mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-22 04:31:58 +08:00
[SCSI] gdth: Convert to use regular kernel types.
converted using this script.. perl -p -i -e 's|ulong32|u32|g' drivers/scsi/gdth* perl -p -i -e 's|ulong64|u64|g' drivers/scsi/gdth* perl -p -i -e 's|ushort|u16|g' drivers/scsi/gdth* perl -p -i -e 's|unchar|u8|g' drivers/scsi/gdth* perl -p -i -e 's|ulong|unsigned long|g' drivers/scsi/gdth* perl -p -i -e 's|PACKED|__attribute__((packed))|g' drivers/scsi/gdth* sha1sum of the generated code was identical before and after. Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
parent
e7efe5932b
commit
1fe6dbf4d0
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -32,109 +32,101 @@
|
|||||||
#define MAX_HDRIVES MAX_LDRIVES /* max. host drive count */
|
#define MAX_HDRIVES MAX_LDRIVES /* max. host drive count */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* typedefs */
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
typedef u32 ulong32;
|
|
||||||
typedef u64 ulong64;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PACKED __attribute__((packed))
|
|
||||||
|
|
||||||
/* scatter/gather element */
|
/* scatter/gather element */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ulong32 sg_ptr; /* address */
|
u32 sg_ptr; /* address */
|
||||||
ulong32 sg_len; /* length */
|
u32 sg_len; /* length */
|
||||||
} PACKED gdth_sg_str;
|
} __attribute__((packed)) gdth_sg_str;
|
||||||
|
|
||||||
/* scatter/gather element - 64bit addresses */
|
/* scatter/gather element - 64bit addresses */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ulong64 sg_ptr; /* address */
|
u64 sg_ptr; /* address */
|
||||||
ulong32 sg_len; /* length */
|
u32 sg_len; /* length */
|
||||||
} PACKED gdth_sg64_str;
|
} __attribute__((packed)) gdth_sg64_str;
|
||||||
|
|
||||||
/* command structure */
|
/* command structure */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ulong32 BoardNode; /* board node (always 0) */
|
u32 BoardNode; /* board node (always 0) */
|
||||||
ulong32 CommandIndex; /* command number */
|
u32 CommandIndex; /* command number */
|
||||||
ushort OpCode; /* the command (READ,..) */
|
u16 OpCode; /* the command (READ,..) */
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
ushort DeviceNo; /* number of cache drive */
|
u16 DeviceNo; /* number of cache drive */
|
||||||
ulong32 BlockNo; /* block number */
|
u32 BlockNo; /* block number */
|
||||||
ulong32 BlockCnt; /* block count */
|
u32 BlockCnt; /* block count */
|
||||||
ulong32 DestAddr; /* dest. addr. (if s/g: -1) */
|
u32 DestAddr; /* dest. addr. (if s/g: -1) */
|
||||||
ulong32 sg_canz; /* s/g element count */
|
u32 sg_canz; /* s/g element count */
|
||||||
gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */
|
gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */
|
||||||
} PACKED cache; /* cache service cmd. str. */
|
} __attribute__((packed)) cache; /* cache service cmd. str. */
|
||||||
struct {
|
struct {
|
||||||
ushort DeviceNo; /* number of cache drive */
|
u16 DeviceNo; /* number of cache drive */
|
||||||
ulong64 BlockNo; /* block number */
|
u64 BlockNo; /* block number */
|
||||||
ulong32 BlockCnt; /* block count */
|
u32 BlockCnt; /* block count */
|
||||||
ulong64 DestAddr; /* dest. addr. (if s/g: -1) */
|
u64 DestAddr; /* dest. addr. (if s/g: -1) */
|
||||||
ulong32 sg_canz; /* s/g element count */
|
u32 sg_canz; /* s/g element count */
|
||||||
gdth_sg64_str sg_lst[GDTH_MAXSG]; /* s/g list */
|
gdth_sg64_str sg_lst[GDTH_MAXSG]; /* s/g list */
|
||||||
} PACKED cache64; /* cache service cmd. str. */
|
} __attribute__((packed)) cache64; /* cache service cmd. str. */
|
||||||
struct {
|
struct {
|
||||||
ushort param_size; /* size of p_param buffer */
|
u16 param_size; /* size of p_param buffer */
|
||||||
ulong32 subfunc; /* IOCTL function */
|
u32 subfunc; /* IOCTL function */
|
||||||
ulong32 channel; /* device */
|
u32 channel; /* device */
|
||||||
ulong64 p_param; /* buffer */
|
u64 p_param; /* buffer */
|
||||||
} PACKED ioctl; /* IOCTL command structure */
|
} __attribute__((packed)) ioctl; /* IOCTL command structure */
|
||||||
struct {
|
struct {
|
||||||
ushort reserved;
|
u16 reserved;
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
ulong32 msg_handle; /* message handle */
|
u32 msg_handle; /* message handle */
|
||||||
ulong64 msg_addr; /* message buffer address */
|
u64 msg_addr; /* message buffer address */
|
||||||
} PACKED msg;
|
} __attribute__((packed)) msg;
|
||||||
unchar data[12]; /* buffer for rtc data, ... */
|
u8 data[12]; /* buffer for rtc data, ... */
|
||||||
} su;
|
} su;
|
||||||
} PACKED screen; /* screen service cmd. str. */
|
} __attribute__((packed)) screen; /* screen service cmd. str. */
|
||||||
struct {
|
struct {
|
||||||
ushort reserved;
|
u16 reserved;
|
||||||
ulong32 direction; /* data direction */
|
u32 direction; /* data direction */
|
||||||
ulong32 mdisc_time; /* disc. time (0: no timeout)*/
|
u32 mdisc_time; /* disc. time (0: no timeout)*/
|
||||||
ulong32 mcon_time; /* connect time(0: no to.) */
|
u32 mcon_time; /* connect time(0: no to.) */
|
||||||
ulong32 sdata; /* dest. addr. (if s/g: -1) */
|
u32 sdata; /* dest. addr. (if s/g: -1) */
|
||||||
ulong32 sdlen; /* data length (bytes) */
|
u32 sdlen; /* data length (bytes) */
|
||||||
ulong32 clen; /* SCSI cmd. length(6,10,12) */
|
u32 clen; /* SCSI cmd. length(6,10,12) */
|
||||||
unchar cmd[12]; /* SCSI command */
|
u8 cmd[12]; /* SCSI command */
|
||||||
unchar target; /* target ID */
|
u8 target; /* target ID */
|
||||||
unchar lun; /* LUN */
|
u8 lun; /* LUN */
|
||||||
unchar bus; /* SCSI bus number */
|
u8 bus; /* SCSI bus number */
|
||||||
unchar priority; /* only 0 used */
|
u8 priority; /* only 0 used */
|
||||||
ulong32 sense_len; /* sense data length */
|
u32 sense_len; /* sense data length */
|
||||||
ulong32 sense_data; /* sense data addr. */
|
u32 sense_data; /* sense data addr. */
|
||||||
ulong32 link_p; /* linked cmds (not supp.) */
|
u32 link_p; /* linked cmds (not supp.) */
|
||||||
ulong32 sg_ranz; /* s/g element count */
|
u32 sg_ranz; /* s/g element count */
|
||||||
gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */
|
gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */
|
||||||
} PACKED raw; /* raw service cmd. struct. */
|
} __attribute__((packed)) raw; /* raw service cmd. struct. */
|
||||||
struct {
|
struct {
|
||||||
ushort reserved;
|
u16 reserved;
|
||||||
ulong32 direction; /* data direction */
|
u32 direction; /* data direction */
|
||||||
ulong32 mdisc_time; /* disc. time (0: no timeout)*/
|
u32 mdisc_time; /* disc. time (0: no timeout)*/
|
||||||
ulong32 mcon_time; /* connect time(0: no to.) */
|
u32 mcon_time; /* connect time(0: no to.) */
|
||||||
ulong64 sdata; /* dest. addr. (if s/g: -1) */
|
u64 sdata; /* dest. addr. (if s/g: -1) */
|
||||||
ulong32 sdlen; /* data length (bytes) */
|
u32 sdlen; /* data length (bytes) */
|
||||||
ulong32 clen; /* SCSI cmd. length(6,..,16) */
|
u32 clen; /* SCSI cmd. length(6,..,16) */
|
||||||
unchar cmd[16]; /* SCSI command */
|
u8 cmd[16]; /* SCSI command */
|
||||||
unchar target; /* target ID */
|
u8 target; /* target ID */
|
||||||
unchar lun; /* LUN */
|
u8 lun; /* LUN */
|
||||||
unchar bus; /* SCSI bus number */
|
u8 bus; /* SCSI bus number */
|
||||||
unchar priority; /* only 0 used */
|
u8 priority; /* only 0 used */
|
||||||
ulong32 sense_len; /* sense data length */
|
u32 sense_len; /* sense data length */
|
||||||
ulong64 sense_data; /* sense data addr. */
|
u64 sense_data; /* sense data addr. */
|
||||||
ulong32 sg_ranz; /* s/g element count */
|
u32 sg_ranz; /* s/g element count */
|
||||||
gdth_sg64_str sg_lst[GDTH_MAXSG]; /* s/g list */
|
gdth_sg64_str sg_lst[GDTH_MAXSG]; /* s/g list */
|
||||||
} PACKED raw64; /* raw service cmd. struct. */
|
} __attribute__((packed)) raw64; /* raw service cmd. struct. */
|
||||||
} u;
|
} u;
|
||||||
/* additional variables */
|
/* additional variables */
|
||||||
unchar Service; /* controller service */
|
u8 Service; /* controller service */
|
||||||
unchar reserved;
|
u8 reserved;
|
||||||
ushort Status; /* command result */
|
u16 Status; /* command result */
|
||||||
ulong32 Info; /* additional information */
|
u32 Info; /* additional information */
|
||||||
void *RequestBuffer; /* request buffer */
|
void *RequestBuffer; /* request buffer */
|
||||||
} PACKED gdth_cmd_str;
|
} __attribute__((packed)) gdth_cmd_str;
|
||||||
|
|
||||||
/* controller event structure */
|
/* controller event structure */
|
||||||
#define ES_ASYNC 1
|
#define ES_ASYNC 1
|
||||||
@ -142,129 +134,129 @@ typedef struct {
|
|||||||
#define ES_TEST 3
|
#define ES_TEST 3
|
||||||
#define ES_SYNC 4
|
#define ES_SYNC 4
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ushort size; /* size of structure */
|
u16 size; /* size of structure */
|
||||||
union {
|
union {
|
||||||
char stream[16];
|
char stream[16];
|
||||||
struct {
|
struct {
|
||||||
ushort ionode;
|
u16 ionode;
|
||||||
ushort service;
|
u16 service;
|
||||||
ulong32 index;
|
u32 index;
|
||||||
} PACKED driver;
|
} __attribute__((packed)) driver;
|
||||||
struct {
|
struct {
|
||||||
ushort ionode;
|
u16 ionode;
|
||||||
ushort service;
|
u16 service;
|
||||||
ushort status;
|
u16 status;
|
||||||
ulong32 info;
|
u32 info;
|
||||||
unchar scsi_coord[3];
|
u8 scsi_coord[3];
|
||||||
} PACKED async;
|
} __attribute__((packed)) async;
|
||||||
struct {
|
struct {
|
||||||
ushort ionode;
|
u16 ionode;
|
||||||
ushort service;
|
u16 service;
|
||||||
ushort status;
|
u16 status;
|
||||||
ulong32 info;
|
u32 info;
|
||||||
ushort hostdrive;
|
u16 hostdrive;
|
||||||
unchar scsi_coord[3];
|
u8 scsi_coord[3];
|
||||||
unchar sense_key;
|
u8 sense_key;
|
||||||
} PACKED sync;
|
} __attribute__((packed)) sync;
|
||||||
struct {
|
struct {
|
||||||
ulong32 l1, l2, l3, l4;
|
u32 l1, l2, l3, l4;
|
||||||
} PACKED test;
|
} __attribute__((packed)) test;
|
||||||
} eu;
|
} eu;
|
||||||
ulong32 severity;
|
u32 severity;
|
||||||
unchar event_string[256];
|
u8 event_string[256];
|
||||||
} PACKED gdth_evt_data;
|
} __attribute__((packed)) gdth_evt_data;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ulong32 first_stamp;
|
u32 first_stamp;
|
||||||
ulong32 last_stamp;
|
u32 last_stamp;
|
||||||
ushort same_count;
|
u16 same_count;
|
||||||
ushort event_source;
|
u16 event_source;
|
||||||
ushort event_idx;
|
u16 event_idx;
|
||||||
unchar application;
|
u8 application;
|
||||||
unchar reserved;
|
u8 reserved;
|
||||||
gdth_evt_data event_data;
|
gdth_evt_data event_data;
|
||||||
} PACKED gdth_evt_str;
|
} __attribute__((packed)) gdth_evt_str;
|
||||||
|
|
||||||
|
|
||||||
#ifdef GDTH_IOCTL_PROC
|
#ifdef GDTH_IOCTL_PROC
|
||||||
/* IOCTL structure (write) */
|
/* IOCTL structure (write) */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ulong32 magic; /* IOCTL magic */
|
u32 magic; /* IOCTL magic */
|
||||||
ushort ioctl; /* IOCTL */
|
u16 ioctl; /* IOCTL */
|
||||||
ushort ionode; /* controller number */
|
u16 ionode; /* controller number */
|
||||||
ushort service; /* controller service */
|
u16 service; /* controller service */
|
||||||
ushort timeout; /* timeout */
|
u16 timeout; /* timeout */
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
unchar command[512]; /* controller command */
|
u8 command[512]; /* controller command */
|
||||||
unchar data[1]; /* add. data */
|
u8 data[1]; /* add. data */
|
||||||
} general;
|
} general;
|
||||||
struct {
|
struct {
|
||||||
unchar lock; /* lock/unlock */
|
u8 lock; /* lock/unlock */
|
||||||
unchar drive_cnt; /* drive count */
|
u8 drive_cnt; /* drive count */
|
||||||
ushort drives[MAX_HDRIVES];/* drives */
|
u16 drives[MAX_HDRIVES];/* drives */
|
||||||
} lockdrv;
|
} lockdrv;
|
||||||
struct {
|
struct {
|
||||||
unchar lock; /* lock/unlock */
|
u8 lock; /* lock/unlock */
|
||||||
unchar channel; /* channel */
|
u8 channel; /* channel */
|
||||||
} lockchn;
|
} lockchn;
|
||||||
struct {
|
struct {
|
||||||
int erase; /* erase event ? */
|
int erase; /* erase event ? */
|
||||||
int handle;
|
int handle;
|
||||||
unchar evt[EVENT_SIZE]; /* event structure */
|
u8 evt[EVENT_SIZE]; /* event structure */
|
||||||
} event;
|
} event;
|
||||||
struct {
|
struct {
|
||||||
unchar bus; /* SCSI bus */
|
u8 bus; /* SCSI bus */
|
||||||
unchar target; /* target ID */
|
u8 target; /* target ID */
|
||||||
unchar lun; /* LUN */
|
u8 lun; /* LUN */
|
||||||
unchar cmd_len; /* command length */
|
u8 cmd_len; /* command length */
|
||||||
unchar cmd[12]; /* SCSI command */
|
u8 cmd[12]; /* SCSI command */
|
||||||
} scsi;
|
} scsi;
|
||||||
struct {
|
struct {
|
||||||
ushort hdr_no; /* host drive number */
|
u16 hdr_no; /* host drive number */
|
||||||
unchar flag; /* old meth./add/remove */
|
u8 flag; /* old meth./add/remove */
|
||||||
} rescan;
|
} rescan;
|
||||||
} iu;
|
} iu;
|
||||||
} gdth_iowr_str;
|
} gdth_iowr_str;
|
||||||
|
|
||||||
/* IOCTL structure (read) */
|
/* IOCTL structure (read) */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ulong32 size; /* buffer size */
|
u32 size; /* buffer size */
|
||||||
ulong32 status; /* IOCTL error code */
|
u32 status; /* IOCTL error code */
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
unchar data[1]; /* data */
|
u8 data[1]; /* data */
|
||||||
} general;
|
} general;
|
||||||
struct {
|
struct {
|
||||||
ushort version; /* driver version */
|
u16 version; /* driver version */
|
||||||
} drvers;
|
} drvers;
|
||||||
struct {
|
struct {
|
||||||
unchar type; /* controller type */
|
u8 type; /* controller type */
|
||||||
ushort info; /* slot etc. */
|
u16 info; /* slot etc. */
|
||||||
ushort oem_id; /* OEM ID */
|
u16 oem_id; /* OEM ID */
|
||||||
ushort bios_ver; /* not used */
|
u16 bios_ver; /* not used */
|
||||||
ushort access; /* not used */
|
u16 access; /* not used */
|
||||||
ushort ext_type; /* extended type */
|
u16 ext_type; /* extended type */
|
||||||
ushort device_id; /* device ID */
|
u16 device_id; /* device ID */
|
||||||
ushort sub_device_id; /* sub device ID */
|
u16 sub_device_id; /* sub device ID */
|
||||||
} ctrtype;
|
} ctrtype;
|
||||||
struct {
|
struct {
|
||||||
unchar version; /* OS version */
|
u8 version; /* OS version */
|
||||||
unchar subversion; /* OS subversion */
|
u8 subversion; /* OS subversion */
|
||||||
ushort revision; /* revision */
|
u16 revision; /* revision */
|
||||||
} osvers;
|
} osvers;
|
||||||
struct {
|
struct {
|
||||||
ushort count; /* controller count */
|
u16 count; /* controller count */
|
||||||
} ctrcnt;
|
} ctrcnt;
|
||||||
struct {
|
struct {
|
||||||
int handle;
|
int handle;
|
||||||
unchar evt[EVENT_SIZE]; /* event structure */
|
u8 evt[EVENT_SIZE]; /* event structure */
|
||||||
} event;
|
} event;
|
||||||
struct {
|
struct {
|
||||||
unchar bus; /* SCSI bus, 0xff: invalid */
|
u8 bus; /* SCSI bus, 0xff: invalid */
|
||||||
unchar target; /* target ID */
|
u8 target; /* target ID */
|
||||||
unchar lun; /* LUN */
|
u8 lun; /* LUN */
|
||||||
unchar cluster_type; /* cluster properties */
|
u8 cluster_type; /* cluster properties */
|
||||||
} hdr_list[MAX_HDRIVES]; /* index is host drive number */
|
} hdr_list[MAX_HDRIVES]; /* index is host drive number */
|
||||||
} iu;
|
} iu;
|
||||||
} gdth_iord_str;
|
} gdth_iord_str;
|
||||||
@ -272,53 +264,53 @@ typedef struct {
|
|||||||
|
|
||||||
/* GDTIOCTL_GENERAL */
|
/* GDTIOCTL_GENERAL */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ushort ionode; /* controller number */
|
u16 ionode; /* controller number */
|
||||||
ushort timeout; /* timeout */
|
u16 timeout; /* timeout */
|
||||||
ulong32 info; /* error info */
|
u32 info; /* error info */
|
||||||
ushort status; /* status */
|
u16 status; /* status */
|
||||||
ulong data_len; /* data buffer size */
|
unsigned long data_len; /* data buffer size */
|
||||||
ulong sense_len; /* sense buffer size */
|
unsigned long sense_len; /* sense buffer size */
|
||||||
gdth_cmd_str command; /* command */
|
gdth_cmd_str command; /* command */
|
||||||
} gdth_ioctl_general;
|
} gdth_ioctl_general;
|
||||||
|
|
||||||
/* GDTIOCTL_LOCKDRV */
|
/* GDTIOCTL_LOCKDRV */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ushort ionode; /* controller number */
|
u16 ionode; /* controller number */
|
||||||
unchar lock; /* lock/unlock */
|
u8 lock; /* lock/unlock */
|
||||||
unchar drive_cnt; /* drive count */
|
u8 drive_cnt; /* drive count */
|
||||||
ushort drives[MAX_HDRIVES]; /* drives */
|
u16 drives[MAX_HDRIVES]; /* drives */
|
||||||
} gdth_ioctl_lockdrv;
|
} gdth_ioctl_lockdrv;
|
||||||
|
|
||||||
/* GDTIOCTL_LOCKCHN */
|
/* GDTIOCTL_LOCKCHN */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ushort ionode; /* controller number */
|
u16 ionode; /* controller number */
|
||||||
unchar lock; /* lock/unlock */
|
u8 lock; /* lock/unlock */
|
||||||
unchar channel; /* channel */
|
u8 channel; /* channel */
|
||||||
} gdth_ioctl_lockchn;
|
} gdth_ioctl_lockchn;
|
||||||
|
|
||||||
/* GDTIOCTL_OSVERS */
|
/* GDTIOCTL_OSVERS */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unchar version; /* OS version */
|
u8 version; /* OS version */
|
||||||
unchar subversion; /* OS subversion */
|
u8 subversion; /* OS subversion */
|
||||||
ushort revision; /* revision */
|
u16 revision; /* revision */
|
||||||
} gdth_ioctl_osvers;
|
} gdth_ioctl_osvers;
|
||||||
|
|
||||||
/* GDTIOCTL_CTRTYPE */
|
/* GDTIOCTL_CTRTYPE */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ushort ionode; /* controller number */
|
u16 ionode; /* controller number */
|
||||||
unchar type; /* controller type */
|
u8 type; /* controller type */
|
||||||
ushort info; /* slot etc. */
|
u16 info; /* slot etc. */
|
||||||
ushort oem_id; /* OEM ID */
|
u16 oem_id; /* OEM ID */
|
||||||
ushort bios_ver; /* not used */
|
u16 bios_ver; /* not used */
|
||||||
ushort access; /* not used */
|
u16 access; /* not used */
|
||||||
ushort ext_type; /* extended type */
|
u16 ext_type; /* extended type */
|
||||||
ushort device_id; /* device ID */
|
u16 device_id; /* device ID */
|
||||||
ushort sub_device_id; /* sub device ID */
|
u16 sub_device_id; /* sub device ID */
|
||||||
} gdth_ioctl_ctrtype;
|
} gdth_ioctl_ctrtype;
|
||||||
|
|
||||||
/* GDTIOCTL_EVENT */
|
/* GDTIOCTL_EVENT */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ushort ionode;
|
u16 ionode;
|
||||||
int erase; /* erase event? */
|
int erase; /* erase event? */
|
||||||
int handle; /* event handle */
|
int handle; /* event handle */
|
||||||
gdth_evt_str event;
|
gdth_evt_str event;
|
||||||
@ -326,22 +318,22 @@ typedef struct {
|
|||||||
|
|
||||||
/* GDTIOCTL_RESCAN/GDTIOCTL_HDRLIST */
|
/* GDTIOCTL_RESCAN/GDTIOCTL_HDRLIST */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ushort ionode; /* controller number */
|
u16 ionode; /* controller number */
|
||||||
unchar flag; /* add/remove */
|
u8 flag; /* add/remove */
|
||||||
ushort hdr_no; /* drive no. */
|
u16 hdr_no; /* drive no. */
|
||||||
struct {
|
struct {
|
||||||
unchar bus; /* SCSI bus */
|
u8 bus; /* SCSI bus */
|
||||||
unchar target; /* target ID */
|
u8 target; /* target ID */
|
||||||
unchar lun; /* LUN */
|
u8 lun; /* LUN */
|
||||||
unchar cluster_type; /* cluster properties */
|
u8 cluster_type; /* cluster properties */
|
||||||
} hdr_list[MAX_HDRIVES]; /* index is host drive number */
|
} hdr_list[MAX_HDRIVES]; /* index is host drive number */
|
||||||
} gdth_ioctl_rescan;
|
} gdth_ioctl_rescan;
|
||||||
|
|
||||||
/* GDTIOCTL_RESET_BUS/GDTIOCTL_RESET_DRV */
|
/* GDTIOCTL_RESET_BUS/GDTIOCTL_RESET_DRV */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ushort ionode; /* controller number */
|
u16 ionode; /* controller number */
|
||||||
ushort number; /* bus/host drive number */
|
u16 number; /* bus/host drive number */
|
||||||
ushort status; /* status */
|
u16 status; /* status */
|
||||||
} gdth_ioctl_reset;
|
} gdth_ioctl_reset;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -43,7 +43,7 @@ static int gdth_set_asc_info(struct Scsi_Host *host, char *buffer,
|
|||||||
int i, found;
|
int i, found;
|
||||||
gdth_cmd_str gdtcmd;
|
gdth_cmd_str gdtcmd;
|
||||||
gdth_cpar_str *pcpar;
|
gdth_cpar_str *pcpar;
|
||||||
ulong64 paddr;
|
u64 paddr;
|
||||||
|
|
||||||
char cmnd[MAX_COMMAND_SIZE];
|
char cmnd[MAX_COMMAND_SIZE];
|
||||||
memset(cmnd, 0xff, 12);
|
memset(cmnd, 0xff, 12);
|
||||||
@ -156,8 +156,8 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
|
|||||||
off_t begin = 0,pos = 0;
|
off_t begin = 0,pos = 0;
|
||||||
int id, i, j, k, sec, flag;
|
int id, i, j, k, sec, flag;
|
||||||
int no_mdrv = 0, drv_no, is_mirr;
|
int no_mdrv = 0, drv_no, is_mirr;
|
||||||
ulong32 cnt;
|
u32 cnt;
|
||||||
ulong64 paddr;
|
u64 paddr;
|
||||||
int rc = -ENOMEM;
|
int rc = -ENOMEM;
|
||||||
|
|
||||||
gdth_cmd_str *gdtcmd;
|
gdth_cmd_str *gdtcmd;
|
||||||
@ -220,14 +220,14 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
|
|||||||
|
|
||||||
if (ha->more_proc)
|
if (ha->more_proc)
|
||||||
sprintf(hrec, "%d.%02d.%02d-%c%03X",
|
sprintf(hrec, "%d.%02d.%02d-%c%03X",
|
||||||
(unchar)(ha->binfo.upd_fw_ver>>24),
|
(u8)(ha->binfo.upd_fw_ver>>24),
|
||||||
(unchar)(ha->binfo.upd_fw_ver>>16),
|
(u8)(ha->binfo.upd_fw_ver>>16),
|
||||||
(unchar)(ha->binfo.upd_fw_ver),
|
(u8)(ha->binfo.upd_fw_ver),
|
||||||
ha->bfeat.raid ? 'R':'N',
|
ha->bfeat.raid ? 'R':'N',
|
||||||
ha->binfo.upd_revision);
|
ha->binfo.upd_revision);
|
||||||
else
|
else
|
||||||
sprintf(hrec, "%d.%02d", (unchar)(ha->cpar.version>>8),
|
sprintf(hrec, "%d.%02d", (u8)(ha->cpar.version>>8),
|
||||||
(unchar)(ha->cpar.version));
|
(u8)(ha->cpar.version));
|
||||||
|
|
||||||
size = sprintf(buffer+len,
|
size = sprintf(buffer+len,
|
||||||
" Driver Ver.: \t%-10s\tFirmware Ver.: \t%s\n",
|
" Driver Ver.: \t%-10s\tFirmware Ver.: \t%s\n",
|
||||||
@ -281,7 +281,7 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
|
|||||||
pds->bid = ha->raw[i].local_no;
|
pds->bid = ha->raw[i].local_no;
|
||||||
pds->first = 0;
|
pds->first = 0;
|
||||||
pds->entries = ha->raw[i].pdev_cnt;
|
pds->entries = ha->raw[i].pdev_cnt;
|
||||||
cnt = (3*GDTH_SCRATCH/4 - 5 * sizeof(ulong32)) /
|
cnt = (3*GDTH_SCRATCH/4 - 5 * sizeof(u32)) /
|
||||||
sizeof(pds->list[0]);
|
sizeof(pds->list[0]);
|
||||||
if (pds->entries > cnt)
|
if (pds->entries > cnt)
|
||||||
pds->entries = cnt;
|
pds->entries = cnt;
|
||||||
@ -604,7 +604,7 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
|
|||||||
|
|
||||||
size = sprintf(buffer+len,
|
size = sprintf(buffer+len,
|
||||||
" Capacity [MB]:\t%-6d \tStart Sector: \t%d\n",
|
" Capacity [MB]:\t%-6d \tStart Sector: \t%d\n",
|
||||||
(ulong32)(ha->hdr[i].size/2048), ha->hdr[i].start_sec);
|
(u32)(ha->hdr[i].size/2048), ha->hdr[i].start_sec);
|
||||||
len += size; pos = begin + len;
|
len += size; pos = begin + len;
|
||||||
if (pos < offset) {
|
if (pos < offset) {
|
||||||
len = 0;
|
len = 0;
|
||||||
@ -664,9 +664,9 @@ free_fail:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *gdth_ioctl_alloc(gdth_ha_str *ha, int size, int scratch,
|
static char *gdth_ioctl_alloc(gdth_ha_str *ha, int size, int scratch,
|
||||||
ulong64 *paddr)
|
u64 *paddr)
|
||||||
{
|
{
|
||||||
ulong flags;
|
unsigned long flags;
|
||||||
char *ret_val;
|
char *ret_val;
|
||||||
|
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
@ -691,9 +691,9 @@ static char *gdth_ioctl_alloc(gdth_ha_str *ha, int size, int scratch,
|
|||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr)
|
static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, u64 paddr)
|
||||||
{
|
{
|
||||||
ulong flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (buf == ha->pscratch) {
|
if (buf == ha->pscratch) {
|
||||||
spin_lock_irqsave(&ha->smp_lock, flags);
|
spin_lock_irqsave(&ha->smp_lock, flags);
|
||||||
@ -705,16 +705,16 @@ static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GDTH_IOCTL_PROC
|
#ifdef GDTH_IOCTL_PROC
|
||||||
static int gdth_ioctl_check_bin(gdth_ha_str *ha, ushort size)
|
static int gdth_ioctl_check_bin(gdth_ha_str *ha, u16 size)
|
||||||
{
|
{
|
||||||
ulong flags;
|
unsigned long flags;
|
||||||
int ret_val;
|
int ret_val;
|
||||||
|
|
||||||
spin_lock_irqsave(&ha->smp_lock, flags);
|
spin_lock_irqsave(&ha->smp_lock, flags);
|
||||||
|
|
||||||
ret_val = FALSE;
|
ret_val = FALSE;
|
||||||
if (ha->scratch_busy) {
|
if (ha->scratch_busy) {
|
||||||
if (((gdth_iord_str *)ha->pscratch)->size == (ulong32)size)
|
if (((gdth_iord_str *)ha->pscratch)->size == (u32)size)
|
||||||
ret_val = TRUE;
|
ret_val = TRUE;
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&ha->smp_lock, flags);
|
spin_unlock_irqrestore(&ha->smp_lock, flags);
|
||||||
@ -724,11 +724,11 @@ static int gdth_ioctl_check_bin(gdth_ha_str *ha, ushort size)
|
|||||||
|
|
||||||
static void gdth_wait_completion(gdth_ha_str *ha, int busnum, int id)
|
static void gdth_wait_completion(gdth_ha_str *ha, int busnum, int id)
|
||||||
{
|
{
|
||||||
ulong flags;
|
unsigned long flags;
|
||||||
int i;
|
int i;
|
||||||
Scsi_Cmnd *scp;
|
Scsi_Cmnd *scp;
|
||||||
struct gdth_cmndinfo *cmndinfo;
|
struct gdth_cmndinfo *cmndinfo;
|
||||||
unchar b, t;
|
u8 b, t;
|
||||||
|
|
||||||
spin_lock_irqsave(&ha->smp_lock, flags);
|
spin_lock_irqsave(&ha->smp_lock, flags);
|
||||||
|
|
||||||
@ -738,8 +738,8 @@ static void gdth_wait_completion(gdth_ha_str *ha, int busnum, int id)
|
|||||||
|
|
||||||
b = scp->device->channel;
|
b = scp->device->channel;
|
||||||
t = scp->device->id;
|
t = scp->device->id;
|
||||||
if (!SPECIAL_SCP(scp) && t == (unchar)id &&
|
if (!SPECIAL_SCP(scp) && t == (u8)id &&
|
||||||
b == (unchar)busnum) {
|
b == (u8)busnum) {
|
||||||
cmndinfo->wait_for_completion = 0;
|
cmndinfo->wait_for_completion = 0;
|
||||||
spin_unlock_irqrestore(&ha->smp_lock, flags);
|
spin_unlock_irqrestore(&ha->smp_lock, flags);
|
||||||
while (!cmndinfo->wait_for_completion)
|
while (!cmndinfo->wait_for_completion)
|
||||||
|
@ -17,8 +17,8 @@ static int gdth_set_asc_info(struct Scsi_Host *host, char *buffer,
|
|||||||
int length, gdth_ha_str *ha);
|
int length, gdth_ha_str *ha);
|
||||||
|
|
||||||
static char *gdth_ioctl_alloc(gdth_ha_str *ha, int size, int scratch,
|
static char *gdth_ioctl_alloc(gdth_ha_str *ha, int size, int scratch,
|
||||||
ulong64 *paddr);
|
u64 *paddr);
|
||||||
static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr);
|
static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, u64 paddr);
|
||||||
static void gdth_wait_completion(gdth_ha_str *ha, int busnum, int id);
|
static void gdth_wait_completion(gdth_ha_str *ha, int busnum, int id);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user