@@ -4532,6 +4532,9 @@ static int bnxt_hwrm_func_qcaps(struct bnxt *bp)
4532
4532
pf -> max_tx_wm_flows = le32_to_cpu (resp -> max_tx_wm_flows );
4533
4533
pf -> max_rx_em_flows = le32_to_cpu (resp -> max_rx_em_flows );
4534
4534
pf -> max_rx_wm_flows = le32_to_cpu (resp -> max_rx_wm_flows );
4535
+ if (resp -> flags &
4536
+ cpu_to_le32 (FUNC_QCAPS_RESP_FLAGS_WOL_MAGICPKT_SUPPORTED ))
4537
+ bp -> flags |= BNXT_FLAG_WOL_CAP ;
4535
4538
} else {
4536
4539
#ifdef CONFIG_BNXT_SRIOV
4537
4540
struct bnxt_vf_info * vf = & bp -> vf ;
@@ -5839,6 +5842,44 @@ static int bnxt_hwrm_port_led_qcaps(struct bnxt *bp)
5839
5842
return 0 ;
5840
5843
}
5841
5844
5845
+ static u16 bnxt_hwrm_get_wol_fltrs (struct bnxt * bp , u16 handle )
5846
+ {
5847
+ struct hwrm_wol_filter_qcfg_input req = {0 };
5848
+ struct hwrm_wol_filter_qcfg_output * resp = bp -> hwrm_cmd_resp_addr ;
5849
+ u16 next_handle = 0 ;
5850
+ int rc ;
5851
+
5852
+ bnxt_hwrm_cmd_hdr_init (bp , & req , HWRM_WOL_FILTER_QCFG , -1 , -1 );
5853
+ req .port_id = cpu_to_le16 (bp -> pf .port_id );
5854
+ req .handle = cpu_to_le16 (handle );
5855
+ mutex_lock (& bp -> hwrm_cmd_lock );
5856
+ rc = _hwrm_send_message (bp , & req , sizeof (req ), HWRM_CMD_TIMEOUT );
5857
+ if (!rc ) {
5858
+ next_handle = le16_to_cpu (resp -> next_handle );
5859
+ if (next_handle != 0 ) {
5860
+ if (resp -> wol_type ==
5861
+ WOL_FILTER_ALLOC_REQ_WOL_TYPE_MAGICPKT ) {
5862
+ bp -> wol = 1 ;
5863
+ bp -> wol_filter_id = resp -> wol_filter_id ;
5864
+ }
5865
+ }
5866
+ }
5867
+ mutex_unlock (& bp -> hwrm_cmd_lock );
5868
+ return next_handle ;
5869
+ }
5870
+
5871
+ static void bnxt_get_wol_settings (struct bnxt * bp )
5872
+ {
5873
+ u16 handle = 0 ;
5874
+
5875
+ if (!BNXT_PF (bp ) || !(bp -> flags & BNXT_FLAG_WOL_CAP ))
5876
+ return ;
5877
+
5878
+ do {
5879
+ handle = bnxt_hwrm_get_wol_fltrs (bp , handle );
5880
+ } while (handle && handle != 0xffff );
5881
+ }
5882
+
5842
5883
static bool bnxt_eee_config_ok (struct bnxt * bp )
5843
5884
{
5844
5885
struct ethtool_eee * eee = & bp -> eee ;
@@ -7575,6 +7616,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
7575
7616
if (rc )
7576
7617
goto init_err_pci_clean ;
7577
7618
7619
+ bnxt_get_wol_settings (bp );
7620
+
7578
7621
rc = register_netdev (dev );
7579
7622
if (rc )
7580
7623
goto init_err_clr_int ;
0 commit comments