@@ -359,6 +359,10 @@ static int wifi_connect(uint32_t mgmt_request, struct net_if *iface,
359
359
return - ENOTSUP ;
360
360
}
361
361
362
+ if (!net_if_is_admin_up (iface )) {
363
+ return - ENETDOWN ;
364
+ }
365
+
362
366
LOG_HEXDUMP_DBG (params -> ssid , params -> ssid_length , "ssid" );
363
367
LOG_HEXDUMP_DBG (params -> psk , params -> psk_length , "psk" );
364
368
if (params -> sae_password ) {
@@ -431,6 +435,10 @@ static int wifi_scan(uint32_t mgmt_request, struct net_if *iface,
431
435
return - ENOTSUP ;
432
436
}
433
437
438
+ if (!net_if_is_admin_up (iface )) {
439
+ return - ENETDOWN ;
440
+ }
441
+
434
442
#ifdef CONFIG_WIFI_MGMT_FORCED_PASSIVE_SCAN
435
443
struct wifi_scan_params default_params = {0 };
436
444
@@ -455,6 +463,10 @@ static int wifi_disconnect(uint32_t mgmt_request, struct net_if *iface,
455
463
return - ENOTSUP ;
456
464
}
457
465
466
+ if (!net_if_is_admin_up (iface )) {
467
+ return - ENETDOWN ;
468
+ }
469
+
458
470
return wifi_mgmt_api -> disconnect (dev );
459
471
}
460
472
@@ -492,6 +504,11 @@ static int wifi_start_roaming(uint32_t mgmt_request, struct net_if *iface,
492
504
if (wifi_mgmt_api == NULL ) {
493
505
return - ENOTSUP ;
494
506
}
507
+
508
+ if (!net_if_is_admin_up (iface )) {
509
+ return - ENETDOWN ;
510
+ }
511
+
495
512
if (roaming_params .is_11r_used ) {
496
513
if (wifi_mgmt_api -> start_11r_roaming == NULL ) {
497
514
return - ENOTSUP ;
@@ -528,6 +545,10 @@ static int wifi_neighbor_rep_complete(uint32_t mgmt_request, struct net_if *ifac
528
545
const struct wifi_mgmt_ops * const wifi_mgmt_api = get_wifi_api (iface );
529
546
struct wifi_scan_params params = {0 };
530
547
548
+ if (!net_if_is_admin_up (iface )) {
549
+ return - ENETDOWN ;
550
+ }
551
+
531
552
for (int i = 0 ; i < roaming_params .neighbor_rep .neighbor_cnt ; i ++ ) {
532
553
params .band_chan [i ].channel = roaming_params .neighbor_rep .neighbor_ap [i ].channel ;
533
554
if (params .band_chan [i ].channel > 14 ) {
@@ -624,6 +645,10 @@ static int wifi_ap_enable(uint32_t mgmt_request, struct net_if *iface,
624
645
return - ENOTSUP ;
625
646
}
626
647
648
+ if (!net_if_is_admin_up (iface )) {
649
+ return - ENETDOWN ;
650
+ }
651
+
627
652
return wifi_mgmt_api -> ap_enable (dev , params );
628
653
}
629
654
@@ -639,6 +664,10 @@ static int wifi_ap_disable(uint32_t mgmt_request, struct net_if *iface,
639
664
return - ENOTSUP ;
640
665
}
641
666
667
+ if (!net_if_is_admin_up (iface )) {
668
+ return - ENETDOWN ;
669
+ }
670
+
642
671
return wifi_mgmt_api -> ap_disable (dev );
643
672
}
644
673
@@ -659,6 +688,10 @@ static int wifi_ap_sta_disconnect(uint32_t mgmt_request, struct net_if *iface,
659
688
return - ENOTSUP ;
660
689
}
661
690
691
+ if (!net_if_is_admin_up (iface )) {
692
+ return - ENETDOWN ;
693
+ }
694
+
662
695
if (!data || len != sizeof (uint8_t ) * WIFI_MAC_ADDR_LEN ) {
663
696
return - EINVAL ;
664
697
}
@@ -684,6 +717,10 @@ static int wifi_ap_config_params(uint32_t mgmt_request, struct net_if *iface,
684
717
return - ENOTSUP ;
685
718
}
686
719
720
+ if (!net_if_is_admin_up (iface )) {
721
+ return - ENETDOWN ;
722
+ }
723
+
687
724
if (!data || len != sizeof (* params )) {
688
725
return - EINVAL ;
689
726
}
@@ -713,6 +750,10 @@ static int wifi_ap_set_rts_threshold(uint32_t mgmt_request, struct net_if *iface
713
750
return - ENOTSUP ;
714
751
}
715
752
753
+ if (!net_if_is_admin_up (iface )) {
754
+ return - ENETDOWN ;
755
+ }
756
+
716
757
if (data == NULL || len != sizeof (* rts_threshold )) {
717
758
return - EINVAL ;
718
759
}
@@ -795,6 +836,10 @@ static int wifi_11k_cfg(uint32_t mgmt_request, struct net_if *iface,
795
836
return - ENOTSUP ;
796
837
}
797
838
839
+ if (!net_if_is_admin_up (iface )) {
840
+ return - ENETDOWN ;
841
+ }
842
+
798
843
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_ROAMING
799
844
if (params -> oper == WIFI_MGMT_SET ) {
800
845
roaming_params .is_11k_enabled = params -> enable_11k ;
@@ -817,6 +862,10 @@ static int wifi_11k_neighbor_request(uint32_t mgmt_request, struct net_if *iface
817
862
return - ENOTSUP ;
818
863
}
819
864
865
+ if (!net_if_is_admin_up (iface )) {
866
+ return - ENETDOWN ;
867
+ }
868
+
820
869
return wifi_mgmt_api -> send_11k_neighbor_request (dev , params );
821
870
}
822
871
@@ -835,6 +884,10 @@ static int wifi_set_power_save(uint32_t mgmt_request, struct net_if *iface,
835
884
return - ENOTSUP ;
836
885
}
837
886
887
+ if (!net_if_is_admin_up (iface )) {
888
+ return - ENETDOWN ;
889
+ }
890
+
838
891
switch (ps_params -> type ) {
839
892
case WIFI_PS_PARAM_LISTEN_INTERVAL :
840
893
case WIFI_PS_PARAM_MODE :
@@ -884,6 +937,10 @@ static int wifi_get_power_save_config(uint32_t mgmt_request, struct net_if *ifac
884
937
return - ENOTSUP ;
885
938
}
886
939
940
+ if (!net_if_is_admin_up (iface )) {
941
+ return - ENETDOWN ;
942
+ }
943
+
887
944
if (!data || len != sizeof (* ps_config )) {
888
945
return - EINVAL ;
889
946
}
@@ -907,6 +964,10 @@ static int wifi_set_twt(uint32_t mgmt_request, struct net_if *iface,
907
964
return - ENOTSUP ;
908
965
}
909
966
967
+ if (!net_if_is_admin_up (iface )) {
968
+ return - ENETDOWN ;
969
+ }
970
+
910
971
if (twt_params -> operation == WIFI_TWT_TEARDOWN ) {
911
972
return wifi_mgmt_api -> set_twt (dev , twt_params );
912
973
}
@@ -970,6 +1031,10 @@ static int wifi_set_btwt(uint32_t mgmt_request, struct net_if *iface,
970
1031
return - ENOTSUP ;
971
1032
}
972
1033
1034
+ if (!net_if_is_admin_up (iface )) {
1035
+ return - ENETDOWN ;
1036
+ }
1037
+
973
1038
if (net_mgmt (NET_REQUEST_WIFI_IFACE_STATUS , iface , & info ,
974
1039
sizeof (struct wifi_iface_status ))) {
975
1040
twt_params -> fail_reason =
@@ -1003,6 +1068,10 @@ static int wifi_reg_domain(uint32_t mgmt_request, struct net_if *iface,
1003
1068
return - ENOTSUP ;
1004
1069
}
1005
1070
1071
+ if (!net_if_is_admin_up (iface )) {
1072
+ return - ENETDOWN ;
1073
+ }
1074
+
1006
1075
if (!data || len != sizeof (* reg_domain )) {
1007
1076
return - EINVAL ;
1008
1077
}
@@ -1035,6 +1104,10 @@ static int wifi_mode(uint32_t mgmt_request, struct net_if *iface,
1035
1104
return - ENOTSUP ;
1036
1105
}
1037
1106
1107
+ if (!net_if_is_admin_up (iface )) {
1108
+ return - ENETDOWN ;
1109
+ }
1110
+
1038
1111
return wifi_mgmt_api -> mode (dev , mode_info );
1039
1112
}
1040
1113
@@ -1055,6 +1128,10 @@ static int wifi_packet_filter(uint32_t mgmt_request, struct net_if *iface,
1055
1128
return - ENOTSUP ;
1056
1129
}
1057
1130
1131
+ if (!net_if_is_admin_up (iface )) {
1132
+ return - ENETDOWN ;
1133
+ }
1134
+
1058
1135
return wifi_mgmt_api -> filter (dev , filter_info );
1059
1136
}
1060
1137
@@ -1075,6 +1152,10 @@ static int wifi_channel(uint32_t mgmt_request, struct net_if *iface,
1075
1152
return - ENOTSUP ;
1076
1153
}
1077
1154
1155
+ if (!net_if_is_admin_up (iface )) {
1156
+ return - ENETDOWN ;
1157
+ }
1158
+
1078
1159
return wifi_mgmt_api -> channel (dev , channel_info );
1079
1160
}
1080
1161
@@ -1107,6 +1188,10 @@ static int wifi_btm_query(uint32_t mgmt_request, struct net_if *iface, void *dat
1107
1188
return - ENOTSUP ;
1108
1189
}
1109
1190
1191
+ if (!net_if_is_admin_up (iface )) {
1192
+ return - ENETDOWN ;
1193
+ }
1194
+
1110
1195
if (query_reason >= WIFI_BTM_QUERY_REASON_UNSPECIFIED &&
1111
1196
query_reason <= WIFI_BTM_QUERY_REASON_LEAVING_ESS ) {
1112
1197
return wifi_mgmt_api -> btm_query (dev , query_reason );
@@ -1129,6 +1214,10 @@ static int wifi_get_connection_params(uint32_t mgmt_request, struct net_if *ifac
1129
1214
return - ENOTSUP ;
1130
1215
}
1131
1216
1217
+ if (!net_if_is_admin_up (iface )) {
1218
+ return - ENETDOWN ;
1219
+ }
1220
+
1132
1221
return wifi_mgmt_api -> get_conn_params (dev , conn_params );
1133
1222
}
1134
1223
@@ -1144,6 +1233,10 @@ static int wifi_wps_config(uint32_t mgmt_request, struct net_if *iface, void *da
1144
1233
return - ENOTSUP ;
1145
1234
}
1146
1235
1236
+ if (!net_if_is_admin_up (iface )) {
1237
+ return - ENETDOWN ;
1238
+ }
1239
+
1147
1240
return wifi_mgmt_api -> wps_config (dev , params );
1148
1241
}
1149
1242
@@ -1160,6 +1253,10 @@ static int wifi_set_rts_threshold(uint32_t mgmt_request, struct net_if *iface,
1160
1253
return - ENOTSUP ;
1161
1254
}
1162
1255
1256
+ if (!net_if_is_admin_up (iface )) {
1257
+ return - ENETDOWN ;
1258
+ }
1259
+
1163
1260
if (!data || len != sizeof (* rts_threshold )) {
1164
1261
return - EINVAL ;
1165
1262
}
@@ -1181,6 +1278,10 @@ static int wifi_dpp(uint32_t mgmt_request, struct net_if *iface,
1181
1278
return - ENOTSUP ;
1182
1279
}
1183
1280
1281
+ if (!net_if_is_admin_up (iface )) {
1282
+ return - ENETDOWN ;
1283
+ }
1284
+
1184
1285
return wifi_mgmt_api -> dpp_dispatch (dev , params );
1185
1286
}
1186
1287
@@ -1198,6 +1299,10 @@ static int wifi_pmksa_flush(uint32_t mgmt_request, struct net_if *iface,
1198
1299
return - ENOTSUP ;
1199
1300
}
1200
1301
1302
+ if (!net_if_is_admin_up (iface )) {
1303
+ return - ENETDOWN ;
1304
+ }
1305
+
1201
1306
return wifi_mgmt_api -> pmksa_flush (dev );
1202
1307
}
1203
1308
@@ -1214,6 +1319,10 @@ static int wifi_get_rts_threshold(uint32_t mgmt_request, struct net_if *iface,
1214
1319
return - ENOTSUP ;
1215
1320
}
1216
1321
1322
+ if (!net_if_is_admin_up (iface )) {
1323
+ return - ENETDOWN ;
1324
+ }
1325
+
1217
1326
if (!data || len != sizeof (* rts_threshold )) {
1218
1327
return - EINVAL ;
1219
1328
}
@@ -1235,6 +1344,10 @@ static int wifi_set_enterprise_creds(uint32_t mgmt_request, struct net_if *iface
1235
1344
return - ENOTSUP ;
1236
1345
}
1237
1346
1347
+ if (!net_if_is_admin_up (iface )) {
1348
+ return - ENETDOWN ;
1349
+ }
1350
+
1238
1351
return wifi_mgmt_api -> enterprise_creds (dev , params );
1239
1352
}
1240
1353
0 commit comments