summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/iwinfo/utils.h3
-rw-r--r--iwinfo_utils.c42
2 files changed, 45 insertions, 0 deletions
diff --git a/include/iwinfo/utils.h b/include/iwinfo/utils.h
index 6fe5785..e9b8f1d 100644
--- a/include/iwinfo/utils.h
+++ b/include/iwinfo/utils.h
@@ -44,6 +44,9 @@ static inline int iwinfo_mbm2dbm(int gain)
}
size_t iwinfo_format_hwmodes(int modes, char *buf, size_t len);
+int iwinfo_htmode_is_ht(int htmode);
+int iwinfo_htmode_is_vht(int htmode);
+int iwinfo_htmode_is_he(int htmode);
int iwinfo_ifup(const char *ifname);
int iwinfo_ifdown(const char *ifname);
diff --git a/iwinfo_utils.c b/iwinfo_utils.c
index 63ae78c..c7713ed 100644
--- a/iwinfo_utils.c
+++ b/iwinfo_utils.c
@@ -102,6 +102,48 @@ size_t iwinfo_format_hwmodes(int modes, char *buf, size_t len)
return res;
}
+int iwinfo_htmode_is_ht(int htmode)
+{
+ switch (htmode)
+ {
+ case IWINFO_HTMODE_HT20:
+ case IWINFO_HTMODE_HT40:
+ return 1;
+ }
+
+ return 0;
+}
+
+int iwinfo_htmode_is_vht(int htmode)
+{
+ switch (htmode)
+ {
+ case IWINFO_HTMODE_VHT20:
+ case IWINFO_HTMODE_VHT40:
+ case IWINFO_HTMODE_VHT80:
+ case IWINFO_HTMODE_VHT80_80:
+ case IWINFO_HTMODE_VHT160:
+ return 1;
+ }
+
+ return 0;
+}
+
+int iwinfo_htmode_is_he(int htmode)
+{
+ switch (htmode)
+ {
+ case IWINFO_HTMODE_HE20:
+ case IWINFO_HTMODE_HE40:
+ case IWINFO_HTMODE_HE80:
+ case IWINFO_HTMODE_HE80_80:
+ case IWINFO_HTMODE_HE160:
+ return 1;
+ }
+
+ return 0;
+}
+
int iwinfo_ifup(const char *ifname)
{
struct ifreq ifr;