Index: head/sys/dev/bnxt/bnxt.h =================================================================== --- head/sys/dev/bnxt/bnxt.h +++ head/sys/dev/bnxt/bnxt.h @@ -102,7 +102,8 @@ #define BNXT_GET_RSS_PROFILE_ID(rss_hash_type) ((rss_hash_type >> 1) & 0x1F) #define BNXT_NO_MORE_WOL_FILTERS 0xFFFF -#define bnxt_wol_supported(softc) ((softc)->flags & BNXT_FLAG_WOL_CAP) +#define bnxt_wol_supported(softc) (!((softc)->flags & BNXT_FLAG_VF) && \ + ((softc)->flags & BNXT_FLAG_WOL_CAP )) /* Completion related defines */ #define CMP_VALID(cmp, v_bit) \ @@ -393,7 +394,6 @@ bus_addr_t hwrm_cmd_req_dma_addr; }; -#define BNXT_FLAG_VF (1<<1) #define BNXT_PF(softc) (!((softc)->flags & BNXT_FLAG_VF)) #define BNXT_VF(softc) ((softc)->flags & BNXT_FLAG_VF) @@ -536,8 +536,9 @@ struct bnxt_bar_info hwrm_bar; struct bnxt_bar_info doorbell_bar; struct bnxt_link_info link_info; -#define BNXT_FLAG_NPAR 0x1 -#define BNXT_FLAG_WOL_CAP 0x2 +#define BNXT_FLAG_VF 0x0001 +#define BNXT_FLAG_NPAR 0x0002 +#define BNXT_FLAG_WOL_CAP 0x0004 uint32_t flags; uint32_t total_msix; Index: head/sys/dev/bnxt/bnxt_hwrm.h =================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.h +++ head/sys/dev/bnxt/bnxt_hwrm.h @@ -61,7 +61,7 @@ int bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); int bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, uint32_t hash_type); -int bnxt_hwrm_func_cfg(struct bnxt_softc *softc); +int bnxt_cfg_async_cr(struct bnxt_softc *softc); int bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, uint32_t flags); int bnxt_hwrm_nvm_find_dir_entry(struct bnxt_softc *softc, uint16_t type, Index: head/sys/dev/bnxt/bnxt_hwrm.c =================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c +++ head/sys/dev/bnxt/bnxt_hwrm.c @@ -949,18 +949,32 @@ } int -bnxt_hwrm_func_cfg(struct bnxt_softc *softc) +bnxt_cfg_async_cr(struct bnxt_softc *softc) { - struct hwrm_func_cfg_input req = {0}; + int rc = 0; + + if (BNXT_PF(softc)) { + struct hwrm_func_cfg_input req = {0}; - bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG); + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG); - req.fid = 0xffff; - req.enables = htole32(HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); + req.fid = 0xffff; + req.enables = htole32(HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); + req.async_event_cr = softc->def_cp_ring.ring.phys_id; - req.async_event_cr = softc->def_cp_ring.ring.phys_id; + rc = hwrm_send_message(softc, &req, sizeof(req)); + } + else { + struct hwrm_func_vf_cfg_input req = {0}; - return hwrm_send_message(softc, &req, sizeof(req)); + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_VF_CFG); + + req.enables = htole32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); + req.async_event_cr = softc->def_cp_ring.ring.phys_id; + + rc = hwrm_send_message(softc, &req, sizeof(req)); + } + return rc; } int @@ -1719,4 +1733,3 @@ return hwrm_send_message(softc, &req, sizeof(req)); } - Index: head/sys/dev/bnxt/if_bnxt.c =================================================================== --- head/sys/dev/bnxt/if_bnxt.c +++ head/sys/dev/bnxt/if_bnxt.c @@ -657,7 +657,7 @@ scctx = softc->scctx; /* TODO: Better way of detecting NPAR/VF is needed */ - switch (softc->sctx->isc_vendor_info->pvi_device_id) { + switch (pci_get_device(softc->dev)) { case BCM57402_NPAR: case BCM57404_NPAR: case BCM57406_NPAR: @@ -980,7 +980,7 @@ goto fail; /* And now set the default CP ring as the async CP ring */ - rc = bnxt_hwrm_func_cfg(softc); + rc = bnxt_cfg_async_cr(softc); if (rc) goto fail;