diff options
author | Arend van Spriel <arend@broadcom.com> | 2012-10-22 13:36:21 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-29 15:28:24 -0400 |
commit | ec5a07d5c4a830f5339d7a808e20562e037059d1 (patch) | |
tree | e4d3a59ac7be4f829b7134db238aa685443956f9 /drivers | |
parent | 1ed9baf0f12168c8ba2410fd9ccd578f7867c564 (diff) |
brcmfmac: use bssidx from struct brcmf_if for bsscfg specific commands
The firmware interface has functions to send bsscfg specific commands
to the device. These functions currently have a bssidx parameter, but
that same information is stored in struct brcmf_if, which is in the
private data of the net_device parameter.
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/fwil.c | 27 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/fwil.h | 14 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 28 |
3 files changed, 33 insertions, 36 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwil.c b/drivers/net/wireless/brcm80211/brcmfmac/fwil.c index 8528937067dd..f4a6e7135f4b 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwil.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "dhd.h" | 26 | #include "dhd.h" |
27 | #include "dhd_bus.h" | 27 | #include "dhd_bus.h" |
28 | #include "dhd_dbg.h" | 28 | #include "dhd_dbg.h" |
29 | #include "fwil.h" | ||
29 | 30 | ||
30 | 31 | ||
31 | static s32 | 32 | static s32 |
@@ -263,7 +264,7 @@ brcmf_create_bsscfg(s32 bssidx, char *name, char *data, u32 datalen, char *buf, | |||
263 | } | 264 | } |
264 | 265 | ||
265 | s32 | 266 | s32 |
266 | brcmf_fil_bsscfg_data_set(struct net_device *ndev, s32 bssidx, char *name, | 267 | brcmf_fil_bsscfg_data_set(struct net_device *ndev, char *name, |
267 | void *data, u32 len) | 268 | void *data, u32 len) |
268 | { | 269 | { |
269 | struct brcmf_if *ifp = netdev_priv(ndev); | 270 | struct brcmf_if *ifp = netdev_priv(ndev); |
@@ -273,11 +274,11 @@ brcmf_fil_bsscfg_data_set(struct net_device *ndev, s32 bssidx, char *name, | |||
273 | 274 | ||
274 | mutex_lock(&drvr->proto_block); | 275 | mutex_lock(&drvr->proto_block); |
275 | 276 | ||
276 | brcmf_dbg(FIL, "bssidx=%d, name=%s, len=%d\n", bssidx, name, len); | 277 | brcmf_dbg(FIL, "bssidx=%d, name=%s, len=%d\n", ifp->bssidx, name, len); |
277 | brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, len, "data"); | 278 | brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, len, "data"); |
278 | 279 | ||
279 | buflen = brcmf_create_bsscfg(bssidx, name, data, len, drvr->proto_buf, | 280 | buflen = brcmf_create_bsscfg(ifp->bssidx, name, data, len, |
280 | sizeof(drvr->proto_buf)); | 281 | drvr->proto_buf, sizeof(drvr->proto_buf)); |
281 | if (buflen) { | 282 | if (buflen) { |
282 | err = brcmf_fil_cmd_data(ifp, BRCMF_C_SET_VAR, drvr->proto_buf, | 283 | err = brcmf_fil_cmd_data(ifp, BRCMF_C_SET_VAR, drvr->proto_buf, |
283 | buflen, true); | 284 | buflen, true); |
@@ -291,7 +292,7 @@ brcmf_fil_bsscfg_data_set(struct net_device *ndev, s32 bssidx, char *name, | |||
291 | } | 292 | } |
292 | 293 | ||
293 | s32 | 294 | s32 |
294 | brcmf_fil_bsscfg_data_get(struct net_device *ndev, s32 bssidx, char *name, | 295 | brcmf_fil_bsscfg_data_get(struct net_device *ndev, char *name, |
295 | void *data, u32 len) | 296 | void *data, u32 len) |
296 | { | 297 | { |
297 | struct brcmf_if *ifp = netdev_priv(ndev); | 298 | struct brcmf_if *ifp = netdev_priv(ndev); |
@@ -301,8 +302,8 @@ brcmf_fil_bsscfg_data_get(struct net_device *ndev, s32 bssidx, char *name, | |||
301 | 302 | ||
302 | mutex_lock(&drvr->proto_block); | 303 | mutex_lock(&drvr->proto_block); |
303 | 304 | ||
304 | buflen = brcmf_create_bsscfg(bssidx, name, NULL, len, drvr->proto_buf, | 305 | buflen = brcmf_create_bsscfg(ifp->bssidx, name, NULL, len, |
305 | sizeof(drvr->proto_buf)); | 306 | drvr->proto_buf, sizeof(drvr->proto_buf)); |
306 | if (buflen) { | 307 | if (buflen) { |
307 | err = brcmf_fil_cmd_data(ifp, BRCMF_C_GET_VAR, drvr->proto_buf, | 308 | err = brcmf_fil_cmd_data(ifp, BRCMF_C_GET_VAR, drvr->proto_buf, |
308 | buflen, false); | 309 | buflen, false); |
@@ -312,7 +313,7 @@ brcmf_fil_bsscfg_data_get(struct net_device *ndev, s32 bssidx, char *name, | |||
312 | err = -EPERM; | 313 | err = -EPERM; |
313 | brcmf_dbg(ERROR, "Creating bsscfg failed\n"); | 314 | brcmf_dbg(ERROR, "Creating bsscfg failed\n"); |
314 | } | 315 | } |
315 | brcmf_dbg(FIL, "bssidx=%d, name=%s, len=%d\n", bssidx, name, len); | 316 | brcmf_dbg(FIL, "bssidx=%d, name=%s, len=%d\n", ifp->bssidx, name, len); |
316 | brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, len, "data"); | 317 | brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, len, "data"); |
317 | 318 | ||
318 | mutex_unlock(&drvr->proto_block); | 319 | mutex_unlock(&drvr->proto_block); |
@@ -321,23 +322,21 @@ brcmf_fil_bsscfg_data_get(struct net_device *ndev, s32 bssidx, char *name, | |||
321 | } | 322 | } |
322 | 323 | ||
323 | s32 | 324 | s32 |
324 | brcmf_fil_bsscfg_int_set(struct net_device *ndev, s32 bssidx, char *name, | 325 | brcmf_fil_bsscfg_int_set(struct net_device *ndev, char *name, u32 data) |
325 | u32 data) | ||
326 | { | 326 | { |
327 | __le32 data_le = cpu_to_le32(data); | 327 | __le32 data_le = cpu_to_le32(data); |
328 | 328 | ||
329 | return brcmf_fil_bsscfg_data_set(ndev, bssidx, name, &data_le, | 329 | return brcmf_fil_bsscfg_data_set(ndev, name, &data_le, |
330 | sizeof(data_le)); | 330 | sizeof(data_le)); |
331 | } | 331 | } |
332 | 332 | ||
333 | s32 | 333 | s32 |
334 | brcmf_fil_bsscfg_int_get(struct net_device *ndev, s32 bssidx, char *name, | 334 | brcmf_fil_bsscfg_int_get(struct net_device *ndev, char *name, u32 *data) |
335 | u32 *data) | ||
336 | { | 335 | { |
337 | __le32 data_le = cpu_to_le32(*data); | 336 | __le32 data_le = cpu_to_le32(*data); |
338 | s32 err; | 337 | s32 err; |
339 | 338 | ||
340 | err = brcmf_fil_bsscfg_data_get(ndev, bssidx, name, &data_le, | 339 | err = brcmf_fil_bsscfg_data_get(ndev, name, &data_le, |
341 | sizeof(data_le)); | 340 | sizeof(data_le)); |
342 | if (err == 0) | 341 | if (err == 0) |
343 | *data = le32_to_cpu(data_le); | 342 | *data = le32_to_cpu(data_le); |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwil.h b/drivers/net/wireless/brcm80211/brcmfmac/fwil.h index 54855ef0f0a6..4d084997d291 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwil.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil.h | |||
@@ -31,13 +31,11 @@ s32 brcmf_fil_iovar_data_get(struct net_device *ndev, char *name, void *data, | |||
31 | s32 brcmf_fil_iovar_int_set(struct net_device *ndev, char *name, u32 data); | 31 | s32 brcmf_fil_iovar_int_set(struct net_device *ndev, char *name, u32 data); |
32 | s32 brcmf_fil_iovar_int_get(struct net_device *ndev, char *name, u32 *data); | 32 | s32 brcmf_fil_iovar_int_get(struct net_device *ndev, char *name, u32 *data); |
33 | 33 | ||
34 | s32 brcmf_fil_bsscfg_data_set(struct net_device *ndev, s32 bssidx, char *name, | 34 | s32 brcmf_fil_bsscfg_data_set(struct net_device *ndev, char *name, void *data, |
35 | void *data, u32 len); | 35 | u32 len); |
36 | s32 brcmf_fil_bsscfg_data_get(struct net_device *ndev, s32 bssidx, char *name, | 36 | s32 brcmf_fil_bsscfg_data_get(struct net_device *ndev, char *name, void *data, |
37 | void *data, u32 len); | 37 | u32 len); |
38 | s32 brcmf_fil_bsscfg_int_set(struct net_device *ndev, s32 bssidx, char *name, | 38 | s32 brcmf_fil_bsscfg_int_set(struct net_device *ndev, char *name, u32 data); |
39 | u32 data); | 39 | s32 brcmf_fil_bsscfg_int_get(struct net_device *ndev, char *name, u32 *data); |
40 | s32 brcmf_fil_bsscfg_int_get(struct net_device *ndev, s32 bssidx, char *name, | ||
41 | u32 *data); | ||
42 | 40 | ||
43 | #endif /* _fwil_h_ */ | 41 | #endif /* _fwil_h_ */ |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 30e9c127f9c1..cb491d9278f5 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -417,7 +417,7 @@ send_key_to_dongle(struct brcmf_cfg80211_info *cfg, s32 bssidx, | |||
417 | 417 | ||
418 | brcmf_netdev_wait_pend8021x(ndev); | 418 | brcmf_netdev_wait_pend8021x(ndev); |
419 | 419 | ||
420 | err = brcmf_fil_bsscfg_data_set(ndev, bssidx, "wsec_key", &key_le, | 420 | err = brcmf_fil_bsscfg_data_set(ndev, "wsec_key", &key_le, |
421 | sizeof(key_le)); | 421 | sizeof(key_le)); |
422 | 422 | ||
423 | if (err) | 423 | if (err) |
@@ -1596,7 +1596,7 @@ brcmf_set_sharedkey(struct net_device *ndev, | |||
1596 | if (sec->auth_type == NL80211_AUTHTYPE_SHARED_KEY) { | 1596 | if (sec->auth_type == NL80211_AUTHTYPE_SHARED_KEY) { |
1597 | WL_CONN("set auth_type to shared key\n"); | 1597 | WL_CONN("set auth_type to shared key\n"); |
1598 | val = WL_AUTH_SHARED_KEY; /* shared key */ | 1598 | val = WL_AUTH_SHARED_KEY; /* shared key */ |
1599 | err = brcmf_fil_bsscfg_int_set(ndev, bssidx, "auth", val); | 1599 | err = brcmf_fil_bsscfg_int_set(ndev, "auth", val); |
1600 | if (err) | 1600 | if (err) |
1601 | WL_ERR("set auth failed (%d)\n", err); | 1601 | WL_ERR("set auth failed (%d)\n", err); |
1602 | } | 1602 | } |
@@ -1815,7 +1815,7 @@ brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev, | |||
1815 | return -EIO; | 1815 | return -EIO; |
1816 | 1816 | ||
1817 | bssidx = brcmf_find_bssidx(cfg, ndev); | 1817 | bssidx = brcmf_find_bssidx(cfg, ndev); |
1818 | err = brcmf_fil_bsscfg_int_get(ndev, bssidx, "wsec", &wsec); | 1818 | err = brcmf_fil_bsscfg_int_get(ndev, "wsec", &wsec); |
1819 | if (err) { | 1819 | if (err) { |
1820 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); | 1820 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); |
1821 | goto done; | 1821 | goto done; |
@@ -1994,13 +1994,13 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, | |||
1994 | if (err) | 1994 | if (err) |
1995 | goto done; | 1995 | goto done; |
1996 | 1996 | ||
1997 | err = brcmf_fil_bsscfg_int_get(ndev, bssidx, "wsec", &wsec); | 1997 | err = brcmf_fil_bsscfg_int_get(ndev, "wsec", &wsec); |
1998 | if (err) { | 1998 | if (err) { |
1999 | WL_ERR("get wsec error (%d)\n", err); | 1999 | WL_ERR("get wsec error (%d)\n", err); |
2000 | goto done; | 2000 | goto done; |
2001 | } | 2001 | } |
2002 | wsec |= val; | 2002 | wsec |= val; |
2003 | err = brcmf_fil_bsscfg_int_set(ndev, bssidx, "wsec", wsec); | 2003 | err = brcmf_fil_bsscfg_int_set(ndev, "wsec", wsec); |
2004 | if (err) { | 2004 | if (err) { |
2005 | WL_ERR("set wsec error (%d)\n", err); | 2005 | WL_ERR("set wsec error (%d)\n", err); |
2006 | goto done; | 2006 | goto done; |
@@ -2070,7 +2070,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, | |||
2070 | memset(¶ms, 0, sizeof(params)); | 2070 | memset(¶ms, 0, sizeof(params)); |
2071 | 2071 | ||
2072 | bssidx = brcmf_find_bssidx(cfg, ndev); | 2072 | bssidx = brcmf_find_bssidx(cfg, ndev); |
2073 | err = brcmf_fil_bsscfg_int_get(ndev, bssidx, "wsec", &wsec); | 2073 | err = brcmf_fil_bsscfg_int_get(ndev, "wsec", &wsec); |
2074 | if (err) { | 2074 | if (err) { |
2075 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); | 2075 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); |
2076 | /* Ignore this error, may happen during DISASSOC */ | 2076 | /* Ignore this error, may happen during DISASSOC */ |
@@ -3481,19 +3481,19 @@ static s32 brcmf_configure_opensecurity(struct net_device *ndev, s32 bssidx) | |||
3481 | s32 err; | 3481 | s32 err; |
3482 | 3482 | ||
3483 | /* set auth */ | 3483 | /* set auth */ |
3484 | err = brcmf_fil_bsscfg_int_set(ndev, bssidx, "auth", 0); | 3484 | err = brcmf_fil_bsscfg_int_set(ndev, "auth", 0); |
3485 | if (err < 0) { | 3485 | if (err < 0) { |
3486 | WL_ERR("auth error %d\n", err); | 3486 | WL_ERR("auth error %d\n", err); |
3487 | return err; | 3487 | return err; |
3488 | } | 3488 | } |
3489 | /* set wsec */ | 3489 | /* set wsec */ |
3490 | err = brcmf_fil_bsscfg_int_set(ndev, bssidx, "wsec", 0); | 3490 | err = brcmf_fil_bsscfg_int_set(ndev, "wsec", 0); |
3491 | if (err < 0) { | 3491 | if (err < 0) { |
3492 | WL_ERR("wsec error %d\n", err); | 3492 | WL_ERR("wsec error %d\n", err); |
3493 | return err; | 3493 | return err; |
3494 | } | 3494 | } |
3495 | /* set upper-layer auth */ | 3495 | /* set upper-layer auth */ |
3496 | err = brcmf_fil_bsscfg_int_set(ndev, bssidx, "wpa_auth", WPA_AUTH_NONE); | 3496 | err = brcmf_fil_bsscfg_int_set(ndev, "wpa_auth", WPA_AUTH_NONE); |
3497 | if (err < 0) { | 3497 | if (err < 0) { |
3498 | WL_ERR("wpa_auth error %d\n", err); | 3498 | WL_ERR("wpa_auth error %d\n", err); |
3499 | return err; | 3499 | return err; |
@@ -3654,7 +3654,7 @@ brcmf_configure_wpaie(struct net_device *ndev, struct brcmf_vs_tlv *wpa_ie, | |||
3654 | wme_bss_disable = 0; | 3654 | wme_bss_disable = 0; |
3655 | } | 3655 | } |
3656 | /* set wme_bss_disable to sync RSN Capabilities */ | 3656 | /* set wme_bss_disable to sync RSN Capabilities */ |
3657 | err = brcmf_fil_bsscfg_int_set(ndev, bssidx, "wme_bss_disable", | 3657 | err = brcmf_fil_bsscfg_int_set(ndev, "wme_bss_disable", |
3658 | wme_bss_disable); | 3658 | wme_bss_disable); |
3659 | if (err < 0) { | 3659 | if (err < 0) { |
3660 | WL_ERR("wme_bss_disable error %d\n", err); | 3660 | WL_ERR("wme_bss_disable error %d\n", err); |
@@ -3665,19 +3665,19 @@ brcmf_configure_wpaie(struct net_device *ndev, struct brcmf_vs_tlv *wpa_ie, | |||
3665 | wsec = (pval | gval | SES_OW_ENABLED); | 3665 | wsec = (pval | gval | SES_OW_ENABLED); |
3666 | 3666 | ||
3667 | /* set auth */ | 3667 | /* set auth */ |
3668 | err = brcmf_fil_bsscfg_int_set(ndev, bssidx, "auth", auth); | 3668 | err = brcmf_fil_bsscfg_int_set(ndev, "auth", auth); |
3669 | if (err < 0) { | 3669 | if (err < 0) { |
3670 | WL_ERR("auth error %d\n", err); | 3670 | WL_ERR("auth error %d\n", err); |
3671 | goto exit; | 3671 | goto exit; |
3672 | } | 3672 | } |
3673 | /* set wsec */ | 3673 | /* set wsec */ |
3674 | err = brcmf_fil_bsscfg_int_set(ndev, bssidx, "wsec", wsec); | 3674 | err = brcmf_fil_bsscfg_int_set(ndev, "wsec", wsec); |
3675 | if (err < 0) { | 3675 | if (err < 0) { |
3676 | WL_ERR("wsec error %d\n", err); | 3676 | WL_ERR("wsec error %d\n", err); |
3677 | goto exit; | 3677 | goto exit; |
3678 | } | 3678 | } |
3679 | /* set upper-layer auth */ | 3679 | /* set upper-layer auth */ |
3680 | err = brcmf_fil_bsscfg_int_set(ndev, bssidx, "wpa_auth", wpa_auth); | 3680 | err = brcmf_fil_bsscfg_int_set(ndev, "wpa_auth", wpa_auth); |
3681 | if (err < 0) { | 3681 | if (err < 0) { |
3682 | WL_ERR("wpa_auth error %d\n", err); | 3682 | WL_ERR("wpa_auth error %d\n", err); |
3683 | goto exit; | 3683 | goto exit; |
@@ -3907,7 +3907,7 @@ brcmf_set_management_ie(struct brcmf_cfg80211_info *cfg, | |||
3907 | } | 3907 | } |
3908 | } | 3908 | } |
3909 | if (total_ie_buf_len) { | 3909 | if (total_ie_buf_len) { |
3910 | err = brcmf_fil_bsscfg_data_set(ndev, bssidx, "vndr_ie", | 3910 | err = brcmf_fil_bsscfg_data_set(ndev, "vndr_ie", |
3911 | iovar_ie_buf, | 3911 | iovar_ie_buf, |
3912 | total_ie_buf_len); | 3912 | total_ie_buf_len); |
3913 | if (err) | 3913 | if (err) |