Skip to content

Commit 25be862

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Set async event bits when registering with the firmware.
Currently, the driver only sets bit 0 of the async_event_fwd fields. To be compatible with the latest spec, we need to set the appropriate event bits handled by the driver. We should be handling link change and PF driver unload events, so these 2 bits should be set. Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 72b34f0 commit 25be862

File tree

1 file changed

+14
-4
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+14
-4
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ static const u16 bnxt_vf_req_snif[] = {
118118
HWRM_CFA_L2_FILTER_ALLOC,
119119
};
120120

121+
static const u16 bnxt_async_events_arr[] = {
122+
HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE,
123+
HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD,
124+
};
125+
121126
static bool bnxt_vf_pciid(enum board_idx idx)
122127
{
123128
return (idx == BCM57304_VF || idx == BCM57404_VF);
@@ -2751,6 +2756,8 @@ static int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp)
27512756
{
27522757
struct hwrm_func_drv_rgtr_input req = {0};
27532758
int i;
2759+
DECLARE_BITMAP(async_events_bmap, 256);
2760+
u32 *events = (u32 *)async_events_bmap;
27542761

27552762
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_DRV_RGTR, -1, -1);
27562763

@@ -2759,10 +2766,13 @@ static int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp)
27592766
FUNC_DRV_RGTR_REQ_ENABLES_VER |
27602767
FUNC_DRV_RGTR_REQ_ENABLES_ASYNC_EVENT_FWD);
27612768

2762-
/* TODO: current async event fwd bits are not defined and the firmware
2763-
* only checks if it is non-zero to enable async event forwarding
2764-
*/
2765-
req.async_event_fwd[0] |= cpu_to_le32(1);
2769+
memset(async_events_bmap, 0, sizeof(async_events_bmap));
2770+
for (i = 0; i < ARRAY_SIZE(bnxt_async_events_arr); i++)
2771+
__set_bit(bnxt_async_events_arr[i], async_events_bmap);
2772+
2773+
for (i = 0; i < 8; i++)
2774+
req.async_event_fwd[i] |= cpu_to_le32(events[i]);
2775+
27662776
req.os_type = cpu_to_le16(FUNC_DRV_RGTR_REQ_OS_TYPE_LINUX);
27672777
req.ver_maj = DRV_VER_MAJ;
27682778
req.ver_min = DRV_VER_MIN;

0 commit comments

Comments
 (0)