Commit c83b4e61 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] gdth update from Intel

parent 8c8373b4
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
#define _GDTH_IOCTL_H
/* gdth_ioctl.h
* $Id: gdth_ioctl.h,v 1.10 2001/05/22 06:28:59 achim Exp $
* $Id: gdth_ioctl.h,v 1.11 2003/02/27 14:59:03 achim Exp $
*/
/* IOCTLs */
......@@ -23,8 +23,136 @@
#define GDTIOCTL_MAGIC 0xaffe0004
#define EVENT_SIZE 294
#define MAX_HDRIVES 100
#define GDTH_MAXSG 32 /* max. s/g elements */
#define MAX_LDRIVES 255 /* max. log. drive count */
#ifdef GDTH_IOCTL_PROC
#define MAX_HDRIVES 100 /* max. host drive count */
#else
#define MAX_HDRIVES MAX_LDRIVES /* max. host drive count */
#endif
/* typedefs */
#ifdef __KERNEL__
typedef u32 ulong32;
#endif
#define PACKED __attribute__((packed))
/* scatter/gather element */
typedef struct {
ulong32 sg_ptr; /* address */
ulong32 sg_len; /* length */
} PACKED gdth_sg_str;
/* command structure */
typedef struct {
ulong32 BoardNode; /* board node (always 0) */
ulong32 CommandIndex; /* command number */
ushort OpCode; /* the command (READ,..) */
union {
struct {
ushort DeviceNo; /* number of cache drive */
ulong32 BlockNo; /* block number */
ulong32 BlockCnt; /* block count */
ulong32 DestAddr; /* dest. addr. (if s/g: -1) */
ulong32 sg_canz; /* s/g element count */
gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */
} PACKED cache; /* cache service cmd. str. */
struct {
ushort param_size; /* size of p_param buffer */
ulong32 subfunc; /* IOCTL function */
ulong32 channel; /* device */
ulong32 p_param; /* buffer */
} PACKED ioctl; /* IOCTL command structure */
struct {
ushort reserved;
union {
struct {
ulong32 msg_handle; /* message handle */
ulong32 msg_addr; /* message buffer address */
} PACKED msg;
unchar data[12]; /* buffer for rtc data, ... */
} su;
} PACKED screen; /* screen service cmd. str. */
struct {
ushort reserved;
ulong32 direction; /* data direction */
ulong32 mdisc_time; /* disc. time (0: no timeout)*/
ulong32 mcon_time; /* connect time(0: no to.) */
ulong32 sdata; /* dest. addr. (if s/g: -1) */
ulong32 sdlen; /* data length (bytes) */
ulong32 clen; /* SCSI cmd. length(6,10,12) */
unchar cmd[12]; /* SCSI command */
unchar target; /* target ID */
unchar lun; /* LUN */
unchar bus; /* SCSI bus number */
unchar priority; /* only 0 used */
ulong32 sense_len; /* sense data length */
ulong32 sense_data; /* sense data addr. */
ulong32 link_p; /* linked cmds (not supp.) */
ulong32 sg_ranz; /* s/g element count */
gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */
} PACKED raw; /* raw service cmd. struct. */
} u;
/* additional variables */
unchar Service; /* controller service */
unchar reserved;
ushort Status; /* command result */
ulong32 Info; /* additional information */
void *RequestBuffer; /* request buffer */
} PACKED gdth_cmd_str;
/* controller event structure */
#define ES_ASYNC 1
#define ES_DRIVER 2
#define ES_TEST 3
#define ES_SYNC 4
typedef struct {
ushort size; /* size of structure */
union {
char stream[16];
struct {
ushort ionode;
ushort service;
ulong32 index;
} PACKED driver;
struct {
ushort ionode;
ushort service;
ushort status;
ulong32 info;
unchar scsi_coord[3];
} PACKED async;
struct {
ushort ionode;
ushort service;
ushort status;
ulong32 info;
ushort hostdrive;
unchar scsi_coord[3];
unchar sense_key;
} PACKED sync;
struct {
ulong32 l1, l2, l3, l4;
} PACKED test;
} eu;
ulong32 severity;
unchar event_string[256];
} PACKED gdth_evt_data;
typedef struct {
ulong32 first_stamp;
ulong32 last_stamp;
ushort same_count;
ushort event_source;
ushort event_idx;
unchar application;
unchar reserved;
gdth_evt_data event_data;
} PACKED gdth_evt_str;
#ifdef GDTH_IOCTL_PROC
/* IOCTL structure (write) */
typedef struct {
ulong32 magic; /* IOCTL magic */
......@@ -106,7 +234,82 @@ typedef struct {
} hdr_list[MAX_HDRIVES]; /* index is host drive number */
} iu;
} gdth_iord_str;
#endif
#ifdef GDTH_IOCTL_CHRDEV
/* GDTIOCTL_GENERAL */
typedef struct {
ushort ionode; /* controller number */
ushort timeout; /* timeout */
ulong32 info; /* error info */
ushort status; /* status */
ulong data_len; /* data buffer size */
ulong sense_len; /* sense buffer size */
gdth_cmd_str command; /* command */
} gdth_ioctl_general;
/* GDTIOCTL_LOCKDRV */
typedef struct {
ushort ionode; /* controller number */
unchar lock; /* lock/unlock */
unchar drive_cnt; /* drive count */
ushort drives[MAX_HDRIVES]; /* drives */
} gdth_ioctl_lockdrv;
/* GDTIOCTL_LOCKCHN */
typedef struct {
ushort ionode; /* controller number */
unchar lock; /* lock/unlock */
unchar channel; /* channel */
} gdth_ioctl_lockchn;
/* GDTIOCTL_OSVERS */
typedef struct {
unchar version; /* OS version */
unchar subversion; /* OS subversion */
ushort revision; /* revision */
} gdth_ioctl_osvers;
/* GDTIOCTL_CTRTYPE */
typedef struct {
ushort ionode; /* controller number */
unchar type; /* controller type */
ushort info; /* slot etc. */
ushort oem_id; /* OEM ID */
ushort bios_ver; /* not used */
ushort access; /* not used */
ushort ext_type; /* extended type */
ushort device_id; /* device ID */
ushort sub_device_id; /* sub device ID */
} gdth_ioctl_ctrtype;
/* GDTIOCTL_EVENT */
typedef struct {
ushort ionode;
int erase; /* erase event? */
int handle; /* event handle */
gdth_evt_str event;
} gdth_ioctl_event;
/* GDTIOCTL_RESCAN/GDTIOCTL_HDRLIST */
typedef struct {
ushort ionode; /* controller number */
unchar flag; /* add/remove */
ushort hdr_no; /* drive no. */
struct {
unchar bus; /* SCSI bus */
unchar target; /* target ID */
unchar lun; /* LUN */
unchar cluster_type; /* cluster properties */
} hdr_list[MAX_HDRIVES]; /* index is host drive number */
} gdth_ioctl_rescan;
/* GDTIOCTL_RESET_BUS/GDTIOCTL_RESET_DRV */
typedef struct {
ushort ionode; /* controller number */
ushort number; /* bus/host drive number */
ushort status; /* status */
} gdth_ioctl_reset;
#endif
#endif
This diff is collapsed.
......@@ -2,26 +2,42 @@
#define _GDTH_PROC_H
/* gdth_proc.h
* $Id: gdth_proc.h,v 1.11 2001/07/25 15:37:40 achim Exp $
* $Id: gdth_proc.h,v 1.13 2003/02/27 14:59:25 achim Exp $
*/
static int gdth_set_info(char *buffer,int length,int vh,int hanum,int busnum);
static int gdth_get_info(char *buffer,char **start,off_t offset,
int length,int vh,int hanum,int busnum);
#if LINUX_VERSION_CODE >= 0x020322
#if LINUX_VERSION_CODE >= 0x020503
static void gdth_do_req(Scsi_Request *srp, gdth_cmd_str *cmd,
char *cmnd, int timeout);
static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Request *scp);
#ifdef GDTH_IOCTL_PROC
static int gdth_set_bin_info(char *buffer,int length,int hanum,Scsi_Request *scp);
#endif
#elif LINUX_VERSION_CODE >= 0x020322
static void gdth_do_cmd(Scsi_Cmnd *scp, gdth_cmd_str *cmd,
char *cmnd, int timeout);
static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd *scp);
#ifdef GDTH_IOCTL_PROC
static int gdth_set_bin_info(char *buffer,int length,int hanum,Scsi_Cmnd *scp);
#endif
#else
static void gdth_do_cmd(Scsi_Cmnd *scp, gdth_cmd_str *cmd,
char *cmnd, int timeout);
static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd scp);
#ifdef GDTH_IOCTL_PROC
static int gdth_set_bin_info(char *buffer,int length,int hanum,Scsi_Cmnd scp);
#endif
static void gdth_do_cmd(Scsi_Cmnd *scp, gdth_cmd_str *cmd,
char *cmnd, int timeout);
#endif
static char *gdth_ioctl_alloc(int hanum, ushort size, int scratch);
static void gdth_ioctl_free(int hanum, char *buf);
static char *gdth_ioctl_alloc(int hanum, int size, int scratch,
ulong32 *paddr);
static void gdth_ioctl_free(int hanum, int size, char *buf, ulong32 paddr);
#ifdef GDTH_IOCTL_PROC
static int gdth_ioctl_check_bin(int hanum, ushort size);
#endif
static void gdth_wait_completion(int hanum, int busnum, int id);
static void gdth_stop_timeout(int hanum, int busnum, int id);
static void gdth_start_timeout(int hanum, int busnum, int id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment