Skip to content

Commit

Permalink
brcmfmac: ignore IF event if it is a add for ifidx 0
Browse files Browse the repository at this point in the history
Firmware fires IF event to add the primary interface but that
is already created in the driver.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Arend van Spriel authored and John W. Linville committed Nov 16, 2012
1 parent b6f06f6 commit b522dd8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
15 changes: 10 additions & 5 deletions drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,12 +696,17 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, int ifidx, s32 bssidx,
* in case we missed the BRCMF_E_IF_DEL event.
*/
if (ifp) {
brcmf_dbg(ERROR, "ERROR: netdev:%s already exists, try free & unregister\n",
brcmf_dbg(ERROR, "ERROR: netdev:%s already exists\n",
ifp->ndev->name);
netif_stop_queue(ifp->ndev);
unregister_netdev(ifp->ndev);
free_netdev(ifp->ndev);
drvr->iflist[ifidx] = NULL;
if (ifidx) {
netif_stop_queue(ifp->ndev);
unregister_netdev(ifp->ndev);
free_netdev(ifp->ndev);
drvr->iflist[ifidx] = NULL;
} else {
brcmf_dbg(ERROR, "ignore IF event\n");
return ERR_PTR(-EINVAL);
}
}

/* Allocate netdev, including space for private structure */
Expand Down
7 changes: 5 additions & 2 deletions drivers/net/wireless/brcm80211/brcmfmac/fweh.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ int brcmf_fweh_register(struct brcmf_pub *drvr, enum brcmf_fweh_event_code code,
return -ENOSPC;
}
drvr->fweh.evt_handler[code] = handler;
brcmf_dbg(TRACE, "event handler registered for code %d\n", code);
brcmf_dbg(TRACE, "event handler registered for %s\n",
brcmf_fweh_event_name(code));
return 0;
}

Expand All @@ -415,7 +416,8 @@ int brcmf_fweh_register(struct brcmf_pub *drvr, enum brcmf_fweh_event_code code,
void brcmf_fweh_unregister(struct brcmf_pub *drvr,
enum brcmf_fweh_event_code code)
{
brcmf_dbg(TRACE, "event handler cleared for code %d\n", code);
brcmf_dbg(TRACE, "event handler cleared for %s\n",
brcmf_fweh_event_name(code));
drvr->fweh.evt_handler[code] = NULL;
}

Expand All @@ -438,6 +440,7 @@ int brcmf_fweh_activate_events(struct brcmf_if *ifp)
}

/* want to handle IF event as well */
brcmf_dbg(EVENT, "enable event IF\n");
setbit(eventmask, BRCMF_E_IF);

err = brcmf_fil_iovar_data_set(ifp, "event_msgs",
Expand Down

0 comments on commit b522dd8

Please sign in to comment.