aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorDmitry Kravkov <dmitry@broadcom.com>2011-11-12 23:34:24 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-13 16:03:54 -0500
commitb306f5edf6615d3abeba16914872c24c9be29051 (patch)
treea21769a5afdbadacd35aeed65179a601634b323d /drivers/net/ethernet
parentad756594a8d88ffc048d14b8d5c02971e08856ce (diff)
bnx2x: separate FCoE and iSCSI license initialization.
FCoE license info must be initialized at probe(), but iSCSI at open(). 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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h10
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c45
3 files changed, 46 insertions, 11 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index f946a6ea8909..3f80c11a29a7 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -1934,6 +1934,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
1934 mod_timer(&bp->timer, jiffies + bp->current_interval); 1934 mod_timer(&bp->timer, jiffies + bp->current_interval);
1935 1935
1936#ifdef BCM_CNIC 1936#ifdef BCM_CNIC
1937 /* re-read iscsi info */
1938 bnx2x_get_iscsi_info(bp);
1937 bnx2x_setup_cnic_irq_info(bp); 1939 bnx2x_setup_cnic_irq_info(bp);
1938 if (bp->state == BNX2X_STATE_OPEN) 1940 if (bp->state == BNX2X_STATE_OPEN)
1939 bnx2x_cnic_notify(bp, CNIC_CTL_START_CMD); 1941 bnx2x_cnic_notify(bp, CNIC_CTL_START_CMD);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
index 4a16757793f4..c1d7833c42e6 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -1489,4 +1489,14 @@ static inline u16 bnx2x_extract_max_cfg(struct bnx2x *bp, u32 mf_cfg)
1489 return max_cfg; 1489 return max_cfg;
1490} 1490}
1491 1491
1492#ifdef BCM_CNIC
1493/**
1494 * bnx2x_get_iscsi_info - update iSCSI params according to licensing info.
1495 *
1496 * @bp: driver handle
1497 *
1498 */
1499void bnx2x_get_iscsi_info(struct bnx2x *bp);
1500#endif
1501
1492#endif /* BNX2X_CMN_H */ 1502#endif /* BNX2X_CMN_H */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 1d185f2fc1e8..26dc539ef290 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -9268,21 +9268,38 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp)
9268} 9268}
9269 9269
9270#ifdef BCM_CNIC 9270#ifdef BCM_CNIC
9271static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp) 9271void bnx2x_get_iscsi_info(struct bnx2x *bp)
9272{ 9272{
9273 int port = BP_PORT(bp); 9273 int port = BP_PORT(bp);
9274 int func = BP_ABS_FUNC(bp);
9275 9274
9276 u32 max_iscsi_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp, 9275 u32 max_iscsi_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp,
9277 drv_lic_key[port].max_iscsi_conn); 9276 drv_lic_key[port].max_iscsi_conn);
9278 u32 max_fcoe_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp,
9279 drv_lic_key[port].max_fcoe_conn);
9280 9277
9281 /* Get the number of maximum allowed iSCSI and FCoE connections */ 9278 /* Get the number of maximum allowed iSCSI connections */
9282 bp->cnic_eth_dev.max_iscsi_conn = 9279 bp->cnic_eth_dev.max_iscsi_conn =
9283 (max_iscsi_conn & BNX2X_MAX_ISCSI_INIT_CONN_MASK) >> 9280 (max_iscsi_conn & BNX2X_MAX_ISCSI_INIT_CONN_MASK) >>
9284 BNX2X_MAX_ISCSI_INIT_CONN_SHIFT; 9281 BNX2X_MAX_ISCSI_INIT_CONN_SHIFT;
9285 9282
9283 BNX2X_DEV_INFO("max_iscsi_conn 0x%x\n",
9284 bp->cnic_eth_dev.max_iscsi_conn);
9285
9286 /*
9287 * If maximum allowed number of connections is zero -
9288 * disable the feature.
9289 */
9290 if (!bp->cnic_eth_dev.max_iscsi_conn)
9291 bp->flags |= NO_ISCSI_FLAG;
9292}
9293
9294static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp)
9295{
9296 int port = BP_PORT(bp);
9297 int func = BP_ABS_FUNC(bp);
9298
9299 u32 max_fcoe_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp,
9300 drv_lic_key[port].max_fcoe_conn);
9301
9302 /* Get the number of maximum allowed FCoE connections */
9286 bp->cnic_eth_dev.max_fcoe_conn = 9303 bp->cnic_eth_dev.max_fcoe_conn =
9287 (max_fcoe_conn & BNX2X_MAX_FCOE_INIT_CONN_MASK) >> 9304 (max_fcoe_conn & BNX2X_MAX_FCOE_INIT_CONN_MASK) >>
9288 BNX2X_MAX_FCOE_INIT_CONN_SHIFT; 9305 BNX2X_MAX_FCOE_INIT_CONN_SHIFT;
@@ -9334,20 +9351,26 @@ static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp)
9334 } 9351 }
9335 } 9352 }
9336 9353
9337 BNX2X_DEV_INFO("max_iscsi_conn 0x%x max_fcoe_conn 0x%x\n", 9354 BNX2X_DEV_INFO("max_fcoe_conn 0x%x\n", bp->cnic_eth_dev.max_fcoe_conn);
9338 bp->cnic_eth_dev.max_iscsi_conn,
9339 bp->cnic_eth_dev.max_fcoe_conn);
9340 9355
9341 /* 9356 /*
9342 * If maximum allowed number of connections is zero - 9357 * If maximum allowed number of connections is zero -
9343 * disable the feature. 9358 * disable the feature.
9344 */ 9359 */
9345 if (!bp->cnic_eth_dev.max_iscsi_conn)
9346 bp->flags |= NO_ISCSI_OOO_FLAG | NO_ISCSI_FLAG;
9347
9348 if (!bp->cnic_eth_dev.max_fcoe_conn) 9360 if (!bp->cnic_eth_dev.max_fcoe_conn)
9349 bp->flags |= NO_FCOE_FLAG; 9361 bp->flags |= NO_FCOE_FLAG;
9350} 9362}
9363
9364static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp)
9365{
9366 /*
9367 * iSCSI may be dynamically disabled but reading
9368 * info here we will decrease memory usage by driver
9369 * if the feature is disabled for good
9370 */
9371 bnx2x_get_iscsi_info(bp);
9372 bnx2x_get_fcoe_info(bp);
9373}
9351#endif 9374#endif
9352 9375
9353static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp) 9376static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)