wifi: properly display ad-hoc networks
Patch status: merged
Patch by Adrien Schildknecht
Long description:
No statistics are displayed with ad-hoc networks since none are available.
To apply this patch, use:
curl http://cr.i3wm.org/patch/10/raw.patch | git am
b/src/print_wireless_info.c
| 14 |
@@ -93,6 +93,15 @@ static int get_wireless_info(const char *interface, wireless_info_t *info) {
|
| 15 |
info->essid[IW_ESSID_MAX_SIZE] = '\0'; |
| 16 |
} |
| 17 |
|
| 18 |
+ /* If the function iw_get_stats does not return proper stats, the |
| 19 |
+ wifi is considered as down. |
| 20 |
+ Since ad-hoc network does not have theses stats, we need to return |
| 21 |
+ here for this mode. */ |
| 22 |
+ if (wcfg.mode == 1) {
|
| 23 |
+ close(skfd); |
| 24 |
+ return 1; |
| 25 |
+ } |
| 26 |
+ |
| 27 |
/* Wireless quality is a relative value in a driver-specific range. |
| 28 |
Signal and noise level can be either relative or absolute values |
| 29 |
in dBm. Furthermore, noise and quality can be expressed directly |