1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954 |
- From 3ef005b82e2ad68107fc5814eaa743d171a6c362 Mon Sep 17 00:00:00 2001
- From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
- Date: Wed, 16 Jan 2019 07:28:54 +0100
- Subject: [PATCH] brcmfmac: add bphy_err() and use it in the cfg80211.c
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- This new macro uses wiphy_err() which:
- 1) Should be the best choice with wiphy already created
- 2) Uses dev_err() which allows identifying error-affected device
- Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
- Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
- ---
- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 497 ++++++++++--------
- .../broadcom/brcm80211/brcmfmac/debug.h | 9 +
- 2 files changed, 282 insertions(+), 224 deletions(-)
- --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
- +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
- @@ -457,6 +457,7 @@ static void convert_key_from_CPU(struct
- static int
- send_key_to_dongle(struct brcmf_if *ifp, struct brcmf_wsec_key *key)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- int err;
- struct brcmf_wsec_key_le key_le;
-
- @@ -468,7 +469,7 @@ send_key_to_dongle(struct brcmf_if *ifp,
- sizeof(key_le));
-
- if (err)
- - brcmf_err("wsec_key error (%d)\n", err);
- + bphy_err(wiphy, "wsec_key error (%d)\n", err);
- return err;
- }
-
- @@ -549,6 +550,7 @@ static int brcmf_get_first_free_bsscfgid
-
- static int brcmf_cfg80211_request_ap_if(struct brcmf_if *ifp)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- struct brcmf_mbss_ssid_le mbss_ssid_le;
- int bsscfgidx;
- int err;
- @@ -565,7 +567,7 @@ static int brcmf_cfg80211_request_ap_if(
- err = brcmf_fil_bsscfg_data_set(ifp, "bsscfg:ssid", &mbss_ssid_le,
- sizeof(mbss_ssid_le));
- if (err < 0)
- - brcmf_err("setting ssid failed %d\n", err);
- + bphy_err(wiphy, "setting ssid failed %d\n", err);
-
- return err;
- }
- @@ -609,7 +611,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
- BRCMF_VIF_EVENT_TIMEOUT);
- brcmf_cfg80211_arm_vif_event(cfg, NULL);
- if (!err) {
- - brcmf_err("timeout occurred\n");
- + bphy_err(wiphy, "timeout occurred\n");
- err = -EIO;
- goto fail;
- }
- @@ -617,7 +619,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
- /* interface created in firmware */
- ifp = vif->ifp;
- if (!ifp) {
- - brcmf_err("no if pointer provided\n");
- + bphy_err(wiphy, "no if pointer provided\n");
- err = -ENOENT;
- goto fail;
- }
- @@ -625,7 +627,7 @@ struct wireless_dev *brcmf_ap_add_vif(st
- strncpy(ifp->ndev->name, name, sizeof(ifp->ndev->name) - 1);
- err = brcmf_net_attach(ifp, true);
- if (err) {
- - brcmf_err("Registering netdevice failed\n");
- + bphy_err(wiphy, "Registering netdevice failed\n");
- goto fail;
- }
-
- @@ -662,7 +664,7 @@ static struct wireless_dev *brcmf_cfg802
- brcmf_dbg(TRACE, "enter: %s type %d\n", name, type);
- err = brcmf_vif_add_validate(wiphy_to_cfg(wiphy), type);
- if (err) {
- - brcmf_err("iface validation failed: err=%d\n", err);
- + bphy_err(wiphy, "iface validation failed: err=%d\n", err);
- return ERR_PTR(err);
- }
- switch (type) {
- @@ -687,8 +689,8 @@ static struct wireless_dev *brcmf_cfg802
- }
-
- if (IS_ERR(wdev))
- - brcmf_err("add iface %s type %d failed: err=%d\n",
- - name, type, (int)PTR_ERR(wdev));
- + bphy_err(wiphy, "add iface %s type %d failed: err=%d\n", name,
- + type, (int)PTR_ERR(wdev));
- else
- brcmf_cfg80211_update_proto_addr_mode(wdev);
-
- @@ -703,12 +705,13 @@ static void brcmf_scan_config_mpc(struct
-
- void brcmf_set_mpc(struct brcmf_if *ifp, int mpc)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- s32 err = 0;
-
- if (check_vif_up(ifp->vif)) {
- err = brcmf_fil_iovar_int_set(ifp, "mpc", mpc);
- if (err) {
- - brcmf_err("fail to set mpc\n");
- + bphy_err(wiphy, "fail to set mpc\n");
- return;
- }
- brcmf_dbg(INFO, "MPC : %d\n", mpc);
- @@ -793,7 +796,7 @@ static int brcmf_cfg80211_del_ap_iface(s
-
- err = brcmf_fil_bsscfg_data_set(ifp, "interface_remove", NULL, 0);
- if (err) {
- - brcmf_err("interface_remove failed %d\n", err);
- + bphy_err(wiphy, "interface_remove failed %d\n", err);
- goto err_unarm;
- }
-
- @@ -801,7 +804,7 @@ static int brcmf_cfg80211_del_ap_iface(s
- ret = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_DEL,
- BRCMF_VIF_EVENT_TIMEOUT);
- if (!ret) {
- - brcmf_err("timeout occurred\n");
- + bphy_err(wiphy, "timeout occurred\n");
- err = -EIO;
- goto err_unarm;
- }
- @@ -903,14 +906,14 @@ brcmf_cfg80211_change_iface(struct wiphy
- }
- err = brcmf_vif_change_validate(wiphy_to_cfg(wiphy), vif, type);
- if (err) {
- - brcmf_err("iface validation failed: err=%d\n", err);
- + bphy_err(wiphy, "iface validation failed: err=%d\n", err);
- return err;
- }
- switch (type) {
- case NL80211_IFTYPE_MONITOR:
- case NL80211_IFTYPE_WDS:
- - brcmf_err("type (%d) : currently we do not support this type\n",
- - type);
- + bphy_err(wiphy, "type (%d) : currently we do not support this type\n",
- + type);
- return -EOPNOTSUPP;
- case NL80211_IFTYPE_ADHOC:
- infra = 0;
- @@ -938,7 +941,7 @@ brcmf_cfg80211_change_iface(struct wiphy
- } else {
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, infra);
- if (err) {
- - brcmf_err("WLC_SET_INFRA error (%d)\n", err);
- + bphy_err(wiphy, "WLC_SET_INFRA error (%d)\n", err);
- err = -EAGAIN;
- goto done;
- }
- @@ -1040,6 +1043,7 @@ static s32
- brcmf_run_escan(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
- struct cfg80211_scan_request *request)
- {
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- s32 params_size = BRCMF_SCAN_PARAMS_FIXED_SIZE +
- offsetof(struct brcmf_escan_params_le, params_le);
- struct brcmf_escan_params_le *params;
- @@ -1071,7 +1075,7 @@ brcmf_run_escan(struct brcmf_cfg80211_in
- if (err == -EBUSY)
- brcmf_dbg(INFO, "system busy : escan canceled\n");
- else
- - brcmf_err("error (%d)\n", err);
- + bphy_err(wiphy, "error (%d)\n", err);
- }
-
- kfree(params);
- @@ -1129,21 +1133,23 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
- brcmf_dbg(SCAN, "START ESCAN\n");
-
- if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
- - brcmf_err("Scanning already: status (%lu)\n", cfg->scan_status);
- + bphy_err(wiphy, "Scanning already: status (%lu)\n",
- + cfg->scan_status);
- return -EAGAIN;
- }
- if (test_bit(BRCMF_SCAN_STATUS_ABORT, &cfg->scan_status)) {
- - brcmf_err("Scanning being aborted: status (%lu)\n",
- - cfg->scan_status);
- + bphy_err(wiphy, "Scanning being aborted: status (%lu)\n",
- + cfg->scan_status);
- return -EAGAIN;
- }
- if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
- - brcmf_err("Scanning suppressed: status (%lu)\n",
- - cfg->scan_status);
- + bphy_err(wiphy, "Scanning suppressed: status (%lu)\n",
- + cfg->scan_status);
- return -EAGAIN;
- }
- if (test_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state)) {
- - brcmf_err("Connecting: status (%lu)\n", ifp->vif->sme_state);
- + bphy_err(wiphy, "Connecting: status (%lu)\n",
- + ifp->vif->sme_state);
- return -EAGAIN;
- }
-
- @@ -1235,7 +1241,7 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
- err = brcmf_cfg80211_escan(wiphy, vif, request, NULL);
-
- if (err)
- - brcmf_err("scan error (%d)\n", err);
- + bphy_err(wiphy, "scan error (%d)\n", err);
-
- brcmf_dbg(TRACE, "Exit\n");
- return err;
- @@ -1243,36 +1249,41 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
-
- static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
- {
- + struct brcmf_if *ifp = netdev_priv(ndev);
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- s32 err = 0;
-
- - err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "rtsthresh",
- - rts_threshold);
- + err = brcmf_fil_iovar_int_set(ifp, "rtsthresh", rts_threshold);
- if (err)
- - brcmf_err("Error (%d)\n", err);
- + bphy_err(wiphy, "Error (%d)\n", err);
-
- return err;
- }
-
- static s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold)
- {
- + struct brcmf_if *ifp = netdev_priv(ndev);
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- s32 err = 0;
-
- - err = brcmf_fil_iovar_int_set(netdev_priv(ndev), "fragthresh",
- + err = brcmf_fil_iovar_int_set(ifp, "fragthresh",
- frag_threshold);
- if (err)
- - brcmf_err("Error (%d)\n", err);
- + bphy_err(wiphy, "Error (%d)\n", err);
-
- return err;
- }
-
- static s32 brcmf_set_retry(struct net_device *ndev, u32 retry, bool l)
- {
- + struct brcmf_if *ifp = netdev_priv(ndev);
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- s32 err = 0;
- u32 cmd = (l ? BRCMF_C_SET_LRL : BRCMF_C_SET_SRL);
-
- - err = brcmf_fil_cmd_int_set(netdev_priv(ndev), cmd, retry);
- + err = brcmf_fil_cmd_int_set(ifp, cmd, retry);
- if (err) {
- - brcmf_err("cmd (%d) , error (%d)\n", cmd, err);
- + bphy_err(wiphy, "cmd (%d) , error (%d)\n", cmd, err);
- return err;
- }
- return err;
- @@ -1349,6 +1360,7 @@ static u16 brcmf_map_fw_linkdown_reason(
- static void brcmf_link_down(struct brcmf_cfg80211_vif *vif, u16 reason)
- {
- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- s32 err = 0;
-
- brcmf_dbg(TRACE, "Enter\n");
- @@ -1358,7 +1370,7 @@ static void brcmf_link_down(struct brcmf
- err = brcmf_fil_cmd_data_set(vif->ifp,
- BRCMF_C_DISASSOC, NULL, 0);
- if (err) {
- - brcmf_err("WLC_DISASSOC failed (%d)\n", err);
- + bphy_err(wiphy, "WLC_DISASSOC failed (%d)\n", err);
- }
- if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
- (vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
- @@ -1442,7 +1454,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
-
- err = brcmf_fil_iovar_int_set(ifp, "wsec", wsec);
- if (err) {
- - brcmf_err("wsec failed (%d)\n", err);
- + bphy_err(wiphy, "wsec failed (%d)\n", err);
- goto done;
- }
-
- @@ -1454,7 +1466,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
-
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, bcnprd);
- if (err) {
- - brcmf_err("WLC_SET_BCNPRD failed (%d)\n", err);
- + bphy_err(wiphy, "WLC_SET_BCNPRD failed (%d)\n", err);
- goto done;
- }
-
- @@ -1499,7 +1511,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_CHANNEL,
- target_channel);
- if (err) {
- - brcmf_err("WLC_SET_CHANNEL failed (%d)\n", err);
- + bphy_err(wiphy, "WLC_SET_CHANNEL failed (%d)\n", err);
- goto done;
- }
- } else
- @@ -1511,7 +1523,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *w
- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- &join_params, join_params_size);
- if (err) {
- - brcmf_err("WLC_SET_SSID failed (%d)\n", err);
- + bphy_err(wiphy, "WLC_SET_SSID failed (%d)\n", err);
- goto done;
- }
-
- @@ -1547,6 +1559,8 @@ brcmf_cfg80211_leave_ibss(struct wiphy *
- static s32 brcmf_set_wpa_version(struct net_device *ndev,
- struct cfg80211_connect_params *sme)
- {
- + struct brcmf_if *ifp = netdev_priv(ndev);
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
- struct brcmf_cfg80211_security *sec;
- s32 val = 0;
- @@ -1559,9 +1573,9 @@ static s32 brcmf_set_wpa_version(struct
- else
- val = WPA_AUTH_DISABLED;
- brcmf_dbg(CONN, "setting wpa_auth to 0x%0x\n", val);
- - err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val);
- + err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", val);
- if (err) {
- - brcmf_err("set wpa_auth failed (%d)\n", err);
- + bphy_err(wiphy, "set wpa_auth failed (%d)\n", err);
- return err;
- }
- sec = &profile->sec;
- @@ -1572,6 +1586,8 @@ static s32 brcmf_set_wpa_version(struct
- static s32 brcmf_set_auth_type(struct net_device *ndev,
- struct cfg80211_connect_params *sme)
- {
- + struct brcmf_if *ifp = netdev_priv(ndev);
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
- struct brcmf_cfg80211_security *sec;
- s32 val = 0;
- @@ -1592,9 +1608,9 @@ static s32 brcmf_set_auth_type(struct ne
- break;
- }
-
- - err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "auth", val);
- + err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
- if (err) {
- - brcmf_err("set auth failed (%d)\n", err);
- + bphy_err(wiphy, "set auth failed (%d)\n", err);
- return err;
- }
- sec = &profile->sec;
- @@ -1606,6 +1622,8 @@ static s32
- brcmf_set_wsec_mode(struct net_device *ndev,
- struct cfg80211_connect_params *sme)
- {
- + struct brcmf_if *ifp = netdev_priv(ndev);
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
- struct brcmf_cfg80211_security *sec;
- s32 pval = 0;
- @@ -1629,8 +1647,8 @@ brcmf_set_wsec_mode(struct net_device *n
- pval = AES_ENABLED;
- break;
- default:
- - brcmf_err("invalid cipher pairwise (%d)\n",
- - sme->crypto.ciphers_pairwise[0]);
- + bphy_err(wiphy, "invalid cipher pairwise (%d)\n",
- + sme->crypto.ciphers_pairwise[0]);
- return -EINVAL;
- }
- }
- @@ -1650,8 +1668,8 @@ brcmf_set_wsec_mode(struct net_device *n
- gval = AES_ENABLED;
- break;
- default:
- - brcmf_err("invalid cipher group (%d)\n",
- - sme->crypto.cipher_group);
- + bphy_err(wiphy, "invalid cipher group (%d)\n",
- + sme->crypto.cipher_group);
- return -EINVAL;
- }
- }
- @@ -1664,9 +1682,9 @@ brcmf_set_wsec_mode(struct net_device *n
- pval = AES_ENABLED;
-
- wsec = pval | gval;
- - err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wsec", wsec);
- + err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- if (err) {
- - brcmf_err("error (%d)\n", err);
- + bphy_err(wiphy, "error (%d)\n", err);
- return err;
- }
-
- @@ -1681,6 +1699,7 @@ static s32
- brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
- {
- struct brcmf_if *ifp = netdev_priv(ndev);
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- s32 val;
- s32 err;
- const struct brcmf_tlv *rsn_ie;
- @@ -1696,7 +1715,7 @@ brcmf_set_key_mgmt(struct net_device *nd
-
- err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wpa_auth", &val);
- if (err) {
- - brcmf_err("could not get wpa_auth (%d)\n", err);
- + bphy_err(wiphy, "could not get wpa_auth (%d)\n", err);
- return err;
- }
- if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
- @@ -1708,8 +1727,8 @@ brcmf_set_key_mgmt(struct net_device *nd
- val = WPA_AUTH_PSK;
- break;
- default:
- - brcmf_err("invalid cipher group (%d)\n",
- - sme->crypto.cipher_group);
- + bphy_err(wiphy, "invalid cipher group (%d)\n",
- + sme->crypto.cipher_group);
- return -EINVAL;
- }
- } else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED)) {
- @@ -1727,8 +1746,8 @@ brcmf_set_key_mgmt(struct net_device *nd
- val = WPA2_AUTH_PSK;
- break;
- default:
- - brcmf_err("invalid cipher group (%d)\n",
- - sme->crypto.cipher_group);
- + bphy_err(wiphy, "invalid cipher group (%d)\n",
- + sme->crypto.cipher_group);
- return -EINVAL;
- }
- }
- @@ -1771,7 +1790,7 @@ skip_mfp_config:
- brcmf_dbg(CONN, "setting wpa_auth to %d\n", val);
- err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val);
- if (err) {
- - brcmf_err("could not set wpa_auth (%d)\n", err);
- + bphy_err(wiphy, "could not set wpa_auth (%d)\n", err);
- return err;
- }
-
- @@ -1782,6 +1801,8 @@ static s32
- brcmf_set_sharedkey(struct net_device *ndev,
- struct cfg80211_connect_params *sme)
- {
- + struct brcmf_if *ifp = netdev_priv(ndev);
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev);
- struct brcmf_cfg80211_security *sec;
- struct brcmf_wsec_key key;
- @@ -1808,7 +1829,7 @@ brcmf_set_sharedkey(struct net_device *n
- key.len = (u32) sme->key_len;
- key.index = (u32) sme->key_idx;
- if (key.len > sizeof(key.data)) {
- - brcmf_err("Too long key length (%u)\n", key.len);
- + bphy_err(wiphy, "Too long key length (%u)\n", key.len);
- return -EINVAL;
- }
- memcpy(key.data, sme->key, key.len);
- @@ -1821,24 +1842,24 @@ brcmf_set_sharedkey(struct net_device *n
- key.algo = CRYPTO_ALGO_WEP128;
- break;
- default:
- - brcmf_err("Invalid algorithm (%d)\n",
- - sme->crypto.ciphers_pairwise[0]);
- + bphy_err(wiphy, "Invalid algorithm (%d)\n",
- + sme->crypto.ciphers_pairwise[0]);
- return -EINVAL;
- }
- /* Set the new key/index */
- brcmf_dbg(CONN, "key length (%d) key index (%d) algo (%d)\n",
- key.len, key.index, key.algo);
- brcmf_dbg(CONN, "key \"%s\"\n", key.data);
- - err = send_key_to_dongle(netdev_priv(ndev), &key);
- + err = send_key_to_dongle(ifp, &key);
- if (err)
- return err;
-
- if (sec->auth_type == NL80211_AUTHTYPE_SHARED_KEY) {
- brcmf_dbg(CONN, "set auth_type to shared key\n");
- val = WL_AUTH_SHARED_KEY; /* shared key */
- - err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "auth", val);
- + err = brcmf_fil_bsscfg_int_set(ifp, "auth", val);
- if (err)
- - brcmf_err("set auth failed (%d)\n", err);
- + bphy_err(wiphy, "set auth failed (%d)\n", err);
- }
- return err;
- }
- @@ -1858,6 +1879,7 @@ enum nl80211_auth_type brcmf_war_auth_ty
- static void brcmf_set_join_pref(struct brcmf_if *ifp,
- struct cfg80211_bss_selection *bss_select)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- struct brcmf_join_pref_params join_pref_params[2];
- enum nl80211_band band;
- int err, i = 0;
- @@ -1896,7 +1918,7 @@ static void brcmf_set_join_pref(struct b
- err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
- sizeof(join_pref_params));
- if (err)
- - brcmf_err("Set join_pref error (%d)\n", err);
- + bphy_err(wiphy, "Set join_pref error (%d)\n", err);
- }
-
- static s32
- @@ -1922,7 +1944,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- return -EIO;
-
- if (!sme->ssid) {
- - brcmf_err("Invalid ssid\n");
- + bphy_err(wiphy, "Invalid ssid\n");
- return -EOPNOTSUPP;
- }
-
- @@ -1951,7 +1973,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
- sme->ie, sme->ie_len);
- if (err)
- - brcmf_err("Set Assoc REQ IE Failed\n");
- + bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
- else
- brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
-
- @@ -1972,32 +1994,32 @@ brcmf_cfg80211_connect(struct wiphy *wip
-
- err = brcmf_set_wpa_version(ndev, sme);
- if (err) {
- - brcmf_err("wl_set_wpa_version failed (%d)\n", err);
- + bphy_err(wiphy, "wl_set_wpa_version failed (%d)\n", err);
- goto done;
- }
-
- sme->auth_type = brcmf_war_auth_type(ifp, sme->auth_type);
- err = brcmf_set_auth_type(ndev, sme);
- if (err) {
- - brcmf_err("wl_set_auth_type failed (%d)\n", err);
- + bphy_err(wiphy, "wl_set_auth_type failed (%d)\n", err);
- goto done;
- }
-
- err = brcmf_set_wsec_mode(ndev, sme);
- if (err) {
- - brcmf_err("wl_set_set_cipher failed (%d)\n", err);
- + bphy_err(wiphy, "wl_set_set_cipher failed (%d)\n", err);
- goto done;
- }
-
- err = brcmf_set_key_mgmt(ndev, sme);
- if (err) {
- - brcmf_err("wl_set_key_mgmt failed (%d)\n", err);
- + bphy_err(wiphy, "wl_set_key_mgmt failed (%d)\n", err);
- goto done;
- }
-
- err = brcmf_set_sharedkey(ndev, sme);
- if (err) {
- - brcmf_err("brcmf_set_sharedkey failed (%d)\n", err);
- + bphy_err(wiphy, "brcmf_set_sharedkey failed (%d)\n", err);
- goto done;
- }
-
- @@ -2084,7 +2106,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- &join_params, join_params_size);
- if (err)
- - brcmf_err("BRCMF_C_SET_SSID failed (%d)\n", err);
- + bphy_err(wiphy, "BRCMF_C_SET_SSID failed (%d)\n", err);
-
- done:
- if (err)
- @@ -2115,7 +2137,7 @@ brcmf_cfg80211_disconnect(struct wiphy *
- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_DISASSOC,
- &scbval, sizeof(scbval));
- if (err)
- - brcmf_err("error (%d)\n", err);
- + bphy_err(wiphy, "error (%d)\n", err);
-
- brcmf_dbg(TRACE, "Exit\n");
- return err;
- @@ -2142,7 +2164,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
- case NL80211_TX_POWER_LIMITED:
- case NL80211_TX_POWER_FIXED:
- if (mbm < 0) {
- - brcmf_err("TX_POWER_FIXED - dbm is negative\n");
- + bphy_err(wiphy, "TX_POWER_FIXED - dbm is negative\n");
- err = -EINVAL;
- goto done;
- }
- @@ -2152,7 +2174,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy
- qdbm |= WL_TXPWR_OVERRIDE;
- break;
- default:
- - brcmf_err("Unsupported type %d\n", type);
- + bphy_err(wiphy, "Unsupported type %d\n", type);
- err = -EINVAL;
- goto done;
- }
- @@ -2160,11 +2182,11 @@ brcmf_cfg80211_set_tx_power(struct wiphy
- disable = WL_RADIO_SW_DISABLE << 16;
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_RADIO, disable);
- if (err)
- - brcmf_err("WLC_SET_RADIO error (%d)\n", err);
- + bphy_err(wiphy, "WLC_SET_RADIO error (%d)\n", err);
-
- err = brcmf_fil_iovar_int_set(ifp, "qtxpower", qdbm);
- if (err)
- - brcmf_err("qtxpower error (%d)\n", err);
- + bphy_err(wiphy, "qtxpower error (%d)\n", err);
-
- done:
- brcmf_dbg(TRACE, "Exit %d (qdbm)\n", qdbm & ~WL_TXPWR_OVERRIDE);
- @@ -2185,7 +2207,7 @@ brcmf_cfg80211_get_tx_power(struct wiphy
-
- err = brcmf_fil_iovar_int_get(vif->ifp, "qtxpower", &qdbm);
- if (err) {
- - brcmf_err("error (%d)\n", err);
- + bphy_err(wiphy, "error (%d)\n", err);
- goto done;
- }
- *dbm = (qdbm & ~WL_TXPWR_OVERRIDE) / 4;
- @@ -2211,7 +2233,7 @@ brcmf_cfg80211_config_default_key(struct
-
- err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- if (err) {
- - brcmf_err("WLC_GET_WSEC error (%d)\n", err);
- + bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
- goto done;
- }
-
- @@ -2221,7 +2243,7 @@ brcmf_cfg80211_config_default_key(struct
- err = brcmf_fil_cmd_int_set(ifp,
- BRCMF_C_SET_KEY_PRIMARY, index);
- if (err)
- - brcmf_err("error (%d)\n", err);
- + bphy_err(wiphy, "error (%d)\n", err);
- }
- done:
- brcmf_dbg(TRACE, "Exit\n");
- @@ -2285,7 +2307,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
-
- if (key_idx >= BRCMF_MAX_DEFAULT_KEYS) {
- /* we ignore this key index in this case */
- - brcmf_err("invalid key index (%d)\n", key_idx);
- + bphy_err(wiphy, "invalid key index (%d)\n", key_idx);
- return -EINVAL;
- }
-
- @@ -2294,7 +2316,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- mac_addr);
-
- if (params->key_len > sizeof(key->data)) {
- - brcmf_err("Too long key length (%u)\n", params->key_len);
- + bphy_err(wiphy, "Too long key length (%u)\n", params->key_len);
- return -EINVAL;
- }
-
- @@ -2348,7 +2370,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip
- brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_CCMP\n");
- break;
- default:
- - brcmf_err("Invalid cipher (0x%x)\n", params->cipher);
- + bphy_err(wiphy, "Invalid cipher (0x%x)\n", params->cipher);
- err = -EINVAL;
- goto done;
- }
- @@ -2359,13 +2381,13 @@ brcmf_cfg80211_add_key(struct wiphy *wip
-
- err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- if (err) {
- - brcmf_err("get wsec error (%d)\n", err);
- + bphy_err(wiphy, "get wsec error (%d)\n", err);
- goto done;
- }
- wsec |= val;
- err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- if (err) {
- - brcmf_err("set wsec error (%d)\n", err);
- + bphy_err(wiphy, "set wsec error (%d)\n", err);
- goto done;
- }
-
- @@ -2396,7 +2418,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
-
- err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- if (err) {
- - brcmf_err("WLC_GET_WSEC error (%d)\n", err);
- + bphy_err(wiphy, "WLC_GET_WSEC error (%d)\n", err);
- /* Ignore this error, may happen during DISASSOC */
- err = -EAGAIN;
- goto done;
- @@ -2417,7 +2439,7 @@ brcmf_cfg80211_get_key(struct wiphy *wip
- params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
- brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n");
- } else {
- - brcmf_err("Invalid algo (0x%x)\n", wsec);
- + bphy_err(wiphy, "Invalid algo (0x%x)\n", wsec);
- err = -EINVAL;
- goto done;
- }
- @@ -2447,6 +2469,7 @@ brcmf_cfg80211_config_default_mgmt_key(s
- static void
- brcmf_cfg80211_reconfigure_wep(struct brcmf_if *ifp)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- s32 err;
- u8 key_idx;
- struct brcmf_wsec_key *key;
- @@ -2463,18 +2486,18 @@ brcmf_cfg80211_reconfigure_wep(struct br
-
- err = send_key_to_dongle(ifp, key);
- if (err) {
- - brcmf_err("Setting WEP key failed (%d)\n", err);
- + bphy_err(wiphy, "Setting WEP key failed (%d)\n", err);
- return;
- }
- err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec);
- if (err) {
- - brcmf_err("get wsec error (%d)\n", err);
- + bphy_err(wiphy, "get wsec error (%d)\n", err);
- return;
- }
- wsec |= WEP_ENABLED;
- err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- if (err)
- - brcmf_err("set wsec error (%d)\n", err);
- + bphy_err(wiphy, "set wsec error (%d)\n", err);
- }
-
- static void brcmf_convert_sta_flags(u32 fw_sta_flags, struct station_info *si)
- @@ -2500,6 +2523,7 @@ static void brcmf_convert_sta_flags(u32
-
- static void brcmf_fill_bss_param(struct brcmf_if *ifp, struct station_info *si)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- struct {
- __le32 len;
- struct brcmf_bss_info_le bss_le;
- @@ -2515,7 +2539,7 @@ static void brcmf_fill_bss_param(struct
- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, buf,
- WL_BSS_INFO_MAX);
- if (err) {
- - brcmf_err("Failed to get bss info (%d)\n", err);
- + bphy_err(wiphy, "Failed to get bss info (%d)\n", err);
- goto out_kfree;
- }
- si->filled |= BIT(NL80211_STA_INFO_BSS_PARAM);
- @@ -2537,6 +2561,7 @@ static s32
- brcmf_cfg80211_get_station_ibss(struct brcmf_if *ifp,
- struct station_info *sinfo)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- struct brcmf_scb_val_le scbval;
- struct brcmf_pktcnt_le pktcnt;
- s32 err;
- @@ -2546,7 +2571,7 @@ brcmf_cfg80211_get_station_ibss(struct b
- /* Get the current tx rate */
- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_RATE, &rate);
- if (err < 0) {
- - brcmf_err("BRCMF_C_GET_RATE error (%d)\n", err);
- + bphy_err(wiphy, "BRCMF_C_GET_RATE error (%d)\n", err);
- return err;
- }
- sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
- @@ -2556,7 +2581,7 @@ brcmf_cfg80211_get_station_ibss(struct b
- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, &scbval,
- sizeof(scbval));
- if (err) {
- - brcmf_err("BRCMF_C_GET_RSSI error (%d)\n", err);
- + bphy_err(wiphy, "BRCMF_C_GET_RSSI error (%d)\n", err);
- return err;
- }
- rssi = le32_to_cpu(scbval.val);
- @@ -2566,7 +2591,7 @@ brcmf_cfg80211_get_station_ibss(struct b
- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_GET_PKTCNTS, &pktcnt,
- sizeof(pktcnt));
- if (err) {
- - brcmf_err("BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
- + bphy_err(wiphy, "BRCMF_C_GET_GET_PKTCNTS error (%d)\n", err);
- return err;
- }
- sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS) |
- @@ -2614,7 +2639,7 @@ brcmf_cfg80211_get_station(struct wiphy
- &sta_info_le,
- sizeof(sta_info_le));
- if (err < 0) {
- - brcmf_err("GET STA INFO failed, %d\n", err);
- + bphy_err(wiphy, "GET STA INFO failed, %d\n", err);
- goto done;
- }
- }
- @@ -2683,7 +2708,8 @@ brcmf_cfg80211_get_station(struct wiphy
- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI,
- &scb_val, sizeof(scb_val));
- if (err) {
- - brcmf_err("Could not get rssi (%d)\n", err);
- + bphy_err(wiphy, "Could not get rssi (%d)\n",
- + err);
- goto done;
- } else {
- rssi = le32_to_cpu(scb_val.val);
- @@ -2714,8 +2740,8 @@ brcmf_cfg80211_dump_station(struct wiphy
- &cfg->assoclist,
- sizeof(cfg->assoclist));
- if (err) {
- - brcmf_err("BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
- - err);
- + bphy_err(wiphy, "BRCMF_C_GET_ASSOCLIST unsupported, err=%d\n",
- + err);
- cfg->assoclist.count = 0;
- return -EOPNOTSUPP;
- }
- @@ -2763,9 +2789,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm);
- if (err) {
- if (err == -ENODEV)
- - brcmf_err("net_device is not ready yet\n");
- + bphy_err(wiphy, "net_device is not ready yet\n");
- else
- - brcmf_err("error (%d)\n", err);
- + bphy_err(wiphy, "error (%d)\n", err);
- }
- done:
- brcmf_dbg(TRACE, "Exit\n");
- @@ -2789,7 +2815,7 @@ static s32 brcmf_inform_single_bss(struc
- s32 notify_signal;
-
- if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) {
- - brcmf_err("Bss info is larger than buffer. Discarding\n");
- + bphy_err(wiphy, "Bss info is larger than buffer. Discarding\n");
- return 0;
- }
-
- @@ -2847,6 +2873,7 @@ next_bss_le(struct brcmf_scan_results *l
-
- static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg)
- {
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- struct brcmf_scan_results *bss_list;
- struct brcmf_bss_info_le *bi = NULL; /* must be initialized */
- s32 err = 0;
- @@ -2855,8 +2882,8 @@ static s32 brcmf_inform_bss(struct brcmf
- bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
- if (bss_list->count != 0 &&
- bss_list->version != BRCMF_BSS_INFO_VERSION) {
- - brcmf_err("Version %d != WL_BSS_INFO_VERSION\n",
- - bss_list->version);
- + bphy_err(wiphy, "Version %d != WL_BSS_INFO_VERSION\n",
- + bss_list->version);
- return -EOPNOTSUPP;
- }
- brcmf_dbg(SCAN, "scanned AP count (%d)\n", bss_list->count);
- @@ -2900,7 +2927,7 @@ static s32 brcmf_inform_ibss(struct brcm
- err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO,
- buf, WL_BSS_INFO_MAX);
- if (err) {
- - brcmf_err("WLC_GET_BSS_INFO failed: %d\n", err);
- + bphy_err(wiphy, "WLC_GET_BSS_INFO failed: %d\n", err);
- goto CleanUp;
- }
-
- @@ -2954,6 +2981,7 @@ CleanUp:
- static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg,
- struct brcmf_if *ifp)
- {
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- struct brcmf_bss_info_le *bi;
- const struct brcmf_tlv *tim;
- u16 beacon_interval;
- @@ -2970,7 +2998,7 @@ static s32 brcmf_update_bss_info(struct
- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO,
- cfg->extra_buf, WL_EXTRA_BUF_MAX);
- if (err) {
- - brcmf_err("Could not get bss info %d\n", err);
- + bphy_err(wiphy, "Could not get bss info %d\n", err);
- goto update_bss_info_out;
- }
-
- @@ -2995,7 +3023,7 @@ static s32 brcmf_update_bss_info(struct
- u32 var;
- err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var);
- if (err) {
- - brcmf_err("wl dtim_assoc failed (%d)\n", err);
- + bphy_err(wiphy, "wl dtim_assoc failed (%d)\n", err);
- goto update_bss_info_out;
- }
- dtim_period = (u8)var;
- @@ -3033,9 +3061,10 @@ static void brcmf_escan_timeout(unsigned
- {
- struct brcmf_cfg80211_info *cfg =
- (struct brcmf_cfg80211_info *)data;
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
-
- if (cfg->internal_escan || cfg->scan_request) {
- - brcmf_err("timer expired\n");
- + bphy_err(wiphy, "timer expired\n");
- schedule_work(&cfg->escan_timeout_work);
- }
- }
- @@ -3084,6 +3113,7 @@ brcmf_cfg80211_escan_handler(struct brcm
- const struct brcmf_event_msg *e, void *data)
- {
- struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- s32 status;
- struct brcmf_escan_result_le *escan_result_le;
- u32 escan_buflen;
- @@ -3100,32 +3130,33 @@ brcmf_cfg80211_escan_handler(struct brcm
- goto exit;
-
- if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
- - brcmf_err("scan not ready, bsscfgidx=%d\n", ifp->bsscfgidx);
- + bphy_err(wiphy, "scan not ready, bsscfgidx=%d\n",
- + ifp->bsscfgidx);
- return -EPERM;
- }
-
- if (status == BRCMF_E_STATUS_PARTIAL) {
- brcmf_dbg(SCAN, "ESCAN Partial result\n");
- if (e->datalen < sizeof(*escan_result_le)) {
- - brcmf_err("invalid event data length\n");
- + bphy_err(wiphy, "invalid event data length\n");
- goto exit;
- }
- escan_result_le = (struct brcmf_escan_result_le *) data;
- if (!escan_result_le) {
- - brcmf_err("Invalid escan result (NULL pointer)\n");
- + bphy_err(wiphy, "Invalid escan result (NULL pointer)\n");
- goto exit;
- }
- escan_buflen = le32_to_cpu(escan_result_le->buflen);
- if (escan_buflen > BRCMF_ESCAN_BUF_SIZE ||
- escan_buflen > e->datalen ||
- escan_buflen < sizeof(*escan_result_le)) {
- - brcmf_err("Invalid escan buffer length: %d\n",
- - escan_buflen);
- + bphy_err(wiphy, "Invalid escan buffer length: %d\n",
- + escan_buflen);
- goto exit;
- }
- if (le16_to_cpu(escan_result_le->bss_count) != 1) {
- - brcmf_err("Invalid bss_count %d: ignoring\n",
- - escan_result_le->bss_count);
- + bphy_err(wiphy, "Invalid bss_count %d: ignoring\n",
- + escan_result_le->bss_count);
- goto exit;
- }
- bss_info_le = &escan_result_le->bss_info_le;
- @@ -3140,8 +3171,8 @@ brcmf_cfg80211_escan_handler(struct brcm
-
- bi_length = le32_to_cpu(bss_info_le->length);
- if (bi_length != escan_buflen - WL_ESCAN_RESULTS_FIXED_SIZE) {
- - brcmf_err("Ignoring invalid bss_info length: %d\n",
- - bi_length);
- + bphy_err(wiphy, "Ignoring invalid bss_info length: %d\n",
- + bi_length);
- goto exit;
- }
-
- @@ -3149,7 +3180,7 @@ brcmf_cfg80211_escan_handler(struct brcm
- BIT(NL80211_IFTYPE_ADHOC))) {
- if (le16_to_cpu(bss_info_le->capability) &
- WLAN_CAPABILITY_IBSS) {
- - brcmf_err("Ignoring IBSS result\n");
- + bphy_err(wiphy, "Ignoring IBSS result\n");
- goto exit;
- }
- }
- @@ -3157,7 +3188,7 @@ brcmf_cfg80211_escan_handler(struct brcm
- list = (struct brcmf_scan_results *)
- cfg->escan_info.escan_buf;
- if (bi_length > BRCMF_ESCAN_BUF_SIZE - list->buflen) {
- - brcmf_err("Buffer is too small: ignoring\n");
- + bphy_err(wiphy, "Buffer is too small: ignoring\n");
- goto exit;
- }
-
- @@ -3346,14 +3377,14 @@ brcmf_notify_sched_scan_results(struct b
- WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE);
- brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count);
- if (!result_count) {
- - brcmf_err("FALSE PNO Event. (pfn_count == 0)\n");
- + bphy_err(wiphy, "FALSE PNO Event. (pfn_count == 0)\n");
- goto out_err;
- }
-
- netinfo_start = brcmf_get_netinfo_array(pfn_result);
- datalen = e->datalen - ((void *)netinfo_start - (void *)pfn_result);
- if (datalen < result_count * sizeof(*netinfo)) {
- - brcmf_err("insufficient event data\n");
- + bphy_err(wiphy, "insufficient event data\n");
- goto out_err;
- }
-
- @@ -3402,8 +3433,8 @@ brcmf_cfg80211_sched_scan_start(struct w
- req->n_match_sets, req->n_ssids);
-
- if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) {
- - brcmf_err("Scanning suppressed: status (%lu)\n",
- - cfg->scan_status);
- + bphy_err(wiphy, "Scanning suppressed: status (%lu)\n",
- + cfg->scan_status);
- return -EAGAIN;
- }
-
- @@ -3482,6 +3513,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i
- void *data)
- {
- struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- struct brcmf_pno_scanresults_le *pfn_result;
- struct brcmf_pno_net_info_le *netinfo;
-
- @@ -3500,8 +3532,8 @@ brcmf_wowl_nd_results(struct brcmf_if *i
- }
-
- if (le32_to_cpu(pfn_result->count) < 1) {
- - brcmf_err("Invalid result count, expected 1 (%d)\n",
- - le32_to_cpu(pfn_result->count));
- + bphy_err(wiphy, "Invalid result count, expected 1 (%d)\n",
- + le32_to_cpu(pfn_result->count));
- return -EINVAL;
- }
-
- @@ -3538,7 +3570,7 @@ static void brcmf_report_wowl_wakeind(st
- err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le,
- sizeof(wake_ind_le));
- if (err) {
- - brcmf_err("Get wowl_wakeind failed, err = %d\n", err);
- + bphy_err(wiphy, "Get wowl_wakeind failed, err = %d\n", err);
- return;
- }
-
- @@ -3579,7 +3611,7 @@ static void brcmf_report_wowl_wakeind(st
- cfg->wowl.nd_data_completed,
- BRCMF_ND_INFO_TIMEOUT);
- if (!timeout)
- - brcmf_err("No result for wowl net detect\n");
- + bphy_err(wiphy, "No result for wowl net detect\n");
- else
- wakeup_data.net_detect = cfg->wowl.nd_info;
- }
- @@ -3787,7 +3819,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w
- cfg->pmk_list.npmk = cpu_to_le32(npmk);
- }
- } else {
- - brcmf_err("Too many PMKSA entries cached %d\n", npmk);
- + bphy_err(wiphy, "Too many PMKSA entries cached %d\n", npmk);
- return -EINVAL;
- }
-
- @@ -3833,7 +3865,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w
- memset(&pmk[i], 0, sizeof(*pmk));
- cfg->pmk_list.npmk = cpu_to_le32(npmk - 1);
- } else {
- - brcmf_err("Cache entry not found\n");
- + bphy_err(wiphy, "Cache entry not found\n");
- return -EINVAL;
- }
-
- @@ -3865,24 +3897,25 @@ brcmf_cfg80211_flush_pmksa(struct wiphy
-
- static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- s32 err;
-
- /* set auth */
- err = brcmf_fil_bsscfg_int_set(ifp, "auth", 0);
- if (err < 0) {
- - brcmf_err("auth error %d\n", err);
- + bphy_err(wiphy, "auth error %d\n", err);
- return err;
- }
- /* set wsec */
- err = brcmf_fil_bsscfg_int_set(ifp, "wsec", 0);
- if (err < 0) {
- - brcmf_err("wsec error %d\n", err);
- + bphy_err(wiphy, "wsec error %d\n", err);
- return err;
- }
- /* set upper-layer auth */
- err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", WPA_AUTH_NONE);
- if (err < 0) {
- - brcmf_err("wpa_auth error %d\n", err);
- + bphy_err(wiphy, "wpa_auth error %d\n", err);
- return err;
- }
-
- @@ -3902,6 +3935,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- const struct brcmf_vs_tlv *wpa_ie,
- bool is_rsn_ie)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- u32 auth = 0; /* d11 open authentication */
- u16 count;
- s32 err = 0;
- @@ -3932,13 +3966,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- /* check for multicast cipher suite */
- if (offset + WPA_IE_MIN_OUI_LEN > len) {
- err = -EINVAL;
- - brcmf_err("no multicast cipher suite\n");
- + bphy_err(wiphy, "no multicast cipher suite\n");
- goto exit;
- }
-
- if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
- err = -EINVAL;
- - brcmf_err("ivalid OUI\n");
- + bphy_err(wiphy, "ivalid OUI\n");
- goto exit;
- }
- offset += TLV_OUI_LEN;
- @@ -3960,7 +3994,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- break;
- default:
- err = -EINVAL;
- - brcmf_err("Invalid multi cast cipher info\n");
- + bphy_err(wiphy, "Invalid multi cast cipher info\n");
- goto exit;
- }
-
- @@ -3971,13 +4005,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- /* Check for unicast suite(s) */
- if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
- err = -EINVAL;
- - brcmf_err("no unicast cipher suite\n");
- + bphy_err(wiphy, "no unicast cipher suite\n");
- goto exit;
- }
- for (i = 0; i < count; i++) {
- if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
- err = -EINVAL;
- - brcmf_err("ivalid OUI\n");
- + bphy_err(wiphy, "ivalid OUI\n");
- goto exit;
- }
- offset += TLV_OUI_LEN;
- @@ -3995,7 +4029,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- pval |= AES_ENABLED;
- break;
- default:
- - brcmf_err("Invalid unicast security info\n");
- + bphy_err(wiphy, "Invalid unicast security info\n");
- }
- offset++;
- }
- @@ -4005,13 +4039,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- /* Check for auth key management suite(s) */
- if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) {
- err = -EINVAL;
- - brcmf_err("no auth key mgmt suite\n");
- + bphy_err(wiphy, "no auth key mgmt suite\n");
- goto exit;
- }
- for (i = 0; i < count; i++) {
- if (!brcmf_valid_wpa_oui(&data[offset], is_rsn_ie)) {
- err = -EINVAL;
- - brcmf_err("ivalid OUI\n");
- + bphy_err(wiphy, "ivalid OUI\n");
- goto exit;
- }
- offset += TLV_OUI_LEN;
- @@ -4039,7 +4073,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- wpa_auth |= WPA2_AUTH_1X_SHA256;
- break;
- default:
- - brcmf_err("Invalid key mgmt info\n");
- + bphy_err(wiphy, "Invalid key mgmt info\n");
- }
- offset++;
- }
- @@ -4081,7 +4115,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable",
- wme_bss_disable);
- if (err < 0) {
- - brcmf_err("wme_bss_disable error %d\n", err);
- + bphy_err(wiphy, "wme_bss_disable error %d\n", err);
- goto exit;
- }
-
- @@ -4095,7 +4129,7 @@ brcmf_configure_wpaie(struct brcmf_if *i
- &data[offset],
- WPA_IE_MIN_OUI_LEN);
- if (err < 0) {
- - brcmf_err("bip error %d\n", err);
- + bphy_err(wiphy, "bip error %d\n", err);
- goto exit;
- }
- }
- @@ -4106,13 +4140,13 @@ brcmf_configure_wpaie(struct brcmf_if *i
- /* set auth */
- err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth);
- if (err < 0) {
- - brcmf_err("auth error %d\n", err);
- + bphy_err(wiphy, "auth error %d\n", err);
- goto exit;
- }
- /* set wsec */
- err = brcmf_fil_bsscfg_int_set(ifp, "wsec", wsec);
- if (err < 0) {
- - brcmf_err("wsec error %d\n", err);
- + bphy_err(wiphy, "wsec error %d\n", err);
- goto exit;
- }
- /* Configure MFP, this needs to go after wsec otherwise the wsec command
- @@ -4121,14 +4155,14 @@ brcmf_configure_wpaie(struct brcmf_if *i
- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) {
- err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp);
- if (err < 0) {
- - brcmf_err("mfp error %d\n", err);
- + bphy_err(wiphy, "mfp error %d\n", err);
- goto exit;
- }
- }
- /* set upper-layer auth */
- err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth);
- if (err < 0) {
- - brcmf_err("wpa_auth error %d\n", err);
- + bphy_err(wiphy, "wpa_auth error %d\n", err);
- goto exit;
- }
-
- @@ -4215,6 +4249,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- const u8 *vndr_ie_buf, u32 vndr_ie_len)
- {
- struct brcmf_if *ifp;
- + struct wiphy *wiphy;
- struct vif_saved_ie *saved_ie;
- s32 err = 0;
- u8 *iovar_ie_buf;
- @@ -4235,6 +4270,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- if (!vif)
- return -ENODEV;
- ifp = vif->ifp;
- + wiphy = ifp->drvr->wiphy;
- saved_ie = &vif->saved_ie;
-
- brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx,
- @@ -4266,13 +4302,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- break;
- default:
- err = -EPERM;
- - brcmf_err("not suitable type\n");
- + bphy_err(wiphy, "not suitable type\n");
- goto exit;
- }
-
- if (vndr_ie_len > mgmt_ie_buf_len) {
- err = -ENOMEM;
- - brcmf_err("extra IE size too big\n");
- + bphy_err(wiphy, "extra IE size too big\n");
- goto exit;
- }
-
- @@ -4333,8 +4369,8 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- /* verify remained buf size before copy data */
- if (remained_buf_len < (vndrie_info->vndrie.len +
- VNDR_IE_VSIE_OFFSET)) {
- - brcmf_err("no space in mgmt_ie_buf: len left %d",
- - remained_buf_len);
- + bphy_err(wiphy, "no space in mgmt_ie_buf: len left %d",
- + remained_buf_len);
- break;
- }
- remained_buf_len -= (vndrie_info->ie_len +
- @@ -4365,7 +4401,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
- err = brcmf_fil_bsscfg_data_set(ifp, "vndr_ie", iovar_ie_buf,
- total_ie_buf_len);
- if (err)
- - brcmf_err("vndr ie set error : %d\n", err);
- + bphy_err(wiphy, "vndr ie set error : %d\n", err);
- }
-
- exit:
- @@ -4393,13 +4429,14 @@ static s32
- brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif,
- struct cfg80211_beacon_data *beacon)
- {
- + struct wiphy *wiphy = vif->ifp->drvr->wiphy;
- s32 err;
-
- /* Set Beacon IEs to FW */
- err = brcmf_vif_set_mgmt_ie(vif, BRCMF_VNDR_IE_BEACON_FLAG,
- beacon->tail, beacon->tail_len);
- if (err) {
- - brcmf_err("Set Beacon IE Failed\n");
- + bphy_err(wiphy, "Set Beacon IE Failed\n");
- return err;
- }
- brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n");
- @@ -4409,7 +4446,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg
- beacon->proberesp_ies,
- beacon->proberesp_ies_len);
- if (err)
- - brcmf_err("Set Probe Resp IE Failed\n");
- + bphy_err(wiphy, "Set Probe Resp IE Failed\n");
- else
- brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n");
-
- @@ -4518,7 +4555,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
- is_11d);
- if (err < 0) {
- - brcmf_err("Regulatory Set Error, %d\n", err);
- + bphy_err(wiphy, "Regulatory Set Error, %d\n",
- + err);
- goto exit;
- }
- }
- @@ -4526,8 +4564,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD,
- settings->beacon_interval);
- if (err < 0) {
- - brcmf_err("Beacon Interval Set Error, %d\n",
- - err);
- + bphy_err(wiphy, "Beacon Interval Set Error, %d\n",
- + err);
- goto exit;
- }
- }
- @@ -4535,7 +4573,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD,
- settings->dtim_period);
- if (err < 0) {
- - brcmf_err("DTIM Interval Set Error, %d\n", err);
- + bphy_err(wiphy, "DTIM Interval Set Error, %d\n",
- + err);
- goto exit;
- }
- }
- @@ -4545,7 +4584,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB))) {
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
- if (err < 0) {
- - brcmf_err("BRCMF_C_DOWN error %d\n", err);
- + bphy_err(wiphy, "BRCMF_C_DOWN error %d\n",
- + err);
- goto exit;
- }
- brcmf_fil_iovar_int_set(ifp, "apsta", 0);
- @@ -4553,7 +4593,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
-
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1);
- if (err < 0) {
- - brcmf_err("SET INFRA error %d\n", err);
- + bphy_err(wiphy, "SET INFRA error %d\n", err);
- goto exit;
- }
- } else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) {
- @@ -4569,7 +4609,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
-
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
- if (err < 0) {
- - brcmf_err("setting AP mode failed %d\n", err);
- + bphy_err(wiphy, "setting AP mode failed %d\n",
- + err);
- goto exit;
- }
- if (!mbss) {
- @@ -4578,14 +4619,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- */
- err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
- if (err < 0) {
- - brcmf_err("Set Channel failed: chspec=%d, %d\n",
- - chanspec, err);
- + bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
- + chanspec, err);
- goto exit;
- }
- }
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
- if (err < 0) {
- - brcmf_err("BRCMF_C_UP error (%d)\n", err);
- + bphy_err(wiphy, "BRCMF_C_UP error (%d)\n", err);
- goto exit;
- }
- /* On DOWN the firmware removes the WEP keys, reconfigure
- @@ -4600,14 +4641,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- &join_params, sizeof(join_params));
- if (err < 0) {
- - brcmf_err("SET SSID error (%d)\n", err);
- + bphy_err(wiphy, "SET SSID error (%d)\n", err);
- goto exit;
- }
-
- if (settings->hidden_ssid) {
- err = brcmf_fil_iovar_int_set(ifp, "closednet", 1);
- if (err) {
- - brcmf_err("closednet error (%d)\n", err);
- + bphy_err(wiphy, "closednet error (%d)\n", err);
- goto exit;
- }
- }
- @@ -4616,14 +4657,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- } else if (dev_role == NL80211_IFTYPE_P2P_GO) {
- err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);
- if (err < 0) {
- - brcmf_err("Set Channel failed: chspec=%d, %d\n",
- - chanspec, err);
- + bphy_err(wiphy, "Set Channel failed: chspec=%d, %d\n",
- + chanspec, err);
- goto exit;
- }
- err = brcmf_fil_bsscfg_data_set(ifp, "ssid", &ssid_le,
- sizeof(ssid_le));
- if (err < 0) {
- - brcmf_err("setting ssid failed %d\n", err);
- + bphy_err(wiphy, "setting ssid failed %d\n", err);
- goto exit;
- }
- bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
- @@ -4631,7 +4672,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
- err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
- sizeof(bss_enable));
- if (err < 0) {
- - brcmf_err("bss_enable config failed %d\n", err);
- + bphy_err(wiphy, "bss_enable config failed %d\n", err);
- goto exit;
- }
-
- @@ -4679,13 +4720,13 @@ static int brcmf_cfg80211_stop_ap(struct
- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID,
- &join_params, sizeof(join_params));
- if (err < 0)
- - brcmf_err("SET SSID error (%d)\n", err);
- + bphy_err(wiphy, "SET SSID error (%d)\n", err);
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
- if (err < 0)
- - brcmf_err("BRCMF_C_DOWN error %d\n", err);
- + bphy_err(wiphy, "BRCMF_C_DOWN error %d\n", err);
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
- if (err < 0)
- - brcmf_err("setting AP mode failed %d\n", err);
- + bphy_err(wiphy, "setting AP mode failed %d\n", err);
- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
- brcmf_fil_iovar_int_set(ifp, "mbss", 0);
- brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
- @@ -4693,7 +4734,7 @@ static int brcmf_cfg80211_stop_ap(struct
- /* Bring device back up so it can be used again */
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
- if (err < 0)
- - brcmf_err("BRCMF_C_UP error %d\n", err);
- + bphy_err(wiphy, "BRCMF_C_UP error %d\n", err);
-
- brcmf_vif_clear_mgmt_ies(ifp->vif);
- } else {
- @@ -4702,7 +4743,7 @@ static int brcmf_cfg80211_stop_ap(struct
- err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
- sizeof(bss_enable));
- if (err < 0)
- - brcmf_err("bss_enable config failed %d\n", err);
- + bphy_err(wiphy, "bss_enable config failed %d\n", err);
- }
- brcmf_set_mpc(ifp, 1);
- brcmf_configure_arp_nd_offload(ifp, true);
- @@ -4750,7 +4791,8 @@ brcmf_cfg80211_del_station(struct wiphy
- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON,
- &scbval, sizeof(scbval));
- if (err)
- - brcmf_err("SCB_DEAUTHENTICATE_FOR_REASON failed %d\n", err);
- + bphy_err(wiphy, "SCB_DEAUTHENTICATE_FOR_REASON failed %d\n",
- + err);
-
- brcmf_dbg(TRACE, "Exit\n");
- return err;
- @@ -4780,7 +4822,7 @@ brcmf_cfg80211_change_station(struct wip
- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SCB_DEAUTHORIZE,
- (void *)mac, ETH_ALEN);
- if (err < 0)
- - brcmf_err("Setting SCB (de-)authorize failed, %d\n", err);
- + bphy_err(wiphy, "Setting SCB (de-)authorize failed, %d\n", err);
-
- return err;
- }
- @@ -4830,7 +4872,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
- mgmt = (const struct ieee80211_mgmt *)buf;
-
- if (!ieee80211_is_mgmt(mgmt->frame_control)) {
- - brcmf_err("Driver only allows MGMT packet type\n");
- + bphy_err(wiphy, "Driver only allows MGMT packet type\n");
- return -EPERM;
- }
-
- @@ -4861,13 +4903,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip
- GFP_KERNEL);
- } else if (ieee80211_is_action(mgmt->frame_control)) {
- if (len > BRCMF_FIL_ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN) {
- - brcmf_err("invalid action frame length\n");
- + bphy_err(wiphy, "invalid action frame length\n");
- err = -EINVAL;
- goto exit;
- }
- af_params = kzalloc(sizeof(*af_params), GFP_KERNEL);
- if (af_params == NULL) {
- - brcmf_err("unable to allocate frame\n");
- + bphy_err(wiphy, "unable to allocate frame\n");
- err = -ENOMEM;
- goto exit;
- }
- @@ -4925,7 +4967,7 @@ brcmf_cfg80211_cancel_remain_on_channel(
-
- vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
- if (vif == NULL) {
- - brcmf_err("No p2p device available for probe response\n");
- + bphy_err(wiphy, "No p2p device available for probe response\n");
- err = -ENODEV;
- goto exit;
- }
- @@ -4953,7 +4995,7 @@ static int brcmf_cfg80211_get_channel(st
-
- err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
- if (err) {
- - brcmf_err("chanspec failed (%d)\n", err);
- + bphy_err(wiphy, "chanspec failed (%d)\n", err);
- return err;
- }
-
- @@ -5092,7 +5134,7 @@ static int brcmf_cfg80211_tdls_oper(stru
- ret = brcmf_fil_iovar_data_set(ifp, "tdls_endpoint",
- &info, sizeof(info));
- if (ret < 0)
- - brcmf_err("tdls_endpoint iovar failed: ret=%d\n", ret);
- + bphy_err(wiphy, "tdls_endpoint iovar failed: ret=%d\n", ret);
-
- return ret;
- }
- @@ -5113,7 +5155,7 @@ brcmf_cfg80211_update_conn_params(struct
- err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG,
- sme->ie, sme->ie_len);
- if (err)
- - brcmf_err("Set Assoc REQ IE Failed\n");
- + bphy_err(wiphy, "Set Assoc REQ IE Failed\n");
- else
- brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n");
-
- @@ -5139,7 +5181,7 @@ brcmf_cfg80211_set_rekey_data(struct wip
- ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", >k_le,
- sizeof(gtk_le));
- if (ret < 0)
- - brcmf_err("gtk_key_info iovar failed: ret=%d\n", ret);
- + bphy_err(wiphy, "gtk_key_info iovar failed: ret=%d\n", ret);
-
- return ret;
- }
- @@ -5317,6 +5359,7 @@ static void brcmf_clear_assoc_ies(struct
- static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg,
- struct brcmf_if *ifp)
- {
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- struct brcmf_cfg80211_assoc_ielen_le *assoc_info;
- struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg);
- u32 req_len;
- @@ -5328,7 +5371,7 @@ static s32 brcmf_get_assoc_ies(struct br
- err = brcmf_fil_iovar_data_get(ifp, "assoc_info",
- cfg->extra_buf, WL_ASSOC_INFO_MAX);
- if (err) {
- - brcmf_err("could not get assoc info (%d)\n", err);
- + bphy_err(wiphy, "could not get assoc info (%d)\n", err);
- return err;
- }
- assoc_info =
- @@ -5340,7 +5383,7 @@ static s32 brcmf_get_assoc_ies(struct br
- cfg->extra_buf,
- WL_ASSOC_INFO_MAX);
- if (err) {
- - brcmf_err("could not get assoc req (%d)\n", err);
- + bphy_err(wiphy, "could not get assoc req (%d)\n", err);
- return err;
- }
- conn_info->req_ie_len = req_len;
- @@ -5356,7 +5399,7 @@ static s32 brcmf_get_assoc_ies(struct br
- cfg->extra_buf,
- WL_ASSOC_INFO_MAX);
- if (err) {
- - brcmf_err("could not get assoc resp (%d)\n", err);
- + bphy_err(wiphy, "could not get assoc resp (%d)\n", err);
- return err;
- }
- conn_info->resp_ie_len = resp_len;
- @@ -5475,6 +5518,7 @@ brcmf_notify_connect_status_ap(struct br
- struct net_device *ndev,
- const struct brcmf_event_msg *e, void *data)
- {
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- static int generation;
- u32 event = e->event_code;
- u32 reason = e->reason;
- @@ -5493,7 +5537,7 @@ brcmf_notify_connect_status_ap(struct br
- (reason == BRCMF_E_STATUS_SUCCESS)) {
- memset(&sinfo, 0, sizeof(sinfo));
- if (!data) {
- - brcmf_err("No IEs present in ASSOC/REASSOC_IND");
- + bphy_err(wiphy, "No IEs present in ASSOC/REASSOC_IND\n");
- return -EINVAL;
- }
- sinfo.assoc_req_ies = data;
- @@ -5774,6 +5818,7 @@ static void init_vif_event(struct brcmf_
-
- static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- s32 err;
- u32 bcn_timeout;
- __le32 roamtrigger[2];
- @@ -5786,7 +5831,7 @@ static s32 brcmf_dongle_roam(struct brcm
- bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON;
- err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout);
- if (err) {
- - brcmf_err("bcn_timeout error (%d)\n", err);
- + bphy_err(wiphy, "bcn_timeout error (%d)\n", err);
- goto roam_setup_done;
- }
-
- @@ -5798,7 +5843,7 @@ static s32 brcmf_dongle_roam(struct brcm
- err = brcmf_fil_iovar_int_set(ifp, "roam_off",
- ifp->drvr->settings->roamoff);
- if (err) {
- - brcmf_err("roam_off error (%d)\n", err);
- + bphy_err(wiphy, "roam_off error (%d)\n", err);
- goto roam_setup_done;
- }
-
- @@ -5807,7 +5852,7 @@ static s32 brcmf_dongle_roam(struct brcm
- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER,
- (void *)roamtrigger, sizeof(roamtrigger));
- if (err) {
- - brcmf_err("WLC_SET_ROAM_TRIGGER error (%d)\n", err);
- + bphy_err(wiphy, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
- goto roam_setup_done;
- }
-
- @@ -5816,7 +5861,7 @@ static s32 brcmf_dongle_roam(struct brcm
- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA,
- (void *)roam_delta, sizeof(roam_delta));
- if (err) {
- - brcmf_err("WLC_SET_ROAM_DELTA error (%d)\n", err);
- + bphy_err(wiphy, "WLC_SET_ROAM_DELTA error (%d)\n", err);
- goto roam_setup_done;
- }
-
- @@ -5827,25 +5872,26 @@ roam_setup_done:
- static s32
- brcmf_dongle_scantime(struct brcmf_if *ifp)
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- s32 err = 0;
-
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME,
- BRCMF_SCAN_CHANNEL_TIME);
- if (err) {
- - brcmf_err("Scan assoc time error (%d)\n", err);
- + bphy_err(wiphy, "Scan assoc time error (%d)\n", err);
- goto dongle_scantime_out;
- }
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME,
- BRCMF_SCAN_UNASSOC_TIME);
- if (err) {
- - brcmf_err("Scan unassoc time error (%d)\n", err);
- + bphy_err(wiphy, "Scan unassoc time error (%d)\n", err);
- goto dongle_scantime_out;
- }
-
- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_PASSIVE_TIME,
- BRCMF_SCAN_PASSIVE_TIME);
- if (err) {
- - brcmf_err("Scan passive time error (%d)\n", err);
- + bphy_err(wiphy, "Scan passive time error (%d)\n", err);
- goto dongle_scantime_out;
- }
-
- @@ -5877,10 +5923,10 @@ static void brcmf_update_bw40_channel_fl
- static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg,
- u32 bw_cap[])
- {
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
- struct ieee80211_supported_band *band;
- struct ieee80211_channel *channel;
- - struct wiphy *wiphy;
- struct brcmf_chanspec_list *list;
- struct brcmu_chan ch;
- int err;
- @@ -5899,11 +5945,10 @@ static int brcmf_construct_chaninfo(stru
- err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
- BRCMF_DCMD_MEDLEN);
- if (err) {
- - brcmf_err("get chanspecs error (%d)\n", err);
- + bphy_err(wiphy, "get chanspecs error (%d)\n", err);
- goto fail_pbuf;
- }
-
- - wiphy = cfg_to_wiphy(cfg);
- band = wiphy->bands[NL80211_BAND_2GHZ];
- if (band)
- for (i = 0; i < band->n_channels; i++)
- @@ -5923,7 +5968,8 @@ static int brcmf_construct_chaninfo(stru
- } else if (ch.band == BRCMU_CHAN_BAND_5G) {
- band = wiphy->bands[NL80211_BAND_5GHZ];
- } else {
- - brcmf_err("Invalid channel Spec. 0x%x.\n", ch.chspec);
- + bphy_err(wiphy, "Invalid channel Spec. 0x%x.\n",
- + ch.chspec);
- continue;
- }
- if (!band)
- @@ -5946,8 +5992,8 @@ static int brcmf_construct_chaninfo(stru
- /* It seems firmware supports some channel we never
- * considered. Something new in IEEE standard?
- */
- - brcmf_err("Ignoring unexpected firmware channel %d\n",
- - ch.control_ch_num);
- + bphy_err(wiphy, "Ignoring unexpected firmware channel %d\n",
- + ch.control_ch_num);
- continue;
- }
-
- @@ -5993,6 +6039,7 @@ fail_pbuf:
-
- static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg)
- {
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
- struct ieee80211_supported_band *band;
- struct brcmf_fil_bwcap_le band_bwcap;
- @@ -6039,7 +6086,7 @@ static int brcmf_enable_bw40_2g(struct b
- err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf,
- BRCMF_DCMD_MEDLEN);
- if (err) {
- - brcmf_err("get chanspecs error (%d)\n", err);
- + bphy_err(wiphy, "get chanspecs error (%d)\n", err);
- kfree(pbuf);
- return err;
- }
- @@ -6070,6 +6117,7 @@ static int brcmf_enable_bw40_2g(struct b
-
- static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[])
- {
- + struct wiphy *wiphy = ifp->drvr->wiphy;
- u32 band, mimo_bwcap;
- int err;
-
- @@ -6105,7 +6153,7 @@ static void brcmf_get_bwcap(struct brcmf
- bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT;
- break;
- default:
- - brcmf_err("invalid mimo_bw_cap value\n");
- + bphy_err(wiphy, "invalid mimo_bw_cap value\n");
- }
- }
-
- @@ -6181,7 +6229,7 @@ static void brcmf_update_vht_cap(struct
- static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg)
- {
- struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
- - struct wiphy *wiphy;
- + struct wiphy *wiphy = cfg_to_wiphy(cfg);
- u32 nmode = 0;
- u32 vhtmode = 0;
- u32 bw_cap[2] = { WLC_BW_20MHZ_BIT, WLC_BW_20MHZ_BIT };
- @@ -6197,7 +6245,7 @@ static int brcmf_setup_wiphybands(struct
- (void)brcmf_fil_iovar_int_get(ifp, "vhtmode", &vhtmode);
- err = brcmf_fil_iovar_int_get(ifp, "nmode", &nmode);
- if (err) {
- - brcmf_err("nmode error (%d)\n", err);
- + bphy_err(wiphy, "nmode error (%d)\n", err);
- } else {
- brcmf_get_bwcap(ifp, bw_cap);
- }
- @@ -6207,7 +6255,7 @@ static int brcmf_setup_wiphybands(struct
-
- err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain);
- if (err) {
- - brcmf_err("rxchain error (%d)\n", err);
- + bphy_err(wiphy, "rxchain error (%d)\n", err);
- nchain = 1;
- } else {
- for (nchain = 0; rxchain; nchain++)
- @@ -6217,7 +6265,7 @@ static int brcmf_setup_wiphybands(struct
-
- err = brcmf_construct_chaninfo(cfg, bw_cap);
- if (err) {
- - brcmf_err("brcmf_construct_chaninfo failed (%d)\n", err);
- + bphy_err(wiphy, "brcmf_construct_chaninfo failed (%d)\n", err);
- return err;
- }
-
- @@ -6229,7 +6277,6 @@ static int brcmf_setup_wiphybands(struct
- &txbf_bfr_cap);
- }
-
- - wiphy = cfg_to_wiphy(cfg);
- for (i = 0; i < ARRAY_SIZE(wiphy->bands); i++) {
- band = wiphy->bands[i];
- if (band == NULL)
- @@ -6440,7 +6487,7 @@ static void brcmf_wiphy_wowl_params(stru
- wowl = kmemdup(&brcmf_wowlan_support, sizeof(brcmf_wowlan_support),
- GFP_KERNEL);
- if (!wowl) {
- - brcmf_err("only support basic wowlan features\n");
- + bphy_err(wiphy, "only support basic wowlan features\n");
- wiphy->wowlan = &brcmf_wowlan_support;
- return;
- }
- @@ -6529,7 +6576,7 @@ static int brcmf_setup_wiphy(struct wiph
- err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist,
- sizeof(bandlist));
- if (err) {
- - brcmf_err("could not obtain band info: err=%d\n", err);
- + bphy_err(wiphy, "could not obtain band info: err=%d\n", err);
- return err;
- }
- /* first entry in bandlist is number of bands */
- @@ -6801,8 +6848,8 @@ static void brcmf_cfg80211_reg_notifier(
- /* ignore non-ISO3166 country codes */
- for (i = 0; i < 2; i++)
- if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
- - brcmf_err("not a ISO3166 code (0x%02x 0x%02x)\n",
- - req->alpha2[0], req->alpha2[1]);
- + bphy_err(wiphy, "not a ISO3166 code (0x%02x 0x%02x)\n",
- + req->alpha2[0], req->alpha2[1]);
- return;
- }
-
- @@ -6811,7 +6858,7 @@ static void brcmf_cfg80211_reg_notifier(
-
- err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
- if (err) {
- - brcmf_err("Country code iovar returned err = %d\n", err);
- + bphy_err(wiphy, "Country code iovar returned err = %d\n", err);
- return;
- }
-
- @@ -6821,7 +6868,7 @@ static void brcmf_cfg80211_reg_notifier(
-
- err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq));
- if (err) {
- - brcmf_err("Firmware rejected country setting\n");
- + bphy_err(wiphy, "Firmware rejected country setting\n");
- return;
- }
- brcmf_setup_wiphybands(cfg);
- @@ -6867,13 +6914,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- u16 *cap = NULL;
-
- if (!ndev) {
- - brcmf_err("ndev is invalid\n");
- + bphy_err(wiphy, "ndev is invalid\n");
- return NULL;
- }
-
- cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
- if (!cfg) {
- - brcmf_err("Could not allocate wiphy device\n");
- + bphy_err(wiphy, "Could not allocate wiphy device\n");
- return NULL;
- }
-
- @@ -6894,7 +6941,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
-
- err = wl_init_priv(cfg);
- if (err) {
- - brcmf_err("Failed to init iwm_priv (%d)\n", err);
- + bphy_err(wiphy, "Failed to init iwm_priv (%d)\n", err);
- brcmf_free_vif(vif);
- goto wiphy_out;
- }
- @@ -6903,7 +6950,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- /* determine d11 io type before wiphy setup */
- err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_VERSION, &io_type);
- if (err) {
- - brcmf_err("Failed to get D11 version (%d)\n", err);
- + bphy_err(wiphy, "Failed to get D11 version (%d)\n", err);
- goto priv_out;
- }
- cfg->d11inf.io_type = (u8)io_type;
- @@ -6937,13 +6984,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- #endif
- err = wiphy_register(wiphy);
- if (err < 0) {
- - brcmf_err("Could not register wiphy device (%d)\n", err);
- + bphy_err(wiphy, "Could not register wiphy device (%d)\n", err);
- goto priv_out;
- }
-
- err = brcmf_setup_wiphybands(cfg);
- if (err) {
- - brcmf_err("Setting wiphy bands failed (%d)\n", err);
- + bphy_err(wiphy, "Setting wiphy bands failed (%d)\n", err);
- goto wiphy_unreg_out;
- }
-
- @@ -6961,18 +7008,18 @@ struct brcmf_cfg80211_info *brcmf_cfg802
-
- err = brcmf_fweh_activate_events(ifp);
- if (err) {
- - brcmf_err("FWEH activation failed (%d)\n", err);
- + bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
- goto wiphy_unreg_out;
- }
-
- err = brcmf_p2p_attach(cfg, p2pdev_forced);
- if (err) {
- - brcmf_err("P2P initialisation failed (%d)\n", err);
- + bphy_err(wiphy, "P2P initialisation failed (%d)\n", err);
- goto wiphy_unreg_out;
- }
- err = brcmf_btcoex_attach(cfg);
- if (err) {
- - brcmf_err("BT-coex initialisation failed (%d)\n", err);
- + bphy_err(wiphy, "BT-coex initialisation failed (%d)\n", err);
- brcmf_p2p_detach(&cfg->p2p);
- goto wiphy_unreg_out;
- }
- @@ -6991,7 +7038,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802
- /* (re-) activate FWEH event handling */
- err = brcmf_fweh_activate_events(ifp);
- if (err) {
- - brcmf_err("FWEH activation failed (%d)\n", err);
- + bphy_err(wiphy, "FWEH activation failed (%d)\n", err);
- goto detach;
- }
-
- --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
- +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
- @@ -62,6 +62,15 @@ void __brcmf_err(struct brcmf_bus *bus,
- } while (0)
- #endif
-
- +#define bphy_err(wiphy, fmt, ...) \
- + do { \
- + if (IS_ENABLED(CPTCFG_BRCMDBG) || \
- + IS_ENABLED(CPTCFG_BRCM_TRACING) || \
- + net_ratelimit()) \
- + wiphy_err(wiphy, "%s: " fmt, __func__, \
- + ##__VA_ARGS__); \
- + } while (0)
- +
- #if defined(DEBUG) || defined(CPTCFG_BRCM_TRACING)
-
- /* For debug/tracing purposes treat info messages as errors */
|