diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-09-28 12:00:11 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-28 14:16:49 -0400 |
commit | f62fe77ad26b9c89c2028d96709f0f28793fe6cd (patch) | |
tree | c84a4b8b90219a5385299bd9dcd5b994cd1ff531 /drivers/infiniband/hw/ipath/ipath_iba6120.c | |
parent | 5659416207a9bcf35a646c7b798b290953e4891c (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/hw/ipath/ipath_iba6120.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_iba6120.c | 30 |
1 files changed, 15 insertions, 15 deletions
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 | ||
868 | static void ipath_init_pe_variables(void) | 868 | static 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 | ||