@@ -1056,7 +1056,7 @@ static int wifi_scan_args_to_params(const struct shell *sh,
1056
1056
1057
1057
static int cmd_wifi_scan (const struct shell * sh , size_t argc , char * argv [])
1058
1058
{
1059
- struct net_if * iface = net_if_get_first_wifi ();
1059
+ struct net_if * iface = net_if_get_wifi_sta ();
1060
1060
struct wifi_scan_params params = { 0 };
1061
1061
bool do_scan = true;
1062
1062
int opt_num ;
@@ -1092,7 +1092,7 @@ static int cmd_wifi_scan(const struct shell *sh, size_t argc, char *argv[])
1092
1092
1093
1093
static int cmd_wifi_status (const struct shell * sh , size_t argc , char * argv [])
1094
1094
{
1095
- struct net_if * iface = net_if_get_first_wifi ();
1095
+ struct net_if * iface = net_if_get_wifi_sta ();
1096
1096
struct wifi_iface_status status = { 0 };
1097
1097
1098
1098
context .sh = sh ;
@@ -1226,7 +1226,7 @@ static int cmd_wifi_stats(const struct shell *sh, size_t argc, char *argv[])
1226
1226
{
1227
1227
#if defined(CONFIG_NET_STATISTICS_WIFI ) && \
1228
1228
defined(CONFIG_NET_STATISTICS_USER_API )
1229
- struct net_if * iface = net_if_get_first_wifi ();
1229
+ struct net_if * iface = net_if_get_wifi_sta ();
1230
1230
struct net_stats_wifi stats = { 0 };
1231
1231
int ret ;
1232
1232
@@ -1269,7 +1269,7 @@ static int cmd_wifi_stats(const struct shell *sh, size_t argc, char *argv[])
1269
1269
1270
1270
static int cmd_wifi_11k (const struct shell * sh , size_t argc , char * argv [])
1271
1271
{
1272
- struct net_if * iface = net_if_get_first_wifi ();
1272
+ struct net_if * iface = net_if_get_wifi_sta ();
1273
1273
struct wifi_11k_params params = { 0 };
1274
1274
1275
1275
context .sh = sh ;
@@ -1310,7 +1310,7 @@ static int cmd_wifi_11k(const struct shell *sh, size_t argc, char *argv[])
1310
1310
1311
1311
static int cmd_wifi_11k_neighbor_request (const struct shell * sh , size_t argc , char * argv [])
1312
1312
{
1313
- struct net_if * iface = net_if_get_first_wifi ();
1313
+ struct net_if * iface = net_if_get_wifi_sta ();
1314
1314
struct wifi_11k_params params = { 0 };
1315
1315
1316
1316
context .sh = sh ;
@@ -1347,7 +1347,7 @@ static int cmd_wifi_11k_neighbor_request(const struct shell *sh, size_t argc, ch
1347
1347
1348
1348
static int cmd_wifi_ps (const struct shell * sh , size_t argc , char * argv [])
1349
1349
{
1350
- struct net_if * iface = net_if_get_first_wifi ();
1350
+ struct net_if * iface = net_if_get_wifi_sta ();
1351
1351
struct wifi_ps_params params = { 0 };
1352
1352
1353
1353
context .sh = sh ;
@@ -1435,7 +1435,7 @@ static int cmd_wifi_ps(const struct shell *sh, size_t argc, char *argv[])
1435
1435
1436
1436
static int cmd_wifi_ps_mode (const struct shell * sh , size_t argc , char * argv [])
1437
1437
{
1438
- struct net_if * iface = net_if_get_first_wifi ();
1438
+ struct net_if * iface = net_if_get_wifi_sta ();
1439
1439
struct wifi_ps_params params = { 0 };
1440
1440
1441
1441
context .sh = sh ;
@@ -1465,7 +1465,7 @@ static int cmd_wifi_ps_mode(const struct shell *sh, size_t argc, char *argv[])
1465
1465
1466
1466
static int cmd_wifi_ps_timeout (const struct shell * sh , size_t argc , char * argv [])
1467
1467
{
1468
- struct net_if * iface = net_if_get_first_wifi ();
1468
+ struct net_if * iface = net_if_get_wifi_sta ();
1469
1469
struct wifi_ps_params params = { 0 };
1470
1470
long timeout_ms = 0 ;
1471
1471
int err = 0 ;
@@ -1500,7 +1500,7 @@ static int cmd_wifi_ps_timeout(const struct shell *sh, size_t argc, char *argv[]
1500
1500
static int cmd_wifi_twt_setup_quick (const struct shell * sh , size_t argc ,
1501
1501
char * argv [])
1502
1502
{
1503
- struct net_if * iface = net_if_get_first_wifi ();
1503
+ struct net_if * iface = net_if_get_wifi_sta ();
1504
1504
struct wifi_twt_params params = { 0 };
1505
1505
int idx = 1 ;
1506
1506
long value ;
@@ -1547,7 +1547,7 @@ static int cmd_wifi_twt_setup_quick(const struct shell *sh, size_t argc,
1547
1547
static int cmd_wifi_twt_setup (const struct shell * sh , size_t argc ,
1548
1548
char * argv [])
1549
1549
{
1550
- struct net_if * iface = net_if_get_first_wifi ();
1550
+ struct net_if * iface = net_if_get_wifi_sta ();
1551
1551
struct wifi_twt_params params = { 0 };
1552
1552
int idx = 1 ;
1553
1553
long value ;
@@ -1632,7 +1632,7 @@ static int cmd_wifi_twt_setup(const struct shell *sh, size_t argc,
1632
1632
static int cmd_wifi_twt_teardown (const struct shell * sh , size_t argc ,
1633
1633
char * argv [])
1634
1634
{
1635
- struct net_if * iface = net_if_get_first_wifi ();
1635
+ struct net_if * iface = net_if_get_wifi_sta ();
1636
1636
struct wifi_twt_params params = { 0 };
1637
1637
long value ;
1638
1638
@@ -1682,7 +1682,7 @@ static int cmd_wifi_twt_teardown(const struct shell *sh, size_t argc,
1682
1682
static int cmd_wifi_twt_teardown_all (const struct shell * sh , size_t argc ,
1683
1683
char * argv [])
1684
1684
{
1685
- struct net_if * iface = net_if_get_first_wifi ();
1685
+ struct net_if * iface = net_if_get_wifi_sta ();
1686
1686
struct wifi_twt_params params = { 0 };
1687
1687
1688
1688
context .sh = sh ;
@@ -1806,11 +1806,7 @@ static int cmd_wifi_ap_stations(const struct shell *sh, size_t argc,
1806
1806
static int cmd_wifi_ap_sta_disconnect (const struct shell * sh , size_t argc ,
1807
1807
char * argv [])
1808
1808
{
1809
- #ifdef CONFIG_WIFI_NM_HOSTAPD_AP
1810
1809
struct net_if * iface = net_if_get_wifi_sap ();
1811
- #else
1812
- struct net_if * iface = net_if_get_first_wifi ();
1813
- #endif
1814
1810
uint8_t mac [6 ];
1815
1811
int ret ;
1816
1812
@@ -1879,11 +1875,7 @@ static int wifi_ap_config_args_to_params(const struct shell *sh, size_t argc, ch
1879
1875
static int cmd_wifi_ap_config_params (const struct shell * sh , size_t argc ,
1880
1876
char * argv [])
1881
1877
{
1882
- #ifdef CONFIG_WIFI_NM_HOSTAPD_AP
1883
1878
struct net_if * iface = net_if_get_wifi_sap ();
1884
- #else
1885
- struct net_if * iface = net_if_get_first_wifi ();
1886
- #endif
1887
1879
struct wifi_ap_config_params ap_config_params = { 0 };
1888
1880
int ret = -1 ;
1889
1881
@@ -1907,7 +1899,7 @@ static int cmd_wifi_ap_config_params(const struct shell *sh, size_t argc,
1907
1899
static int cmd_wifi_reg_domain (const struct shell * sh , size_t argc ,
1908
1900
char * argv [])
1909
1901
{
1910
- struct net_if * iface = net_if_get_first_wifi ();
1902
+ struct net_if * iface = net_if_get_wifi_sta ();
1911
1903
struct wifi_reg_domain regd = {0 };
1912
1904
int ret , chan_idx = 0 ;
1913
1905
@@ -1976,7 +1968,7 @@ static int cmd_wifi_reg_domain(const struct shell *sh, size_t argc,
1976
1968
1977
1969
static int cmd_wifi_listen_interval (const struct shell * sh , size_t argc , char * argv [])
1978
1970
{
1979
- struct net_if * iface = net_if_get_first_wifi ();
1971
+ struct net_if * iface = net_if_get_wifi_sta ();
1980
1972
struct wifi_ps_params params = { 0 };
1981
1973
long interval ;
1982
1974
@@ -2011,7 +2003,7 @@ static int cmd_wifi_listen_interval(const struct shell *sh, size_t argc, char *a
2011
2003
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
2012
2004
static int cmd_wifi_btm_query (const struct shell * sh , size_t argc , char * argv [])
2013
2005
{
2014
- struct net_if * iface = net_if_get_first_wifi ();
2006
+ struct net_if * iface = net_if_get_wifi_sta ();
2015
2007
uint8_t query_reason = 0 ;
2016
2008
long tmp = 0 ;
2017
2009
@@ -2139,7 +2131,7 @@ static int cmd_wifi_ap_wps_pin(const struct shell *sh, size_t argc, char *argv[]
2139
2131
2140
2132
static int cmd_wifi_ps_wakeup_mode (const struct shell * sh , size_t argc , char * argv [])
2141
2133
{
2142
- struct net_if * iface = net_if_get_first_wifi ();
2134
+ struct net_if * iface = net_if_get_wifi_sta ();
2143
2135
struct wifi_ps_params params = { 0 };
2144
2136
2145
2137
context .sh = sh ;
@@ -2170,7 +2162,7 @@ static int cmd_wifi_ps_wakeup_mode(const struct shell *sh, size_t argc, char *ar
2170
2162
2171
2163
static int cmd_wifi_set_rts_threshold (const struct shell * sh , size_t argc , char * argv [])
2172
2164
{
2173
- struct net_if * iface = net_if_get_first_wifi ();
2165
+ struct net_if * iface = net_if_get_wifi_sta ();
2174
2166
unsigned int rts_threshold = -1 ; /* Default value if user supplies "off" argument */
2175
2167
int err = 0 ;
2176
2168
@@ -2227,7 +2219,7 @@ static int cmd_wifi_set_rts_threshold(const struct shell *sh, size_t argc, char
2227
2219
static int cmd_wifi_ps_exit_strategy (const struct shell * sh , size_t argc ,
2228
2220
char * argv [])
2229
2221
{
2230
- struct net_if * iface = net_if_get_first_wifi ();
2222
+ struct net_if * iface = net_if_get_wifi_sta ();
2231
2223
struct wifi_ps_params params = { 0 };
2232
2224
2233
2225
context .sh = sh ;
@@ -2328,7 +2320,7 @@ static int cmd_wifi_mode(const struct shell *sh, size_t argc, char *argv[])
2328
2320
* lower layer
2329
2321
*/
2330
2322
if (mode_info .if_index == 0 ) {
2331
- iface = net_if_get_first_wifi ();
2323
+ iface = net_if_get_wifi_sta ();
2332
2324
if (iface == NULL ) {
2333
2325
PR_ERROR ("Cannot find the default wifi interface\n" );
2334
2326
return - ENOEXEC ;
@@ -2417,7 +2409,7 @@ static int cmd_wifi_channel(const struct shell *sh, size_t argc, char *argv[])
2417
2409
*/
2418
2410
2419
2411
if (channel_info .if_index == 0 ) {
2420
- iface = net_if_get_first_wifi ();
2412
+ iface = net_if_get_wifi_sta ();
2421
2413
if (iface == NULL ) {
2422
2414
PR_ERROR ("Cannot find the default wifi interface\n" );
2423
2415
return - ENOEXEC ;
@@ -2531,7 +2523,7 @@ static int cmd_wifi_packet_filter(const struct shell *sh, size_t argc, char *arg
2531
2523
* value to be verified by the lower layer.
2532
2524
*/
2533
2525
if (packet_filter .if_index == 0 ) {
2534
- iface = net_if_get_first_wifi ();
2526
+ iface = net_if_get_wifi_sta ();
2535
2527
if (iface == NULL ) {
2536
2528
PR_ERROR ("Cannot find the default wifi interface\n" );
2537
2529
return - ENOEXEC ;
@@ -2568,7 +2560,7 @@ static int cmd_wifi_packet_filter(const struct shell *sh, size_t argc, char *arg
2568
2560
2569
2561
static int cmd_wifi_version (const struct shell * sh , size_t argc , char * argv [])
2570
2562
{
2571
- struct net_if * iface = net_if_get_first_wifi ();
2563
+ struct net_if * iface = net_if_get_wifi_sta ();
2572
2564
struct wifi_version version = {0 };
2573
2565
2574
2566
if (argc > 1 ) {
@@ -2813,7 +2805,7 @@ static int parse_dpp_args_set_config_param(const struct shell *sh, size_t argc,
2813
2805
2814
2806
static int cmd_wifi_dpp_configurator_add (const struct shell * sh , size_t argc , char * argv [])
2815
2807
{
2816
- struct net_if * iface = net_if_get_first_wifi ();
2808
+ struct net_if * iface = net_if_get_wifi_sta ();
2817
2809
struct wifi_dpp_params params = {0 };
2818
2810
2819
2811
params .action = WIFI_DPP_CONFIGURATOR_ADD ;
@@ -2828,7 +2820,7 @@ static int cmd_wifi_dpp_configurator_add(const struct shell *sh, size_t argc, ch
2828
2820
static int cmd_wifi_dpp_auth_init (const struct shell * sh , size_t argc , char * argv [])
2829
2821
{
2830
2822
int ret ;
2831
- struct net_if * iface = net_if_get_first_wifi ();
2823
+ struct net_if * iface = net_if_get_wifi_sta ();
2832
2824
struct wifi_dpp_params params = {0 };
2833
2825
2834
2826
params .action = WIFI_DPP_AUTH_INIT ;
@@ -2848,7 +2840,7 @@ static int cmd_wifi_dpp_auth_init(const struct shell *sh, size_t argc, char *arg
2848
2840
2849
2841
static int cmd_wifi_dpp_qr_code (const struct shell * sh , size_t argc , char * argv [])
2850
2842
{
2851
- struct net_if * iface = net_if_get_first_wifi ();
2843
+ struct net_if * iface = net_if_get_wifi_sta ();
2852
2844
struct wifi_dpp_params params = {0 };
2853
2845
2854
2846
params .action = WIFI_DPP_QR_CODE ;
@@ -2867,7 +2859,7 @@ static int cmd_wifi_dpp_qr_code(const struct shell *sh, size_t argc, char *argv[
2867
2859
static int cmd_wifi_dpp_chirp (const struct shell * sh , size_t argc , char * argv [])
2868
2860
{
2869
2861
int ret ;
2870
- struct net_if * iface = net_if_get_first_wifi ();
2862
+ struct net_if * iface = net_if_get_wifi_sta ();
2871
2863
struct wifi_dpp_params params = {0 };
2872
2864
2873
2865
params .action = WIFI_DPP_CHIRP ;
@@ -2888,7 +2880,7 @@ static int cmd_wifi_dpp_chirp(const struct shell *sh, size_t argc, char *argv[])
2888
2880
static int cmd_wifi_dpp_listen (const struct shell * sh , size_t argc , char * argv [])
2889
2881
{
2890
2882
int ret ;
2891
- struct net_if * iface = net_if_get_first_wifi ();
2883
+ struct net_if * iface = net_if_get_wifi_sta ();
2892
2884
struct wifi_dpp_params params = {0 };
2893
2885
2894
2886
params .action = WIFI_DPP_LISTEN ;
@@ -2909,7 +2901,7 @@ static int cmd_wifi_dpp_listen(const struct shell *sh, size_t argc, char *argv[]
2909
2901
static int cmd_wifi_dpp_btstrap_gen (const struct shell * sh , size_t argc , char * argv [])
2910
2902
{
2911
2903
int ret ;
2912
- struct net_if * iface = net_if_get_first_wifi ();
2904
+ struct net_if * iface = net_if_get_wifi_sta ();
2913
2905
struct wifi_dpp_params params = {0 };
2914
2906
2915
2907
params .action = WIFI_DPP_BOOTSTRAP_GEN ;
@@ -2930,7 +2922,7 @@ static int cmd_wifi_dpp_btstrap_gen(const struct shell *sh, size_t argc, char *a
2930
2922
static int cmd_wifi_dpp_btstrap_get_uri (const struct shell * sh , size_t argc , char * argv [])
2931
2923
{
2932
2924
int ret = 0 ;
2933
- struct net_if * iface = net_if_get_first_wifi ();
2925
+ struct net_if * iface = net_if_get_wifi_sta ();
2934
2926
struct wifi_dpp_params params = {0 };
2935
2927
2936
2928
params .action = WIFI_DPP_BOOTSTRAP_GET_URI ;
@@ -2954,7 +2946,7 @@ static int cmd_wifi_dpp_btstrap_get_uri(const struct shell *sh, size_t argc, cha
2954
2946
static int cmd_wifi_dpp_configurator_set (const struct shell * sh , size_t argc , char * argv [])
2955
2947
{
2956
2948
int ret ;
2957
- struct net_if * iface = net_if_get_first_wifi ();
2949
+ struct net_if * iface = net_if_get_wifi_sta ();
2958
2950
struct wifi_dpp_params params = {0 };
2959
2951
2960
2952
params .action = WIFI_DPP_SET_CONF_PARAM ;
@@ -2975,7 +2967,7 @@ static int cmd_wifi_dpp_configurator_set(const struct shell *sh, size_t argc, ch
2975
2967
static int cmd_wifi_dpp_resp_timeout_set (const struct shell * sh , size_t argc , char * argv [])
2976
2968
{
2977
2969
int ret = 0 ;
2978
- struct net_if * iface = net_if_get_first_wifi ();
2970
+ struct net_if * iface = net_if_get_wifi_sta ();
2979
2971
struct wifi_dpp_params params = {0 };
2980
2972
2981
2973
params .action = WIFI_DPP_SET_WAIT_RESP_TIME ;
0 commit comments