diff options
author | Arend van Spriel <arend@broadcom.com> | 2012-10-22 13:36:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-29 15:28:27 -0400 |
commit | ac24be6fe6593564be99a88e41cddc6c0fc1899f (patch) | |
tree | 972f421bb64ce8c8fe0392c37f7c6efff64e9eb8 /drivers | |
parent | 6e186166ea0259f7ef9cb2393317126003c13680 (diff) |
brcmfmac: use struct brcmf_if as interface object for fwil functions
The functions for communicating were given the net_device only because
its private data contained struct brcmf_if object. However, not all
firmware related interfaces will be associated with a net_device. To
accomodate provisioning firmware for such interfaces the struct
brcmf_if object will be passed to the fwil functions.
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 | 40 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/fwil.h | 26 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 251 |
3 files changed, 162 insertions, 155 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwil.c b/drivers/net/wireless/brcm80211/brcmfmac/fwil.c index f4a6e7135f4b..4b272c3d237c 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwil.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil.c | |||
@@ -57,9 +57,8 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set) | |||
57 | } | 57 | } |
58 | 58 | ||
59 | s32 | 59 | s32 |
60 | brcmf_fil_cmd_data_set(struct net_device *ndev, u32 cmd, void *data, u32 len) | 60 | brcmf_fil_cmd_data_set(struct brcmf_if *ifp, u32 cmd, void *data, u32 len) |
61 | { | 61 | { |
62 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
63 | s32 err; | 62 | s32 err; |
64 | 63 | ||
65 | mutex_lock(&ifp->drvr->proto_block); | 64 | mutex_lock(&ifp->drvr->proto_block); |
@@ -74,9 +73,8 @@ brcmf_fil_cmd_data_set(struct net_device *ndev, u32 cmd, void *data, u32 len) | |||
74 | } | 73 | } |
75 | 74 | ||
76 | s32 | 75 | s32 |
77 | brcmf_fil_cmd_data_get(struct net_device *ndev, u32 cmd, void *data, u32 len) | 76 | brcmf_fil_cmd_data_get(struct brcmf_if *ifp, u32 cmd, void *data, u32 len) |
78 | { | 77 | { |
79 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
80 | s32 err; | 78 | s32 err; |
81 | 79 | ||
82 | mutex_lock(&ifp->drvr->proto_block); | 80 | mutex_lock(&ifp->drvr->proto_block); |
@@ -92,9 +90,8 @@ brcmf_fil_cmd_data_get(struct net_device *ndev, u32 cmd, void *data, u32 len) | |||
92 | 90 | ||
93 | 91 | ||
94 | s32 | 92 | s32 |
95 | brcmf_fil_cmd_int_set(struct net_device *ndev, u32 cmd, u32 data) | 93 | brcmf_fil_cmd_int_set(struct brcmf_if *ifp, u32 cmd, u32 data) |
96 | { | 94 | { |
97 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
98 | s32 err; | 95 | s32 err; |
99 | __le32 data_le = cpu_to_le32(data); | 96 | __le32 data_le = cpu_to_le32(data); |
100 | 97 | ||
@@ -106,9 +103,8 @@ brcmf_fil_cmd_int_set(struct net_device *ndev, u32 cmd, u32 data) | |||
106 | } | 103 | } |
107 | 104 | ||
108 | s32 | 105 | s32 |
109 | brcmf_fil_cmd_int_get(struct net_device *ndev, u32 cmd, u32 *data) | 106 | brcmf_fil_cmd_int_get(struct brcmf_if *ifp, u32 cmd, u32 *data) |
110 | { | 107 | { |
111 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
112 | s32 err; | 108 | s32 err; |
113 | __le32 data_le = cpu_to_le32(*data); | 109 | __le32 data_le = cpu_to_le32(*data); |
114 | 110 | ||
@@ -141,10 +137,9 @@ brcmf_create_iovar(char *name, char *data, u32 datalen, char *buf, u32 buflen) | |||
141 | 137 | ||
142 | 138 | ||
143 | s32 | 139 | s32 |
144 | brcmf_fil_iovar_data_set(struct net_device *ndev, char *name, void *data, | 140 | brcmf_fil_iovar_data_set(struct brcmf_if *ifp, char *name, void *data, |
145 | u32 len) | 141 | u32 len) |
146 | { | 142 | { |
147 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
148 | struct brcmf_pub *drvr = ifp->drvr; | 143 | struct brcmf_pub *drvr = ifp->drvr; |
149 | s32 err; | 144 | s32 err; |
150 | u32 buflen; | 145 | u32 buflen; |
@@ -169,10 +164,9 @@ brcmf_fil_iovar_data_set(struct net_device *ndev, char *name, void *data, | |||
169 | } | 164 | } |
170 | 165 | ||
171 | s32 | 166 | s32 |
172 | brcmf_fil_iovar_data_get(struct net_device *ndev, char *name, void *data, | 167 | brcmf_fil_iovar_data_get(struct brcmf_if *ifp, char *name, void *data, |
173 | u32 len) | 168 | u32 len) |
174 | { | 169 | { |
175 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
176 | struct brcmf_pub *drvr = ifp->drvr; | 170 | struct brcmf_pub *drvr = ifp->drvr; |
177 | s32 err; | 171 | s32 err; |
178 | u32 buflen; | 172 | u32 buflen; |
@@ -199,20 +193,20 @@ brcmf_fil_iovar_data_get(struct net_device *ndev, char *name, void *data, | |||
199 | } | 193 | } |
200 | 194 | ||
201 | s32 | 195 | s32 |
202 | brcmf_fil_iovar_int_set(struct net_device *ndev, char *name, u32 data) | 196 | brcmf_fil_iovar_int_set(struct brcmf_if *ifp, char *name, u32 data) |
203 | { | 197 | { |
204 | __le32 data_le = cpu_to_le32(data); | 198 | __le32 data_le = cpu_to_le32(data); |
205 | 199 | ||
206 | return brcmf_fil_iovar_data_set(ndev, name, &data_le, sizeof(data_le)); | 200 | return brcmf_fil_iovar_data_set(ifp, name, &data_le, sizeof(data_le)); |
207 | } | 201 | } |
208 | 202 | ||
209 | s32 | 203 | s32 |
210 | brcmf_fil_iovar_int_get(struct net_device *ndev, char *name, u32 *data) | 204 | brcmf_fil_iovar_int_get(struct brcmf_if *ifp, char *name, u32 *data) |
211 | { | 205 | { |
212 | __le32 data_le = cpu_to_le32(*data); | 206 | __le32 data_le = cpu_to_le32(*data); |
213 | s32 err; | 207 | s32 err; |
214 | 208 | ||
215 | err = brcmf_fil_iovar_data_get(ndev, name, &data_le, sizeof(data_le)); | 209 | err = brcmf_fil_iovar_data_get(ifp, name, &data_le, sizeof(data_le)); |
216 | if (err == 0) | 210 | if (err == 0) |
217 | *data = le32_to_cpu(data_le); | 211 | *data = le32_to_cpu(data_le); |
218 | return err; | 212 | return err; |
@@ -264,10 +258,9 @@ brcmf_create_bsscfg(s32 bssidx, char *name, char *data, u32 datalen, char *buf, | |||
264 | } | 258 | } |
265 | 259 | ||
266 | s32 | 260 | s32 |
267 | brcmf_fil_bsscfg_data_set(struct net_device *ndev, char *name, | 261 | brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, char *name, |
268 | void *data, u32 len) | 262 | void *data, u32 len) |
269 | { | 263 | { |
270 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
271 | struct brcmf_pub *drvr = ifp->drvr; | 264 | struct brcmf_pub *drvr = ifp->drvr; |
272 | s32 err; | 265 | s32 err; |
273 | u32 buflen; | 266 | u32 buflen; |
@@ -292,10 +285,9 @@ brcmf_fil_bsscfg_data_set(struct net_device *ndev, char *name, | |||
292 | } | 285 | } |
293 | 286 | ||
294 | s32 | 287 | s32 |
295 | brcmf_fil_bsscfg_data_get(struct net_device *ndev, char *name, | 288 | brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name, |
296 | void *data, u32 len) | 289 | void *data, u32 len) |
297 | { | 290 | { |
298 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
299 | struct brcmf_pub *drvr = ifp->drvr; | 291 | struct brcmf_pub *drvr = ifp->drvr; |
300 | s32 err; | 292 | s32 err; |
301 | u32 buflen; | 293 | u32 buflen; |
@@ -322,21 +314,21 @@ brcmf_fil_bsscfg_data_get(struct net_device *ndev, char *name, | |||
322 | } | 314 | } |
323 | 315 | ||
324 | s32 | 316 | s32 |
325 | brcmf_fil_bsscfg_int_set(struct net_device *ndev, char *name, u32 data) | 317 | brcmf_fil_bsscfg_int_set(struct brcmf_if *ifp, char *name, u32 data) |
326 | { | 318 | { |
327 | __le32 data_le = cpu_to_le32(data); | 319 | __le32 data_le = cpu_to_le32(data); |
328 | 320 | ||
329 | return brcmf_fil_bsscfg_data_set(ndev, name, &data_le, | 321 | return brcmf_fil_bsscfg_data_set(ifp, name, &data_le, |
330 | sizeof(data_le)); | 322 | sizeof(data_le)); |
331 | } | 323 | } |
332 | 324 | ||
333 | s32 | 325 | s32 |
334 | brcmf_fil_bsscfg_int_get(struct net_device *ndev, char *name, u32 *data) | 326 | brcmf_fil_bsscfg_int_get(struct brcmf_if *ifp, char *name, u32 *data) |
335 | { | 327 | { |
336 | __le32 data_le = cpu_to_le32(*data); | 328 | __le32 data_le = cpu_to_le32(*data); |
337 | s32 err; | 329 | s32 err; |
338 | 330 | ||
339 | err = brcmf_fil_bsscfg_data_get(ndev, name, &data_le, | 331 | err = brcmf_fil_bsscfg_data_get(ifp, name, &data_le, |
340 | sizeof(data_le)); | 332 | sizeof(data_le)); |
341 | if (err == 0) | 333 | if (err == 0) |
342 | *data = le32_to_cpu(data_le); | 334 | *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 4d084997d291..16eb8202fb1e 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwil.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil.h | |||
@@ -17,25 +17,23 @@ | |||
17 | #ifndef _fwil_h_ | 17 | #ifndef _fwil_h_ |
18 | #define _fwil_h_ | 18 | #define _fwil_h_ |
19 | 19 | ||
20 | s32 brcmf_fil_cmd_data_set(struct net_device *ndev, u32 cmd, void *data, | 20 | s32 brcmf_fil_cmd_data_set(struct brcmf_if *ifp, u32 cmd, void *data, u32 len); |
21 | u32 len); | 21 | s32 brcmf_fil_cmd_data_get(struct brcmf_if *ifp, u32 cmd, void *data, u32 len); |
22 | s32 brcmf_fil_cmd_data_get(struct net_device *ndev, u32 cmd, void *data, | 22 | s32 brcmf_fil_cmd_int_set(struct brcmf_if *ifp, u32 cmd, u32 data); |
23 | u32 len); | 23 | s32 brcmf_fil_cmd_int_get(struct brcmf_if *ifp, u32 cmd, u32 *data); |
24 | s32 brcmf_fil_cmd_int_set(struct net_device *ndev, u32 cmd, u32 data); | ||
25 | s32 brcmf_fil_cmd_int_get(struct net_device *ndev, u32 cmd, u32 *data); | ||
26 | 24 | ||
27 | s32 brcmf_fil_iovar_data_set(struct net_device *ndev, char *name, void *data, | 25 | s32 brcmf_fil_iovar_data_set(struct brcmf_if *ifp, char *name, void *data, |
28 | u32 len); | 26 | u32 len); |
29 | s32 brcmf_fil_iovar_data_get(struct net_device *ndev, char *name, void *data, | 27 | s32 brcmf_fil_iovar_data_get(struct brcmf_if *ifp, char *name, void *data, |
30 | u32 len); | 28 | u32 len); |
31 | s32 brcmf_fil_iovar_int_set(struct net_device *ndev, char *name, u32 data); | 29 | s32 brcmf_fil_iovar_int_set(struct brcmf_if *ifp, char *name, u32 data); |
32 | s32 brcmf_fil_iovar_int_get(struct net_device *ndev, char *name, u32 *data); | 30 | s32 brcmf_fil_iovar_int_get(struct brcmf_if *ifp, char *name, u32 *data); |
33 | 31 | ||
34 | s32 brcmf_fil_bsscfg_data_set(struct net_device *ndev, char *name, void *data, | 32 | s32 brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, char *name, void *data, |
35 | u32 len); | 33 | u32 len); |
36 | s32 brcmf_fil_bsscfg_data_get(struct net_device *ndev, char *name, void *data, | 34 | s32 brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name, void *data, |
37 | u32 len); | 35 | u32 len); |
38 | s32 brcmf_fil_bsscfg_int_set(struct net_device *ndev, char *name, u32 data); | 36 | s32 brcmf_fil_bsscfg_int_set(struct brcmf_if *ifp, char *name, u32 data); |
39 | s32 brcmf_fil_bsscfg_int_get(struct net_device *ndev, char *name, u32 *data); | 37 | s32 brcmf_fil_bsscfg_int_get(struct brcmf_if *ifp, char *name, u32 *data); |
40 | 38 | ||
41 | #endif /* _fwil_h_ */ | 39 | #endif /* _fwil_h_ */ |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 5a3093d2b117..61d9489b0cfc 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -442,7 +442,7 @@ send_key_to_dongle(struct brcmf_cfg80211_info *cfg, s32 bssidx, | |||
442 | 442 | ||
443 | brcmf_netdev_wait_pend8021x(ndev); | 443 | brcmf_netdev_wait_pend8021x(ndev); |
444 | 444 | ||
445 | err = brcmf_fil_bsscfg_data_set(ndev, "wsec_key", &key_le, | 445 | err = brcmf_fil_bsscfg_data_set(netdev_priv(ndev), "wsec_key", &key_le, |
446 | sizeof(key_le)); | 446 | sizeof(key_le)); |
447 | 447 | ||
448 | if (err) | 448 | if (err) |
@@ -496,7 +496,8 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, | |||
496 | } | 496 | } |
497 | WL_INFO("IF Type = AP\n"); | 497 | WL_INFO("IF Type = AP\n"); |
498 | } else { | 498 | } else { |
499 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_INFRA, infra); | 499 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), |
500 | BRCMF_C_SET_INFRA, infra); | ||
500 | if (err) { | 501 | if (err) { |
501 | WL_ERR("WLC_SET_INFRA error (%d)\n", err); | 502 | WL_ERR("WLC_SET_INFRA error (%d)\n", err); |
502 | err = -EAGAIN; | 503 | err = -EAGAIN; |
@@ -530,7 +531,7 @@ static void brcmf_set_mpc(struct net_device *ndev, int mpc) | |||
530 | struct brcmf_cfg80211_info *cfg = ndev_to_cfg(ndev); | 531 | struct brcmf_cfg80211_info *cfg = ndev_to_cfg(ndev); |
531 | 532 | ||
532 | if (test_bit(WL_STATUS_READY, &cfg->status)) { | 533 | if (test_bit(WL_STATUS_READY, &cfg->status)) { |
533 | err = brcmf_fil_iovar_int_set(ndev, "mpc", mpc); | 534 | err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "mpc", mpc); |
534 | if (err) { | 535 | if (err) { |
535 | WL_ERR("fail to set mpc\n"); | 536 | WL_ERR("fail to set mpc\n"); |
536 | return; | 537 | return; |
@@ -578,8 +579,8 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan, | |||
578 | params->action = cpu_to_le16(action); | 579 | params->action = cpu_to_le16(action); |
579 | params->scan_duration = cpu_to_le16(0); | 580 | params->scan_duration = cpu_to_le16(0); |
580 | 581 | ||
581 | err = brcmf_fil_iovar_data_set(iscan->ndev, "iscan", params, | 582 | err = brcmf_fil_iovar_data_set(netdev_priv(iscan->ndev), "iscan", |
582 | params_size); | 583 | params, params_size); |
583 | if (err) { | 584 | if (err) { |
584 | if (err == -EBUSY) | 585 | if (err == -EBUSY) |
585 | WL_INFO("system busy : iscan canceled\n"); | 586 | WL_INFO("system busy : iscan canceled\n"); |
@@ -605,7 +606,7 @@ static s32 brcmf_do_iscan(struct brcmf_cfg80211_info *cfg) | |||
605 | iscan->state = WL_ISCAN_STATE_SCANING; | 606 | iscan->state = WL_ISCAN_STATE_SCANING; |
606 | 607 | ||
607 | passive_scan = cfg->active_scan ? 0 : 1; | 608 | passive_scan = cfg->active_scan ? 0 : 1; |
608 | err = brcmf_fil_cmd_int_set(cfg_to_ndev(cfg), | 609 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), |
609 | BRCMF_C_SET_PASSIVE_SCAN, passive_scan); | 610 | BRCMF_C_SET_PASSIVE_SCAN, passive_scan); |
610 | if (err) { | 611 | if (err) { |
611 | WL_ERR("error (%d)\n", err); | 612 | WL_ERR("error (%d)\n", err); |
@@ -689,15 +690,16 @@ brcmf_cfg80211_iscan(struct wiphy *wiphy, struct net_device *ndev, | |||
689 | } | 690 | } |
690 | 691 | ||
691 | passive_scan = cfg->active_scan ? 0 : 1; | 692 | passive_scan = cfg->active_scan ? 0 : 1; |
692 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_PASSIVE_SCAN, | 693 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), |
694 | BRCMF_C_SET_PASSIVE_SCAN, | ||
693 | passive_scan); | 695 | passive_scan); |
694 | if (err) { | 696 | if (err) { |
695 | WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err); | 697 | WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err); |
696 | goto scan_out; | 698 | goto scan_out; |
697 | } | 699 | } |
698 | brcmf_set_mpc(ndev, 0); | 700 | brcmf_set_mpc(ndev, 0); |
699 | err = brcmf_fil_cmd_data_set(ndev, BRCMF_C_SCAN, &sr->ssid_le, | 701 | err = brcmf_fil_cmd_data_set(netdev_priv(ndev), BRCMF_C_SCAN, |
700 | sizeof(sr->ssid_le)); | 702 | &sr->ssid_le, sizeof(sr->ssid_le)); |
701 | if (err) { | 703 | if (err) { |
702 | if (err == -EBUSY) | 704 | if (err == -EBUSY) |
703 | WL_INFO("system busy : scan for \"%s\" " | 705 | WL_INFO("system busy : scan for \"%s\" " |
@@ -829,8 +831,8 @@ brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg, | |||
829 | /* Scan is aborted by setting channel_list[0] to -1 */ | 831 | /* Scan is aborted by setting channel_list[0] to -1 */ |
830 | params_le.channel_list[0] = cpu_to_le16(-1); | 832 | params_le.channel_list[0] = cpu_to_le16(-1); |
831 | /* E-Scan (or anyother type) can be aborted by SCAN */ | 833 | /* E-Scan (or anyother type) can be aborted by SCAN */ |
832 | err = brcmf_fil_cmd_data_set(ndev, BRCMF_C_SCAN, ¶ms_le, | 834 | err = brcmf_fil_cmd_data_set(netdev_priv(ndev), BRCMF_C_SCAN, |
833 | sizeof(params_le)); | 835 | ¶ms_le, sizeof(params_le)); |
834 | if (err) | 836 | if (err) |
835 | WL_ERR("Scan abort failed\n"); | 837 | WL_ERR("Scan abort failed\n"); |
836 | } | 838 | } |
@@ -888,7 +890,8 @@ brcmf_run_escan(struct brcmf_cfg80211_info *cfg, struct net_device *ndev, | |||
888 | params->action = cpu_to_le16(action); | 890 | params->action = cpu_to_le16(action); |
889 | params->sync_id = cpu_to_le16(0x1234); | 891 | params->sync_id = cpu_to_le16(0x1234); |
890 | 892 | ||
891 | err = brcmf_fil_iovar_data_set(ndev, "escan", params, params_size); | 893 | err = brcmf_fil_iovar_data_set(netdev_priv(ndev), "escan", |
894 | params, params_size); | ||
892 | if (err) { | 895 | if (err) { |
893 | if (err == -EBUSY) | 896 | if (err == -EBUSY) |
894 | WL_INFO("system busy : escan canceled\n"); | 897 | WL_INFO("system busy : escan canceled\n"); |
@@ -914,7 +917,7 @@ brcmf_do_escan(struct brcmf_cfg80211_info *cfg, struct wiphy *wiphy, | |||
914 | cfg->escan_info.wiphy = wiphy; | 917 | cfg->escan_info.wiphy = wiphy; |
915 | cfg->escan_info.escan_state = WL_ESCAN_STATE_SCANNING; | 918 | cfg->escan_info.escan_state = WL_ESCAN_STATE_SCANNING; |
916 | passive_scan = cfg->active_scan ? 0 : 1; | 919 | passive_scan = cfg->active_scan ? 0 : 1; |
917 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_PASSIVE_SCAN, | 920 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), BRCMF_C_SET_PASSIVE_SCAN, |
918 | passive_scan); | 921 | passive_scan); |
919 | if (err) { | 922 | if (err) { |
920 | WL_ERR("error (%d)\n", err); | 923 | WL_ERR("error (%d)\n", err); |
@@ -1001,15 +1004,16 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct net_device *ndev, | |||
1001 | WL_SCAN("Broadcast scan\n"); | 1004 | WL_SCAN("Broadcast scan\n"); |
1002 | 1005 | ||
1003 | passive_scan = cfg->active_scan ? 0 : 1; | 1006 | passive_scan = cfg->active_scan ? 0 : 1; |
1004 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_PASSIVE_SCAN, | 1007 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), |
1008 | BRCMF_C_SET_PASSIVE_SCAN, | ||
1005 | passive_scan); | 1009 | passive_scan); |
1006 | if (err) { | 1010 | if (err) { |
1007 | WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err); | 1011 | WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err); |
1008 | goto scan_out; | 1012 | goto scan_out; |
1009 | } | 1013 | } |
1010 | brcmf_set_mpc(ndev, 0); | 1014 | brcmf_set_mpc(ndev, 0); |
1011 | err = brcmf_fil_cmd_data_set(ndev, BRCMF_C_SCAN, &sr->ssid_le, | 1015 | err = brcmf_fil_cmd_data_set(netdev_priv(ndev), BRCMF_C_SCAN, |
1012 | sizeof(sr->ssid_le)); | 1016 | &sr->ssid_le, sizeof(sr->ssid_le)); |
1013 | if (err) { | 1017 | if (err) { |
1014 | if (err == -EBUSY) | 1018 | if (err == -EBUSY) |
1015 | WL_INFO("BUSY: scan for \"%s\" canceled\n", | 1019 | WL_INFO("BUSY: scan for \"%s\" canceled\n", |
@@ -1061,7 +1065,8 @@ static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold) | |||
1061 | { | 1065 | { |
1062 | s32 err = 0; | 1066 | s32 err = 0; |
1063 | 1067 | ||
1064 | err = brcmf_fil_iovar_int_set(ndev, "rtsthresh", rts_threshold); | 1068 | err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "rtsthresh", |
1069 | rts_threshold); | ||
1065 | if (err) | 1070 | if (err) |
1066 | WL_ERR("Error (%d)\n", err); | 1071 | WL_ERR("Error (%d)\n", err); |
1067 | 1072 | ||
@@ -1072,7 +1077,8 @@ static s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold) | |||
1072 | { | 1077 | { |
1073 | s32 err = 0; | 1078 | s32 err = 0; |
1074 | 1079 | ||
1075 | err = brcmf_fil_iovar_int_set(ndev, "fragthresh", frag_threshold); | 1080 | err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "fragthresh", |
1081 | frag_threshold); | ||
1076 | if (err) | 1082 | if (err) |
1077 | WL_ERR("Error (%d)\n", err); | 1083 | WL_ERR("Error (%d)\n", err); |
1078 | 1084 | ||
@@ -1084,7 +1090,7 @@ static s32 brcmf_set_retry(struct net_device *ndev, u32 retry, bool l) | |||
1084 | s32 err = 0; | 1090 | s32 err = 0; |
1085 | u32 cmd = (l ? BRCM_SET_LRL : BRCM_SET_SRL); | 1091 | u32 cmd = (l ? BRCM_SET_LRL : BRCM_SET_SRL); |
1086 | 1092 | ||
1087 | err = brcmf_fil_cmd_int_set(ndev, cmd, retry); | 1093 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), cmd, retry); |
1088 | if (err) { | 1094 | if (err) { |
1089 | WL_ERR("cmd (%d) , error (%d)\n", cmd, err); | 1095 | WL_ERR("cmd (%d) , error (%d)\n", cmd, err); |
1090 | return err; | 1096 | return err; |
@@ -1178,7 +1184,8 @@ static void brcmf_link_down(struct brcmf_cfg80211_info *cfg) | |||
1178 | if (cfg->link_up) { | 1184 | if (cfg->link_up) { |
1179 | ndev = cfg_to_ndev(cfg); | 1185 | ndev = cfg_to_ndev(cfg); |
1180 | WL_INFO("Call WLC_DISASSOC to stop excess roaming\n "); | 1186 | WL_INFO("Call WLC_DISASSOC to stop excess roaming\n "); |
1181 | err = brcmf_fil_cmd_data_set(ndev, BRCMF_C_DISASSOC, NULL, 0); | 1187 | err = brcmf_fil_cmd_data_set(netdev_priv(ndev), |
1188 | BRCMF_C_DISASSOC, NULL, 0); | ||
1182 | if (err) | 1189 | if (err) |
1183 | WL_ERR("WLC_DISASSOC failed (%d)\n", err); | 1190 | WL_ERR("WLC_DISASSOC failed (%d)\n", err); |
1184 | cfg->link_up = false; | 1191 | cfg->link_up = false; |
@@ -1250,7 +1257,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *ndev, | |||
1250 | if (params->privacy) | 1257 | if (params->privacy) |
1251 | wsec |= WEP_ENABLED; | 1258 | wsec |= WEP_ENABLED; |
1252 | 1259 | ||
1253 | err = brcmf_fil_iovar_int_set(ndev, "wsec", wsec); | 1260 | err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "wsec", wsec); |
1254 | if (err) { | 1261 | if (err) { |
1255 | WL_ERR("wsec failed (%d)\n", err); | 1262 | WL_ERR("wsec failed (%d)\n", err); |
1256 | goto done; | 1263 | goto done; |
@@ -1262,7 +1269,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *ndev, | |||
1262 | else | 1269 | else |
1263 | bcnprd = 100; | 1270 | bcnprd = 100; |
1264 | 1271 | ||
1265 | err = brcmf_fil_cmd_int_set(ndev, BRCM_SET_BCNPRD, bcnprd); | 1272 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), BRCM_SET_BCNPRD, bcnprd); |
1266 | if (err) { | 1273 | if (err) { |
1267 | WL_ERR("WLC_SET_BCNPRD failed (%d)\n", err); | 1274 | WL_ERR("WLC_SET_BCNPRD failed (%d)\n", err); |
1268 | goto done; | 1275 | goto done; |
@@ -1304,7 +1311,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *ndev, | |||
1304 | 1311 | ||
1305 | /* set channel for starter */ | 1312 | /* set channel for starter */ |
1306 | target_channel = cfg->channel; | 1313 | target_channel = cfg->channel; |
1307 | err = brcmf_fil_cmd_int_set(ndev, BRCM_SET_CHANNEL, | 1314 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), BRCM_SET_CHANNEL, |
1308 | target_channel); | 1315 | target_channel); |
1309 | if (err) { | 1316 | if (err) { |
1310 | WL_ERR("WLC_SET_CHANNEL failed (%d)\n", err); | 1317 | WL_ERR("WLC_SET_CHANNEL failed (%d)\n", err); |
@@ -1316,7 +1323,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *ndev, | |||
1316 | cfg->ibss_starter = false; | 1323 | cfg->ibss_starter = false; |
1317 | 1324 | ||
1318 | 1325 | ||
1319 | err = brcmf_fil_cmd_data_set(ndev, BRCMF_C_SET_SSID, | 1326 | err = brcmf_fil_cmd_data_set(netdev_priv(ndev), BRCMF_C_SET_SSID, |
1320 | &join_params, join_params_size); | 1327 | &join_params, join_params_size); |
1321 | if (err) { | 1328 | if (err) { |
1322 | WL_ERR("WLC_SET_SSID failed (%d)\n", err); | 1329 | WL_ERR("WLC_SET_SSID failed (%d)\n", err); |
@@ -1363,7 +1370,7 @@ static s32 brcmf_set_wpa_version(struct net_device *ndev, | |||
1363 | else | 1370 | else |
1364 | val = WPA_AUTH_DISABLED; | 1371 | val = WPA_AUTH_DISABLED; |
1365 | WL_CONN("setting wpa_auth to 0x%0x\n", val); | 1372 | WL_CONN("setting wpa_auth to 0x%0x\n", val); |
1366 | err = brcmf_fil_iovar_int_set(ndev, "wpa_auth", val); | 1373 | err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "wpa_auth", val); |
1367 | if (err) { | 1374 | if (err) { |
1368 | WL_ERR("set wpa_auth failed (%d)\n", err); | 1375 | WL_ERR("set wpa_auth failed (%d)\n", err); |
1369 | return err; | 1376 | return err; |
@@ -1403,7 +1410,7 @@ static s32 brcmf_set_auth_type(struct net_device *ndev, | |||
1403 | break; | 1410 | break; |
1404 | } | 1411 | } |
1405 | 1412 | ||
1406 | err = brcmf_fil_iovar_int_set(ndev, "auth", val); | 1413 | err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "auth", val); |
1407 | if (err) { | 1414 | if (err) { |
1408 | WL_ERR("set auth failed (%d)\n", err); | 1415 | WL_ERR("set auth failed (%d)\n", err); |
1409 | return err; | 1416 | return err; |
@@ -1468,7 +1475,7 @@ brcmf_set_set_cipher(struct net_device *ndev, | |||
1468 | } | 1475 | } |
1469 | 1476 | ||
1470 | WL_CONN("pval (%d) gval (%d)\n", pval, gval); | 1477 | WL_CONN("pval (%d) gval (%d)\n", pval, gval); |
1471 | err = brcmf_fil_iovar_int_set(ndev, "wsec", pval | gval); | 1478 | err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "wsec", pval | gval); |
1472 | if (err) { | 1479 | if (err) { |
1473 | WL_ERR("error (%d)\n", err); | 1480 | WL_ERR("error (%d)\n", err); |
1474 | return err; | 1481 | return err; |
@@ -1491,7 +1498,8 @@ brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme) | |||
1491 | s32 err = 0; | 1498 | s32 err = 0; |
1492 | 1499 | ||
1493 | if (sme->crypto.n_akm_suites) { | 1500 | if (sme->crypto.n_akm_suites) { |
1494 | err = brcmf_fil_iovar_int_get(ndev, "wpa_auth", &val); | 1501 | err = brcmf_fil_iovar_int_get(netdev_priv(ndev), |
1502 | "wpa_auth", &val); | ||
1495 | if (err) { | 1503 | if (err) { |
1496 | WL_ERR("could not get wpa_auth (%d)\n", err); | 1504 | WL_ERR("could not get wpa_auth (%d)\n", err); |
1497 | return err; | 1505 | return err; |
@@ -1525,7 +1533,8 @@ brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme) | |||
1525 | } | 1533 | } |
1526 | 1534 | ||
1527 | WL_CONN("setting wpa_auth to %d\n", val); | 1535 | WL_CONN("setting wpa_auth to %d\n", val); |
1528 | err = brcmf_fil_iovar_int_set(ndev, "wpa_auth", val); | 1536 | err = brcmf_fil_iovar_int_set(netdev_priv(ndev), |
1537 | "wpa_auth", val); | ||
1529 | if (err) { | 1538 | if (err) { |
1530 | WL_ERR("could not set wpa_auth (%d)\n", err); | 1539 | WL_ERR("could not set wpa_auth (%d)\n", err); |
1531 | return err; | 1540 | return err; |
@@ -1598,7 +1607,7 @@ brcmf_set_sharedkey(struct net_device *ndev, | |||
1598 | if (sec->auth_type == NL80211_AUTHTYPE_SHARED_KEY) { | 1607 | if (sec->auth_type == NL80211_AUTHTYPE_SHARED_KEY) { |
1599 | WL_CONN("set auth_type to shared key\n"); | 1608 | WL_CONN("set auth_type to shared key\n"); |
1600 | val = WL_AUTH_SHARED_KEY; /* shared key */ | 1609 | val = WL_AUTH_SHARED_KEY; /* shared key */ |
1601 | err = brcmf_fil_bsscfg_int_set(ndev, "auth", val); | 1610 | err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "auth", val); |
1602 | if (err) | 1611 | if (err) |
1603 | WL_ERR("set auth failed (%d)\n", err); | 1612 | WL_ERR("set auth failed (%d)\n", err); |
1604 | } | 1613 | } |
@@ -1686,7 +1695,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev, | |||
1686 | 1695 | ||
1687 | brcmf_ch_to_chanspec(cfg->channel, | 1696 | brcmf_ch_to_chanspec(cfg->channel, |
1688 | &join_params, &join_params_size); | 1697 | &join_params, &join_params_size); |
1689 | err = brcmf_fil_cmd_data_set(ndev, BRCMF_C_SET_SSID, | 1698 | err = brcmf_fil_cmd_data_set(netdev_priv(ndev), BRCMF_C_SET_SSID, |
1690 | &join_params, join_params_size); | 1699 | &join_params, join_params_size); |
1691 | if (err) | 1700 | if (err) |
1692 | WL_ERR("WLC_SET_SSID failed (%d)\n", err); | 1701 | WL_ERR("WLC_SET_SSID failed (%d)\n", err); |
@@ -1715,8 +1724,8 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev, | |||
1715 | 1724 | ||
1716 | memcpy(&scbval.ea, &profile->bssid, ETH_ALEN); | 1725 | memcpy(&scbval.ea, &profile->bssid, ETH_ALEN); |
1717 | scbval.val = cpu_to_le32(reason_code); | 1726 | scbval.val = cpu_to_le32(reason_code); |
1718 | err = brcmf_fil_cmd_data_set(ndev, BRCMF_C_DISASSOC, &scbval, | 1727 | err = brcmf_fil_cmd_data_set(netdev_priv(ndev), BRCMF_C_DISASSOC, |
1719 | sizeof(struct brcmf_scb_val_le)); | 1728 | &scbval, sizeof(scbval)); |
1720 | if (err) | 1729 | if (err) |
1721 | WL_ERR("error (%d)\n", err); | 1730 | WL_ERR("error (%d)\n", err); |
1722 | 1731 | ||
@@ -1732,7 +1741,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy, | |||
1732 | { | 1741 | { |
1733 | 1742 | ||
1734 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 1743 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
1735 | struct net_device *ndev = cfg_to_ndev(cfg); | 1744 | struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); |
1736 | u16 txpwrmw; | 1745 | u16 txpwrmw; |
1737 | s32 err = 0; | 1746 | s32 err = 0; |
1738 | s32 disable = 0; | 1747 | s32 disable = 0; |
@@ -1756,7 +1765,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy, | |||
1756 | } | 1765 | } |
1757 | /* Make sure radio is off or on as far as software is concerned */ | 1766 | /* Make sure radio is off or on as far as software is concerned */ |
1758 | disable = WL_RADIO_SW_DISABLE << 16; | 1767 | disable = WL_RADIO_SW_DISABLE << 16; |
1759 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_RADIO, disable); | 1768 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_RADIO, disable); |
1760 | if (err) | 1769 | if (err) |
1761 | WL_ERR("WLC_SET_RADIO error (%d)\n", err); | 1770 | WL_ERR("WLC_SET_RADIO error (%d)\n", err); |
1762 | 1771 | ||
@@ -1764,8 +1773,8 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy, | |||
1764 | txpwrmw = 0xffff; | 1773 | txpwrmw = 0xffff; |
1765 | else | 1774 | else |
1766 | txpwrmw = (u16) dbm; | 1775 | txpwrmw = (u16) dbm; |
1767 | err = brcmf_fil_iovar_int_set(ndev, "qtxpower", | 1776 | err = brcmf_fil_iovar_int_set(ifp, "qtxpower", |
1768 | (s32) (brcmf_mw_to_qdbm(txpwrmw))); | 1777 | (s32)brcmf_mw_to_qdbm(txpwrmw)); |
1769 | if (err) | 1778 | if (err) |
1770 | WL_ERR("qtxpower error (%d)\n", err); | 1779 | WL_ERR("qtxpower error (%d)\n", err); |
1771 | cfg->conf->tx_power = dbm; | 1780 | cfg->conf->tx_power = dbm; |
@@ -1787,7 +1796,7 @@ static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm) | |||
1787 | if (!check_sys_up(wiphy)) | 1796 | if (!check_sys_up(wiphy)) |
1788 | return -EIO; | 1797 | return -EIO; |
1789 | 1798 | ||
1790 | err = brcmf_fil_iovar_int_get(ndev, "qtxpower", &txpwrdbm); | 1799 | err = brcmf_fil_iovar_int_get(netdev_priv(ndev), "qtxpower", &txpwrdbm); |
1791 | if (err) { | 1800 | if (err) { |
1792 | WL_ERR("error (%d)\n", err); | 1801 | WL_ERR("error (%d)\n", err); |
1793 | goto done; | 1802 | goto done; |
@@ -1805,19 +1814,16 @@ static s32 | |||
1805 | brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev, | 1814 | brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev, |
1806 | u8 key_idx, bool unicast, bool multicast) | 1815 | u8 key_idx, bool unicast, bool multicast) |
1807 | { | 1816 | { |
1808 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | ||
1809 | u32 index; | 1817 | u32 index; |
1810 | u32 wsec; | 1818 | u32 wsec; |
1811 | s32 err = 0; | 1819 | s32 err = 0; |
1812 | s32 bssidx; | ||
1813 | 1820 | ||
1814 | WL_TRACE("Enter\n"); | 1821 | WL_TRACE("Enter\n"); |
1815 | WL_CONN("key index (%d)\n", key_idx); | 1822 | WL_CONN("key index (%d)\n", key_idx); |
1816 | if (!check_sys_up(wiphy)) | 1823 | if (!check_sys_up(wiphy)) |
1817 | return -EIO; | 1824 | return -EIO; |
1818 | 1825 | ||
1819 | bssidx = brcmf_find_bssidx(cfg, ndev); | 1826 | err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wsec", &wsec); |
1820 | err = brcmf_fil_bsscfg_int_get(ndev, "wsec", &wsec); | ||
1821 | if (err) { | 1827 | if (err) { |
1822 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); | 1828 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); |
1823 | goto done; | 1829 | goto done; |
@@ -1826,8 +1832,8 @@ brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev, | |||
1826 | if (wsec & WEP_ENABLED) { | 1832 | if (wsec & WEP_ENABLED) { |
1827 | /* Just select a new current key */ | 1833 | /* Just select a new current key */ |
1828 | index = key_idx; | 1834 | index = key_idx; |
1829 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_KEY_PRIMARY, | 1835 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), |
1830 | index); | 1836 | BRCMF_C_SET_KEY_PRIMARY, index); |
1831 | if (err) | 1837 | if (err) |
1832 | WL_ERR("error (%d)\n", err); | 1838 | WL_ERR("error (%d)\n", err); |
1833 | } | 1839 | } |
@@ -1996,13 +2002,13 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, | |||
1996 | if (err) | 2002 | if (err) |
1997 | goto done; | 2003 | goto done; |
1998 | 2004 | ||
1999 | err = brcmf_fil_bsscfg_int_get(ndev, "wsec", &wsec); | 2005 | err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wsec", &wsec); |
2000 | if (err) { | 2006 | if (err) { |
2001 | WL_ERR("get wsec error (%d)\n", err); | 2007 | WL_ERR("get wsec error (%d)\n", err); |
2002 | goto done; | 2008 | goto done; |
2003 | } | 2009 | } |
2004 | wsec |= val; | 2010 | wsec |= val; |
2005 | err = brcmf_fil_bsscfg_int_set(ndev, "wsec", wsec); | 2011 | err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wsec", wsec); |
2006 | if (err) { | 2012 | if (err) { |
2007 | WL_ERR("set wsec error (%d)\n", err); | 2013 | WL_ERR("set wsec error (%d)\n", err); |
2008 | goto done; | 2014 | goto done; |
@@ -2072,7 +2078,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, | |||
2072 | memset(¶ms, 0, sizeof(params)); | 2078 | memset(¶ms, 0, sizeof(params)); |
2073 | 2079 | ||
2074 | bssidx = brcmf_find_bssidx(cfg, ndev); | 2080 | bssidx = brcmf_find_bssidx(cfg, ndev); |
2075 | err = brcmf_fil_bsscfg_int_get(ndev, "wsec", &wsec); | 2081 | err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wsec", &wsec); |
2076 | if (err) { | 2082 | if (err) { |
2077 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); | 2083 | WL_ERR("WLC_GET_WSEC error (%d)\n", err); |
2078 | /* Ignore this error, may happen during DISASSOC */ | 2084 | /* Ignore this error, may happen during DISASSOC */ |
@@ -2138,7 +2144,8 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, | |||
2138 | 2144 | ||
2139 | if (cfg->conf->mode == WL_MODE_AP) { | 2145 | if (cfg->conf->mode == WL_MODE_AP) { |
2140 | memcpy(&sta_info_le, mac, ETH_ALEN); | 2146 | memcpy(&sta_info_le, mac, ETH_ALEN); |
2141 | err = brcmf_fil_iovar_data_get(ndev, "sta_info", &sta_info_le, | 2147 | err = brcmf_fil_iovar_data_get(netdev_priv(ndev), "sta_info", |
2148 | &sta_info_le, | ||
2142 | sizeof(sta_info_le)); | 2149 | sizeof(sta_info_le)); |
2143 | if (err < 0) { | 2150 | if (err < 0) { |
2144 | WL_ERR("GET STA INFO failed, %d\n", err); | 2151 | WL_ERR("GET STA INFO failed, %d\n", err); |
@@ -2160,7 +2167,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, | |||
2160 | goto done; | 2167 | goto done; |
2161 | } | 2168 | } |
2162 | /* Report the current tx rate */ | 2169 | /* Report the current tx rate */ |
2163 | err = brcmf_fil_cmd_int_get(ndev, BRCMF_C_GET_RATE, &rate); | 2170 | err = brcmf_fil_cmd_int_get(netdev_priv(ndev), BRCMF_C_GET_RATE, &rate); |
2164 | if (err) { | 2171 | if (err) { |
2165 | WL_ERR("Could not get rate (%d)\n", err); | 2172 | WL_ERR("Could not get rate (%d)\n", err); |
2166 | goto done; | 2173 | goto done; |
@@ -2172,8 +2179,9 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, | |||
2172 | 2179 | ||
2173 | if (test_bit(WL_STATUS_CONNECTED, &cfg->status)) { | 2180 | if (test_bit(WL_STATUS_CONNECTED, &cfg->status)) { |
2174 | memset(&scb_val, 0, sizeof(scb_val)); | 2181 | memset(&scb_val, 0, sizeof(scb_val)); |
2175 | err = brcmf_fil_cmd_data_get(ndev, BRCMF_C_GET_RSSI, &scb_val, | 2182 | err = brcmf_fil_cmd_data_get(netdev_priv(ndev), |
2176 | sizeof(struct brcmf_scb_val_le)); | 2183 | BRCMF_C_GET_RSSI, &scb_val, |
2184 | sizeof(scb_val)); | ||
2177 | if (err) { | 2185 | if (err) { |
2178 | WL_ERR("Could not get rssi (%d)\n", err); | 2186 | WL_ERR("Could not get rssi (%d)\n", err); |
2179 | goto done; | 2187 | goto done; |
@@ -2218,7 +2226,7 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev, | |||
2218 | pm = enabled ? PM_FAST : PM_OFF; | 2226 | pm = enabled ? PM_FAST : PM_OFF; |
2219 | WL_INFO("power save %s\n", (pm ? "enabled" : "disabled")); | 2227 | WL_INFO("power save %s\n", (pm ? "enabled" : "disabled")); |
2220 | 2228 | ||
2221 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_PM, pm); | 2229 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), BRCMF_C_SET_PM, pm); |
2222 | if (err) { | 2230 | if (err) { |
2223 | if (err == -ENODEV) | 2231 | if (err == -ENODEV) |
2224 | WL_ERR("net_device is not ready yet\n"); | 2232 | WL_ERR("net_device is not ready yet\n"); |
@@ -2249,8 +2257,8 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *ndev, | |||
2249 | 2257 | ||
2250 | /* addr param is always NULL. ignore it */ | 2258 | /* addr param is always NULL. ignore it */ |
2251 | /* Get current rateset */ | 2259 | /* Get current rateset */ |
2252 | err = brcmf_fil_cmd_data_get(ndev, BRCM_GET_CURR_RATESET, &rateset_le, | 2260 | err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCM_GET_CURR_RATESET, |
2253 | sizeof(rateset_le)); | 2261 | &rateset_le, sizeof(rateset_le)); |
2254 | if (err) { | 2262 | if (err) { |
2255 | WL_ERR("could not get current rateset (%d)\n", err); | 2263 | WL_ERR("could not get current rateset (%d)\n", err); |
2256 | goto done; | 2264 | goto done; |
@@ -2277,8 +2285,8 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *ndev, | |||
2277 | * Set rate override, | 2285 | * Set rate override, |
2278 | * Since the is a/b/g-blind, both a/bg_rate are enforced. | 2286 | * Since the is a/b/g-blind, both a/bg_rate are enforced. |
2279 | */ | 2287 | */ |
2280 | err_bg = brcmf_fil_iovar_int_set(ndev, "bg_rate", rate); | 2288 | err_bg = brcmf_fil_iovar_int_set(netdev_priv(ndev), "bg_rate", rate); |
2281 | err_a = brcmf_fil_iovar_int_set(ndev, "a_rate", rate); | 2289 | err_a = brcmf_fil_iovar_int_set(netdev_priv(ndev), "a_rate", rate); |
2282 | if (err_bg && err_a) { | 2290 | if (err_bg && err_a) { |
2283 | WL_ERR("could not set fixed rate (%d) (%d)\n", err_bg, err_a); | 2291 | WL_ERR("could not set fixed rate (%d) (%d)\n", err_bg, err_a); |
2284 | err = err_bg | err_a; | 2292 | err = err_bg | err_a; |
@@ -2407,8 +2415,8 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_info *cfg, | |||
2407 | 2415 | ||
2408 | *(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX); | 2416 | *(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX); |
2409 | 2417 | ||
2410 | err = brcmf_fil_cmd_data_get(ndev, BRCMF_C_GET_BSS_INFO, buf, | 2418 | err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO, |
2411 | WL_BSS_INFO_MAX); | 2419 | buf, WL_BSS_INFO_MAX); |
2412 | if (err) { | 2420 | if (err) { |
2413 | WL_ERR("WLC_GET_BSS_INFO failed: %d\n", err); | 2421 | WL_ERR("WLC_GET_BSS_INFO failed: %d\n", err); |
2414 | goto CleanUp; | 2422 | goto CleanUp; |
@@ -2533,6 +2541,7 @@ brcmf_find_wpaie(u8 *parse, u32 len) | |||
2533 | static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg) | 2541 | static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg) |
2534 | { | 2542 | { |
2535 | struct brcmf_cfg80211_profile *profile = cfg->profile; | 2543 | struct brcmf_cfg80211_profile *profile = cfg->profile; |
2544 | struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); | ||
2536 | struct brcmf_bss_info_le *bi; | 2545 | struct brcmf_bss_info_le *bi; |
2537 | struct brcmf_ssid *ssid; | 2546 | struct brcmf_ssid *ssid; |
2538 | struct brcmf_tlv *tim; | 2547 | struct brcmf_tlv *tim; |
@@ -2549,8 +2558,7 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg) | |||
2549 | ssid = &profile->ssid; | 2558 | ssid = &profile->ssid; |
2550 | 2559 | ||
2551 | *(__le32 *)cfg->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX); | 2560 | *(__le32 *)cfg->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX); |
2552 | err = brcmf_fil_cmd_data_get(cfg_to_ndev(cfg), | 2561 | err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, |
2553 | BRCMF_C_GET_BSS_INFO, | ||
2554 | cfg->extra_buf, WL_EXTRA_BUF_MAX); | 2562 | cfg->extra_buf, WL_EXTRA_BUF_MAX); |
2555 | if (err) { | 2563 | if (err) { |
2556 | WL_ERR("Could not get bss info %d\n", err); | 2564 | WL_ERR("Could not get bss info %d\n", err); |
@@ -2576,8 +2584,7 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg) | |||
2576 | * so we speficially query dtim information to dongle. | 2584 | * so we speficially query dtim information to dongle. |
2577 | */ | 2585 | */ |
2578 | u32 var; | 2586 | u32 var; |
2579 | err = brcmf_fil_iovar_int_get(cfg_to_ndev(cfg), | 2587 | err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var); |
2580 | "dtim_assoc", &var); | ||
2581 | if (err) { | 2588 | if (err) { |
2582 | WL_ERR("wl dtim_assoc failed (%d)\n", err); | 2589 | WL_ERR("wl dtim_assoc failed (%d)\n", err); |
2583 | goto update_bss_info_out; | 2590 | goto update_bss_info_out; |
@@ -2677,7 +2684,7 @@ brcmf_get_iscan_results(struct brcmf_cfg80211_iscan_ctrl *iscan, u32 *status, | |||
2677 | results_le->version = 0; | 2684 | results_le->version = 0; |
2678 | results_le->count = 0; | 2685 | results_le->count = 0; |
2679 | 2686 | ||
2680 | err = brcmf_fil_iovar_data_get(iscan->ndev, "iscanresults", | 2687 | err = brcmf_fil_iovar_data_get(netdev_priv(iscan->ndev), "iscanresults", |
2681 | iscan->scan_buf, | 2688 | iscan->scan_buf, |
2682 | sizeof(iscan->scan_buf)); | 2689 | sizeof(iscan->scan_buf)); |
2683 | if (err) { | 2690 | if (err) { |
@@ -3080,8 +3087,8 @@ brcmf_update_pmklist(struct net_device *ndev, | |||
3080 | } | 3087 | } |
3081 | 3088 | ||
3082 | if (!err) | 3089 | if (!err) |
3083 | brcmf_fil_iovar_data_set(ndev, "pmkid_info", (char *)pmk_list, | 3090 | brcmf_fil_iovar_data_set(netdev_priv(ndev), "pmkid_info", |
3084 | sizeof(*pmk_list)); | 3091 | (char *)pmk_list, sizeof(*pmk_list)); |
3085 | 3092 | ||
3086 | return err; | 3093 | return err; |
3087 | } | 3094 | } |
@@ -3320,10 +3327,11 @@ static int brcmf_dev_pno_clean(struct net_device *ndev) | |||
3320 | int ret; | 3327 | int ret; |
3321 | 3328 | ||
3322 | /* Disable pfn */ | 3329 | /* Disable pfn */ |
3323 | ret = brcmf_fil_iovar_int_set(ndev, "pfn", 0); | 3330 | ret = brcmf_fil_iovar_int_set(netdev_priv(ndev), "pfn", 0); |
3324 | if (ret == 0) { | 3331 | if (ret == 0) { |
3325 | /* clear pfn */ | 3332 | /* clear pfn */ |
3326 | ret = brcmf_fil_iovar_data_set(ndev, "pfnclear", NULL, 0); | 3333 | ret = brcmf_fil_iovar_data_set(netdev_priv(ndev), "pfnclear", |
3334 | NULL, 0); | ||
3327 | } | 3335 | } |
3328 | if (ret < 0) | 3336 | if (ret < 0) |
3329 | WL_ERR("failed code %d\n", ret); | 3337 | WL_ERR("failed code %d\n", ret); |
@@ -3346,8 +3354,8 @@ static int brcmf_dev_pno_config(struct net_device *ndev) | |||
3346 | /* set up pno scan fr */ | 3354 | /* set up pno scan fr */ |
3347 | pfn_param.scan_freq = cpu_to_le32(BRCMF_PNO_TIME); | 3355 | pfn_param.scan_freq = cpu_to_le32(BRCMF_PNO_TIME); |
3348 | 3356 | ||
3349 | return brcmf_fil_iovar_data_set(ndev, "pfn_set", &pfn_param, | 3357 | return brcmf_fil_iovar_data_set(netdev_priv(ndev), "pfn_set", |
3350 | sizeof(pfn_param)); | 3358 | &pfn_param, sizeof(pfn_param)); |
3351 | } | 3359 | } |
3352 | 3360 | ||
3353 | static int | 3361 | static int |
@@ -3420,14 +3428,15 @@ brcmf_cfg80211_sched_scan_start(struct wiphy *wiphy, | |||
3420 | pfn.flags = cpu_to_le32(1 << BRCMF_PNO_HIDDEN_BIT); | 3428 | pfn.flags = cpu_to_le32(1 << BRCMF_PNO_HIDDEN_BIT); |
3421 | pfn.ssid.SSID_len = cpu_to_le32(ssid_len); | 3429 | pfn.ssid.SSID_len = cpu_to_le32(ssid_len); |
3422 | memcpy(pfn.ssid.SSID, ssid->ssid, ssid_len); | 3430 | memcpy(pfn.ssid.SSID, ssid->ssid, ssid_len); |
3423 | ret = brcmf_fil_iovar_data_set(ndev, "pfn_add", | 3431 | ret = brcmf_fil_iovar_data_set(netdev_priv(ndev), |
3424 | &pfn, sizeof(pfn)); | 3432 | "pfn_add", &pfn, |
3433 | sizeof(pfn)); | ||
3425 | WL_SCAN(">>> PNO filter %s for ssid (%s)\n", | 3434 | WL_SCAN(">>> PNO filter %s for ssid (%s)\n", |
3426 | ret == 0 ? "set" : "failed", | 3435 | ret == 0 ? "set" : "failed", |
3427 | ssid->ssid); | 3436 | ssid->ssid); |
3428 | } | 3437 | } |
3429 | /* Enable the PNO */ | 3438 | /* Enable the PNO */ |
3430 | if (brcmf_fil_iovar_int_set(ndev, "pfn", 1) < 0) { | 3439 | if (brcmf_fil_iovar_int_set(netdev_priv(ndev), "pfn", 1) < 0) { |
3431 | WL_ERR("PNO enable failed!! ret=%d\n", ret); | 3440 | WL_ERR("PNO enable failed!! ret=%d\n", ret); |
3432 | return -EINVAL; | 3441 | return -EINVAL; |
3433 | } | 3442 | } |
@@ -3464,11 +3473,11 @@ static int brcmf_cfg80211_testmode(struct wiphy *wiphy, void *data, int len) | |||
3464 | dcmd->buf, dcmd->len); | 3473 | dcmd->buf, dcmd->len); |
3465 | 3474 | ||
3466 | if (dcmd->set) | 3475 | if (dcmd->set) |
3467 | ret = brcmf_fil_cmd_data_set(ndev, dcmd->cmd, dcmd->buf, | 3476 | ret = brcmf_fil_cmd_data_set(netdev_priv(ndev), dcmd->cmd, |
3468 | dcmd->len); | 3477 | dcmd->buf, dcmd->len); |
3469 | else | 3478 | else |
3470 | ret = brcmf_fil_cmd_data_get(ndev, dcmd->cmd, dcmd->buf, | 3479 | ret = brcmf_fil_cmd_data_get(netdev_priv(ndev), dcmd->cmd, |
3471 | dcmd->len); | 3480 | dcmd->buf, dcmd->len); |
3472 | if (ret == 0) { | 3481 | if (ret == 0) { |
3473 | reply = cfg80211_testmode_alloc_reply_skb(wiphy, sizeof(*dcmd)); | 3482 | reply = cfg80211_testmode_alloc_reply_skb(wiphy, sizeof(*dcmd)); |
3474 | nla_put(reply, NL80211_ATTR_TESTDATA, sizeof(*dcmd), dcmd); | 3483 | nla_put(reply, NL80211_ATTR_TESTDATA, sizeof(*dcmd), dcmd); |
@@ -3480,22 +3489,23 @@ static int brcmf_cfg80211_testmode(struct wiphy *wiphy, void *data, int len) | |||
3480 | 3489 | ||
3481 | static s32 brcmf_configure_opensecurity(struct net_device *ndev, s32 bssidx) | 3490 | static s32 brcmf_configure_opensecurity(struct net_device *ndev, s32 bssidx) |
3482 | { | 3491 | { |
3492 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
3483 | s32 err; | 3493 | s32 err; |
3484 | 3494 | ||
3485 | /* set auth */ | 3495 | /* set auth */ |
3486 | err = brcmf_fil_bsscfg_int_set(ndev, "auth", 0); | 3496 | err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0); |
3487 | if (err < 0) { | 3497 | if (err < 0) { |
3488 | WL_ERR("auth error %d\n", err); | 3498 | WL_ERR("auth error %d\n", err); |
3489 | return err; | 3499 | return err; |
3490 | } | 3500 | } |
3491 | /* set wsec */ | 3501 | /* set wsec */ |
3492 | err = brcmf_fil_bsscfg_int_set(ndev, "wsec", 0); | 3502 | err = brcmf_fil_bsscfg_int_set(ifp, "wsec", 0); |
3493 | if (err < 0) { | 3503 | if (err < 0) { |
3494 | WL_ERR("wsec error %d\n", err); | 3504 | WL_ERR("wsec error %d\n", err); |
3495 | return err; | 3505 | return err; |
3496 | } | 3506 | } |
3497 | /* set upper-layer auth */ | 3507 | /* set upper-layer auth */ |
3498 | err = brcmf_fil_bsscfg_int_set(ndev, "wpa_auth", WPA_AUTH_NONE); | 3508 | err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", WPA_AUTH_NONE); |
3499 | if (err < 0) { | 3509 | if (err < 0) { |
3500 | WL_ERR("wpa_auth error %d\n", err); | 3510 | WL_ERR("wpa_auth error %d\n", err); |
3501 | return err; | 3511 | return err; |
@@ -3516,6 +3526,7 @@ static s32 | |||
3516 | brcmf_configure_wpaie(struct net_device *ndev, struct brcmf_vs_tlv *wpa_ie, | 3526 | brcmf_configure_wpaie(struct net_device *ndev, struct brcmf_vs_tlv *wpa_ie, |
3517 | bool is_rsn_ie, s32 bssidx) | 3527 | bool is_rsn_ie, s32 bssidx) |
3518 | { | 3528 | { |
3529 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
3519 | u32 auth = 0; /* d11 open authentication */ | 3530 | u32 auth = 0; /* d11 open authentication */ |
3520 | u16 count; | 3531 | u16 count; |
3521 | s32 err = 0; | 3532 | s32 err = 0; |
@@ -3656,7 +3667,7 @@ brcmf_configure_wpaie(struct net_device *ndev, struct brcmf_vs_tlv *wpa_ie, | |||
3656 | wme_bss_disable = 0; | 3667 | wme_bss_disable = 0; |
3657 | } | 3668 | } |
3658 | /* set wme_bss_disable to sync RSN Capabilities */ | 3669 | /* set wme_bss_disable to sync RSN Capabilities */ |
3659 | err = brcmf_fil_bsscfg_int_set(ndev, "wme_bss_disable", | 3670 | err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable", |
3660 | wme_bss_disable); | 3671 | wme_bss_disable); |
3661 | if (err < 0) { | 3672 | if (err < 0) { |
3662 | WL_ERR("wme_bss_disable error %d\n", err); | 3673 | WL_ERR("wme_bss_disable error %d\n", err); |
@@ -3667,19 +3678,19 @@ brcmf_configure_wpaie(struct net_device *ndev, struct brcmf_vs_tlv *wpa_ie, | |||
3667 | wsec = (pval | gval | SES_OW_ENABLED); | 3678 | wsec = (pval | gval | SES_OW_ENABLED); |
3668 | 3679 | ||
3669 | /* set auth */ | 3680 | /* set auth */ |
3670 | err = brcmf_fil_bsscfg_int_set(ndev, "auth", auth); | 3681 | err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth); |
3671 | if (err < 0) { | 3682 | if (err < 0) { |
3672 | WL_ERR("auth error %d\n", err); | 3683 | WL_ERR("auth error %d\n", err); |
3673 | goto exit; | 3684 | goto exit; |
3674 | } | 3685 | } |
3675 | /* set wsec */ | 3686 | /* set wsec */ |
3676 | err = brcmf_fil_bsscfg_int_set(ndev, "wsec", wsec); | 3687 | err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec); |
3677 | if (err < 0) { | 3688 | if (err < 0) { |
3678 | WL_ERR("wsec error %d\n", err); | 3689 | WL_ERR("wsec error %d\n", err); |
3679 | goto exit; | 3690 | goto exit; |
3680 | } | 3691 | } |
3681 | /* set upper-layer auth */ | 3692 | /* set upper-layer auth */ |
3682 | err = brcmf_fil_bsscfg_int_set(ndev, "wpa_auth", wpa_auth); | 3693 | err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth); |
3683 | if (err < 0) { | 3694 | if (err < 0) { |
3684 | WL_ERR("wpa_auth error %d\n", err); | 3695 | WL_ERR("wpa_auth error %d\n", err); |
3685 | goto exit; | 3696 | goto exit; |
@@ -3909,7 +3920,7 @@ brcmf_set_management_ie(struct brcmf_cfg80211_info *cfg, | |||
3909 | } | 3920 | } |
3910 | } | 3921 | } |
3911 | if (total_ie_buf_len) { | 3922 | if (total_ie_buf_len) { |
3912 | err = brcmf_fil_bsscfg_data_set(ndev, "vndr_ie", | 3923 | err = brcmf_fil_bsscfg_data_set(netdev_priv(ndev), "vndr_ie", |
3913 | iovar_ie_buf, | 3924 | iovar_ie_buf, |
3914 | total_ie_buf_len); | 3925 | total_ie_buf_len); |
3915 | if (err) | 3926 | if (err) |
@@ -3926,6 +3937,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | |||
3926 | struct cfg80211_ap_settings *settings) | 3937 | struct cfg80211_ap_settings *settings) |
3927 | { | 3938 | { |
3928 | s32 ie_offset; | 3939 | s32 ie_offset; |
3940 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
3929 | struct brcmf_tlv *ssid_ie; | 3941 | struct brcmf_tlv *ssid_ie; |
3930 | struct brcmf_ssid_le ssid_le; | 3942 | struct brcmf_ssid_le ssid_le; |
3931 | s32 err = -EPERM; | 3943 | s32 err = -EPERM; |
@@ -3966,17 +3978,17 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | |||
3966 | } | 3978 | } |
3967 | 3979 | ||
3968 | brcmf_set_mpc(ndev, 0); | 3980 | brcmf_set_mpc(ndev, 0); |
3969 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_DOWN, 1); | 3981 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1); |
3970 | if (err < 0) { | 3982 | if (err < 0) { |
3971 | WL_ERR("BRCMF_C_DOWN error %d\n", err); | 3983 | WL_ERR("BRCMF_C_DOWN error %d\n", err); |
3972 | goto exit; | 3984 | goto exit; |
3973 | } | 3985 | } |
3974 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_INFRA, 1); | 3986 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1); |
3975 | if (err < 0) { | 3987 | if (err < 0) { |
3976 | WL_ERR("SET INFRA error %d\n", err); | 3988 | WL_ERR("SET INFRA error %d\n", err); |
3977 | goto exit; | 3989 | goto exit; |
3978 | } | 3990 | } |
3979 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_AP, 1); | 3991 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1); |
3980 | if (err < 0) { | 3992 | if (err < 0) { |
3981 | WL_ERR("setting AP mode failed %d\n", err); | 3993 | WL_ERR("setting AP mode failed %d\n", err); |
3982 | goto exit; | 3994 | goto exit; |
@@ -4045,7 +4057,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | |||
4045 | WL_TRACE("Applied Vndr IEs for Probe Resp\n"); | 4057 | WL_TRACE("Applied Vndr IEs for Probe Resp\n"); |
4046 | 4058 | ||
4047 | if (settings->beacon_interval) { | 4059 | if (settings->beacon_interval) { |
4048 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_BCNPRD, | 4060 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, |
4049 | settings->beacon_interval); | 4061 | settings->beacon_interval); |
4050 | if (err < 0) { | 4062 | if (err < 0) { |
4051 | WL_ERR("Beacon Interval Set Error, %d\n", err); | 4063 | WL_ERR("Beacon Interval Set Error, %d\n", err); |
@@ -4053,14 +4065,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | |||
4053 | } | 4065 | } |
4054 | } | 4066 | } |
4055 | if (settings->dtim_period) { | 4067 | if (settings->dtim_period) { |
4056 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_DTIMPRD, | 4068 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD, |
4057 | settings->dtim_period); | 4069 | settings->dtim_period); |
4058 | if (err < 0) { | 4070 | if (err < 0) { |
4059 | WL_ERR("DTIM Interval Set Error, %d\n", err); | 4071 | WL_ERR("DTIM Interval Set Error, %d\n", err); |
4060 | goto exit; | 4072 | goto exit; |
4061 | } | 4073 | } |
4062 | } | 4074 | } |
4063 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_UP, 1); | 4075 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1); |
4064 | if (err < 0) { | 4076 | if (err < 0) { |
4065 | WL_ERR("BRCMF_C_UP error (%d)\n", err); | 4077 | WL_ERR("BRCMF_C_UP error (%d)\n", err); |
4066 | goto exit; | 4078 | goto exit; |
@@ -4070,8 +4082,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | |||
4070 | /* join parameters starts with ssid */ | 4082 | /* join parameters starts with ssid */ |
4071 | memcpy(&join_params.ssid_le, &ssid_le, sizeof(ssid_le)); | 4083 | memcpy(&join_params.ssid_le, &ssid_le, sizeof(ssid_le)); |
4072 | /* create softap */ | 4084 | /* create softap */ |
4073 | err = brcmf_fil_cmd_data_set(ndev, BRCMF_C_SET_SSID, &join_params, | 4085 | err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, |
4074 | sizeof(join_params)); | 4086 | &join_params, sizeof(join_params)); |
4075 | if (err < 0) { | 4087 | if (err < 0) { |
4076 | WL_ERR("SET SSID error (%d)\n", err); | 4088 | WL_ERR("SET SSID error (%d)\n", err); |
4077 | goto exit; | 4089 | goto exit; |
@@ -4096,12 +4108,13 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) | |||
4096 | /* Due to most likely deauths outstanding we sleep */ | 4108 | /* Due to most likely deauths outstanding we sleep */ |
4097 | /* first to make sure they get processed by fw. */ | 4109 | /* first to make sure they get processed by fw. */ |
4098 | msleep(400); | 4110 | msleep(400); |
4099 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_AP, 0); | 4111 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), |
4112 | BRCMF_C_SET_AP, 0); | ||
4100 | if (err < 0) { | 4113 | if (err < 0) { |
4101 | WL_ERR("setting AP mode failed %d\n", err); | 4114 | WL_ERR("setting AP mode failed %d\n", err); |
4102 | goto exit; | 4115 | goto exit; |
4103 | } | 4116 | } |
4104 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_UP, 0); | 4117 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), BRCMF_C_UP, 0); |
4105 | if (err < 0) { | 4118 | if (err < 0) { |
4106 | WL_ERR("BRCMF_C_UP error %d\n", err); | 4119 | WL_ERR("BRCMF_C_UP error %d\n", err); |
4107 | goto exit; | 4120 | goto exit; |
@@ -4131,7 +4144,7 @@ brcmf_cfg80211_del_station(struct wiphy *wiphy, struct net_device *ndev, | |||
4131 | 4144 | ||
4132 | memcpy(&scbval.ea, mac, ETH_ALEN); | 4145 | memcpy(&scbval.ea, mac, ETH_ALEN); |
4133 | scbval.val = cpu_to_le32(WLAN_REASON_DEAUTH_LEAVING); | 4146 | scbval.val = cpu_to_le32(WLAN_REASON_DEAUTH_LEAVING); |
4134 | err = brcmf_fil_cmd_data_set(ndev, | 4147 | err = brcmf_fil_cmd_data_set(netdev_priv(ndev), |
4135 | BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON, | 4148 | BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON, |
4136 | &scbval, sizeof(scbval)); | 4149 | &scbval, sizeof(scbval)); |
4137 | if (err) | 4150 | if (err) |
@@ -4335,7 +4348,7 @@ static void brcmf_clear_assoc_ies(struct brcmf_cfg80211_info *cfg) | |||
4335 | 4348 | ||
4336 | static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg) | 4349 | static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg) |
4337 | { | 4350 | { |
4338 | struct net_device *ndev = cfg_to_ndev(cfg); | 4351 | struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); |
4339 | struct brcmf_cfg80211_assoc_ielen_le *assoc_info; | 4352 | struct brcmf_cfg80211_assoc_ielen_le *assoc_info; |
4340 | struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg); | 4353 | struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg); |
4341 | u32 req_len; | 4354 | u32 req_len; |
@@ -4344,8 +4357,8 @@ static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg) | |||
4344 | 4357 | ||
4345 | brcmf_clear_assoc_ies(cfg); | 4358 | brcmf_clear_assoc_ies(cfg); |
4346 | 4359 | ||
4347 | err = brcmf_fil_iovar_data_get(ndev, "assoc_info", cfg->extra_buf, | 4360 | err = brcmf_fil_iovar_data_get(ifp, "assoc_info", |
4348 | WL_ASSOC_INFO_MAX); | 4361 | cfg->extra_buf, WL_ASSOC_INFO_MAX); |
4349 | if (err) { | 4362 | if (err) { |
4350 | WL_ERR("could not get assoc info (%d)\n", err); | 4363 | WL_ERR("could not get assoc info (%d)\n", err); |
4351 | return err; | 4364 | return err; |
@@ -4355,7 +4368,7 @@ static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg) | |||
4355 | req_len = le32_to_cpu(assoc_info->req_len); | 4368 | req_len = le32_to_cpu(assoc_info->req_len); |
4356 | resp_len = le32_to_cpu(assoc_info->resp_len); | 4369 | resp_len = le32_to_cpu(assoc_info->resp_len); |
4357 | if (req_len) { | 4370 | if (req_len) { |
4358 | err = brcmf_fil_iovar_data_get(ndev, "assoc_req_ies", | 4371 | err = brcmf_fil_iovar_data_get(ifp, "assoc_req_ies", |
4359 | cfg->extra_buf, | 4372 | cfg->extra_buf, |
4360 | WL_ASSOC_INFO_MAX); | 4373 | WL_ASSOC_INFO_MAX); |
4361 | if (err) { | 4374 | if (err) { |
@@ -4371,7 +4384,7 @@ static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg) | |||
4371 | conn_info->req_ie = NULL; | 4384 | conn_info->req_ie = NULL; |
4372 | } | 4385 | } |
4373 | if (resp_len) { | 4386 | if (resp_len) { |
4374 | err = brcmf_fil_iovar_data_get(ndev, "assoc_resp_ies", | 4387 | err = brcmf_fil_iovar_data_get(ifp, "assoc_resp_ies", |
4375 | cfg->extra_buf, | 4388 | cfg->extra_buf, |
4376 | WL_ASSOC_INFO_MAX); | 4389 | WL_ASSOC_INFO_MAX); |
4377 | if (err) { | 4390 | if (err) { |
@@ -4422,8 +4435,8 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_info *cfg, | |||
4422 | 4435 | ||
4423 | /* data sent to dongle has to be little endian */ | 4436 | /* data sent to dongle has to be little endian */ |
4424 | *(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX); | 4437 | *(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX); |
4425 | err = brcmf_fil_cmd_data_get(ndev, BRCMF_C_GET_BSS_INFO, buf, | 4438 | err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO, |
4426 | WL_BSS_INFO_MAX); | 4439 | buf, WL_BSS_INFO_MAX); |
4427 | 4440 | ||
4428 | if (err) | 4441 | if (err) |
4429 | goto done; | 4442 | goto done; |
@@ -4637,7 +4650,7 @@ brcmf_notify_scan_status(struct brcmf_cfg80211_info *cfg, | |||
4637 | goto scan_done_out; | 4650 | goto scan_done_out; |
4638 | } | 4651 | } |
4639 | 4652 | ||
4640 | err = brcmf_fil_cmd_data_get(ndev, BRCMF_C_GET_CHANNEL, | 4653 | err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_CHANNEL, |
4641 | &channel_inform_le, | 4654 | &channel_inform_le, |
4642 | sizeof(channel_inform_le)); | 4655 | sizeof(channel_inform_le)); |
4643 | if (err) { | 4656 | if (err) { |
@@ -4653,7 +4666,7 @@ brcmf_notify_scan_status(struct brcmf_cfg80211_info *cfg, | |||
4653 | 4666 | ||
4654 | memset(cfg->scan_results, 0, len); | 4667 | memset(cfg->scan_results, 0, len); |
4655 | bss_list_le->buflen = cpu_to_le32(len); | 4668 | bss_list_le->buflen = cpu_to_le32(len); |
4656 | err = brcmf_fil_cmd_data_get(ndev, BRCMF_C_SCAN_RESULTS, | 4669 | err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_SCAN_RESULTS, |
4657 | cfg->scan_results, len); | 4670 | cfg->scan_results, len); |
4658 | if (err) { | 4671 | if (err) { |
4659 | WL_ERR("%s Scan_results error (%d)\n", ndev->name, err); | 4672 | WL_ERR("%s Scan_results error (%d)\n", ndev->name, err); |
@@ -5004,8 +5017,8 @@ static s32 brcmf_dongle_eventmsg(struct net_device *ndev) | |||
5004 | WL_TRACE("Enter\n"); | 5017 | WL_TRACE("Enter\n"); |
5005 | 5018 | ||
5006 | /* Setup event_msgs */ | 5019 | /* Setup event_msgs */ |
5007 | err = brcmf_fil_iovar_data_get(ndev, "event_msgs", eventmask, | 5020 | err = brcmf_fil_iovar_data_get(netdev_priv(ndev), "event_msgs", |
5008 | BRCMF_EVENTING_MASK_LEN); | 5021 | eventmask, BRCMF_EVENTING_MASK_LEN); |
5009 | if (err) { | 5022 | if (err) { |
5010 | WL_ERR("Get event_msgs error (%d)\n", err); | 5023 | WL_ERR("Get event_msgs error (%d)\n", err); |
5011 | goto dongle_eventmsg_out; | 5024 | goto dongle_eventmsg_out; |
@@ -5033,8 +5046,8 @@ static s32 brcmf_dongle_eventmsg(struct net_device *ndev) | |||
5033 | setbit(eventmask, BRCMF_E_ESCAN_RESULT); | 5046 | setbit(eventmask, BRCMF_E_ESCAN_RESULT); |
5034 | setbit(eventmask, BRCMF_E_PFN_NET_FOUND); | 5047 | setbit(eventmask, BRCMF_E_PFN_NET_FOUND); |
5035 | 5048 | ||
5036 | err = brcmf_fil_iovar_data_set(ndev, "event_msgs", eventmask, | 5049 | err = brcmf_fil_iovar_data_set(netdev_priv(ndev), "event_msgs", |
5037 | BRCMF_EVENTING_MASK_LEN); | 5050 | eventmask, BRCMF_EVENTING_MASK_LEN); |
5038 | if (err) { | 5051 | if (err) { |
5039 | WL_ERR("Set event_msgs error (%d)\n", err); | 5052 | WL_ERR("Set event_msgs error (%d)\n", err); |
5040 | goto dongle_eventmsg_out; | 5053 | goto dongle_eventmsg_out; |
@@ -5048,6 +5061,7 @@ dongle_eventmsg_out: | |||
5048 | static s32 | 5061 | static s32 |
5049 | brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) | 5062 | brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) |
5050 | { | 5063 | { |
5064 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
5051 | s32 err = 0; | 5065 | s32 err = 0; |
5052 | __le32 roamtrigger[2]; | 5066 | __le32 roamtrigger[2]; |
5053 | __le32 roam_delta[2]; | 5067 | __le32 roam_delta[2]; |
@@ -5057,7 +5071,7 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) | |||
5057 | * off to report link down | 5071 | * off to report link down |
5058 | */ | 5072 | */ |
5059 | if (roamvar) { | 5073 | if (roamvar) { |
5060 | err = brcmf_fil_iovar_int_set(ndev, "bcn_timeout", bcn_timeout); | 5074 | err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout); |
5061 | if (err) { | 5075 | if (err) { |
5062 | WL_ERR("bcn_timeout error (%d)\n", err); | 5076 | WL_ERR("bcn_timeout error (%d)\n", err); |
5063 | goto dongle_rom_out; | 5077 | goto dongle_rom_out; |
@@ -5069,7 +5083,7 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) | |||
5069 | * to take care of roaming | 5083 | * to take care of roaming |
5070 | */ | 5084 | */ |
5071 | WL_INFO("Internal Roaming = %s\n", roamvar ? "Off" : "On"); | 5085 | WL_INFO("Internal Roaming = %s\n", roamvar ? "Off" : "On"); |
5072 | err = brcmf_fil_iovar_int_set(ndev, "roam_off", roamvar); | 5086 | err = brcmf_fil_iovar_int_set(ifp, "roam_off", roamvar); |
5073 | if (err) { | 5087 | if (err) { |
5074 | WL_ERR("roam_off error (%d)\n", err); | 5088 | WL_ERR("roam_off error (%d)\n", err); |
5075 | goto dongle_rom_out; | 5089 | goto dongle_rom_out; |
@@ -5077,7 +5091,7 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) | |||
5077 | 5091 | ||
5078 | roamtrigger[0] = cpu_to_le32(WL_ROAM_TRIGGER_LEVEL); | 5092 | roamtrigger[0] = cpu_to_le32(WL_ROAM_TRIGGER_LEVEL); |
5079 | roamtrigger[1] = cpu_to_le32(BRCM_BAND_ALL); | 5093 | roamtrigger[1] = cpu_to_le32(BRCM_BAND_ALL); |
5080 | err = brcmf_fil_cmd_data_set(ndev, BRCMF_C_SET_ROAM_TRIGGER, | 5094 | err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER, |
5081 | (void *)roamtrigger, sizeof(roamtrigger)); | 5095 | (void *)roamtrigger, sizeof(roamtrigger)); |
5082 | if (err) { | 5096 | if (err) { |
5083 | WL_ERR("WLC_SET_ROAM_TRIGGER error (%d)\n", err); | 5097 | WL_ERR("WLC_SET_ROAM_TRIGGER error (%d)\n", err); |
@@ -5086,7 +5100,7 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) | |||
5086 | 5100 | ||
5087 | roam_delta[0] = cpu_to_le32(WL_ROAM_DELTA); | 5101 | roam_delta[0] = cpu_to_le32(WL_ROAM_DELTA); |
5088 | roam_delta[1] = cpu_to_le32(BRCM_BAND_ALL); | 5102 | roam_delta[1] = cpu_to_le32(BRCM_BAND_ALL); |
5089 | err = brcmf_fil_cmd_data_set(ndev, BRCMF_C_SET_ROAM_DELTA, | 5103 | err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA, |
5090 | (void *)roam_delta, sizeof(roam_delta)); | 5104 | (void *)roam_delta, sizeof(roam_delta)); |
5091 | if (err) { | 5105 | if (err) { |
5092 | WL_ERR("WLC_SET_ROAM_DELTA error (%d)\n", err); | 5106 | WL_ERR("WLC_SET_ROAM_DELTA error (%d)\n", err); |
@@ -5101,9 +5115,10 @@ static s32 | |||
5101 | brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time, | 5115 | brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time, |
5102 | s32 scan_unassoc_time, s32 scan_passive_time) | 5116 | s32 scan_unassoc_time, s32 scan_passive_time) |
5103 | { | 5117 | { |
5118 | struct brcmf_if *ifp = netdev_priv(ndev); | ||
5104 | s32 err = 0; | 5119 | s32 err = 0; |
5105 | 5120 | ||
5106 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_SCAN_CHANNEL_TIME, | 5121 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME, |
5107 | scan_assoc_time); | 5122 | scan_assoc_time); |
5108 | if (err) { | 5123 | if (err) { |
5109 | if (err == -EOPNOTSUPP) | 5124 | if (err == -EOPNOTSUPP) |
@@ -5112,7 +5127,7 @@ brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time, | |||
5112 | WL_ERR("Scan assoc time error (%d)\n", err); | 5127 | WL_ERR("Scan assoc time error (%d)\n", err); |
5113 | goto dongle_scantime_out; | 5128 | goto dongle_scantime_out; |
5114 | } | 5129 | } |
5115 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_SCAN_UNASSOC_TIME, | 5130 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME, |
5116 | scan_unassoc_time); | 5131 | scan_unassoc_time); |
5117 | if (err) { | 5132 | if (err) { |
5118 | if (err == -EOPNOTSUPP) | 5133 | if (err == -EOPNOTSUPP) |
@@ -5122,7 +5137,7 @@ brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time, | |||
5122 | goto dongle_scantime_out; | 5137 | goto dongle_scantime_out; |
5123 | } | 5138 | } |
5124 | 5139 | ||
5125 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_SCAN_PASSIVE_TIME, | 5140 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_PASSIVE_TIME, |
5126 | scan_passive_time); | 5141 | scan_passive_time); |
5127 | if (err) { | 5142 | if (err) { |
5128 | if (err == -EOPNOTSUPP) | 5143 | if (err == -EOPNOTSUPP) |
@@ -5138,12 +5153,13 @@ dongle_scantime_out: | |||
5138 | 5153 | ||
5139 | static s32 wl_update_wiphybands(struct brcmf_cfg80211_info *cfg) | 5154 | static s32 wl_update_wiphybands(struct brcmf_cfg80211_info *cfg) |
5140 | { | 5155 | { |
5156 | struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); | ||
5141 | struct wiphy *wiphy; | 5157 | struct wiphy *wiphy; |
5142 | s32 phy_list; | 5158 | s32 phy_list; |
5143 | s8 phy; | 5159 | s8 phy; |
5144 | s32 err = 0; | 5160 | s32 err = 0; |
5145 | 5161 | ||
5146 | err = brcmf_fil_cmd_data_get(cfg_to_ndev(cfg), BRCM_GET_PHYLIST, | 5162 | err = brcmf_fil_cmd_data_get(ifp, BRCM_GET_PHYLIST, |
5147 | &phy_list, sizeof(phy_list)); | 5163 | &phy_list, sizeof(phy_list)); |
5148 | if (err) { | 5164 | if (err) { |
5149 | WL_ERR("error (%d)\n", err); | 5165 | WL_ERR("error (%d)\n", err); |
@@ -5186,7 +5202,8 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) | |||
5186 | goto default_conf_out; | 5202 | goto default_conf_out; |
5187 | 5203 | ||
5188 | power_mode = cfg->pwr_save ? PM_FAST : PM_OFF; | 5204 | power_mode = cfg->pwr_save ? PM_FAST : PM_OFF; |
5189 | err = brcmf_fil_cmd_int_set(ndev, BRCMF_C_SET_PM, power_mode); | 5205 | err = brcmf_fil_cmd_int_set(netdev_priv(ndev), BRCMF_C_SET_PM, |
5206 | power_mode); | ||
5190 | if (err) | 5207 | if (err) |
5191 | goto default_conf_out; | 5208 | goto default_conf_out; |
5192 | WL_INFO("power save set to %s\n", | 5209 | WL_INFO("power save set to %s\n", |