]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnx2x: properly initialize L5 features
authorJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 13:11:07 +0000 (21:11 +0800)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 14:41:13 +0000 (22:41 +0800)
The code is missing initialization of NO_FCOE_FLAG and NO_ISCSI*FLAGS
when CONFIG_CNIC is not selected.
This causes panic during driver load since commit
1d187b34daaecbb87aa523ba46b92930a388cb21 where NO_FCOE tested
unconditionally (outside #ifdef BCM_CNIC  structure) and
accessed fp[FCOE_IDX] which is not allocated.

(backported from commit 7185bb335a1493f0ce27e9e94a1645a15db0fc0f)
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/bnx2x/bnx2x_cmn.h
drivers/net/bnx2x/bnx2x_main.c

index 22e0ba7a974f6dd4bd17aa64866961f77020d348..0d761e6d98dc0d8d67465690d1e9220cb29015d2 100644 (file)
@@ -1491,7 +1491,6 @@ static inline u16 bnx2x_extract_max_cfg(struct bnx2x *bp, int vn)
        return max_cfg ?: 100;
 }
 
-#ifdef BCM_CNIC
 /**
  * bnx2x_get_iscsi_info - update iSCSI params according to licensing info.
  *
@@ -1499,7 +1498,6 @@ static inline u16 bnx2x_extract_max_cfg(struct bnx2x *bp, int vn)
  *
  */
 void bnx2x_get_iscsi_info(struct bnx2x *bp);
-#endif
 
 /* returns func by VN for current port */
 static inline int func_by_vn(struct bnx2x *bp, int vn)
index 283c7bf535f43a49a2bffdda720e2d7c7c900557..904832b78371f19ee2137c4aec54444893027bcb 100644 (file)
@@ -9412,9 +9412,9 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp)
                                                        bp->common.shmem2_base);
 }
 
-#ifdef BCM_CNIC
 void bnx2x_get_iscsi_info(struct bnx2x *bp)
 {
+#ifdef BCM_CNIC
        int port = BP_PORT(bp);
 
        u32 max_iscsi_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp,
@@ -9434,10 +9434,14 @@ void bnx2x_get_iscsi_info(struct bnx2x *bp)
         */
        if (!bp->cnic_eth_dev.max_iscsi_conn)
                bp->flags |= NO_ISCSI_FLAG;
+#else
+       bp->flags |= NO_ISCSI_FLAG;
+#endif
 }
 
 static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp)
 {
+#ifdef BCM_CNIC
        int port = BP_PORT(bp);
        int func = BP_ABS_FUNC(bp);
 
@@ -9504,6 +9508,9 @@ static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp)
         */
        if (!bp->cnic_eth_dev.max_fcoe_conn)
                bp->flags |= NO_FCOE_FLAG;
+#else
+       bp->flags |= NO_FCOE_FLAG;
+#endif
 }
 
 static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp)
@@ -9516,7 +9523,6 @@ static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp)
        bnx2x_get_iscsi_info(bp);
        bnx2x_get_fcoe_info(bp);
 }
-#endif
 
 static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)
 {
@@ -9843,9 +9849,7 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp)
        /* Get MAC addresses */
        bnx2x_get_mac_hwinfo(bp);
 
-#ifdef BCM_CNIC
        bnx2x_get_cnic_info(bp);
-#endif
 
        /* Get current FW pulse sequence */
        if (!BP_NOMCP(bp)) {