aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_main.c
diff options
context:
space:
mode:
authorEilon Greenstein <eilong@broadcom.com>2009-02-12 03:36:23 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-16 02:31:09 -0500
commitf1ef27ef42dc946a255de4cc7b878630011735d8 (patch)
tree031a60a38dc99a51f4d794d70bfb95f22c0b1521 /drivers/net/bnx2x_main.c
parent0f00846deb9c9eaaeb4668b81496b783a04a241f (diff)
bnx2x: Disabling interrupts after iSCSI-boot
Before initializing the chip after iSCSI boot, the interrupts of the function that was used to boot must be disabled. That means that the driver needs to set the chip as if it is the iSCSI PCI function - this bug is exposed only with MSI Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r--drivers/net/bnx2x_main.c61
1 files changed, 59 insertions, 2 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 312f652872b4..ea7d86d2da92 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -7006,6 +7006,64 @@ reset_task_exit:
7006 * Init service functions 7006 * Init service functions
7007 */ 7007 */
7008 7008
7009static inline u32 bnx2x_get_pretend_reg(struct bnx2x *bp, int func)
7010{
7011 switch (func) {
7012 case 0: return PXP2_REG_PGL_PRETEND_FUNC_F0;
7013 case 1: return PXP2_REG_PGL_PRETEND_FUNC_F1;
7014 case 2: return PXP2_REG_PGL_PRETEND_FUNC_F2;
7015 case 3: return PXP2_REG_PGL_PRETEND_FUNC_F3;
7016 case 4: return PXP2_REG_PGL_PRETEND_FUNC_F4;
7017 case 5: return PXP2_REG_PGL_PRETEND_FUNC_F5;
7018 case 6: return PXP2_REG_PGL_PRETEND_FUNC_F6;
7019 case 7: return PXP2_REG_PGL_PRETEND_FUNC_F7;
7020 default:
7021 BNX2X_ERR("Unsupported function index: %d\n", func);
7022 return (u32)(-1);
7023 }
7024}
7025
7026static void bnx2x_undi_int_disable_e1h(struct bnx2x *bp, int orig_func)
7027{
7028 u32 reg = bnx2x_get_pretend_reg(bp, orig_func), new_val;
7029
7030 /* Flush all outstanding writes */
7031 mmiowb();
7032
7033 /* Pretend to be function 0 */
7034 REG_WR(bp, reg, 0);
7035 /* Flush the GRC transaction (in the chip) */
7036 new_val = REG_RD(bp, reg);
7037 if (new_val != 0) {
7038 BNX2X_ERR("Hmmm... Pretend register wasn't updated: (0,%d)!\n",
7039 new_val);
7040 BUG();
7041 }
7042
7043 /* From now we are in the "like-E1" mode */
7044 bnx2x_int_disable(bp);
7045
7046 /* Flush all outstanding writes */
7047 mmiowb();
7048
7049 /* Restore the original funtion settings */
7050 REG_WR(bp, reg, orig_func);
7051 new_val = REG_RD(bp, reg);
7052 if (new_val != orig_func) {
7053 BNX2X_ERR("Hmmm... Pretend register wasn't updated: (%d,%d)!\n",
7054 orig_func, new_val);
7055 BUG();
7056 }
7057}
7058
7059static inline void bnx2x_undi_int_disable(struct bnx2x *bp, int func)
7060{
7061 if (CHIP_IS_E1H(bp))
7062 bnx2x_undi_int_disable_e1h(bp, func);
7063 else
7064 bnx2x_int_disable(bp);
7065}
7066
7009static void __devinit bnx2x_undi_unload(struct bnx2x *bp) 7067static void __devinit bnx2x_undi_unload(struct bnx2x *bp)
7010{ 7068{
7011 u32 val; 7069 u32 val;
@@ -7056,8 +7114,7 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp)
7056 /* now it's safe to release the lock */ 7114 /* now it's safe to release the lock */
7057 bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); 7115 bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI);
7058 7116
7059 REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 : 7117 bnx2x_undi_int_disable(bp, func);
7060 HC_REG_CONFIG_0), 0x1000);
7061 7118
7062 /* close input traffic and wait for it */ 7119 /* close input traffic and wait for it */
7063 /* Do not rcv packets to BRB */ 7120 /* Do not rcv packets to BRB */