forked from openwrt/openwrt
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch
2025 lines (1870 loc) · 65.1 KB
/
346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
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;
}
@@ -508,6 +509,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;
@@ -524,7 +526,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;
}
@@ -567,7 +569,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;
}
@@ -575,7 +577,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;
}
@@ -583,7 +585,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");
free_netdev(ifp->ndev);
goto fail;
}
@@ -620,7 +622,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) {
@@ -645,8 +647,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);
@@ -661,12 +663,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);
@@ -677,6 +680,7 @@ s32 brcmf_notify_escan_complete(struct b
struct brcmf_if *ifp, bool aborted,
bool fw_abort)
{
+ struct wiphy *wiphy = cfg_to_wiphy(cfg);
struct brcmf_scan_params_le params_le;
struct cfg80211_scan_request *scan_request;
u64 reqid;
@@ -711,7 +715,7 @@ s32 brcmf_notify_escan_complete(struct b
err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN,
¶ms_le, sizeof(params_le));
if (err)
- brcmf_err("Scan abort failed\n");
+ bphy_err(wiphy, "Scan abort failed\n");
}
brcmf_scan_config_mpc(ifp, 1);
@@ -763,7 +767,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;
}
@@ -771,7 +775,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;
}
@@ -873,14 +877,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;
@@ -908,7 +912,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;
}
@@ -999,6 +1003,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;
@@ -1030,7 +1035,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);
@@ -1076,21 +1081,22 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
return -EIO;
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, &vif->sme_state)) {
- brcmf_err("Connecting: status (%lu)\n", vif->sme_state);
+ bphy_err(wiphy, "Connecting: status (%lu)\n", vif->sme_state);
return -EAGAIN;
}
@@ -1124,7 +1130,7 @@ brcmf_cfg80211_scan(struct wiphy *wiphy,
return 0;
scan_out:
- brcmf_err("scan error (%d)\n", err);
+ bphy_err(wiphy, "scan error (%d)\n", err);
clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
cfg->scan_request = NULL;
return err;
@@ -1132,36 +1138,41 @@ scan_out:
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;
@@ -1237,6 +1248,7 @@ static u16 brcmf_map_fw_linkdown_reason(
static int brcmf_set_pmk(struct brcmf_if *ifp, const u8 *pmk_data, u16 pmk_len)
{
+ struct wiphy *wiphy = ifp->drvr->wiphy;
struct brcmf_wsec_pmk_le pmk;
int i, err;
@@ -1250,8 +1262,8 @@ static int brcmf_set_pmk(struct brcmf_if
err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_WSEC_PMK,
&pmk, sizeof(pmk));
if (err < 0)
- brcmf_err("failed to change PSK in firmware (len=%u)\n",
- pmk_len);
+ bphy_err(wiphy, "failed to change PSK in firmware (len=%u)\n",
+ pmk_len);
return err;
}
@@ -1259,6 +1271,7 @@ static int brcmf_set_pmk(struct brcmf_if
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");
@@ -1268,7 +1281,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))
@@ -1356,7 +1369,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;
}
@@ -1368,7 +1381,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;
}
@@ -1413,7 +1426,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
@@ -1425,7 +1438,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;
}
@@ -1461,6 +1474,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;
@@ -1473,9 +1488,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;
@@ -1486,6 +1501,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;
@@ -1506,9 +1523,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;
@@ -1520,6 +1537,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;
@@ -1543,8 +1562,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;
}
}
@@ -1564,8 +1583,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;
}
}
@@ -1578,9 +1597,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;
}
@@ -1595,6 +1614,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;
struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
s32 val;
s32 err;
@@ -1613,7 +1633,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)) {
@@ -1627,8 +1647,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)) {
@@ -1650,8 +1670,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;
}
}
@@ -1697,7 +1717,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;
}
@@ -1708,6 +1728,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;
@@ -1734,7 +1756,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);
@@ -1747,24 +1769,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;
}
@@ -1784,6 +1806,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;
@@ -1822,7 +1845,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
@@ -1849,7 +1872,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;
}
@@ -1878,7 +1901,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");
@@ -1899,32 +1922,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;
}
@@ -1941,7 +1964,7 @@ brcmf_cfg80211_connect(struct wiphy *wip
/* enable firmware supplicant for this interface */
err = brcmf_fil_iovar_int_set(ifp, "sup_wpa", 1);
if (err < 0) {
- brcmf_err("failed to enable fw supplicant\n");
+ bphy_err(wiphy, "failed to enable fw supplicant\n");
goto done;
}
}
@@ -2036,7 +2059,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)
@@ -2067,7 +2090,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;
@@ -2094,7 +2117,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;
}
@@ -2104,7 +2127,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;
}
@@ -2112,11 +2135,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);
@@ -2137,7 +2160,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;
@@ -2163,7 +2186,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;
}
@@ -2173,7 +2196,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");
@@ -2237,7 +2260,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;
}
@@ -2246,7 +2269,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;
}
@@ -2300,7 +2323,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;
}
@@ -2311,13 +2334,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;
}
@@ -2348,7 +2371,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;
@@ -2369,7 +2392,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;
}
@@ -2399,6 +2422,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;
@@ -2415,18 +2439,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)
@@ -2452,6 +2476,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;
@@ -2467,7 +2492,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_ULL(NL80211_STA_INFO_BSS_PARAM);
@@ -2489,6 +2514,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;
@@ -2498,7 +2524,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_ULL(NL80211_STA_INFO_TX_BITRATE);
@@ -2508,7 +2534,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);
@@ -2518,7 +2544,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_ULL(NL80211_STA_INFO_RX_PACKETS) |
@@ -2566,7 +2592,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;
}
}
@@ -2635,7 +2661,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);
@@ -2666,8 +2693,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;
}
@@ -2715,9 +2742,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");
@@ -2740,7 +2767,7 @@ static s32 brcmf_inform_single_bss(struc
struct cfg80211_inform_bss bss_data = {};
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;
}
@@ -2799,6 +2826,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;
@@ -2807,8 +2835,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);
@@ -2852,7 +2880,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;
}
@@ -2906,6 +2934,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;
@@ -2922,7 +2951,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;
}
@@ -2947,7 +2976,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;
@@ -2985,9 +3014,10 @@ static void brcmf_escan_timeout(struct t
{
struct brcmf_cfg80211_info *cfg =
from_timer(cfg, t, escan_timeout);
+ struct wiphy *wiphy = cfg_to_wiphy(cfg);
if (cfg->int_escan_map || cfg->scan_request) {
- brcmf_err("timer expired\n");
+ bphy_err(wiphy, "timer expired\n");
schedule_work(&cfg->escan_timeout_work);
}
}
@@ -3036,6 +3066,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;
@@ -3052,32 +3083,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",