aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index bb96fdd58e23..0f4a1f3c7e9f 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -126,8 +126,8 @@ static void cmd_free(struct ctlr_info *h, struct CommandList *c);
126static void cmd_special_free(struct ctlr_info *h, struct CommandList *c); 126static void cmd_special_free(struct ctlr_info *h, struct CommandList *c);
127static struct CommandList *cmd_alloc(struct ctlr_info *h); 127static struct CommandList *cmd_alloc(struct ctlr_info *h);
128static struct CommandList *cmd_special_alloc(struct ctlr_info *h); 128static struct CommandList *cmd_special_alloc(struct ctlr_info *h);
129static void fill_cmd(struct CommandList *c, __u8 cmd, struct ctlr_info *h, 129static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h,
130 void *buff, size_t size, __u8 page_code, unsigned char *scsi3addr, 130 void *buff, size_t size, u8 page_code, unsigned char *scsi3addr,
131 int cmd_type); 131 int cmd_type);
132 132
133static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, 133static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,
@@ -912,7 +912,7 @@ static void hpsa_scsi_setup(struct ctlr_info *h)
912} 912}
913 913
914static void complete_scsi_command(struct CommandList *cp, 914static void complete_scsi_command(struct CommandList *cp,
915 int timeout, __u32 tag) 915 int timeout, u32 tag)
916{ 916{
917 struct scsi_cmnd *cmd; 917 struct scsi_cmnd *cmd;
918 struct ctlr_info *h; 918 struct ctlr_info *h;
@@ -1160,7 +1160,7 @@ static void hpsa_map_one(struct pci_dev *pdev,
1160 size_t buflen, 1160 size_t buflen,
1161 int data_direction) 1161 int data_direction)
1162{ 1162{
1163 __u64 addr64; 1163 u64 addr64;
1164 1164
1165 if (buflen == 0 || data_direction == PCI_DMA_NONE) { 1165 if (buflen == 0 || data_direction == PCI_DMA_NONE) {
1166 cp->Header.SGList = 0; 1166 cp->Header.SGList = 0;
@@ -1168,14 +1168,14 @@ static void hpsa_map_one(struct pci_dev *pdev,
1168 return; 1168 return;
1169 } 1169 }
1170 1170
1171 addr64 = (__u64) pci_map_single(pdev, buf, buflen, data_direction); 1171 addr64 = (u64) pci_map_single(pdev, buf, buflen, data_direction);
1172 cp->SG[0].Addr.lower = 1172 cp->SG[0].Addr.lower =
1173 (__u32) (addr64 & (__u64) 0x00000000FFFFFFFF); 1173 (u32) (addr64 & (u64) 0x00000000FFFFFFFF);
1174 cp->SG[0].Addr.upper = 1174 cp->SG[0].Addr.upper =
1175 (__u32) ((addr64 >> 32) & (__u64) 0x00000000FFFFFFFF); 1175 (u32) ((addr64 >> 32) & (u64) 0x00000000FFFFFFFF);
1176 cp->SG[0].Len = buflen; 1176 cp->SG[0].Len = buflen;
1177 cp->Header.SGList = (__u8) 1; /* no. SGs contig in this cmd */ 1177 cp->Header.SGList = (u8) 1; /* no. SGs contig in this cmd */
1178 cp->Header.SGTotal = (__u16) 1; /* total sgs in this cmd list */ 1178 cp->Header.SGTotal = (u16) 1; /* total sgs in this cmd list */
1179} 1179}
1180 1180
1181static inline void hpsa_scsi_do_simple_cmd_core(struct ctlr_info *h, 1181static 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)
1485 * in hpsa_find_target_lun, called by hpsa_scsi_add_entry.) 1485 * in hpsa_find_target_lun, called by hpsa_scsi_add_entry.)
1486 */ 1486 */
1487static void figure_bus_target_lun(struct ctlr_info *h, 1487static void figure_bus_target_lun(struct ctlr_info *h,
1488 __u8 *lunaddrbytes, int *bus, int *target, int *lun, 1488 u8 *lunaddrbytes, int *bus, int *target, int *lun,
1489 struct hpsa_scsi_dev_t *device) 1489 struct hpsa_scsi_dev_t *device)
1490{ 1490{
1491 1491
1492 __u32 lunid; 1492 u32 lunid;
1493 1493
1494 if (is_logical_dev_addr_mode(lunaddrbytes)) { 1494 if (is_logical_dev_addr_mode(lunaddrbytes)) {
1495 /* logical device */ 1495 /* logical device */
@@ -1529,7 +1529,7 @@ static void figure_bus_target_lun(struct ctlr_info *h,
1529 */ 1529 */
1530static int add_msa2xxx_enclosure_device(struct ctlr_info *h, 1530static int add_msa2xxx_enclosure_device(struct ctlr_info *h,
1531 struct hpsa_scsi_dev_t *tmpdevice, 1531 struct hpsa_scsi_dev_t *tmpdevice,
1532 struct hpsa_scsi_dev_t *this_device, __u8 *lunaddrbytes, 1532 struct hpsa_scsi_dev_t *this_device, u8 *lunaddrbytes,
1533 int bus, int target, int lun, unsigned long lunzerobits[], 1533 int bus, int target, int lun, unsigned long lunzerobits[],
1534 int *nmsa2xxx_enclosures) 1534 int *nmsa2xxx_enclosures)
1535{ 1535{
@@ -1576,8 +1576,8 @@ static int add_msa2xxx_enclosure_device(struct ctlr_info *h,
1576 */ 1576 */
1577static int hpsa_gather_lun_info(struct ctlr_info *h, 1577static int hpsa_gather_lun_info(struct ctlr_info *h,
1578 int reportlunsize, 1578 int reportlunsize,
1579 struct ReportLUNdata *physdev, __u32 *nphysicals, 1579 struct ReportLUNdata *physdev, u32 *nphysicals,
1580 struct ReportLUNdata *logdev, __u32 *nlogicals) 1580 struct ReportLUNdata *logdev, u32 *nlogicals)
1581{ 1581{
1582 if (hpsa_scsi_do_report_phys_luns(h, physdev, reportlunsize, 0)) { 1582 if (hpsa_scsi_do_report_phys_luns(h, physdev, reportlunsize, 0)) {
1583 dev_err(&h->pdev->dev, "report physical LUNs failed.\n"); 1583 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)
1636 struct ReportLUNdata *physdev_list = NULL; 1636 struct ReportLUNdata *physdev_list = NULL;
1637 struct ReportLUNdata *logdev_list = NULL; 1637 struct ReportLUNdata *logdev_list = NULL;
1638 unsigned char *inq_buff = NULL; 1638 unsigned char *inq_buff = NULL;
1639 __u32 nphysicals = 0; 1639 u32 nphysicals = 0;
1640 __u32 nlogicals = 0; 1640 u32 nlogicals = 0;
1641 __u32 ndev_allocated = 0; 1641 u32 ndev_allocated = 0;
1642 struct hpsa_scsi_dev_t **currentsd, *this_device, *tmpdevice; 1642 struct hpsa_scsi_dev_t **currentsd, *this_device, *tmpdevice;
1643 int ncurrent = 0; 1643 int ncurrent = 0;
1644 int reportlunsize = sizeof(*physdev_list) + HPSA_MAX_PHYS_LUN * 8; 1644 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)
1684 /* adjust our table of devices */ 1684 /* adjust our table of devices */
1685 nmsa2xxx_enclosures = 0; 1685 nmsa2xxx_enclosures = 0;
1686 for (i = 0; i < nphysicals + nlogicals + 1; i++) { 1686 for (i = 0; i < nphysicals + nlogicals + 1; i++) {
1687 __u8 *lunaddrbytes; 1687 u8 *lunaddrbytes;
1688 1688
1689 /* Figure out where the LUN ID info is coming from */ 1689 /* Figure out where the LUN ID info is coming from */
1690 if (i < nphysicals) 1690 if (i < nphysicals)
@@ -1790,7 +1790,7 @@ static int hpsa_scatter_gather(struct pci_dev *pdev,
1790{ 1790{
1791 unsigned int len; 1791 unsigned int len;
1792 struct scatterlist *sg; 1792 struct scatterlist *sg;
1793 __u64 addr64; 1793 u64 addr64;
1794 int use_sg, i; 1794 int use_sg, i;
1795 1795
1796 BUG_ON(scsi_sg_count(cmd) > MAXSGENTRIES); 1796 BUG_ON(scsi_sg_count(cmd) > MAXSGENTRIES);
@@ -1803,20 +1803,20 @@ static int hpsa_scatter_gather(struct pci_dev *pdev,
1803 goto sglist_finished; 1803 goto sglist_finished;
1804 1804
1805 scsi_for_each_sg(cmd, sg, use_sg, i) { 1805 scsi_for_each_sg(cmd, sg, use_sg, i) {
1806 addr64 = (__u64) sg_dma_address(sg); 1806 addr64 = (u64) sg_dma_address(sg);
1807 len = sg_dma_len(sg); 1807 len = sg_dma_len(sg);
1808 cp->SG[i].Addr.lower = 1808 cp->SG[i].Addr.lower =
1809 (__u32) (addr64 & (__u64) 0x00000000FFFFFFFF); 1809 (u32) (addr64 & (u64) 0x00000000FFFFFFFF);
1810 cp->SG[i].Addr.upper = 1810 cp->SG[i].Addr.upper =
1811 (__u32) ((addr64 >> 32) & (__u64) 0x00000000FFFFFFFF); 1811 (u32) ((addr64 >> 32) & (u64) 0x00000000FFFFFFFF);
1812 cp->SG[i].Len = len; 1812 cp->SG[i].Len = len;
1813 cp->SG[i].Ext = 0; /* we are not chaining */ 1813 cp->SG[i].Ext = 0; /* we are not chaining */
1814 } 1814 }
1815 1815
1816sglist_finished: 1816sglist_finished:
1817 1817
1818 cp->Header.SGList = (__u8) use_sg; /* no. SGs contig in this cmd */ 1818 cp->Header.SGList = (u8) use_sg; /* no. SGs contig in this cmd */
1819 cp->Header.SGTotal = (__u16) use_sg; /* total sgs in this cmd list */ 1819 cp->Header.SGTotal = (u16) use_sg; /* total sgs in this cmd list */
1820 return 0; 1820 return 0;
1821} 1821}
1822 1822
@@ -2053,8 +2053,8 @@ static struct CommandList *cmd_alloc(struct ctlr_info *h)
2053 c->cmdindex = i; 2053 c->cmdindex = i;
2054 2054
2055 INIT_HLIST_NODE(&c->list); 2055 INIT_HLIST_NODE(&c->list);
2056 c->busaddr = (__u32) cmd_dma_handle; 2056 c->busaddr = (u32) cmd_dma_handle;
2057 temp64.val = (__u64) err_dma_handle; 2057 temp64.val = (u64) err_dma_handle;
2058 c->ErrDesc.Addr.lower = temp64.val32.lower; 2058 c->ErrDesc.Addr.lower = temp64.val32.lower;
2059 c->ErrDesc.Addr.upper = temp64.val32.upper; 2059 c->ErrDesc.Addr.upper = temp64.val32.upper;
2060 c->ErrDesc.Len = sizeof(*c->err_info); 2060 c->ErrDesc.Len = sizeof(*c->err_info);
@@ -2091,8 +2091,8 @@ static struct CommandList *cmd_special_alloc(struct ctlr_info *h)
2091 memset(c->err_info, 0, sizeof(*c->err_info)); 2091 memset(c->err_info, 0, sizeof(*c->err_info));
2092 2092
2093 INIT_HLIST_NODE(&c->list); 2093 INIT_HLIST_NODE(&c->list);
2094 c->busaddr = (__u32) cmd_dma_handle; 2094 c->busaddr = (u32) cmd_dma_handle;
2095 temp64.val = (__u64) err_dma_handle; 2095 temp64.val = (u64) err_dma_handle;
2096 c->ErrDesc.Addr.lower = temp64.val32.lower; 2096 c->ErrDesc.Addr.lower = temp64.val32.lower;
2097 c->ErrDesc.Addr.upper = temp64.val32.upper; 2097 c->ErrDesc.Addr.upper = temp64.val32.upper;
2098 c->ErrDesc.Len = sizeof(*c->err_info); 2098 c->ErrDesc.Len = sizeof(*c->err_info);
@@ -2378,8 +2378,8 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
2378 BYTE sg_used = 0; 2378 BYTE sg_used = 0;
2379 int status = 0; 2379 int status = 0;
2380 int i; 2380 int i;
2381 __u32 left; 2381 u32 left;
2382 __u32 sz; 2382 u32 sz;
2383 BYTE __user *data_ptr; 2383 BYTE __user *data_ptr;
2384 2384
2385 if (!argp) 2385 if (!argp)
@@ -2542,8 +2542,8 @@ static int hpsa_ioctl(struct scsi_device *dev, int cmd, void *arg)
2542 } 2542 }
2543} 2543}
2544 2544
2545static void fill_cmd(struct CommandList *c, __u8 cmd, struct ctlr_info *h, 2545static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h,
2546 void *buff, size_t size, __u8 page_code, unsigned char *scsi3addr, 2546 void *buff, size_t size, u8 page_code, unsigned char *scsi3addr,
2547 int cmd_type) 2547 int cmd_type)
2548{ 2548{
2549 int pci_dir = XFER_NONE; 2549 int pci_dir = XFER_NONE;
@@ -2721,8 +2721,8 @@ static inline long interrupt_not_for_us(struct ctlr_info *h)
2721 (h->interrupts_enabled == 0)); 2721 (h->interrupts_enabled == 0));
2722} 2722}
2723 2723
2724static inline int bad_tag(struct ctlr_info *h, __u32 tag_index, 2724static inline int bad_tag(struct ctlr_info *h, u32 tag_index,
2725 __u32 raw_tag) 2725 u32 raw_tag)
2726{ 2726{
2727 if (unlikely(tag_index >= h->nr_cmds)) { 2727 if (unlikely(tag_index >= h->nr_cmds)) {
2728 dev_warn(&h->pdev->dev, "bad tag 0x%08x ignored.\n", raw_tag); 2728 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,
2731 return 0; 2731 return 0;
2732} 2732}
2733 2733
2734static inline void finish_cmd(struct CommandList *c, __u32 raw_tag) 2734static inline void finish_cmd(struct CommandList *c, u32 raw_tag)
2735{ 2735{
2736 removeQ(c); 2736 removeQ(c);
2737 if (likely(c->cmd_type == CMD_SCSI)) 2737 if (likely(c->cmd_type == CMD_SCSI))
@@ -2745,7 +2745,7 @@ static irqreturn_t do_hpsa_intr(int irq, void *dev_id)
2745 struct ctlr_info *h = dev_id; 2745 struct ctlr_info *h = dev_id;
2746 struct CommandList *c; 2746 struct CommandList *c;
2747 unsigned long flags; 2747 unsigned long flags;
2748 __u32 raw_tag, tag, tag_index; 2748 u32 raw_tag, tag, tag_index;
2749 struct hlist_node *tmp; 2749 struct hlist_node *tmp;
2750 2750
2751 if (interrupt_not_for_us(h)) 2751 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)
3063 */ 3063 */
3064 3064
3065static void __devinit hpsa_interrupt_mode(struct ctlr_info *h, 3065static void __devinit hpsa_interrupt_mode(struct ctlr_info *h,
3066 struct pci_dev *pdev, __u32 board_id) 3066 struct pci_dev *pdev, u32 board_id)
3067{ 3067{
3068#ifdef CONFIG_PCI_MSI 3068#ifdef CONFIG_PCI_MSI
3069 int err; 3069 int err;
@@ -3114,15 +3114,15 @@ default_int_mode:
3114static int hpsa_pci_init(struct ctlr_info *h, struct pci_dev *pdev) 3114static int hpsa_pci_init(struct ctlr_info *h, struct pci_dev *pdev)
3115{ 3115{
3116 ushort subsystem_vendor_id, subsystem_device_id, command; 3116 ushort subsystem_vendor_id, subsystem_device_id, command;
3117 __u32 board_id, scratchpad = 0; 3117 u32 board_id, scratchpad = 0;
3118 __u64 cfg_offset; 3118 u64 cfg_offset;
3119 __u32 cfg_base_addr; 3119 u32 cfg_base_addr;
3120 __u64 cfg_base_addr_index; 3120 u64 cfg_base_addr_index;
3121 int i, prod_index, err; 3121 int i, prod_index, err;
3122 3122
3123 subsystem_vendor_id = pdev->subsystem_vendor; 3123 subsystem_vendor_id = pdev->subsystem_vendor;
3124 subsystem_device_id = pdev->subsystem_device; 3124 subsystem_device_id = pdev->subsystem_device;
3125 board_id = (((__u32) (subsystem_device_id << 16) & 0xffff0000) | 3125 board_id = (((u32) (subsystem_device_id << 16) & 0xffff0000) |
3126 subsystem_vendor_id); 3126 subsystem_vendor_id);
3127 3127
3128 for (i = 0; i < ARRAY_SIZE(products); i++) 3128 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)
3199 3199
3200 /* get the address index number */ 3200 /* get the address index number */
3201 cfg_base_addr = readl(h->vaddr + SA5_CTCFG_OFFSET); 3201 cfg_base_addr = readl(h->vaddr + SA5_CTCFG_OFFSET);
3202 cfg_base_addr &= (__u32) 0x0000ffff; 3202 cfg_base_addr &= (u32) 0x0000ffff;
3203 cfg_base_addr_index = find_PCI_BAR_index(pdev, cfg_base_addr); 3203 cfg_base_addr_index = find_PCI_BAR_index(pdev, cfg_base_addr);
3204 if (cfg_base_addr_index == -1) { 3204 if (cfg_base_addr_index == -1) {
3205 dev_warn(&pdev->dev, "cannot find cfg_base_addr_index\n"); 3205 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)
3232#ifdef CONFIG_X86 3232#ifdef CONFIG_X86
3233 { 3233 {
3234 /* Need to enable prefetch in the SCSI core for 6400 in x86 */ 3234 /* Need to enable prefetch in the SCSI core for 6400 in x86 */
3235 __u32 prefetch; 3235 u32 prefetch;
3236 prefetch = readl(&(h->cfgtable->SCSI_Prefetch)); 3236 prefetch = readl(&(h->cfgtable->SCSI_Prefetch));
3237 prefetch |= 0x100; 3237 prefetch |= 0x100;
3238 writel(prefetch, &(h->cfgtable->SCSI_Prefetch)); 3238 writel(prefetch, &(h->cfgtable->SCSI_Prefetch));
@@ -3244,7 +3244,7 @@ static int hpsa_pci_init(struct ctlr_info *h, struct pci_dev *pdev)
3244 * physical memory. 3244 * physical memory.
3245 */ 3245 */
3246 if (board_id == 0x3225103C) { 3246 if (board_id == 0x3225103C) {
3247 __u32 dma_prefetch; 3247 u32 dma_prefetch;
3248 dma_prefetch = readl(h->vaddr + I2O_DMA1_CFG); 3248 dma_prefetch = readl(h->vaddr + I2O_DMA1_CFG);
3249 dma_prefetch |= 0x8000; 3249 dma_prefetch |= 0x8000;
3250 writel(dma_prefetch, h->vaddr + I2O_DMA1_CFG); 3250 writel(dma_prefetch, h->vaddr + I2O_DMA1_CFG);