339-v5.1-0008-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223
  1. From 16e646768396339b3d354985b99bcd3f1f195a7d Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
  3. Date: Fri, 15 Feb 2019 15:45:54 +0100
  4. Subject: [PATCH] brcmfmac: rework bphy_err() to take struct brcmf_pub argument
  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 <rafal@milecki.pl>
  18. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  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. @@ -550,7 +550,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. @@ -567,7 +567,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. @@ -586,6 +586,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. @@ -611,7 +612,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. @@ -619,7 +620,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. @@ -627,7 +628,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. goto fail;
  88. }
  89. @@ -658,13 +659,15 @@ static struct wireless_dev *brcmf_cfg802
  90. u32 *flags,
  91. struct vif_params *params)
  92. {
  93. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  94. + struct brcmf_pub *drvr = cfg->pub;
  95. struct wireless_dev *wdev;
  96. int err;
  97. brcmf_dbg(TRACE, "enter: %s type %d\n", name, type);
  98. err = brcmf_vif_add_validate(wiphy_to_cfg(wiphy), type);
  99. if (err) {
  100. - bphy_err(wiphy, "iface validation failed: err=%d\n", err);
  101. + bphy_err(drvr, "iface validation failed: err=%d\n", err);
  102. return ERR_PTR(err);
  103. }
  104. switch (type) {
  105. @@ -689,7 +692,7 @@ static struct wireless_dev *brcmf_cfg802
  106. }
  107. if (IS_ERR(wdev))
  108. - bphy_err(wiphy, "add iface %s type %d failed: err=%d\n", name,
  109. + bphy_err(drvr, "add iface %s type %d failed: err=%d\n", name,
  110. type, (int)PTR_ERR(wdev));
  111. else
  112. brcmf_cfg80211_update_proto_addr_mode(wdev);
  113. @@ -705,13 +708,13 @@ static void brcmf_scan_config_mpc(struct
  114. void brcmf_set_mpc(struct brcmf_if *ifp, int mpc)
  115. {
  116. - struct wiphy *wiphy = ifp->drvr->wiphy;
  117. + struct brcmf_pub *drvr = ifp->drvr;
  118. s32 err = 0;
  119. if (check_vif_up(ifp->vif)) {
  120. err = brcmf_fil_iovar_int_set(ifp, "mpc", mpc);
  121. if (err) {
  122. - bphy_err(wiphy, "fail to set mpc\n");
  123. + bphy_err(drvr, "fail to set mpc\n");
  124. return;
  125. }
  126. brcmf_dbg(INFO, "MPC : %d\n", mpc);
  127. @@ -789,6 +792,7 @@ static int brcmf_cfg80211_del_ap_iface(s
  128. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  129. struct net_device *ndev = wdev->netdev;
  130. struct brcmf_if *ifp = netdev_priv(ndev);
  131. + struct brcmf_pub *drvr = cfg->pub;
  132. int ret;
  133. int err;
  134. @@ -796,7 +800,7 @@ static int brcmf_cfg80211_del_ap_iface(s
  135. err = brcmf_fil_bsscfg_data_set(ifp, "interface_remove", NULL, 0);
  136. if (err) {
  137. - bphy_err(wiphy, "interface_remove failed %d\n", err);
  138. + bphy_err(drvr, "interface_remove failed %d\n", err);
  139. goto err_unarm;
  140. }
  141. @@ -804,7 +808,7 @@ static int brcmf_cfg80211_del_ap_iface(s
  142. ret = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_DEL,
  143. BRCMF_VIF_EVENT_TIMEOUT);
  144. if (!ret) {
  145. - bphy_err(wiphy, "timeout occurred\n");
  146. + bphy_err(drvr, "timeout occurred\n");
  147. err = -EIO;
  148. goto err_unarm;
  149. }
  150. @@ -867,6 +871,7 @@ brcmf_cfg80211_change_iface(struct wiphy
  151. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  152. struct brcmf_if *ifp = netdev_priv(ndev);
  153. struct brcmf_cfg80211_vif *vif = ifp->vif;
  154. + struct brcmf_pub *drvr = cfg->pub;
  155. s32 infra = 0;
  156. s32 ap = 0;
  157. s32 err = 0;
  158. @@ -906,13 +911,13 @@ brcmf_cfg80211_change_iface(struct wiphy
  159. }
  160. err = brcmf_vif_change_validate(wiphy_to_cfg(wiphy), vif, type);
  161. if (err) {
  162. - bphy_err(wiphy, "iface validation failed: err=%d\n", err);
  163. + bphy_err(drvr, "iface validation failed: err=%d\n", err);
  164. return err;
  165. }
  166. switch (type) {
  167. case NL80211_IFTYPE_MONITOR:
  168. case NL80211_IFTYPE_WDS:
  169. - bphy_err(wiphy, "type (%d) : currently we do not support this type\n",
  170. + bphy_err(drvr, "type (%d) : currently we do not support this type\n",
  171. type);
  172. return -EOPNOTSUPP;
  173. case NL80211_IFTYPE_ADHOC:
  174. @@ -941,7 +946,7 @@ brcmf_cfg80211_change_iface(struct wiphy
  175. } else {
  176. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, infra);
  177. if (err) {
  178. - bphy_err(wiphy, "WLC_SET_INFRA error (%d)\n", err);
  179. + bphy_err(drvr, "WLC_SET_INFRA error (%d)\n", err);
  180. err = -EAGAIN;
  181. goto done;
  182. }
  183. @@ -1043,7 +1048,7 @@ static s32
  184. brcmf_run_escan(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
  185. struct cfg80211_scan_request *request)
  186. {
  187. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  188. + struct brcmf_pub *drvr = cfg->pub;
  189. s32 params_size = BRCMF_SCAN_PARAMS_FIXED_SIZE +
  190. offsetof(struct brcmf_escan_params_le, params_le);
  191. struct brcmf_escan_params_le *params;
  192. @@ -1075,7 +1080,7 @@ brcmf_run_escan(struct brcmf_cfg80211_in
  193. if (err == -EBUSY)
  194. brcmf_dbg(INFO, "system busy : escan canceled\n");
  195. else
  196. - bphy_err(wiphy, "error (%d)\n", err);
  197. + bphy_err(drvr, "error (%d)\n", err);
  198. }
  199. kfree(params);
  200. @@ -1122,6 +1127,7 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
  201. {
  202. struct brcmf_if *ifp = vif->ifp;
  203. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  204. + struct brcmf_pub *drvr = cfg->pub;
  205. struct cfg80211_ssid *ssids;
  206. u32 passive_scan;
  207. bool escan_req;
  208. @@ -1133,22 +1139,22 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
  209. brcmf_dbg(SCAN, "START ESCAN\n");
  210. if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
  211. - bphy_err(wiphy, "Scanning already: status (%lu)\n",
  212. + bphy_err(drvr, "Scanning already: status (%lu)\n",
  213. cfg->scan_status);
  214. return -EAGAIN;
  215. }
  216. if (test_bit(BRCMF_SCAN_STATUS_ABORT, &cfg->scan_status)) {
  217. - bphy_err(wiphy, "Scanning being aborted: status (%lu)\n",
  218. + bphy_err(drvr, "Scanning being aborted: status (%lu)\n",
  219. cfg->scan_status);
  220. return -EAGAIN;
  221. }
  222. if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
  223. - bphy_err(wiphy, "Scanning suppressed: status (%lu)\n",
  224. + bphy_err(drvr, "Scanning suppressed: status (%lu)\n",
  225. cfg->scan_status);
  226. return -EAGAIN;
  227. }
  228. if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) {
  229. - bphy_err(wiphy, "Connecting: status (%lu)\n",
  230. + bphy_err(drvr, "Connecting: status (%lu)\n",
  231. ifp->vif->sme_state);
  232. return -EAGAIN;
  233. }
  234. @@ -1230,6 +1236,8 @@ scan_out:
  235. static s32
  236. brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
  237. {
  238. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  239. + struct brcmf_pub *drvr = cfg->pub;
  240. struct brcmf_cfg80211_vif *vif;
  241. s32 err = 0;
  242. @@ -1241,7 +1249,7 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
  243. err = brcmf_cfg80211_escan(wiphy, vif, request, NULL);
  244. if (err)
  245. - bphy_err(wiphy, "scan error (%d)\n", err);
  246. + bphy_err(drvr, "scan error (%d)\n", err);
  247. brcmf_dbg(TRACE, "Exit\n");
  248. return err;
  249. @@ -1250,12 +1258,12 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
  250. static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
  251. {
  252. struct brcmf_if *ifp = netdev_priv(ndev);
  253. - struct wiphy *wiphy = ifp->drvr->wiphy;
  254. + struct brcmf_pub *drvr = ifp->drvr;
  255. s32 err = 0;
  256. err = brcmf_fil_iovar_int_set(ifp, "rtsthresh", rts_threshold);
  257. if (err)
  258. - bphy_err(wiphy, "Error (%d)\n", err);
  259. + bphy_err(drvr, "Error (%d)\n", err);
  260. return err;
  261. }
  262. @@ -1263,13 +1271,13 @@ static s32 brcmf_set_rts(struct net_devi
  263. static s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold)
  264. {
  265. struct brcmf_if *ifp = netdev_priv(ndev);
  266. - struct wiphy *wiphy = ifp->drvr->wiphy;
  267. + struct brcmf_pub *drvr = ifp->drvr;
  268. s32 err = 0;
  269. err = brcmf_fil_iovar_int_set(ifp, "fragthresh",
  270. frag_threshold);
  271. if (err)
  272. - bphy_err(wiphy, "Error (%d)\n", err);
  273. + bphy_err(drvr, "Error (%d)\n", err);
  274. return err;
  275. }
  276. @@ -1277,13 +1285,13 @@ static s32 brcmf_set_frag(struct net_dev
  277. static s32 brcmf_set_retry(struct net_device *ndev, u32 retry, bool l)
  278. {
  279. struct brcmf_if *ifp = netdev_priv(ndev);
  280. - struct wiphy *wiphy = ifp->drvr->wiphy;
  281. + struct brcmf_pub *drvr = ifp->drvr;
  282. s32 err = 0;
  283. u32 cmd = (l ? BRCMF_C_SET_LRL : BRCMF_C_SET_SRL);
  284. err = brcmf_fil_cmd_int_set(ifp, cmd, retry);
  285. if (err) {
  286. - bphy_err(wiphy, "cmd (%d) , error (%d)\n", cmd, err);
  287. + bphy_err(drvr, "cmd (%d) , error (%d)\n", cmd, err);
  288. return err;
  289. }
  290. return err;
  291. @@ -1360,7 +1368,7 @@ static u16 brcmf_map_fw_linkdown_reason(
  292. static void brcmf_link_down(struct brcmf_cfg80211_vif *vif, u16 reason)
  293. {
  294. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
  295. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  296. + struct brcmf_pub *drvr = cfg->pub;
  297. s32 err = 0;
  298. brcmf_dbg(TRACE, "Enter\n");
  299. @@ -1370,7 +1378,7 @@ static void brcmf_link_down(struct brcmf
  300. err = brcmf_fil_cmd_data_set(vif->ifp,
  301. BRCMF_C_DISASSOC, NULL, 0);
  302. if (err) {
  303. - bphy_err(wiphy, "WLC_DISASSOC failed (%d)\n", err);
  304. + bphy_err(drvr, "WLC_DISASSOC failed (%d)\n", err);
  305. }
  306. if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
  307. (vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
  308. @@ -1390,6 +1398,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
  309. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  310. struct brcmf_if *ifp = netdev_priv(ndev);
  311. struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
  312. + struct brcmf_pub *drvr = cfg->pub;
  313. struct brcmf_join_params join_params;
  314. size_t join_params_size = 0;
  315. s32 err = 0;
  316. @@ -1454,7 +1463,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
  317. err = brcmf_fil_iovar_int_set(ifp, "wsec", wsec);
  318. if (err) {
  319. - bphy_err(wiphy, "wsec failed (%d)\n", err);
  320. + bphy_err(drvr, "wsec failed (%d)\n", err);
  321. goto done;
  322. }
  323. @@ -1466,7 +1475,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
  324. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, bcnprd);
  325. if (err) {
  326. - bphy_err(wiphy, "WLC_SET_BCNPRD failed (%d)\n", err);
  327. + bphy_err(drvr, "WLC_SET_BCNPRD failed (%d)\n", err);
  328. goto done;
  329. }
  330. @@ -1511,7 +1520,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
  331. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_CHANNEL,
  332. target_channel);
  333. if (err) {
  334. - bphy_err(wiphy, "WLC_SET_CHANNEL failed (%d)\n", err);
  335. + bphy_err(drvr, "WLC_SET_CHANNEL failed (%d)\n", err);
  336. goto done;
  337. }
  338. } else
  339. @@ -1523,7 +1532,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
  340. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
  341. &join_params, join_params_size);
  342. if (err) {
  343. - bphy_err(wiphy, "WLC_SET_SSID failed (%d)\n", err);
  344. + bphy_err(drvr, "WLC_SET_SSID failed (%d)\n", err);
  345. goto done;
  346. }
  347. @@ -1560,8 +1569,8 @@ static s32 brcmf_set_wpa_version(struct
  348. struct cfg80211_connect_params *sme)
  349. {
  350. struct brcmf_if *ifp = netdev_priv(ndev);
  351. - struct wiphy *wiphy = ifp->drvr->wiphy;
  352. struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
  353. + struct brcmf_pub *drvr = ifp->drvr;
  354. struct brcmf_cfg80211_security *sec;
  355. s32 val = 0;
  356. s32 err = 0;
  357. @@ -1575,7 +1584,7 @@ static s32 brcmf_set_wpa_version(struct
  358. brcmf_dbg(CONN, "setting wpa_auth to 0x%0x\n", val);
  359. err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", val);
  360. if (err) {
  361. - bphy_err(wiphy, "set wpa_auth failed (%d)\n", err);
  362. + bphy_err(drvr, "set wpa_auth failed (%d)\n", err);
  363. return err;
  364. }
  365. sec = &profile->sec;
  366. @@ -1587,8 +1596,8 @@ static s32 brcmf_set_auth_type(struct ne
  367. struct cfg80211_connect_params *sme)
  368. {
  369. struct brcmf_if *ifp = netdev_priv(ndev);
  370. - struct wiphy *wiphy = ifp->drvr->wiphy;
  371. struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
  372. + struct brcmf_pub *drvr = ifp->drvr;
  373. struct brcmf_cfg80211_security *sec;
  374. s32 val = 0;
  375. s32 err = 0;
  376. @@ -1610,7 +1619,7 @@ static s32 brcmf_set_auth_type(struct ne
  377. err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
  378. if (err) {
  379. - bphy_err(wiphy, "set auth failed (%d)\n", err);
  380. + bphy_err(drvr, "set auth failed (%d)\n", err);
  381. return err;
  382. }
  383. sec = &profile->sec;
  384. @@ -1623,8 +1632,8 @@ brcmf_set_wsec_mode(struct net_device *n
  385. struct cfg80211_connect_params *sme)
  386. {
  387. struct brcmf_if *ifp = netdev_priv(ndev);
  388. - struct wiphy *wiphy = ifp->drvr->wiphy;
  389. struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
  390. + struct brcmf_pub *drvr = ifp->drvr;
  391. struct brcmf_cfg80211_security *sec;
  392. s32 pval = 0;
  393. s32 gval = 0;
  394. @@ -1647,7 +1656,7 @@ brcmf_set_wsec_mode(struct net_device *n
  395. pval = AES_ENABLED;
  396. break;
  397. default:
  398. - bphy_err(wiphy, "invalid cipher pairwise (%d)\n",
  399. + bphy_err(drvr, "invalid cipher pairwise (%d)\n",
  400. sme->crypto.ciphers_pairwise[0]);
  401. return -EINVAL;
  402. }
  403. @@ -1668,7 +1677,7 @@ brcmf_set_wsec_mode(struct net_device *n
  404. gval = AES_ENABLED;
  405. break;
  406. default:
  407. - bphy_err(wiphy, "invalid cipher group (%d)\n",
  408. + bphy_err(drvr, "invalid cipher group (%d)\n",
  409. sme->crypto.cipher_group);
  410. return -EINVAL;
  411. }
  412. @@ -1684,7 +1693,7 @@ brcmf_set_wsec_mode(struct net_device *n
  413. wsec = pval | gval;
  414. err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
  415. if (err) {
  416. - bphy_err(wiphy, "error (%d)\n", err);
  417. + bphy_err(drvr, "error (%d)\n", err);
  418. return err;
  419. }
  420. @@ -1699,7 +1708,7 @@ static s32
  421. brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
  422. {
  423. struct brcmf_if *ifp = netdev_priv(ndev);
  424. - struct wiphy *wiphy = ifp->drvr->wiphy;
  425. + struct brcmf_pub *drvr = ifp->drvr;
  426. s32 val;
  427. s32 err;
  428. const struct brcmf_tlv *rsn_ie;
  429. @@ -1715,7 +1724,7 @@ brcmf_set_key_mgmt(struct net_device *nd
  430. err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wpa_auth", &val);
  431. if (err) {
  432. - bphy_err(wiphy, "could not get wpa_auth (%d)\n", err);
  433. + bphy_err(drvr, "could not get wpa_auth (%d)\n", err);
  434. return err;
  435. }
  436. if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
  437. @@ -1727,7 +1736,7 @@ brcmf_set_key_mgmt(struct net_device *nd
  438. val = WPA_AUTH_PSK;
  439. break;
  440. default:
  441. - bphy_err(wiphy, "invalid cipher group (%d)\n",
  442. + bphy_err(drvr, "invalid cipher group (%d)\n",
  443. sme->crypto.cipher_group);
  444. return -EINVAL;
  445. }
  446. @@ -1746,7 +1755,7 @@ brcmf_set_key_mgmt(struct net_device *nd
  447. val = WPA2_AUTH_PSK;
  448. break;
  449. default:
  450. - bphy_err(wiphy, "invalid cipher group (%d)\n",
  451. + bphy_err(drvr, "invalid cipher group (%d)\n",
  452. sme->crypto.cipher_group);
  453. return -EINVAL;
  454. }
  455. @@ -1790,7 +1799,7 @@ skip_mfp_config:
  456. brcmf_dbg(CONN, "setting wpa_auth to %d\n", val);
  457. err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val);
  458. if (err) {
  459. - bphy_err(wiphy, "could not set wpa_auth (%d)\n", err);
  460. + bphy_err(drvr, "could not set wpa_auth (%d)\n", err);
  461. return err;
  462. }
  463. @@ -1802,7 +1811,7 @@ brcmf_set_sharedkey(struct net_device *n
  464. struct cfg80211_connect_params *sme)
  465. {
  466. struct brcmf_if *ifp = netdev_priv(ndev);
  467. - struct wiphy *wiphy = ifp->drvr->wiphy;
  468. + struct brcmf_pub *drvr = ifp->drvr;
  469. struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
  470. struct brcmf_cfg80211_security *sec;
  471. struct brcmf_wsec_key key;
  472. @@ -1829,7 +1838,7 @@ brcmf_set_sharedkey(struct net_device *n
  473. key.len = (u32) sme->key_len;
  474. key.index = (u32) sme->key_idx;
  475. if (key.len > sizeof(key.data)) {
  476. - bphy_err(wiphy, "Too long key length (%u)\n", key.len);
  477. + bphy_err(drvr, "Too long key length (%u)\n", key.len);
  478. return -EINVAL;
  479. }
  480. memcpy(key.data, sme->key, key.len);
  481. @@ -1842,7 +1851,7 @@ brcmf_set_sharedkey(struct net_device *n
  482. key.algo = CRYPTO_ALGO_WEP128;
  483. break;
  484. default:
  485. - bphy_err(wiphy, "Invalid algorithm (%d)\n",
  486. + bphy_err(drvr, "Invalid algorithm (%d)\n",
  487. sme->crypto.ciphers_pairwise[0]);
  488. return -EINVAL;
  489. }
  490. @@ -1859,7 +1868,7 @@ brcmf_set_sharedkey(struct net_device *n
  491. val = WL_AUTH_SHARED_KEY; /* shared key */
  492. err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
  493. if (err)
  494. - bphy_err(wiphy, "set auth failed (%d)\n", err);
  495. + bphy_err(drvr, "set auth failed (%d)\n", err);
  496. }
  497. return err;
  498. }
  499. @@ -1879,7 +1888,7 @@ enum nl80211_auth_type brcmf_war_auth_ty
  500. static void brcmf_set_join_pref(struct brcmf_if *ifp,
  501. struct cfg80211_bss_selection *bss_select)
  502. {
  503. - struct wiphy *wiphy = ifp->drvr->wiphy;
  504. + struct brcmf_pub *drvr = ifp->drvr;
  505. struct brcmf_join_pref_params join_pref_params[2];
  506. enum nl80211_band band;
  507. int err, i = 0;
  508. @@ -1918,7 +1927,7 @@ static void brcmf_set_join_pref(struct b
  509. err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
  510. sizeof(join_pref_params));
  511. if (err)
  512. - bphy_err(wiphy, "Set join_pref error (%d)\n", err);
  513. + bphy_err(drvr, "Set join_pref error (%d)\n", err);
  514. }
  515. static s32
  516. @@ -1928,6 +1937,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
  517. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  518. struct brcmf_if *ifp = netdev_priv(ndev);
  519. struct ieee80211_channel *chan = sme->channel;
  520. + struct brcmf_pub *drvr = ifp->drvr;
  521. struct brcmf_join_params join_params;
  522. size_t join_params_size;
  523. const struct brcmf_tlv *rsn_ie;
  524. @@ -1944,7 +1954,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
  525. return -EIO;
  526. if (!sme->ssid) {
  527. - bphy_err(wiphy, "Invalid ssid\n");
  528. + bphy_err(drvr, "Invalid ssid\n");
  529. return -EOPNOTSUPP;
  530. }
  531. @@ -1973,7 +1983,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
  532. err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
  533. sme->ie, sme->ie_len);
  534. if (err)
  535. - bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
  536. + bphy_err(drvr, "Set Assoc REQ IE Failed\n");
  537. else
  538. brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
  539. @@ -1994,32 +2004,32 @@ brcmf_cfg80211_connect(struct wiphy *wip
  540. err = brcmf_set_wpa_version(ndev, sme);
  541. if (err) {
  542. - bphy_err(wiphy, "wl_set_wpa_version failed (%d)\n", err);
  543. + bphy_err(drvr, "wl_set_wpa_version failed (%d)\n", err);
  544. goto done;
  545. }
  546. sme->auth_type = brcmf_war_auth_type(ifp, sme->auth_type);
  547. err = brcmf_set_auth_type(ndev, sme);
  548. if (err) {
  549. - bphy_err(wiphy, "wl_set_auth_type failed (%d)\n", err);
  550. + bphy_err(drvr, "wl_set_auth_type failed (%d)\n", err);
  551. goto done;
  552. }
  553. err = brcmf_set_wsec_mode(ndev, sme);
  554. if (err) {
  555. - bphy_err(wiphy, "wl_set_set_cipher failed (%d)\n", err);
  556. + bphy_err(drvr, "wl_set_set_cipher failed (%d)\n", err);
  557. goto done;
  558. }
  559. err = brcmf_set_key_mgmt(ndev, sme);
  560. if (err) {
  561. - bphy_err(wiphy, "wl_set_key_mgmt failed (%d)\n", err);
  562. + bphy_err(drvr, "wl_set_key_mgmt failed (%d)\n", err);
  563. goto done;
  564. }
  565. err = brcmf_set_sharedkey(ndev, sme);
  566. if (err) {
  567. - bphy_err(wiphy, "brcmf_set_sharedkey failed (%d)\n", err);
  568. + bphy_err(drvr, "brcmf_set_sharedkey failed (%d)\n", err);
  569. goto done;
  570. }
  571. @@ -2106,7 +2116,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
  572. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
  573. &join_params, join_params_size);
  574. if (err)
  575. - bphy_err(wiphy, "BRCMF_C_SET_SSID failed (%d)\n", err);
  576. + bphy_err(drvr, "BRCMF_C_SET_SSID failed (%d)\n", err);
  577. done:
  578. if (err)
  579. @@ -2119,8 +2129,10 @@ static s32
  580. brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
  581. u16 reason_code)
  582. {
  583. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  584. struct brcmf_if *ifp = netdev_priv(ndev);
  585. struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
  586. + struct brcmf_pub *drvr = cfg->pub;
  587. struct brcmf_scb_val_le scbval;
  588. s32 err = 0;
  589. @@ -2137,7 +2149,7 @@ brcmf_cfg80211_disconnect(struct wiphy *
  590. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_DISASSOC,
  591. &scbval, sizeof(scbval));
  592. if (err)
  593. - bphy_err(wiphy, "error (%d)\n", err);
  594. + bphy_err(drvr, "error (%d)\n", err);
  595. brcmf_dbg(TRACE, "Exit\n");
  596. return err;
  597. @@ -2150,6 +2162,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
  598. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  599. struct net_device *ndev = cfg_to_ndev(cfg);
  600. struct brcmf_if *ifp = netdev_priv(ndev);
  601. + struct brcmf_pub *drvr = cfg->pub;
  602. s32 err;
  603. s32 disable;
  604. u32 qdbm = 127;
  605. @@ -2164,7 +2177,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
  606. case NL80211_TX_POWER_LIMITED:
  607. case NL80211_TX_POWER_FIXED:
  608. if (mbm < 0) {
  609. - bphy_err(wiphy, "TX_POWER_FIXED - dbm is negative\n");
  610. + bphy_err(drvr, "TX_POWER_FIXED - dbm is negative\n");
  611. err = -EINVAL;
  612. goto done;
  613. }
  614. @@ -2174,7 +2187,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
  615. qdbm |= WL_TXPWR_OVERRIDE;
  616. break;
  617. default:
  618. - bphy_err(wiphy, "Unsupported type %d\n", type);
  619. + bphy_err(drvr, "Unsupported type %d\n", type);
  620. err = -EINVAL;
  621. goto done;
  622. }
  623. @@ -2182,11 +2195,11 @@ brcmf_cfg80211_set_tx_power(struct wiphy
  624. disable = WL_RADIO_SW_DISABLE << 16;
  625. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_RADIO, disable);
  626. if (err)
  627. - bphy_err(wiphy, "WLC_SET_RADIO error (%d)\n", err);
  628. + bphy_err(drvr, "WLC_SET_RADIO error (%d)\n", err);
  629. err = brcmf_fil_iovar_int_set(ifp, "qtxpower", qdbm);
  630. if (err)
  631. - bphy_err(wiphy, "qtxpower error (%d)\n", err);
  632. + bphy_err(drvr, "qtxpower error (%d)\n", err);
  633. done:
  634. brcmf_dbg(TRACE, "Exit %d (qdbm)\n", qdbm & ~WL_TXPWR_OVERRIDE);
  635. @@ -2197,7 +2210,9 @@ static s32
  636. brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
  637. s32 *dbm)
  638. {
  639. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  640. struct brcmf_cfg80211_vif *vif = wdev_to_vif(wdev);
  641. + struct brcmf_pub *drvr = cfg->pub;
  642. s32 qdbm = 0;
  643. s32 err;
  644. @@ -2207,7 +2222,7 @@ brcmf_cfg80211_get_tx_power(struct wiphy
  645. err = brcmf_fil_iovar_int_get(vif->ifp, "qtxpower", &qdbm);
  646. if (err) {
  647. - bphy_err(wiphy, "error (%d)\n", err);
  648. + bphy_err(drvr, "error (%d)\n", err);
  649. goto done;
  650. }
  651. *dbm = (qdbm & ~WL_TXPWR_OVERRIDE) / 4;
  652. @@ -2222,6 +2237,7 @@ brcmf_cfg80211_config_default_key(struct
  653. u8 key_idx, bool unicast, bool multicast)
  654. {
  655. struct brcmf_if *ifp = netdev_priv(ndev);
  656. + struct brcmf_pub *drvr = ifp->drvr;
  657. u32 index;
  658. u32 wsec;
  659. s32 err = 0;
  660. @@ -2233,7 +2249,7 @@ brcmf_cfg80211_config_default_key(struct
  661. err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
  662. if (err) {
  663. - bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
  664. + bphy_err(drvr, "WLC_GET_WSEC error (%d)\n", err);
  665. goto done;
  666. }
  667. @@ -2243,7 +2259,7 @@ brcmf_cfg80211_config_default_key(struct
  668. err = brcmf_fil_cmd_int_set(ifp,
  669. BRCMF_C_SET_KEY_PRIMARY, index);
  670. if (err)
  671. - bphy_err(wiphy, "error (%d)\n", err);
  672. + bphy_err(drvr, "error (%d)\n", err);
  673. }
  674. done:
  675. brcmf_dbg(TRACE, "Exit\n");
  676. @@ -2292,7 +2308,9 @@ brcmf_cfg80211_add_key(struct wiphy *wip
  677. u8 key_idx, bool pairwise, const u8 *mac_addr,
  678. struct key_params *params)
  679. {
  680. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  681. struct brcmf_if *ifp = netdev_priv(ndev);
  682. + struct brcmf_pub *drvr = cfg->pub;
  683. struct brcmf_wsec_key *key;
  684. s32 val;
  685. s32 wsec;
  686. @@ -2307,7 +2325,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
  687. if (key_idx >= BRCMF_MAX_DEFAULT_KEYS) {
  688. /* we ignore this key index in this case */
  689. - bphy_err(wiphy, "invalid key index (%d)\n", key_idx);
  690. + bphy_err(drvr, "invalid key index (%d)\n", key_idx);
  691. return -EINVAL;
  692. }
  693. @@ -2316,7 +2334,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
  694. mac_addr);
  695. if (params->key_len > sizeof(key->data)) {
  696. - bphy_err(wiphy, "Too long key length (%u)\n", params->key_len);
  697. + bphy_err(drvr, "Too long key length (%u)\n", params->key_len);
  698. return -EINVAL;
  699. }
  700. @@ -2370,7 +2388,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
  701. brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_CCMP\n");
  702. break;
  703. default:
  704. - bphy_err(wiphy, "Invalid cipher (0x%x)\n", params->cipher);
  705. + bphy_err(drvr, "Invalid cipher (0x%x)\n", params->cipher);
  706. err = -EINVAL;
  707. goto done;
  708. }
  709. @@ -2381,13 +2399,13 @@ brcmf_cfg80211_add_key(struct wiphy *wip
  710. err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
  711. if (err) {
  712. - bphy_err(wiphy, "get wsec error (%d)\n", err);
  713. + bphy_err(drvr, "get wsec error (%d)\n", err);
  714. goto done;
  715. }
  716. wsec |= val;
  717. err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
  718. if (err) {
  719. - bphy_err(wiphy, "set wsec error (%d)\n", err);
  720. + bphy_err(drvr, "set wsec error (%d)\n", err);
  721. goto done;
  722. }
  723. @@ -2402,9 +2420,11 @@ brcmf_cfg80211_get_key(struct wiphy *wip
  724. void (*callback)(void *cookie,
  725. struct key_params *params))
  726. {
  727. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  728. struct key_params params;
  729. struct brcmf_if *ifp = netdev_priv(ndev);
  730. struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
  731. + struct brcmf_pub *drvr = cfg->pub;
  732. struct brcmf_cfg80211_security *sec;
  733. s32 wsec;
  734. s32 err = 0;
  735. @@ -2418,7 +2438,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
  736. err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
  737. if (err) {
  738. - bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
  739. + bphy_err(drvr, "WLC_GET_WSEC error (%d)\n", err);
  740. /* Ignore this error, may happen during DISASSOC */
  741. err = -EAGAIN;
  742. goto done;
  743. @@ -2439,7 +2459,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
  744. params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
  745. brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n");
  746. } else {
  747. - bphy_err(wiphy, "Invalid algo (0x%x)\n", wsec);
  748. + bphy_err(drvr, "Invalid algo (0x%x)\n", wsec);
  749. err = -EINVAL;
  750. goto done;
  751. }
  752. @@ -2469,7 +2489,7 @@ brcmf_cfg80211_config_default_mgmt_key(s
  753. static void
  754. brcmf_cfg80211_reconfigure_wep(struct brcmf_if *ifp)
  755. {
  756. - struct wiphy *wiphy = ifp->drvr->wiphy;
  757. + struct brcmf_pub *drvr = ifp->drvr;
  758. s32 err;
  759. u8 key_idx;
  760. struct brcmf_wsec_key *key;
  761. @@ -2486,18 +2506,18 @@ brcmf_cfg80211_reconfigure_wep(struct br
  762. err = send_key_to_dongle(ifp, key);
  763. if (err) {
  764. - bphy_err(wiphy, "Setting WEP key failed (%d)\n", err);
  765. + bphy_err(drvr, "Setting WEP key failed (%d)\n", err);
  766. return;
  767. }
  768. err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
  769. if (err) {
  770. - bphy_err(wiphy, "get wsec error (%d)\n", err);
  771. + bphy_err(drvr, "get wsec error (%d)\n", err);
  772. return;
  773. }
  774. wsec |= WEP_ENABLED;
  775. err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
  776. if (err)
  777. - bphy_err(wiphy, "set wsec error (%d)\n", err);
  778. + bphy_err(drvr, "set wsec error (%d)\n", err);
  779. }
  780. static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si)
  781. @@ -2523,7 +2543,7 @@ static void brcmf_convert_sta_flags(u32
  782. static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si)
  783. {
  784. - struct wiphy *wiphy = ifp->drvr->wiphy;
  785. + struct brcmf_pub *drvr = ifp->drvr;
  786. struct {
  787. __le32 len;
  788. struct brcmf_bss_info_le bss_le;
  789. @@ -2539,7 +2559,7 @@ static void brcmf_fill_bss_param(struct
  790. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf,
  791. WL_BSS_INFO_MAX);
  792. if (err) {
  793. - bphy_err(wiphy, "Failed to get bss info (%d)\n", err);
  794. + bphy_err(drvr, "Failed to get bss info (%d)\n", err);
  795. goto out_kfree;
  796. }
  797. si->filled |= BIT(NL80211_STA_INFO_BSS_PARAM);
  798. @@ -2561,7 +2581,7 @@ static s32
  799. brcmf_cfg80211_get_station_ibss(struct brcmf_if *ifp,
  800. struct station_info *sinfo)
  801. {
  802. - struct wiphy *wiphy = ifp->drvr->wiphy;
  803. + struct brcmf_pub *drvr = ifp->drvr;
  804. struct brcmf_scb_val_le scbval;
  805. struct brcmf_pktcnt_le pktcnt;
  806. s32 err;
  807. @@ -2571,7 +2591,7 @@ brcmf_cfg80211_get_station_ibss(struct b
  808. /* Get the current tx rate */
  809. err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate);
  810. if (err < 0) {
  811. - bphy_err(wiphy, "BRCMF_C_GET_RATE error (%d)\n", err);
  812. + bphy_err(drvr, "BRCMF_C_GET_RATE error (%d)\n", err);
  813. return err;
  814. }
  815. sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
  816. @@ -2581,7 +2601,7 @@ brcmf_cfg80211_get_station_ibss(struct b
  817. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, &scbval,
  818. sizeof(scbval));
  819. if (err) {
  820. - bphy_err(wiphy, "BRCMF_C_GET_RSSI error (%d)\n", err);
  821. + bphy_err(drvr, "BRCMF_C_GET_RSSI error (%d)\n", err);
  822. return err;
  823. }
  824. rssi = le32_to_cpu(scbval.val);
  825. @@ -2591,7 +2611,7 @@ brcmf_cfg80211_get_station_ibss(struct b
  826. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_GET_PKTCNTS, &pktcnt,
  827. sizeof(pktcnt));
  828. if (err) {
  829. - bphy_err(wiphy, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
  830. + bphy_err(drvr, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
  831. return err;
  832. }
  833. sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS) |
  834. @@ -2610,7 +2630,9 @@ static s32
  835. brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
  836. const u8 *mac, struct station_info *sinfo)
  837. {
  838. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  839. struct brcmf_if *ifp = netdev_priv(ndev);
  840. + struct brcmf_pub *drvr = cfg->pub;
  841. struct brcmf_scb_val_le scb_val;
  842. s32 err = 0;
  843. struct brcmf_sta_info_le sta_info_le;
  844. @@ -2639,7 +2661,7 @@ brcmf_cfg80211_get_station(struct wiphy
  845. &sta_info_le,
  846. sizeof(sta_info_le));
  847. if (err < 0) {
  848. - bphy_err(wiphy, "GET STA INFO failed, %d\n", err);
  849. + bphy_err(drvr, "GET STA INFO failed, %d\n", err);
  850. goto done;
  851. }
  852. }
  853. @@ -2708,7 +2730,7 @@ brcmf_cfg80211_get_station(struct wiphy
  854. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
  855. &scb_val, sizeof(scb_val));
  856. if (err) {
  857. - bphy_err(wiphy, "Could not get rssi (%d)\n",
  858. + bphy_err(drvr, "Could not get rssi (%d)\n",
  859. err);
  860. goto done;
  861. } else {
  862. @@ -2730,6 +2752,7 @@ brcmf_cfg80211_dump_station(struct wiphy
  863. {
  864. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  865. struct brcmf_if *ifp = netdev_priv(ndev);
  866. + struct brcmf_pub *drvr = cfg->pub;
  867. s32 err;
  868. brcmf_dbg(TRACE, "Enter, idx %d\n", idx);
  869. @@ -2740,7 +2763,7 @@ brcmf_cfg80211_dump_station(struct wiphy
  870. &cfg->assoclist,
  871. sizeof(cfg->assoclist));
  872. if (err) {
  873. - bphy_err(wiphy, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
  874. + bphy_err(drvr, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
  875. err);
  876. cfg->assoclist.count = 0;
  877. return -EOPNOTSUPP;
  878. @@ -2761,6 +2784,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip
  879. s32 err = 0;
  880. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  881. struct brcmf_if *ifp = netdev_priv(ndev);
  882. + struct brcmf_pub *drvr = cfg->pub;
  883. brcmf_dbg(TRACE, "Enter\n");
  884. @@ -2789,9 +2813,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip
  885. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm);
  886. if (err) {
  887. if (err == -ENODEV)
  888. - bphy_err(wiphy, "net_device is not ready yet\n");
  889. + bphy_err(drvr, "net_device is not ready yet\n");
  890. else
  891. - bphy_err(wiphy, "error (%d)\n", err);
  892. + bphy_err(drvr, "error (%d)\n", err);
  893. }
  894. done:
  895. brcmf_dbg(TRACE, "Exit\n");
  896. @@ -2802,6 +2826,7 @@ static s32 brcmf_inform_single_bss(struc
  897. struct brcmf_bss_info_le *bi)
  898. {
  899. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  900. + struct brcmf_pub *drvr = cfg->pub;
  901. struct ieee80211_channel *notify_channel;
  902. struct cfg80211_bss *bss;
  903. struct ieee80211_supported_band *band;
  904. @@ -2815,7 +2840,7 @@ static s32 brcmf_inform_single_bss(struc
  905. s32 notify_signal;
  906. if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) {
  907. - bphy_err(wiphy, "Bss info is larger than buffer. Discarding\n");
  908. + bphy_err(drvr, "Bss info is larger than buffer. Discarding\n");
  909. return 0;
  910. }
  911. @@ -2873,7 +2898,7 @@ next_bss_le(struct brcmf_scan_results *l
  912. static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg)
  913. {
  914. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  915. + struct brcmf_pub *drvr = cfg->pub;
  916. struct brcmf_scan_results *bss_list;
  917. struct brcmf_bss_info_le *bi = NULL; /* must be initialized */
  918. s32 err = 0;
  919. @@ -2882,7 +2907,7 @@ static s32 brcmf_inform_bss(struct brcmf
  920. bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
  921. if (bss_list->count != 0 &&
  922. bss_list->version != BRCMF_BSS_INFO_VERSION) {
  923. - bphy_err(wiphy, "Version %d != WL_BSS_INFO_VERSION\n",
  924. + bphy_err(drvr, "Version %d != WL_BSS_INFO_VERSION\n",
  925. bss_list->version);
  926. return -EOPNOTSUPP;
  927. }
  928. @@ -2900,6 +2925,7 @@ static s32 brcmf_inform_ibss(struct brcm
  929. struct net_device *ndev, const u8 *bssid)
  930. {
  931. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  932. + struct brcmf_pub *drvr = cfg->pub;
  933. struct ieee80211_channel *notify_channel;
  934. struct brcmf_bss_info_le *bi = NULL;
  935. struct ieee80211_supported_band *band;
  936. @@ -2927,7 +2953,7 @@ static s32 brcmf_inform_ibss(struct brcm
  937. err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO,
  938. buf, WL_BSS_INFO_MAX);
  939. if (err) {
  940. - bphy_err(wiphy, "WLC_GET_BSS_INFO failed: %d\n", err);
  941. + bphy_err(drvr, "WLC_GET_BSS_INFO failed: %d\n", err);
  942. goto CleanUp;
  943. }
  944. @@ -2981,7 +3007,7 @@ CleanUp:
  945. static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg,
  946. struct brcmf_if *ifp)
  947. {
  948. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  949. + struct brcmf_pub *drvr = cfg->pub;
  950. struct brcmf_bss_info_le *bi;
  951. const struct brcmf_tlv *tim;
  952. u16 beacon_interval;
  953. @@ -2998,7 +3024,7 @@ static s32 brcmf_update_bss_info(struct
  954. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO,
  955. cfg->extra_buf, WL_EXTRA_BUF_MAX);
  956. if (err) {
  957. - bphy_err(wiphy, "Could not get bss info %d\n", err);
  958. + bphy_err(drvr, "Could not get bss info %d\n", err);
  959. goto update_bss_info_out;
  960. }
  961. @@ -3023,7 +3049,7 @@ static s32 brcmf_update_bss_info(struct
  962. u32 var;
  963. err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var);
  964. if (err) {
  965. - bphy_err(wiphy, "wl dtim_assoc failed (%d)\n", err);
  966. + bphy_err(drvr, "wl dtim_assoc failed (%d)\n", err);
  967. goto update_bss_info_out;
  968. }
  969. dtim_period = (u8)var;
  970. @@ -3061,10 +3087,10 @@ static void brcmf_escan_timeout(unsigned
  971. {
  972. struct brcmf_cfg80211_info *cfg =
  973. (struct brcmf_cfg80211_info *)data;
  974. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  975. + struct brcmf_pub *drvr = cfg->pub;
  976. if (cfg->internal_escan || cfg->scan_request) {
  977. - bphy_err(wiphy, "timer expired\n");
  978. + bphy_err(drvr, "timer expired\n");
  979. schedule_work(&cfg->escan_timeout_work);
  980. }
  981. }
  982. @@ -3112,8 +3138,8 @@ static s32
  983. brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
  984. const struct brcmf_event_msg *e, void *data)
  985. {
  986. - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
  987. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  988. + struct brcmf_pub *drvr = ifp->drvr;
  989. + struct brcmf_cfg80211_info *cfg = drvr->config;
  990. s32 status;
  991. struct brcmf_escan_result_le *escan_result_le;
  992. u32 escan_buflen;
  993. @@ -3130,7 +3156,7 @@ brcmf_cfg80211_escan_handler(struct brcm
  994. goto exit;
  995. if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
  996. - bphy_err(wiphy, "scan not ready, bsscfgidx=%d\n",
  997. + bphy_err(drvr, "scan not ready, bsscfgidx=%d\n",
  998. ifp->bsscfgidx);
  999. return -EPERM;
  1000. }
  1001. @@ -3138,24 +3164,24 @@ brcmf_cfg80211_escan_handler(struct brcm
  1002. if (status == BRCMF_E_STATUS_PARTIAL) {
  1003. brcmf_dbg(SCAN, "ESCAN Partial result\n");
  1004. if (e->datalen < sizeof(*escan_result_le)) {
  1005. - bphy_err(wiphy, "invalid event data length\n");
  1006. + bphy_err(drvr, "invalid event data length\n");
  1007. goto exit;
  1008. }
  1009. escan_result_le = (struct brcmf_escan_result_le *) data;
  1010. if (!escan_result_le) {
  1011. - bphy_err(wiphy, "Invalid escan result (NULL pointer)\n");
  1012. + bphy_err(drvr, "Invalid escan result (NULL pointer)\n");
  1013. goto exit;
  1014. }
  1015. escan_buflen = le32_to_cpu(escan_result_le->buflen);
  1016. if (escan_buflen > BRCMF_ESCAN_BUF_SIZE ||
  1017. escan_buflen > e->datalen ||
  1018. escan_buflen < sizeof(*escan_result_le)) {
  1019. - bphy_err(wiphy, "Invalid escan buffer length: %d\n",
  1020. + bphy_err(drvr, "Invalid escan buffer length: %d\n",
  1021. escan_buflen);
  1022. goto exit;
  1023. }
  1024. if (le16_to_cpu(escan_result_le->bss_count) != 1) {
  1025. - bphy_err(wiphy, "Invalid bss_count %d: ignoring\n",
  1026. + bphy_err(drvr, "Invalid bss_count %d: ignoring\n",
  1027. escan_result_le->bss_count);
  1028. goto exit;
  1029. }
  1030. @@ -3171,7 +3197,7 @@ brcmf_cfg80211_escan_handler(struct brcm
  1031. bi_length = le32_to_cpu(bss_info_le->length);
  1032. if (bi_length != escan_buflen - WL_ESCAN_RESULTS_FIXED_SIZE) {
  1033. - bphy_err(wiphy, "Ignoring invalid bss_info length: %d\n",
  1034. + bphy_err(drvr, "Ignoring invalid bss_info length: %d\n",
  1035. bi_length);
  1036. goto exit;
  1037. }
  1038. @@ -3180,7 +3206,7 @@ brcmf_cfg80211_escan_handler(struct brcm
  1039. BIT(NL80211_IFTYPE_ADHOC))) {
  1040. if (le16_to_cpu(bss_info_le->capability) &
  1041. WLAN_CAPABILITY_IBSS) {
  1042. - bphy_err(wiphy, "Ignoring IBSS result\n");
  1043. + bphy_err(drvr, "Ignoring IBSS result\n");
  1044. goto exit;
  1045. }
  1046. }
  1047. @@ -3188,7 +3214,7 @@ brcmf_cfg80211_escan_handler(struct brcm
  1048. list = (struct brcmf_scan_results *)
  1049. cfg->escan_info.escan_buf;
  1050. if (bi_length > BRCMF_ESCAN_BUF_SIZE - list->buflen) {
  1051. - bphy_err(wiphy, "Buffer is too small: ignoring\n");
  1052. + bphy_err(drvr, "Buffer is too small: ignoring\n");
  1053. goto exit;
  1054. }
  1055. @@ -3345,7 +3371,8 @@ static s32
  1056. brcmf_notify_sched_scan_results(struct brcmf_if *ifp,
  1057. const struct brcmf_event_msg *e, void *data)
  1058. {
  1059. - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
  1060. + struct brcmf_pub *drvr = ifp->drvr;
  1061. + struct brcmf_cfg80211_info *cfg = drvr->config;
  1062. struct brcmf_pno_net_info_le *netinfo, *netinfo_start;
  1063. struct cfg80211_scan_request *request = NULL;
  1064. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1065. @@ -3377,14 +3404,14 @@ brcmf_notify_sched_scan_results(struct b
  1066. WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE);
  1067. brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count);
  1068. if (!result_count) {
  1069. - bphy_err(wiphy, "FALSE PNO Event. (pfn_count == 0)\n");
  1070. + bphy_err(drvr, "FALSE PNO Event. (pfn_count == 0)\n");
  1071. goto out_err;
  1072. }
  1073. netinfo_start = brcmf_get_netinfo_array(pfn_result);
  1074. datalen = e->datalen - ((void *)netinfo_start - (void *)pfn_result);
  1075. if (datalen < result_count * sizeof(*netinfo)) {
  1076. - bphy_err(wiphy, "insufficient event data\n");
  1077. + bphy_err(drvr, "insufficient event data\n");
  1078. goto out_err;
  1079. }
  1080. @@ -3428,12 +3455,13 @@ brcmf_cfg80211_sched_scan_start(struct w
  1081. {
  1082. struct brcmf_if *ifp = netdev_priv(ndev);
  1083. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1084. + struct brcmf_pub *drvr = cfg->pub;
  1085. brcmf_dbg(SCAN, "Enter n_match_sets:%d n_ssids:%d\n",
  1086. req->n_match_sets, req->n_ssids);
  1087. if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
  1088. - bphy_err(wiphy, "Scanning suppressed: status (%lu)\n",
  1089. + bphy_err(drvr, "Scanning suppressed: status (%lu)\n",
  1090. cfg->scan_status);
  1091. return -EAGAIN;
  1092. }
  1093. @@ -3512,8 +3540,8 @@ static s32
  1094. brcmf_wowl_nd_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e,
  1095. void *data)
  1096. {
  1097. - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
  1098. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1099. + struct brcmf_pub *drvr = ifp->drvr;
  1100. + struct brcmf_cfg80211_info *cfg = drvr->config;
  1101. struct brcmf_pno_scanresults_le *pfn_result;
  1102. struct brcmf_pno_net_info_le *netinfo;
  1103. @@ -3532,7 +3560,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
  1104. }
  1105. if (le32_to_cpu(pfn_result->count) < 1) {
  1106. - bphy_err(wiphy, "Invalid result count, expected 1 (%d)\n",
  1107. + bphy_err(drvr, "Invalid result count, expected 1 (%d)\n",
  1108. le32_to_cpu(pfn_result->count));
  1109. return -EINVAL;
  1110. }
  1111. @@ -3560,6 +3588,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
  1112. static void brcmf_report_wowl_wakeind(struct wiphy *wiphy, struct brcmf_if *ifp)
  1113. {
  1114. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1115. + struct brcmf_pub *drvr = cfg->pub;
  1116. struct brcmf_wowl_wakeind_le wake_ind_le;
  1117. struct cfg80211_wowlan_wakeup wakeup_data;
  1118. struct cfg80211_wowlan_wakeup *wakeup;
  1119. @@ -3570,7 +3599,7 @@ static void brcmf_report_wowl_wakeind(st
  1120. err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le,
  1121. sizeof(wake_ind_le));
  1122. if (err) {
  1123. - bphy_err(wiphy, "Get wowl_wakeind failed, err = %d\n", err);
  1124. + bphy_err(drvr, "Get wowl_wakeind failed, err = %d\n", err);
  1125. return;
  1126. }
  1127. @@ -3611,7 +3640,7 @@ static void brcmf_report_wowl_wakeind(st
  1128. cfg->wowl.nd_data_completed,
  1129. BRCMF_ND_INFO_TIMEOUT);
  1130. if (!timeout)
  1131. - bphy_err(wiphy, "No result for wowl net detect\n");
  1132. + bphy_err(drvr, "No result for wowl net detect\n");
  1133. else
  1134. wakeup_data.net_detect = cfg->wowl.nd_info;
  1135. }
  1136. @@ -3800,6 +3829,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
  1137. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1138. struct brcmf_if *ifp = netdev_priv(ndev);
  1139. struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0];
  1140. + struct brcmf_pub *drvr = cfg->pub;
  1141. s32 err;
  1142. u32 npmk, i;
  1143. @@ -3819,7 +3849,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
  1144. cfg->pmk_list.npmk = cpu_to_le32(npmk);
  1145. }
  1146. } else {
  1147. - bphy_err(wiphy, "Too many PMKSA entries cached %d\n", npmk);
  1148. + bphy_err(drvr, "Too many PMKSA entries cached %d\n", npmk);
  1149. return -EINVAL;
  1150. }
  1151. @@ -3842,6 +3872,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
  1152. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1153. struct brcmf_if *ifp = netdev_priv(ndev);
  1154. struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0];
  1155. + struct brcmf_pub *drvr = cfg->pub;
  1156. s32 err;
  1157. u32 npmk, i;
  1158. @@ -3865,7 +3896,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
  1159. memset(&pmk[i], 0, sizeof(*pmk));
  1160. cfg->pmk_list.npmk = cpu_to_le32(npmk - 1);
  1161. } else {
  1162. - bphy_err(wiphy, "Cache entry not found\n");
  1163. + bphy_err(drvr, "Cache entry not found\n");
  1164. return -EINVAL;
  1165. }
  1166. @@ -3897,25 +3928,25 @@ brcmf_cfg80211_flush_pmksa(struct wiphy
  1167. static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
  1168. {
  1169. - struct wiphy *wiphy = ifp->drvr->wiphy;
  1170. + struct brcmf_pub *drvr = ifp->drvr;
  1171. s32 err;
  1172. /* set auth */
  1173. err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0);
  1174. if (err < 0) {
  1175. - bphy_err(wiphy, "auth error %d\n", err);
  1176. + bphy_err(drvr, "auth error %d\n", err);
  1177. return err;
  1178. }
  1179. /* set wsec */
  1180. err = brcmf_fil_bsscfg_int_set(ifp, "wsec", 0);
  1181. if (err < 0) {
  1182. - bphy_err(wiphy, "wsec error %d\n", err);
  1183. + bphy_err(drvr, "wsec error %d\n", err);
  1184. return err;
  1185. }
  1186. /* set upper-layer auth */
  1187. err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", WPA_AUTH_NONE);
  1188. if (err < 0) {
  1189. - bphy_err(wiphy, "wpa_auth error %d\n", err);
  1190. + bphy_err(drvr, "wpa_auth error %d\n", err);
  1191. return err;
  1192. }
  1193. @@ -3935,7 +3966,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1194. const struct brcmf_vs_tlv *wpa_ie,
  1195. bool is_rsn_ie)
  1196. {
  1197. - struct wiphy *wiphy = ifp->drvr->wiphy;
  1198. + struct brcmf_pub *drvr = ifp->drvr;
  1199. u32 auth = 0; /* d11 open authentication */
  1200. u16 count;
  1201. s32 err = 0;
  1202. @@ -3966,13 +3997,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1203. /* check for multicast cipher suite */
  1204. if (offset + WPA_IE_MIN_OUI_LEN > len) {
  1205. err = -EINVAL;
  1206. - bphy_err(wiphy, "no multicast cipher suite\n");
  1207. + bphy_err(drvr, "no multicast cipher suite\n");
  1208. goto exit;
  1209. }
  1210. if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
  1211. err = -EINVAL;
  1212. - bphy_err(wiphy, "ivalid OUI\n");
  1213. + bphy_err(drvr, "ivalid OUI\n");
  1214. goto exit;
  1215. }
  1216. offset += TLV_OUI_LEN;
  1217. @@ -3994,7 +4025,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1218. break;
  1219. default:
  1220. err = -EINVAL;
  1221. - bphy_err(wiphy, "Invalid multi cast cipher info\n");
  1222. + bphy_err(drvr, "Invalid multi cast cipher info\n");
  1223. goto exit;
  1224. }
  1225. @@ -4005,13 +4036,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1226. /* Check for unicast suite(s) */
  1227. if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
  1228. err = -EINVAL;
  1229. - bphy_err(wiphy, "no unicast cipher suite\n");
  1230. + bphy_err(drvr, "no unicast cipher suite\n");
  1231. goto exit;
  1232. }
  1233. for (i = 0; i < count; i++) {
  1234. if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
  1235. err = -EINVAL;
  1236. - bphy_err(wiphy, "ivalid OUI\n");
  1237. + bphy_err(drvr, "ivalid OUI\n");
  1238. goto exit;
  1239. }
  1240. offset += TLV_OUI_LEN;
  1241. @@ -4029,7 +4060,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1242. pval |= AES_ENABLED;
  1243. break;
  1244. default:
  1245. - bphy_err(wiphy, "Invalid unicast security info\n");
  1246. + bphy_err(drvr, "Invalid unicast security info\n");
  1247. }
  1248. offset++;
  1249. }
  1250. @@ -4039,13 +4070,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1251. /* Check for auth key management suite(s) */
  1252. if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
  1253. err = -EINVAL;
  1254. - bphy_err(wiphy, "no auth key mgmt suite\n");
  1255. + bphy_err(drvr, "no auth key mgmt suite\n");
  1256. goto exit;
  1257. }
  1258. for (i = 0; i < count; i++) {
  1259. if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
  1260. err = -EINVAL;
  1261. - bphy_err(wiphy, "ivalid OUI\n");
  1262. + bphy_err(drvr, "ivalid OUI\n");
  1263. goto exit;
  1264. }
  1265. offset += TLV_OUI_LEN;
  1266. @@ -4073,7 +4104,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1267. wpa_auth |= WPA2_AUTH_1X_SHA256;
  1268. break;
  1269. default:
  1270. - bphy_err(wiphy, "Invalid key mgmt info\n");
  1271. + bphy_err(drvr, "Invalid key mgmt info\n");
  1272. }
  1273. offset++;
  1274. }
  1275. @@ -4115,7 +4146,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1276. err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable",
  1277. wme_bss_disable);
  1278. if (err < 0) {
  1279. - bphy_err(wiphy, "wme_bss_disable error %d\n", err);
  1280. + bphy_err(drvr, "wme_bss_disable error %d\n", err);
  1281. goto exit;
  1282. }
  1283. @@ -4129,7 +4160,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1284. &data[offset],
  1285. WPA_IE_MIN_OUI_LEN);
  1286. if (err < 0) {
  1287. - bphy_err(wiphy, "bip error %d\n", err);
  1288. + bphy_err(drvr, "bip error %d\n", err);
  1289. goto exit;
  1290. }
  1291. }
  1292. @@ -4140,13 +4171,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1293. /* set auth */
  1294. err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth);
  1295. if (err < 0) {
  1296. - bphy_err(wiphy, "auth error %d\n", err);
  1297. + bphy_err(drvr, "auth error %d\n", err);
  1298. goto exit;
  1299. }
  1300. /* set wsec */
  1301. err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
  1302. if (err < 0) {
  1303. - bphy_err(wiphy, "wsec error %d\n", err);
  1304. + bphy_err(drvr, "wsec error %d\n", err);
  1305. goto exit;
  1306. }
  1307. /* Configure MFP, this needs to go after wsec otherwise the wsec command
  1308. @@ -4155,14 +4186,14 @@ brcmf_configure_wpaie(struct brcmf_if *i
  1309. if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) {
  1310. err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp);
  1311. if (err < 0) {
  1312. - bphy_err(wiphy, "mfp error %d\n", err);
  1313. + bphy_err(drvr, "mfp error %d\n", err);
  1314. goto exit;
  1315. }
  1316. }
  1317. /* set upper-layer auth */
  1318. err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth);
  1319. if (err < 0) {
  1320. - bphy_err(wiphy, "wpa_auth error %d\n", err);
  1321. + bphy_err(drvr, "wpa_auth error %d\n", err);
  1322. goto exit;
  1323. }
  1324. @@ -4248,8 +4279,8 @@ brcmf_vndr_ie(u8 *iebuf, s32 pktflag, u8
  1325. s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag,
  1326. const u8 *vndr_ie_buf, u32 vndr_ie_len)
  1327. {
  1328. + struct brcmf_pub *drvr;
  1329. struct brcmf_if *ifp;
  1330. - struct wiphy *wiphy;
  1331. struct vif_saved_ie *saved_ie;
  1332. s32 err = 0;
  1333. u8 *iovar_ie_buf;
  1334. @@ -4270,7 +4301,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
  1335. if (!vif)
  1336. return -ENODEV;
  1337. ifp = vif->ifp;
  1338. - wiphy = ifp->drvr->wiphy;
  1339. + drvr = ifp->drvr;
  1340. saved_ie = &vif->saved_ie;
  1341. brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx,
  1342. @@ -4302,13 +4333,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
  1343. break;
  1344. default:
  1345. err = -EPERM;
  1346. - bphy_err(wiphy, "not suitable type\n");
  1347. + bphy_err(drvr, "not suitable type\n");
  1348. goto exit;
  1349. }
  1350. if (vndr_ie_len > mgmt_ie_buf_len) {
  1351. err = -ENOMEM;
  1352. - bphy_err(wiphy, "extra IE size too big\n");
  1353. + bphy_err(drvr, "extra IE size too big\n");
  1354. goto exit;
  1355. }
  1356. @@ -4369,7 +4400,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
  1357. /* verify remained buf size before copy data */
  1358. if (remained_buf_len < (vndrie_info->vndrie.len +
  1359. VNDR_IE_VSIE_OFFSET)) {
  1360. - bphy_err(wiphy, "no space in mgmt_ie_buf: len left %d",
  1361. + bphy_err(drvr, "no space in mgmt_ie_buf: len left %d",
  1362. remained_buf_len);
  1363. break;
  1364. }
  1365. @@ -4401,7 +4432,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
  1366. err = brcmf_fil_bsscfg_data_set(ifp, "vndr_ie", iovar_ie_buf,
  1367. total_ie_buf_len);
  1368. if (err)
  1369. - bphy_err(wiphy, "vndr ie set error : %d\n", err);
  1370. + bphy_err(drvr, "vndr ie set error : %d\n", err);
  1371. }
  1372. exit:
  1373. @@ -4429,14 +4460,14 @@ static s32
  1374. brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif,
  1375. struct cfg80211_beacon_data *beacon)
  1376. {
  1377. - struct wiphy *wiphy = vif->ifp->drvr->wiphy;
  1378. + struct brcmf_pub *drvr = vif->ifp->drvr;
  1379. s32 err;
  1380. /* Set Beacon IEs to FW */
  1381. err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_BEACON_FLAG,
  1382. beacon->tail, beacon->tail_len);
  1383. if (err) {
  1384. - bphy_err(wiphy, "Set Beacon IE Failed\n");
  1385. + bphy_err(drvr, "Set Beacon IE Failed\n");
  1386. return err;
  1387. }
  1388. brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n");
  1389. @@ -4446,7 +4477,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg
  1390. beacon->proberesp_ies,
  1391. beacon->proberesp_ies_len);
  1392. if (err)
  1393. - bphy_err(wiphy, "Set Probe Resp IE Failed\n");
  1394. + bphy_err(drvr, "Set Probe Resp IE Failed\n");
  1395. else
  1396. brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n");
  1397. @@ -4460,6 +4491,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1398. s32 ie_offset;
  1399. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1400. struct brcmf_if *ifp = netdev_priv(ndev);
  1401. + struct brcmf_pub *drvr = cfg->pub;
  1402. const struct brcmf_tlv *ssid_ie;
  1403. const struct brcmf_tlv *country_ie;
  1404. struct brcmf_ssid_le ssid_le;
  1405. @@ -4555,7 +4587,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1406. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
  1407. is_11d);
  1408. if (err < 0) {
  1409. - bphy_err(wiphy, "Regulatory Set Error, %d\n",
  1410. + bphy_err(drvr, "Regulatory Set Error, %d\n",
  1411. err);
  1412. goto exit;
  1413. }
  1414. @@ -4564,7 +4596,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1415. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD,
  1416. settings->beacon_interval);
  1417. if (err < 0) {
  1418. - bphy_err(wiphy, "Beacon Interval Set Error, %d\n",
  1419. + bphy_err(drvr, "Beacon Interval Set Error, %d\n",
  1420. err);
  1421. goto exit;
  1422. }
  1423. @@ -4573,7 +4605,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1424. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD,
  1425. settings->dtim_period);
  1426. if (err < 0) {
  1427. - bphy_err(wiphy, "DTIM Interval Set Error, %d\n",
  1428. + bphy_err(drvr, "DTIM Interval Set Error, %d\n",
  1429. err);
  1430. goto exit;
  1431. }
  1432. @@ -4584,7 +4616,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1433. !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB))) {
  1434. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
  1435. if (err < 0) {
  1436. - bphy_err(wiphy, "BRCMF_C_DOWN error %d\n",
  1437. + bphy_err(drvr, "BRCMF_C_DOWN error %d\n",
  1438. err);
  1439. goto exit;
  1440. }
  1441. @@ -4593,7 +4625,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1442. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1);
  1443. if (err < 0) {
  1444. - bphy_err(wiphy, "SET INFRA error %d\n", err);
  1445. + bphy_err(drvr, "SET INFRA error %d\n", err);
  1446. goto exit;
  1447. }
  1448. } else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) {
  1449. @@ -4609,7 +4641,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1450. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
  1451. if (err < 0) {
  1452. - bphy_err(wiphy, "setting AP mode failed %d\n",
  1453. + bphy_err(drvr, "setting AP mode failed %d\n",
  1454. err);
  1455. goto exit;
  1456. }
  1457. @@ -4619,14 +4651,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1458. */
  1459. err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
  1460. if (err < 0) {
  1461. - bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
  1462. + bphy_err(drvr, "Set Channel failed: chspec=%d, %d\n",
  1463. chanspec, err);
  1464. goto exit;
  1465. }
  1466. }
  1467. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
  1468. if (err < 0) {
  1469. - bphy_err(wiphy, "BRCMF_C_UP error (%d)\n", err);
  1470. + bphy_err(drvr, "BRCMF_C_UP error (%d)\n", err);
  1471. goto exit;
  1472. }
  1473. /* On DOWN the firmware removes the WEP keys, reconfigure
  1474. @@ -4641,14 +4673,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1475. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
  1476. &join_params, sizeof(join_params));
  1477. if (err < 0) {
  1478. - bphy_err(wiphy, "SET SSID error (%d)\n", err);
  1479. + bphy_err(drvr, "SET SSID error (%d)\n", err);
  1480. goto exit;
  1481. }
  1482. if (settings->hidden_ssid) {
  1483. err = brcmf_fil_iovar_int_set(ifp, "closednet", 1);
  1484. if (err) {
  1485. - bphy_err(wiphy, "closednet error (%d)\n", err);
  1486. + bphy_err(drvr, "closednet error (%d)\n", err);
  1487. goto exit;
  1488. }
  1489. }
  1490. @@ -4657,14 +4689,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1491. } else if (dev_role == NL80211_IFTYPE_P2P_GO) {
  1492. err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
  1493. if (err < 0) {
  1494. - bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
  1495. + bphy_err(drvr, "Set Channel failed: chspec=%d, %d\n",
  1496. chanspec, err);
  1497. goto exit;
  1498. }
  1499. err = brcmf_fil_bsscfg_data_set(ifp, "ssid", &ssid_le,
  1500. sizeof(ssid_le));
  1501. if (err < 0) {
  1502. - bphy_err(wiphy, "setting ssid failed %d\n", err);
  1503. + bphy_err(drvr, "setting ssid failed %d\n", err);
  1504. goto exit;
  1505. }
  1506. bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
  1507. @@ -4672,7 +4704,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
  1508. err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
  1509. sizeof(bss_enable));
  1510. if (err < 0) {
  1511. - bphy_err(wiphy, "bss_enable config failed %d\n", err);
  1512. + bphy_err(drvr, "bss_enable config failed %d\n", err);
  1513. goto exit;
  1514. }
  1515. @@ -4695,7 +4727,9 @@ exit:
  1516. static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
  1517. {
  1518. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1519. struct brcmf_if *ifp = netdev_priv(ndev);
  1520. + struct brcmf_pub *drvr = cfg->pub;
  1521. s32 err;
  1522. struct brcmf_fil_bss_enable_le bss_enable;
  1523. struct brcmf_join_params join_params;
  1524. @@ -4720,13 +4754,13 @@ static int brcmf_cfg80211_stop_ap(struct
  1525. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
  1526. &join_params, sizeof(join_params));
  1527. if (err < 0)
  1528. - bphy_err(wiphy, "SET SSID error (%d)\n", err);
  1529. + bphy_err(drvr, "SET SSID error (%d)\n", err);
  1530. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
  1531. if (err < 0)
  1532. - bphy_err(wiphy, "BRCMF_C_DOWN error %d\n", err);
  1533. + bphy_err(drvr, "BRCMF_C_DOWN error %d\n", err);
  1534. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
  1535. if (err < 0)
  1536. - bphy_err(wiphy, "setting AP mode failed %d\n", err);
  1537. + bphy_err(drvr, "setting AP mode failed %d\n", err);
  1538. if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
  1539. brcmf_fil_iovar_int_set(ifp, "mbss", 0);
  1540. brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
  1541. @@ -4734,7 +4768,7 @@ static int brcmf_cfg80211_stop_ap(struct
  1542. /* Bring device back up so it can be used again */
  1543. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
  1544. if (err < 0)
  1545. - bphy_err(wiphy, "BRCMF_C_UP error %d\n", err);
  1546. + bphy_err(drvr, "BRCMF_C_UP error %d\n", err);
  1547. brcmf_vif_clear_mgmt_ies(ifp->vif);
  1548. } else {
  1549. @@ -4743,7 +4777,7 @@ static int brcmf_cfg80211_stop_ap(struct
  1550. err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
  1551. sizeof(bss_enable));
  1552. if (err < 0)
  1553. - bphy_err(wiphy, "bss_enable config failed %d\n", err);
  1554. + bphy_err(drvr, "bss_enable config failed %d\n", err);
  1555. }
  1556. brcmf_set_mpc(ifp, 1);
  1557. brcmf_configure_arp_nd_offload(ifp, true);
  1558. @@ -4772,6 +4806,7 @@ brcmf_cfg80211_del_station(struct wiphy
  1559. struct station_del_parameters *params)
  1560. {
  1561. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1562. + struct brcmf_pub *drvr = cfg->pub;
  1563. struct brcmf_scb_val_le scbval;
  1564. struct brcmf_if *ifp = netdev_priv(ndev);
  1565. s32 err;
  1566. @@ -4791,7 +4826,7 @@ brcmf_cfg80211_del_station(struct wiphy
  1567. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON,
  1568. &scbval, sizeof(scbval));
  1569. if (err)
  1570. - bphy_err(wiphy, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
  1571. + bphy_err(drvr, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
  1572. err);
  1573. brcmf_dbg(TRACE, "Exit\n");
  1574. @@ -4802,7 +4837,9 @@ static int
  1575. brcmf_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev,
  1576. const u8 *mac, struct station_parameters *params)
  1577. {
  1578. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1579. struct brcmf_if *ifp = netdev_priv(ndev);
  1580. + struct brcmf_pub *drvr = cfg->pub;
  1581. s32 err;
  1582. brcmf_dbg(TRACE, "Enter, MAC %pM, mask 0x%04x set 0x%04x\n", mac,
  1583. @@ -4822,7 +4859,7 @@ brcmf_cfg80211_change_station(struct wip
  1584. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SCB_DEAUTHORIZE,
  1585. (void *)mac, ETH_ALEN);
  1586. if (err < 0)
  1587. - bphy_err(wiphy, "Setting SCB (de-)authorize failed, %d\n", err);
  1588. + bphy_err(drvr, "Setting SCB (de-)authorize failed, %d\n", err);
  1589. return err;
  1590. }
  1591. @@ -4852,6 +4889,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
  1592. {
  1593. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1594. struct ieee80211_channel *chan = params->chan;
  1595. + struct brcmf_pub *drvr = cfg->pub;
  1596. const u8 *buf = params->buf;
  1597. size_t len = params->len;
  1598. const struct ieee80211_mgmt *mgmt;
  1599. @@ -4872,7 +4910,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
  1600. mgmt = (const struct ieee80211_mgmt *)buf;
  1601. if (!ieee80211_is_mgmt(mgmt->frame_control)) {
  1602. - bphy_err(wiphy, "Driver only allows MGMT packet type\n");
  1603. + bphy_err(drvr, "Driver only allows MGMT packet type\n");
  1604. return -EPERM;
  1605. }
  1606. @@ -4903,13 +4941,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
  1607. GFP_KERNEL);
  1608. } else if (ieee80211_is_action(mgmt->frame_control)) {
  1609. if (len > BRCMF_FIL_ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN) {
  1610. - bphy_err(wiphy, "invalid action frame length\n");
  1611. + bphy_err(drvr, "invalid action frame length\n");
  1612. err = -EINVAL;
  1613. goto exit;
  1614. }
  1615. af_params = kzalloc(sizeof(*af_params), GFP_KERNEL);
  1616. if (af_params == NULL) {
  1617. - bphy_err(wiphy, "unable to allocate frame\n");
  1618. + bphy_err(drvr, "unable to allocate frame\n");
  1619. err = -ENOMEM;
  1620. goto exit;
  1621. }
  1622. @@ -4960,6 +4998,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
  1623. u64 cookie)
  1624. {
  1625. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1626. + struct brcmf_pub *drvr = cfg->pub;
  1627. struct brcmf_cfg80211_vif *vif;
  1628. int err = 0;
  1629. @@ -4967,7 +5006,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
  1630. vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
  1631. if (vif == NULL) {
  1632. - bphy_err(wiphy, "No p2p device available for probe response\n");
  1633. + bphy_err(drvr, "No p2p device available for probe response\n");
  1634. err = -ENODEV;
  1635. goto exit;
  1636. }
  1637. @@ -4982,6 +5021,7 @@ static int brcmf_cfg80211_get_channel(st
  1638. {
  1639. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1640. struct net_device *ndev = wdev->netdev;
  1641. + struct brcmf_pub *drvr = cfg->pub;
  1642. struct brcmf_if *ifp;
  1643. struct brcmu_chan ch;
  1644. enum nl80211_band band = 0;
  1645. @@ -4995,7 +5035,7 @@ static int brcmf_cfg80211_get_channel(st
  1646. err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
  1647. if (err) {
  1648. - bphy_err(wiphy, "chanspec failed (%d)\n", err);
  1649. + bphy_err(drvr, "chanspec failed (%d)\n", err);
  1650. return err;
  1651. }
  1652. @@ -5117,6 +5157,8 @@ static int brcmf_cfg80211_tdls_oper(stru
  1653. struct net_device *ndev, const u8 *peer,
  1654. enum nl80211_tdls_operation oper)
  1655. {
  1656. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1657. + struct brcmf_pub *drvr = cfg->pub;
  1658. struct brcmf_if *ifp;
  1659. struct brcmf_tdls_iovar_le info;
  1660. int ret = 0;
  1661. @@ -5134,7 +5176,7 @@ static int brcmf_cfg80211_tdls_oper(stru
  1662. ret = brcmf_fil_iovar_data_set(ifp, "tdls_endpoint",
  1663. &info, sizeof(info));
  1664. if (ret < 0)
  1665. - bphy_err(wiphy, "tdls_endpoint iovar failed: ret=%d\n", ret);
  1666. + bphy_err(drvr, "tdls_endpoint iovar failed: ret=%d\n", ret);
  1667. return ret;
  1668. }
  1669. @@ -5145,6 +5187,8 @@ brcmf_cfg80211_update_conn_params(struct
  1670. struct cfg80211_connect_params *sme,
  1671. u32 changed)
  1672. {
  1673. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1674. + struct brcmf_pub *drvr = cfg->pub;
  1675. struct brcmf_if *ifp;
  1676. int err;
  1677. @@ -5155,7 +5199,7 @@ brcmf_cfg80211_update_conn_params(struct
  1678. err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
  1679. sme->ie, sme->ie_len);
  1680. if (err)
  1681. - bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
  1682. + bphy_err(drvr, "Set Assoc REQ IE Failed\n");
  1683. else
  1684. brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
  1685. @@ -5167,6 +5211,8 @@ static int
  1686. brcmf_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *ndev,
  1687. struct cfg80211_gtk_rekey_data *gtk)
  1688. {
  1689. + struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1690. + struct brcmf_pub *drvr = cfg->pub;
  1691. struct brcmf_if *ifp = netdev_priv(ndev);
  1692. struct brcmf_gtk_keyinfo_le gtk_le;
  1693. int ret;
  1694. @@ -5181,7 +5227,7 @@ brcmf_cfg80211_set_rekey_data(struct wip
  1695. ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", &gtk_le,
  1696. sizeof(gtk_le));
  1697. if (ret < 0)
  1698. - bphy_err(wiphy, "gtk_key_info iovar failed: ret=%d\n", ret);
  1699. + bphy_err(drvr, "gtk_key_info iovar failed: ret=%d\n", ret);
  1700. return ret;
  1701. }
  1702. @@ -5359,7 +5405,7 @@ static void brcmf_clear_assoc_ies(struct
  1703. static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg,
  1704. struct brcmf_if *ifp)
  1705. {
  1706. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1707. + struct brcmf_pub *drvr = cfg->pub;
  1708. struct brcmf_cfg80211_assoc_ielen_le *assoc_info;
  1709. struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg);
  1710. u32 req_len;
  1711. @@ -5371,7 +5417,7 @@ static s32 brcmf_get_assoc_ies(struct br
  1712. err = brcmf_fil_iovar_data_get(ifp, "assoc_info",
  1713. cfg->extra_buf, WL_ASSOC_INFO_MAX);
  1714. if (err) {
  1715. - bphy_err(wiphy, "could not get assoc info (%d)\n", err);
  1716. + bphy_err(drvr, "could not get assoc info (%d)\n", err);
  1717. return err;
  1718. }
  1719. assoc_info =
  1720. @@ -5383,7 +5429,7 @@ static s32 brcmf_get_assoc_ies(struct br
  1721. cfg->extra_buf,
  1722. WL_ASSOC_INFO_MAX);
  1723. if (err) {
  1724. - bphy_err(wiphy, "could not get assoc req (%d)\n", err);
  1725. + bphy_err(drvr, "could not get assoc req (%d)\n", err);
  1726. return err;
  1727. }
  1728. conn_info->req_ie_len = req_len;
  1729. @@ -5399,7 +5445,7 @@ static s32 brcmf_get_assoc_ies(struct br
  1730. cfg->extra_buf,
  1731. WL_ASSOC_INFO_MAX);
  1732. if (err) {
  1733. - bphy_err(wiphy, "could not get assoc resp (%d)\n", err);
  1734. + bphy_err(drvr, "could not get assoc resp (%d)\n", err);
  1735. return err;
  1736. }
  1737. conn_info->resp_ie_len = resp_len;
  1738. @@ -5518,7 +5564,7 @@ brcmf_notify_connect_status_ap(struct br
  1739. struct net_device *ndev,
  1740. const struct brcmf_event_msg *e, void *data)
  1741. {
  1742. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1743. + struct brcmf_pub *drvr = cfg->pub;
  1744. static int generation;
  1745. u32 event = e->event_code;
  1746. u32 reason = e->reason;
  1747. @@ -5537,7 +5583,7 @@ brcmf_notify_connect_status_ap(struct br
  1748. (reason == BRCMF_E_STATUS_SUCCESS)) {
  1749. memset(&sinfo, 0, sizeof(sinfo));
  1750. if (!data) {
  1751. - bphy_err(wiphy, "No IEs present in ASSOC/REASSOC_IND\n");
  1752. + bphy_err(drvr, "No IEs present in ASSOC/REASSOC_IND\n");
  1753. return -EINVAL;
  1754. }
  1755. sinfo.assoc_req_ies = data;
  1756. @@ -5818,7 +5864,7 @@ static void init_vif_event(struct brcmf_
  1757. static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
  1758. {
  1759. - struct wiphy *wiphy = ifp->drvr->wiphy;
  1760. + struct brcmf_pub *drvr = ifp->drvr;
  1761. s32 err;
  1762. u32 bcn_timeout;
  1763. __le32 roamtrigger[2];
  1764. @@ -5831,7 +5877,7 @@ static s32 brcmf_dongle_roam(struct brcm
  1765. bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON;
  1766. err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout);
  1767. if (err) {
  1768. - bphy_err(wiphy, "bcn_timeout error (%d)\n", err);
  1769. + bphy_err(drvr, "bcn_timeout error (%d)\n", err);
  1770. goto roam_setup_done;
  1771. }
  1772. @@ -5843,7 +5889,7 @@ static s32 brcmf_dongle_roam(struct brcm
  1773. err = brcmf_fil_iovar_int_set(ifp, "roam_off",
  1774. ifp->drvr->settings->roamoff);
  1775. if (err) {
  1776. - bphy_err(wiphy, "roam_off error (%d)\n", err);
  1777. + bphy_err(drvr, "roam_off error (%d)\n", err);
  1778. goto roam_setup_done;
  1779. }
  1780. @@ -5852,7 +5898,7 @@ static s32 brcmf_dongle_roam(struct brcm
  1781. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER,
  1782. (void *)roamtrigger, sizeof(roamtrigger));
  1783. if (err) {
  1784. - bphy_err(wiphy, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
  1785. + bphy_err(drvr, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
  1786. goto roam_setup_done;
  1787. }
  1788. @@ -5861,7 +5907,7 @@ static s32 brcmf_dongle_roam(struct brcm
  1789. err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA,
  1790. (void *)roam_delta, sizeof(roam_delta));
  1791. if (err) {
  1792. - bphy_err(wiphy, "WLC_SET_ROAM_DELTA error (%d)\n", err);
  1793. + bphy_err(drvr, "WLC_SET_ROAM_DELTA error (%d)\n", err);
  1794. goto roam_setup_done;
  1795. }
  1796. @@ -5872,26 +5918,26 @@ roam_setup_done:
  1797. static s32
  1798. brcmf_dongle_scantime(struct brcmf_if *ifp)
  1799. {
  1800. - struct wiphy *wiphy = ifp->drvr->wiphy;
  1801. + struct brcmf_pub *drvr = ifp->drvr;
  1802. s32 err = 0;
  1803. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME,
  1804. BRCMF_SCAN_CHANNEL_TIME);
  1805. if (err) {
  1806. - bphy_err(wiphy, "Scan assoc time error (%d)\n", err);
  1807. + bphy_err(drvr, "Scan assoc time error (%d)\n", err);
  1808. goto dongle_scantime_out;
  1809. }
  1810. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME,
  1811. BRCMF_SCAN_UNASSOC_TIME);
  1812. if (err) {
  1813. - bphy_err(wiphy, "Scan unassoc time error (%d)\n", err);
  1814. + bphy_err(drvr, "Scan unassoc time error (%d)\n", err);
  1815. goto dongle_scantime_out;
  1816. }
  1817. err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_PASSIVE_TIME,
  1818. BRCMF_SCAN_PASSIVE_TIME);
  1819. if (err) {
  1820. - bphy_err(wiphy, "Scan passive time error (%d)\n", err);
  1821. + bphy_err(drvr, "Scan passive time error (%d)\n", err);
  1822. goto dongle_scantime_out;
  1823. }
  1824. @@ -5924,7 +5970,8 @@ static int brcmf_construct_chaninfo(stru
  1825. u32 bw_cap[])
  1826. {
  1827. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1828. - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
  1829. + struct brcmf_pub *drvr = cfg->pub;
  1830. + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
  1831. struct ieee80211_supported_band *band;
  1832. struct ieee80211_channel *channel;
  1833. struct brcmf_chanspec_list *list;
  1834. @@ -5945,7 +5992,7 @@ static int brcmf_construct_chaninfo(stru
  1835. err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
  1836. BRCMF_DCMD_MEDLEN);
  1837. if (err) {
  1838. - bphy_err(wiphy, "get chanspecs error (%d)\n", err);
  1839. + bphy_err(drvr, "get chanspecs error (%d)\n", err);
  1840. goto fail_pbuf;
  1841. }
  1842. @@ -5968,7 +6015,7 @@ static int brcmf_construct_chaninfo(stru
  1843. } else if (ch.band == BRCMU_CHAN_BAND_5G) {
  1844. band = wiphy->bands[NL80211_BAND_5GHZ];
  1845. } else {
  1846. - bphy_err(wiphy, "Invalid channel Spec. 0x%x.\n",
  1847. + bphy_err(drvr, "Invalid channel Spec. 0x%x.\n",
  1848. ch.chspec);
  1849. continue;
  1850. }
  1851. @@ -5992,7 +6039,7 @@ static int brcmf_construct_chaninfo(stru
  1852. /* It seems firmware supports some channel we never
  1853. * considered. Something new in IEEE standard?
  1854. */
  1855. - bphy_err(wiphy, "Ignoring unexpected firmware channel %d\n",
  1856. + bphy_err(drvr, "Ignoring unexpected firmware channel %d\n",
  1857. ch.control_ch_num);
  1858. continue;
  1859. }
  1860. @@ -6049,8 +6096,8 @@ fail_pbuf:
  1861. static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
  1862. {
  1863. - struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1864. - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
  1865. + struct brcmf_pub *drvr = cfg->pub;
  1866. + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
  1867. struct ieee80211_supported_band *band;
  1868. struct brcmf_fil_bwcap_le band_bwcap;
  1869. struct brcmf_chanspec_list *list;
  1870. @@ -6096,7 +6143,7 @@ static int brcmf_enable_bw40_2g(struct b
  1871. err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
  1872. BRCMF_DCMD_MEDLEN);
  1873. if (err) {
  1874. - bphy_err(wiphy, "get chanspecs error (%d)\n", err);
  1875. + bphy_err(drvr, "get chanspecs error (%d)\n", err);
  1876. kfree(pbuf);
  1877. return err;
  1878. }
  1879. @@ -6127,7 +6174,7 @@ static int brcmf_enable_bw40_2g(struct b
  1880. static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[])
  1881. {
  1882. - struct wiphy *wiphy = ifp->drvr->wiphy;
  1883. + struct brcmf_pub *drvr = ifp->drvr;
  1884. u32 band, mimo_bwcap;
  1885. int err;
  1886. @@ -6163,7 +6210,7 @@ static void brcmf_get_bwcap(struct brcmf
  1887. bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT;
  1888. break;
  1889. default:
  1890. - bphy_err(wiphy, "invalid mimo_bw_cap value\n");
  1891. + bphy_err(drvr, "invalid mimo_bw_cap value\n");
  1892. }
  1893. }
  1894. @@ -6238,7 +6285,8 @@ static void brcmf_update_vht_cap(struct
  1895. static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
  1896. {
  1897. - struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
  1898. + struct brcmf_pub *drvr = cfg->pub;
  1899. + struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
  1900. struct wiphy *wiphy = cfg_to_wiphy(cfg);
  1901. u32 nmode = 0;
  1902. u32 vhtmode = 0;
  1903. @@ -6255,7 +6303,7 @@ static int brcmf_setup_wiphybands(struct
  1904. (void)brcmf_fil_iovar_int_get(ifp, "vhtmode", &vhtmode);
  1905. err = brcmf_fil_iovar_int_get(ifp, "nmode", &nmode);
  1906. if (err) {
  1907. - bphy_err(wiphy, "nmode error (%d)\n", err);
  1908. + bphy_err(drvr, "nmode error (%d)\n", err);
  1909. } else {
  1910. brcmf_get_bwcap(ifp, bw_cap);
  1911. }
  1912. @@ -6265,7 +6313,7 @@ static int brcmf_setup_wiphybands(struct
  1913. err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain);
  1914. if (err) {
  1915. - bphy_err(wiphy, "rxchain error (%d)\n", err);
  1916. + bphy_err(drvr, "rxchain error (%d)\n", err);
  1917. nchain = 1;
  1918. } else {
  1919. for (nchain = 0; rxchain; nchain++)
  1920. @@ -6275,7 +6323,7 @@ static int brcmf_setup_wiphybands(struct
  1921. err = brcmf_construct_chaninfo(cfg, bw_cap);
  1922. if (err) {
  1923. - bphy_err(wiphy, "brcmf_construct_chaninfo failed (%d)\n", err);
  1924. + bphy_err(drvr, "brcmf_construct_chaninfo failed (%d)\n", err);
  1925. return err;
  1926. }
  1927. @@ -6492,12 +6540,13 @@ static void brcmf_wiphy_wowl_params(stru
  1928. {
  1929. #ifdef CONFIG_PM
  1930. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1931. + struct brcmf_pub *drvr = cfg->pub;
  1932. struct wiphy_wowlan_support *wowl;
  1933. wowl = kmemdup(&brcmf_wowlan_support, sizeof(brcmf_wowlan_support),
  1934. GFP_KERNEL);
  1935. if (!wowl) {
  1936. - bphy_err(wiphy, "only support basic wowlan features\n");
  1937. + bphy_err(drvr, "only support basic wowlan features\n");
  1938. wiphy->wowlan = &brcmf_wowlan_support;
  1939. return;
  1940. }
  1941. @@ -6586,7 +6635,7 @@ static int brcmf_setup_wiphy(struct wiph
  1942. err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist,
  1943. sizeof(bandlist));
  1944. if (err) {
  1945. - bphy_err(wiphy, "could not obtain band info: err=%d\n", err);
  1946. + bphy_err(drvr, "could not obtain band info: err=%d\n", err);
  1947. return err;
  1948. }
  1949. /* first entry in bandlist is number of bands */
  1950. @@ -6847,6 +6896,7 @@ static void brcmf_cfg80211_reg_notifier(
  1951. {
  1952. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  1953. struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
  1954. + struct brcmf_pub *drvr = cfg->pub;
  1955. struct brcmf_fil_country_le ccreq;
  1956. s32 err;
  1957. int i;
  1958. @@ -6858,7 +6908,7 @@ static void brcmf_cfg80211_reg_notifier(
  1959. /* ignore non-ISO3166 country codes */
  1960. for (i = 0; i < 2; i++)
  1961. if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
  1962. - bphy_err(wiphy, "not a ISO3166 code (0x%02x 0x%02x)\n",
  1963. + bphy_err(drvr, "not a ISO3166 code (0x%02x 0x%02x)\n",
  1964. req->alpha2[0], req->alpha2[1]);
  1965. return;
  1966. }
  1967. @@ -6868,7 +6918,7 @@ static void brcmf_cfg80211_reg_notifier(
  1968. err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
  1969. if (err) {
  1970. - bphy_err(wiphy, "Country code iovar returned err = %d\n", err);
  1971. + bphy_err(drvr, "Country code iovar returned err = %d\n", err);
  1972. return;
  1973. }
  1974. @@ -6878,7 +6928,7 @@ static void brcmf_cfg80211_reg_notifier(
  1975. err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq));
  1976. if (err) {
  1977. - bphy_err(wiphy, "Firmware rejected country setting\n");
  1978. + bphy_err(drvr, "Firmware rejected country setting\n");
  1979. return;
  1980. }
  1981. brcmf_setup_wiphybands(cfg);
  1982. @@ -6924,13 +6974,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  1983. u16 *cap = NULL;
  1984. if (!ndev) {
  1985. - bphy_err(wiphy, "ndev is invalid\n");
  1986. + bphy_err(drvr, "ndev is invalid\n");
  1987. return NULL;
  1988. }
  1989. cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
  1990. if (!cfg) {
  1991. - bphy_err(wiphy, "Could not allocate wiphy device\n");
  1992. + bphy_err(drvr, "Could not allocate wiphy device\n");
  1993. return NULL;
  1994. }
  1995. @@ -6951,7 +7001,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  1996. err = wl_init_priv(cfg);
  1997. if (err) {
  1998. - bphy_err(wiphy, "Failed to init iwm_priv (%d)\n", err);
  1999. + bphy_err(drvr, "Failed to init iwm_priv (%d)\n", err);
  2000. brcmf_free_vif(vif);
  2001. goto wiphy_out;
  2002. }
  2003. @@ -6960,7 +7010,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  2004. /* determine d11 io type before wiphy setup */
  2005. err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_VERSION, &io_type);
  2006. if (err) {
  2007. - bphy_err(wiphy, "Failed to get D11 version (%d)\n", err);
  2008. + bphy_err(drvr, "Failed to get D11 version (%d)\n", err);
  2009. goto priv_out;
  2010. }
  2011. cfg->d11inf.io_type = (u8)io_type;
  2012. @@ -6994,13 +7044,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  2013. #endif
  2014. err = wiphy_register(wiphy);
  2015. if (err < 0) {
  2016. - bphy_err(wiphy, "Could not register wiphy device (%d)\n", err);
  2017. + bphy_err(drvr, "Could not register wiphy device (%d)\n", err);
  2018. goto priv_out;
  2019. }
  2020. err = brcmf_setup_wiphybands(cfg);
  2021. if (err) {
  2022. - bphy_err(wiphy, "Setting wiphy bands failed (%d)\n", err);
  2023. + bphy_err(drvr, "Setting wiphy bands failed (%d)\n", err);
  2024. goto wiphy_unreg_out;
  2025. }
  2026. @@ -7018,18 +7068,18 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  2027. err = brcmf_fweh_activate_events(ifp);
  2028. if (err) {
  2029. - bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
  2030. + bphy_err(drvr, "FWEH activation failed (%d)\n", err);
  2031. goto wiphy_unreg_out;
  2032. }
  2033. err = brcmf_p2p_attach(cfg, p2pdev_forced);
  2034. if (err) {
  2035. - bphy_err(wiphy, "P2P initialisation failed (%d)\n", err);
  2036. + bphy_err(drvr, "P2P initialisation failed (%d)\n", err);
  2037. goto wiphy_unreg_out;
  2038. }
  2039. err = brcmf_btcoex_attach(cfg);
  2040. if (err) {
  2041. - bphy_err(wiphy, "BT-coex initialisation failed (%d)\n", err);
  2042. + bphy_err(drvr, "BT-coex initialisation failed (%d)\n", err);
  2043. brcmf_p2p_detach(&cfg->p2p);
  2044. goto wiphy_unreg_out;
  2045. }
  2046. @@ -7048,7 +7098,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  2047. /* (re-) activate FWEH event handling */
  2048. err = brcmf_fweh_activate_events(ifp);
  2049. if (err) {
  2050. - bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
  2051. + bphy_err(drvr, "FWEH activation failed (%d)\n", err);
  2052. goto detach;
  2053. }
  2054. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
  2055. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
  2056. @@ -62,12 +62,12 @@ void __brcmf_err(struct brcmf_bus *bus,
  2057. } while (0)
  2058. #endif
  2059. -#define bphy_err(wiphy, fmt, ...) \
  2060. +#define bphy_err(drvr, fmt, ...) \
  2061. do { \
  2062. if (IS_ENABLED(CPTCFG_BRCMDBG) || \
  2063. IS_ENABLED(CPTCFG_BRCM_TRACING) || \
  2064. net_ratelimit()) \
  2065. - wiphy_err(wiphy, "%s: " fmt, __func__, \
  2066. + wiphy_err((drvr)->wiphy, "%s: " fmt, __func__, \
  2067. ##__VA_ARGS__); \
  2068. } while (0)