aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.c66
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.h1
2 files changed, 30 insertions, 37 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 09d663762475..a3be41a2af26 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1324,15 +1324,6 @@ next_rx_no_prod:
1324 ((data) & \ 1324 ((data) & \
1325 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK) 1325 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK)
1326 1326
1327#define BNXT_EVENT_POLICY_MASK \
1328 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK
1329
1330#define BNXT_EVENT_POLICY_SFT \
1331 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT
1332
1333#define BNXT_GET_EVENT_POLICY(data) \
1334 (((data) & BNXT_EVENT_POLICY_MASK) >> BNXT_EVENT_POLICY_SFT)
1335
1336static int bnxt_async_event_process(struct bnxt *bp, 1327static int bnxt_async_event_process(struct bnxt *bp,
1337 struct hwrm_async_event_cmpl *cmpl) 1328 struct hwrm_async_event_cmpl *cmpl)
1338{ 1329{
@@ -1371,9 +1362,6 @@ static int bnxt_async_event_process(struct bnxt *bp,
1371 if (bp->pf.port_id != port_id) 1362 if (bp->pf.port_id != port_id)
1372 break; 1363 break;
1373 1364
1374 bp->link_info.last_port_module_event =
1375 BNXT_GET_EVENT_POLICY(data1);
1376
1377 set_bit(BNXT_HWRM_PORT_MODULE_SP_EVENT, &bp->sp_event); 1365 set_bit(BNXT_HWRM_PORT_MODULE_SP_EVENT, &bp->sp_event);
1378 break; 1366 break;
1379 } 1367 }
@@ -4788,6 +4776,33 @@ static int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
4788 return 0; 4776 return 0;
4789} 4777}
4790 4778
4779static void bnxt_get_port_module_status(struct bnxt *bp)
4780{
4781 struct bnxt_link_info *link_info = &bp->link_info;
4782 struct hwrm_port_phy_qcfg_output *resp = &link_info->phy_qcfg_resp;
4783 u8 module_status;
4784
4785 if (bnxt_update_link(bp, true))
4786 return;
4787
4788 module_status = link_info->module_status;
4789 switch (module_status) {
4790 case PORT_PHY_QCFG_RESP_MODULE_STATUS_DISABLETX:
4791 case PORT_PHY_QCFG_RESP_MODULE_STATUS_PWRDOWN:
4792 case PORT_PHY_QCFG_RESP_MODULE_STATUS_WARNINGMSG:
4793 netdev_warn(bp->dev, "Unqualified SFP+ module detected on port %d\n",
4794 bp->pf.port_id);
4795 if (bp->hwrm_spec_code >= 0x10201) {
4796 netdev_warn(bp->dev, "Module part number %s\n",
4797 resp->phy_vendor_partnumber);
4798 }
4799 if (module_status == PORT_PHY_QCFG_RESP_MODULE_STATUS_DISABLETX)
4800 netdev_warn(bp->dev, "TX is disabled\n");
4801 if (module_status == PORT_PHY_QCFG_RESP_MODULE_STATUS_PWRDOWN)
4802 netdev_warn(bp->dev, "SFP+ module is shutdown\n");
4803 }
4804}
4805
4791static void 4806static void
4792bnxt_hwrm_set_pause_common(struct bnxt *bp, struct hwrm_port_phy_cfg_input *req) 4807bnxt_hwrm_set_pause_common(struct bnxt *bp, struct hwrm_port_phy_cfg_input *req)
4793{ 4808{
@@ -5080,7 +5095,8 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
5080 /* Enable TX queues */ 5095 /* Enable TX queues */
5081 bnxt_tx_enable(bp); 5096 bnxt_tx_enable(bp);
5082 mod_timer(&bp->timer, jiffies + bp->current_interval); 5097 mod_timer(&bp->timer, jiffies + bp->current_interval);
5083 bnxt_update_link(bp, true); 5098 /* Poll link status and check for SFP+ module status */
5099 bnxt_get_port_module_status(bp);
5084 5100
5085 return 0; 5101 return 0;
5086 5102
@@ -5615,28 +5631,6 @@ bnxt_restart_timer:
5615 mod_timer(&bp->timer, jiffies + bp->current_interval); 5631 mod_timer(&bp->timer, jiffies + bp->current_interval);
5616} 5632}
5617 5633
5618static void bnxt_port_module_event(struct bnxt *bp)
5619{
5620 struct bnxt_link_info *link_info = &bp->link_info;
5621 struct hwrm_port_phy_qcfg_output *resp = &link_info->phy_qcfg_resp;
5622
5623 if (bnxt_update_link(bp, true))
5624 return;
5625
5626 if (link_info->last_port_module_event != 0) {
5627 netdev_warn(bp->dev, "Unqualified SFP+ module detected on port %d\n",
5628 bp->pf.port_id);
5629 if (bp->hwrm_spec_code >= 0x10201) {
5630 netdev_warn(bp->dev, "Module part number %s\n",
5631 resp->phy_vendor_partnumber);
5632 }
5633 }
5634 if (link_info->last_port_module_event == 1)
5635 netdev_warn(bp->dev, "TX is disabled\n");
5636 if (link_info->last_port_module_event == 3)
5637 netdev_warn(bp->dev, "Shutdown SFP+ module\n");
5638}
5639
5640static void bnxt_cfg_ntp_filters(struct bnxt *); 5634static void bnxt_cfg_ntp_filters(struct bnxt *);
5641 5635
5642static void bnxt_sp_task(struct work_struct *work) 5636static void bnxt_sp_task(struct work_struct *work)
@@ -5685,7 +5679,7 @@ static void bnxt_sp_task(struct work_struct *work)
5685 } 5679 }
5686 5680
5687 if (test_and_clear_bit(BNXT_HWRM_PORT_MODULE_SP_EVENT, &bp->sp_event)) 5681 if (test_and_clear_bit(BNXT_HWRM_PORT_MODULE_SP_EVENT, &bp->sp_event))
5688 bnxt_port_module_event(bp); 5682 bnxt_get_port_module_status(bp);
5689 5683
5690 if (test_and_clear_bit(BNXT_PERIODIC_STATS_SP_EVENT, &bp->sp_event)) 5684 if (test_and_clear_bit(BNXT_PERIODIC_STATS_SP_EVENT, &bp->sp_event))
5691 bnxt_hwrm_port_qstats(bp); 5685 bnxt_hwrm_port_qstats(bp);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 2e4ba7216548..2824d65b2e35 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -850,7 +850,6 @@ struct bnxt_link_info {
850 u32 advertising; 850 u32 advertising;
851 bool force_link_chng; 851 bool force_link_chng;
852 852
853 u8 last_port_module_event;
854 /* a copy of phy_qcfg output used to report link 853 /* a copy of phy_qcfg output used to report link
855 * info to VF 854 * info to VF
856 */ 855 */