352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290
  1. From 16e646768396339b3d354985b99bcd3f1f195a7d Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  3. Date: Fri, 15 Feb 2019 15:45:54 +0100
  4. Subject: [PATCH] brcmfmac: rework bphy_err() to take struct brcmf_pub argument
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This macro will be used in more places not just the cfg80211.c. It makes
  9. sense to pass some common struct to it as "struct wiphy" is mostly
  10. referenced in cfg80211 code only.
  11. A very common one (used above the bus abstraction layer) is struct
  12. brcmf_pub. Many functions already keep reference to it which will make
  13. using bphy_err() simpler. It should also allow extending that macro's
  14. logic if it's ever needed.
  15. This improves code recently added in the commit 3ef005b82e2a ("brcmfmac:
  16. add bphy_err() and use it in the cfg80211.c").
  17. Signed-off-by: Rafał Miłecki <[email protected]>
  18. Signed-off-by: Kalle Valo <[email protected]>
  19. ---
  20. .../broadcom/brcm80211/brcmfmac/cfg80211.c | 510 ++++++++++--------
  21. .../broadcom/brcm80211/brcmfmac/debug.h | 4 +-
  22. 2 files changed, 281 insertions(+), 233 deletions(-)
  23. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  24. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  25. @@ -457,7 +457,7 @@ static void convert_key_from_CPU(struct
  26. static int
  27. send_key_to_dongle(struct brcmf_if *ifp, struct brcmf_wsec_key *key)
  28. {
  29. - struct wiphy *wiphy = ifp->drvr->wiphy;
  30. + struct brcmf_pub *drvr = ifp->drvr;
  31. int err;
  32. struct brcmf_wsec_key_le key_le;
  33. @@ -469,7 +469,7 @@ send_key_to_dongle(struct brcmf_if *ifp,
  34. sizeof(key_le));
  35. if (err)
  36. - bphy_err(wiphy, "wsec_key error (%d)\n", err);
  37. + bphy_err(drvr, "wsec_key error (%d)\n", err);
  38. return err;
  39. }
  40. @@ -509,7 +509,7 @@ static int brcmf_get_first_free_bsscfgid
  41. static int brcmf_cfg80211_request_ap_if(struct brcmf_if *ifp)
  42. {
  43. - struct wiphy *wiphy = ifp->drvr->wiphy;
  44. + struct brcmf_pub *drvr = ifp->drvr;
  45. struct brcmf_mbss_ssid_le mbss_ssid_le;
  46. int bsscfgidx;
  47. int err;
  48. @@ -526,7 +526,7 @@ static int brcmf_cfg80211_request_ap_if(
  49. err = brcmf_fil_bsscfg_data_set(ifp, "bsscfg:ssid", &mbss_ssid_le,
  50. sizeof(mbss_ssid_le));
  51. if (err < 0)
  52. - bphy_err(wiphy, "setting ssid failed %d\n", err);
  53. + bphy_err(drvr, "setting ssid failed %d\n", err);
  54. return err;
  55. }
  56. @@ -544,6 +544,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
  57. {
  58. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  59. struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
  60. + struct brcmf_pub *drvr = cfg->pub;
  61. struct brcmf_cfg80211_vif *vif;
  62. int err;
  63. @@ -569,7 +570,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
  64. BRCMF_VIF_EVENT_TIMEOUT);
  65. brcmf_cfg80211_arm_vif_event(cfg, NULL);
  66. if (!err) {
  67. - bphy_err(wiphy, "timeout occurred\n");
  68. + bphy_err(drvr, "timeout occurred\n");
  69. err = -EIO;
  70. goto fail;
  71. }
  72. @@ -577,7 +578,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
  73. /* interface created in firmware */
  74. ifp = vif->ifp;
  75. if (!ifp) {
  76. - bphy_err(wiphy, "no if pointer provided\n");
  77. + bphy_err(drvr, "no if pointer provided\n");
  78. err = -ENOENT;
  79. goto fail;
  80. }
  81. @@ -585,7 +586,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
  82. strncpy(ifp->ndev->name, name, sizeof(ifp->ndev->name) - 1);
  83. err = brcmf_net_attach(ifp, true);
  84. if (err) {
  85. - bphy_err(wiphy, "Registering netdevice failed\n");
  86. + bphy_err(drvr, "Registering netdevice failed\n");
  87. free_netdev(ifp->ndev);
  88. goto fail;
  89. }
  90. @@ -616,13 +617,15 @@ static struct wireless_dev *brcmf_cfg802
  91. enum nl80211_iftype type,
  92. struct vif_params *params)
  93. {
  94. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  95. + struct brcmf_pub *drvr = cfg->pub;
  96. struct wireless_dev *wdev;
  97. int err;
  98. brcmf_dbg(TRACE, "enter: %s type %d\n", name, type);
  99. err = brcmf_vif_add_validate(wiphy_to_cfg(wiphy), type);
  100. if (err) {
  101. - bphy_err(wiphy, "iface validation failed: err=%d\n", err);
  102. + bphy_err(drvr, "iface validation failed: err=%d\n", err);
  103. return ERR_PTR(err);
  104. }
  105. switch (type) {
  106. @@ -647,7 +650,7 @@ static struct wireless_dev *brcmf_cfg802
  107. }
  108. if (IS_ERR(wdev))
  109. - bphy_err(wiphy, "add iface %s type %d failed: err=%d\n", name,
  110. + bphy_err(drvr, "add iface %s type %d failed: err=%d\n", name,
  111. type, (int)PTR_ERR(wdev));
  112. else
  113. brcmf_cfg80211_update_proto_addr_mode(wdev);
  114. @@ -663,13 +666,13 @@ static void brcmf_scan_config_mpc(struct
  115. void brcmf_set_mpc(struct brcmf_if *ifp, int mpc)
  116. {
  117. - struct wiphy *wiphy = ifp->drvr->wiphy;
  118. + struct brcmf_pub *drvr = ifp->drvr;
  119. s32 err = 0;
  120. if (check_vif_up(ifp->vif)) {
  121. err = brcmf_fil_iovar_int_set(ifp, "mpc", mpc);
  122. if (err) {
  123. - bphy_err(wiphy, "fail to set mpc\n");
  124. + bphy_err(drvr, "fail to set mpc\n");
  125. return;
  126. }
  127. brcmf_dbg(INFO, "MPC : %d\n", mpc);
  128. @@ -680,7 +683,7 @@ s32 brcmf_notify_escan_complete(struct b
  129. struct brcmf_if *ifp, bool aborted,
  130. bool fw_abort)
  131. {
  132. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  133. + struct brcmf_pub *drvr = cfg->pub;
  134. struct brcmf_scan_params_le params_le;
  135. struct cfg80211_scan_request *scan_request;
  136. u64 reqid;
  137. @@ -715,7 +718,7 @@ s32 brcmf_notify_escan_complete(struct b
  138. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN,
  139. &params_le, sizeof(params_le));
  140. if (err)
  141. - bphy_err(wiphy, "Scan abort failed\n");
  142. + bphy_err(drvr, "Scan abort failed\n");
  143. }
  144. brcmf_scan_config_mpc(ifp, 1);
  145. @@ -760,6 +763,7 @@ static int brcmf_cfg80211_del_ap_iface(s
  146. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  147. struct net_device *ndev = wdev->netdev;
  148. struct brcmf_if *ifp = netdev_priv(ndev);
  149. + struct brcmf_pub *drvr = cfg->pub;
  150. int ret;
  151. int err;
  152. @@ -767,7 +771,7 @@ static int brcmf_cfg80211_del_ap_iface(s
  153. err = brcmf_fil_bsscfg_data_set(ifp, "interface_remove", NULL, 0);
  154. if (err) {
  155. - bphy_err(wiphy, "interface_remove failed %d\n", err);
  156. + bphy_err(drvr, "interface_remove failed %d\n", err);
  157. goto err_unarm;
  158. }
  159. @@ -775,7 +779,7 @@ static int brcmf_cfg80211_del_ap_iface(s
  160. ret = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_DEL,
  161. BRCMF_VIF_EVENT_TIMEOUT);
  162. if (!ret) {
  163. - bphy_err(wiphy, "timeout occurred\n");
  164. + bphy_err(drvr, "timeout occurred\n");
  165. err = -EIO;
  166. goto err_unarm;
  167. }
  168. @@ -838,6 +842,7 @@ brcmf_cfg80211_change_iface(struct wiphy
  169. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  170. struct brcmf_if *ifp = netdev_priv(ndev);
  171. struct brcmf_cfg80211_vif *vif = ifp->vif;
  172. + struct brcmf_pub *drvr = cfg->pub;
  173. s32 infra = 0;
  174. s32 ap = 0;
  175. s32 err = 0;
  176. @@ -877,13 +882,13 @@ brcmf_cfg80211_change_iface(struct wiphy
  177. }
  178. err = brcmf_vif_change_validate(wiphy_to_cfg(wiphy), vif, type);
  179. if (err) {
  180. - bphy_err(wiphy, "iface validation failed: err=%d\n", err);
  181. + bphy_err(drvr, "iface validation failed: err=%d\n", err);
  182. return err;
  183. }
  184. switch (type) {
  185. case NL80211_IFTYPE_MONITOR:
  186. case NL80211_IFTYPE_WDS:
  187. - bphy_err(wiphy, "type (%d) : currently we do not support this type\n",
  188. + bphy_err(drvr, "type (%d) : currently we do not support this type\n",
  189. type);
  190. return -EOPNOTSUPP;
  191. case NL80211_IFTYPE_ADHOC:
  192. @@ -912,7 +917,7 @@ brcmf_cfg80211_change_iface(struct wiphy
  193. } else {
  194. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, infra);
  195. if (err) {
  196. - bphy_err(wiphy, "WLC_SET_INFRA error (%d)\n", err);
  197. + bphy_err(drvr, "WLC_SET_INFRA error (%d)\n", err);
  198. err = -EAGAIN;
  199. goto done;
  200. }
  201. @@ -1003,7 +1008,7 @@ static s32
  202. brcmf_run_escan(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
  203. struct cfg80211_scan_request *request)
  204. {
  205. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  206. + struct brcmf_pub *drvr = cfg->pub;
  207. s32 params_size = BRCMF_SCAN_PARAMS_FIXED_SIZE +
  208. offsetof(struct brcmf_escan_params_le, params_le);
  209. struct brcmf_escan_params_le *params;
  210. @@ -1035,7 +1040,7 @@ brcmf_run_escan(struct brcmf_cfg80211_in
  211. if (err == -EBUSY)
  212. brcmf_dbg(INFO, "system busy : escan canceled\n");
  213. else
  214. - bphy_err(wiphy, "error (%d)\n", err);
  215. + bphy_err(drvr, "error (%d)\n", err);
  216. }
  217. kfree(params);
  218. @@ -1072,6 +1077,7 @@ static s32
  219. brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
  220. {
  221. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  222. + struct brcmf_pub *drvr = cfg->pub;
  223. struct brcmf_cfg80211_vif *vif;
  224. s32 err = 0;
  225. @@ -1081,22 +1087,22 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
  226. return -EIO;
  227. if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
  228. - bphy_err(wiphy, "Scanning already: status (%lu)\n",
  229. + bphy_err(drvr, "Scanning already: status (%lu)\n",
  230. cfg->scan_status);
  231. return -EAGAIN;
  232. }
  233. if (test_bit(BRCMF_SCAN_STATUS_ABORT, &cfg->scan_status)) {
  234. - bphy_err(wiphy, "Scanning being aborted: status (%lu)\n",
  235. + bphy_err(drvr, "Scanning being aborted: status (%lu)\n",
  236. cfg->scan_status);
  237. return -EAGAIN;
  238. }
  239. if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
  240. - bphy_err(wiphy, "Scanning suppressed: status (%lu)\n",
  241. + bphy_err(drvr, "Scanning suppressed: status (%lu)\n",
  242. cfg->scan_status);
  243. return -EAGAIN;
  244. }
  245. if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state)) {
  246. - bphy_err(wiphy, "Connecting: status (%lu)\n", vif->sme_state);
  247. + bphy_err(drvr, "Connecting: status (%lu)\n", vif->sme_state);
  248. return -EAGAIN;
  249. }
  250. @@ -1130,7 +1136,7 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
  251. return 0;
  252. scan_out:
  253. - bphy_err(wiphy, "scan error (%d)\n", err);
  254. + bphy_err(drvr, "scan error (%d)\n", err);
  255. clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
  256. cfg->scan_request = NULL;
  257. return err;
  258. @@ -1139,12 +1145,12 @@ scan_out:
  259. static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
  260. {
  261. struct brcmf_if *ifp = netdev_priv(ndev);
  262. - struct wiphy *wiphy = ifp->drvr->wiphy;
  263. + struct brcmf_pub *drvr = ifp->drvr;
  264. s32 err = 0;
  265. err = brcmf_fil_iovar_int_set(ifp, "rtsthresh", rts_threshold);
  266. if (err)
  267. - bphy_err(wiphy, "Error (%d)\n", err);
  268. + bphy_err(drvr, "Error (%d)\n", err);
  269. return err;
  270. }
  271. @@ -1152,13 +1158,13 @@ static s32 brcmf_set_rts(struct net_devi
  272. static s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold)
  273. {
  274. struct brcmf_if *ifp = netdev_priv(ndev);
  275. - struct wiphy *wiphy = ifp->drvr->wiphy;
  276. + struct brcmf_pub *drvr = ifp->drvr;
  277. s32 err = 0;
  278. err = brcmf_fil_iovar_int_set(ifp, "fragthresh",
  279. frag_threshold);
  280. if (err)
  281. - bphy_err(wiphy, "Error (%d)\n", err);
  282. + bphy_err(drvr, "Error (%d)\n", err);
  283. return err;
  284. }
  285. @@ -1166,13 +1172,13 @@ static s32 brcmf_set_frag(struct net_dev
  286. static s32 brcmf_set_retry(struct net_device *ndev, u32 retry, bool l)
  287. {
  288. struct brcmf_if *ifp = netdev_priv(ndev);
  289. - struct wiphy *wiphy = ifp->drvr->wiphy;
  290. + struct brcmf_pub *drvr = ifp->drvr;
  291. s32 err = 0;
  292. u32 cmd = (l ? BRCMF_C_SET_LRL : BRCMF_C_SET_SRL);
  293. err = brcmf_fil_cmd_int_set(ifp, cmd, retry);
  294. if (err) {
  295. - bphy_err(wiphy, "cmd (%d) , error (%d)\n", cmd, err);
  296. + bphy_err(drvr, "cmd (%d) , error (%d)\n", cmd, err);
  297. return err;
  298. }
  299. return err;
  300. @@ -1248,7 +1254,7 @@ static u16 brcmf_map_fw_linkdown_reason(
  301. static int brcmf_set_pmk(struct brcmf_if *ifp, const u8 *pmk_data, u16 pmk_len)
  302. {
  303. - struct wiphy *wiphy = ifp->drvr->wiphy;
  304. + struct brcmf_pub *drvr = ifp->drvr;
  305. struct brcmf_wsec_pmk_le pmk;
  306. int i, err;
  307. @@ -1262,7 +1268,7 @@ static int brcmf_set_pmk(struct brcmf_if
  308. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_WSEC_PMK,
  309. &pmk, sizeof(pmk));
  310. if (err < 0)
  311. - bphy_err(wiphy, "failed to change PSK in firmware (len=%u)\n",
  312. + bphy_err(drvr, "failed to change PSK in firmware (len=%u)\n",
  313. pmk_len);
  314. return err;
  315. @@ -1271,7 +1277,7 @@ static int brcmf_set_pmk(struct brcmf_if
  316. static void brcmf_link_down(struct brcmf_cfg80211_vif *vif, u16 reason)
  317. {
  318. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
  319. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  320. + struct brcmf_pub *drvr = cfg->pub;
  321. s32 err = 0;
  322. brcmf_dbg(TRACE, "Enter\n");
  323. @@ -1281,7 +1287,7 @@ static void brcmf_link_down(struct brcmf
  324. err = brcmf_fil_cmd_data_set(vif->ifp,
  325. BRCMF_C_DISASSOC, NULL, 0);
  326. if (err) {
  327. - bphy_err(wiphy, "WLC_DISASSOC failed (%d)\n", err);
  328. + bphy_err(drvr, "WLC_DISASSOC failed (%d)\n", err);
  329. }
  330. if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
  331. (vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
  332. @@ -1305,6 +1311,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
  333. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  334. struct brcmf_if *ifp = netdev_priv(ndev);
  335. struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
  336. + struct brcmf_pub *drvr = cfg->pub;
  337. struct brcmf_join_params join_params;
  338. size_t join_params_size = 0;
  339. s32 err = 0;
  340. @@ -1369,7 +1376,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
  341. err = brcmf_fil_iovar_int_set(ifp, "wsec", wsec);
  342. if (err) {
  343. - bphy_err(wiphy, "wsec failed (%d)\n", err);
  344. + bphy_err(drvr, "wsec failed (%d)\n", err);
  345. goto done;
  346. }
  347. @@ -1381,7 +1388,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
  348. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, bcnprd);
  349. if (err) {
  350. - bphy_err(wiphy, "WLC_SET_BCNPRD failed (%d)\n", err);
  351. + bphy_err(drvr, "WLC_SET_BCNPRD failed (%d)\n", err);
  352. goto done;
  353. }
  354. @@ -1426,7 +1433,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
  355. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_CHANNEL,
  356. target_channel);
  357. if (err) {
  358. - bphy_err(wiphy, "WLC_SET_CHANNEL failed (%d)\n", err);
  359. + bphy_err(drvr, "WLC_SET_CHANNEL failed (%d)\n", err);
  360. goto done;
  361. }
  362. } else
  363. @@ -1438,7 +1445,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
  364. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
  365. &join_params, join_params_size);
  366. if (err) {
  367. - bphy_err(wiphy, "WLC_SET_SSID failed (%d)\n", err);
  368. + bphy_err(drvr, "WLC_SET_SSID failed (%d)\n", err);
  369. goto done;
  370. }
  371. @@ -1475,8 +1482,8 @@ static s32 brcmf_set_wpa_version(struct
  372. struct cfg80211_connect_params *sme)
  373. {
  374. struct brcmf_if *ifp = netdev_priv(ndev);
  375. - struct wiphy *wiphy = ifp->drvr->wiphy;
  376. struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
  377. + struct brcmf_pub *drvr = ifp->drvr;
  378. struct brcmf_cfg80211_security *sec;
  379. s32 val = 0;
  380. s32 err = 0;
  381. @@ -1490,7 +1497,7 @@ static s32 brcmf_set_wpa_version(struct
  382. brcmf_dbg(CONN, "setting wpa_auth to 0x%0x\n", val);
  383. err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", val);
  384. if (err) {
  385. - bphy_err(wiphy, "set wpa_auth failed (%d)\n", err);
  386. + bphy_err(drvr, "set wpa_auth failed (%d)\n", err);
  387. return err;
  388. }
  389. sec = &profile->sec;
  390. @@ -1502,8 +1509,8 @@ static s32 brcmf_set_auth_type(struct ne
  391. struct cfg80211_connect_params *sme)
  392. {
  393. struct brcmf_if *ifp = netdev_priv(ndev);
  394. - struct wiphy *wiphy = ifp->drvr->wiphy;
  395. struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
  396. + struct brcmf_pub *drvr = ifp->drvr;
  397. struct brcmf_cfg80211_security *sec;
  398. s32 val = 0;
  399. s32 err = 0;
  400. @@ -1525,7 +1532,7 @@ static s32 brcmf_set_auth_type(struct ne
  401. err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
  402. if (err) {
  403. - bphy_err(wiphy, "set auth failed (%d)\n", err);
  404. + bphy_err(drvr, "set auth failed (%d)\n", err);
  405. return err;
  406. }
  407. sec = &profile->sec;
  408. @@ -1538,8 +1545,8 @@ brcmf_set_wsec_mode(struct net_device *n
  409. struct cfg80211_connect_params *sme)
  410. {
  411. struct brcmf_if *ifp = netdev_priv(ndev);
  412. - struct wiphy *wiphy = ifp->drvr->wiphy;
  413. struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
  414. + struct brcmf_pub *drvr = ifp->drvr;
  415. struct brcmf_cfg80211_security *sec;
  416. s32 pval = 0;
  417. s32 gval = 0;
  418. @@ -1562,7 +1569,7 @@ brcmf_set_wsec_mode(struct net_device *n
  419. pval = AES_ENABLED;
  420. break;
  421. default:
  422. - bphy_err(wiphy, "invalid cipher pairwise (%d)\n",
  423. + bphy_err(drvr, "invalid cipher pairwise (%d)\n",
  424. sme->crypto.ciphers_pairwise[0]);
  425. return -EINVAL;
  426. }
  427. @@ -1583,7 +1590,7 @@ brcmf_set_wsec_mode(struct net_device *n
  428. gval = AES_ENABLED;
  429. break;
  430. default:
  431. - bphy_err(wiphy, "invalid cipher group (%d)\n",
  432. + bphy_err(drvr, "invalid cipher group (%d)\n",
  433. sme->crypto.cipher_group);
  434. return -EINVAL;
  435. }
  436. @@ -1599,7 +1606,7 @@ brcmf_set_wsec_mode(struct net_device *n
  437. wsec = pval | gval;
  438. err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
  439. if (err) {
  440. - bphy_err(wiphy, "error (%d)\n", err);
  441. + bphy_err(drvr, "error (%d)\n", err);
  442. return err;
  443. }
  444. @@ -1614,8 +1621,8 @@ static s32
  445. brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
  446. {
  447. struct brcmf_if *ifp = netdev_priv(ndev);
  448. - struct wiphy *wiphy = ifp->drvr->wiphy;
  449. struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
  450. + struct brcmf_pub *drvr = ifp->drvr;
  451. s32 val;
  452. s32 err;
  453. const struct brcmf_tlv *rsn_ie;
  454. @@ -1633,7 +1640,7 @@ brcmf_set_key_mgmt(struct net_device *nd
  455. err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wpa_auth", &val);
  456. if (err) {
  457. - bphy_err(wiphy, "could not get wpa_auth (%d)\n", err);
  458. + bphy_err(drvr, "could not get wpa_auth (%d)\n", err);
  459. return err;
  460. }
  461. if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
  462. @@ -1647,7 +1654,7 @@ brcmf_set_key_mgmt(struct net_device *nd
  463. val = WPA_AUTH_PSK;
  464. break;
  465. default:
  466. - bphy_err(wiphy, "invalid cipher group (%d)\n",
  467. + bphy_err(drvr, "invalid cipher group (%d)\n",
  468. sme->crypto.cipher_group);
  469. return -EINVAL;
  470. }
  471. @@ -1670,7 +1677,7 @@ brcmf_set_key_mgmt(struct net_device *nd
  472. val = WPA2_AUTH_PSK;
  473. break;
  474. default:
  475. - bphy_err(wiphy, "invalid cipher group (%d)\n",
  476. + bphy_err(drvr, "invalid cipher group (%d)\n",
  477. sme->crypto.cipher_group);
  478. return -EINVAL;
  479. }
  480. @@ -1717,7 +1724,7 @@ skip_mfp_config:
  481. brcmf_dbg(CONN, "setting wpa_auth to %d\n", val);
  482. err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val);
  483. if (err) {
  484. - bphy_err(wiphy, "could not set wpa_auth (%d)\n", err);
  485. + bphy_err(drvr, "could not set wpa_auth (%d)\n", err);
  486. return err;
  487. }
  488. @@ -1729,7 +1736,7 @@ brcmf_set_sharedkey(struct net_device *n
  489. struct cfg80211_connect_params *sme)
  490. {
  491. struct brcmf_if *ifp = netdev_priv(ndev);
  492. - struct wiphy *wiphy = ifp->drvr->wiphy;
  493. + struct brcmf_pub *drvr = ifp->drvr;
  494. struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
  495. struct brcmf_cfg80211_security *sec;
  496. struct brcmf_wsec_key key;
  497. @@ -1756,7 +1763,7 @@ brcmf_set_sharedkey(struct net_device *n
  498. key.len = (u32) sme->key_len;
  499. key.index = (u32) sme->key_idx;
  500. if (key.len > sizeof(key.data)) {
  501. - bphy_err(wiphy, "Too long key length (%u)\n", key.len);
  502. + bphy_err(drvr, "Too long key length (%u)\n", key.len);
  503. return -EINVAL;
  504. }
  505. memcpy(key.data, sme->key, key.len);
  506. @@ -1769,7 +1776,7 @@ brcmf_set_sharedkey(struct net_device *n
  507. key.algo = CRYPTO_ALGO_WEP128;
  508. break;
  509. default:
  510. - bphy_err(wiphy, "Invalid algorithm (%d)\n",
  511. + bphy_err(drvr, "Invalid algorithm (%d)\n",
  512. sme->crypto.ciphers_pairwise[0]);
  513. return -EINVAL;
  514. }
  515. @@ -1786,7 +1793,7 @@ brcmf_set_sharedkey(struct net_device *n
  516. val = WL_AUTH_SHARED_KEY; /* shared key */
  517. err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
  518. if (err)
  519. - bphy_err(wiphy, "set auth failed (%d)\n", err);
  520. + bphy_err(drvr, "set auth failed (%d)\n", err);
  521. }
  522. return err;
  523. }
  524. @@ -1806,7 +1813,7 @@ enum nl80211_auth_type brcmf_war_auth_ty
  525. static void brcmf_set_join_pref(struct brcmf_if *ifp,
  526. struct cfg80211_bss_selection *bss_select)
  527. {
  528. - struct wiphy *wiphy = ifp->drvr->wiphy;
  529. + struct brcmf_pub *drvr = ifp->drvr;
  530. struct brcmf_join_pref_params join_pref_params[2];
  531. enum nl80211_band band;
  532. int err, i = 0;
  533. @@ -1845,7 +1852,7 @@ static void brcmf_set_join_pref(struct b
  534. err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
  535. sizeof(join_pref_params));
  536. if (err)
  537. - bphy_err(wiphy, "Set join_pref error (%d)\n", err);
  538. + bphy_err(drvr, "Set join_pref error (%d)\n", err);
  539. }
  540. static s32
  541. @@ -1856,6 +1863,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
  542. struct brcmf_if *ifp = netdev_priv(ndev);
  543. struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
  544. struct ieee80211_channel *chan = sme->channel;
  545. + struct brcmf_pub *drvr = ifp->drvr;
  546. struct brcmf_join_params join_params;
  547. size_t join_params_size;
  548. const struct brcmf_tlv *rsn_ie;
  549. @@ -1872,7 +1880,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
  550. return -EIO;
  551. if (!sme->ssid) {
  552. - bphy_err(wiphy, "Invalid ssid\n");
  553. + bphy_err(drvr, "Invalid ssid\n");
  554. return -EOPNOTSUPP;
  555. }
  556. @@ -1901,7 +1909,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
  557. err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
  558. sme->ie, sme->ie_len);
  559. if (err)
  560. - bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
  561. + bphy_err(drvr, "Set Assoc REQ IE Failed\n");
  562. else
  563. brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
  564. @@ -1922,32 +1930,32 @@ brcmf_cfg80211_connect(struct wiphy *wip
  565. err = brcmf_set_wpa_version(ndev, sme);
  566. if (err) {
  567. - bphy_err(wiphy, "wl_set_wpa_version failed (%d)\n", err);
  568. + bphy_err(drvr, "wl_set_wpa_version failed (%d)\n", err);
  569. goto done;
  570. }
  571. sme->auth_type = brcmf_war_auth_type(ifp, sme->auth_type);
  572. err = brcmf_set_auth_type(ndev, sme);
  573. if (err) {
  574. - bphy_err(wiphy, "wl_set_auth_type failed (%d)\n", err);
  575. + bphy_err(drvr, "wl_set_auth_type failed (%d)\n", err);
  576. goto done;
  577. }
  578. err = brcmf_set_wsec_mode(ndev, sme);
  579. if (err) {
  580. - bphy_err(wiphy, "wl_set_set_cipher failed (%d)\n", err);
  581. + bphy_err(drvr, "wl_set_set_cipher failed (%d)\n", err);
  582. goto done;
  583. }
  584. err = brcmf_set_key_mgmt(ndev, sme);
  585. if (err) {
  586. - bphy_err(wiphy, "wl_set_key_mgmt failed (%d)\n", err);
  587. + bphy_err(drvr, "wl_set_key_mgmt failed (%d)\n", err);
  588. goto done;
  589. }
  590. err = brcmf_set_sharedkey(ndev, sme);
  591. if (err) {
  592. - bphy_err(wiphy, "brcmf_set_sharedkey failed (%d)\n", err);
  593. + bphy_err(drvr, "brcmf_set_sharedkey failed (%d)\n", err);
  594. goto done;
  595. }
  596. @@ -1964,7 +1972,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
  597. /* enable firmware supplicant for this interface */
  598. err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 1);
  599. if (err < 0) {
  600. - bphy_err(wiphy, "failed to enable fw supplicant\n");
  601. + bphy_err(drvr, "failed to enable fw supplicant\n");
  602. goto done;
  603. }
  604. }
  605. @@ -2059,7 +2067,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
  606. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
  607. &join_params, join_params_size);
  608. if (err)
  609. - bphy_err(wiphy, "BRCMF_C_SET_SSID failed (%d)\n", err);
  610. + bphy_err(drvr, "BRCMF_C_SET_SSID failed (%d)\n", err);
  611. done:
  612. if (err)
  613. @@ -2072,8 +2080,10 @@ static s32
  614. brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
  615. u16 reason_code)
  616. {
  617. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  618. struct brcmf_if *ifp = netdev_priv(ndev);
  619. struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
  620. + struct brcmf_pub *drvr = cfg->pub;
  621. struct brcmf_scb_val_le scbval;
  622. s32 err = 0;
  623. @@ -2090,7 +2100,7 @@ brcmf_cfg80211_disconnect(struct wiphy *
  624. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_DISASSOC,
  625. &scbval, sizeof(scbval));
  626. if (err)
  627. - bphy_err(wiphy, "error (%d)\n", err);
  628. + bphy_err(drvr, "error (%d)\n", err);
  629. brcmf_dbg(TRACE, "Exit\n");
  630. return err;
  631. @@ -2103,6 +2113,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
  632. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  633. struct net_device *ndev = cfg_to_ndev(cfg);
  634. struct brcmf_if *ifp = netdev_priv(ndev);
  635. + struct brcmf_pub *drvr = cfg->pub;
  636. s32 err;
  637. s32 disable;
  638. u32 qdbm = 127;
  639. @@ -2117,7 +2128,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
  640. case NL80211_TX_POWER_LIMITED:
  641. case NL80211_TX_POWER_FIXED:
  642. if (mbm < 0) {
  643. - bphy_err(wiphy, "TX_POWER_FIXED - dbm is negative\n");
  644. + bphy_err(drvr, "TX_POWER_FIXED - dbm is negative\n");
  645. err = -EINVAL;
  646. goto done;
  647. }
  648. @@ -2127,7 +2138,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
  649. qdbm |= WL_TXPWR_OVERRIDE;
  650. break;
  651. default:
  652. - bphy_err(wiphy, "Unsupported type %d\n", type);
  653. + bphy_err(drvr, "Unsupported type %d\n", type);
  654. err = -EINVAL;
  655. goto done;
  656. }
  657. @@ -2135,11 +2146,11 @@ brcmf_cfg80211_set_tx_power(struct wiphy
  658. disable = WL_RADIO_SW_DISABLE << 16;
  659. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_RADIO, disable);
  660. if (err)
  661. - bphy_err(wiphy, "WLC_SET_RADIO error (%d)\n", err);
  662. + bphy_err(drvr, "WLC_SET_RADIO error (%d)\n", err);
  663. err = brcmf_fil_iovar_int_set(ifp, "qtxpower", qdbm);
  664. if (err)
  665. - bphy_err(wiphy, "qtxpower error (%d)\n", err);
  666. + bphy_err(drvr, "qtxpower error (%d)\n", err);
  667. done:
  668. brcmf_dbg(TRACE, "Exit %d (qdbm)\n", qdbm & ~WL_TXPWR_OVERRIDE);
  669. @@ -2150,7 +2161,9 @@ static s32
  670. brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
  671. s32 *dbm)
  672. {
  673. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  674. struct brcmf_cfg80211_vif *vif = wdev_to_vif(wdev);
  675. + struct brcmf_pub *drvr = cfg->pub;
  676. s32 qdbm = 0;
  677. s32 err;
  678. @@ -2160,7 +2173,7 @@ brcmf_cfg80211_get_tx_power(struct wiphy
  679. err = brcmf_fil_iovar_int_get(vif->ifp, "qtxpower", &qdbm);
  680. if (err) {
  681. - bphy_err(wiphy, "error (%d)\n", err);
  682. + bphy_err(drvr, "error (%d)\n", err);
  683. goto done;
  684. }
  685. *dbm = (qdbm & ~WL_TXPWR_OVERRIDE) / 4;
  686. @@ -2175,6 +2188,7 @@ brcmf_cfg80211_config_default_key(struct
  687. u8 key_idx, bool unicast, bool multicast)
  688. {
  689. struct brcmf_if *ifp = netdev_priv(ndev);
  690. + struct brcmf_pub *drvr = ifp->drvr;
  691. u32 index;
  692. u32 wsec;
  693. s32 err = 0;
  694. @@ -2186,7 +2200,7 @@ brcmf_cfg80211_config_default_key(struct
  695. err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
  696. if (err) {
  697. - bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
  698. + bphy_err(drvr, "WLC_GET_WSEC error (%d)\n", err);
  699. goto done;
  700. }
  701. @@ -2196,7 +2210,7 @@ brcmf_cfg80211_config_default_key(struct
  702. err = brcmf_fil_cmd_int_set(ifp,
  703. BRCMF_C_SET_KEY_PRIMARY, index);
  704. if (err)
  705. - bphy_err(wiphy, "error (%d)\n", err);
  706. + bphy_err(drvr, "error (%d)\n", err);
  707. }
  708. done:
  709. brcmf_dbg(TRACE, "Exit\n");
  710. @@ -2245,7 +2259,9 @@ brcmf_cfg80211_add_key(struct wiphy *wip
  711. u8 key_idx, bool pairwise, const u8 *mac_addr,
  712. struct key_params *params)
  713. {
  714. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  715. struct brcmf_if *ifp = netdev_priv(ndev);
  716. + struct brcmf_pub *drvr = cfg->pub;
  717. struct brcmf_wsec_key *key;
  718. s32 val;
  719. s32 wsec;
  720. @@ -2260,7 +2276,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
  721. if (key_idx >= BRCMF_MAX_DEFAULT_KEYS) {
  722. /* we ignore this key index in this case */
  723. - bphy_err(wiphy, "invalid key index (%d)\n", key_idx);
  724. + bphy_err(drvr, "invalid key index (%d)\n", key_idx);
  725. return -EINVAL;
  726. }
  727. @@ -2269,7 +2285,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
  728. mac_addr);
  729. if (params->key_len > sizeof(key->data)) {
  730. - bphy_err(wiphy, "Too long key length (%u)\n", params->key_len);
  731. + bphy_err(drvr, "Too long key length (%u)\n", params->key_len);
  732. return -EINVAL;
  733. }
  734. @@ -2323,7 +2339,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
  735. brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_CCMP\n");
  736. break;
  737. default:
  738. - bphy_err(wiphy, "Invalid cipher (0x%x)\n", params->cipher);
  739. + bphy_err(drvr, "Invalid cipher (0x%x)\n", params->cipher);
  740. err = -EINVAL;
  741. goto done;
  742. }
  743. @@ -2334,13 +2350,13 @@ brcmf_cfg80211_add_key(struct wiphy *wip
  744. err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
  745. if (err) {
  746. - bphy_err(wiphy, "get wsec error (%d)\n", err);
  747. + bphy_err(drvr, "get wsec error (%d)\n", err);
  748. goto done;
  749. }
  750. wsec |= val;
  751. err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
  752. if (err) {
  753. - bphy_err(wiphy, "set wsec error (%d)\n", err);
  754. + bphy_err(drvr, "set wsec error (%d)\n", err);
  755. goto done;
  756. }
  757. @@ -2355,9 +2371,11 @@ brcmf_cfg80211_get_key(struct wiphy *wip
  758. void (*callback)(void *cookie,
  759. struct key_params *params))
  760. {
  761. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  762. struct key_params params;
  763. struct brcmf_if *ifp = netdev_priv(ndev);
  764. struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
  765. + struct brcmf_pub *drvr = cfg->pub;
  766. struct brcmf_cfg80211_security *sec;
  767. s32 wsec;
  768. s32 err = 0;
  769. @@ -2371,7 +2389,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
  770. err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
  771. if (err) {
  772. - bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
  773. + bphy_err(drvr, "WLC_GET_WSEC error (%d)\n", err);
  774. /* Ignore this error, may happen during DISASSOC */
  775. err = -EAGAIN;
  776. goto done;
  777. @@ -2392,7 +2410,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
  778. params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
  779. brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n");
  780. } else {
  781. - bphy_err(wiphy, "Invalid algo (0x%x)\n", wsec);
  782. + bphy_err(drvr, "Invalid algo (0x%x)\n", wsec);
  783. err = -EINVAL;
  784. goto done;
  785. }
  786. @@ -2422,7 +2440,7 @@ brcmf_cfg80211_config_default_mgmt_key(s
  787. static void
  788. brcmf_cfg80211_reconfigure_wep(struct brcmf_if *ifp)
  789. {
  790. - struct wiphy *wiphy = ifp->drvr->wiphy;
  791. + struct brcmf_pub *drvr = ifp->drvr;
  792. s32 err;
  793. u8 key_idx;
  794. struct brcmf_wsec_key *key;
  795. @@ -2439,18 +2457,18 @@ brcmf_cfg80211_reconfigure_wep(struct br
  796. err = send_key_to_dongle(ifp, key);
  797. if (err) {
  798. - bphy_err(wiphy, "Setting WEP key failed (%d)\n", err);
  799. + bphy_err(drvr, "Setting WEP key failed (%d)\n", err);
  800. return;
  801. }
  802. err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
  803. if (err) {
  804. - bphy_err(wiphy, "get wsec error (%d)\n", err);
  805. + bphy_err(drvr, "get wsec error (%d)\n", err);
  806. return;
  807. }
  808. wsec |= WEP_ENABLED;
  809. err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
  810. if (err)
  811. - bphy_err(wiphy, "set wsec error (%d)\n", err);
  812. + bphy_err(drvr, "set wsec error (%d)\n", err);
  813. }
  814. static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si)
  815. @@ -2476,7 +2494,7 @@ static void brcmf_convert_sta_flags(u32
  816. static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si)
  817. {
  818. - struct wiphy *wiphy = ifp->drvr->wiphy;
  819. + struct brcmf_pub *drvr = ifp->drvr;
  820. struct {
  821. __le32 len;
  822. struct brcmf_bss_info_le bss_le;
  823. @@ -2492,7 +2510,7 @@ static void brcmf_fill_bss_param(struct
  824. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf,
  825. WL_BSS_INFO_MAX);
  826. if (err) {
  827. - bphy_err(wiphy, "Failed to get bss info (%d)\n", err);
  828. + bphy_err(drvr, "Failed to get bss info (%d)\n", err);
  829. goto out_kfree;
  830. }
  831. si->filled |= BIT_ULL(NL80211_STA_INFO_BSS_PARAM);
  832. @@ -2514,7 +2532,7 @@ static s32
  833. brcmf_cfg80211_get_station_ibss(struct brcmf_if *ifp,
  834. struct station_info *sinfo)
  835. {
  836. - struct wiphy *wiphy = ifp->drvr->wiphy;
  837. + struct brcmf_pub *drvr = ifp->drvr;
  838. struct brcmf_scb_val_le scbval;
  839. struct brcmf_pktcnt_le pktcnt;
  840. s32 err;
  841. @@ -2524,7 +2542,7 @@ brcmf_cfg80211_get_station_ibss(struct b
  842. /* Get the current tx rate */
  843. err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate);
  844. if (err < 0) {
  845. - bphy_err(wiphy, "BRCMF_C_GET_RATE error (%d)\n", err);
  846. + bphy_err(drvr, "BRCMF_C_GET_RATE error (%d)\n", err);
  847. return err;
  848. }
  849. sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
  850. @@ -2534,7 +2552,7 @@ brcmf_cfg80211_get_station_ibss(struct b
  851. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, &scbval,
  852. sizeof(scbval));
  853. if (err) {
  854. - bphy_err(wiphy, "BRCMF_C_GET_RSSI error (%d)\n", err);
  855. + bphy_err(drvr, "BRCMF_C_GET_RSSI error (%d)\n", err);
  856. return err;
  857. }
  858. rssi = le32_to_cpu(scbval.val);
  859. @@ -2544,7 +2562,7 @@ brcmf_cfg80211_get_station_ibss(struct b
  860. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_GET_PKTCNTS, &pktcnt,
  861. sizeof(pktcnt));
  862. if (err) {
  863. - bphy_err(wiphy, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
  864. + bphy_err(drvr, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
  865. return err;
  866. }
  867. sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_PACKETS) |
  868. @@ -2563,7 +2581,9 @@ static s32
  869. brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
  870. const u8 *mac, struct station_info *sinfo)
  871. {
  872. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  873. struct brcmf_if *ifp = netdev_priv(ndev);
  874. + struct brcmf_pub *drvr = cfg->pub;
  875. struct brcmf_scb_val_le scb_val;
  876. s32 err = 0;
  877. struct brcmf_sta_info_le sta_info_le;
  878. @@ -2592,7 +2612,7 @@ brcmf_cfg80211_get_station(struct wiphy
  879. &sta_info_le,
  880. sizeof(sta_info_le));
  881. if (err < 0) {
  882. - bphy_err(wiphy, "GET STA INFO failed, %d\n", err);
  883. + bphy_err(drvr, "GET STA INFO failed, %d\n", err);
  884. goto done;
  885. }
  886. }
  887. @@ -2661,7 +2681,7 @@ brcmf_cfg80211_get_station(struct wiphy
  888. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
  889. &scb_val, sizeof(scb_val));
  890. if (err) {
  891. - bphy_err(wiphy, "Could not get rssi (%d)\n",
  892. + bphy_err(drvr, "Could not get rssi (%d)\n",
  893. err);
  894. goto done;
  895. } else {
  896. @@ -2683,6 +2703,7 @@ brcmf_cfg80211_dump_station(struct wiphy
  897. {
  898. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  899. struct brcmf_if *ifp = netdev_priv(ndev);
  900. + struct brcmf_pub *drvr = cfg->pub;
  901. s32 err;
  902. brcmf_dbg(TRACE, "Enter, idx %d\n", idx);
  903. @@ -2693,7 +2714,7 @@ brcmf_cfg80211_dump_station(struct wiphy
  904. &cfg->assoclist,
  905. sizeof(cfg->assoclist));
  906. if (err) {
  907. - bphy_err(wiphy, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
  908. + bphy_err(drvr, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
  909. err);
  910. cfg->assoclist.count = 0;
  911. return -EOPNOTSUPP;
  912. @@ -2714,6 +2735,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip
  913. s32 err = 0;
  914. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  915. struct brcmf_if *ifp = netdev_priv(ndev);
  916. + struct brcmf_pub *drvr = cfg->pub;
  917. brcmf_dbg(TRACE, "Enter\n");
  918. @@ -2742,9 +2764,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip
  919. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm);
  920. if (err) {
  921. if (err == -ENODEV)
  922. - bphy_err(wiphy, "net_device is not ready yet\n");
  923. + bphy_err(drvr, "net_device is not ready yet\n");
  924. else
  925. - bphy_err(wiphy, "error (%d)\n", err);
  926. + bphy_err(drvr, "error (%d)\n", err);
  927. }
  928. done:
  929. brcmf_dbg(TRACE, "Exit\n");
  930. @@ -2755,6 +2777,7 @@ static s32 brcmf_inform_single_bss(struc
  931. struct brcmf_bss_info_le *bi)
  932. {
  933. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  934. + struct brcmf_pub *drvr = cfg->pub;
  935. struct cfg80211_bss *bss;
  936. enum nl80211_band band;
  937. struct brcmu_chan ch;
  938. @@ -2767,7 +2790,7 @@ static s32 brcmf_inform_single_bss(struc
  939. struct cfg80211_inform_bss bss_data = {};
  940. if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) {
  941. - bphy_err(wiphy, "Bss info is larger than buffer. Discarding\n");
  942. + bphy_err(drvr, "Bss info is larger than buffer. Discarding\n");
  943. return 0;
  944. }
  945. @@ -2826,7 +2849,7 @@ next_bss_le(struct brcmf_scan_results *l
  946. static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg)
  947. {
  948. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  949. + struct brcmf_pub *drvr = cfg->pub;
  950. struct brcmf_scan_results *bss_list;
  951. struct brcmf_bss_info_le *bi = NULL; /* must be initialized */
  952. s32 err = 0;
  953. @@ -2835,7 +2858,7 @@ static s32 brcmf_inform_bss(struct brcmf
  954. bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
  955. if (bss_list->count != 0 &&
  956. bss_list->version != BRCMF_BSS_INFO_VERSION) {
  957. - bphy_err(wiphy, "Version %d != WL_BSS_INFO_VERSION\n",
  958. + bphy_err(drvr, "Version %d != WL_BSS_INFO_VERSION\n",
  959. bss_list->version);
  960. return -EOPNOTSUPP;
  961. }
  962. @@ -2853,6 +2876,7 @@ static s32 brcmf_inform_ibss(struct brcm
  963. struct net_device *ndev, const u8 *bssid)
  964. {
  965. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  966. + struct brcmf_pub *drvr = cfg->pub;
  967. struct ieee80211_channel *notify_channel;
  968. struct brcmf_bss_info_le *bi = NULL;
  969. struct ieee80211_supported_band *band;
  970. @@ -2880,7 +2904,7 @@ static s32 brcmf_inform_ibss(struct brcm
  971. err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO,
  972. buf, WL_BSS_INFO_MAX);
  973. if (err) {
  974. - bphy_err(wiphy, "WLC_GET_BSS_INFO failed: %d\n", err);
  975. + bphy_err(drvr, "WLC_GET_BSS_INFO failed: %d\n", err);
  976. goto CleanUp;
  977. }
  978. @@ -2934,7 +2958,7 @@ CleanUp:
  979. static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg,
  980. struct brcmf_if *ifp)
  981. {
  982. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  983. + struct brcmf_pub *drvr = cfg->pub;
  984. struct brcmf_bss_info_le *bi;
  985. const struct brcmf_tlv *tim;
  986. u16 beacon_interval;
  987. @@ -2951,7 +2975,7 @@ static s32 brcmf_update_bss_info(struct
  988. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO,
  989. cfg->extra_buf, WL_EXTRA_BUF_MAX);
  990. if (err) {
  991. - bphy_err(wiphy, "Could not get bss info %d\n", err);
  992. + bphy_err(drvr, "Could not get bss info %d\n", err);
  993. goto update_bss_info_out;
  994. }
  995. @@ -2976,7 +3000,7 @@ static s32 brcmf_update_bss_info(struct
  996. u32 var;
  997. err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var);
  998. if (err) {
  999. - bphy_err(wiphy, "wl dtim_assoc failed (%d)\n", err);
  1000. + bphy_err(drvr, "wl dtim_assoc failed (%d)\n", err);
  1001. goto update_bss_info_out;
  1002. }
  1003. dtim_period = (u8)var;
  1004. @@ -3014,10 +3038,10 @@ static void brcmf_escan_timeout(struct t
  1005. {
  1006. struct brcmf_cfg80211_info *cfg =
  1007. from_timer(cfg, t, escan_timeout);
  1008. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1009. + struct brcmf_pub *drvr = cfg->pub;
  1010. if (cfg->int_escan_map || cfg->scan_request) {
  1011. - bphy_err(wiphy, "timer expired\n");
  1012. + bphy_err(drvr, "timer expired\n");
  1013. schedule_work(&cfg->escan_timeout_work);
  1014. }
  1015. }
  1016. @@ -3065,8 +3089,8 @@ static s32
  1017. brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
  1018. const struct brcmf_event_msg *e, void *data)
  1019. {
  1020. - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
  1021. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1022. + struct brcmf_pub *drvr = ifp->drvr;
  1023. + struct brcmf_cfg80211_info *cfg = drvr->config;
  1024. s32 status;
  1025. struct brcmf_escan_result_le *escan_result_le;
  1026. u32 escan_buflen;
  1027. @@ -3083,7 +3107,7 @@ brcmf_cfg80211_escan_handler(struct brcm
  1028. goto exit;
  1029. if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
  1030. - bphy_err(wiphy, "scan not ready, bsscfgidx=%d\n",
  1031. + bphy_err(drvr, "scan not ready, bsscfgidx=%d\n",
  1032. ifp->bsscfgidx);
  1033. return -EPERM;
  1034. }
  1035. @@ -3091,24 +3115,24 @@ brcmf_cfg80211_escan_handler(struct brcm
  1036. if (status == BRCMF_E_STATUS_PARTIAL) {
  1037. brcmf_dbg(SCAN, "ESCAN Partial result\n");
  1038. if (e->datalen < sizeof(*escan_result_le)) {
  1039. - bphy_err(wiphy, "invalid event data length\n");
  1040. + bphy_err(drvr, "invalid event data length\n");
  1041. goto exit;
  1042. }
  1043. escan_result_le = (struct brcmf_escan_result_le *) data;
  1044. if (!escan_result_le) {
  1045. - bphy_err(wiphy, "Invalid escan result (NULL pointer)\n");
  1046. + bphy_err(drvr, "Invalid escan result (NULL pointer)\n");
  1047. goto exit;
  1048. }
  1049. escan_buflen = le32_to_cpu(escan_result_le->buflen);
  1050. if (escan_buflen > BRCMF_ESCAN_BUF_SIZE ||
  1051. escan_buflen > e->datalen ||
  1052. escan_buflen < sizeof(*escan_result_le)) {
  1053. - bphy_err(wiphy, "Invalid escan buffer length: %d\n",
  1054. + bphy_err(drvr, "Invalid escan buffer length: %d\n",
  1055. escan_buflen);
  1056. goto exit;
  1057. }
  1058. if (le16_to_cpu(escan_result_le->bss_count) != 1) {
  1059. - bphy_err(wiphy, "Invalid bss_count %d: ignoring\n",
  1060. + bphy_err(drvr, "Invalid bss_count %d: ignoring\n",
  1061. escan_result_le->bss_count);
  1062. goto exit;
  1063. }
  1064. @@ -3124,7 +3148,7 @@ brcmf_cfg80211_escan_handler(struct brcm
  1065. bi_length = le32_to_cpu(bss_info_le->length);
  1066. if (bi_length != escan_buflen - WL_ESCAN_RESULTS_FIXED_SIZE) {
  1067. - bphy_err(wiphy, "Ignoring invalid bss_info length: %d\n",
  1068. + bphy_err(drvr, "Ignoring invalid bss_info length: %d\n",
  1069. bi_length);
  1070. goto exit;
  1071. }
  1072. @@ -3133,7 +3157,7 @@ brcmf_cfg80211_escan_handler(struct brcm
  1073. BIT(NL80211_IFTYPE_ADHOC))) {
  1074. if (le16_to_cpu(bss_info_le->capability) &
  1075. WLAN_CAPABILITY_IBSS) {
  1076. - bphy_err(wiphy, "Ignoring IBSS result\n");
  1077. + bphy_err(drvr, "Ignoring IBSS result\n");
  1078. goto exit;
  1079. }
  1080. }
  1081. @@ -3141,7 +3165,7 @@ brcmf_cfg80211_escan_handler(struct brcm
  1082. list = (struct brcmf_scan_results *)
  1083. cfg->escan_info.escan_buf;
  1084. if (bi_length > BRCMF_ESCAN_BUF_SIZE - list->buflen) {
  1085. - bphy_err(wiphy, "Buffer is too small: ignoring\n");
  1086. + bphy_err(drvr, "Buffer is too small: ignoring\n");
  1087. goto exit;
  1088. }
  1089. @@ -3300,7 +3324,8 @@ static s32
  1090. brcmf_notify_sched_scan_results(struct brcmf_if *ifp,
  1091. const struct brcmf_event_msg *e, void *data)
  1092. {
  1093. - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
  1094. + struct brcmf_pub *drvr = ifp->drvr;
  1095. + struct brcmf_cfg80211_info *cfg = drvr->config;
  1096. struct brcmf_pno_net_info_le *netinfo, *netinfo_start;
  1097. struct cfg80211_scan_request *request = NULL;
  1098. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1099. @@ -3333,14 +3358,14 @@ brcmf_notify_sched_scan_results(struct b
  1100. WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE);
  1101. brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count);
  1102. if (!result_count) {
  1103. - bphy_err(wiphy, "FALSE PNO Event. (pfn_count == 0)\n");
  1104. + bphy_err(drvr, "FALSE PNO Event. (pfn_count == 0)\n");
  1105. goto out_err;
  1106. }
  1107. netinfo_start = brcmf_get_netinfo_array(pfn_result);
  1108. datalen = e->datalen - ((void *)netinfo_start - (void *)pfn_result);
  1109. if (datalen < result_count * sizeof(*netinfo)) {
  1110. - bphy_err(wiphy, "insufficient event data\n");
  1111. + bphy_err(drvr, "insufficient event data\n");
  1112. goto out_err;
  1113. }
  1114. @@ -3387,14 +3412,15 @@ brcmf_cfg80211_sched_scan_start(struct w
  1115. struct net_device *ndev,
  1116. struct cfg80211_sched_scan_request *req)
  1117. {
  1118. - struct brcmf_if *ifp = netdev_priv(ndev);
  1119. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1120. + struct brcmf_if *ifp = netdev_priv(ndev);
  1121. + struct brcmf_pub *drvr = cfg->pub;
  1122. brcmf_dbg(SCAN, "Enter: n_match_sets=%d n_ssids=%d\n",
  1123. req->n_match_sets, req->n_ssids);
  1124. if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
  1125. - bphy_err(wiphy, "Scanning suppressed: status=%lu\n",
  1126. + bphy_err(drvr, "Scanning suppressed: status=%lu\n",
  1127. cfg->scan_status);
  1128. return -EAGAIN;
  1129. }
  1130. @@ -3473,8 +3499,8 @@ static s32
  1131. brcmf_wowl_nd_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e,
  1132. void *data)
  1133. {
  1134. - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
  1135. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1136. + struct brcmf_pub *drvr = ifp->drvr;
  1137. + struct brcmf_cfg80211_info *cfg = drvr->config;
  1138. struct brcmf_pno_scanresults_le *pfn_result;
  1139. struct brcmf_pno_net_info_le *netinfo;
  1140. @@ -3493,7 +3519,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
  1141. }
  1142. if (le32_to_cpu(pfn_result->count) < 1) {
  1143. - bphy_err(wiphy, "Invalid result count, expected 1 (%d)\n",
  1144. + bphy_err(drvr, "Invalid result count, expected 1 (%d)\n",
  1145. le32_to_cpu(pfn_result->count));
  1146. return -EINVAL;
  1147. }
  1148. @@ -3523,6 +3549,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
  1149. static void brcmf_report_wowl_wakeind(struct wiphy *wiphy, struct brcmf_if *ifp)
  1150. {
  1151. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1152. + struct brcmf_pub *drvr = cfg->pub;
  1153. struct brcmf_wowl_wakeind_le wake_ind_le;
  1154. struct cfg80211_wowlan_wakeup wakeup_data;
  1155. struct cfg80211_wowlan_wakeup *wakeup;
  1156. @@ -3533,7 +3560,7 @@ static void brcmf_report_wowl_wakeind(st
  1157. err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le,
  1158. sizeof(wake_ind_le));
  1159. if (err) {
  1160. - bphy_err(wiphy, "Get wowl_wakeind failed, err = %d\n", err);
  1161. + bphy_err(drvr, "Get wowl_wakeind failed, err = %d\n", err);
  1162. return;
  1163. }
  1164. @@ -3574,7 +3601,7 @@ static void brcmf_report_wowl_wakeind(st
  1165. cfg->wowl.nd_data_completed,
  1166. BRCMF_ND_INFO_TIMEOUT);
  1167. if (!timeout)
  1168. - bphy_err(wiphy, "No result for wowl net detect\n");
  1169. + bphy_err(drvr, "No result for wowl net detect\n");
  1170. else
  1171. wakeup_data.net_detect = cfg->wowl.nd_info;
  1172. }
  1173. @@ -3763,6 +3790,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
  1174. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1175. struct brcmf_if *ifp = netdev_priv(ndev);
  1176. struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0];
  1177. + struct brcmf_pub *drvr = cfg->pub;
  1178. s32 err;
  1179. u32 npmk, i;
  1180. @@ -3782,7 +3810,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
  1181. cfg->pmk_list.npmk = cpu_to_le32(npmk);
  1182. }
  1183. } else {
  1184. - bphy_err(wiphy, "Too many PMKSA entries cached %d\n", npmk);
  1185. + bphy_err(drvr, "Too many PMKSA entries cached %d\n", npmk);
  1186. return -EINVAL;
  1187. }
  1188. @@ -3805,6 +3833,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
  1189. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1190. struct brcmf_if *ifp = netdev_priv(ndev);
  1191. struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0];
  1192. + struct brcmf_pub *drvr = cfg->pub;
  1193. s32 err;
  1194. u32 npmk, i;
  1195. @@ -3828,7 +3857,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
  1196. memset(&pmk[i], 0, sizeof(*pmk));
  1197. cfg->pmk_list.npmk = cpu_to_le32(npmk - 1);
  1198. } else {
  1199. - bphy_err(wiphy, "Cache entry not found\n");
  1200. + bphy_err(drvr, "Cache entry not found\n");
  1201. return -EINVAL;
  1202. }
  1203. @@ -3860,20 +3889,20 @@ brcmf_cfg80211_flush_pmksa(struct wiphy
  1204. static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
  1205. {
  1206. - struct wiphy *wiphy = ifp->drvr->wiphy;
  1207. + struct brcmf_pub *drvr = ifp->drvr;
  1208. s32 err;
  1209. s32 wpa_val;
  1210. /* set auth */
  1211. err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0);
  1212. if (err < 0) {
  1213. - bphy_err(wiphy, "auth error %d\n", err);
  1214. + bphy_err(drvr, "auth error %d\n", err);
  1215. return err;
  1216. }
  1217. /* set wsec */
  1218. err = brcmf_fil_bsscfg_int_set(ifp, "wsec", 0);
  1219. if (err < 0) {
  1220. - bphy_err(wiphy, "wsec error %d\n", err);
  1221. + bphy_err(drvr, "wsec error %d\n", err);
  1222. return err;
  1223. }
  1224. /* set upper-layer auth */
  1225. @@ -3883,7 +3912,7 @@ static s32 brcmf_configure_opensecurity(
  1226. wpa_val = WPA_AUTH_DISABLED;
  1227. err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_val);
  1228. if (err < 0) {
  1229. - bphy_err(wiphy, "wpa_auth error %d\n", err);
  1230. + bphy_err(drvr, "wpa_auth error %d\n", err);
  1231. return err;
  1232. }
  1233. @@ -3903,7 +3932,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1234. const struct brcmf_vs_tlv *wpa_ie,
  1235. bool is_rsn_ie)
  1236. {
  1237. - struct wiphy *wiphy = ifp->drvr->wiphy;
  1238. + struct brcmf_pub *drvr = ifp->drvr;
  1239. u32 auth = 0; /* d11 open authentication */
  1240. u16 count;
  1241. s32 err = 0;
  1242. @@ -3934,13 +3963,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1243. /* check for multicast cipher suite */
  1244. if (offset + WPA_IE_MIN_OUI_LEN > len) {
  1245. err = -EINVAL;
  1246. - bphy_err(wiphy, "no multicast cipher suite\n");
  1247. + bphy_err(drvr, "no multicast cipher suite\n");
  1248. goto exit;
  1249. }
  1250. if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
  1251. err = -EINVAL;
  1252. - bphy_err(wiphy, "ivalid OUI\n");
  1253. + bphy_err(drvr, "ivalid OUI\n");
  1254. goto exit;
  1255. }
  1256. offset += TLV_OUI_LEN;
  1257. @@ -3962,7 +3991,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1258. break;
  1259. default:
  1260. err = -EINVAL;
  1261. - bphy_err(wiphy, "Invalid multi cast cipher info\n");
  1262. + bphy_err(drvr, "Invalid multi cast cipher info\n");
  1263. goto exit;
  1264. }
  1265. @@ -3973,13 +4002,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1266. /* Check for unicast suite(s) */
  1267. if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
  1268. err = -EINVAL;
  1269. - bphy_err(wiphy, "no unicast cipher suite\n");
  1270. + bphy_err(drvr, "no unicast cipher suite\n");
  1271. goto exit;
  1272. }
  1273. for (i = 0; i < count; i++) {
  1274. if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
  1275. err = -EINVAL;
  1276. - bphy_err(wiphy, "ivalid OUI\n");
  1277. + bphy_err(drvr, "ivalid OUI\n");
  1278. goto exit;
  1279. }
  1280. offset += TLV_OUI_LEN;
  1281. @@ -3997,7 +4026,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1282. pval |= AES_ENABLED;
  1283. break;
  1284. default:
  1285. - bphy_err(wiphy, "Invalid unicast security info\n");
  1286. + bphy_err(drvr, "Invalid unicast security info\n");
  1287. }
  1288. offset++;
  1289. }
  1290. @@ -4007,13 +4036,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1291. /* Check for auth key management suite(s) */
  1292. if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
  1293. err = -EINVAL;
  1294. - bphy_err(wiphy, "no auth key mgmt suite\n");
  1295. + bphy_err(drvr, "no auth key mgmt suite\n");
  1296. goto exit;
  1297. }
  1298. for (i = 0; i < count; i++) {
  1299. if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
  1300. err = -EINVAL;
  1301. - bphy_err(wiphy, "ivalid OUI\n");
  1302. + bphy_err(drvr, "ivalid OUI\n");
  1303. goto exit;
  1304. }
  1305. offset += TLV_OUI_LEN;
  1306. @@ -4041,7 +4070,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1307. wpa_auth |= WPA2_AUTH_1X_SHA256;
  1308. break;
  1309. default:
  1310. - bphy_err(wiphy, "Invalid key mgmt info\n");
  1311. + bphy_err(drvr, "Invalid key mgmt info\n");
  1312. }
  1313. offset++;
  1314. }
  1315. @@ -4083,7 +4112,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1316. err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable",
  1317. wme_bss_disable);
  1318. if (err < 0) {
  1319. - bphy_err(wiphy, "wme_bss_disable error %d\n", err);
  1320. + bphy_err(drvr, "wme_bss_disable error %d\n", err);
  1321. goto exit;
  1322. }
  1323. @@ -4097,7 +4126,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1324. &data[offset],
  1325. WPA_IE_MIN_OUI_LEN);
  1326. if (err < 0) {
  1327. - bphy_err(wiphy, "bip error %d\n", err);
  1328. + bphy_err(drvr, "bip error %d\n", err);
  1329. goto exit;
  1330. }
  1331. }
  1332. @@ -4108,13 +4137,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1333. /* set auth */
  1334. err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth);
  1335. if (err < 0) {
  1336. - bphy_err(wiphy, "auth error %d\n", err);
  1337. + bphy_err(drvr, "auth error %d\n", err);
  1338. goto exit;
  1339. }
  1340. /* set wsec */
  1341. err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
  1342. if (err < 0) {
  1343. - bphy_err(wiphy, "wsec error %d\n", err);
  1344. + bphy_err(drvr, "wsec error %d\n", err);
  1345. goto exit;
  1346. }
  1347. /* Configure MFP, this needs to go after wsec otherwise the wsec command
  1348. @@ -4123,14 +4152,14 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1349. if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) {
  1350. err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp);
  1351. if (err < 0) {
  1352. - bphy_err(wiphy, "mfp error %d\n", err);
  1353. + bphy_err(drvr, "mfp error %d\n", err);
  1354. goto exit;
  1355. }
  1356. }
  1357. /* set upper-layer auth */
  1358. err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth);
  1359. if (err < 0) {
  1360. - bphy_err(wiphy, "wpa_auth error %d\n", err);
  1361. + bphy_err(drvr, "wpa_auth error %d\n", err);
  1362. goto exit;
  1363. }
  1364. @@ -4216,8 +4245,8 @@ brcmf_vndr_ie(u8 *iebuf, s32 pktflag, u8
  1365. s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag,
  1366. const u8 *vndr_ie_buf, u32 vndr_ie_len)
  1367. {
  1368. + struct brcmf_pub *drvr;
  1369. struct brcmf_if *ifp;
  1370. - struct wiphy *wiphy;
  1371. struct vif_saved_ie *saved_ie;
  1372. s32 err = 0;
  1373. u8 *iovar_ie_buf;
  1374. @@ -4238,7 +4267,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
  1375. if (!vif)
  1376. return -ENODEV;
  1377. ifp = vif->ifp;
  1378. - wiphy = ifp->drvr->wiphy;
  1379. + drvr = ifp->drvr;
  1380. saved_ie = &vif->saved_ie;
  1381. brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx,
  1382. @@ -4270,13 +4299,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
  1383. break;
  1384. default:
  1385. err = -EPERM;
  1386. - bphy_err(wiphy, "not suitable type\n");
  1387. + bphy_err(drvr, "not suitable type\n");
  1388. goto exit;
  1389. }
  1390. if (vndr_ie_len > mgmt_ie_buf_len) {
  1391. err = -ENOMEM;
  1392. - bphy_err(wiphy, "extra IE size too big\n");
  1393. + bphy_err(drvr, "extra IE size too big\n");
  1394. goto exit;
  1395. }
  1396. @@ -4337,7 +4366,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
  1397. /* verify remained buf size before copy data */
  1398. if (remained_buf_len < (vndrie_info->vndrie.len +
  1399. VNDR_IE_VSIE_OFFSET)) {
  1400. - bphy_err(wiphy, "no space in mgmt_ie_buf: len left %d",
  1401. + bphy_err(drvr, "no space in mgmt_ie_buf: len left %d",
  1402. remained_buf_len);
  1403. break;
  1404. }
  1405. @@ -4369,7 +4398,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
  1406. err = brcmf_fil_bsscfg_data_set(ifp, "vndr_ie", iovar_ie_buf,
  1407. total_ie_buf_len);
  1408. if (err)
  1409. - bphy_err(wiphy, "vndr ie set error : %d\n", err);
  1410. + bphy_err(drvr, "vndr ie set error : %d\n", err);
  1411. }
  1412. exit:
  1413. @@ -4397,14 +4426,14 @@ static s32
  1414. brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif,
  1415. struct cfg80211_beacon_data *beacon)
  1416. {
  1417. - struct wiphy *wiphy = vif->ifp->drvr->wiphy;
  1418. + struct brcmf_pub *drvr = vif->ifp->drvr;
  1419. s32 err;
  1420. /* Set Beacon IEs to FW */
  1421. err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_BEACON_FLAG,
  1422. beacon->tail, beacon->tail_len);
  1423. if (err) {
  1424. - bphy_err(wiphy, "Set Beacon IE Failed\n");
  1425. + bphy_err(drvr, "Set Beacon IE Failed\n");
  1426. return err;
  1427. }
  1428. brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n");
  1429. @@ -4414,7 +4443,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg
  1430. beacon->proberesp_ies,
  1431. beacon->proberesp_ies_len);
  1432. if (err)
  1433. - bphy_err(wiphy, "Set Probe Resp IE Failed\n");
  1434. + bphy_err(drvr, "Set Probe Resp IE Failed\n");
  1435. else
  1436. brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n");
  1437. @@ -4428,6 +4457,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1438. s32 ie_offset;
  1439. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1440. struct brcmf_if *ifp = netdev_priv(ndev);
  1441. + struct brcmf_pub *drvr = cfg->pub;
  1442. const struct brcmf_tlv *ssid_ie;
  1443. const struct brcmf_tlv *country_ie;
  1444. struct brcmf_ssid_le ssid_le;
  1445. @@ -4523,7 +4553,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1446. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
  1447. is_11d);
  1448. if (err < 0) {
  1449. - bphy_err(wiphy, "Regulatory Set Error, %d\n",
  1450. + bphy_err(drvr, "Regulatory Set Error, %d\n",
  1451. err);
  1452. goto exit;
  1453. }
  1454. @@ -4532,7 +4562,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1455. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD,
  1456. settings->beacon_interval);
  1457. if (err < 0) {
  1458. - bphy_err(wiphy, "Beacon Interval Set Error, %d\n",
  1459. + bphy_err(drvr, "Beacon Interval Set Error, %d\n",
  1460. err);
  1461. goto exit;
  1462. }
  1463. @@ -4541,7 +4571,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1464. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD,
  1465. settings->dtim_period);
  1466. if (err < 0) {
  1467. - bphy_err(wiphy, "DTIM Interval Set Error, %d\n",
  1468. + bphy_err(drvr, "DTIM Interval Set Error, %d\n",
  1469. err);
  1470. goto exit;
  1471. }
  1472. @@ -4552,7 +4582,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1473. !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB))) {
  1474. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
  1475. if (err < 0) {
  1476. - bphy_err(wiphy, "BRCMF_C_DOWN error %d\n",
  1477. + bphy_err(drvr, "BRCMF_C_DOWN error %d\n",
  1478. err);
  1479. goto exit;
  1480. }
  1481. @@ -4561,7 +4591,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1482. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1);
  1483. if (err < 0) {
  1484. - bphy_err(wiphy, "SET INFRA error %d\n", err);
  1485. + bphy_err(drvr, "SET INFRA error %d\n", err);
  1486. goto exit;
  1487. }
  1488. } else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) {
  1489. @@ -4577,7 +4607,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1490. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
  1491. if (err < 0) {
  1492. - bphy_err(wiphy, "setting AP mode failed %d\n",
  1493. + bphy_err(drvr, "setting AP mode failed %d\n",
  1494. err);
  1495. goto exit;
  1496. }
  1497. @@ -4587,14 +4617,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1498. */
  1499. err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
  1500. if (err < 0) {
  1501. - bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
  1502. + bphy_err(drvr, "Set Channel failed: chspec=%d, %d\n",
  1503. chanspec, err);
  1504. goto exit;
  1505. }
  1506. }
  1507. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
  1508. if (err < 0) {
  1509. - bphy_err(wiphy, "BRCMF_C_UP error (%d)\n", err);
  1510. + bphy_err(drvr, "BRCMF_C_UP error (%d)\n", err);
  1511. goto exit;
  1512. }
  1513. /* On DOWN the firmware removes the WEP keys, reconfigure
  1514. @@ -4609,14 +4639,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1515. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
  1516. &join_params, sizeof(join_params));
  1517. if (err < 0) {
  1518. - bphy_err(wiphy, "SET SSID error (%d)\n", err);
  1519. + bphy_err(drvr, "SET SSID error (%d)\n", err);
  1520. goto exit;
  1521. }
  1522. if (settings->hidden_ssid) {
  1523. err = brcmf_fil_iovar_int_set(ifp, "closednet", 1);
  1524. if (err) {
  1525. - bphy_err(wiphy, "closednet error (%d)\n", err);
  1526. + bphy_err(drvr, "closednet error (%d)\n", err);
  1527. goto exit;
  1528. }
  1529. }
  1530. @@ -4625,14 +4655,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1531. } else if (dev_role == NL80211_IFTYPE_P2P_GO) {
  1532. err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
  1533. if (err < 0) {
  1534. - bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
  1535. + bphy_err(drvr, "Set Channel failed: chspec=%d, %d\n",
  1536. chanspec, err);
  1537. goto exit;
  1538. }
  1539. err = brcmf_fil_bsscfg_data_set(ifp, "ssid", &ssid_le,
  1540. sizeof(ssid_le));
  1541. if (err < 0) {
  1542. - bphy_err(wiphy, "setting ssid failed %d\n", err);
  1543. + bphy_err(drvr, "setting ssid failed %d\n", err);
  1544. goto exit;
  1545. }
  1546. bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
  1547. @@ -4640,7 +4670,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1548. err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
  1549. sizeof(bss_enable));
  1550. if (err < 0) {
  1551. - bphy_err(wiphy, "bss_enable config failed %d\n", err);
  1552. + bphy_err(drvr, "bss_enable config failed %d\n", err);
  1553. goto exit;
  1554. }
  1555. @@ -4663,7 +4693,9 @@ exit:
  1556. static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
  1557. {
  1558. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1559. struct brcmf_if *ifp = netdev_priv(ndev);
  1560. + struct brcmf_pub *drvr = cfg->pub;
  1561. s32 err;
  1562. struct brcmf_fil_bss_enable_le bss_enable;
  1563. struct brcmf_join_params join_params;
  1564. @@ -4688,13 +4720,13 @@ static int brcmf_cfg80211_stop_ap(struct
  1565. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
  1566. &join_params, sizeof(join_params));
  1567. if (err < 0)
  1568. - bphy_err(wiphy, "SET SSID error (%d)\n", err);
  1569. + bphy_err(drvr, "SET SSID error (%d)\n", err);
  1570. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
  1571. if (err < 0)
  1572. - bphy_err(wiphy, "BRCMF_C_DOWN error %d\n", err);
  1573. + bphy_err(drvr, "BRCMF_C_DOWN error %d\n", err);
  1574. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
  1575. if (err < 0)
  1576. - bphy_err(wiphy, "setting AP mode failed %d\n", err);
  1577. + bphy_err(drvr, "setting AP mode failed %d\n", err);
  1578. if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
  1579. brcmf_fil_iovar_int_set(ifp, "mbss", 0);
  1580. brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
  1581. @@ -4702,7 +4734,7 @@ static int brcmf_cfg80211_stop_ap(struct
  1582. /* Bring device back up so it can be used again */
  1583. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
  1584. if (err < 0)
  1585. - bphy_err(wiphy, "BRCMF_C_UP error %d\n", err);
  1586. + bphy_err(drvr, "BRCMF_C_UP error %d\n", err);
  1587. brcmf_vif_clear_mgmt_ies(ifp->vif);
  1588. } else {
  1589. @@ -4711,7 +4743,7 @@ static int brcmf_cfg80211_stop_ap(struct
  1590. err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
  1591. sizeof(bss_enable));
  1592. if (err < 0)
  1593. - bphy_err(wiphy, "bss_enable config failed %d\n", err);
  1594. + bphy_err(drvr, "bss_enable config failed %d\n", err);
  1595. }
  1596. brcmf_set_mpc(ifp, 1);
  1597. brcmf_configure_arp_nd_offload(ifp, true);
  1598. @@ -4740,6 +4772,7 @@ brcmf_cfg80211_del_station(struct wiphy
  1599. struct station_del_parameters *params)
  1600. {
  1601. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1602. + struct brcmf_pub *drvr = cfg->pub;
  1603. struct brcmf_scb_val_le scbval;
  1604. struct brcmf_if *ifp = netdev_priv(ndev);
  1605. s32 err;
  1606. @@ -4759,7 +4792,7 @@ brcmf_cfg80211_del_station(struct wiphy
  1607. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON,
  1608. &scbval, sizeof(scbval));
  1609. if (err)
  1610. - bphy_err(wiphy, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
  1611. + bphy_err(drvr, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
  1612. err);
  1613. brcmf_dbg(TRACE, "Exit\n");
  1614. @@ -4770,6 +4803,8 @@ static int
  1615. brcmf_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev,
  1616. const u8 *mac, struct station_parameters *params)
  1617. {
  1618. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1619. + struct brcmf_pub *drvr = cfg->pub;
  1620. struct brcmf_if *ifp = netdev_priv(ndev);
  1621. s32 err;
  1622. @@ -4790,7 +4825,7 @@ brcmf_cfg80211_change_station(struct wip
  1623. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SCB_DEAUTHORIZE,
  1624. (void *)mac, ETH_ALEN);
  1625. if (err < 0)
  1626. - bphy_err(wiphy, "Setting SCB (de-)authorize failed, %d\n", err);
  1627. + bphy_err(drvr, "Setting SCB (de-)authorize failed, %d\n", err);
  1628. return err;
  1629. }
  1630. @@ -4820,6 +4855,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
  1631. {
  1632. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1633. struct ieee80211_channel *chan = params->chan;
  1634. + struct brcmf_pub *drvr = cfg->pub;
  1635. const u8 *buf = params->buf;
  1636. size_t len = params->len;
  1637. const struct ieee80211_mgmt *mgmt;
  1638. @@ -4840,7 +4876,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
  1639. mgmt = (const struct ieee80211_mgmt *)buf;
  1640. if (!ieee80211_is_mgmt(mgmt->frame_control)) {
  1641. - bphy_err(wiphy, "Driver only allows MGMT packet type\n");
  1642. + bphy_err(drvr, "Driver only allows MGMT packet type\n");
  1643. return -EPERM;
  1644. }
  1645. @@ -4871,13 +4907,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
  1646. GFP_KERNEL);
  1647. } else if (ieee80211_is_action(mgmt->frame_control)) {
  1648. if (len > BRCMF_FIL_ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN) {
  1649. - bphy_err(wiphy, "invalid action frame length\n");
  1650. + bphy_err(drvr, "invalid action frame length\n");
  1651. err = -EINVAL;
  1652. goto exit;
  1653. }
  1654. af_params = kzalloc(sizeof(*af_params), GFP_KERNEL);
  1655. if (af_params == NULL) {
  1656. - bphy_err(wiphy, "unable to allocate frame\n");
  1657. + bphy_err(drvr, "unable to allocate frame\n");
  1658. err = -ENOMEM;
  1659. goto exit;
  1660. }
  1661. @@ -4928,6 +4964,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
  1662. u64 cookie)
  1663. {
  1664. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1665. + struct brcmf_pub *drvr = cfg->pub;
  1666. struct brcmf_cfg80211_vif *vif;
  1667. int err = 0;
  1668. @@ -4935,7 +4972,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
  1669. vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
  1670. if (vif == NULL) {
  1671. - bphy_err(wiphy, "No p2p device available for probe response\n");
  1672. + bphy_err(drvr, "No p2p device available for probe response\n");
  1673. err = -ENODEV;
  1674. goto exit;
  1675. }
  1676. @@ -4950,6 +4987,7 @@ static int brcmf_cfg80211_get_channel(st
  1677. {
  1678. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1679. struct net_device *ndev = wdev->netdev;
  1680. + struct brcmf_pub *drvr = cfg->pub;
  1681. struct brcmf_if *ifp;
  1682. struct brcmu_chan ch;
  1683. enum nl80211_band band = 0;
  1684. @@ -4963,7 +5001,7 @@ static int brcmf_cfg80211_get_channel(st
  1685. err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
  1686. if (err) {
  1687. - bphy_err(wiphy, "chanspec failed (%d)\n", err);
  1688. + bphy_err(drvr, "chanspec failed (%d)\n", err);
  1689. return err;
  1690. }
  1691. @@ -5085,6 +5123,8 @@ static int brcmf_cfg80211_tdls_oper(stru
  1692. struct net_device *ndev, const u8 *peer,
  1693. enum nl80211_tdls_operation oper)
  1694. {
  1695. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1696. + struct brcmf_pub *drvr = cfg->pub;
  1697. struct brcmf_if *ifp;
  1698. struct brcmf_tdls_iovar_le info;
  1699. int ret = 0;
  1700. @@ -5102,7 +5142,7 @@ static int brcmf_cfg80211_tdls_oper(stru
  1701. ret = brcmf_fil_iovar_data_set(ifp, "tdls_endpoint",
  1702. &info, sizeof(info));
  1703. if (ret < 0)
  1704. - bphy_err(wiphy, "tdls_endpoint iovar failed: ret=%d\n", ret);
  1705. + bphy_err(drvr, "tdls_endpoint iovar failed: ret=%d\n", ret);
  1706. return ret;
  1707. }
  1708. @@ -5113,6 +5153,8 @@ brcmf_cfg80211_update_conn_params(struct
  1709. struct cfg80211_connect_params *sme,
  1710. u32 changed)
  1711. {
  1712. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1713. + struct brcmf_pub *drvr = cfg->pub;
  1714. struct brcmf_if *ifp;
  1715. int err;
  1716. @@ -5123,7 +5165,7 @@ brcmf_cfg80211_update_conn_params(struct
  1717. err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
  1718. sme->ie, sme->ie_len);
  1719. if (err)
  1720. - bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
  1721. + bphy_err(drvr, "Set Assoc REQ IE Failed\n");
  1722. else
  1723. brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
  1724. @@ -5135,6 +5177,8 @@ static int
  1725. brcmf_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *ndev,
  1726. struct cfg80211_gtk_rekey_data *gtk)
  1727. {
  1728. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1729. + struct brcmf_pub *drvr = cfg->pub;
  1730. struct brcmf_if *ifp = netdev_priv(ndev);
  1731. struct brcmf_gtk_keyinfo_le gtk_le;
  1732. int ret;
  1733. @@ -5149,7 +5193,7 @@ brcmf_cfg80211_set_rekey_data(struct wip
  1734. ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", &gtk_le,
  1735. sizeof(gtk_le));
  1736. if (ret < 0)
  1737. - bphy_err(wiphy, "gtk_key_info iovar failed: ret=%d\n", ret);
  1738. + bphy_err(drvr, "gtk_key_info iovar failed: ret=%d\n", ret);
  1739. return ret;
  1740. }
  1741. @@ -5381,7 +5425,7 @@ static void brcmf_clear_assoc_ies(struct
  1742. static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg,
  1743. struct brcmf_if *ifp)
  1744. {
  1745. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1746. + struct brcmf_pub *drvr = cfg->pub;
  1747. struct brcmf_cfg80211_assoc_ielen_le *assoc_info;
  1748. struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg);
  1749. u32 req_len;
  1750. @@ -5393,7 +5437,7 @@ static s32 brcmf_get_assoc_ies(struct br
  1751. err = brcmf_fil_iovar_data_get(ifp, "assoc_info",
  1752. cfg->extra_buf, WL_ASSOC_INFO_MAX);
  1753. if (err) {
  1754. - bphy_err(wiphy, "could not get assoc info (%d)\n", err);
  1755. + bphy_err(drvr, "could not get assoc info (%d)\n", err);
  1756. return err;
  1757. }
  1758. assoc_info =
  1759. @@ -5405,7 +5449,7 @@ static s32 brcmf_get_assoc_ies(struct br
  1760. cfg->extra_buf,
  1761. WL_ASSOC_INFO_MAX);
  1762. if (err) {
  1763. - bphy_err(wiphy, "could not get assoc req (%d)\n", err);
  1764. + bphy_err(drvr, "could not get assoc req (%d)\n", err);
  1765. return err;
  1766. }
  1767. conn_info->req_ie_len = req_len;
  1768. @@ -5421,7 +5465,7 @@ static s32 brcmf_get_assoc_ies(struct br
  1769. cfg->extra_buf,
  1770. WL_ASSOC_INFO_MAX);
  1771. if (err) {
  1772. - bphy_err(wiphy, "could not get assoc resp (%d)\n", err);
  1773. + bphy_err(drvr, "could not get assoc resp (%d)\n", err);
  1774. return err;
  1775. }
  1776. conn_info->resp_ie_len = resp_len;
  1777. @@ -5548,7 +5592,7 @@ brcmf_notify_connect_status_ap(struct br
  1778. struct net_device *ndev,
  1779. const struct brcmf_event_msg *e, void *data)
  1780. {
  1781. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1782. + struct brcmf_pub *drvr = cfg->pub;
  1783. static int generation;
  1784. u32 event = e->event_code;
  1785. u32 reason = e->reason;
  1786. @@ -5566,7 +5610,7 @@ brcmf_notify_connect_status_ap(struct br
  1787. if (((event == BRCMF_E_ASSOC_IND) || (event == BRCMF_E_REASSOC_IND)) &&
  1788. (reason == BRCMF_E_STATUS_SUCCESS)) {
  1789. if (!data) {
  1790. - bphy_err(wiphy, "No IEs present in ASSOC/REASSOC_IND\n");
  1791. + bphy_err(drvr, "No IEs present in ASSOC/REASSOC_IND\n");
  1792. return -EINVAL;
  1793. }
  1794. @@ -5858,7 +5902,7 @@ static void init_vif_event(struct brcmf_
  1795. static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
  1796. {
  1797. - struct wiphy *wiphy = ifp->drvr->wiphy;
  1798. + struct brcmf_pub *drvr = ifp->drvr;
  1799. s32 err;
  1800. u32 bcn_timeout;
  1801. __le32 roamtrigger[2];
  1802. @@ -5871,7 +5915,7 @@ static s32 brcmf_dongle_roam(struct brcm
  1803. bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON;
  1804. err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout);
  1805. if (err) {
  1806. - bphy_err(wiphy, "bcn_timeout error (%d)\n", err);
  1807. + bphy_err(drvr, "bcn_timeout error (%d)\n", err);
  1808. goto roam_setup_done;
  1809. }
  1810. @@ -5883,7 +5927,7 @@ static s32 brcmf_dongle_roam(struct brcm
  1811. err = brcmf_fil_iovar_int_set(ifp, "roam_off",
  1812. ifp->drvr->settings->roamoff);
  1813. if (err) {
  1814. - bphy_err(wiphy, "roam_off error (%d)\n", err);
  1815. + bphy_err(drvr, "roam_off error (%d)\n", err);
  1816. goto roam_setup_done;
  1817. }
  1818. @@ -5892,7 +5936,7 @@ static s32 brcmf_dongle_roam(struct brcm
  1819. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER,
  1820. (void *)roamtrigger, sizeof(roamtrigger));
  1821. if (err) {
  1822. - bphy_err(wiphy, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
  1823. + bphy_err(drvr, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
  1824. goto roam_setup_done;
  1825. }
  1826. @@ -5901,7 +5945,7 @@ static s32 brcmf_dongle_roam(struct brcm
  1827. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA,
  1828. (void *)roam_delta, sizeof(roam_delta));
  1829. if (err) {
  1830. - bphy_err(wiphy, "WLC_SET_ROAM_DELTA error (%d)\n", err);
  1831. + bphy_err(drvr, "WLC_SET_ROAM_DELTA error (%d)\n", err);
  1832. goto roam_setup_done;
  1833. }
  1834. @@ -5912,26 +5956,26 @@ roam_setup_done:
  1835. static s32
  1836. brcmf_dongle_scantime(struct brcmf_if *ifp)
  1837. {
  1838. - struct wiphy *wiphy = ifp->drvr->wiphy;
  1839. + struct brcmf_pub *drvr = ifp->drvr;
  1840. s32 err = 0;
  1841. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME,
  1842. BRCMF_SCAN_CHANNEL_TIME);
  1843. if (err) {
  1844. - bphy_err(wiphy, "Scan assoc time error (%d)\n", err);
  1845. + bphy_err(drvr, "Scan assoc time error (%d)\n", err);
  1846. goto dongle_scantime_out;
  1847. }
  1848. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME,
  1849. BRCMF_SCAN_UNASSOC_TIME);
  1850. if (err) {
  1851. - bphy_err(wiphy, "Scan unassoc time error (%d)\n", err);
  1852. + bphy_err(drvr, "Scan unassoc time error (%d)\n", err);
  1853. goto dongle_scantime_out;
  1854. }
  1855. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_PASSIVE_TIME,
  1856. BRCMF_SCAN_PASSIVE_TIME);
  1857. if (err) {
  1858. - bphy_err(wiphy, "Scan passive time error (%d)\n", err);
  1859. + bphy_err(drvr, "Scan passive time error (%d)\n", err);
  1860. goto dongle_scantime_out;
  1861. }
  1862. @@ -5964,7 +6008,8 @@ static int brcmf_construct_chaninfo(stru
  1863. u32 bw_cap[])
  1864. {
  1865. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1866. - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
  1867. + struct brcmf_pub *drvr = cfg->pub;
  1868. + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
  1869. struct ieee80211_supported_band *band;
  1870. struct ieee80211_channel *channel;
  1871. struct brcmf_chanspec_list *list;
  1872. @@ -5985,7 +6030,7 @@ static int brcmf_construct_chaninfo(stru
  1873. err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
  1874. BRCMF_DCMD_MEDLEN);
  1875. if (err) {
  1876. - bphy_err(wiphy, "get chanspecs error (%d)\n", err);
  1877. + bphy_err(drvr, "get chanspecs error (%d)\n", err);
  1878. goto fail_pbuf;
  1879. }
  1880. @@ -6008,7 +6053,7 @@ static int brcmf_construct_chaninfo(stru
  1881. } else if (ch.band == BRCMU_CHAN_BAND_5G) {
  1882. band = wiphy->bands[NL80211_BAND_5GHZ];
  1883. } else {
  1884. - bphy_err(wiphy, "Invalid channel Spec. 0x%x.\n",
  1885. + bphy_err(drvr, "Invalid channel Spec. 0x%x.\n",
  1886. ch.chspec);
  1887. continue;
  1888. }
  1889. @@ -6032,7 +6077,7 @@ static int brcmf_construct_chaninfo(stru
  1890. /* It seems firmware supports some channel we never
  1891. * considered. Something new in IEEE standard?
  1892. */
  1893. - bphy_err(wiphy, "Ignoring unexpected firmware channel %d\n",
  1894. + bphy_err(drvr, "Ignoring unexpected firmware channel %d\n",
  1895. ch.control_ch_num);
  1896. continue;
  1897. }
  1898. @@ -6089,8 +6134,8 @@ fail_pbuf:
  1899. static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
  1900. {
  1901. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1902. - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
  1903. + struct brcmf_pub *drvr = cfg->pub;
  1904. + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
  1905. struct ieee80211_supported_band *band;
  1906. struct brcmf_fil_bwcap_le band_bwcap;
  1907. struct brcmf_chanspec_list *list;
  1908. @@ -6136,7 +6181,7 @@ static int brcmf_enable_bw40_2g(struct b
  1909. err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
  1910. BRCMF_DCMD_MEDLEN);
  1911. if (err) {
  1912. - bphy_err(wiphy, "get chanspecs error (%d)\n", err);
  1913. + bphy_err(drvr, "get chanspecs error (%d)\n", err);
  1914. kfree(pbuf);
  1915. return err;
  1916. }
  1917. @@ -6167,7 +6212,7 @@ static int brcmf_enable_bw40_2g(struct b
  1918. static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[])
  1919. {
  1920. - struct wiphy *wiphy = ifp->drvr->wiphy;
  1921. + struct brcmf_pub *drvr = ifp->drvr;
  1922. u32 band, mimo_bwcap;
  1923. int err;
  1924. @@ -6203,7 +6248,7 @@ static void brcmf_get_bwcap(struct brcmf
  1925. bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT;
  1926. break;
  1927. default:
  1928. - bphy_err(wiphy, "invalid mimo_bw_cap value\n");
  1929. + bphy_err(drvr, "invalid mimo_bw_cap value\n");
  1930. }
  1931. }
  1932. @@ -6278,7 +6323,8 @@ static void brcmf_update_vht_cap(struct
  1933. static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
  1934. {
  1935. - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
  1936. + struct brcmf_pub *drvr = cfg->pub;
  1937. + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
  1938. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1939. u32 nmode = 0;
  1940. u32 vhtmode = 0;
  1941. @@ -6295,7 +6341,7 @@ static int brcmf_setup_wiphybands(struct
  1942. (void)brcmf_fil_iovar_int_get(ifp, "vhtmode", &vhtmode);
  1943. err = brcmf_fil_iovar_int_get(ifp, "nmode", &nmode);
  1944. if (err) {
  1945. - bphy_err(wiphy, "nmode error (%d)\n", err);
  1946. + bphy_err(drvr, "nmode error (%d)\n", err);
  1947. } else {
  1948. brcmf_get_bwcap(ifp, bw_cap);
  1949. }
  1950. @@ -6305,7 +6351,7 @@ static int brcmf_setup_wiphybands(struct
  1951. err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain);
  1952. if (err) {
  1953. - bphy_err(wiphy, "rxchain error (%d)\n", err);
  1954. + bphy_err(drvr, "rxchain error (%d)\n", err);
  1955. nchain = 1;
  1956. } else {
  1957. for (nchain = 0; rxchain; nchain++)
  1958. @@ -6315,7 +6361,7 @@ static int brcmf_setup_wiphybands(struct
  1959. err = brcmf_construct_chaninfo(cfg, bw_cap);
  1960. if (err) {
  1961. - bphy_err(wiphy, "brcmf_construct_chaninfo failed (%d)\n", err);
  1962. + bphy_err(drvr, "brcmf_construct_chaninfo failed (%d)\n", err);
  1963. return err;
  1964. }
  1965. @@ -6522,12 +6568,13 @@ static void brcmf_wiphy_wowl_params(stru
  1966. {
  1967. #ifdef CONFIG_PM
  1968. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1969. + struct brcmf_pub *drvr = cfg->pub;
  1970. struct wiphy_wowlan_support *wowl;
  1971. wowl = kmemdup(&brcmf_wowlan_support, sizeof(brcmf_wowlan_support),
  1972. GFP_KERNEL);
  1973. if (!wowl) {
  1974. - bphy_err(wiphy, "only support basic wowlan features\n");
  1975. + bphy_err(drvr, "only support basic wowlan features\n");
  1976. wiphy->wowlan = &brcmf_wowlan_support;
  1977. return;
  1978. }
  1979. @@ -6624,7 +6671,7 @@ static int brcmf_setup_wiphy(struct wiph
  1980. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist,
  1981. sizeof(bandlist));
  1982. if (err) {
  1983. - bphy_err(wiphy, "could not obtain band info: err=%d\n", err);
  1984. + bphy_err(drvr, "could not obtain band info: err=%d\n", err);
  1985. return err;
  1986. }
  1987. /* first entry in bandlist is number of bands */
  1988. @@ -6673,7 +6720,7 @@ static int brcmf_setup_wiphy(struct wiph
  1989. static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
  1990. {
  1991. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1992. + struct brcmf_pub *drvr = cfg->pub;
  1993. struct net_device *ndev;
  1994. struct wireless_dev *wdev;
  1995. struct brcmf_if *ifp;
  1996. @@ -6711,7 +6758,7 @@ static s32 brcmf_config_dongle(struct br
  1997. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1);
  1998. if (err) {
  1999. - bphy_err(wiphy, "failed to set frameburst mode\n");
  2000. + bphy_err(drvr, "failed to set frameburst mode\n");
  2001. goto default_conf_out;
  2002. }
  2003. @@ -6892,6 +6939,7 @@ static void brcmf_cfg80211_reg_notifier(
  2004. {
  2005. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  2006. struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
  2007. + struct brcmf_pub *drvr = cfg->pub;
  2008. struct brcmf_fil_country_le ccreq;
  2009. s32 err;
  2010. int i;
  2011. @@ -6903,7 +6951,7 @@ static void brcmf_cfg80211_reg_notifier(
  2012. /* ignore non-ISO3166 country codes */
  2013. for (i = 0; i < 2; i++)
  2014. if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
  2015. - bphy_err(wiphy, "not an ISO3166 code (0x%02x 0x%02x)\n",
  2016. + bphy_err(drvr, "not an ISO3166 code (0x%02x 0x%02x)\n",
  2017. req->alpha2[0], req->alpha2[1]);
  2018. return;
  2019. }
  2020. @@ -6913,7 +6961,7 @@ static void brcmf_cfg80211_reg_notifier(
  2021. err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
  2022. if (err) {
  2023. - bphy_err(wiphy, "Country code iovar returned err = %d\n", err);
  2024. + bphy_err(drvr, "Country code iovar returned err = %d\n", err);
  2025. return;
  2026. }
  2027. @@ -6923,7 +6971,7 @@ static void brcmf_cfg80211_reg_notifier(
  2028. err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq));
  2029. if (err) {
  2030. - bphy_err(wiphy, "Firmware rejected country setting\n");
  2031. + bphy_err(drvr, "Firmware rejected country setting\n");
  2032. return;
  2033. }
  2034. brcmf_setup_wiphybands(cfg);
  2035. @@ -6969,13 +7017,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  2036. u16 *cap = NULL;
  2037. if (!ndev) {
  2038. - bphy_err(wiphy, "ndev is invalid\n");
  2039. + bphy_err(drvr, "ndev is invalid\n");
  2040. return NULL;
  2041. }
  2042. cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
  2043. if (!cfg) {
  2044. - bphy_err(wiphy, "Could not allocate wiphy device\n");
  2045. + bphy_err(drvr, "Could not allocate wiphy device\n");
  2046. return NULL;
  2047. }
  2048. @@ -6996,7 +7044,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  2049. err = wl_init_priv(cfg);
  2050. if (err) {
  2051. - bphy_err(wiphy, "Failed to init iwm_priv (%d)\n", err);
  2052. + bphy_err(drvr, "Failed to init iwm_priv (%d)\n", err);
  2053. brcmf_free_vif(vif);
  2054. goto wiphy_out;
  2055. }
  2056. @@ -7005,7 +7053,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  2057. /* determine d11 io type before wiphy setup */
  2058. err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_VERSION, &io_type);
  2059. if (err) {
  2060. - bphy_err(wiphy, "Failed to get D11 version (%d)\n", err);
  2061. + bphy_err(drvr, "Failed to get D11 version (%d)\n", err);
  2062. goto priv_out;
  2063. }
  2064. cfg->d11inf.io_type = (u8)io_type;
  2065. @@ -7039,13 +7087,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  2066. #endif
  2067. err = wiphy_register(wiphy);
  2068. if (err < 0) {
  2069. - bphy_err(wiphy, "Could not register wiphy device (%d)\n", err);
  2070. + bphy_err(drvr, "Could not register wiphy device (%d)\n", err);
  2071. goto priv_out;
  2072. }
  2073. err = brcmf_setup_wiphybands(cfg);
  2074. if (err) {
  2075. - bphy_err(wiphy, "Setting wiphy bands failed (%d)\n", err);
  2076. + bphy_err(drvr, "Setting wiphy bands failed (%d)\n", err);
  2077. goto wiphy_unreg_out;
  2078. }
  2079. @@ -7063,24 +7111,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  2080. err = brcmf_fweh_activate_events(ifp);
  2081. if (err) {
  2082. - bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
  2083. + bphy_err(drvr, "FWEH activation failed (%d)\n", err);
  2084. goto wiphy_unreg_out;
  2085. }
  2086. err = brcmf_p2p_attach(cfg, p2pdev_forced);
  2087. if (err) {
  2088. - bphy_err(wiphy, "P2P initialisation failed (%d)\n", err);
  2089. + bphy_err(drvr, "P2P initialisation failed (%d)\n", err);
  2090. goto wiphy_unreg_out;
  2091. }
  2092. err = brcmf_btcoex_attach(cfg);
  2093. if (err) {
  2094. - bphy_err(wiphy, "BT-coex initialisation failed (%d)\n", err);
  2095. + bphy_err(drvr, "BT-coex initialisation failed (%d)\n", err);
  2096. brcmf_p2p_detach(&cfg->p2p);
  2097. goto wiphy_unreg_out;
  2098. }
  2099. err = brcmf_pno_attach(cfg);
  2100. if (err) {
  2101. - bphy_err(wiphy, "PNO initialisation failed (%d)\n", err);
  2102. + bphy_err(drvr, "PNO initialisation failed (%d)\n", err);
  2103. brcmf_btcoex_detach(cfg);
  2104. brcmf_p2p_detach(&cfg->p2p);
  2105. goto wiphy_unreg_out;
  2106. @@ -7100,7 +7148,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  2107. /* (re-) activate FWEH event handling */
  2108. err = brcmf_fweh_activate_events(ifp);
  2109. if (err) {
  2110. - bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
  2111. + bphy_err(drvr, "FWEH activation failed (%d)\n", err);
  2112. goto detach;
  2113. }
  2114. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
  2115. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
  2116. @@ -62,12 +62,12 @@ void __brcmf_err(struct brcmf_bus *bus,
  2117. } while (0)
  2118. #endif
  2119. -#define bphy_err(wiphy, fmt, ...) \
  2120. +#define bphy_err(drvr, fmt, ...) \
  2121. do { \
  2122. if (IS_ENABLED(CPTCFG_BRCMDBG) || \
  2123. IS_ENABLED(CPTCFG_BRCM_TRACING) || \
  2124. net_ratelimit()) \
  2125. - wiphy_err(wiphy, "%s: " fmt, __func__, \
  2126. + wiphy_err((drvr)->wiphy, "%s: " fmt, __func__, \
  2127. ##__VA_ARGS__); \
  2128. } while (0)