aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2013-05-27 15:09:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-05-28 13:43:09 -0400
commit24e28beef939df8666a5d2784d6617cd9bb910a0 (patch)
tree6ee01a05babb7d336390ab701ac44e98c86fc88e /drivers/net/wireless/brcm80211/brcmfmac/p2p.c
parent15a953d0919e3e7c94691ecabd0d9f74373f19aa (diff)
brcmfmac: add additional parameter to brcmf_free_vif()
Pass the struct brcmf_cfg80211_info instance instead of obtaining through vif itself using vif->wdev. This is needed as the netdev associated with this vif is already unregistered. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/p2p.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/p2p.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
index 17275ceb686c..167b7afdf0d8 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
@@ -1955,21 +1955,21 @@ s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg)
1955 err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1); 1955 err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1);
1956 if (err < 0) { 1956 if (err < 0) {
1957 brcmf_err("set p2p_disc error\n"); 1957 brcmf_err("set p2p_disc error\n");
1958 brcmf_free_vif(p2p_vif); 1958 brcmf_free_vif(cfg, p2p_vif);
1959 goto exit; 1959 goto exit;
1960 } 1960 }
1961 /* obtain bsscfg index for P2P discovery */ 1961 /* obtain bsscfg index for P2P discovery */
1962 err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bssidx); 1962 err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bssidx);
1963 if (err < 0) { 1963 if (err < 0) {
1964 brcmf_err("retrieving discover bsscfg index failed\n"); 1964 brcmf_err("retrieving discover bsscfg index failed\n");
1965 brcmf_free_vif(p2p_vif); 1965 brcmf_free_vif(cfg, p2p_vif);
1966 goto exit; 1966 goto exit;
1967 } 1967 }
1968 /* Verify that firmware uses same bssidx as driver !! */ 1968 /* Verify that firmware uses same bssidx as driver !! */
1969 if (p2p_ifp->bssidx != bssidx) { 1969 if (p2p_ifp->bssidx != bssidx) {
1970 brcmf_err("Incorrect bssidx=%d, compared to p2p_ifp->bssidx=%d\n", 1970 brcmf_err("Incorrect bssidx=%d, compared to p2p_ifp->bssidx=%d\n",
1971 bssidx, p2p_ifp->bssidx); 1971 bssidx, p2p_ifp->bssidx);
1972 brcmf_free_vif(p2p_vif); 1972 brcmf_free_vif(cfg, p2p_vif);
1973 goto exit; 1973 goto exit;
1974 } 1974 }
1975 1975
@@ -1997,7 +1997,7 @@ void brcmf_p2p_detach(struct brcmf_p2p_info *p2p)
1997 brcmf_p2p_cancel_remain_on_channel(vif->ifp); 1997 brcmf_p2p_cancel_remain_on_channel(vif->ifp);
1998 brcmf_p2p_deinit_discovery(p2p); 1998 brcmf_p2p_deinit_discovery(p2p);
1999 /* remove discovery interface */ 1999 /* remove discovery interface */
2000 brcmf_free_vif(vif); 2000 brcmf_free_vif(p2p->cfg, vif);
2001 p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; 2001 p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL;
2002 } 2002 }
2003 /* just set it all to zero */ 2003 /* just set it all to zero */
@@ -2222,7 +2222,7 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p,
2222 return &p2p_vif->wdev; 2222 return &p2p_vif->wdev;
2223 2223
2224fail: 2224fail:
2225 brcmf_free_vif(p2p_vif); 2225 brcmf_free_vif(p2p->cfg, p2p_vif);
2226 return ERR_PTR(err); 2226 return ERR_PTR(err);
2227} 2227}
2228 2228
@@ -2231,13 +2231,12 @@ fail:
2231 * 2231 *
2232 * @vif: virtual interface object to delete. 2232 * @vif: virtual interface object to delete.
2233 */ 2233 */
2234static void brcmf_p2p_delete_p2pdev(struct brcmf_cfg80211_vif *vif) 2234static void brcmf_p2p_delete_p2pdev(struct brcmf_cfg80211_info *cfg,
2235 struct brcmf_cfg80211_vif *vif)
2235{ 2236{
2236 struct brcmf_p2p_info *p2p = &vif->ifp->drvr->config->p2p;
2237
2238 cfg80211_unregister_wdev(&vif->wdev); 2237 cfg80211_unregister_wdev(&vif->wdev);
2239 p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; 2238 cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL;
2240 brcmf_free_vif(vif); 2239 brcmf_free_vif(cfg, vif);
2241} 2240}
2242 2241
2243/** 2242/**
@@ -2328,7 +2327,7 @@ struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name,
2328 return &ifp->vif->wdev; 2327 return &ifp->vif->wdev;
2329 2328
2330fail: 2329fail:
2331 brcmf_free_vif(vif); 2330 brcmf_free_vif(cfg, vif);
2332 return ERR_PTR(err); 2331 return ERR_PTR(err);
2333} 2332}
2334 2333
@@ -2364,7 +2363,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev)
2364 break; 2363 break;
2365 2364
2366 case NL80211_IFTYPE_P2P_DEVICE: 2365 case NL80211_IFTYPE_P2P_DEVICE:
2367 brcmf_p2p_delete_p2pdev(vif); 2366 brcmf_p2p_delete_p2pdev(cfg, vif);
2368 return 0; 2367 return 0;
2369 default: 2368 default:
2370 return -ENOTSUPP; 2369 return -ENOTSUPP;
@@ -2392,7 +2391,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev)
2392 err = 0; 2391 err = 0;
2393 } 2392 }
2394 brcmf_cfg80211_arm_vif_event(cfg, NULL); 2393 brcmf_cfg80211_arm_vif_event(cfg, NULL);
2395 brcmf_free_vif(vif); 2394 brcmf_free_vif(cfg, vif);
2396 p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL; 2395 p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL;
2397 2396
2398 return err; 2397 return err;