aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-09-28 12:00:11 -0400
committerRoland Dreier <rolandd@cisco.com>2006-09-28 14:16:49 -0400
commitf62fe77ad26b9c89c2028d96709f0f28793fe6cd (patch)
treec84a4b8b90219a5385299bd9dcd5b994cd1ff531 /drivers/infiniband
parent5659416207a9bcf35a646c7b798b290953e4891c (diff)
IB/ipath: Support multiple simultaneous devices of different types
Prior to this change, the driver was not able to support a HT and PCIE card simultaneously present in the same machine. Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c10
-rw-r--r--drivers/infiniband/hw/ipath/ipath_eeprom.c16
-rw-r--r--drivers/infiniband/hw/ipath/ipath_iba6110.c30
-rw-r--r--drivers/infiniband/hw/ipath/ipath_iba6120.c30
-rw-r--r--drivers/infiniband/hw/ipath/ipath_intr.c16
-rw-r--r--drivers/infiniband/hw/ipath/ipath_kernel.h24
-rw-r--r--drivers/infiniband/hw/ipath/ipath_registers.h18
7 files changed, 81 insertions, 63 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index a260acf4a9e6..2d336b48f3d7 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -95,16 +95,6 @@ const char *ipath_ibcstatus_str[] = {
95 "RecovIdle", 95 "RecovIdle",
96}; 96};
97 97
98/*
99 * These variables are initialized in the chip-specific files
100 * but are defined here.
101 */
102u16 ipath_gpio_sda_num, ipath_gpio_scl_num;
103u64 ipath_gpio_sda, ipath_gpio_scl;
104u64 infinipath_i_bitsextant;
105ipath_err_t infinipath_e_bitsextant, infinipath_hwe_bitsextant;
106u32 infinipath_i_rcvavail_mask, infinipath_i_rcvurg_mask;
107
108static void __devexit ipath_remove_one(struct pci_dev *); 98static void __devexit ipath_remove_one(struct pci_dev *);
109static int __devinit ipath_init_one(struct pci_dev *, 99static int __devinit ipath_init_one(struct pci_dev *,
110 const struct pci_device_id *); 100 const struct pci_device_id *);
diff --git a/drivers/infiniband/hw/ipath/ipath_eeprom.c b/drivers/infiniband/hw/ipath/ipath_eeprom.c
index 3313356ab93a..c8cfda89cb36 100644
--- a/drivers/infiniband/hw/ipath/ipath_eeprom.c
+++ b/drivers/infiniband/hw/ipath/ipath_eeprom.c
@@ -100,9 +100,9 @@ static int i2c_gpio_set(struct ipath_devdata *dd,
100 gpioval = &dd->ipath_gpio_out; 100 gpioval = &dd->ipath_gpio_out;
101 read_val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_extctrl); 101 read_val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_extctrl);
102 if (line == i2c_line_scl) 102 if (line == i2c_line_scl)
103 mask = ipath_gpio_scl; 103 mask = dd->ipath_gpio_scl;
104 else 104 else
105 mask = ipath_gpio_sda; 105 mask = dd->ipath_gpio_sda;
106 106
107 if (new_line_state == i2c_line_high) 107 if (new_line_state == i2c_line_high)
108 /* tri-state the output rather than force high */ 108 /* tri-state the output rather than force high */
@@ -119,12 +119,12 @@ static int i2c_gpio_set(struct ipath_devdata *dd,
119 write_val = 0x0UL; 119 write_val = 0x0UL;
120 120
121 if (line == i2c_line_scl) { 121 if (line == i2c_line_scl) {
122 write_val <<= ipath_gpio_scl_num; 122 write_val <<= dd->ipath_gpio_scl_num;
123 *gpioval = *gpioval & ~(1UL << ipath_gpio_scl_num); 123 *gpioval = *gpioval & ~(1UL << dd->ipath_gpio_scl_num);
124 *gpioval |= write_val; 124 *gpioval |= write_val;
125 } else { 125 } else {
126 write_val <<= ipath_gpio_sda_num; 126 write_val <<= dd->ipath_gpio_sda_num;
127 *gpioval = *gpioval & ~(1UL << ipath_gpio_sda_num); 127 *gpioval = *gpioval & ~(1UL << dd->ipath_gpio_sda_num);
128 *gpioval |= write_val; 128 *gpioval |= write_val;
129 } 129 }
130 ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_out, *gpioval); 130 ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_out, *gpioval);
@@ -157,9 +157,9 @@ static int i2c_gpio_get(struct ipath_devdata *dd,
157 read_val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_extctrl); 157 read_val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_extctrl);
158 /* config line to be an input */ 158 /* config line to be an input */
159 if (line == i2c_line_scl) 159 if (line == i2c_line_scl)
160 mask = ipath_gpio_scl; 160 mask = dd->ipath_gpio_scl;
161 else 161 else
162 mask = ipath_gpio_sda; 162 mask = dd->ipath_gpio_sda;
163 write_val = read_val & ~mask; 163 write_val = read_val & ~mask;
164 ipath_write_kreg(dd, dd->ipath_kregs->kr_extctrl, write_val); 164 ipath_write_kreg(dd, dd->ipath_kregs->kr_extctrl, write_val);
165 read_val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_extstatus); 165 read_val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_extstatus);
diff --git a/drivers/infiniband/hw/ipath/ipath_iba6110.c b/drivers/infiniband/hw/ipath/ipath_iba6110.c
index 87eb99af5e19..695f77402515 100644
--- a/drivers/infiniband/hw/ipath/ipath_iba6110.c
+++ b/drivers/infiniband/hw/ipath/ipath_iba6110.c
@@ -252,8 +252,8 @@ static const struct ipath_cregs ipath_ht_cregs = {
252}; 252};
253 253
254/* kr_intstatus, kr_intclear, kr_intmask bits */ 254/* kr_intstatus, kr_intclear, kr_intmask bits */
255#define INFINIPATH_I_RCVURG_MASK 0x1FF 255#define INFINIPATH_I_RCVURG_MASK ((1U<<9)-1)
256#define INFINIPATH_I_RCVAVAIL_MASK 0x1FF 256#define INFINIPATH_I_RCVAVAIL_MASK ((1U<<9)-1)
257 257
258/* kr_hwerrclear, kr_hwerrmask, kr_hwerrstatus, bits */ 258/* kr_hwerrclear, kr_hwerrmask, kr_hwerrstatus, bits */
259#define INFINIPATH_HWE_HTCMEMPARITYERR_SHIFT 0 259#define INFINIPATH_HWE_HTCMEMPARITYERR_SHIFT 0
@@ -457,10 +457,10 @@ static void ipath_ht_handle_hwerrors(struct ipath_devdata *dd, char *msg,
457 "(cleared)\n", (unsigned long long) hwerrs); 457 "(cleared)\n", (unsigned long long) hwerrs);
458 dd->ipath_lasthwerror |= hwerrs; 458 dd->ipath_lasthwerror |= hwerrs;
459 459
460 if (hwerrs & ~infinipath_hwe_bitsextant) 460 if (hwerrs & ~dd->ipath_hwe_bitsextant)
461 ipath_dev_err(dd, "hwerror interrupt with unknown errors " 461 ipath_dev_err(dd, "hwerror interrupt with unknown errors "
462 "%llx set\n", (unsigned long long) 462 "%llx set\n", (unsigned long long)
463 (hwerrs & ~infinipath_hwe_bitsextant)); 463 (hwerrs & ~dd->ipath_hwe_bitsextant));
464 464
465 ctrl = ipath_read_kreg32(dd, dd->ipath_kregs->kr_control); 465 ctrl = ipath_read_kreg32(dd, dd->ipath_kregs->kr_control);
466 if (ctrl & INFINIPATH_C_FREEZEMODE) { 466 if (ctrl & INFINIPATH_C_FREEZEMODE) {
@@ -1058,21 +1058,21 @@ static void ipath_setup_ht_setextled(struct ipath_devdata *dd,
1058 ipath_write_kreg(dd, dd->ipath_kregs->kr_extctrl, extctl); 1058 ipath_write_kreg(dd, dd->ipath_kregs->kr_extctrl, extctl);
1059} 1059}
1060 1060
1061static void ipath_init_ht_variables(void) 1061static void ipath_init_ht_variables(struct ipath_devdata *dd)
1062{ 1062{
1063 ipath_gpio_sda_num = _IPATH_GPIO_SDA_NUM; 1063 dd->ipath_gpio_sda_num = _IPATH_GPIO_SDA_NUM;
1064 ipath_gpio_scl_num = _IPATH_GPIO_SCL_NUM; 1064 dd->ipath_gpio_scl_num = _IPATH_GPIO_SCL_NUM;
1065 ipath_gpio_sda = IPATH_GPIO_SDA; 1065 dd->ipath_gpio_sda = IPATH_GPIO_SDA;
1066 ipath_gpio_scl = IPATH_GPIO_SCL; 1066 dd->ipath_gpio_scl = IPATH_GPIO_SCL;
1067 1067
1068 infinipath_i_bitsextant = 1068 dd->ipath_i_bitsextant =
1069 (INFINIPATH_I_RCVURG_MASK << INFINIPATH_I_RCVURG_SHIFT) | 1069 (INFINIPATH_I_RCVURG_MASK << INFINIPATH_I_RCVURG_SHIFT) |
1070 (INFINIPATH_I_RCVAVAIL_MASK << 1070 (INFINIPATH_I_RCVAVAIL_MASK <<
1071 INFINIPATH_I_RCVAVAIL_SHIFT) | 1071 INFINIPATH_I_RCVAVAIL_SHIFT) |
1072 INFINIPATH_I_ERROR | INFINIPATH_I_SPIOSENT | 1072 INFINIPATH_I_ERROR | INFINIPATH_I_SPIOSENT |
1073 INFINIPATH_I_SPIOBUFAVAIL | INFINIPATH_I_GPIO; 1073 INFINIPATH_I_SPIOBUFAVAIL | INFINIPATH_I_GPIO;
1074 1074
1075 infinipath_e_bitsextant = 1075 dd->ipath_e_bitsextant =
1076 INFINIPATH_E_RFORMATERR | INFINIPATH_E_RVCRC | 1076 INFINIPATH_E_RFORMATERR | INFINIPATH_E_RVCRC |
1077 INFINIPATH_E_RICRC | INFINIPATH_E_RMINPKTLEN | 1077 INFINIPATH_E_RICRC | INFINIPATH_E_RMINPKTLEN |
1078 INFINIPATH_E_RMAXPKTLEN | INFINIPATH_E_RLONGPKTLEN | 1078 INFINIPATH_E_RMAXPKTLEN | INFINIPATH_E_RLONGPKTLEN |
@@ -1090,7 +1090,7 @@ static void ipath_init_ht_variables(void)
1090 INFINIPATH_E_INVALIDADDR | INFINIPATH_E_RESET | 1090 INFINIPATH_E_INVALIDADDR | INFINIPATH_E_RESET |
1091 INFINIPATH_E_HARDWARE; 1091 INFINIPATH_E_HARDWARE;
1092 1092
1093 infinipath_hwe_bitsextant = 1093 dd->ipath_hwe_bitsextant =
1094 (INFINIPATH_HWE_HTCMEMPARITYERR_MASK << 1094 (INFINIPATH_HWE_HTCMEMPARITYERR_MASK <<
1095 INFINIPATH_HWE_HTCMEMPARITYERR_SHIFT) | 1095 INFINIPATH_HWE_HTCMEMPARITYERR_SHIFT) |
1096 (INFINIPATH_HWE_TXEMEMPARITYERR_MASK << 1096 (INFINIPATH_HWE_TXEMEMPARITYERR_MASK <<
@@ -1119,8 +1119,8 @@ static void ipath_init_ht_variables(void)
1119 INFINIPATH_HWE_IBCBUSTOSPCPARITYERR | 1119 INFINIPATH_HWE_IBCBUSTOSPCPARITYERR |
1120 INFINIPATH_HWE_IBCBUSFRSPCPARITYERR; 1120 INFINIPATH_HWE_IBCBUSFRSPCPARITYERR;
1121 1121
1122 infinipath_i_rcvavail_mask = INFINIPATH_I_RCVAVAIL_MASK; 1122 dd->ipath_i_rcvavail_mask = INFINIPATH_I_RCVAVAIL_MASK;
1123 infinipath_i_rcvurg_mask = INFINIPATH_I_RCVURG_MASK; 1123 dd->ipath_i_rcvurg_mask = INFINIPATH_I_RCVURG_MASK;
1124} 1124}
1125 1125
1126/** 1126/**
@@ -1585,5 +1585,5 @@ void ipath_init_iba6110_funcs(struct ipath_devdata *dd)
1585 * do very early init that is needed before ipath_f_bus is 1585 * do very early init that is needed before ipath_f_bus is
1586 * called 1586 * called
1587 */ 1587 */
1588 ipath_init_ht_variables(); 1588 ipath_init_ht_variables(dd);
1589} 1589}
diff --git a/drivers/infiniband/hw/ipath/ipath_iba6120.c b/drivers/infiniband/hw/ipath/ipath_iba6120.c
index a4ec50b0fe87..ac5cbe27c068 100644
--- a/drivers/infiniband/hw/ipath/ipath_iba6120.c
+++ b/drivers/infiniband/hw/ipath/ipath_iba6120.c
@@ -263,8 +263,8 @@ static const struct ipath_cregs ipath_pe_cregs = {
263}; 263};
264 264
265/* kr_intstatus, kr_intclear, kr_intmask bits */ 265/* kr_intstatus, kr_intclear, kr_intmask bits */
266#define INFINIPATH_I_RCVURG_MASK 0x1F 266#define INFINIPATH_I_RCVURG_MASK ((1U<<5)-1)
267#define INFINIPATH_I_RCVAVAIL_MASK 0x1F 267#define INFINIPATH_I_RCVAVAIL_MASK ((1U<<5)-1)
268 268
269/* kr_hwerrclear, kr_hwerrmask, kr_hwerrstatus, bits */ 269/* kr_hwerrclear, kr_hwerrmask, kr_hwerrstatus, bits */
270#define INFINIPATH_HWE_PCIEMEMPARITYERR_MASK 0x000000000000003fULL 270#define INFINIPATH_HWE_PCIEMEMPARITYERR_MASK 0x000000000000003fULL
@@ -376,10 +376,10 @@ static void ipath_pe_handle_hwerrors(struct ipath_devdata *dd, char *msg,
376 "(cleared)\n", (unsigned long long) hwerrs); 376 "(cleared)\n", (unsigned long long) hwerrs);
377 dd->ipath_lasthwerror |= hwerrs; 377 dd->ipath_lasthwerror |= hwerrs;
378 378
379 if (hwerrs & ~infinipath_hwe_bitsextant) 379 if (hwerrs & ~dd->ipath_hwe_bitsextant)
380 ipath_dev_err(dd, "hwerror interrupt with unknown errors " 380 ipath_dev_err(dd, "hwerror interrupt with unknown errors "
381 "%llx set\n", (unsigned long long) 381 "%llx set\n", (unsigned long long)
382 (hwerrs & ~infinipath_hwe_bitsextant)); 382 (hwerrs & ~dd->ipath_hwe_bitsextant));
383 383
384 ctrl = ipath_read_kreg32(dd, dd->ipath_kregs->kr_control); 384 ctrl = ipath_read_kreg32(dd, dd->ipath_kregs->kr_control);
385 if (ctrl & INFINIPATH_C_FREEZEMODE) { 385 if (ctrl & INFINIPATH_C_FREEZEMODE) {
@@ -865,19 +865,19 @@ static int ipath_setup_pe_config(struct ipath_devdata *dd,
865 return 0; 865 return 0;
866} 866}
867 867
868static void ipath_init_pe_variables(void) 868static void ipath_init_pe_variables(struct ipath_devdata *dd)
869{ 869{
870 /* 870 /*
871 * bits for selecting i2c direction and values, 871 * bits for selecting i2c direction and values,
872 * used for I2C serial flash 872 * used for I2C serial flash
873 */ 873 */
874 ipath_gpio_sda_num = _IPATH_GPIO_SDA_NUM; 874 dd->ipath_gpio_sda_num = _IPATH_GPIO_SDA_NUM;
875 ipath_gpio_scl_num = _IPATH_GPIO_SCL_NUM; 875 dd->ipath_gpio_scl_num = _IPATH_GPIO_SCL_NUM;
876 ipath_gpio_sda = IPATH_GPIO_SDA; 876 dd->ipath_gpio_sda = IPATH_GPIO_SDA;
877 ipath_gpio_scl = IPATH_GPIO_SCL; 877 dd->ipath_gpio_scl = IPATH_GPIO_SCL;
878 878
879 /* variables for sanity checking interrupt and errors */ 879 /* variables for sanity checking interrupt and errors */
880 infinipath_hwe_bitsextant = 880 dd->ipath_hwe_bitsextant =
881 (INFINIPATH_HWE_RXEMEMPARITYERR_MASK << 881 (INFINIPATH_HWE_RXEMEMPARITYERR_MASK <<
882 INFINIPATH_HWE_RXEMEMPARITYERR_SHIFT) | 882 INFINIPATH_HWE_RXEMEMPARITYERR_SHIFT) |
883 (INFINIPATH_HWE_PCIEMEMPARITYERR_MASK << 883 (INFINIPATH_HWE_PCIEMEMPARITYERR_MASK <<
@@ -895,13 +895,13 @@ static void ipath_init_pe_variables(void)
895 INFINIPATH_HWE_SERDESPLLFAILED | 895 INFINIPATH_HWE_SERDESPLLFAILED |
896 INFINIPATH_HWE_IBCBUSTOSPCPARITYERR | 896 INFINIPATH_HWE_IBCBUSTOSPCPARITYERR |
897 INFINIPATH_HWE_IBCBUSFRSPCPARITYERR; 897 INFINIPATH_HWE_IBCBUSFRSPCPARITYERR;
898 infinipath_i_bitsextant = 898 dd->ipath_i_bitsextant =
899 (INFINIPATH_I_RCVURG_MASK << INFINIPATH_I_RCVURG_SHIFT) | 899 (INFINIPATH_I_RCVURG_MASK << INFINIPATH_I_RCVURG_SHIFT) |
900 (INFINIPATH_I_RCVAVAIL_MASK << 900 (INFINIPATH_I_RCVAVAIL_MASK <<
901 INFINIPATH_I_RCVAVAIL_SHIFT) | 901 INFINIPATH_I_RCVAVAIL_SHIFT) |
902 INFINIPATH_I_ERROR | INFINIPATH_I_SPIOSENT | 902 INFINIPATH_I_ERROR | INFINIPATH_I_SPIOSENT |
903 INFINIPATH_I_SPIOBUFAVAIL | INFINIPATH_I_GPIO; 903 INFINIPATH_I_SPIOBUFAVAIL | INFINIPATH_I_GPIO;
904 infinipath_e_bitsextant = 904 dd->ipath_e_bitsextant =
905 INFINIPATH_E_RFORMATERR | INFINIPATH_E_RVCRC | 905 INFINIPATH_E_RFORMATERR | INFINIPATH_E_RVCRC |
906 INFINIPATH_E_RICRC | INFINIPATH_E_RMINPKTLEN | 906 INFINIPATH_E_RICRC | INFINIPATH_E_RMINPKTLEN |
907 INFINIPATH_E_RMAXPKTLEN | INFINIPATH_E_RLONGPKTLEN | 907 INFINIPATH_E_RMAXPKTLEN | INFINIPATH_E_RLONGPKTLEN |
@@ -919,8 +919,8 @@ static void ipath_init_pe_variables(void)
919 INFINIPATH_E_INVALIDADDR | INFINIPATH_E_RESET | 919 INFINIPATH_E_INVALIDADDR | INFINIPATH_E_RESET |
920 INFINIPATH_E_HARDWARE; 920 INFINIPATH_E_HARDWARE;
921 921
922 infinipath_i_rcvavail_mask = INFINIPATH_I_RCVAVAIL_MASK; 922 dd->ipath_i_rcvavail_mask = INFINIPATH_I_RCVAVAIL_MASK;
923 infinipath_i_rcvurg_mask = INFINIPATH_I_RCVURG_MASK; 923 dd->ipath_i_rcvurg_mask = INFINIPATH_I_RCVURG_MASK;
924} 924}
925 925
926/* setup the MSI stuff again after a reset. I'd like to just call 926/* setup the MSI stuff again after a reset. I'd like to just call
@@ -1326,6 +1326,6 @@ void ipath_init_iba6120_funcs(struct ipath_devdata *dd)
1326 dd->ipath_kregs = &ipath_pe_kregs; 1326 dd->ipath_kregs = &ipath_pe_kregs;
1327 dd->ipath_cregs = &ipath_pe_cregs; 1327 dd->ipath_cregs = &ipath_pe_cregs;
1328 1328
1329 ipath_init_pe_variables(); 1329 ipath_init_pe_variables(dd);
1330} 1330}
1331 1331
diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c b/drivers/infiniband/hw/ipath/ipath_intr.c
index b58d35e85b53..54b3dbc8195a 100644
--- a/drivers/infiniband/hw/ipath/ipath_intr.c
+++ b/drivers/infiniband/hw/ipath/ipath_intr.c
@@ -480,10 +480,10 @@ static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
480 dd->ipath_f_handle_hwerrors(dd, msg, sizeof msg); 480 dd->ipath_f_handle_hwerrors(dd, msg, sizeof msg);
481 } 481 }
482 482
483 if (!noprint && (errs & ~infinipath_e_bitsextant)) 483 if (!noprint && (errs & ~dd->ipath_e_bitsextant))
484 ipath_dev_err(dd, "error interrupt with unknown errors " 484 ipath_dev_err(dd, "error interrupt with unknown errors "
485 "%llx set\n", (unsigned long long) 485 "%llx set\n", (unsigned long long)
486 (errs & ~infinipath_e_bitsextant)); 486 (errs & ~dd->ipath_e_bitsextant));
487 487
488 if (errs & E_SUM_ERRS) 488 if (errs & E_SUM_ERRS)
489 ignore_this_time = handle_e_sum_errs(dd, errs); 489 ignore_this_time = handle_e_sum_errs(dd, errs);
@@ -805,9 +805,9 @@ static void handle_urcv(struct ipath_devdata *dd, u32 istat)
805 int rcvdint = 0; 805 int rcvdint = 0;
806 806
807 portr = ((istat >> INFINIPATH_I_RCVAVAIL_SHIFT) & 807 portr = ((istat >> INFINIPATH_I_RCVAVAIL_SHIFT) &
808 infinipath_i_rcvavail_mask) 808 dd->ipath_i_rcvavail_mask)
809 | ((istat >> INFINIPATH_I_RCVURG_SHIFT) & 809 | ((istat >> INFINIPATH_I_RCVURG_SHIFT) &
810 infinipath_i_rcvurg_mask); 810 dd->ipath_i_rcvurg_mask);
811 for (i = 1; i < dd->ipath_cfgports; i++) { 811 for (i = 1; i < dd->ipath_cfgports; i++) {
812 struct ipath_portdata *pd = dd->ipath_pd[i]; 812 struct ipath_portdata *pd = dd->ipath_pd[i];
813 if (portr & (1 << i) && pd && pd->port_cnt && 813 if (portr & (1 << i) && pd && pd->port_cnt &&
@@ -914,10 +914,10 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs)
914 if (unexpected) 914 if (unexpected)
915 unexpected = 0; 915 unexpected = 0;
916 916
917 if (unlikely(istat & ~infinipath_i_bitsextant)) 917 if (unlikely(istat & ~dd->ipath_i_bitsextant))
918 ipath_dev_err(dd, 918 ipath_dev_err(dd,
919 "interrupt with unknown interrupts %x set\n", 919 "interrupt with unknown interrupts %x set\n",
920 istat & (u32) ~ infinipath_i_bitsextant); 920 istat & (u32) ~ dd->ipath_i_bitsextant);
921 else 921 else
922 ipath_cdbg(VERBOSE, "intr stat=0x%x\n", istat); 922 ipath_cdbg(VERBOSE, "intr stat=0x%x\n", istat);
923 923
@@ -1041,9 +1041,9 @@ irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs)
1041 istat &= ~port0rbits; 1041 istat &= ~port0rbits;
1042 } 1042 }
1043 1043
1044 if (istat & ((infinipath_i_rcvavail_mask << 1044 if (istat & ((dd->ipath_i_rcvavail_mask <<
1045 INFINIPATH_I_RCVAVAIL_SHIFT) 1045 INFINIPATH_I_RCVAVAIL_SHIFT)
1046 | (infinipath_i_rcvurg_mask << 1046 | (dd->ipath_i_rcvurg_mask <<
1047 INFINIPATH_I_RCVURG_SHIFT))) 1047 INFINIPATH_I_RCVURG_SHIFT)))
1048 handle_urcv(dd, istat); 1048 handle_urcv(dd, istat);
1049 1049
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index a7342ce334a5..96e2bd8fb5f8 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -533,6 +533,30 @@ struct ipath_devdata {
533 u32 ipath_rxfc_unsupvl_errs; 533 u32 ipath_rxfc_unsupvl_errs;
534 u32 ipath_overrun_thresh_errs; 534 u32 ipath_overrun_thresh_errs;
535 u32 ipath_lli_errs; 535 u32 ipath_lli_errs;
536
537 /*
538 * Not all devices managed by a driver instance are the same
539 * type, so these fields must be per-device.
540 */
541 u64 ipath_i_bitsextant;
542 ipath_err_t ipath_e_bitsextant;
543 ipath_err_t ipath_hwe_bitsextant;
544
545 /*
546 * Below should be computable from number of ports,
547 * since they are never modified.
548 */
549 u32 ipath_i_rcvavail_mask;
550 u32 ipath_i_rcvurg_mask;
551
552 /*
553 * Register bits for selecting i2c direction and values, used for
554 * I2C serial flash.
555 */
556 u16 ipath_gpio_sda_num;
557 u16 ipath_gpio_scl_num;
558 u64 ipath_gpio_sda;
559 u64 ipath_gpio_scl;
536}; 560};
537 561
538/* Private data for file operations */ 562/* Private data for file operations */
diff --git a/drivers/infiniband/hw/ipath/ipath_registers.h b/drivers/infiniband/hw/ipath/ipath_registers.h
index 25c901e4a352..dffc76016d3c 100644
--- a/drivers/infiniband/hw/ipath/ipath_registers.h
+++ b/drivers/infiniband/hw/ipath/ipath_registers.h
@@ -316,6 +316,17 @@
316 316
317typedef u64 ipath_err_t; 317typedef u64 ipath_err_t;
318 318
319/* The following change with the type of device, so
320 * need to be part of the ipath_devdata struct, or
321 * we could have problems plugging in devices of
322 * different types (e.g. one HT, one PCIE)
323 * in one system, to be managed by one driver.
324 * On the other hand, this file is may also be included
325 * by other code, so leave the declarations here
326 * temporarily. Minor footprint issue if common-model
327 * linker used, none if C89+ linker used.
328 */
329
319/* mask of defined bits for various registers */ 330/* mask of defined bits for various registers */
320extern u64 infinipath_i_bitsextant; 331extern u64 infinipath_i_bitsextant;
321extern ipath_err_t infinipath_e_bitsextant, infinipath_hwe_bitsextant; 332extern ipath_err_t infinipath_e_bitsextant, infinipath_hwe_bitsextant;
@@ -324,13 +335,6 @@ extern ipath_err_t infinipath_e_bitsextant, infinipath_hwe_bitsextant;
324extern u32 infinipath_i_rcvavail_mask, infinipath_i_rcvurg_mask; 335extern u32 infinipath_i_rcvavail_mask, infinipath_i_rcvurg_mask;
325 336
326/* 337/*
327 * register bits for selecting i2c direction and values, used for I2C serial
328 * flash
329 */
330extern u16 ipath_gpio_sda_num, ipath_gpio_scl_num;
331extern u64 ipath_gpio_sda, ipath_gpio_scl;
332
333/*
334 * These are the infinipath general register numbers (not offsets). 338 * These are the infinipath general register numbers (not offsets).
335 * The kernel registers are used directly, those beyond the kernel 339 * The kernel registers are used directly, those beyond the kernel
336 * registers are calculated from one of the base registers. The use of 340 * registers are calculated from one of the base registers. The use of