1 From 16e646768396339b3d354985b99bcd3f1f195a7d Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Fri, 15 Feb 2019 15:45:54 +0100
4 Subject: [PATCH] brcmfmac: rework bphy_err() to take struct brcmf_pub argument
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 This macro will be used in more places not just the cfg80211.c. It makes
10 sense to pass some common struct to it as "struct wiphy" is mostly
11 referenced in cfg80211 code only.
13 A very common one (used above the bus abstraction layer) is struct
14 brcmf_pub. Many functions already keep reference to it which will make
15 using bphy_err() simpler. It should also allow extending that macro's
16 logic if it's ever needed.
18 This improves code recently added in the commit 3ef005b82e2a ("brcmfmac:
19 add bphy_err() and use it in the cfg80211.c").
21 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
22 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
24 .../broadcom/brcm80211/brcmfmac/cfg80211.c | 510 ++++++++++--------
25 .../broadcom/brcm80211/brcmfmac/debug.h | 4 +-
26 2 files changed, 281 insertions(+), 233 deletions(-)
28 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
29 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
30 @@ -457,7 +457,7 @@ static void convert_key_from_CPU(struct
32 send_key_to_dongle(struct brcmf_if *ifp, struct brcmf_wsec_key *key)
34 - struct wiphy *wiphy = ifp->drvr->wiphy;
35 + struct brcmf_pub *drvr = ifp->drvr;
37 struct brcmf_wsec_key_le key_le;
39 @@ -469,7 +469,7 @@ send_key_to_dongle(struct brcmf_if *ifp,
43 - bphy_err(wiphy, "wsec_key error (%d)\n", err);
44 + bphy_err(drvr, "wsec_key error (%d)\n", err);
48 @@ -509,7 +509,7 @@ static int brcmf_get_first_free_bsscfgid
50 static int brcmf_cfg80211_request_ap_if(struct brcmf_if *ifp)
52 - struct wiphy *wiphy = ifp->drvr->wiphy;
53 + struct brcmf_pub *drvr = ifp->drvr;
54 struct brcmf_mbss_ssid_le mbss_ssid_le;
57 @@ -526,7 +526,7 @@ static int brcmf_cfg80211_request_ap_if(
58 err = brcmf_fil_bsscfg_data_set(ifp, "bsscfg:ssid", &mbss_ssid_le,
59 sizeof(mbss_ssid_le));
61 - bphy_err(wiphy, "setting ssid failed %d\n", err);
62 + bphy_err(drvr, "setting ssid failed %d\n", err);
66 @@ -544,6 +544,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
68 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
69 struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
70 + struct brcmf_pub *drvr = cfg->pub;
71 struct brcmf_cfg80211_vif *vif;
74 @@ -569,7 +570,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
75 BRCMF_VIF_EVENT_TIMEOUT);
76 brcmf_cfg80211_arm_vif_event(cfg, NULL);
78 - bphy_err(wiphy, "timeout occurred\n");
79 + bphy_err(drvr, "timeout occurred\n");
83 @@ -577,7 +578,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
84 /* interface created in firmware */
87 - bphy_err(wiphy, "no if pointer provided\n");
88 + bphy_err(drvr, "no if pointer provided\n");
92 @@ -585,7 +586,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
93 strncpy(ifp->ndev->name, name, sizeof(ifp->ndev->name) - 1);
94 err = brcmf_net_attach(ifp, true);
96 - bphy_err(wiphy, "Registering netdevice failed\n");
97 + bphy_err(drvr, "Registering netdevice failed\n");
98 free_netdev(ifp->ndev);
101 @@ -616,13 +617,15 @@ static struct wireless_dev *brcmf_cfg802
102 enum nl80211_iftype type,
103 struct vif_params *params)
105 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
106 + struct brcmf_pub *drvr = cfg->pub;
107 struct wireless_dev *wdev;
110 brcmf_dbg(TRACE, "enter: %s type %d\n", name, type);
111 err = brcmf_vif_add_validate(wiphy_to_cfg(wiphy), type);
113 - bphy_err(wiphy, "iface validation failed: err=%d\n", err);
114 + bphy_err(drvr, "iface validation failed: err=%d\n", err);
118 @@ -647,7 +650,7 @@ static struct wireless_dev *brcmf_cfg802
122 - bphy_err(wiphy, "add iface %s type %d failed: err=%d\n", name,
123 + bphy_err(drvr, "add iface %s type %d failed: err=%d\n", name,
124 type, (int)PTR_ERR(wdev));
126 brcmf_cfg80211_update_proto_addr_mode(wdev);
127 @@ -663,13 +666,13 @@ static void brcmf_scan_config_mpc(struct
129 void brcmf_set_mpc(struct brcmf_if *ifp, int mpc)
131 - struct wiphy *wiphy = ifp->drvr->wiphy;
132 + struct brcmf_pub *drvr = ifp->drvr;
135 if (check_vif_up(ifp->vif)) {
136 err = brcmf_fil_iovar_int_set(ifp, "mpc", mpc);
138 - bphy_err(wiphy, "fail to set mpc\n");
139 + bphy_err(drvr, "fail to set mpc\n");
142 brcmf_dbg(INFO, "MPC : %d\n", mpc);
143 @@ -680,7 +683,7 @@ s32 brcmf_notify_escan_complete(struct b
144 struct brcmf_if *ifp, bool aborted,
147 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
148 + struct brcmf_pub *drvr = cfg->pub;
149 struct brcmf_scan_params_le params_le;
150 struct cfg80211_scan_request *scan_request;
152 @@ -715,7 +718,7 @@ s32 brcmf_notify_escan_complete(struct b
153 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN,
154 ¶ms_le, sizeof(params_le));
156 - bphy_err(wiphy, "Scan abort failed\n");
157 + bphy_err(drvr, "Scan abort failed\n");
160 brcmf_scan_config_mpc(ifp, 1);
161 @@ -760,6 +763,7 @@ static int brcmf_cfg80211_del_ap_iface(s
162 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
163 struct net_device *ndev = wdev->netdev;
164 struct brcmf_if *ifp = netdev_priv(ndev);
165 + struct brcmf_pub *drvr = cfg->pub;
169 @@ -767,7 +771,7 @@ static int brcmf_cfg80211_del_ap_iface(s
171 err = brcmf_fil_bsscfg_data_set(ifp, "interface_remove", NULL, 0);
173 - bphy_err(wiphy, "interface_remove failed %d\n", err);
174 + bphy_err(drvr, "interface_remove failed %d\n", err);
178 @@ -775,7 +779,7 @@ static int brcmf_cfg80211_del_ap_iface(s
179 ret = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_DEL,
180 BRCMF_VIF_EVENT_TIMEOUT);
182 - bphy_err(wiphy, "timeout occurred\n");
183 + bphy_err(drvr, "timeout occurred\n");
187 @@ -838,6 +842,7 @@ brcmf_cfg80211_change_iface(struct wiphy
188 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
189 struct brcmf_if *ifp = netdev_priv(ndev);
190 struct brcmf_cfg80211_vif *vif = ifp->vif;
191 + struct brcmf_pub *drvr = cfg->pub;
195 @@ -877,13 +882,13 @@ brcmf_cfg80211_change_iface(struct wiphy
197 err = brcmf_vif_change_validate(wiphy_to_cfg(wiphy), vif, type);
199 - bphy_err(wiphy, "iface validation failed: err=%d\n", err);
200 + bphy_err(drvr, "iface validation failed: err=%d\n", err);
204 case NL80211_IFTYPE_MONITOR:
205 case NL80211_IFTYPE_WDS:
206 - bphy_err(wiphy, "type (%d) : currently we do not support this type\n",
207 + bphy_err(drvr, "type (%d) : currently we do not support this type\n",
210 case NL80211_IFTYPE_ADHOC:
211 @@ -912,7 +917,7 @@ brcmf_cfg80211_change_iface(struct wiphy
213 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, infra);
215 - bphy_err(wiphy, "WLC_SET_INFRA error (%d)\n", err);
216 + bphy_err(drvr, "WLC_SET_INFRA error (%d)\n", err);
220 @@ -1003,7 +1008,7 @@ static s32
221 brcmf_run_escan(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
222 struct cfg80211_scan_request *request)
224 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
225 + struct brcmf_pub *drvr = cfg->pub;
226 s32 params_size = BRCMF_SCAN_PARAMS_FIXED_SIZE +
227 offsetof(struct brcmf_escan_params_le, params_le);
228 struct brcmf_escan_params_le *params;
229 @@ -1035,7 +1040,7 @@ brcmf_run_escan(struct brcmf_cfg80211_in
231 brcmf_dbg(INFO, "system busy : escan canceled\n");
233 - bphy_err(wiphy, "error (%d)\n", err);
234 + bphy_err(drvr, "error (%d)\n", err);
238 @@ -1072,6 +1077,7 @@ static s32
239 brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
241 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
242 + struct brcmf_pub *drvr = cfg->pub;
243 struct brcmf_cfg80211_vif *vif;
246 @@ -1081,22 +1087,22 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
249 if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
250 - bphy_err(wiphy, "Scanning already: status (%lu)\n",
251 + bphy_err(drvr, "Scanning already: status (%lu)\n",
255 if (test_bit(BRCMF_SCAN_STATUS_ABORT, &cfg->scan_status)) {
256 - bphy_err(wiphy, "Scanning being aborted: status (%lu)\n",
257 + bphy_err(drvr, "Scanning being aborted: status (%lu)\n",
261 if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
262 - bphy_err(wiphy, "Scanning suppressed: status (%lu)\n",
263 + bphy_err(drvr, "Scanning suppressed: status (%lu)\n",
267 if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state)) {
268 - bphy_err(wiphy, "Connecting: status (%lu)\n", vif->sme_state);
269 + bphy_err(drvr, "Connecting: status (%lu)\n", vif->sme_state);
273 @@ -1130,7 +1136,7 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
277 - bphy_err(wiphy, "scan error (%d)\n", err);
278 + bphy_err(drvr, "scan error (%d)\n", err);
279 clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
280 cfg->scan_request = NULL;
282 @@ -1139,12 +1145,12 @@ scan_out:
283 static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
285 struct brcmf_if *ifp = netdev_priv(ndev);
286 - struct wiphy *wiphy = ifp->drvr->wiphy;
287 + struct brcmf_pub *drvr = ifp->drvr;
290 err = brcmf_fil_iovar_int_set(ifp, "rtsthresh", rts_threshold);
292 - bphy_err(wiphy, "Error (%d)\n", err);
293 + bphy_err(drvr, "Error (%d)\n", err);
297 @@ -1152,13 +1158,13 @@ static s32 brcmf_set_rts(struct net_devi
298 static s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold)
300 struct brcmf_if *ifp = netdev_priv(ndev);
301 - struct wiphy *wiphy = ifp->drvr->wiphy;
302 + struct brcmf_pub *drvr = ifp->drvr;
305 err = brcmf_fil_iovar_int_set(ifp, "fragthresh",
308 - bphy_err(wiphy, "Error (%d)\n", err);
309 + bphy_err(drvr, "Error (%d)\n", err);
313 @@ -1166,13 +1172,13 @@ static s32 brcmf_set_frag(struct net_dev
314 static s32 brcmf_set_retry(struct net_device *ndev, u32 retry, bool l)
316 struct brcmf_if *ifp = netdev_priv(ndev);
317 - struct wiphy *wiphy = ifp->drvr->wiphy;
318 + struct brcmf_pub *drvr = ifp->drvr;
320 u32 cmd = (l ? BRCMF_C_SET_LRL : BRCMF_C_SET_SRL);
322 err = brcmf_fil_cmd_int_set(ifp, cmd, retry);
324 - bphy_err(wiphy, "cmd (%d) , error (%d)\n", cmd, err);
325 + bphy_err(drvr, "cmd (%d) , error (%d)\n", cmd, err);
329 @@ -1248,7 +1254,7 @@ static u16 brcmf_map_fw_linkdown_reason(
331 static int brcmf_set_pmk(struct brcmf_if *ifp, const u8 *pmk_data, u16 pmk_len)
333 - struct wiphy *wiphy = ifp->drvr->wiphy;
334 + struct brcmf_pub *drvr = ifp->drvr;
335 struct brcmf_wsec_pmk_le pmk;
338 @@ -1262,7 +1268,7 @@ static int brcmf_set_pmk(struct brcmf_if
339 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_WSEC_PMK,
342 - bphy_err(wiphy, "failed to change PSK in firmware (len=%u)\n",
343 + bphy_err(drvr, "failed to change PSK in firmware (len=%u)\n",
347 @@ -1271,7 +1277,7 @@ static int brcmf_set_pmk(struct brcmf_if
348 static void brcmf_link_down(struct brcmf_cfg80211_vif *vif, u16 reason)
350 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
351 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
352 + struct brcmf_pub *drvr = cfg->pub;
355 brcmf_dbg(TRACE, "Enter\n");
356 @@ -1281,7 +1287,7 @@ static void brcmf_link_down(struct brcmf
357 err = brcmf_fil_cmd_data_set(vif->ifp,
358 BRCMF_C_DISASSOC, NULL, 0);
360 - bphy_err(wiphy, "WLC_DISASSOC failed (%d)\n", err);
361 + bphy_err(drvr, "WLC_DISASSOC failed (%d)\n", err);
363 if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
364 (vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
365 @@ -1305,6 +1311,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
366 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
367 struct brcmf_if *ifp = netdev_priv(ndev);
368 struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
369 + struct brcmf_pub *drvr = cfg->pub;
370 struct brcmf_join_params join_params;
371 size_t join_params_size = 0;
373 @@ -1369,7 +1376,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
375 err = brcmf_fil_iovar_int_set(ifp, "wsec", wsec);
377 - bphy_err(wiphy, "wsec failed (%d)\n", err);
378 + bphy_err(drvr, "wsec failed (%d)\n", err);
382 @@ -1381,7 +1388,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
384 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, bcnprd);
386 - bphy_err(wiphy, "WLC_SET_BCNPRD failed (%d)\n", err);
387 + bphy_err(drvr, "WLC_SET_BCNPRD failed (%d)\n", err);
391 @@ -1426,7 +1433,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
392 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_CHANNEL,
395 - bphy_err(wiphy, "WLC_SET_CHANNEL failed (%d)\n", err);
396 + bphy_err(drvr, "WLC_SET_CHANNEL failed (%d)\n", err);
400 @@ -1438,7 +1445,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
401 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
402 &join_params, join_params_size);
404 - bphy_err(wiphy, "WLC_SET_SSID failed (%d)\n", err);
405 + bphy_err(drvr, "WLC_SET_SSID failed (%d)\n", err);
409 @@ -1475,8 +1482,8 @@ static s32 brcmf_set_wpa_version(struct
410 struct cfg80211_connect_params *sme)
412 struct brcmf_if *ifp = netdev_priv(ndev);
413 - struct wiphy *wiphy = ifp->drvr->wiphy;
414 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
415 + struct brcmf_pub *drvr = ifp->drvr;
416 struct brcmf_cfg80211_security *sec;
419 @@ -1490,7 +1497,7 @@ static s32 brcmf_set_wpa_version(struct
420 brcmf_dbg(CONN, "setting wpa_auth to 0x%0x\n", val);
421 err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", val);
423 - bphy_err(wiphy, "set wpa_auth failed (%d)\n", err);
424 + bphy_err(drvr, "set wpa_auth failed (%d)\n", err);
428 @@ -1502,8 +1509,8 @@ static s32 brcmf_set_auth_type(struct ne
429 struct cfg80211_connect_params *sme)
431 struct brcmf_if *ifp = netdev_priv(ndev);
432 - struct wiphy *wiphy = ifp->drvr->wiphy;
433 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
434 + struct brcmf_pub *drvr = ifp->drvr;
435 struct brcmf_cfg80211_security *sec;
438 @@ -1525,7 +1532,7 @@ static s32 brcmf_set_auth_type(struct ne
440 err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
442 - bphy_err(wiphy, "set auth failed (%d)\n", err);
443 + bphy_err(drvr, "set auth failed (%d)\n", err);
447 @@ -1538,8 +1545,8 @@ brcmf_set_wsec_mode(struct net_device *n
448 struct cfg80211_connect_params *sme)
450 struct brcmf_if *ifp = netdev_priv(ndev);
451 - struct wiphy *wiphy = ifp->drvr->wiphy;
452 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
453 + struct brcmf_pub *drvr = ifp->drvr;
454 struct brcmf_cfg80211_security *sec;
457 @@ -1562,7 +1569,7 @@ brcmf_set_wsec_mode(struct net_device *n
461 - bphy_err(wiphy, "invalid cipher pairwise (%d)\n",
462 + bphy_err(drvr, "invalid cipher pairwise (%d)\n",
463 sme->crypto.ciphers_pairwise[0]);
466 @@ -1583,7 +1590,7 @@ brcmf_set_wsec_mode(struct net_device *n
470 - bphy_err(wiphy, "invalid cipher group (%d)\n",
471 + bphy_err(drvr, "invalid cipher group (%d)\n",
472 sme->crypto.cipher_group);
475 @@ -1599,7 +1606,7 @@ brcmf_set_wsec_mode(struct net_device *n
477 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
479 - bphy_err(wiphy, "error (%d)\n", err);
480 + bphy_err(drvr, "error (%d)\n", err);
484 @@ -1614,8 +1621,8 @@ static s32
485 brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
487 struct brcmf_if *ifp = netdev_priv(ndev);
488 - struct wiphy *wiphy = ifp->drvr->wiphy;
489 struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
490 + struct brcmf_pub *drvr = ifp->drvr;
493 const struct brcmf_tlv *rsn_ie;
494 @@ -1633,7 +1640,7 @@ brcmf_set_key_mgmt(struct net_device *nd
496 err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wpa_auth", &val);
498 - bphy_err(wiphy, "could not get wpa_auth (%d)\n", err);
499 + bphy_err(drvr, "could not get wpa_auth (%d)\n", err);
502 if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
503 @@ -1647,7 +1654,7 @@ brcmf_set_key_mgmt(struct net_device *nd
507 - bphy_err(wiphy, "invalid cipher group (%d)\n",
508 + bphy_err(drvr, "invalid cipher group (%d)\n",
509 sme->crypto.cipher_group);
512 @@ -1670,7 +1677,7 @@ brcmf_set_key_mgmt(struct net_device *nd
516 - bphy_err(wiphy, "invalid cipher group (%d)\n",
517 + bphy_err(drvr, "invalid cipher group (%d)\n",
518 sme->crypto.cipher_group);
521 @@ -1717,7 +1724,7 @@ skip_mfp_config:
522 brcmf_dbg(CONN, "setting wpa_auth to %d\n", val);
523 err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val);
525 - bphy_err(wiphy, "could not set wpa_auth (%d)\n", err);
526 + bphy_err(drvr, "could not set wpa_auth (%d)\n", err);
530 @@ -1729,7 +1736,7 @@ brcmf_set_sharedkey(struct net_device *n
531 struct cfg80211_connect_params *sme)
533 struct brcmf_if *ifp = netdev_priv(ndev);
534 - struct wiphy *wiphy = ifp->drvr->wiphy;
535 + struct brcmf_pub *drvr = ifp->drvr;
536 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
537 struct brcmf_cfg80211_security *sec;
538 struct brcmf_wsec_key key;
539 @@ -1756,7 +1763,7 @@ brcmf_set_sharedkey(struct net_device *n
540 key.len = (u32) sme->key_len;
541 key.index = (u32) sme->key_idx;
542 if (key.len > sizeof(key.data)) {
543 - bphy_err(wiphy, "Too long key length (%u)\n", key.len);
544 + bphy_err(drvr, "Too long key length (%u)\n", key.len);
547 memcpy(key.data, sme->key, key.len);
548 @@ -1769,7 +1776,7 @@ brcmf_set_sharedkey(struct net_device *n
549 key.algo = CRYPTO_ALGO_WEP128;
552 - bphy_err(wiphy, "Invalid algorithm (%d)\n",
553 + bphy_err(drvr, "Invalid algorithm (%d)\n",
554 sme->crypto.ciphers_pairwise[0]);
557 @@ -1786,7 +1793,7 @@ brcmf_set_sharedkey(struct net_device *n
558 val = WL_AUTH_SHARED_KEY; /* shared key */
559 err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
561 - bphy_err(wiphy, "set auth failed (%d)\n", err);
562 + bphy_err(drvr, "set auth failed (%d)\n", err);
566 @@ -1806,7 +1813,7 @@ enum nl80211_auth_type brcmf_war_auth_ty
567 static void brcmf_set_join_pref(struct brcmf_if *ifp,
568 struct cfg80211_bss_selection *bss_select)
570 - struct wiphy *wiphy = ifp->drvr->wiphy;
571 + struct brcmf_pub *drvr = ifp->drvr;
572 struct brcmf_join_pref_params join_pref_params[2];
573 enum nl80211_band band;
575 @@ -1845,7 +1852,7 @@ static void brcmf_set_join_pref(struct b
576 err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
577 sizeof(join_pref_params));
579 - bphy_err(wiphy, "Set join_pref error (%d)\n", err);
580 + bphy_err(drvr, "Set join_pref error (%d)\n", err);
584 @@ -1856,6 +1863,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
585 struct brcmf_if *ifp = netdev_priv(ndev);
586 struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
587 struct ieee80211_channel *chan = sme->channel;
588 + struct brcmf_pub *drvr = ifp->drvr;
589 struct brcmf_join_params join_params;
590 size_t join_params_size;
591 const struct brcmf_tlv *rsn_ie;
592 @@ -1872,7 +1880,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
596 - bphy_err(wiphy, "Invalid ssid\n");
597 + bphy_err(drvr, "Invalid ssid\n");
601 @@ -1901,7 +1909,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
602 err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
603 sme->ie, sme->ie_len);
605 - bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
606 + bphy_err(drvr, "Set Assoc REQ IE Failed\n");
608 brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
610 @@ -1922,32 +1930,32 @@ brcmf_cfg80211_connect(struct wiphy *wip
612 err = brcmf_set_wpa_version(ndev, sme);
614 - bphy_err(wiphy, "wl_set_wpa_version failed (%d)\n", err);
615 + bphy_err(drvr, "wl_set_wpa_version failed (%d)\n", err);
619 sme->auth_type = brcmf_war_auth_type(ifp, sme->auth_type);
620 err = brcmf_set_auth_type(ndev, sme);
622 - bphy_err(wiphy, "wl_set_auth_type failed (%d)\n", err);
623 + bphy_err(drvr, "wl_set_auth_type failed (%d)\n", err);
627 err = brcmf_set_wsec_mode(ndev, sme);
629 - bphy_err(wiphy, "wl_set_set_cipher failed (%d)\n", err);
630 + bphy_err(drvr, "wl_set_set_cipher failed (%d)\n", err);
634 err = brcmf_set_key_mgmt(ndev, sme);
636 - bphy_err(wiphy, "wl_set_key_mgmt failed (%d)\n", err);
637 + bphy_err(drvr, "wl_set_key_mgmt failed (%d)\n", err);
641 err = brcmf_set_sharedkey(ndev, sme);
643 - bphy_err(wiphy, "brcmf_set_sharedkey failed (%d)\n", err);
644 + bphy_err(drvr, "brcmf_set_sharedkey failed (%d)\n", err);
648 @@ -1964,7 +1972,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
649 /* enable firmware supplicant for this interface */
650 err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 1);
652 - bphy_err(wiphy, "failed to enable fw supplicant\n");
653 + bphy_err(drvr, "failed to enable fw supplicant\n");
657 @@ -2059,7 +2067,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
658 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
659 &join_params, join_params_size);
661 - bphy_err(wiphy, "BRCMF_C_SET_SSID failed (%d)\n", err);
662 + bphy_err(drvr, "BRCMF_C_SET_SSID failed (%d)\n", err);
666 @@ -2072,8 +2080,10 @@ static s32
667 brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
670 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
671 struct brcmf_if *ifp = netdev_priv(ndev);
672 struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
673 + struct brcmf_pub *drvr = cfg->pub;
674 struct brcmf_scb_val_le scbval;
677 @@ -2090,7 +2100,7 @@ brcmf_cfg80211_disconnect(struct wiphy *
678 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_DISASSOC,
679 &scbval, sizeof(scbval));
681 - bphy_err(wiphy, "error (%d)\n", err);
682 + bphy_err(drvr, "error (%d)\n", err);
684 brcmf_dbg(TRACE, "Exit\n");
686 @@ -2103,6 +2113,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
687 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
688 struct net_device *ndev = cfg_to_ndev(cfg);
689 struct brcmf_if *ifp = netdev_priv(ndev);
690 + struct brcmf_pub *drvr = cfg->pub;
694 @@ -2117,7 +2128,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
695 case NL80211_TX_POWER_LIMITED:
696 case NL80211_TX_POWER_FIXED:
698 - bphy_err(wiphy, "TX_POWER_FIXED - dbm is negative\n");
699 + bphy_err(drvr, "TX_POWER_FIXED - dbm is negative\n");
703 @@ -2127,7 +2138,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
704 qdbm |= WL_TXPWR_OVERRIDE;
707 - bphy_err(wiphy, "Unsupported type %d\n", type);
708 + bphy_err(drvr, "Unsupported type %d\n", type);
712 @@ -2135,11 +2146,11 @@ brcmf_cfg80211_set_tx_power(struct wiphy
713 disable = WL_RADIO_SW_DISABLE << 16;
714 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_RADIO, disable);
716 - bphy_err(wiphy, "WLC_SET_RADIO error (%d)\n", err);
717 + bphy_err(drvr, "WLC_SET_RADIO error (%d)\n", err);
719 err = brcmf_fil_iovar_int_set(ifp, "qtxpower", qdbm);
721 - bphy_err(wiphy, "qtxpower error (%d)\n", err);
722 + bphy_err(drvr, "qtxpower error (%d)\n", err);
725 brcmf_dbg(TRACE, "Exit %d (qdbm)\n", qdbm & ~WL_TXPWR_OVERRIDE);
726 @@ -2150,7 +2161,9 @@ static s32
727 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
730 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
731 struct brcmf_cfg80211_vif *vif = wdev_to_vif(wdev);
732 + struct brcmf_pub *drvr = cfg->pub;
736 @@ -2160,7 +2173,7 @@ brcmf_cfg80211_get_tx_power(struct wiphy
738 err = brcmf_fil_iovar_int_get(vif->ifp, "qtxpower", &qdbm);
740 - bphy_err(wiphy, "error (%d)\n", err);
741 + bphy_err(drvr, "error (%d)\n", err);
744 *dbm = (qdbm & ~WL_TXPWR_OVERRIDE) / 4;
745 @@ -2175,6 +2188,7 @@ brcmf_cfg80211_config_default_key(struct
746 u8 key_idx, bool unicast, bool multicast)
748 struct brcmf_if *ifp = netdev_priv(ndev);
749 + struct brcmf_pub *drvr = ifp->drvr;
753 @@ -2186,7 +2200,7 @@ brcmf_cfg80211_config_default_key(struct
755 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
757 - bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
758 + bphy_err(drvr, "WLC_GET_WSEC error (%d)\n", err);
762 @@ -2196,7 +2210,7 @@ brcmf_cfg80211_config_default_key(struct
763 err = brcmf_fil_cmd_int_set(ifp,
764 BRCMF_C_SET_KEY_PRIMARY, index);
766 - bphy_err(wiphy, "error (%d)\n", err);
767 + bphy_err(drvr, "error (%d)\n", err);
770 brcmf_dbg(TRACE, "Exit\n");
771 @@ -2245,7 +2259,9 @@ brcmf_cfg80211_add_key(struct wiphy *wip
772 u8 key_idx, bool pairwise, const u8 *mac_addr,
773 struct key_params *params)
775 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
776 struct brcmf_if *ifp = netdev_priv(ndev);
777 + struct brcmf_pub *drvr = cfg->pub;
778 struct brcmf_wsec_key *key;
781 @@ -2260,7 +2276,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
783 if (key_idx >= BRCMF_MAX_DEFAULT_KEYS) {
784 /* we ignore this key index in this case */
785 - bphy_err(wiphy, "invalid key index (%d)\n", key_idx);
786 + bphy_err(drvr, "invalid key index (%d)\n", key_idx);
790 @@ -2269,7 +2285,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
793 if (params->key_len > sizeof(key->data)) {
794 - bphy_err(wiphy, "Too long key length (%u)\n", params->key_len);
795 + bphy_err(drvr, "Too long key length (%u)\n", params->key_len);
799 @@ -2323,7 +2339,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
800 brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_CCMP\n");
803 - bphy_err(wiphy, "Invalid cipher (0x%x)\n", params->cipher);
804 + bphy_err(drvr, "Invalid cipher (0x%x)\n", params->cipher);
808 @@ -2334,13 +2350,13 @@ brcmf_cfg80211_add_key(struct wiphy *wip
810 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
812 - bphy_err(wiphy, "get wsec error (%d)\n", err);
813 + bphy_err(drvr, "get wsec error (%d)\n", err);
817 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
819 - bphy_err(wiphy, "set wsec error (%d)\n", err);
820 + bphy_err(drvr, "set wsec error (%d)\n", err);
824 @@ -2355,9 +2371,11 @@ brcmf_cfg80211_get_key(struct wiphy *wip
825 void (*callback)(void *cookie,
826 struct key_params *params))
828 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
829 struct key_params params;
830 struct brcmf_if *ifp = netdev_priv(ndev);
831 struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
832 + struct brcmf_pub *drvr = cfg->pub;
833 struct brcmf_cfg80211_security *sec;
836 @@ -2371,7 +2389,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
838 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
840 - bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
841 + bphy_err(drvr, "WLC_GET_WSEC error (%d)\n", err);
842 /* Ignore this error, may happen during DISASSOC */
845 @@ -2392,7 +2410,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
846 params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
847 brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n");
849 - bphy_err(wiphy, "Invalid algo (0x%x)\n", wsec);
850 + bphy_err(drvr, "Invalid algo (0x%x)\n", wsec);
854 @@ -2422,7 +2440,7 @@ brcmf_cfg80211_config_default_mgmt_key(s
856 brcmf_cfg80211_reconfigure_wep(struct brcmf_if *ifp)
858 - struct wiphy *wiphy = ifp->drvr->wiphy;
859 + struct brcmf_pub *drvr = ifp->drvr;
862 struct brcmf_wsec_key *key;
863 @@ -2439,18 +2457,18 @@ brcmf_cfg80211_reconfigure_wep(struct br
865 err = send_key_to_dongle(ifp, key);
867 - bphy_err(wiphy, "Setting WEP key failed (%d)\n", err);
868 + bphy_err(drvr, "Setting WEP key failed (%d)\n", err);
871 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
873 - bphy_err(wiphy, "get wsec error (%d)\n", err);
874 + bphy_err(drvr, "get wsec error (%d)\n", err);
878 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
880 - bphy_err(wiphy, "set wsec error (%d)\n", err);
881 + bphy_err(drvr, "set wsec error (%d)\n", err);
884 static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si)
885 @@ -2476,7 +2494,7 @@ static void brcmf_convert_sta_flags(u32
887 static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si)
889 - struct wiphy *wiphy = ifp->drvr->wiphy;
890 + struct brcmf_pub *drvr = ifp->drvr;
893 struct brcmf_bss_info_le bss_le;
894 @@ -2492,7 +2510,7 @@ static void brcmf_fill_bss_param(struct
895 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf,
898 - bphy_err(wiphy, "Failed to get bss info (%d)\n", err);
899 + bphy_err(drvr, "Failed to get bss info (%d)\n", err);
902 si->filled |= BIT_ULL(NL80211_STA_INFO_BSS_PARAM);
903 @@ -2514,7 +2532,7 @@ static s32
904 brcmf_cfg80211_get_station_ibss(struct brcmf_if *ifp,
905 struct station_info *sinfo)
907 - struct wiphy *wiphy = ifp->drvr->wiphy;
908 + struct brcmf_pub *drvr = ifp->drvr;
909 struct brcmf_scb_val_le scbval;
910 struct brcmf_pktcnt_le pktcnt;
912 @@ -2524,7 +2542,7 @@ brcmf_cfg80211_get_station_ibss(struct b
913 /* Get the current tx rate */
914 err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate);
916 - bphy_err(wiphy, "BRCMF_C_GET_RATE error (%d)\n", err);
917 + bphy_err(drvr, "BRCMF_C_GET_RATE error (%d)\n", err);
920 sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
921 @@ -2534,7 +2552,7 @@ brcmf_cfg80211_get_station_ibss(struct b
922 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, &scbval,
925 - bphy_err(wiphy, "BRCMF_C_GET_RSSI error (%d)\n", err);
926 + bphy_err(drvr, "BRCMF_C_GET_RSSI error (%d)\n", err);
929 rssi = le32_to_cpu(scbval.val);
930 @@ -2544,7 +2562,7 @@ brcmf_cfg80211_get_station_ibss(struct b
931 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_GET_PKTCNTS, &pktcnt,
934 - bphy_err(wiphy, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
935 + bphy_err(drvr, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
938 sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_PACKETS) |
939 @@ -2563,7 +2581,9 @@ static s32
940 brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
941 const u8 *mac, struct station_info *sinfo)
943 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
944 struct brcmf_if *ifp = netdev_priv(ndev);
945 + struct brcmf_pub *drvr = cfg->pub;
946 struct brcmf_scb_val_le scb_val;
948 struct brcmf_sta_info_le sta_info_le;
949 @@ -2592,7 +2612,7 @@ brcmf_cfg80211_get_station(struct wiphy
951 sizeof(sta_info_le));
953 - bphy_err(wiphy, "GET STA INFO failed, %d\n", err);
954 + bphy_err(drvr, "GET STA INFO failed, %d\n", err);
958 @@ -2661,7 +2681,7 @@ brcmf_cfg80211_get_station(struct wiphy
959 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
960 &scb_val, sizeof(scb_val));
962 - bphy_err(wiphy, "Could not get rssi (%d)\n",
963 + bphy_err(drvr, "Could not get rssi (%d)\n",
967 @@ -2683,6 +2703,7 @@ brcmf_cfg80211_dump_station(struct wiphy
969 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
970 struct brcmf_if *ifp = netdev_priv(ndev);
971 + struct brcmf_pub *drvr = cfg->pub;
974 brcmf_dbg(TRACE, "Enter, idx %d\n", idx);
975 @@ -2693,7 +2714,7 @@ brcmf_cfg80211_dump_station(struct wiphy
977 sizeof(cfg->assoclist));
979 - bphy_err(wiphy, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
980 + bphy_err(drvr, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
982 cfg->assoclist.count = 0;
984 @@ -2714,6 +2735,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip
986 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
987 struct brcmf_if *ifp = netdev_priv(ndev);
988 + struct brcmf_pub *drvr = cfg->pub;
990 brcmf_dbg(TRACE, "Enter\n");
992 @@ -2742,9 +2764,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip
993 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm);
996 - bphy_err(wiphy, "net_device is not ready yet\n");
997 + bphy_err(drvr, "net_device is not ready yet\n");
999 - bphy_err(wiphy, "error (%d)\n", err);
1000 + bphy_err(drvr, "error (%d)\n", err);
1003 brcmf_dbg(TRACE, "Exit\n");
1004 @@ -2755,6 +2777,7 @@ static s32 brcmf_inform_single_bss(struc
1005 struct brcmf_bss_info_le *bi)
1007 struct wiphy *wiphy = cfg_to_wiphy(cfg);
1008 + struct brcmf_pub *drvr = cfg->pub;
1009 struct cfg80211_bss *bss;
1010 enum nl80211_band band;
1011 struct brcmu_chan ch;
1012 @@ -2767,7 +2790,7 @@ static s32 brcmf_inform_single_bss(struc
1013 struct cfg80211_inform_bss bss_data = {};
1015 if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) {
1016 - bphy_err(wiphy, "Bss info is larger than buffer. Discarding\n");
1017 + bphy_err(drvr, "Bss info is larger than buffer. Discarding\n");
1021 @@ -2826,7 +2849,7 @@ next_bss_le(struct brcmf_scan_results *l
1023 static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg)
1025 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1026 + struct brcmf_pub *drvr = cfg->pub;
1027 struct brcmf_scan_results *bss_list;
1028 struct brcmf_bss_info_le *bi = NULL; /* must be initialized */
1030 @@ -2835,7 +2858,7 @@ static s32 brcmf_inform_bss(struct brcmf
1031 bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
1032 if (bss_list->count != 0 &&
1033 bss_list->version != BRCMF_BSS_INFO_VERSION) {
1034 - bphy_err(wiphy, "Version %d != WL_BSS_INFO_VERSION\n",
1035 + bphy_err(drvr, "Version %d != WL_BSS_INFO_VERSION\n",
1039 @@ -2853,6 +2876,7 @@ static s32 brcmf_inform_ibss(struct brcm
1040 struct net_device *ndev, const u8 *bssid)
1042 struct wiphy *wiphy = cfg_to_wiphy(cfg);
1043 + struct brcmf_pub *drvr = cfg->pub;
1044 struct ieee80211_channel *notify_channel;
1045 struct brcmf_bss_info_le *bi = NULL;
1046 struct ieee80211_supported_band *band;
1047 @@ -2880,7 +2904,7 @@ static s32 brcmf_inform_ibss(struct brcm
1048 err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO,
1049 buf, WL_BSS_INFO_MAX);
1051 - bphy_err(wiphy, "WLC_GET_BSS_INFO failed: %d\n", err);
1052 + bphy_err(drvr, "WLC_GET_BSS_INFO failed: %d\n", err);
1056 @@ -2934,7 +2958,7 @@ CleanUp:
1057 static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg,
1058 struct brcmf_if *ifp)
1060 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1061 + struct brcmf_pub *drvr = cfg->pub;
1062 struct brcmf_bss_info_le *bi;
1063 const struct brcmf_tlv *tim;
1064 u16 beacon_interval;
1065 @@ -2951,7 +2975,7 @@ static s32 brcmf_update_bss_info(struct
1066 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO,
1067 cfg->extra_buf, WL_EXTRA_BUF_MAX);
1069 - bphy_err(wiphy, "Could not get bss info %d\n", err);
1070 + bphy_err(drvr, "Could not get bss info %d\n", err);
1071 goto update_bss_info_out;
1074 @@ -2976,7 +3000,7 @@ static s32 brcmf_update_bss_info(struct
1076 err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var);
1078 - bphy_err(wiphy, "wl dtim_assoc failed (%d)\n", err);
1079 + bphy_err(drvr, "wl dtim_assoc failed (%d)\n", err);
1080 goto update_bss_info_out;
1082 dtim_period = (u8)var;
1083 @@ -3014,10 +3038,10 @@ static void brcmf_escan_timeout(struct t
1085 struct brcmf_cfg80211_info *cfg =
1086 from_timer(cfg, t, escan_timeout);
1087 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1088 + struct brcmf_pub *drvr = cfg->pub;
1090 if (cfg->int_escan_map || cfg->scan_request) {
1091 - bphy_err(wiphy, "timer expired\n");
1092 + bphy_err(drvr, "timer expired\n");
1093 schedule_work(&cfg->escan_timeout_work);
1096 @@ -3065,8 +3089,8 @@ static s32
1097 brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
1098 const struct brcmf_event_msg *e, void *data)
1100 - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
1101 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1102 + struct brcmf_pub *drvr = ifp->drvr;
1103 + struct brcmf_cfg80211_info *cfg = drvr->config;
1105 struct brcmf_escan_result_le *escan_result_le;
1107 @@ -3083,7 +3107,7 @@ brcmf_cfg80211_escan_handler(struct brcm
1110 if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
1111 - bphy_err(wiphy, "scan not ready, bsscfgidx=%d\n",
1112 + bphy_err(drvr, "scan not ready, bsscfgidx=%d\n",
1116 @@ -3091,24 +3115,24 @@ brcmf_cfg80211_escan_handler(struct brcm
1117 if (status == BRCMF_E_STATUS_PARTIAL) {
1118 brcmf_dbg(SCAN, "ESCAN Partial result\n");
1119 if (e->datalen < sizeof(*escan_result_le)) {
1120 - bphy_err(wiphy, "invalid event data length\n");
1121 + bphy_err(drvr, "invalid event data length\n");
1124 escan_result_le = (struct brcmf_escan_result_le *) data;
1125 if (!escan_result_le) {
1126 - bphy_err(wiphy, "Invalid escan result (NULL pointer)\n");
1127 + bphy_err(drvr, "Invalid escan result (NULL pointer)\n");
1130 escan_buflen = le32_to_cpu(escan_result_le->buflen);
1131 if (escan_buflen > BRCMF_ESCAN_BUF_SIZE ||
1132 escan_buflen > e->datalen ||
1133 escan_buflen < sizeof(*escan_result_le)) {
1134 - bphy_err(wiphy, "Invalid escan buffer length: %d\n",
1135 + bphy_err(drvr, "Invalid escan buffer length: %d\n",
1139 if (le16_to_cpu(escan_result_le->bss_count) != 1) {
1140 - bphy_err(wiphy, "Invalid bss_count %d: ignoring\n",
1141 + bphy_err(drvr, "Invalid bss_count %d: ignoring\n",
1142 escan_result_le->bss_count);
1145 @@ -3124,7 +3148,7 @@ brcmf_cfg80211_escan_handler(struct brcm
1147 bi_length = le32_to_cpu(bss_info_le->length);
1148 if (bi_length != escan_buflen - WL_ESCAN_RESULTS_FIXED_SIZE) {
1149 - bphy_err(wiphy, "Ignoring invalid bss_info length: %d\n",
1150 + bphy_err(drvr, "Ignoring invalid bss_info length: %d\n",
1154 @@ -3133,7 +3157,7 @@ brcmf_cfg80211_escan_handler(struct brcm
1155 BIT(NL80211_IFTYPE_ADHOC))) {
1156 if (le16_to_cpu(bss_info_le->capability) &
1157 WLAN_CAPABILITY_IBSS) {
1158 - bphy_err(wiphy, "Ignoring IBSS result\n");
1159 + bphy_err(drvr, "Ignoring IBSS result\n");
1163 @@ -3141,7 +3165,7 @@ brcmf_cfg80211_escan_handler(struct brcm
1164 list = (struct brcmf_scan_results *)
1165 cfg->escan_info.escan_buf;
1166 if (bi_length > BRCMF_ESCAN_BUF_SIZE - list->buflen) {
1167 - bphy_err(wiphy, "Buffer is too small: ignoring\n");
1168 + bphy_err(drvr, "Buffer is too small: ignoring\n");
1172 @@ -3300,7 +3324,8 @@ static s32
1173 brcmf_notify_sched_scan_results(struct brcmf_if *ifp,
1174 const struct brcmf_event_msg *e, void *data)
1176 - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
1177 + struct brcmf_pub *drvr = ifp->drvr;
1178 + struct brcmf_cfg80211_info *cfg = drvr->config;
1179 struct brcmf_pno_net_info_le *netinfo, *netinfo_start;
1180 struct cfg80211_scan_request *request = NULL;
1181 struct wiphy *wiphy = cfg_to_wiphy(cfg);
1182 @@ -3333,14 +3358,14 @@ brcmf_notify_sched_scan_results(struct b
1183 WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE);
1184 brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count);
1185 if (!result_count) {
1186 - bphy_err(wiphy, "FALSE PNO Event. (pfn_count == 0)\n");
1187 + bphy_err(drvr, "FALSE PNO Event. (pfn_count == 0)\n");
1191 netinfo_start = brcmf_get_netinfo_array(pfn_result);
1192 datalen = e->datalen - ((void *)netinfo_start - (void *)pfn_result);
1193 if (datalen < result_count * sizeof(*netinfo)) {
1194 - bphy_err(wiphy, "insufficient event data\n");
1195 + bphy_err(drvr, "insufficient event data\n");
1199 @@ -3387,14 +3412,15 @@ brcmf_cfg80211_sched_scan_start(struct w
1200 struct net_device *ndev,
1201 struct cfg80211_sched_scan_request *req)
1203 - struct brcmf_if *ifp = netdev_priv(ndev);
1204 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1205 + struct brcmf_if *ifp = netdev_priv(ndev);
1206 + struct brcmf_pub *drvr = cfg->pub;
1208 brcmf_dbg(SCAN, "Enter: n_match_sets=%d n_ssids=%d\n",
1209 req->n_match_sets, req->n_ssids);
1211 if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
1212 - bphy_err(wiphy, "Scanning suppressed: status=%lu\n",
1213 + bphy_err(drvr, "Scanning suppressed: status=%lu\n",
1217 @@ -3473,8 +3499,8 @@ static s32
1218 brcmf_wowl_nd_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e,
1221 - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
1222 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1223 + struct brcmf_pub *drvr = ifp->drvr;
1224 + struct brcmf_cfg80211_info *cfg = drvr->config;
1225 struct brcmf_pno_scanresults_le *pfn_result;
1226 struct brcmf_pno_net_info_le *netinfo;
1228 @@ -3493,7 +3519,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
1231 if (le32_to_cpu(pfn_result->count) < 1) {
1232 - bphy_err(wiphy, "Invalid result count, expected 1 (%d)\n",
1233 + bphy_err(drvr, "Invalid result count, expected 1 (%d)\n",
1234 le32_to_cpu(pfn_result->count));
1237 @@ -3523,6 +3549,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
1238 static void brcmf_report_wowl_wakeind(struct wiphy *wiphy, struct brcmf_if *ifp)
1240 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1241 + struct brcmf_pub *drvr = cfg->pub;
1242 struct brcmf_wowl_wakeind_le wake_ind_le;
1243 struct cfg80211_wowlan_wakeup wakeup_data;
1244 struct cfg80211_wowlan_wakeup *wakeup;
1245 @@ -3533,7 +3560,7 @@ static void brcmf_report_wowl_wakeind(st
1246 err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le,
1247 sizeof(wake_ind_le));
1249 - bphy_err(wiphy, "Get wowl_wakeind failed, err = %d\n", err);
1250 + bphy_err(drvr, "Get wowl_wakeind failed, err = %d\n", err);
1254 @@ -3574,7 +3601,7 @@ static void brcmf_report_wowl_wakeind(st
1255 cfg->wowl.nd_data_completed,
1256 BRCMF_ND_INFO_TIMEOUT);
1258 - bphy_err(wiphy, "No result for wowl net detect\n");
1259 + bphy_err(drvr, "No result for wowl net detect\n");
1261 wakeup_data.net_detect = cfg->wowl.nd_info;
1263 @@ -3763,6 +3790,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
1264 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1265 struct brcmf_if *ifp = netdev_priv(ndev);
1266 struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0];
1267 + struct brcmf_pub *drvr = cfg->pub;
1271 @@ -3782,7 +3810,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
1272 cfg->pmk_list.npmk = cpu_to_le32(npmk);
1275 - bphy_err(wiphy, "Too many PMKSA entries cached %d\n", npmk);
1276 + bphy_err(drvr, "Too many PMKSA entries cached %d\n", npmk);
1280 @@ -3805,6 +3833,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
1281 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1282 struct brcmf_if *ifp = netdev_priv(ndev);
1283 struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0];
1284 + struct brcmf_pub *drvr = cfg->pub;
1288 @@ -3828,7 +3857,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
1289 memset(&pmk[i], 0, sizeof(*pmk));
1290 cfg->pmk_list.npmk = cpu_to_le32(npmk - 1);
1292 - bphy_err(wiphy, "Cache entry not found\n");
1293 + bphy_err(drvr, "Cache entry not found\n");
1297 @@ -3860,20 +3889,20 @@ brcmf_cfg80211_flush_pmksa(struct wiphy
1299 static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
1301 - struct wiphy *wiphy = ifp->drvr->wiphy;
1302 + struct brcmf_pub *drvr = ifp->drvr;
1307 err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0);
1309 - bphy_err(wiphy, "auth error %d\n", err);
1310 + bphy_err(drvr, "auth error %d\n", err);
1314 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", 0);
1316 - bphy_err(wiphy, "wsec error %d\n", err);
1317 + bphy_err(drvr, "wsec error %d\n", err);
1320 /* set upper-layer auth */
1321 @@ -3883,7 +3912,7 @@ static s32 brcmf_configure_opensecurity(
1322 wpa_val = WPA_AUTH_DISABLED;
1323 err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_val);
1325 - bphy_err(wiphy, "wpa_auth error %d\n", err);
1326 + bphy_err(drvr, "wpa_auth error %d\n", err);
1330 @@ -3903,7 +3932,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1331 const struct brcmf_vs_tlv *wpa_ie,
1334 - struct wiphy *wiphy = ifp->drvr->wiphy;
1335 + struct brcmf_pub *drvr = ifp->drvr;
1336 u32 auth = 0; /* d11 open authentication */
1339 @@ -3934,13 +3963,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
1340 /* check for multicast cipher suite */
1341 if (offset + WPA_IE_MIN_OUI_LEN > len) {
1343 - bphy_err(wiphy, "no multicast cipher suite\n");
1344 + bphy_err(drvr, "no multicast cipher suite\n");
1348 if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
1350 - bphy_err(wiphy, "ivalid OUI\n");
1351 + bphy_err(drvr, "ivalid OUI\n");
1354 offset += TLV_OUI_LEN;
1355 @@ -3962,7 +3991,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1359 - bphy_err(wiphy, "Invalid multi cast cipher info\n");
1360 + bphy_err(drvr, "Invalid multi cast cipher info\n");
1364 @@ -3973,13 +4002,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
1365 /* Check for unicast suite(s) */
1366 if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
1368 - bphy_err(wiphy, "no unicast cipher suite\n");
1369 + bphy_err(drvr, "no unicast cipher suite\n");
1372 for (i = 0; i < count; i++) {
1373 if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
1375 - bphy_err(wiphy, "ivalid OUI\n");
1376 + bphy_err(drvr, "ivalid OUI\n");
1379 offset += TLV_OUI_LEN;
1380 @@ -3997,7 +4026,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1381 pval |= AES_ENABLED;
1384 - bphy_err(wiphy, "Invalid unicast security info\n");
1385 + bphy_err(drvr, "Invalid unicast security info\n");
1389 @@ -4007,13 +4036,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
1390 /* Check for auth key management suite(s) */
1391 if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
1393 - bphy_err(wiphy, "no auth key mgmt suite\n");
1394 + bphy_err(drvr, "no auth key mgmt suite\n");
1397 for (i = 0; i < count; i++) {
1398 if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
1400 - bphy_err(wiphy, "ivalid OUI\n");
1401 + bphy_err(drvr, "ivalid OUI\n");
1404 offset += TLV_OUI_LEN;
1405 @@ -4041,7 +4070,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1406 wpa_auth |= WPA2_AUTH_1X_SHA256;
1409 - bphy_err(wiphy, "Invalid key mgmt info\n");
1410 + bphy_err(drvr, "Invalid key mgmt info\n");
1414 @@ -4083,7 +4112,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1415 err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable",
1418 - bphy_err(wiphy, "wme_bss_disable error %d\n", err);
1419 + bphy_err(drvr, "wme_bss_disable error %d\n", err);
1423 @@ -4097,7 +4126,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1425 WPA_IE_MIN_OUI_LEN);
1427 - bphy_err(wiphy, "bip error %d\n", err);
1428 + bphy_err(drvr, "bip error %d\n", err);
1432 @@ -4108,13 +4137,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
1434 err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth);
1436 - bphy_err(wiphy, "auth error %d\n", err);
1437 + bphy_err(drvr, "auth error %d\n", err);
1441 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
1443 - bphy_err(wiphy, "wsec error %d\n", err);
1444 + bphy_err(drvr, "wsec error %d\n", err);
1447 /* Configure MFP, this needs to go after wsec otherwise the wsec command
1448 @@ -4123,14 +4152,14 @@ brcmf_configure_wpaie(struct brcmf_if *i
1449 if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) {
1450 err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp);
1452 - bphy_err(wiphy, "mfp error %d\n", err);
1453 + bphy_err(drvr, "mfp error %d\n", err);
1457 /* set upper-layer auth */
1458 err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth);
1460 - bphy_err(wiphy, "wpa_auth error %d\n", err);
1461 + bphy_err(drvr, "wpa_auth error %d\n", err);
1465 @@ -4216,8 +4245,8 @@ brcmf_vndr_ie(u8 *iebuf, s32 pktflag, u8
1466 s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag,
1467 const u8 *vndr_ie_buf, u32 vndr_ie_len)
1469 + struct brcmf_pub *drvr;
1470 struct brcmf_if *ifp;
1471 - struct wiphy *wiphy;
1472 struct vif_saved_ie *saved_ie;
1475 @@ -4238,7 +4267,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
1479 - wiphy = ifp->drvr->wiphy;
1481 saved_ie = &vif->saved_ie;
1483 brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx,
1484 @@ -4270,13 +4299,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
1488 - bphy_err(wiphy, "not suitable type\n");
1489 + bphy_err(drvr, "not suitable type\n");
1493 if (vndr_ie_len > mgmt_ie_buf_len) {
1495 - bphy_err(wiphy, "extra IE size too big\n");
1496 + bphy_err(drvr, "extra IE size too big\n");
1500 @@ -4337,7 +4366,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
1501 /* verify remained buf size before copy data */
1502 if (remained_buf_len < (vndrie_info->vndrie.len +
1503 VNDR_IE_VSIE_OFFSET)) {
1504 - bphy_err(wiphy, "no space in mgmt_ie_buf: len left %d",
1505 + bphy_err(drvr, "no space in mgmt_ie_buf: len left %d",
1509 @@ -4369,7 +4398,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
1510 err = brcmf_fil_bsscfg_data_set(ifp, "vndr_ie", iovar_ie_buf,
1513 - bphy_err(wiphy, "vndr ie set error : %d\n", err);
1514 + bphy_err(drvr, "vndr ie set error : %d\n", err);
1518 @@ -4397,14 +4426,14 @@ static s32
1519 brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif,
1520 struct cfg80211_beacon_data *beacon)
1522 - struct wiphy *wiphy = vif->ifp->drvr->wiphy;
1523 + struct brcmf_pub *drvr = vif->ifp->drvr;
1526 /* Set Beacon IEs to FW */
1527 err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_BEACON_FLAG,
1528 beacon->tail, beacon->tail_len);
1530 - bphy_err(wiphy, "Set Beacon IE Failed\n");
1531 + bphy_err(drvr, "Set Beacon IE Failed\n");
1534 brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n");
1535 @@ -4414,7 +4443,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg
1536 beacon->proberesp_ies,
1537 beacon->proberesp_ies_len);
1539 - bphy_err(wiphy, "Set Probe Resp IE Failed\n");
1540 + bphy_err(drvr, "Set Probe Resp IE Failed\n");
1542 brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n");
1544 @@ -4428,6 +4457,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1546 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1547 struct brcmf_if *ifp = netdev_priv(ndev);
1548 + struct brcmf_pub *drvr = cfg->pub;
1549 const struct brcmf_tlv *ssid_ie;
1550 const struct brcmf_tlv *country_ie;
1551 struct brcmf_ssid_le ssid_le;
1552 @@ -4523,7 +4553,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1553 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
1556 - bphy_err(wiphy, "Regulatory Set Error, %d\n",
1557 + bphy_err(drvr, "Regulatory Set Error, %d\n",
1561 @@ -4532,7 +4562,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1562 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD,
1563 settings->beacon_interval);
1565 - bphy_err(wiphy, "Beacon Interval Set Error, %d\n",
1566 + bphy_err(drvr, "Beacon Interval Set Error, %d\n",
1570 @@ -4541,7 +4571,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1571 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD,
1572 settings->dtim_period);
1574 - bphy_err(wiphy, "DTIM Interval Set Error, %d\n",
1575 + bphy_err(drvr, "DTIM Interval Set Error, %d\n",
1579 @@ -4552,7 +4582,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1580 !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB))) {
1581 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
1583 - bphy_err(wiphy, "BRCMF_C_DOWN error %d\n",
1584 + bphy_err(drvr, "BRCMF_C_DOWN error %d\n",
1588 @@ -4561,7 +4591,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1590 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1);
1592 - bphy_err(wiphy, "SET INFRA error %d\n", err);
1593 + bphy_err(drvr, "SET INFRA error %d\n", err);
1596 } else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) {
1597 @@ -4577,7 +4607,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1599 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
1601 - bphy_err(wiphy, "setting AP mode failed %d\n",
1602 + bphy_err(drvr, "setting AP mode failed %d\n",
1606 @@ -4587,14 +4617,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1608 err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
1610 - bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
1611 + bphy_err(drvr, "Set Channel failed: chspec=%d, %d\n",
1616 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
1618 - bphy_err(wiphy, "BRCMF_C_UP error (%d)\n", err);
1619 + bphy_err(drvr, "BRCMF_C_UP error (%d)\n", err);
1622 /* On DOWN the firmware removes the WEP keys, reconfigure
1623 @@ -4609,14 +4639,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1624 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
1625 &join_params, sizeof(join_params));
1627 - bphy_err(wiphy, "SET SSID error (%d)\n", err);
1628 + bphy_err(drvr, "SET SSID error (%d)\n", err);
1632 if (settings->hidden_ssid) {
1633 err = brcmf_fil_iovar_int_set(ifp, "closednet", 1);
1635 - bphy_err(wiphy, "closednet error (%d)\n", err);
1636 + bphy_err(drvr, "closednet error (%d)\n", err);
1640 @@ -4625,14 +4655,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1641 } else if (dev_role == NL80211_IFTYPE_P2P_GO) {
1642 err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
1644 - bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
1645 + bphy_err(drvr, "Set Channel failed: chspec=%d, %d\n",
1649 err = brcmf_fil_bsscfg_data_set(ifp, "ssid", &ssid_le,
1652 - bphy_err(wiphy, "setting ssid failed %d\n", err);
1653 + bphy_err(drvr, "setting ssid failed %d\n", err);
1656 bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
1657 @@ -4640,7 +4670,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1658 err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
1659 sizeof(bss_enable));
1661 - bphy_err(wiphy, "bss_enable config failed %d\n", err);
1662 + bphy_err(drvr, "bss_enable config failed %d\n", err);
1666 @@ -4663,7 +4693,9 @@ exit:
1668 static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
1670 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1671 struct brcmf_if *ifp = netdev_priv(ndev);
1672 + struct brcmf_pub *drvr = cfg->pub;
1674 struct brcmf_fil_bss_enable_le bss_enable;
1675 struct brcmf_join_params join_params;
1676 @@ -4688,13 +4720,13 @@ static int brcmf_cfg80211_stop_ap(struct
1677 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
1678 &join_params, sizeof(join_params));
1680 - bphy_err(wiphy, "SET SSID error (%d)\n", err);
1681 + bphy_err(drvr, "SET SSID error (%d)\n", err);
1682 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
1684 - bphy_err(wiphy, "BRCMF_C_DOWN error %d\n", err);
1685 + bphy_err(drvr, "BRCMF_C_DOWN error %d\n", err);
1686 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
1688 - bphy_err(wiphy, "setting AP mode failed %d\n", err);
1689 + bphy_err(drvr, "setting AP mode failed %d\n", err);
1690 if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
1691 brcmf_fil_iovar_int_set(ifp, "mbss", 0);
1692 brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
1693 @@ -4702,7 +4734,7 @@ static int brcmf_cfg80211_stop_ap(struct
1694 /* Bring device back up so it can be used again */
1695 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
1697 - bphy_err(wiphy, "BRCMF_C_UP error %d\n", err);
1698 + bphy_err(drvr, "BRCMF_C_UP error %d\n", err);
1700 brcmf_vif_clear_mgmt_ies(ifp->vif);
1702 @@ -4711,7 +4743,7 @@ static int brcmf_cfg80211_stop_ap(struct
1703 err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
1704 sizeof(bss_enable));
1706 - bphy_err(wiphy, "bss_enable config failed %d\n", err);
1707 + bphy_err(drvr, "bss_enable config failed %d\n", err);
1709 brcmf_set_mpc(ifp, 1);
1710 brcmf_configure_arp_nd_offload(ifp, true);
1711 @@ -4740,6 +4772,7 @@ brcmf_cfg80211_del_station(struct wiphy
1712 struct station_del_parameters *params)
1714 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1715 + struct brcmf_pub *drvr = cfg->pub;
1716 struct brcmf_scb_val_le scbval;
1717 struct brcmf_if *ifp = netdev_priv(ndev);
1719 @@ -4759,7 +4792,7 @@ brcmf_cfg80211_del_station(struct wiphy
1720 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON,
1721 &scbval, sizeof(scbval));
1723 - bphy_err(wiphy, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
1724 + bphy_err(drvr, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
1727 brcmf_dbg(TRACE, "Exit\n");
1728 @@ -4770,6 +4803,8 @@ static int
1729 brcmf_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev,
1730 const u8 *mac, struct station_parameters *params)
1732 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1733 + struct brcmf_pub *drvr = cfg->pub;
1734 struct brcmf_if *ifp = netdev_priv(ndev);
1737 @@ -4790,7 +4825,7 @@ brcmf_cfg80211_change_station(struct wip
1738 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SCB_DEAUTHORIZE,
1739 (void *)mac, ETH_ALEN);
1741 - bphy_err(wiphy, "Setting SCB (de-)authorize failed, %d\n", err);
1742 + bphy_err(drvr, "Setting SCB (de-)authorize failed, %d\n", err);
1746 @@ -4820,6 +4855,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
1748 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1749 struct ieee80211_channel *chan = params->chan;
1750 + struct brcmf_pub *drvr = cfg->pub;
1751 const u8 *buf = params->buf;
1752 size_t len = params->len;
1753 const struct ieee80211_mgmt *mgmt;
1754 @@ -4840,7 +4876,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
1755 mgmt = (const struct ieee80211_mgmt *)buf;
1757 if (!ieee80211_is_mgmt(mgmt->frame_control)) {
1758 - bphy_err(wiphy, "Driver only allows MGMT packet type\n");
1759 + bphy_err(drvr, "Driver only allows MGMT packet type\n");
1763 @@ -4871,13 +4907,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
1765 } else if (ieee80211_is_action(mgmt->frame_control)) {
1766 if (len > BRCMF_FIL_ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN) {
1767 - bphy_err(wiphy, "invalid action frame length\n");
1768 + bphy_err(drvr, "invalid action frame length\n");
1772 af_params = kzalloc(sizeof(*af_params), GFP_KERNEL);
1773 if (af_params == NULL) {
1774 - bphy_err(wiphy, "unable to allocate frame\n");
1775 + bphy_err(drvr, "unable to allocate frame\n");
1779 @@ -4928,6 +4964,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
1782 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1783 + struct brcmf_pub *drvr = cfg->pub;
1784 struct brcmf_cfg80211_vif *vif;
1787 @@ -4935,7 +4972,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
1789 vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
1791 - bphy_err(wiphy, "No p2p device available for probe response\n");
1792 + bphy_err(drvr, "No p2p device available for probe response\n");
1796 @@ -4950,6 +4987,7 @@ static int brcmf_cfg80211_get_channel(st
1798 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1799 struct net_device *ndev = wdev->netdev;
1800 + struct brcmf_pub *drvr = cfg->pub;
1801 struct brcmf_if *ifp;
1802 struct brcmu_chan ch;
1803 enum nl80211_band band = 0;
1804 @@ -4963,7 +5001,7 @@ static int brcmf_cfg80211_get_channel(st
1806 err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
1808 - bphy_err(wiphy, "chanspec failed (%d)\n", err);
1809 + bphy_err(drvr, "chanspec failed (%d)\n", err);
1813 @@ -5085,6 +5123,8 @@ static int brcmf_cfg80211_tdls_oper(stru
1814 struct net_device *ndev, const u8 *peer,
1815 enum nl80211_tdls_operation oper)
1817 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1818 + struct brcmf_pub *drvr = cfg->pub;
1819 struct brcmf_if *ifp;
1820 struct brcmf_tdls_iovar_le info;
1822 @@ -5102,7 +5142,7 @@ static int brcmf_cfg80211_tdls_oper(stru
1823 ret = brcmf_fil_iovar_data_set(ifp, "tdls_endpoint",
1824 &info, sizeof(info));
1826 - bphy_err(wiphy, "tdls_endpoint iovar failed: ret=%d\n", ret);
1827 + bphy_err(drvr, "tdls_endpoint iovar failed: ret=%d\n", ret);
1831 @@ -5113,6 +5153,8 @@ brcmf_cfg80211_update_conn_params(struct
1832 struct cfg80211_connect_params *sme,
1835 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1836 + struct brcmf_pub *drvr = cfg->pub;
1837 struct brcmf_if *ifp;
1840 @@ -5123,7 +5165,7 @@ brcmf_cfg80211_update_conn_params(struct
1841 err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
1842 sme->ie, sme->ie_len);
1844 - bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
1845 + bphy_err(drvr, "Set Assoc REQ IE Failed\n");
1847 brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
1849 @@ -5135,6 +5177,8 @@ static int
1850 brcmf_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *ndev,
1851 struct cfg80211_gtk_rekey_data *gtk)
1853 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1854 + struct brcmf_pub *drvr = cfg->pub;
1855 struct brcmf_if *ifp = netdev_priv(ndev);
1856 struct brcmf_gtk_keyinfo_le gtk_le;
1858 @@ -5149,7 +5193,7 @@ brcmf_cfg80211_set_rekey_data(struct wip
1859 ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", >k_le,
1862 - bphy_err(wiphy, "gtk_key_info iovar failed: ret=%d\n", ret);
1863 + bphy_err(drvr, "gtk_key_info iovar failed: ret=%d\n", ret);
1867 @@ -5381,7 +5425,7 @@ static void brcmf_clear_assoc_ies(struct
1868 static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg,
1869 struct brcmf_if *ifp)
1871 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1872 + struct brcmf_pub *drvr = cfg->pub;
1873 struct brcmf_cfg80211_assoc_ielen_le *assoc_info;
1874 struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg);
1876 @@ -5393,7 +5437,7 @@ static s32 brcmf_get_assoc_ies(struct br
1877 err = brcmf_fil_iovar_data_get(ifp, "assoc_info",
1878 cfg->extra_buf, WL_ASSOC_INFO_MAX);
1880 - bphy_err(wiphy, "could not get assoc info (%d)\n", err);
1881 + bphy_err(drvr, "could not get assoc info (%d)\n", err);
1885 @@ -5405,7 +5449,7 @@ static s32 brcmf_get_assoc_ies(struct br
1889 - bphy_err(wiphy, "could not get assoc req (%d)\n", err);
1890 + bphy_err(drvr, "could not get assoc req (%d)\n", err);
1893 conn_info->req_ie_len = req_len;
1894 @@ -5423,7 +5467,7 @@ static s32 brcmf_get_assoc_ies(struct br
1898 - bphy_err(wiphy, "could not get assoc resp (%d)\n", err);
1899 + bphy_err(drvr, "could not get assoc resp (%d)\n", err);
1902 conn_info->resp_ie_len = resp_len;
1903 @@ -5552,7 +5596,7 @@ brcmf_notify_connect_status_ap(struct br
1904 struct net_device *ndev,
1905 const struct brcmf_event_msg *e, void *data)
1907 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1908 + struct brcmf_pub *drvr = cfg->pub;
1909 static int generation;
1910 u32 event = e->event_code;
1911 u32 reason = e->reason;
1912 @@ -5570,7 +5614,7 @@ brcmf_notify_connect_status_ap(struct br
1913 if (((event == BRCMF_E_ASSOC_IND) || (event == BRCMF_E_REASSOC_IND)) &&
1914 (reason == BRCMF_E_STATUS_SUCCESS)) {
1916 - bphy_err(wiphy, "No IEs present in ASSOC/REASSOC_IND\n");
1917 + bphy_err(drvr, "No IEs present in ASSOC/REASSOC_IND\n");
1921 @@ -5862,7 +5906,7 @@ static void init_vif_event(struct brcmf_
1923 static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
1925 - struct wiphy *wiphy = ifp->drvr->wiphy;
1926 + struct brcmf_pub *drvr = ifp->drvr;
1929 __le32 roamtrigger[2];
1930 @@ -5875,7 +5919,7 @@ static s32 brcmf_dongle_roam(struct brcm
1931 bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON;
1932 err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout);
1934 - bphy_err(wiphy, "bcn_timeout error (%d)\n", err);
1935 + bphy_err(drvr, "bcn_timeout error (%d)\n", err);
1936 goto roam_setup_done;
1939 @@ -5887,7 +5931,7 @@ static s32 brcmf_dongle_roam(struct brcm
1940 err = brcmf_fil_iovar_int_set(ifp, "roam_off",
1941 ifp->drvr->settings->roamoff);
1943 - bphy_err(wiphy, "roam_off error (%d)\n", err);
1944 + bphy_err(drvr, "roam_off error (%d)\n", err);
1945 goto roam_setup_done;
1948 @@ -5896,7 +5940,7 @@ static s32 brcmf_dongle_roam(struct brcm
1949 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER,
1950 (void *)roamtrigger, sizeof(roamtrigger));
1952 - bphy_err(wiphy, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
1953 + bphy_err(drvr, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
1954 goto roam_setup_done;
1957 @@ -5905,7 +5949,7 @@ static s32 brcmf_dongle_roam(struct brcm
1958 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA,
1959 (void *)roam_delta, sizeof(roam_delta));
1961 - bphy_err(wiphy, "WLC_SET_ROAM_DELTA error (%d)\n", err);
1962 + bphy_err(drvr, "WLC_SET_ROAM_DELTA error (%d)\n", err);
1963 goto roam_setup_done;
1966 @@ -5916,26 +5960,26 @@ roam_setup_done:
1968 brcmf_dongle_scantime(struct brcmf_if *ifp)
1970 - struct wiphy *wiphy = ifp->drvr->wiphy;
1971 + struct brcmf_pub *drvr = ifp->drvr;
1974 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME,
1975 BRCMF_SCAN_CHANNEL_TIME);
1977 - bphy_err(wiphy, "Scan assoc time error (%d)\n", err);
1978 + bphy_err(drvr, "Scan assoc time error (%d)\n", err);
1979 goto dongle_scantime_out;
1981 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME,
1982 BRCMF_SCAN_UNASSOC_TIME);
1984 - bphy_err(wiphy, "Scan unassoc time error (%d)\n", err);
1985 + bphy_err(drvr, "Scan unassoc time error (%d)\n", err);
1986 goto dongle_scantime_out;
1989 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_PASSIVE_TIME,
1990 BRCMF_SCAN_PASSIVE_TIME);
1992 - bphy_err(wiphy, "Scan passive time error (%d)\n", err);
1993 + bphy_err(drvr, "Scan passive time error (%d)\n", err);
1994 goto dongle_scantime_out;
1997 @@ -5968,7 +6012,8 @@ static int brcmf_construct_chaninfo(stru
2000 struct wiphy *wiphy = cfg_to_wiphy(cfg);
2001 - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
2002 + struct brcmf_pub *drvr = cfg->pub;
2003 + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
2004 struct ieee80211_supported_band *band;
2005 struct ieee80211_channel *channel;
2006 struct brcmf_chanspec_list *list;
2007 @@ -5989,7 +6034,7 @@ static int brcmf_construct_chaninfo(stru
2008 err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
2011 - bphy_err(wiphy, "get chanspecs error (%d)\n", err);
2012 + bphy_err(drvr, "get chanspecs error (%d)\n", err);
2016 @@ -6012,7 +6057,7 @@ static int brcmf_construct_chaninfo(stru
2017 } else if (ch.band == BRCMU_CHAN_BAND_5G) {
2018 band = wiphy->bands[NL80211_BAND_5GHZ];
2020 - bphy_err(wiphy, "Invalid channel Spec. 0x%x.\n",
2021 + bphy_err(drvr, "Invalid channel Spec. 0x%x.\n",
2025 @@ -6036,7 +6081,7 @@ static int brcmf_construct_chaninfo(stru
2026 /* It seems firmware supports some channel we never
2027 * considered. Something new in IEEE standard?
2029 - bphy_err(wiphy, "Ignoring unexpected firmware channel %d\n",
2030 + bphy_err(drvr, "Ignoring unexpected firmware channel %d\n",
2034 @@ -6093,8 +6138,8 @@ fail_pbuf:
2036 static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
2038 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
2039 - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
2040 + struct brcmf_pub *drvr = cfg->pub;
2041 + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
2042 struct ieee80211_supported_band *band;
2043 struct brcmf_fil_bwcap_le band_bwcap;
2044 struct brcmf_chanspec_list *list;
2045 @@ -6140,7 +6185,7 @@ static int brcmf_enable_bw40_2g(struct b
2046 err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
2049 - bphy_err(wiphy, "get chanspecs error (%d)\n", err);
2050 + bphy_err(drvr, "get chanspecs error (%d)\n", err);
2054 @@ -6171,7 +6216,7 @@ static int brcmf_enable_bw40_2g(struct b
2056 static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[])
2058 - struct wiphy *wiphy = ifp->drvr->wiphy;
2059 + struct brcmf_pub *drvr = ifp->drvr;
2060 u32 band, mimo_bwcap;
2063 @@ -6207,7 +6252,7 @@ static void brcmf_get_bwcap(struct brcmf
2064 bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT;
2067 - bphy_err(wiphy, "invalid mimo_bw_cap value\n");
2068 + bphy_err(drvr, "invalid mimo_bw_cap value\n");
2072 @@ -6282,7 +6327,8 @@ static void brcmf_update_vht_cap(struct
2074 static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
2076 - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
2077 + struct brcmf_pub *drvr = cfg->pub;
2078 + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
2079 struct wiphy *wiphy = cfg_to_wiphy(cfg);
2082 @@ -6299,7 +6345,7 @@ static int brcmf_setup_wiphybands(struct
2083 (void)brcmf_fil_iovar_int_get(ifp, "vhtmode", &vhtmode);
2084 err = brcmf_fil_iovar_int_get(ifp, "nmode", &nmode);
2086 - bphy_err(wiphy, "nmode error (%d)\n", err);
2087 + bphy_err(drvr, "nmode error (%d)\n", err);
2089 brcmf_get_bwcap(ifp, bw_cap);
2091 @@ -6309,7 +6355,7 @@ static int brcmf_setup_wiphybands(struct
2093 err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain);
2095 - bphy_err(wiphy, "rxchain error (%d)\n", err);
2096 + bphy_err(drvr, "rxchain error (%d)\n", err);
2099 for (nchain = 0; rxchain; nchain++)
2100 @@ -6319,7 +6365,7 @@ static int brcmf_setup_wiphybands(struct
2102 err = brcmf_construct_chaninfo(cfg, bw_cap);
2104 - bphy_err(wiphy, "brcmf_construct_chaninfo failed (%d)\n", err);
2105 + bphy_err(drvr, "brcmf_construct_chaninfo failed (%d)\n", err);
2109 @@ -6526,12 +6572,13 @@ static void brcmf_wiphy_wowl_params(stru
2112 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
2113 + struct brcmf_pub *drvr = cfg->pub;
2114 struct wiphy_wowlan_support *wowl;
2116 wowl = kmemdup(&brcmf_wowlan_support, sizeof(brcmf_wowlan_support),
2119 - bphy_err(wiphy, "only support basic wowlan features\n");
2120 + bphy_err(drvr, "only support basic wowlan features\n");
2121 wiphy->wowlan = &brcmf_wowlan_support;
2124 @@ -6628,7 +6675,7 @@ static int brcmf_setup_wiphy(struct wiph
2125 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist,
2128 - bphy_err(wiphy, "could not obtain band info: err=%d\n", err);
2129 + bphy_err(drvr, "could not obtain band info: err=%d\n", err);
2132 /* first entry in bandlist is number of bands */
2133 @@ -6677,7 +6724,7 @@ static int brcmf_setup_wiphy(struct wiph
2135 static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
2137 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
2138 + struct brcmf_pub *drvr = cfg->pub;
2139 struct net_device *ndev;
2140 struct wireless_dev *wdev;
2141 struct brcmf_if *ifp;
2142 @@ -6715,7 +6762,7 @@ static s32 brcmf_config_dongle(struct br
2144 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1);
2146 - bphy_err(wiphy, "failed to set frameburst mode\n");
2147 + bphy_err(drvr, "failed to set frameburst mode\n");
2148 goto default_conf_out;
2151 @@ -6896,6 +6943,7 @@ static void brcmf_cfg80211_reg_notifier(
2153 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
2154 struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
2155 + struct brcmf_pub *drvr = cfg->pub;
2156 struct brcmf_fil_country_le ccreq;
2159 @@ -6907,7 +6955,7 @@ static void brcmf_cfg80211_reg_notifier(
2160 /* ignore non-ISO3166 country codes */
2161 for (i = 0; i < 2; i++)
2162 if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
2163 - bphy_err(wiphy, "not an ISO3166 code (0x%02x 0x%02x)\n",
2164 + bphy_err(drvr, "not an ISO3166 code (0x%02x 0x%02x)\n",
2165 req->alpha2[0], req->alpha2[1]);
2168 @@ -6917,7 +6965,7 @@ static void brcmf_cfg80211_reg_notifier(
2170 err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
2172 - bphy_err(wiphy, "Country code iovar returned err = %d\n", err);
2173 + bphy_err(drvr, "Country code iovar returned err = %d\n", err);
2177 @@ -6927,7 +6975,7 @@ static void brcmf_cfg80211_reg_notifier(
2179 err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq));
2181 - bphy_err(wiphy, "Firmware rejected country setting\n");
2182 + bphy_err(drvr, "Firmware rejected country setting\n");
2185 brcmf_setup_wiphybands(cfg);
2186 @@ -6973,13 +7021,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2190 - bphy_err(wiphy, "ndev is invalid\n");
2191 + bphy_err(drvr, "ndev is invalid\n");
2195 cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
2197 - bphy_err(wiphy, "Could not allocate wiphy device\n");
2198 + bphy_err(drvr, "Could not allocate wiphy device\n");
2202 @@ -7000,7 +7048,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2204 err = wl_init_priv(cfg);
2206 - bphy_err(wiphy, "Failed to init iwm_priv (%d)\n", err);
2207 + bphy_err(drvr, "Failed to init iwm_priv (%d)\n", err);
2208 brcmf_free_vif(vif);
2211 @@ -7009,7 +7057,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2212 /* determine d11 io type before wiphy setup */
2213 err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_VERSION, &io_type);
2215 - bphy_err(wiphy, "Failed to get D11 version (%d)\n", err);
2216 + bphy_err(drvr, "Failed to get D11 version (%d)\n", err);
2219 cfg->d11inf.io_type = (u8)io_type;
2220 @@ -7043,13 +7091,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2222 err = wiphy_register(wiphy);
2224 - bphy_err(wiphy, "Could not register wiphy device (%d)\n", err);
2225 + bphy_err(drvr, "Could not register wiphy device (%d)\n", err);
2229 err = brcmf_setup_wiphybands(cfg);
2231 - bphy_err(wiphy, "Setting wiphy bands failed (%d)\n", err);
2232 + bphy_err(drvr, "Setting wiphy bands failed (%d)\n", err);
2233 goto wiphy_unreg_out;
2236 @@ -7067,24 +7115,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2238 err = brcmf_fweh_activate_events(ifp);
2240 - bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
2241 + bphy_err(drvr, "FWEH activation failed (%d)\n", err);
2242 goto wiphy_unreg_out;
2245 err = brcmf_p2p_attach(cfg, p2pdev_forced);
2247 - bphy_err(wiphy, "P2P initialisation failed (%d)\n", err);
2248 + bphy_err(drvr, "P2P initialisation failed (%d)\n", err);
2249 goto wiphy_unreg_out;
2251 err = brcmf_btcoex_attach(cfg);
2253 - bphy_err(wiphy, "BT-coex initialisation failed (%d)\n", err);
2254 + bphy_err(drvr, "BT-coex initialisation failed (%d)\n", err);
2255 brcmf_p2p_detach(&cfg->p2p);
2256 goto wiphy_unreg_out;
2258 err = brcmf_pno_attach(cfg);
2260 - bphy_err(wiphy, "PNO initialisation failed (%d)\n", err);
2261 + bphy_err(drvr, "PNO initialisation failed (%d)\n", err);
2262 brcmf_btcoex_detach(cfg);
2263 brcmf_p2p_detach(&cfg->p2p);
2264 goto wiphy_unreg_out;
2265 @@ -7104,7 +7152,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2266 /* (re-) activate FWEH event handling */
2267 err = brcmf_fweh_activate_events(ifp);
2269 - bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
2270 + bphy_err(drvr, "FWEH activation failed (%d)\n", err);
2274 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
2275 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
2276 @@ -62,12 +62,12 @@ void __brcmf_err(struct brcmf_bus *bus,
2280 -#define bphy_err(wiphy, fmt, ...) \
2281 +#define bphy_err(drvr, fmt, ...) \
2283 if (IS_ENABLED(CPTCFG_BRCMDBG) || \
2284 IS_ENABLED(CPTCFG_BRCM_TRACING) || \
2286 - wiphy_err(wiphy, "%s: " fmt, __func__, \
2287 + wiphy_err((drvr)->wiphy, "%s: " fmt, __func__, \