Skip to content
Snippets Groups Projects
Commit d160ff57 authored by ballen4705's avatar ballen4705
Browse files

Modified Makefile and header files slightly so we can build against kernel

header include files instead of system header files.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@76 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent e74cce16
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
#
# Home page: http://smartmontools.sourceforge.net
#
# $Id: Makefile,v 1.19 2002/10/20 19:40:23 ballen4705 Exp $
# $Id: Makefile,v 1.20 2002/10/22 08:43:22 ballen4705 Exp $
#
# Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
#
......@@ -21,7 +21,14 @@
# California, Santa Cruz. http://ssrc.soe.ucsc.edu/
CC = gcc
# Debugging
# CFLAGS = -fsigned-char -Wall -g
# Build against kernel header files. Change linux-2.4 to correct path for your system
# CFLAGS = -fsigned-char -Wall -O2 -I./usr/src/linux-2.4/include
# Normal build
CFLAGS = -fsigned-char -Wall -O2
releasefiles=atacmds.c atacmds.h ataprint.c ataprint.h CHANGELOG COPYING extern.h Makefile\
......
// $Id: atacmds.c,v 1.14 2002/10/21 16:11:58 ballen4705 Exp $
// $Id: atacmds.c,v 1.15 2002/10/22 08:43:22 ballen4705 Exp $
/*
* atacmds.c
*
......@@ -144,6 +144,7 @@ int ataReadHDIdentity ( int device, struct hd_driveid *buf){
// Reads current Device Identity info (512 bytes) into buf
int ataReadHDIdentity (int device, struct hd_driveid *buf){
unsigned short driveidchecksum;
unsigned char parms[HDIO_DRIVE_CMD_HDR_SIZE+sizeof(*buf)]=
{WIN_IDENTIFY, 0, 0, 1,};
......@@ -163,7 +164,15 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){
// It should say: short words160_255[96]. I have written to Andre
// Hedrick about this on Oct 17 2002. Please remove this comment
// once the fix has made it into the stock kernel tree.
if ((buf->words160_255[95] & 0x00ff) == 0x00a5){
// The following ifdef is a HACK to distinguish different versions
// of the header file defining hd_driveid
#ifdef CFA_REQ_EXT_ERROR_CODE
driveidchecksum=buf->integrity_word;
#else
driveidchecksum=buf->words160_255[95];
#endif
if ((driveidchecksum & 0x00ff) == 0x00a5){
// Device identity structure contains a checksum
unsigned char cksum=0;
int i;
......
// $Id: atacmds.cpp,v 1.14 2002/10/21 16:11:58 ballen4705 Exp $
// $Id: atacmds.cpp,v 1.15 2002/10/22 08:43:22 ballen4705 Exp $
/*
* atacmds.c
*
......@@ -144,6 +144,7 @@ int ataReadHDIdentity ( int device, struct hd_driveid *buf){
// Reads current Device Identity info (512 bytes) into buf
int ataReadHDIdentity (int device, struct hd_driveid *buf){
unsigned short driveidchecksum;
unsigned char parms[HDIO_DRIVE_CMD_HDR_SIZE+sizeof(*buf)]=
{WIN_IDENTIFY, 0, 0, 1,};
......@@ -163,7 +164,15 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){
// It should say: short words160_255[96]. I have written to Andre
// Hedrick about this on Oct 17 2002. Please remove this comment
// once the fix has made it into the stock kernel tree.
if ((buf->words160_255[95] & 0x00ff) == 0x00a5){
// The following ifdef is a HACK to distinguish different versions
// of the header file defining hd_driveid
#ifdef CFA_REQ_EXT_ERROR_CODE
driveidchecksum=buf->integrity_word;
#else
driveidchecksum=buf->words160_255[95];
#endif
if ((driveidchecksum & 0x00ff) == 0x00a5){
// Device identity structure contains a checksum
unsigned char cksum=0;
int i;
......
// $Id: scsicmds.c,v 1.7 2002/10/15 14:24:27 ballen4705 Exp $
// $Id: scsicmds.c,v 1.8 2002/10/22 08:43:22 ballen4705 Exp $
/*
* scsicmds.c
......@@ -30,6 +30,8 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/hdreg.h>
// We do NOT want to include the kernel SCSI header file, just user space one
#define _LINUX_SCSI_H
#include <scsi/scsi.h>
#include "scsicmds.h"
......
// $Id: scsicmds.cpp,v 1.7 2002/10/15 14:24:27 ballen4705 Exp $
// $Id: scsicmds.cpp,v 1.8 2002/10/22 08:43:22 ballen4705 Exp $
/*
* scsicmds.c
......@@ -30,6 +30,8 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/hdreg.h>
// We do NOT want to include the kernel SCSI header file, just user space one
#define _LINUX_SCSI_H
#include <scsi/scsi.h>
#include "scsicmds.h"
......
// $Id: scsicmds.h,v 1.5 2002/10/15 14:24:27 ballen4705 Exp $
// $Id: scsicmds.h,v 1.6 2002/10/22 08:43:22 ballen4705 Exp $
/*
* scsicmds.h
*
......@@ -28,6 +28,38 @@
#define SCSICMDS_H_
#ifndef LOG_SENSE
#define LOG_SENSE 0x4d
#endif
#ifndef MODE_SENSE
#define MODE_SENSE 0x1a
#endif
#ifndef MODE_SELECT
#define MODE_SELECT 0x15
#endif
#ifndef MODE_SELECT_10
#define MODE_SELECT_10 0x55
#endif
#ifndef INQUIRY
#define INQUIRY 0x12
#endif
#ifndef REQUEST_SENSE
#define REQUEST_SENSE 0x03
#endif
#ifndef RECEIVE_DIAGNOSTIC
#define RECEIVE_DIAGNOSTIC 0x1c
#endif
#ifndef SEND_DIAGNOSTIC
#define SEND_DIAGNOSTIC 0x1d
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment