lib: add IWINFO_BAND_COUNT and IWINFO_BAND_NAMES
[project/iwinfo.git] / include / iwinfo.h
index 576632d7cce2d5dbac1c7e9c0fdceab59e1318c3..fee665cc5266baf273c08c6332a9baaae3052621 100644 (file)
@@ -35,6 +35,7 @@
 #define IWINFO_BAND_5        (1 << 1)
 #define IWINFO_BAND_6        (1 << 2)
 #define IWINFO_BAND_60       (1 << 3)
+#define IWINFO_BAND_COUNT    4
 
 #define IWINFO_CIPHER_NONE    (1 << 0)
 #define IWINFO_CIPHER_WEP40   (1 << 1)
 #define IWINFO_FREQ_NO_HT40MINUS       (1 << 3)
 #define IWINFO_FREQ_NO_80MHZ           (1 << 4)
 #define IWINFO_FREQ_NO_160MHZ          (1 << 5)
-#define IWINFO_FREQ_NO_2160MHZ         (1 << 6)
+#define IWINFO_FREQ_NO_HE              (1 << 6)
 
-extern const char *IWINFO_CIPHER_NAMES[IWINFO_CIPHER_COUNT];
-extern const char *IWINFO_KMGMT_NAMES[IWINFO_KMGMT_COUNT];
-extern const char *IWINFO_AUTH_NAMES[IWINFO_AUTH_COUNT];
+extern const char * const IWINFO_BAND_NAMES[IWINFO_BAND_COUNT];
+extern const char * const IWINFO_CIPHER_NAMES[IWINFO_CIPHER_COUNT];
+extern const char * const IWINFO_KMGMT_NAMES[IWINFO_KMGMT_COUNT];
+extern const char * const IWINFO_AUTH_NAMES[IWINFO_AUTH_COUNT];
 
 
 enum iwinfo_opmode {
@@ -84,9 +86,11 @@ enum iwinfo_opmode {
        IWINFO_OPMODE_MESHPOINT  = 7,
        IWINFO_OPMODE_P2P_CLIENT = 8,
        IWINFO_OPMODE_P2P_GO     = 9,
+
+       IWINFO_OPMODE_COUNT      = 10,
 };
 
-extern const char *IWINFO_OPMODE_NAMES[];
+extern const char * const IWINFO_OPMODE_NAMES[IWINFO_OPMODE_COUNT];
 
 
 enum iwinfo_htmode {
@@ -107,7 +111,7 @@ enum iwinfo_htmode {
        IWINFO_HTMODE_COUNT      = 13
 };
 
-extern const char *IWINFO_HTMODE_NAMES[IWINFO_HTMODE_COUNT];
+extern const char * const IWINFO_HTMODE_NAMES[IWINFO_HTMODE_COUNT];
 
 
 struct iwinfo_rate_entry {
@@ -199,25 +203,15 @@ struct iwinfo_scanlist_vht_chan_entry {
        uint8_t center_chan_2;
 };
 
-static const char *ht_secondary_offset[4] = {
-       "no secondary",
-       "above",
-       "[reserved!]",
-       "below",
-};
-
-
-static uint16_t ht_chan_width[2] = {
-       20, /* 20 MHz */
-       2040, /* 40 MHz or higher (refer to vht if supported) */
-};
-
-static uint16_t vht_chan_width[] = {
-       [0] = 40, /* 40 MHz or lower (refer to ht to a more precise width) */
-       [1] = 80, /* 80 MHz */
-       [3] = 8080, /* 80+80 MHz */
-       [2] = 160, /* 160 MHz */
-};
+extern const char * const ht_secondary_offset[4];
+/* 0 = 20 MHz
+   1 = 40 MHz or higher (refer to vht if supported) */
+extern const uint16_t ht_chan_width[2];
+/* 0 = 40 MHz or lower (refer to ht to a more precise width)
+   1 = 80 MHz
+   2 = 160 MHz
+   3 = 80+80 MHz */
+extern const uint16_t vht_chan_width[4];
 
 struct iwinfo_scanlist_entry {
        uint8_t mac[6];
@@ -239,7 +233,7 @@ struct iwinfo_country_entry {
 
 struct iwinfo_iso3166_label {
        uint16_t iso3166;
-       char name[28];
+       const char name[28];
 };
 
 struct iwinfo_hardware_id {