wl18xx: increase MAX_CHANNELS_5GHZ
authorEliad Peller <eliad@wizery.com>
Thu, 22 Nov 2012 16:06:16 +0000 (18:06 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 27 Nov 2012 08:49:27 +0000 (10:49 +0200)
Some regdomains have more than 23 valid 5ghz channels,
so 18xx's MAX_CHANNELS_5GHZ was increased to 32.

Since now we have different max 5ghz channels values
for wl12xx and wl18xx, add a new wl->max_channels_5ghz
field, and use it for scan channels configuration.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/ti/wl12xx/main.c
drivers/net/wireless/ti/wl12xx/scan.h
drivers/net/wireless/ti/wl18xx/main.c
drivers/net/wireless/ti/wl18xx/scan.h
drivers/net/wireless/ti/wlcore/scan.c
drivers/net/wireless/ti/wlcore/scan.h
drivers/net/wireless/ti/wlcore/wlcore.h

index ada7031777cc3b3dccb1006e1fc308157157a8e8..0c81eeb4f5b80954fc9b79171215826bde0383d1 100644 (file)
@@ -704,6 +704,7 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
        wl->scan_templ_id_5 = CMD_TEMPL_APP_PROBE_REQ_5_LEGACY;
        wl->sched_scan_templ_id_2_4 = CMD_TEMPL_CFG_PROBE_REQ_2_4;
        wl->sched_scan_templ_id_5 = CMD_TEMPL_CFG_PROBE_REQ_5;
+       wl->max_channels_5 = WL12XX_MAX_CHANNELS_5GHZ;
 out:
        return ret;
 }
index bd075dec59464d56ad28bdb4e2debcb0c1856280..264af7ac27854721c372379c4b59cd2248facac6 100644 (file)
@@ -26,6 +26,8 @@
 #include "../wlcore/cmd.h"
 #include "../wlcore/scan.h"
 
+#define WL12XX_MAX_CHANNELS_5GHZ 23
+
 struct basic_scan_params {
        /* Scan option flags (WL1271_SCAN_OPT_*) */
        __le16 scan_options;
@@ -107,7 +109,7 @@ struct wl1271_cmd_sched_scan_config {
        u8 role_id;
        u8 padding[1];
        struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
-       struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ];
+       struct conn_scan_ch_params channels_5[WL12XX_MAX_CHANNELS_5GHZ];
        struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
 } __packed;
 
index 97c23c8dd5e9432e3ce5accfe6521d0a1471fc67..e81b3518d288a989b2985d0f09628ca73d8574b6 100644 (file)
@@ -636,6 +636,7 @@ static int wl18xx_identify_chip(struct wl1271 *wl)
        wl->scan_templ_id_5 = CMD_TEMPL_CFG_PROBE_REQ_5;
        wl->sched_scan_templ_id_2_4 = CMD_TEMPL_PROBE_REQ_2_4_PERIODIC;
        wl->sched_scan_templ_id_5 = CMD_TEMPL_PROBE_REQ_5_PERIODIC;
+       wl->max_channels_5 = WL18XX_MAX_CHANNELS_5GHZ;
 out:
        return ret;
 }
index 404baf17aa28cfdef673944504bd7d5689e0cffc..0e026ecb311ebf74983e31b6a3657676ef053108 100644 (file)
@@ -50,6 +50,8 @@ enum
        WL18XX_SCAN_RATE_6      = 2,
 };
 
+#define WL18XX_MAX_CHANNELS_5GHZ 32
+
 struct wl18xx_cmd_scan_params {
        struct wl1271_cmd_header header;
 
@@ -89,7 +91,7 @@ struct wl18xx_cmd_scan_params {
        union {
                struct {
                        struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
-                       struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ];
+                       struct conn_scan_ch_params channels_5[WL18XX_MAX_CHANNELS_5GHZ];
                        struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
                };
                struct tracking_ch_params channels_tracking[WL1271_SCAN_MAX_CHANNELS];
index 9eab64d1679bfc9ec638a9573c78dc42b9aac7f7..e7d0a02be5b06beb6e9eb356cf523d4a06981990 100644 (file)
@@ -228,7 +228,7 @@ wlcore_set_scan_chan_params(struct wl1271 *wl,
                                         cfg->channels_5,
                                         IEEE80211_BAND_5GHZ,
                                         false, true, 0,
-                                        MAX_CHANNELS_5GHZ,
+                                        wl->max_channels_5,
                                         &n_pactive_ch);
        cfg->dfs =
                wlcore_scan_get_channels(wl,
@@ -239,7 +239,7 @@ wlcore_set_scan_chan_params(struct wl1271 *wl,
                                         IEEE80211_BAND_5GHZ,
                                         true, true,
                                         cfg->passive[1],
-                                        MAX_CHANNELS_5GHZ,
+                                        wl->max_channels_5,
                                         &n_pactive_ch);
        cfg->active[1] =
                wlcore_scan_get_channels(wl,
@@ -250,7 +250,7 @@ wlcore_set_scan_chan_params(struct wl1271 *wl,
                                         IEEE80211_BAND_5GHZ,
                                         false, false,
                                         cfg->passive[1] + cfg->dfs,
-                                        MAX_CHANNELS_5GHZ,
+                                        wl->max_channels_5,
                                         &n_pactive_ch);
 
        /* 802.11j channels are not supported yet */
index 25b0422ec98953a5059bb2115072c649e4c9c3f9..8465f35c6a0658ce0cfb460dcb174f517578e91b 100644 (file)
@@ -71,9 +71,17 @@ struct wl1271_cmd_trigger_scan_to {
 } __packed;
 
 #define MAX_CHANNELS_2GHZ      14
-#define MAX_CHANNELS_5GHZ      23
 #define MAX_CHANNELS_4GHZ      4
 
+/*
+ * This max value here is used only for the struct definition of
+ * wlcore_scan_channels. This struct is used by both 12xx
+ * and 18xx (which have different max 5ghz channels value).
+ * In order to make sure this is large enough, just use the
+ * max possible 5ghz channels.
+ */
+#define MAX_CHANNELS_5GHZ      42
+
 #define SCAN_MAX_CYCLE_INTERVALS 16
 #define SCAN_MAX_BANDS 3
 
index 9f82ee3a4a3ab631863dfd601349314ee040c039..36fde4e01969fc5dea6f9a58a9c3cc6f024a05e5 100644 (file)
@@ -382,6 +382,7 @@ struct wl1271 {
        u8 scan_templ_id_5;
        u8 sched_scan_templ_id_2_4;
        u8 sched_scan_templ_id_5;
+       u8 max_channels_5;
 
        /* per-chip-family private structure */
        void *priv;