Skip to content
Snippets Groups Projects
Commit 7fb3d9d2 authored by Erik Karlsson's avatar Erik Karlsson
Browse files

iwinfo: add missing band and mhz properties for libwifi backend

Missing band and mhz properties for scanlist and missing band property
for freqlist are added.
parent 41b8691b
No related branches found
No related tags found
1 merge request!568iwinfo: do not restrict DFS channels and add missing band and mhz properties
......@@ -142,6 +142,21 @@ static int phy_to_netdev(const char *phy, char *netdev, size_t size)
return ret;
}
static uint8_t band_libwifi_to_iwinfo(enum wifi_band band)
{
switch (band) {
case BAND_2:
return IWINFO_BAND_24;
case BAND_5:
return IWINFO_BAND_5;
case BAND_60:
return IWINFO_BAND_60;
case BAND_6:
return IWINFO_BAND_6;
default:
return 0;
}
}
static int esl_probe(const char *ifname)
{
......@@ -614,12 +629,15 @@ static int esl_get_scanlist(const char *ifname, char *buf, int *len)
struct wifi_bss *b = &bsss[i];
struct iwinfo_scanlist_entry *e =
(struct iwinfo_scanlist_entry *)&buf[i*sizeof(struct iwinfo_scanlist_entry)];
int freq = wifi_channel_to_freq_ex(b->channel, b->band);
memset(e, 0, sizeof(*e));
memcpy(e->mac, b->bssid, 6);
memcpy(e->ssid, b->ssid, IWINFO_ESSID_MAX_SIZE);
e->mode = IWINFO_OPMODE_MASTER; //FIXME
e->band = band_libwifi_to_iwinfo(b->band);
e->channel = b->channel;
e->mhz = freq > 0 ? freq : 0;
e->signal = b->rssi + 0x100;
e->quality = b->rssi + 110;
e->quality_max = 70;
......@@ -700,6 +718,7 @@ static int esl_get_freqlist(const char *ifname, char *buf, int *len)
(struct iwinfo_freqlist_entry *)&buf[i*sizeof(struct iwinfo_freqlist_entry)];
memset(e, 0, sizeof(*e));
e->band = band_libwifi_to_iwinfo(ch[i].band);
e->channel = ch[i].channel;
e->mhz = ch[i].freq;
e->restricted = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment