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 @@ -550,7 +550,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 @@ -567,7 +567,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 @@ -586,6 +586,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 @@ -611,7 +612,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 @@ -619,7 +620,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 @@ -627,7 +628,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");
101 @@ -658,13 +659,15 @@ static struct wireless_dev *brcmf_cfg802
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 @@ -689,7 +692,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 @@ -705,13 +708,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 @@ -789,6 +792,7 @@ static int brcmf_cfg80211_del_ap_iface(s
144 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
145 struct net_device *ndev = wdev->netdev;
146 struct brcmf_if *ifp = netdev_priv(ndev);
147 + struct brcmf_pub *drvr = cfg->pub;
151 @@ -796,7 +800,7 @@ static int brcmf_cfg80211_del_ap_iface(s
153 err = brcmf_fil_bsscfg_data_set(ifp, "interface_remove", NULL, 0);
155 - bphy_err(wiphy, "interface_remove failed %d\n", err);
156 + bphy_err(drvr, "interface_remove failed %d\n", err);
160 @@ -804,7 +808,7 @@ static int brcmf_cfg80211_del_ap_iface(s
161 ret = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_DEL,
162 BRCMF_VIF_EVENT_TIMEOUT);
164 - bphy_err(wiphy, "timeout occurred\n");
165 + bphy_err(drvr, "timeout occurred\n");
169 @@ -867,6 +871,7 @@ brcmf_cfg80211_change_iface(struct wiphy
170 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
171 struct brcmf_if *ifp = netdev_priv(ndev);
172 struct brcmf_cfg80211_vif *vif = ifp->vif;
173 + struct brcmf_pub *drvr = cfg->pub;
177 @@ -906,13 +911,13 @@ brcmf_cfg80211_change_iface(struct wiphy
179 err = brcmf_vif_change_validate(wiphy_to_cfg(wiphy), vif, type);
181 - bphy_err(wiphy, "iface validation failed: err=%d\n", err);
182 + bphy_err(drvr, "iface validation failed: err=%d\n", err);
186 case NL80211_IFTYPE_MONITOR:
187 case NL80211_IFTYPE_WDS:
188 - bphy_err(wiphy, "type (%d) : currently we do not support this type\n",
189 + bphy_err(drvr, "type (%d) : currently we do not support this type\n",
192 case NL80211_IFTYPE_ADHOC:
193 @@ -941,7 +946,7 @@ brcmf_cfg80211_change_iface(struct wiphy
195 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, infra);
197 - bphy_err(wiphy, "WLC_SET_INFRA error (%d)\n", err);
198 + bphy_err(drvr, "WLC_SET_INFRA error (%d)\n", err);
202 @@ -1043,7 +1048,7 @@ static s32
203 brcmf_run_escan(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
204 struct cfg80211_scan_request *request)
206 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
207 + struct brcmf_pub *drvr = cfg->pub;
208 s32 params_size = BRCMF_SCAN_PARAMS_FIXED_SIZE +
209 offsetof(struct brcmf_escan_params_le, params_le);
210 struct brcmf_escan_params_le *params;
211 @@ -1075,7 +1080,7 @@ brcmf_run_escan(struct brcmf_cfg80211_in
213 brcmf_dbg(INFO, "system busy : escan canceled\n");
215 - bphy_err(wiphy, "error (%d)\n", err);
216 + bphy_err(drvr, "error (%d)\n", err);
220 @@ -1122,6 +1127,7 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
222 struct brcmf_if *ifp = vif->ifp;
223 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
224 + struct brcmf_pub *drvr = cfg->pub;
225 struct cfg80211_ssid *ssids;
228 @@ -1133,22 +1139,22 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
229 brcmf_dbg(SCAN, "START ESCAN\n");
231 if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
232 - bphy_err(wiphy, "Scanning already: status (%lu)\n",
233 + bphy_err(drvr, "Scanning already: status (%lu)\n",
237 if (test_bit(BRCMF_SCAN_STATUS_ABORT, &cfg->scan_status)) {
238 - bphy_err(wiphy, "Scanning being aborted: status (%lu)\n",
239 + bphy_err(drvr, "Scanning being aborted: status (%lu)\n",
243 if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
244 - bphy_err(wiphy, "Scanning suppressed: status (%lu)\n",
245 + bphy_err(drvr, "Scanning suppressed: status (%lu)\n",
249 if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) {
250 - bphy_err(wiphy, "Connecting: status (%lu)\n",
251 + bphy_err(drvr, "Connecting: status (%lu)\n",
252 ifp->vif->sme_state);
255 @@ -1230,6 +1236,8 @@ scan_out:
257 brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
259 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
260 + struct brcmf_pub *drvr = cfg->pub;
261 struct brcmf_cfg80211_vif *vif;
264 @@ -1241,7 +1249,7 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
265 err = brcmf_cfg80211_escan(wiphy, vif, request, NULL);
268 - bphy_err(wiphy, "scan error (%d)\n", err);
269 + bphy_err(drvr, "scan error (%d)\n", err);
271 brcmf_dbg(TRACE, "Exit\n");
273 @@ -1250,12 +1258,12 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
274 static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
276 struct brcmf_if *ifp = netdev_priv(ndev);
277 - struct wiphy *wiphy = ifp->drvr->wiphy;
278 + struct brcmf_pub *drvr = ifp->drvr;
281 err = brcmf_fil_iovar_int_set(ifp, "rtsthresh", rts_threshold);
283 - bphy_err(wiphy, "Error (%d)\n", err);
284 + bphy_err(drvr, "Error (%d)\n", err);
288 @@ -1263,13 +1271,13 @@ static s32 brcmf_set_rts(struct net_devi
289 static s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold)
291 struct brcmf_if *ifp = netdev_priv(ndev);
292 - struct wiphy *wiphy = ifp->drvr->wiphy;
293 + struct brcmf_pub *drvr = ifp->drvr;
296 err = brcmf_fil_iovar_int_set(ifp, "fragthresh",
299 - bphy_err(wiphy, "Error (%d)\n", err);
300 + bphy_err(drvr, "Error (%d)\n", err);
304 @@ -1277,13 +1285,13 @@ static s32 brcmf_set_frag(struct net_dev
305 static s32 brcmf_set_retry(struct net_device *ndev, u32 retry, bool l)
307 struct brcmf_if *ifp = netdev_priv(ndev);
308 - struct wiphy *wiphy = ifp->drvr->wiphy;
309 + struct brcmf_pub *drvr = ifp->drvr;
311 u32 cmd = (l ? BRCMF_C_SET_LRL : BRCMF_C_SET_SRL);
313 err = brcmf_fil_cmd_int_set(ifp, cmd, retry);
315 - bphy_err(wiphy, "cmd (%d) , error (%d)\n", cmd, err);
316 + bphy_err(drvr, "cmd (%d) , error (%d)\n", cmd, err);
320 @@ -1360,7 +1368,7 @@ static u16 brcmf_map_fw_linkdown_reason(
321 static void brcmf_link_down(struct brcmf_cfg80211_vif *vif, u16 reason)
323 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
324 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
325 + struct brcmf_pub *drvr = cfg->pub;
328 brcmf_dbg(TRACE, "Enter\n");
329 @@ -1370,7 +1378,7 @@ static void brcmf_link_down(struct brcmf
330 err = brcmf_fil_cmd_data_set(vif->ifp,
331 BRCMF_C_DISASSOC, NULL, 0);
333 - bphy_err(wiphy, "WLC_DISASSOC failed (%d)\n", err);
334 + bphy_err(drvr, "WLC_DISASSOC failed (%d)\n", err);
336 if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
337 (vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
338 @@ -1390,6 +1398,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
339 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
340 struct brcmf_if *ifp = netdev_priv(ndev);
341 struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
342 + struct brcmf_pub *drvr = cfg->pub;
343 struct brcmf_join_params join_params;
344 size_t join_params_size = 0;
346 @@ -1454,7 +1463,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
348 err = brcmf_fil_iovar_int_set(ifp, "wsec", wsec);
350 - bphy_err(wiphy, "wsec failed (%d)\n", err);
351 + bphy_err(drvr, "wsec failed (%d)\n", err);
355 @@ -1466,7 +1475,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
357 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, bcnprd);
359 - bphy_err(wiphy, "WLC_SET_BCNPRD failed (%d)\n", err);
360 + bphy_err(drvr, "WLC_SET_BCNPRD failed (%d)\n", err);
364 @@ -1511,7 +1520,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
365 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_CHANNEL,
368 - bphy_err(wiphy, "WLC_SET_CHANNEL failed (%d)\n", err);
369 + bphy_err(drvr, "WLC_SET_CHANNEL failed (%d)\n", err);
373 @@ -1523,7 +1532,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
374 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
375 &join_params, join_params_size);
377 - bphy_err(wiphy, "WLC_SET_SSID failed (%d)\n", err);
378 + bphy_err(drvr, "WLC_SET_SSID failed (%d)\n", err);
382 @@ -1560,8 +1569,8 @@ static s32 brcmf_set_wpa_version(struct
383 struct cfg80211_connect_params *sme)
385 struct brcmf_if *ifp = netdev_priv(ndev);
386 - struct wiphy *wiphy = ifp->drvr->wiphy;
387 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
388 + struct brcmf_pub *drvr = ifp->drvr;
389 struct brcmf_cfg80211_security *sec;
392 @@ -1575,7 +1584,7 @@ static s32 brcmf_set_wpa_version(struct
393 brcmf_dbg(CONN, "setting wpa_auth to 0x%0x\n", val);
394 err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", val);
396 - bphy_err(wiphy, "set wpa_auth failed (%d)\n", err);
397 + bphy_err(drvr, "set wpa_auth failed (%d)\n", err);
401 @@ -1587,8 +1596,8 @@ static s32 brcmf_set_auth_type(struct ne
402 struct cfg80211_connect_params *sme)
404 struct brcmf_if *ifp = netdev_priv(ndev);
405 - struct wiphy *wiphy = ifp->drvr->wiphy;
406 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
407 + struct brcmf_pub *drvr = ifp->drvr;
408 struct brcmf_cfg80211_security *sec;
411 @@ -1610,7 +1619,7 @@ static s32 brcmf_set_auth_type(struct ne
413 err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
415 - bphy_err(wiphy, "set auth failed (%d)\n", err);
416 + bphy_err(drvr, "set auth failed (%d)\n", err);
420 @@ -1623,8 +1632,8 @@ brcmf_set_wsec_mode(struct net_device *n
421 struct cfg80211_connect_params *sme)
423 struct brcmf_if *ifp = netdev_priv(ndev);
424 - struct wiphy *wiphy = ifp->drvr->wiphy;
425 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
426 + struct brcmf_pub *drvr = ifp->drvr;
427 struct brcmf_cfg80211_security *sec;
430 @@ -1647,7 +1656,7 @@ brcmf_set_wsec_mode(struct net_device *n
434 - bphy_err(wiphy, "invalid cipher pairwise (%d)\n",
435 + bphy_err(drvr, "invalid cipher pairwise (%d)\n",
436 sme->crypto.ciphers_pairwise[0]);
439 @@ -1668,7 +1677,7 @@ brcmf_set_wsec_mode(struct net_device *n
443 - bphy_err(wiphy, "invalid cipher group (%d)\n",
444 + bphy_err(drvr, "invalid cipher group (%d)\n",
445 sme->crypto.cipher_group);
448 @@ -1684,7 +1693,7 @@ brcmf_set_wsec_mode(struct net_device *n
450 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
452 - bphy_err(wiphy, "error (%d)\n", err);
453 + bphy_err(drvr, "error (%d)\n", err);
457 @@ -1699,7 +1708,7 @@ static s32
458 brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
460 struct brcmf_if *ifp = netdev_priv(ndev);
461 - struct wiphy *wiphy = ifp->drvr->wiphy;
462 + struct brcmf_pub *drvr = ifp->drvr;
465 const struct brcmf_tlv *rsn_ie;
466 @@ -1715,7 +1724,7 @@ brcmf_set_key_mgmt(struct net_device *nd
468 err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wpa_auth", &val);
470 - bphy_err(wiphy, "could not get wpa_auth (%d)\n", err);
471 + bphy_err(drvr, "could not get wpa_auth (%d)\n", err);
474 if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
475 @@ -1727,7 +1736,7 @@ brcmf_set_key_mgmt(struct net_device *nd
479 - bphy_err(wiphy, "invalid cipher group (%d)\n",
480 + bphy_err(drvr, "invalid cipher group (%d)\n",
481 sme->crypto.cipher_group);
484 @@ -1746,7 +1755,7 @@ brcmf_set_key_mgmt(struct net_device *nd
488 - bphy_err(wiphy, "invalid cipher group (%d)\n",
489 + bphy_err(drvr, "invalid cipher group (%d)\n",
490 sme->crypto.cipher_group);
493 @@ -1790,7 +1799,7 @@ skip_mfp_config:
494 brcmf_dbg(CONN, "setting wpa_auth to %d\n", val);
495 err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val);
497 - bphy_err(wiphy, "could not set wpa_auth (%d)\n", err);
498 + bphy_err(drvr, "could not set wpa_auth (%d)\n", err);
502 @@ -1802,7 +1811,7 @@ brcmf_set_sharedkey(struct net_device *n
503 struct cfg80211_connect_params *sme)
505 struct brcmf_if *ifp = netdev_priv(ndev);
506 - struct wiphy *wiphy = ifp->drvr->wiphy;
507 + struct brcmf_pub *drvr = ifp->drvr;
508 struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
509 struct brcmf_cfg80211_security *sec;
510 struct brcmf_wsec_key key;
511 @@ -1829,7 +1838,7 @@ brcmf_set_sharedkey(struct net_device *n
512 key.len = (u32) sme->key_len;
513 key.index = (u32) sme->key_idx;
514 if (key.len > sizeof(key.data)) {
515 - bphy_err(wiphy, "Too long key length (%u)\n", key.len);
516 + bphy_err(drvr, "Too long key length (%u)\n", key.len);
519 memcpy(key.data, sme->key, key.len);
520 @@ -1842,7 +1851,7 @@ brcmf_set_sharedkey(struct net_device *n
521 key.algo = CRYPTO_ALGO_WEP128;
524 - bphy_err(wiphy, "Invalid algorithm (%d)\n",
525 + bphy_err(drvr, "Invalid algorithm (%d)\n",
526 sme->crypto.ciphers_pairwise[0]);
529 @@ -1859,7 +1868,7 @@ brcmf_set_sharedkey(struct net_device *n
530 val = WL_AUTH_SHARED_KEY; /* shared key */
531 err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
533 - bphy_err(wiphy, "set auth failed (%d)\n", err);
534 + bphy_err(drvr, "set auth failed (%d)\n", err);
538 @@ -1879,7 +1888,7 @@ enum nl80211_auth_type brcmf_war_auth_ty
539 static void brcmf_set_join_pref(struct brcmf_if *ifp,
540 struct cfg80211_bss_selection *bss_select)
542 - struct wiphy *wiphy = ifp->drvr->wiphy;
543 + struct brcmf_pub *drvr = ifp->drvr;
544 struct brcmf_join_pref_params join_pref_params[2];
545 enum nl80211_band band;
547 @@ -1918,7 +1927,7 @@ static void brcmf_set_join_pref(struct b
548 err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
549 sizeof(join_pref_params));
551 - bphy_err(wiphy, "Set join_pref error (%d)\n", err);
552 + bphy_err(drvr, "Set join_pref error (%d)\n", err);
556 @@ -1928,6 +1937,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
557 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
558 struct brcmf_if *ifp = netdev_priv(ndev);
559 struct ieee80211_channel *chan = sme->channel;
560 + struct brcmf_pub *drvr = ifp->drvr;
561 struct brcmf_join_params join_params;
562 size_t join_params_size;
563 const struct brcmf_tlv *rsn_ie;
564 @@ -1944,7 +1954,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
568 - bphy_err(wiphy, "Invalid ssid\n");
569 + bphy_err(drvr, "Invalid ssid\n");
573 @@ -1973,7 +1983,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
574 err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
575 sme->ie, sme->ie_len);
577 - bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
578 + bphy_err(drvr, "Set Assoc REQ IE Failed\n");
580 brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
582 @@ -1994,32 +2004,32 @@ brcmf_cfg80211_connect(struct wiphy *wip
584 err = brcmf_set_wpa_version(ndev, sme);
586 - bphy_err(wiphy, "wl_set_wpa_version failed (%d)\n", err);
587 + bphy_err(drvr, "wl_set_wpa_version failed (%d)\n", err);
591 sme->auth_type = brcmf_war_auth_type(ifp, sme->auth_type);
592 err = brcmf_set_auth_type(ndev, sme);
594 - bphy_err(wiphy, "wl_set_auth_type failed (%d)\n", err);
595 + bphy_err(drvr, "wl_set_auth_type failed (%d)\n", err);
599 err = brcmf_set_wsec_mode(ndev, sme);
601 - bphy_err(wiphy, "wl_set_set_cipher failed (%d)\n", err);
602 + bphy_err(drvr, "wl_set_set_cipher failed (%d)\n", err);
606 err = brcmf_set_key_mgmt(ndev, sme);
608 - bphy_err(wiphy, "wl_set_key_mgmt failed (%d)\n", err);
609 + bphy_err(drvr, "wl_set_key_mgmt failed (%d)\n", err);
613 err = brcmf_set_sharedkey(ndev, sme);
615 - bphy_err(wiphy, "brcmf_set_sharedkey failed (%d)\n", err);
616 + bphy_err(drvr, "brcmf_set_sharedkey failed (%d)\n", err);
620 @@ -2106,7 +2116,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
621 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
622 &join_params, join_params_size);
624 - bphy_err(wiphy, "BRCMF_C_SET_SSID failed (%d)\n", err);
625 + bphy_err(drvr, "BRCMF_C_SET_SSID failed (%d)\n", err);
629 @@ -2119,8 +2129,10 @@ static s32
630 brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
633 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
634 struct brcmf_if *ifp = netdev_priv(ndev);
635 struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
636 + struct brcmf_pub *drvr = cfg->pub;
637 struct brcmf_scb_val_le scbval;
640 @@ -2137,7 +2149,7 @@ brcmf_cfg80211_disconnect(struct wiphy *
641 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_DISASSOC,
642 &scbval, sizeof(scbval));
644 - bphy_err(wiphy, "error (%d)\n", err);
645 + bphy_err(drvr, "error (%d)\n", err);
647 brcmf_dbg(TRACE, "Exit\n");
649 @@ -2150,6 +2162,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
650 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
651 struct net_device *ndev = cfg_to_ndev(cfg);
652 struct brcmf_if *ifp = netdev_priv(ndev);
653 + struct brcmf_pub *drvr = cfg->pub;
657 @@ -2164,7 +2177,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
658 case NL80211_TX_POWER_LIMITED:
659 case NL80211_TX_POWER_FIXED:
661 - bphy_err(wiphy, "TX_POWER_FIXED - dbm is negative\n");
662 + bphy_err(drvr, "TX_POWER_FIXED - dbm is negative\n");
666 @@ -2174,7 +2187,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
667 qdbm |= WL_TXPWR_OVERRIDE;
670 - bphy_err(wiphy, "Unsupported type %d\n", type);
671 + bphy_err(drvr, "Unsupported type %d\n", type);
675 @@ -2182,11 +2195,11 @@ brcmf_cfg80211_set_tx_power(struct wiphy
676 disable = WL_RADIO_SW_DISABLE << 16;
677 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_RADIO, disable);
679 - bphy_err(wiphy, "WLC_SET_RADIO error (%d)\n", err);
680 + bphy_err(drvr, "WLC_SET_RADIO error (%d)\n", err);
682 err = brcmf_fil_iovar_int_set(ifp, "qtxpower", qdbm);
684 - bphy_err(wiphy, "qtxpower error (%d)\n", err);
685 + bphy_err(drvr, "qtxpower error (%d)\n", err);
688 brcmf_dbg(TRACE, "Exit %d (qdbm)\n", qdbm & ~WL_TXPWR_OVERRIDE);
689 @@ -2197,7 +2210,9 @@ static s32
690 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
693 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
694 struct brcmf_cfg80211_vif *vif = wdev_to_vif(wdev);
695 + struct brcmf_pub *drvr = cfg->pub;
699 @@ -2207,7 +2222,7 @@ brcmf_cfg80211_get_tx_power(struct wiphy
701 err = brcmf_fil_iovar_int_get(vif->ifp, "qtxpower", &qdbm);
703 - bphy_err(wiphy, "error (%d)\n", err);
704 + bphy_err(drvr, "error (%d)\n", err);
707 *dbm = (qdbm & ~WL_TXPWR_OVERRIDE) / 4;
708 @@ -2222,6 +2237,7 @@ brcmf_cfg80211_config_default_key(struct
709 u8 key_idx, bool unicast, bool multicast)
711 struct brcmf_if *ifp = netdev_priv(ndev);
712 + struct brcmf_pub *drvr = ifp->drvr;
716 @@ -2233,7 +2249,7 @@ brcmf_cfg80211_config_default_key(struct
718 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
720 - bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
721 + bphy_err(drvr, "WLC_GET_WSEC error (%d)\n", err);
725 @@ -2243,7 +2259,7 @@ brcmf_cfg80211_config_default_key(struct
726 err = brcmf_fil_cmd_int_set(ifp,
727 BRCMF_C_SET_KEY_PRIMARY, index);
729 - bphy_err(wiphy, "error (%d)\n", err);
730 + bphy_err(drvr, "error (%d)\n", err);
733 brcmf_dbg(TRACE, "Exit\n");
734 @@ -2292,7 +2308,9 @@ brcmf_cfg80211_add_key(struct wiphy *wip
735 u8 key_idx, bool pairwise, const u8 *mac_addr,
736 struct key_params *params)
738 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
739 struct brcmf_if *ifp = netdev_priv(ndev);
740 + struct brcmf_pub *drvr = cfg->pub;
741 struct brcmf_wsec_key *key;
744 @@ -2307,7 +2325,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
746 if (key_idx >= BRCMF_MAX_DEFAULT_KEYS) {
747 /* we ignore this key index in this case */
748 - bphy_err(wiphy, "invalid key index (%d)\n", key_idx);
749 + bphy_err(drvr, "invalid key index (%d)\n", key_idx);
753 @@ -2316,7 +2334,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
756 if (params->key_len > sizeof(key->data)) {
757 - bphy_err(wiphy, "Too long key length (%u)\n", params->key_len);
758 + bphy_err(drvr, "Too long key length (%u)\n", params->key_len);
762 @@ -2370,7 +2388,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
763 brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_CCMP\n");
766 - bphy_err(wiphy, "Invalid cipher (0x%x)\n", params->cipher);
767 + bphy_err(drvr, "Invalid cipher (0x%x)\n", params->cipher);
771 @@ -2381,13 +2399,13 @@ brcmf_cfg80211_add_key(struct wiphy *wip
773 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
775 - bphy_err(wiphy, "get wsec error (%d)\n", err);
776 + bphy_err(drvr, "get wsec error (%d)\n", err);
780 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
782 - bphy_err(wiphy, "set wsec error (%d)\n", err);
783 + bphy_err(drvr, "set wsec error (%d)\n", err);
787 @@ -2402,9 +2420,11 @@ brcmf_cfg80211_get_key(struct wiphy *wip
788 void (*callback)(void *cookie,
789 struct key_params *params))
791 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
792 struct key_params params;
793 struct brcmf_if *ifp = netdev_priv(ndev);
794 struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
795 + struct brcmf_pub *drvr = cfg->pub;
796 struct brcmf_cfg80211_security *sec;
799 @@ -2418,7 +2438,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
801 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
803 - bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
804 + bphy_err(drvr, "WLC_GET_WSEC error (%d)\n", err);
805 /* Ignore this error, may happen during DISASSOC */
808 @@ -2439,7 +2459,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
809 params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
810 brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n");
812 - bphy_err(wiphy, "Invalid algo (0x%x)\n", wsec);
813 + bphy_err(drvr, "Invalid algo (0x%x)\n", wsec);
817 @@ -2469,7 +2489,7 @@ brcmf_cfg80211_config_default_mgmt_key(s
819 brcmf_cfg80211_reconfigure_wep(struct brcmf_if *ifp)
821 - struct wiphy *wiphy = ifp->drvr->wiphy;
822 + struct brcmf_pub *drvr = ifp->drvr;
825 struct brcmf_wsec_key *key;
826 @@ -2486,18 +2506,18 @@ brcmf_cfg80211_reconfigure_wep(struct br
828 err = send_key_to_dongle(ifp, key);
830 - bphy_err(wiphy, "Setting WEP key failed (%d)\n", err);
831 + bphy_err(drvr, "Setting WEP key failed (%d)\n", err);
834 err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
836 - bphy_err(wiphy, "get wsec error (%d)\n", err);
837 + bphy_err(drvr, "get wsec error (%d)\n", err);
841 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
843 - bphy_err(wiphy, "set wsec error (%d)\n", err);
844 + bphy_err(drvr, "set wsec error (%d)\n", err);
847 static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si)
848 @@ -2523,7 +2543,7 @@ static void brcmf_convert_sta_flags(u32
850 static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si)
852 - struct wiphy *wiphy = ifp->drvr->wiphy;
853 + struct brcmf_pub *drvr = ifp->drvr;
856 struct brcmf_bss_info_le bss_le;
857 @@ -2539,7 +2559,7 @@ static void brcmf_fill_bss_param(struct
858 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf,
861 - bphy_err(wiphy, "Failed to get bss info (%d)\n", err);
862 + bphy_err(drvr, "Failed to get bss info (%d)\n", err);
865 si->filled |= BIT(NL80211_STA_INFO_BSS_PARAM);
866 @@ -2561,7 +2581,7 @@ static s32
867 brcmf_cfg80211_get_station_ibss(struct brcmf_if *ifp,
868 struct station_info *sinfo)
870 - struct wiphy *wiphy = ifp->drvr->wiphy;
871 + struct brcmf_pub *drvr = ifp->drvr;
872 struct brcmf_scb_val_le scbval;
873 struct brcmf_pktcnt_le pktcnt;
875 @@ -2571,7 +2591,7 @@ brcmf_cfg80211_get_station_ibss(struct b
876 /* Get the current tx rate */
877 err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate);
879 - bphy_err(wiphy, "BRCMF_C_GET_RATE error (%d)\n", err);
880 + bphy_err(drvr, "BRCMF_C_GET_RATE error (%d)\n", err);
883 sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
884 @@ -2581,7 +2601,7 @@ brcmf_cfg80211_get_station_ibss(struct b
885 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, &scbval,
888 - bphy_err(wiphy, "BRCMF_C_GET_RSSI error (%d)\n", err);
889 + bphy_err(drvr, "BRCMF_C_GET_RSSI error (%d)\n", err);
892 rssi = le32_to_cpu(scbval.val);
893 @@ -2591,7 +2611,7 @@ brcmf_cfg80211_get_station_ibss(struct b
894 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_GET_PKTCNTS, &pktcnt,
897 - bphy_err(wiphy, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
898 + bphy_err(drvr, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
901 sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS) |
902 @@ -2610,7 +2630,9 @@ static s32
903 brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
904 const u8 *mac, struct station_info *sinfo)
906 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
907 struct brcmf_if *ifp = netdev_priv(ndev);
908 + struct brcmf_pub *drvr = cfg->pub;
909 struct brcmf_scb_val_le scb_val;
911 struct brcmf_sta_info_le sta_info_le;
912 @@ -2639,7 +2661,7 @@ brcmf_cfg80211_get_station(struct wiphy
914 sizeof(sta_info_le));
916 - bphy_err(wiphy, "GET STA INFO failed, %d\n", err);
917 + bphy_err(drvr, "GET STA INFO failed, %d\n", err);
921 @@ -2708,7 +2730,7 @@ brcmf_cfg80211_get_station(struct wiphy
922 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
923 &scb_val, sizeof(scb_val));
925 - bphy_err(wiphy, "Could not get rssi (%d)\n",
926 + bphy_err(drvr, "Could not get rssi (%d)\n",
930 @@ -2730,6 +2752,7 @@ brcmf_cfg80211_dump_station(struct wiphy
932 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
933 struct brcmf_if *ifp = netdev_priv(ndev);
934 + struct brcmf_pub *drvr = cfg->pub;
937 brcmf_dbg(TRACE, "Enter, idx %d\n", idx);
938 @@ -2740,7 +2763,7 @@ brcmf_cfg80211_dump_station(struct wiphy
940 sizeof(cfg->assoclist));
942 - bphy_err(wiphy, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
943 + bphy_err(drvr, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
945 cfg->assoclist.count = 0;
947 @@ -2761,6 +2784,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip
949 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
950 struct brcmf_if *ifp = netdev_priv(ndev);
951 + struct brcmf_pub *drvr = cfg->pub;
953 brcmf_dbg(TRACE, "Enter\n");
955 @@ -2789,9 +2813,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip
956 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm);
959 - bphy_err(wiphy, "net_device is not ready yet\n");
960 + bphy_err(drvr, "net_device is not ready yet\n");
962 - bphy_err(wiphy, "error (%d)\n", err);
963 + bphy_err(drvr, "error (%d)\n", err);
966 brcmf_dbg(TRACE, "Exit\n");
967 @@ -2802,6 +2826,7 @@ static s32 brcmf_inform_single_bss(struc
968 struct brcmf_bss_info_le *bi)
970 struct wiphy *wiphy = cfg_to_wiphy(cfg);
971 + struct brcmf_pub *drvr = cfg->pub;
972 struct ieee80211_channel *notify_channel;
973 struct cfg80211_bss *bss;
974 struct ieee80211_supported_band *band;
975 @@ -2815,7 +2840,7 @@ static s32 brcmf_inform_single_bss(struc
978 if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) {
979 - bphy_err(wiphy, "Bss info is larger than buffer. Discarding\n");
980 + bphy_err(drvr, "Bss info is larger than buffer. Discarding\n");
984 @@ -2873,7 +2898,7 @@ next_bss_le(struct brcmf_scan_results *l
986 static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg)
988 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
989 + struct brcmf_pub *drvr = cfg->pub;
990 struct brcmf_scan_results *bss_list;
991 struct brcmf_bss_info_le *bi = NULL; /* must be initialized */
993 @@ -2882,7 +2907,7 @@ static s32 brcmf_inform_bss(struct brcmf
994 bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
995 if (bss_list->count != 0 &&
996 bss_list->version != BRCMF_BSS_INFO_VERSION) {
997 - bphy_err(wiphy, "Version %d != WL_BSS_INFO_VERSION\n",
998 + bphy_err(drvr, "Version %d != WL_BSS_INFO_VERSION\n",
1002 @@ -2900,6 +2925,7 @@ static s32 brcmf_inform_ibss(struct brcm
1003 struct net_device *ndev, const u8 *bssid)
1005 struct wiphy *wiphy = cfg_to_wiphy(cfg);
1006 + struct brcmf_pub *drvr = cfg->pub;
1007 struct ieee80211_channel *notify_channel;
1008 struct brcmf_bss_info_le *bi = NULL;
1009 struct ieee80211_supported_band *band;
1010 @@ -2927,7 +2953,7 @@ static s32 brcmf_inform_ibss(struct brcm
1011 err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO,
1012 buf, WL_BSS_INFO_MAX);
1014 - bphy_err(wiphy, "WLC_GET_BSS_INFO failed: %d\n", err);
1015 + bphy_err(drvr, "WLC_GET_BSS_INFO failed: %d\n", err);
1019 @@ -2981,7 +3007,7 @@ CleanUp:
1020 static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg,
1021 struct brcmf_if *ifp)
1023 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1024 + struct brcmf_pub *drvr = cfg->pub;
1025 struct brcmf_bss_info_le *bi;
1026 const struct brcmf_tlv *tim;
1027 u16 beacon_interval;
1028 @@ -2998,7 +3024,7 @@ static s32 brcmf_update_bss_info(struct
1029 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO,
1030 cfg->extra_buf, WL_EXTRA_BUF_MAX);
1032 - bphy_err(wiphy, "Could not get bss info %d\n", err);
1033 + bphy_err(drvr, "Could not get bss info %d\n", err);
1034 goto update_bss_info_out;
1037 @@ -3023,7 +3049,7 @@ static s32 brcmf_update_bss_info(struct
1039 err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var);
1041 - bphy_err(wiphy, "wl dtim_assoc failed (%d)\n", err);
1042 + bphy_err(drvr, "wl dtim_assoc failed (%d)\n", err);
1043 goto update_bss_info_out;
1045 dtim_period = (u8)var;
1046 @@ -3061,10 +3087,10 @@ static void brcmf_escan_timeout(unsigned
1048 struct brcmf_cfg80211_info *cfg =
1049 (struct brcmf_cfg80211_info *)data;
1050 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1051 + struct brcmf_pub *drvr = cfg->pub;
1053 if (cfg->internal_escan || cfg->scan_request) {
1054 - bphy_err(wiphy, "timer expired\n");
1055 + bphy_err(drvr, "timer expired\n");
1056 schedule_work(&cfg->escan_timeout_work);
1059 @@ -3112,8 +3138,8 @@ static s32
1060 brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
1061 const struct brcmf_event_msg *e, void *data)
1063 - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
1064 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1065 + struct brcmf_pub *drvr = ifp->drvr;
1066 + struct brcmf_cfg80211_info *cfg = drvr->config;
1068 struct brcmf_escan_result_le *escan_result_le;
1070 @@ -3130,7 +3156,7 @@ brcmf_cfg80211_escan_handler(struct brcm
1073 if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
1074 - bphy_err(wiphy, "scan not ready, bsscfgidx=%d\n",
1075 + bphy_err(drvr, "scan not ready, bsscfgidx=%d\n",
1079 @@ -3138,24 +3164,24 @@ brcmf_cfg80211_escan_handler(struct brcm
1080 if (status == BRCMF_E_STATUS_PARTIAL) {
1081 brcmf_dbg(SCAN, "ESCAN Partial result\n");
1082 if (e->datalen < sizeof(*escan_result_le)) {
1083 - bphy_err(wiphy, "invalid event data length\n");
1084 + bphy_err(drvr, "invalid event data length\n");
1087 escan_result_le = (struct brcmf_escan_result_le *) data;
1088 if (!escan_result_le) {
1089 - bphy_err(wiphy, "Invalid escan result (NULL pointer)\n");
1090 + bphy_err(drvr, "Invalid escan result (NULL pointer)\n");
1093 escan_buflen = le32_to_cpu(escan_result_le->buflen);
1094 if (escan_buflen > BRCMF_ESCAN_BUF_SIZE ||
1095 escan_buflen > e->datalen ||
1096 escan_buflen < sizeof(*escan_result_le)) {
1097 - bphy_err(wiphy, "Invalid escan buffer length: %d\n",
1098 + bphy_err(drvr, "Invalid escan buffer length: %d\n",
1102 if (le16_to_cpu(escan_result_le->bss_count) != 1) {
1103 - bphy_err(wiphy, "Invalid bss_count %d: ignoring\n",
1104 + bphy_err(drvr, "Invalid bss_count %d: ignoring\n",
1105 escan_result_le->bss_count);
1108 @@ -3171,7 +3197,7 @@ brcmf_cfg80211_escan_handler(struct brcm
1110 bi_length = le32_to_cpu(bss_info_le->length);
1111 if (bi_length != escan_buflen - WL_ESCAN_RESULTS_FIXED_SIZE) {
1112 - bphy_err(wiphy, "Ignoring invalid bss_info length: %d\n",
1113 + bphy_err(drvr, "Ignoring invalid bss_info length: %d\n",
1117 @@ -3180,7 +3206,7 @@ brcmf_cfg80211_escan_handler(struct brcm
1118 BIT(NL80211_IFTYPE_ADHOC))) {
1119 if (le16_to_cpu(bss_info_le->capability) &
1120 WLAN_CAPABILITY_IBSS) {
1121 - bphy_err(wiphy, "Ignoring IBSS result\n");
1122 + bphy_err(drvr, "Ignoring IBSS result\n");
1126 @@ -3188,7 +3214,7 @@ brcmf_cfg80211_escan_handler(struct brcm
1127 list = (struct brcmf_scan_results *)
1128 cfg->escan_info.escan_buf;
1129 if (bi_length > BRCMF_ESCAN_BUF_SIZE - list->buflen) {
1130 - bphy_err(wiphy, "Buffer is too small: ignoring\n");
1131 + bphy_err(drvr, "Buffer is too small: ignoring\n");
1135 @@ -3345,7 +3371,8 @@ static s32
1136 brcmf_notify_sched_scan_results(struct brcmf_if *ifp,
1137 const struct brcmf_event_msg *e, void *data)
1139 - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
1140 + struct brcmf_pub *drvr = ifp->drvr;
1141 + struct brcmf_cfg80211_info *cfg = drvr->config;
1142 struct brcmf_pno_net_info_le *netinfo, *netinfo_start;
1143 struct cfg80211_scan_request *request = NULL;
1144 struct wiphy *wiphy = cfg_to_wiphy(cfg);
1145 @@ -3377,14 +3404,14 @@ brcmf_notify_sched_scan_results(struct b
1146 WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE);
1147 brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count);
1148 if (!result_count) {
1149 - bphy_err(wiphy, "FALSE PNO Event. (pfn_count == 0)\n");
1150 + bphy_err(drvr, "FALSE PNO Event. (pfn_count == 0)\n");
1154 netinfo_start = brcmf_get_netinfo_array(pfn_result);
1155 datalen = e->datalen - ((void *)netinfo_start - (void *)pfn_result);
1156 if (datalen < result_count * sizeof(*netinfo)) {
1157 - bphy_err(wiphy, "insufficient event data\n");
1158 + bphy_err(drvr, "insufficient event data\n");
1162 @@ -3428,12 +3455,13 @@ brcmf_cfg80211_sched_scan_start(struct w
1164 struct brcmf_if *ifp = netdev_priv(ndev);
1165 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1166 + struct brcmf_pub *drvr = cfg->pub;
1168 brcmf_dbg(SCAN, "Enter n_match_sets:%d n_ssids:%d\n",
1169 req->n_match_sets, req->n_ssids);
1171 if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
1172 - bphy_err(wiphy, "Scanning suppressed: status (%lu)\n",
1173 + bphy_err(drvr, "Scanning suppressed: status (%lu)\n",
1177 @@ -3512,8 +3540,8 @@ static s32
1178 brcmf_wowl_nd_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e,
1181 - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
1182 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1183 + struct brcmf_pub *drvr = ifp->drvr;
1184 + struct brcmf_cfg80211_info *cfg = drvr->config;
1185 struct brcmf_pno_scanresults_le *pfn_result;
1186 struct brcmf_pno_net_info_le *netinfo;
1188 @@ -3532,7 +3560,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
1191 if (le32_to_cpu(pfn_result->count) < 1) {
1192 - bphy_err(wiphy, "Invalid result count, expected 1 (%d)\n",
1193 + bphy_err(drvr, "Invalid result count, expected 1 (%d)\n",
1194 le32_to_cpu(pfn_result->count));
1197 @@ -3560,6 +3588,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
1198 static void brcmf_report_wowl_wakeind(struct wiphy *wiphy, struct brcmf_if *ifp)
1200 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1201 + struct brcmf_pub *drvr = cfg->pub;
1202 struct brcmf_wowl_wakeind_le wake_ind_le;
1203 struct cfg80211_wowlan_wakeup wakeup_data;
1204 struct cfg80211_wowlan_wakeup *wakeup;
1205 @@ -3570,7 +3599,7 @@ static void brcmf_report_wowl_wakeind(st
1206 err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le,
1207 sizeof(wake_ind_le));
1209 - bphy_err(wiphy, "Get wowl_wakeind failed, err = %d\n", err);
1210 + bphy_err(drvr, "Get wowl_wakeind failed, err = %d\n", err);
1214 @@ -3611,7 +3640,7 @@ static void brcmf_report_wowl_wakeind(st
1215 cfg->wowl.nd_data_completed,
1216 BRCMF_ND_INFO_TIMEOUT);
1218 - bphy_err(wiphy, "No result for wowl net detect\n");
1219 + bphy_err(drvr, "No result for wowl net detect\n");
1221 wakeup_data.net_detect = cfg->wowl.nd_info;
1223 @@ -3800,6 +3829,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
1224 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1225 struct brcmf_if *ifp = netdev_priv(ndev);
1226 struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0];
1227 + struct brcmf_pub *drvr = cfg->pub;
1231 @@ -3819,7 +3849,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
1232 cfg->pmk_list.npmk = cpu_to_le32(npmk);
1235 - bphy_err(wiphy, "Too many PMKSA entries cached %d\n", npmk);
1236 + bphy_err(drvr, "Too many PMKSA entries cached %d\n", npmk);
1240 @@ -3842,6 +3872,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
1241 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1242 struct brcmf_if *ifp = netdev_priv(ndev);
1243 struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0];
1244 + struct brcmf_pub *drvr = cfg->pub;
1248 @@ -3865,7 +3896,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
1249 memset(&pmk[i], 0, sizeof(*pmk));
1250 cfg->pmk_list.npmk = cpu_to_le32(npmk - 1);
1252 - bphy_err(wiphy, "Cache entry not found\n");
1253 + bphy_err(drvr, "Cache entry not found\n");
1257 @@ -3897,25 +3928,25 @@ brcmf_cfg80211_flush_pmksa(struct wiphy
1259 static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
1261 - struct wiphy *wiphy = ifp->drvr->wiphy;
1262 + struct brcmf_pub *drvr = ifp->drvr;
1266 err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0);
1268 - bphy_err(wiphy, "auth error %d\n", err);
1269 + bphy_err(drvr, "auth error %d\n", err);
1273 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", 0);
1275 - bphy_err(wiphy, "wsec error %d\n", err);
1276 + bphy_err(drvr, "wsec error %d\n", err);
1279 /* set upper-layer auth */
1280 err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", WPA_AUTH_NONE);
1282 - bphy_err(wiphy, "wpa_auth error %d\n", err);
1283 + bphy_err(drvr, "wpa_auth error %d\n", err);
1287 @@ -3935,7 +3966,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1288 const struct brcmf_vs_tlv *wpa_ie,
1291 - struct wiphy *wiphy = ifp->drvr->wiphy;
1292 + struct brcmf_pub *drvr = ifp->drvr;
1293 u32 auth = 0; /* d11 open authentication */
1296 @@ -3966,13 +3997,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
1297 /* check for multicast cipher suite */
1298 if (offset + WPA_IE_MIN_OUI_LEN > len) {
1300 - bphy_err(wiphy, "no multicast cipher suite\n");
1301 + bphy_err(drvr, "no multicast cipher suite\n");
1305 if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
1307 - bphy_err(wiphy, "ivalid OUI\n");
1308 + bphy_err(drvr, "ivalid OUI\n");
1311 offset += TLV_OUI_LEN;
1312 @@ -3994,7 +4025,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1316 - bphy_err(wiphy, "Invalid multi cast cipher info\n");
1317 + bphy_err(drvr, "Invalid multi cast cipher info\n");
1321 @@ -4005,13 +4036,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
1322 /* Check for unicast suite(s) */
1323 if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
1325 - bphy_err(wiphy, "no unicast cipher suite\n");
1326 + bphy_err(drvr, "no unicast cipher suite\n");
1329 for (i = 0; i < count; i++) {
1330 if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
1332 - bphy_err(wiphy, "ivalid OUI\n");
1333 + bphy_err(drvr, "ivalid OUI\n");
1336 offset += TLV_OUI_LEN;
1337 @@ -4029,7 +4060,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1338 pval |= AES_ENABLED;
1341 - bphy_err(wiphy, "Invalid unicast security info\n");
1342 + bphy_err(drvr, "Invalid unicast security info\n");
1346 @@ -4039,13 +4070,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
1347 /* Check for auth key management suite(s) */
1348 if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
1350 - bphy_err(wiphy, "no auth key mgmt suite\n");
1351 + bphy_err(drvr, "no auth key mgmt suite\n");
1354 for (i = 0; i < count; i++) {
1355 if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
1357 - bphy_err(wiphy, "ivalid OUI\n");
1358 + bphy_err(drvr, "ivalid OUI\n");
1361 offset += TLV_OUI_LEN;
1362 @@ -4073,7 +4104,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1363 wpa_auth |= WPA2_AUTH_1X_SHA256;
1366 - bphy_err(wiphy, "Invalid key mgmt info\n");
1367 + bphy_err(drvr, "Invalid key mgmt info\n");
1371 @@ -4115,7 +4146,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1372 err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable",
1375 - bphy_err(wiphy, "wme_bss_disable error %d\n", err);
1376 + bphy_err(drvr, "wme_bss_disable error %d\n", err);
1380 @@ -4129,7 +4160,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
1382 WPA_IE_MIN_OUI_LEN);
1384 - bphy_err(wiphy, "bip error %d\n", err);
1385 + bphy_err(drvr, "bip error %d\n", err);
1389 @@ -4140,13 +4171,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
1391 err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth);
1393 - bphy_err(wiphy, "auth error %d\n", err);
1394 + bphy_err(drvr, "auth error %d\n", err);
1398 err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
1400 - bphy_err(wiphy, "wsec error %d\n", err);
1401 + bphy_err(drvr, "wsec error %d\n", err);
1404 /* Configure MFP, this needs to go after wsec otherwise the wsec command
1405 @@ -4155,14 +4186,14 @@ brcmf_configure_wpaie(struct brcmf_if *i
1406 if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) {
1407 err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp);
1409 - bphy_err(wiphy, "mfp error %d\n", err);
1410 + bphy_err(drvr, "mfp error %d\n", err);
1414 /* set upper-layer auth */
1415 err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth);
1417 - bphy_err(wiphy, "wpa_auth error %d\n", err);
1418 + bphy_err(drvr, "wpa_auth error %d\n", err);
1422 @@ -4248,8 +4279,8 @@ brcmf_vndr_ie(u8 *iebuf, s32 pktflag, u8
1423 s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag,
1424 const u8 *vndr_ie_buf, u32 vndr_ie_len)
1426 + struct brcmf_pub *drvr;
1427 struct brcmf_if *ifp;
1428 - struct wiphy *wiphy;
1429 struct vif_saved_ie *saved_ie;
1432 @@ -4270,7 +4301,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
1436 - wiphy = ifp->drvr->wiphy;
1438 saved_ie = &vif->saved_ie;
1440 brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx,
1441 @@ -4302,13 +4333,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
1445 - bphy_err(wiphy, "not suitable type\n");
1446 + bphy_err(drvr, "not suitable type\n");
1450 if (vndr_ie_len > mgmt_ie_buf_len) {
1452 - bphy_err(wiphy, "extra IE size too big\n");
1453 + bphy_err(drvr, "extra IE size too big\n");
1457 @@ -4369,7 +4400,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
1458 /* verify remained buf size before copy data */
1459 if (remained_buf_len < (vndrie_info->vndrie.len +
1460 VNDR_IE_VSIE_OFFSET)) {
1461 - bphy_err(wiphy, "no space in mgmt_ie_buf: len left %d",
1462 + bphy_err(drvr, "no space in mgmt_ie_buf: len left %d",
1466 @@ -4401,7 +4432,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
1467 err = brcmf_fil_bsscfg_data_set(ifp, "vndr_ie", iovar_ie_buf,
1470 - bphy_err(wiphy, "vndr ie set error : %d\n", err);
1471 + bphy_err(drvr, "vndr ie set error : %d\n", err);
1475 @@ -4429,14 +4460,14 @@ static s32
1476 brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif,
1477 struct cfg80211_beacon_data *beacon)
1479 - struct wiphy *wiphy = vif->ifp->drvr->wiphy;
1480 + struct brcmf_pub *drvr = vif->ifp->drvr;
1483 /* Set Beacon IEs to FW */
1484 err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_BEACON_FLAG,
1485 beacon->tail, beacon->tail_len);
1487 - bphy_err(wiphy, "Set Beacon IE Failed\n");
1488 + bphy_err(drvr, "Set Beacon IE Failed\n");
1491 brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n");
1492 @@ -4446,7 +4477,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg
1493 beacon->proberesp_ies,
1494 beacon->proberesp_ies_len);
1496 - bphy_err(wiphy, "Set Probe Resp IE Failed\n");
1497 + bphy_err(drvr, "Set Probe Resp IE Failed\n");
1499 brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n");
1501 @@ -4460,6 +4491,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1503 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1504 struct brcmf_if *ifp = netdev_priv(ndev);
1505 + struct brcmf_pub *drvr = cfg->pub;
1506 const struct brcmf_tlv *ssid_ie;
1507 const struct brcmf_tlv *country_ie;
1508 struct brcmf_ssid_le ssid_le;
1509 @@ -4555,7 +4587,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1510 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
1513 - bphy_err(wiphy, "Regulatory Set Error, %d\n",
1514 + bphy_err(drvr, "Regulatory Set Error, %d\n",
1518 @@ -4564,7 +4596,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1519 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD,
1520 settings->beacon_interval);
1522 - bphy_err(wiphy, "Beacon Interval Set Error, %d\n",
1523 + bphy_err(drvr, "Beacon Interval Set Error, %d\n",
1527 @@ -4573,7 +4605,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1528 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD,
1529 settings->dtim_period);
1531 - bphy_err(wiphy, "DTIM Interval Set Error, %d\n",
1532 + bphy_err(drvr, "DTIM Interval Set Error, %d\n",
1536 @@ -4584,7 +4616,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1537 !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB))) {
1538 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
1540 - bphy_err(wiphy, "BRCMF_C_DOWN error %d\n",
1541 + bphy_err(drvr, "BRCMF_C_DOWN error %d\n",
1545 @@ -4593,7 +4625,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1547 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1);
1549 - bphy_err(wiphy, "SET INFRA error %d\n", err);
1550 + bphy_err(drvr, "SET INFRA error %d\n", err);
1553 } else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) {
1554 @@ -4609,7 +4641,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1556 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
1558 - bphy_err(wiphy, "setting AP mode failed %d\n",
1559 + bphy_err(drvr, "setting AP mode failed %d\n",
1563 @@ -4619,14 +4651,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1565 err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
1567 - bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
1568 + bphy_err(drvr, "Set Channel failed: chspec=%d, %d\n",
1573 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
1575 - bphy_err(wiphy, "BRCMF_C_UP error (%d)\n", err);
1576 + bphy_err(drvr, "BRCMF_C_UP error (%d)\n", err);
1579 /* On DOWN the firmware removes the WEP keys, reconfigure
1580 @@ -4641,14 +4673,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1581 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
1582 &join_params, sizeof(join_params));
1584 - bphy_err(wiphy, "SET SSID error (%d)\n", err);
1585 + bphy_err(drvr, "SET SSID error (%d)\n", err);
1589 if (settings->hidden_ssid) {
1590 err = brcmf_fil_iovar_int_set(ifp, "closednet", 1);
1592 - bphy_err(wiphy, "closednet error (%d)\n", err);
1593 + bphy_err(drvr, "closednet error (%d)\n", err);
1597 @@ -4657,14 +4689,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1598 } else if (dev_role == NL80211_IFTYPE_P2P_GO) {
1599 err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
1601 - bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
1602 + bphy_err(drvr, "Set Channel failed: chspec=%d, %d\n",
1606 err = brcmf_fil_bsscfg_data_set(ifp, "ssid", &ssid_le,
1609 - bphy_err(wiphy, "setting ssid failed %d\n", err);
1610 + bphy_err(drvr, "setting ssid failed %d\n", err);
1613 bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
1614 @@ -4672,7 +4704,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
1615 err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
1616 sizeof(bss_enable));
1618 - bphy_err(wiphy, "bss_enable config failed %d\n", err);
1619 + bphy_err(drvr, "bss_enable config failed %d\n", err);
1623 @@ -4695,7 +4727,9 @@ exit:
1625 static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
1627 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1628 struct brcmf_if *ifp = netdev_priv(ndev);
1629 + struct brcmf_pub *drvr = cfg->pub;
1631 struct brcmf_fil_bss_enable_le bss_enable;
1632 struct brcmf_join_params join_params;
1633 @@ -4720,13 +4754,13 @@ static int brcmf_cfg80211_stop_ap(struct
1634 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
1635 &join_params, sizeof(join_params));
1637 - bphy_err(wiphy, "SET SSID error (%d)\n", err);
1638 + bphy_err(drvr, "SET SSID error (%d)\n", err);
1639 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
1641 - bphy_err(wiphy, "BRCMF_C_DOWN error %d\n", err);
1642 + bphy_err(drvr, "BRCMF_C_DOWN error %d\n", err);
1643 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
1645 - bphy_err(wiphy, "setting AP mode failed %d\n", err);
1646 + bphy_err(drvr, "setting AP mode failed %d\n", err);
1647 if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
1648 brcmf_fil_iovar_int_set(ifp, "mbss", 0);
1649 brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
1650 @@ -4734,7 +4768,7 @@ static int brcmf_cfg80211_stop_ap(struct
1651 /* Bring device back up so it can be used again */
1652 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
1654 - bphy_err(wiphy, "BRCMF_C_UP error %d\n", err);
1655 + bphy_err(drvr, "BRCMF_C_UP error %d\n", err);
1657 brcmf_vif_clear_mgmt_ies(ifp->vif);
1659 @@ -4743,7 +4777,7 @@ static int brcmf_cfg80211_stop_ap(struct
1660 err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
1661 sizeof(bss_enable));
1663 - bphy_err(wiphy, "bss_enable config failed %d\n", err);
1664 + bphy_err(drvr, "bss_enable config failed %d\n", err);
1666 brcmf_set_mpc(ifp, 1);
1667 brcmf_configure_arp_nd_offload(ifp, true);
1668 @@ -4772,6 +4806,7 @@ brcmf_cfg80211_del_station(struct wiphy
1669 struct station_del_parameters *params)
1671 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1672 + struct brcmf_pub *drvr = cfg->pub;
1673 struct brcmf_scb_val_le scbval;
1674 struct brcmf_if *ifp = netdev_priv(ndev);
1676 @@ -4791,7 +4826,7 @@ brcmf_cfg80211_del_station(struct wiphy
1677 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON,
1678 &scbval, sizeof(scbval));
1680 - bphy_err(wiphy, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
1681 + bphy_err(drvr, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
1684 brcmf_dbg(TRACE, "Exit\n");
1685 @@ -4802,7 +4837,9 @@ static int
1686 brcmf_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev,
1687 const u8 *mac, struct station_parameters *params)
1689 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1690 struct brcmf_if *ifp = netdev_priv(ndev);
1691 + struct brcmf_pub *drvr = cfg->pub;
1694 brcmf_dbg(TRACE, "Enter, MAC %pM, mask 0x%04x set 0x%04x\n", mac,
1695 @@ -4822,7 +4859,7 @@ brcmf_cfg80211_change_station(struct wip
1696 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SCB_DEAUTHORIZE,
1697 (void *)mac, ETH_ALEN);
1699 - bphy_err(wiphy, "Setting SCB (de-)authorize failed, %d\n", err);
1700 + bphy_err(drvr, "Setting SCB (de-)authorize failed, %d\n", err);
1704 @@ -4852,6 +4889,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
1706 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1707 struct ieee80211_channel *chan = params->chan;
1708 + struct brcmf_pub *drvr = cfg->pub;
1709 const u8 *buf = params->buf;
1710 size_t len = params->len;
1711 const struct ieee80211_mgmt *mgmt;
1712 @@ -4872,7 +4910,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
1713 mgmt = (const struct ieee80211_mgmt *)buf;
1715 if (!ieee80211_is_mgmt(mgmt->frame_control)) {
1716 - bphy_err(wiphy, "Driver only allows MGMT packet type\n");
1717 + bphy_err(drvr, "Driver only allows MGMT packet type\n");
1721 @@ -4903,13 +4941,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
1723 } else if (ieee80211_is_action(mgmt->frame_control)) {
1724 if (len > BRCMF_FIL_ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN) {
1725 - bphy_err(wiphy, "invalid action frame length\n");
1726 + bphy_err(drvr, "invalid action frame length\n");
1730 af_params = kzalloc(sizeof(*af_params), GFP_KERNEL);
1731 if (af_params == NULL) {
1732 - bphy_err(wiphy, "unable to allocate frame\n");
1733 + bphy_err(drvr, "unable to allocate frame\n");
1737 @@ -4960,6 +4998,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
1740 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1741 + struct brcmf_pub *drvr = cfg->pub;
1742 struct brcmf_cfg80211_vif *vif;
1745 @@ -4967,7 +5006,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
1747 vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
1749 - bphy_err(wiphy, "No p2p device available for probe response\n");
1750 + bphy_err(drvr, "No p2p device available for probe response\n");
1754 @@ -4982,6 +5021,7 @@ static int brcmf_cfg80211_get_channel(st
1756 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1757 struct net_device *ndev = wdev->netdev;
1758 + struct brcmf_pub *drvr = cfg->pub;
1759 struct brcmf_if *ifp;
1760 struct brcmu_chan ch;
1761 enum nl80211_band band = 0;
1762 @@ -4995,7 +5035,7 @@ static int brcmf_cfg80211_get_channel(st
1764 err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
1766 - bphy_err(wiphy, "chanspec failed (%d)\n", err);
1767 + bphy_err(drvr, "chanspec failed (%d)\n", err);
1771 @@ -5117,6 +5157,8 @@ static int brcmf_cfg80211_tdls_oper(stru
1772 struct net_device *ndev, const u8 *peer,
1773 enum nl80211_tdls_operation oper)
1775 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1776 + struct brcmf_pub *drvr = cfg->pub;
1777 struct brcmf_if *ifp;
1778 struct brcmf_tdls_iovar_le info;
1780 @@ -5134,7 +5176,7 @@ static int brcmf_cfg80211_tdls_oper(stru
1781 ret = brcmf_fil_iovar_data_set(ifp, "tdls_endpoint",
1782 &info, sizeof(info));
1784 - bphy_err(wiphy, "tdls_endpoint iovar failed: ret=%d\n", ret);
1785 + bphy_err(drvr, "tdls_endpoint iovar failed: ret=%d\n", ret);
1789 @@ -5145,6 +5187,8 @@ brcmf_cfg80211_update_conn_params(struct
1790 struct cfg80211_connect_params *sme,
1793 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1794 + struct brcmf_pub *drvr = cfg->pub;
1795 struct brcmf_if *ifp;
1798 @@ -5155,7 +5199,7 @@ brcmf_cfg80211_update_conn_params(struct
1799 err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
1800 sme->ie, sme->ie_len);
1802 - bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
1803 + bphy_err(drvr, "Set Assoc REQ IE Failed\n");
1805 brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
1807 @@ -5167,6 +5211,8 @@ static int
1808 brcmf_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *ndev,
1809 struct cfg80211_gtk_rekey_data *gtk)
1811 + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
1812 + struct brcmf_pub *drvr = cfg->pub;
1813 struct brcmf_if *ifp = netdev_priv(ndev);
1814 struct brcmf_gtk_keyinfo_le gtk_le;
1816 @@ -5181,7 +5227,7 @@ brcmf_cfg80211_set_rekey_data(struct wip
1817 ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", >k_le,
1820 - bphy_err(wiphy, "gtk_key_info iovar failed: ret=%d\n", ret);
1821 + bphy_err(drvr, "gtk_key_info iovar failed: ret=%d\n", ret);
1825 @@ -5359,7 +5405,7 @@ static void brcmf_clear_assoc_ies(struct
1826 static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg,
1827 struct brcmf_if *ifp)
1829 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1830 + struct brcmf_pub *drvr = cfg->pub;
1831 struct brcmf_cfg80211_assoc_ielen_le *assoc_info;
1832 struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg);
1834 @@ -5371,7 +5417,7 @@ static s32 brcmf_get_assoc_ies(struct br
1835 err = brcmf_fil_iovar_data_get(ifp, "assoc_info",
1836 cfg->extra_buf, WL_ASSOC_INFO_MAX);
1838 - bphy_err(wiphy, "could not get assoc info (%d)\n", err);
1839 + bphy_err(drvr, "could not get assoc info (%d)\n", err);
1843 @@ -5383,7 +5429,7 @@ static s32 brcmf_get_assoc_ies(struct br
1847 - bphy_err(wiphy, "could not get assoc req (%d)\n", err);
1848 + bphy_err(drvr, "could not get assoc req (%d)\n", err);
1851 conn_info->req_ie_len = req_len;
1852 @@ -5399,7 +5445,7 @@ static s32 brcmf_get_assoc_ies(struct br
1856 - bphy_err(wiphy, "could not get assoc resp (%d)\n", err);
1857 + bphy_err(drvr, "could not get assoc resp (%d)\n", err);
1860 conn_info->resp_ie_len = resp_len;
1861 @@ -5518,7 +5564,7 @@ brcmf_notify_connect_status_ap(struct br
1862 struct net_device *ndev,
1863 const struct brcmf_event_msg *e, void *data)
1865 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1866 + struct brcmf_pub *drvr = cfg->pub;
1867 static int generation;
1868 u32 event = e->event_code;
1869 u32 reason = e->reason;
1870 @@ -5537,7 +5583,7 @@ brcmf_notify_connect_status_ap(struct br
1871 (reason == BRCMF_E_STATUS_SUCCESS)) {
1872 memset(&sinfo, 0, sizeof(sinfo));
1874 - bphy_err(wiphy, "No IEs present in ASSOC/REASSOC_IND\n");
1875 + bphy_err(drvr, "No IEs present in ASSOC/REASSOC_IND\n");
1878 sinfo.assoc_req_ies = data;
1879 @@ -5818,7 +5864,7 @@ static void init_vif_event(struct brcmf_
1881 static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
1883 - struct wiphy *wiphy = ifp->drvr->wiphy;
1884 + struct brcmf_pub *drvr = ifp->drvr;
1887 __le32 roamtrigger[2];
1888 @@ -5831,7 +5877,7 @@ static s32 brcmf_dongle_roam(struct brcm
1889 bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON;
1890 err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout);
1892 - bphy_err(wiphy, "bcn_timeout error (%d)\n", err);
1893 + bphy_err(drvr, "bcn_timeout error (%d)\n", err);
1894 goto roam_setup_done;
1897 @@ -5843,7 +5889,7 @@ static s32 brcmf_dongle_roam(struct brcm
1898 err = brcmf_fil_iovar_int_set(ifp, "roam_off",
1899 ifp->drvr->settings->roamoff);
1901 - bphy_err(wiphy, "roam_off error (%d)\n", err);
1902 + bphy_err(drvr, "roam_off error (%d)\n", err);
1903 goto roam_setup_done;
1906 @@ -5852,7 +5898,7 @@ static s32 brcmf_dongle_roam(struct brcm
1907 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER,
1908 (void *)roamtrigger, sizeof(roamtrigger));
1910 - bphy_err(wiphy, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
1911 + bphy_err(drvr, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
1912 goto roam_setup_done;
1915 @@ -5861,7 +5907,7 @@ static s32 brcmf_dongle_roam(struct brcm
1916 err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA,
1917 (void *)roam_delta, sizeof(roam_delta));
1919 - bphy_err(wiphy, "WLC_SET_ROAM_DELTA error (%d)\n", err);
1920 + bphy_err(drvr, "WLC_SET_ROAM_DELTA error (%d)\n", err);
1921 goto roam_setup_done;
1924 @@ -5872,26 +5918,26 @@ roam_setup_done:
1926 brcmf_dongle_scantime(struct brcmf_if *ifp)
1928 - struct wiphy *wiphy = ifp->drvr->wiphy;
1929 + struct brcmf_pub *drvr = ifp->drvr;
1932 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME,
1933 BRCMF_SCAN_CHANNEL_TIME);
1935 - bphy_err(wiphy, "Scan assoc time error (%d)\n", err);
1936 + bphy_err(drvr, "Scan assoc time error (%d)\n", err);
1937 goto dongle_scantime_out;
1939 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME,
1940 BRCMF_SCAN_UNASSOC_TIME);
1942 - bphy_err(wiphy, "Scan unassoc time error (%d)\n", err);
1943 + bphy_err(drvr, "Scan unassoc time error (%d)\n", err);
1944 goto dongle_scantime_out;
1947 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_PASSIVE_TIME,
1948 BRCMF_SCAN_PASSIVE_TIME);
1950 - bphy_err(wiphy, "Scan passive time error (%d)\n", err);
1951 + bphy_err(drvr, "Scan passive time error (%d)\n", err);
1952 goto dongle_scantime_out;
1955 @@ -5924,7 +5970,8 @@ static int brcmf_construct_chaninfo(stru
1958 struct wiphy *wiphy = cfg_to_wiphy(cfg);
1959 - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
1960 + struct brcmf_pub *drvr = cfg->pub;
1961 + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
1962 struct ieee80211_supported_band *band;
1963 struct ieee80211_channel *channel;
1964 struct brcmf_chanspec_list *list;
1965 @@ -5945,7 +5992,7 @@ static int brcmf_construct_chaninfo(stru
1966 err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
1969 - bphy_err(wiphy, "get chanspecs error (%d)\n", err);
1970 + bphy_err(drvr, "get chanspecs error (%d)\n", err);
1974 @@ -5968,7 +6015,7 @@ static int brcmf_construct_chaninfo(stru
1975 } else if (ch.band == BRCMU_CHAN_BAND_5G) {
1976 band = wiphy->bands[NL80211_BAND_5GHZ];
1978 - bphy_err(wiphy, "Invalid channel Spec. 0x%x.\n",
1979 + bphy_err(drvr, "Invalid channel Spec. 0x%x.\n",
1983 @@ -5992,7 +6039,7 @@ static int brcmf_construct_chaninfo(stru
1984 /* It seems firmware supports some channel we never
1985 * considered. Something new in IEEE standard?
1987 - bphy_err(wiphy, "Ignoring unexpected firmware channel %d\n",
1988 + bphy_err(drvr, "Ignoring unexpected firmware channel %d\n",
1992 @@ -6049,8 +6096,8 @@ fail_pbuf:
1994 static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
1996 - struct wiphy *wiphy = cfg_to_wiphy(cfg);
1997 - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
1998 + struct brcmf_pub *drvr = cfg->pub;
1999 + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
2000 struct ieee80211_supported_band *band;
2001 struct brcmf_fil_bwcap_le band_bwcap;
2002 struct brcmf_chanspec_list *list;
2003 @@ -6096,7 +6143,7 @@ static int brcmf_enable_bw40_2g(struct b
2004 err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
2007 - bphy_err(wiphy, "get chanspecs error (%d)\n", err);
2008 + bphy_err(drvr, "get chanspecs error (%d)\n", err);
2012 @@ -6127,7 +6174,7 @@ static int brcmf_enable_bw40_2g(struct b
2014 static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[])
2016 - struct wiphy *wiphy = ifp->drvr->wiphy;
2017 + struct brcmf_pub *drvr = ifp->drvr;
2018 u32 band, mimo_bwcap;
2021 @@ -6163,7 +6210,7 @@ static void brcmf_get_bwcap(struct brcmf
2022 bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT;
2025 - bphy_err(wiphy, "invalid mimo_bw_cap value\n");
2026 + bphy_err(drvr, "invalid mimo_bw_cap value\n");
2030 @@ -6238,7 +6285,8 @@ static void brcmf_update_vht_cap(struct
2032 static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
2034 - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
2035 + struct brcmf_pub *drvr = cfg->pub;
2036 + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
2037 struct wiphy *wiphy = cfg_to_wiphy(cfg);
2040 @@ -6255,7 +6303,7 @@ static int brcmf_setup_wiphybands(struct
2041 (void)brcmf_fil_iovar_int_get(ifp, "vhtmode", &vhtmode);
2042 err = brcmf_fil_iovar_int_get(ifp, "nmode", &nmode);
2044 - bphy_err(wiphy, "nmode error (%d)\n", err);
2045 + bphy_err(drvr, "nmode error (%d)\n", err);
2047 brcmf_get_bwcap(ifp, bw_cap);
2049 @@ -6265,7 +6313,7 @@ static int brcmf_setup_wiphybands(struct
2051 err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain);
2053 - bphy_err(wiphy, "rxchain error (%d)\n", err);
2054 + bphy_err(drvr, "rxchain error (%d)\n", err);
2057 for (nchain = 0; rxchain; nchain++)
2058 @@ -6275,7 +6323,7 @@ static int brcmf_setup_wiphybands(struct
2060 err = brcmf_construct_chaninfo(cfg, bw_cap);
2062 - bphy_err(wiphy, "brcmf_construct_chaninfo failed (%d)\n", err);
2063 + bphy_err(drvr, "brcmf_construct_chaninfo failed (%d)\n", err);
2067 @@ -6492,12 +6540,13 @@ static void brcmf_wiphy_wowl_params(stru
2070 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
2071 + struct brcmf_pub *drvr = cfg->pub;
2072 struct wiphy_wowlan_support *wowl;
2074 wowl = kmemdup(&brcmf_wowlan_support, sizeof(brcmf_wowlan_support),
2077 - bphy_err(wiphy, "only support basic wowlan features\n");
2078 + bphy_err(drvr, "only support basic wowlan features\n");
2079 wiphy->wowlan = &brcmf_wowlan_support;
2082 @@ -6585,7 +6634,7 @@ static int brcmf_setup_wiphy(struct wiph
2083 err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist,
2086 - bphy_err(wiphy, "could not obtain band info: err=%d\n", err);
2087 + bphy_err(drvr, "could not obtain band info: err=%d\n", err);
2090 /* first entry in bandlist is number of bands */
2091 @@ -6846,6 +6895,7 @@ static void brcmf_cfg80211_reg_notifier(
2093 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
2094 struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
2095 + struct brcmf_pub *drvr = cfg->pub;
2096 struct brcmf_fil_country_le ccreq;
2099 @@ -6857,7 +6907,7 @@ static void brcmf_cfg80211_reg_notifier(
2100 /* ignore non-ISO3166 country codes */
2101 for (i = 0; i < 2; i++)
2102 if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
2103 - bphy_err(wiphy, "not a ISO3166 code (0x%02x 0x%02x)\n",
2104 + bphy_err(drvr, "not a ISO3166 code (0x%02x 0x%02x)\n",
2105 req->alpha2[0], req->alpha2[1]);
2108 @@ -6867,7 +6917,7 @@ static void brcmf_cfg80211_reg_notifier(
2110 err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
2112 - bphy_err(wiphy, "Country code iovar returned err = %d\n", err);
2113 + bphy_err(drvr, "Country code iovar returned err = %d\n", err);
2117 @@ -6877,7 +6927,7 @@ static void brcmf_cfg80211_reg_notifier(
2119 err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq));
2121 - bphy_err(wiphy, "Firmware rejected country setting\n");
2122 + bphy_err(drvr, "Firmware rejected country setting\n");
2125 brcmf_setup_wiphybands(cfg);
2126 @@ -6923,13 +6973,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2130 - bphy_err(wiphy, "ndev is invalid\n");
2131 + bphy_err(drvr, "ndev is invalid\n");
2135 cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
2137 - bphy_err(wiphy, "Could not allocate wiphy device\n");
2138 + bphy_err(drvr, "Could not allocate wiphy device\n");
2142 @@ -6950,7 +7000,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2144 err = wl_init_priv(cfg);
2146 - bphy_err(wiphy, "Failed to init iwm_priv (%d)\n", err);
2147 + bphy_err(drvr, "Failed to init iwm_priv (%d)\n", err);
2148 brcmf_free_vif(vif);
2151 @@ -6959,7 +7009,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2152 /* determine d11 io type before wiphy setup */
2153 err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_VERSION, &io_type);
2155 - bphy_err(wiphy, "Failed to get D11 version (%d)\n", err);
2156 + bphy_err(drvr, "Failed to get D11 version (%d)\n", err);
2159 cfg->d11inf.io_type = (u8)io_type;
2160 @@ -6993,13 +7043,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2162 err = wiphy_register(wiphy);
2164 - bphy_err(wiphy, "Could not register wiphy device (%d)\n", err);
2165 + bphy_err(drvr, "Could not register wiphy device (%d)\n", err);
2169 err = brcmf_setup_wiphybands(cfg);
2171 - bphy_err(wiphy, "Setting wiphy bands failed (%d)\n", err);
2172 + bphy_err(drvr, "Setting wiphy bands failed (%d)\n", err);
2173 goto wiphy_unreg_out;
2176 @@ -7017,18 +7067,18 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2178 err = brcmf_fweh_activate_events(ifp);
2180 - bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
2181 + bphy_err(drvr, "FWEH activation failed (%d)\n", err);
2182 goto wiphy_unreg_out;
2185 err = brcmf_p2p_attach(cfg, p2pdev_forced);
2187 - bphy_err(wiphy, "P2P initialisation failed (%d)\n", err);
2188 + bphy_err(drvr, "P2P initialisation failed (%d)\n", err);
2189 goto wiphy_unreg_out;
2191 err = brcmf_btcoex_attach(cfg);
2193 - bphy_err(wiphy, "BT-coex initialisation failed (%d)\n", err);
2194 + bphy_err(drvr, "BT-coex initialisation failed (%d)\n", err);
2195 brcmf_p2p_detach(&cfg->p2p);
2196 goto wiphy_unreg_out;
2198 @@ -7047,7 +7097,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
2199 /* (re-) activate FWEH event handling */
2200 err = brcmf_fweh_activate_events(ifp);
2202 - bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
2203 + bphy_err(drvr, "FWEH activation failed (%d)\n", err);
2207 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
2208 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
2209 @@ -62,12 +62,12 @@ void __brcmf_err(struct brcmf_bus *bus,
2213 -#define bphy_err(wiphy, fmt, ...) \
2214 +#define bphy_err(drvr, fmt, ...) \
2216 if (IS_ENABLED(CPTCFG_BRCMDBG) || \
2217 IS_ENABLED(CPTCFG_BRCM_TRACING) || \
2219 - wiphy_err(wiphy, "%s: " fmt, __func__, \
2220 + wiphy_err((drvr)->wiphy, "%s: " fmt, __func__, \