@@ -65,6 +65,7 @@ static struct {
65
65
static uint32_t scan_result ;
66
66
67
67
static struct net_mgmt_event_callback wifi_shell_mgmt_cb ;
68
+ static struct wifi_reg_chan_info chan_info [MAX_REG_CHAN_NUM ];
68
69
69
70
static K_MUTEX_DEFINE (wifi_ap_sta_list_lock );
70
71
struct wifi_ap_sta_node {
@@ -135,7 +136,6 @@ static void handle_wifi_scan_result(struct net_mgmt_event_callback *cb)
135
136
wifi_mfp_txt (entry -> mfp ));
136
137
}
137
138
138
- #ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
139
139
static int wifi_freq_to_channel (int frequency )
140
140
{
141
141
int channel = 0 ;
@@ -157,6 +157,7 @@ static int wifi_freq_to_channel(int frequency)
157
157
return channel ;
158
158
}
159
159
160
+ #ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
160
161
static enum wifi_frequency_bands wifi_freq_to_band (int frequency )
161
162
{
162
163
enum wifi_frequency_bands band = WIFI_FREQ_BAND_2_4_GHZ ;
@@ -1295,9 +1296,10 @@ static int cmd_wifi_reg_domain(const struct shell *sh, size_t argc,
1295
1296
{
1296
1297
struct net_if * iface = net_if_get_first_wifi ();
1297
1298
struct wifi_reg_domain regd = {0 };
1298
- int ret ;
1299
+ int ret , chan_idx = 0 ;
1299
1300
1300
1301
if (argc == 1 ) {
1302
+ (& regd )-> chan_info = & chan_info [0 ];
1301
1303
regd .oper = WIFI_MGMT_GET ;
1302
1304
} else if (argc >= 2 && argc <= 3 ) {
1303
1305
regd .oper = WIFI_MGMT_SET ;
@@ -1342,6 +1344,19 @@ static int cmd_wifi_reg_domain(const struct shell *sh, size_t argc,
1342
1344
if (regd .oper == WIFI_MGMT_GET ) {
1343
1345
shell_fprintf (sh , SHELL_NORMAL , "Wi-Fi Regulatory domain is: %c%c\n" ,
1344
1346
regd .country_code [0 ], regd .country_code [1 ]);
1347
+ shell_fprintf (sh , SHELL_NORMAL ,
1348
+ "<channel>\t<center frequency>\t<supported(y/n)>\t"
1349
+ "<max power(dBm)>\t<passive scan supported(y/n)>\t<dfs supported(y/n)>\n" );
1350
+ for (chan_idx = 0 ; chan_idx < regd .num_channels ; chan_idx ++ ) {
1351
+ shell_fprintf (sh , SHELL_NORMAL ,
1352
+ " %d\t\t\t\%d\t\t\t\%s\t\t\t%d\t\t\t%s\t\t\t\t%s\n" ,
1353
+ wifi_freq_to_channel (chan_info [chan_idx ].center_frequency ),
1354
+ chan_info [chan_idx ].center_frequency ,
1355
+ chan_info [chan_idx ].supported ? "y" : "n" ,
1356
+ chan_info [chan_idx ].max_power ,
1357
+ chan_info [chan_idx ].passive_only ? "y" : "n" ,
1358
+ chan_info [chan_idx ].dfs ? "y" : "n" );
1359
+ }
1345
1360
} else {
1346
1361
shell_fprintf (sh , SHELL_NORMAL , "Wi-Fi Regulatory domain set to: %c%c\n" ,
1347
1362
regd .country_code [0 ], regd .country_code [1 ]);
0 commit comments