brcmfmac: change parameters for brcmf_remove_interface()
authorArend van Spriel <arend@broadcom.com>
Wed, 26 Aug 2015 20:14:55 +0000 (22:14 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 29 Sep 2015 07:28:32 +0000 (10:28 +0300)
Just pass the interface to be removed, ie. the struct brcmf_if instance.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
drivers/net/wireless/brcm80211/brcmfmac/core.c
drivers/net/wireless/brcm80211/brcmfmac/core.h
drivers/net/wireless/brcm80211/brcmfmac/fweh.c
drivers/net/wireless/brcm80211/brcmfmac/p2p.c

index a293275c1b0bcffcc55265a55d091b3e17edf1af..0c29bf61bb82cb7f17e372def131636c6a0e7072 100644 (file)
@@ -4983,7 +4983,7 @@ brcmf_notify_connect_status_ap(struct brcmf_cfg80211_info *cfg,
                brcmf_dbg(CONN, "AP mode link down\n");
                complete(&cfg->vif_disabled);
                if (ifp->vif->mbss)
-                       brcmf_remove_interface(ifp->drvr, ifp->bssidx);
+                       brcmf_remove_interface(ifp);
                return 0;
        }
 
index 1f65ce867b1621867534d60a9fb820017ec59ede..157f0d7be350041b5c150b9b518baec996e36321 100644 (file)
@@ -887,12 +887,13 @@ static void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx)
        }
 }
 
-void brcmf_remove_interface(struct brcmf_pub *drvr, u32 bssidx)
+void brcmf_remove_interface(struct brcmf_if *ifp)
 {
-       if (drvr->iflist[bssidx]) {
-               brcmf_fws_del_interface(drvr->iflist[bssidx]);
-               brcmf_del_if(drvr, bssidx);
-       }
+       if (!ifp || WARN_ON(ifp->drvr->iflist[ifp->bssidx] != ifp))
+               return;
+
+       brcmf_fws_del_interface(ifp);
+       brcmf_del_if(ifp->drvr, ifp->bssidx);
 }
 
 int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr)
@@ -1122,7 +1123,7 @@ void brcmf_detach(struct device *dev)
 
        /* make sure primary interface removed last */
        for (i = BRCMF_MAX_IFS-1; i > -1; i--)
-               brcmf_remove_interface(drvr, i);
+               brcmf_remove_interface(drvr->iflist[i]);
 
        brcmf_cfg80211_detach(drvr->config);
 
index 1dc5b9684a9db172853c6edfb03ec5bbbb828da2..eb0c177be1db47667c2eab7cb5b663f6a691ea80 100644 (file)
@@ -206,7 +206,7 @@ struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx);
 int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
 struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx,
                              char *name, u8 *mac_addr);
-void brcmf_remove_interface(struct brcmf_pub *drvr, u32 bssidx);
+void brcmf_remove_interface(struct brcmf_if *ifp);
 int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr);
 void brcmf_txflowblock_if(struct brcmf_if *ifp,
                          enum brcmf_netif_stop_reason reason, bool state);
index ec62492ffa69fd3fefd6481b2ec2e152167b0e36..4d4cc2cd76684a93ce8d556964c7f2b5aeaf75d3 100644 (file)
@@ -222,7 +222,7 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
        err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data);
 
        if (ifp && ifevent->action == BRCMF_E_IF_DEL)
-               brcmf_remove_interface(drvr, ifevent->bssidx);
+               brcmf_remove_interface(ifp);
 }
 
 /**
index a9ba775a24c1c1eb6c17f3717e76e994d849f325..6a70c068fbc51edabad81c8b1269b618ec3a38d2 100644 (file)
@@ -2140,7 +2140,7 @@ static void brcmf_p2p_delete_p2pdev(struct brcmf_p2p_info *p2p,
 {
        cfg80211_unregister_wdev(&vif->wdev);
        p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL;
-       brcmf_remove_interface(vif->ifp->drvr, vif->ifp->bssidx);
+       brcmf_remove_interface(vif->ifp);
        brcmf_free_vif(vif);
 }