Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01a02ffc authored by Stephen M. Cameron's avatar Stephen M. Cameron Committed by James Bottomley
Browse files

[SCSI] hpsa: Use kernel integer types, not userland ones



That is, use u64, u32, u16 and u8 rather than __u64, __u32, __u16 and __u8.

Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 466dc224
Loading
Loading
Loading
Loading
+45 −45
Original line number Original line Diff line number Diff line
@@ -126,8 +126,8 @@ static void cmd_free(struct ctlr_info *h, struct CommandList *c);
static void cmd_special_free(struct ctlr_info *h, struct CommandList *c);
static void cmd_special_free(struct ctlr_info *h, struct CommandList *c);
static struct CommandList *cmd_alloc(struct ctlr_info *h);
static struct CommandList *cmd_alloc(struct ctlr_info *h);
static struct CommandList *cmd_special_alloc(struct ctlr_info *h);
static struct CommandList *cmd_special_alloc(struct ctlr_info *h);
static void fill_cmd(struct CommandList *c, __u8 cmd, struct ctlr_info *h,
static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h,
	void *buff, size_t size, __u8 page_code, unsigned char *scsi3addr,
	void *buff, size_t size, u8 page_code, unsigned char *scsi3addr,
	int cmd_type);
	int cmd_type);


static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,
static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,
@@ -912,7 +912,7 @@ static void hpsa_scsi_setup(struct ctlr_info *h)
}
}


static void complete_scsi_command(struct CommandList *cp,
static void complete_scsi_command(struct CommandList *cp,
	int timeout, __u32 tag)
	int timeout, u32 tag)
{
{
	struct scsi_cmnd *cmd;
	struct scsi_cmnd *cmd;
	struct ctlr_info *h;
	struct ctlr_info *h;
@@ -1160,7 +1160,7 @@ static void hpsa_map_one(struct pci_dev *pdev,
		size_t buflen,
		size_t buflen,
		int data_direction)
		int data_direction)
{
{
	__u64 addr64;
	u64 addr64;


	if (buflen == 0 || data_direction == PCI_DMA_NONE) {
	if (buflen == 0 || data_direction == PCI_DMA_NONE) {
		cp->Header.SGList = 0;
		cp->Header.SGList = 0;
@@ -1168,14 +1168,14 @@ static void hpsa_map_one(struct pci_dev *pdev,
		return;
		return;
	}
	}


	addr64 = (__u64) pci_map_single(pdev, buf, buflen, data_direction);
	addr64 = (u64) pci_map_single(pdev, buf, buflen, data_direction);
	cp->SG[0].Addr.lower =
	cp->SG[0].Addr.lower =
	  (__u32) (addr64 & (__u64) 0x00000000FFFFFFFF);
	  (u32) (addr64 & (u64) 0x00000000FFFFFFFF);
	cp->SG[0].Addr.upper =
	cp->SG[0].Addr.upper =
	  (__u32) ((addr64 >> 32) & (__u64) 0x00000000FFFFFFFF);
	  (u32) ((addr64 >> 32) & (u64) 0x00000000FFFFFFFF);
	cp->SG[0].Len = buflen;
	cp->SG[0].Len = buflen;
	cp->Header.SGList = (__u8) 1;   /* no. SGs contig in this cmd */
	cp->Header.SGList = (u8) 1;   /* no. SGs contig in this cmd */
	cp->Header.SGTotal = (__u16) 1; /* total sgs in this cmd list */
	cp->Header.SGTotal = (u16) 1; /* total sgs in this cmd list */
}
}


static inline void hpsa_scsi_do_simple_cmd_core(struct ctlr_info *h,
static inline void hpsa_scsi_do_simple_cmd_core(struct ctlr_info *h,
@@ -1485,11 +1485,11 @@ static int is_msa2xxx(struct ctlr_info *h, struct hpsa_scsi_dev_t *device)
 * in hpsa_find_target_lun, called by hpsa_scsi_add_entry.)
 * in hpsa_find_target_lun, called by hpsa_scsi_add_entry.)
 */
 */
static void figure_bus_target_lun(struct ctlr_info *h,
static void figure_bus_target_lun(struct ctlr_info *h,
	__u8 *lunaddrbytes, int *bus, int *target, int *lun,
	u8 *lunaddrbytes, int *bus, int *target, int *lun,
	struct hpsa_scsi_dev_t *device)
	struct hpsa_scsi_dev_t *device)
{
{


	__u32 lunid;
	u32 lunid;


	if (is_logical_dev_addr_mode(lunaddrbytes)) {
	if (is_logical_dev_addr_mode(lunaddrbytes)) {
		/* logical device */
		/* logical device */
@@ -1529,7 +1529,7 @@ static void figure_bus_target_lun(struct ctlr_info *h,
 */
 */
static int add_msa2xxx_enclosure_device(struct ctlr_info *h,
static int add_msa2xxx_enclosure_device(struct ctlr_info *h,
	struct hpsa_scsi_dev_t *tmpdevice,
	struct hpsa_scsi_dev_t *tmpdevice,
	struct hpsa_scsi_dev_t *this_device, __u8 *lunaddrbytes,
	struct hpsa_scsi_dev_t *this_device, u8 *lunaddrbytes,
	int bus, int target, int lun, unsigned long lunzerobits[],
	int bus, int target, int lun, unsigned long lunzerobits[],
	int *nmsa2xxx_enclosures)
	int *nmsa2xxx_enclosures)
{
{
@@ -1576,8 +1576,8 @@ static int add_msa2xxx_enclosure_device(struct ctlr_info *h,
 */
 */
static int hpsa_gather_lun_info(struct ctlr_info *h,
static int hpsa_gather_lun_info(struct ctlr_info *h,
	int reportlunsize,
	int reportlunsize,
	struct ReportLUNdata *physdev, __u32 *nphysicals,
	struct ReportLUNdata *physdev, u32 *nphysicals,
	struct ReportLUNdata *logdev, __u32 *nlogicals)
	struct ReportLUNdata *logdev, u32 *nlogicals)
{
{
	if (hpsa_scsi_do_report_phys_luns(h, physdev, reportlunsize, 0)) {
	if (hpsa_scsi_do_report_phys_luns(h, physdev, reportlunsize, 0)) {
		dev_err(&h->pdev->dev, "report physical LUNs failed.\n");
		dev_err(&h->pdev->dev, "report physical LUNs failed.\n");
@@ -1636,9 +1636,9 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
	struct ReportLUNdata *physdev_list = NULL;
	struct ReportLUNdata *physdev_list = NULL;
	struct ReportLUNdata *logdev_list = NULL;
	struct ReportLUNdata *logdev_list = NULL;
	unsigned char *inq_buff = NULL;
	unsigned char *inq_buff = NULL;
	__u32 nphysicals = 0;
	u32 nphysicals = 0;
	__u32 nlogicals = 0;
	u32 nlogicals = 0;
	__u32 ndev_allocated = 0;
	u32 ndev_allocated = 0;
	struct hpsa_scsi_dev_t **currentsd, *this_device, *tmpdevice;
	struct hpsa_scsi_dev_t **currentsd, *this_device, *tmpdevice;
	int ncurrent = 0;
	int ncurrent = 0;
	int reportlunsize = sizeof(*physdev_list) + HPSA_MAX_PHYS_LUN * 8;
	int reportlunsize = sizeof(*physdev_list) + HPSA_MAX_PHYS_LUN * 8;
@@ -1684,7 +1684,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
	/* adjust our table of devices */
	/* adjust our table of devices */
	nmsa2xxx_enclosures = 0;
	nmsa2xxx_enclosures = 0;
	for (i = 0; i < nphysicals + nlogicals + 1; i++) {
	for (i = 0; i < nphysicals + nlogicals + 1; i++) {
		__u8 *lunaddrbytes;
		u8 *lunaddrbytes;


		/* Figure out where the LUN ID info is coming from */
		/* Figure out where the LUN ID info is coming from */
		if (i < nphysicals)
		if (i < nphysicals)
@@ -1790,7 +1790,7 @@ static int hpsa_scatter_gather(struct pci_dev *pdev,
{
{
	unsigned int len;
	unsigned int len;
	struct scatterlist *sg;
	struct scatterlist *sg;
	__u64 addr64;
	u64 addr64;
	int use_sg, i;
	int use_sg, i;


	BUG_ON(scsi_sg_count(cmd) > MAXSGENTRIES);
	BUG_ON(scsi_sg_count(cmd) > MAXSGENTRIES);
@@ -1803,20 +1803,20 @@ static int hpsa_scatter_gather(struct pci_dev *pdev,
		goto sglist_finished;
		goto sglist_finished;


	scsi_for_each_sg(cmd, sg, use_sg, i) {
	scsi_for_each_sg(cmd, sg, use_sg, i) {
		addr64 = (__u64) sg_dma_address(sg);
		addr64 = (u64) sg_dma_address(sg);
		len  = sg_dma_len(sg);
		len  = sg_dma_len(sg);
		cp->SG[i].Addr.lower =
		cp->SG[i].Addr.lower =
			(__u32) (addr64 & (__u64) 0x00000000FFFFFFFF);
			(u32) (addr64 & (u64) 0x00000000FFFFFFFF);
		cp->SG[i].Addr.upper =
		cp->SG[i].Addr.upper =
			(__u32) ((addr64 >> 32) & (__u64) 0x00000000FFFFFFFF);
			(u32) ((addr64 >> 32) & (u64) 0x00000000FFFFFFFF);
		cp->SG[i].Len = len;
		cp->SG[i].Len = len;
		cp->SG[i].Ext = 0;  /* we are not chaining */
		cp->SG[i].Ext = 0;  /* we are not chaining */
	}
	}


sglist_finished:
sglist_finished:


	cp->Header.SGList = (__u8) use_sg;   /* no. SGs contig in this cmd */
	cp->Header.SGList = (u8) use_sg;   /* no. SGs contig in this cmd */
	cp->Header.SGTotal = (__u16) use_sg; /* total sgs in this cmd list */
	cp->Header.SGTotal = (u16) use_sg; /* total sgs in this cmd list */
	return 0;
	return 0;
}
}


@@ -2053,8 +2053,8 @@ static struct CommandList *cmd_alloc(struct ctlr_info *h)
	c->cmdindex = i;
	c->cmdindex = i;


	INIT_HLIST_NODE(&c->list);
	INIT_HLIST_NODE(&c->list);
	c->busaddr = (__u32) cmd_dma_handle;
	c->busaddr = (u32) cmd_dma_handle;
	temp64.val = (__u64) err_dma_handle;
	temp64.val = (u64) err_dma_handle;
	c->ErrDesc.Addr.lower = temp64.val32.lower;
	c->ErrDesc.Addr.lower = temp64.val32.lower;
	c->ErrDesc.Addr.upper = temp64.val32.upper;
	c->ErrDesc.Addr.upper = temp64.val32.upper;
	c->ErrDesc.Len = sizeof(*c->err_info);
	c->ErrDesc.Len = sizeof(*c->err_info);
@@ -2091,8 +2091,8 @@ static struct CommandList *cmd_special_alloc(struct ctlr_info *h)
	memset(c->err_info, 0, sizeof(*c->err_info));
	memset(c->err_info, 0, sizeof(*c->err_info));


	INIT_HLIST_NODE(&c->list);
	INIT_HLIST_NODE(&c->list);
	c->busaddr = (__u32) cmd_dma_handle;
	c->busaddr = (u32) cmd_dma_handle;
	temp64.val = (__u64) err_dma_handle;
	temp64.val = (u64) err_dma_handle;
	c->ErrDesc.Addr.lower = temp64.val32.lower;
	c->ErrDesc.Addr.lower = temp64.val32.lower;
	c->ErrDesc.Addr.upper = temp64.val32.upper;
	c->ErrDesc.Addr.upper = temp64.val32.upper;
	c->ErrDesc.Len = sizeof(*c->err_info);
	c->ErrDesc.Len = sizeof(*c->err_info);
@@ -2378,8 +2378,8 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
	BYTE sg_used = 0;
	BYTE sg_used = 0;
	int status = 0;
	int status = 0;
	int i;
	int i;
	__u32 left;
	u32 left;
	__u32 sz;
	u32 sz;
	BYTE __user *data_ptr;
	BYTE __user *data_ptr;


	if (!argp)
	if (!argp)
@@ -2542,8 +2542,8 @@ static int hpsa_ioctl(struct scsi_device *dev, int cmd, void *arg)
	}
	}
}
}


static void fill_cmd(struct CommandList *c, __u8 cmd, struct ctlr_info *h,
static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h,
	void *buff, size_t size, __u8 page_code, unsigned char *scsi3addr,
	void *buff, size_t size, u8 page_code, unsigned char *scsi3addr,
	int cmd_type)
	int cmd_type)
{
{
	int pci_dir = XFER_NONE;
	int pci_dir = XFER_NONE;
@@ -2721,8 +2721,8 @@ static inline long interrupt_not_for_us(struct ctlr_info *h)
		 (h->interrupts_enabled == 0));
		 (h->interrupts_enabled == 0));
}
}


static inline int bad_tag(struct ctlr_info *h, __u32 tag_index,
static inline int bad_tag(struct ctlr_info *h, u32 tag_index,
	__u32 raw_tag)
	u32 raw_tag)
{
{
	if (unlikely(tag_index >= h->nr_cmds)) {
	if (unlikely(tag_index >= h->nr_cmds)) {
		dev_warn(&h->pdev->dev, "bad tag 0x%08x ignored.\n", raw_tag);
		dev_warn(&h->pdev->dev, "bad tag 0x%08x ignored.\n", raw_tag);
@@ -2731,7 +2731,7 @@ static inline int bad_tag(struct ctlr_info *h, __u32 tag_index,
	return 0;
	return 0;
}
}


static inline void finish_cmd(struct CommandList *c, __u32 raw_tag)
static inline void finish_cmd(struct CommandList *c, u32 raw_tag)
{
{
	removeQ(c);
	removeQ(c);
	if (likely(c->cmd_type == CMD_SCSI))
	if (likely(c->cmd_type == CMD_SCSI))
@@ -2745,7 +2745,7 @@ static irqreturn_t do_hpsa_intr(int irq, void *dev_id)
	struct ctlr_info *h = dev_id;
	struct ctlr_info *h = dev_id;
	struct CommandList *c;
	struct CommandList *c;
	unsigned long flags;
	unsigned long flags;
	__u32 raw_tag, tag, tag_index;
	u32 raw_tag, tag, tag_index;
	struct hlist_node *tmp;
	struct hlist_node *tmp;


	if (interrupt_not_for_us(h))
	if (interrupt_not_for_us(h))
@@ -3063,7 +3063,7 @@ static int find_PCI_BAR_index(struct pci_dev *pdev, unsigned long pci_bar_addr)
 */
 */


static void __devinit hpsa_interrupt_mode(struct ctlr_info *h,
static void __devinit hpsa_interrupt_mode(struct ctlr_info *h,
					   struct pci_dev *pdev, __u32 board_id)
					   struct pci_dev *pdev, u32 board_id)
{
{
#ifdef CONFIG_PCI_MSI
#ifdef CONFIG_PCI_MSI
	int err;
	int err;
@@ -3114,15 +3114,15 @@ static void __devinit hpsa_interrupt_mode(struct ctlr_info *h,
static int hpsa_pci_init(struct ctlr_info *h, struct pci_dev *pdev)
static int hpsa_pci_init(struct ctlr_info *h, struct pci_dev *pdev)
{
{
	ushort subsystem_vendor_id, subsystem_device_id, command;
	ushort subsystem_vendor_id, subsystem_device_id, command;
	__u32 board_id, scratchpad = 0;
	u32 board_id, scratchpad = 0;
	__u64 cfg_offset;
	u64 cfg_offset;
	__u32 cfg_base_addr;
	u32 cfg_base_addr;
	__u64 cfg_base_addr_index;
	u64 cfg_base_addr_index;
	int i, prod_index, err;
	int i, prod_index, err;


	subsystem_vendor_id = pdev->subsystem_vendor;
	subsystem_vendor_id = pdev->subsystem_vendor;
	subsystem_device_id = pdev->subsystem_device;
	subsystem_device_id = pdev->subsystem_device;
	board_id = (((__u32) (subsystem_device_id << 16) & 0xffff0000) |
	board_id = (((u32) (subsystem_device_id << 16) & 0xffff0000) |
		    subsystem_vendor_id);
		    subsystem_vendor_id);


	for (i = 0; i < ARRAY_SIZE(products); i++)
	for (i = 0; i < ARRAY_SIZE(products); i++)
@@ -3199,7 +3199,7 @@ static int hpsa_pci_init(struct ctlr_info *h, struct pci_dev *pdev)


	/* get the address index number */
	/* get the address index number */
	cfg_base_addr = readl(h->vaddr + SA5_CTCFG_OFFSET);
	cfg_base_addr = readl(h->vaddr + SA5_CTCFG_OFFSET);
	cfg_base_addr &= (__u32) 0x0000ffff;
	cfg_base_addr &= (u32) 0x0000ffff;
	cfg_base_addr_index = find_PCI_BAR_index(pdev, cfg_base_addr);
	cfg_base_addr_index = find_PCI_BAR_index(pdev, cfg_base_addr);
	if (cfg_base_addr_index == -1) {
	if (cfg_base_addr_index == -1) {
		dev_warn(&pdev->dev, "cannot find cfg_base_addr_index\n");
		dev_warn(&pdev->dev, "cannot find cfg_base_addr_index\n");
@@ -3232,7 +3232,7 @@ static int hpsa_pci_init(struct ctlr_info *h, struct pci_dev *pdev)
#ifdef CONFIG_X86
#ifdef CONFIG_X86
	{
	{
		/* Need to enable prefetch in the SCSI core for 6400 in x86 */
		/* Need to enable prefetch in the SCSI core for 6400 in x86 */
		__u32 prefetch;
		u32 prefetch;
		prefetch = readl(&(h->cfgtable->SCSI_Prefetch));
		prefetch = readl(&(h->cfgtable->SCSI_Prefetch));
		prefetch |= 0x100;
		prefetch |= 0x100;
		writel(prefetch, &(h->cfgtable->SCSI_Prefetch));
		writel(prefetch, &(h->cfgtable->SCSI_Prefetch));
@@ -3244,7 +3244,7 @@ static int hpsa_pci_init(struct ctlr_info *h, struct pci_dev *pdev)
	 * physical memory.
	 * physical memory.
	 */
	 */
	if (board_id == 0x3225103C) {
	if (board_id == 0x3225103C) {
		__u32 dma_prefetch;
		u32 dma_prefetch;
		dma_prefetch = readl(h->vaddr + I2O_DMA1_CFG);
		dma_prefetch = readl(h->vaddr + I2O_DMA1_CFG);
		dma_prefetch |= 0x8000;
		dma_prefetch |= 0x8000;
		writel(dma_prefetch, h->vaddr + I2O_DMA1_CFG);
		writel(dma_prefetch, h->vaddr + I2O_DMA1_CFG);
+2 −2
Original line number Original line Diff line number Diff line
@@ -55,7 +55,7 @@ struct ctlr_info {
	char    *product_name;
	char    *product_name;
	char	firm_ver[4]; /* Firmware version */
	char	firm_ver[4]; /* Firmware version */
	struct pci_dev *pdev;
	struct pci_dev *pdev;
	__u32	board_id;
	u32	board_id;
	void __iomem *vaddr;
	void __iomem *vaddr;
	unsigned long paddr;
	unsigned long paddr;
	int 	nr_cmds; /* Number of commands allowed on this controller */
	int 	nr_cmds; /* Number of commands allowed on this controller */
@@ -261,7 +261,7 @@ static struct access_method SA5_access = {
};
};


struct board_type {
struct board_type {
	__u32	board_id;
	u32	board_id;
	char	*product_name;
	char	*product_name;
	struct access_method *access;
	struct access_method *access;
};
};
+73 −73
Original line number Original line Diff line number Diff line
@@ -107,13 +107,13 @@
#define CFGTBL_BusType_Fibre1G  0x00000100l
#define CFGTBL_BusType_Fibre1G  0x00000100l
#define CFGTBL_BusType_Fibre2G  0x00000200l
#define CFGTBL_BusType_Fibre2G  0x00000200l
struct vals32 {
struct vals32 {
	__u32   lower;
	u32   lower;
	__u32   upper;
	u32   upper;
};
};


union u64bit {
union u64bit {
	struct vals32 val32;
	struct vals32 val32;
	__u64 val;
	u64 val;
};
};


/* FIXME this is a per controller value (barf!) */
/* FIXME this is a per controller value (barf!) */
@@ -126,34 +126,34 @@ union u64bit {


#define HPSA_INQUIRY 0x12
#define HPSA_INQUIRY 0x12
struct InquiryData {
struct InquiryData {
	__u8 data_byte[36];
	u8 data_byte[36];
};
};


#define HPSA_REPORT_LOG 0xc2    /* Report Logical LUNs */
#define HPSA_REPORT_LOG 0xc2    /* Report Logical LUNs */
#define HPSA_REPORT_PHYS 0xc3   /* Report Physical LUNs */
#define HPSA_REPORT_PHYS 0xc3   /* Report Physical LUNs */
struct ReportLUNdata {
struct ReportLUNdata {
	__u8 LUNListLength[4];
	u8 LUNListLength[4];
	__u32 reserved;
	u32 reserved;
	__u8 LUN[HPSA_MAX_LUN][8];
	u8 LUN[HPSA_MAX_LUN][8];
};
};


struct ReportExtendedLUNdata {
struct ReportExtendedLUNdata {
	__u8 LUNListLength[4];
	u8 LUNListLength[4];
	__u8 extended_response_flag;
	u8 extended_response_flag;
	__u8 reserved[3];
	u8 reserved[3];
	__u8 LUN[HPSA_MAX_LUN][24];
	u8 LUN[HPSA_MAX_LUN][24];
};
};


struct SenseSubsystem_info {
struct SenseSubsystem_info {
	__u8 reserved[36];
	u8 reserved[36];
	__u8 portname[8];
	u8 portname[8];
	__u8 reserved1[1108];
	u8 reserved1[1108];
};
};


#define HPSA_READ_CAPACITY 0x25 /* Read Capacity */
#define HPSA_READ_CAPACITY 0x25 /* Read Capacity */
struct ReadCapdata {
struct ReadCapdata {
	__u8 total_size[4];	/* Total size in blocks */
	u8 total_size[4];	/* Total size in blocks */
	__u8 block_size[4];	/* Size of blocks in bytes */
	u8 block_size[4];	/* Size of blocks in bytes */
};
};


#if 0
#if 0
@@ -174,94 +174,94 @@ struct ReadCapdata {
/* Command List Structure */
/* Command List Structure */
union SCSI3Addr {
union SCSI3Addr {
	struct {
	struct {
		__u8 Dev;
		u8 Dev;
		__u8 Bus:6;
		u8 Bus:6;
		__u8 Mode:2;        /* b00 */
		u8 Mode:2;        /* b00 */
	} PeripDev;
	} PeripDev;
	struct {
	struct {
		__u8 DevLSB;
		u8 DevLSB;
		__u8 DevMSB:6;
		u8 DevMSB:6;
		__u8 Mode:2;        /* b01 */
		u8 Mode:2;        /* b01 */
	} LogDev;
	} LogDev;
	struct {
	struct {
		__u8 Dev:5;
		u8 Dev:5;
		__u8 Bus:3;
		u8 Bus:3;
		__u8 Targ:6;
		u8 Targ:6;
		__u8 Mode:2;        /* b10 */
		u8 Mode:2;        /* b10 */
	} LogUnit;
	} LogUnit;
};
};


struct PhysDevAddr {
struct PhysDevAddr {
	__u32             TargetId:24;
	u32             TargetId:24;
	__u32             Bus:6;
	u32             Bus:6;
	__u32             Mode:2;
	u32             Mode:2;
	/* 2 level target device addr */
	/* 2 level target device addr */
	union SCSI3Addr  Target[2];
	union SCSI3Addr  Target[2];
};
};


struct LogDevAddr {
struct LogDevAddr {
	__u32            VolId:30;
	u32            VolId:30;
	__u32            Mode:2;
	u32            Mode:2;
	__u8             reserved[4];
	u8             reserved[4];
};
};


union LUNAddr {
union LUNAddr {
	__u8               LunAddrBytes[8];
	u8               LunAddrBytes[8];
	union SCSI3Addr    SCSI3Lun[4];
	union SCSI3Addr    SCSI3Lun[4];
	struct PhysDevAddr PhysDev;
	struct PhysDevAddr PhysDev;
	struct LogDevAddr  LogDev;
	struct LogDevAddr  LogDev;
};
};


struct CommandListHeader {
struct CommandListHeader {
	__u8              ReplyQueue;
	u8              ReplyQueue;
	__u8              SGList;
	u8              SGList;
	__u16             SGTotal;
	u16             SGTotal;
	struct vals32     Tag;
	struct vals32     Tag;
	union LUNAddr     LUN;
	union LUNAddr     LUN;
};
};


struct RequestBlock {
struct RequestBlock {
	__u8   CDBLen;
	u8   CDBLen;
	struct {
	struct {
		__u8 Type:3;
		u8 Type:3;
		__u8 Attribute:3;
		u8 Attribute:3;
		__u8 Direction:2;
		u8 Direction:2;
	} Type;
	} Type;
	__u16  Timeout;
	u16  Timeout;
	__u8   CDB[16];
	u8   CDB[16];
};
};


struct ErrDescriptor {
struct ErrDescriptor {
	struct vals32 Addr;
	struct vals32 Addr;
	__u32  Len;
	u32  Len;
};
};


struct SGDescriptor {
struct SGDescriptor {
	struct vals32 Addr;
	struct vals32 Addr;
	__u32  Len;
	u32  Len;
	__u32  Ext;
	u32  Ext;
};
};


union MoreErrInfo {
union MoreErrInfo {
	struct {
	struct {
		__u8  Reserved[3];
		u8  Reserved[3];
		__u8  Type;
		u8  Type;
		__u32 ErrorInfo;
		u32 ErrorInfo;
	} Common_Info;
	} Common_Info;
	struct {
	struct {
		__u8  Reserved[2];
		u8  Reserved[2];
		__u8  offense_size; /* size of offending entry */
		u8  offense_size; /* size of offending entry */
		__u8  offense_num;  /* byte # of offense 0-base */
		u8  offense_num;  /* byte # of offense 0-base */
		__u32 offense_value;
		u32 offense_value;
	} Invalid_Cmd;
	} Invalid_Cmd;
};
};
struct ErrorInfo {
struct ErrorInfo {
	__u8               ScsiStatus;
	u8               ScsiStatus;
	__u8               SenseLen;
	u8               SenseLen;
	__u16              CommandStatus;
	u16              CommandStatus;
	__u32              ResidualCnt;
	u32              ResidualCnt;
	union MoreErrInfo  MoreErrInfo;
	union MoreErrInfo  MoreErrInfo;
	__u8               SenseInfo[SENSEINFOBYTES];
	u8               SenseInfo[SENSEINFOBYTES];
};
};
/* Command types */
/* Command types */
#define CMD_IOCTL_PEND  0x01
#define CMD_IOCTL_PEND  0x01
@@ -279,7 +279,7 @@ struct CommandList {
	struct ErrDescriptor     ErrDesc;
	struct ErrDescriptor     ErrDesc;
	struct SGDescriptor      SG[MAXSGENTRIES];
	struct SGDescriptor      SG[MAXSGENTRIES];
	/* information associated with the command */
	/* information associated with the command */
	__u32			   busaddr; /* physical addr of this record */
	u32			   busaddr; /* physical addr of this record */
	struct ErrorInfo *err_info; /* pointer to the allocated mem */
	struct ErrorInfo *err_info; /* pointer to the allocated mem */
	struct ctlr_info	   *h;
	struct ctlr_info	   *h;
	int			   cmd_type;
	int			   cmd_type;
@@ -295,31 +295,31 @@ struct CommandList {


/* Configuration Table Structure */
/* Configuration Table Structure */
struct HostWrite {
struct HostWrite {
	__u32 TransportRequest;
	u32 TransportRequest;
	__u32 Reserved;
	u32 Reserved;
	__u32 CoalIntDelay;
	u32 CoalIntDelay;
	__u32 CoalIntCount;
	u32 CoalIntCount;
};
};


struct CfgTable {
struct CfgTable {
	__u8             Signature[4];
	u8             Signature[4];
	__u32            SpecValence;
	u32            SpecValence;
	__u32            TransportSupport;
	u32            TransportSupport;
	__u32            TransportActive;
	u32            TransportActive;
	struct HostWrite HostWrite;
	struct HostWrite HostWrite;
	__u32            CmdsOutMax;
	u32            CmdsOutMax;
	__u32            BusTypes;
	u32            BusTypes;
	__u32            Reserved;
	u32            Reserved;
	__u8             ServerName[16];
	u8             ServerName[16];
	__u32            HeartBeat;
	u32            HeartBeat;
	__u32            SCSI_Prefetch;
	u32            SCSI_Prefetch;
};
};


struct hpsa_pci_info {
struct hpsa_pci_info {
	unsigned char	bus;
	unsigned char	bus;
	unsigned char	dev_fn;
	unsigned char	dev_fn;
	unsigned short	domain;
	unsigned short	domain;
	__u32		board_id;
	u32		board_id;
};
};


#pragma pack()
#pragma pack()