wl12xx: Add AP related configuration to conf_drv_settings
authorArik Nemtsov <arik@wizery.com>
Sat, 16 Oct 2010 15:44:51 +0000 (17:44 +0200)
committerLuciano Coelho <coelho@ti.com>
Mon, 24 Jan 2011 20:11:46 +0000 (22:11 +0200)
Rate class configuration has been split up for AP and STA modes.
Template related configuration likewise separated.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/acx.c
drivers/net/wireless/wl12xx/cmd.c
drivers/net/wireless/wl12xx/conf.h
drivers/net/wireless/wl12xx/main.c

index 17f6a63fbdea8f95b1d8b527f53c46cbff3c1e34..d6885d7c4256305f35875af1fc1868c16356e359 100644 (file)
@@ -754,7 +754,7 @@ int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats)
 int wl1271_acx_rate_policies(struct wl1271 *wl)
 {
        struct acx_rate_policy *acx;
-       struct conf_tx_rate_class *c = &wl->conf.tx.rc_conf;
+       struct conf_tx_rate_class *c = &wl->conf.tx.sta_rc_conf;
        int idx = 0;
        int ret = 0;
 
index 52a6bcd5c309fd31d5dd730a69fad8c42dfeb598..3b7b8f0a200b6e2dfb37af695e2326a6bc5ab762 100644 (file)
@@ -490,8 +490,8 @@ int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
        cmd->len = cpu_to_le16(buf_len);
        cmd->template_type = template_id;
        cmd->enabled_rates = cpu_to_le32(rates);
-       cmd->short_retry_limit = wl->conf.tx.rc_conf.short_retry_limit;
-       cmd->long_retry_limit = wl->conf.tx.rc_conf.long_retry_limit;
+       cmd->short_retry_limit = wl->conf.tx.tmpl_short_retry_limit;
+       cmd->long_retry_limit = wl->conf.tx.tmpl_long_retry_limit;
        cmd->index = index;
 
        if (buf)
index a16b3616e4308fa95a1ebe37419e46a97db12a63..7563ce3a9f66ee6eb130f52787b7d3c98d5e2c97 100644 (file)
@@ -496,6 +496,26 @@ struct conf_rx_settings {
                                        CONF_HW_BIT_RATE_2MBPS)
 #define CONF_TX_RATE_RETRY_LIMIT       10
 
+/*
+ * Rates supported for data packets when operating as AP. Note the absense
+ * of the 22Mbps rate. There is a FW limitation on 12 rates so we must drop
+ * one. The rate dropped is not mandatory under any operating mode.
+ */
+#define CONF_TX_AP_ENABLED_RATES       (CONF_HW_BIT_RATE_1MBPS | \
+       CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS |      \
+       CONF_HW_BIT_RATE_6MBPS | CONF_HW_BIT_RATE_9MBPS |        \
+       CONF_HW_BIT_RATE_11MBPS | CONF_HW_BIT_RATE_12MBPS |      \
+       CONF_HW_BIT_RATE_18MBPS | CONF_HW_BIT_RATE_24MBPS |      \
+       CONF_HW_BIT_RATE_36MBPS | CONF_HW_BIT_RATE_48MBPS |      \
+       CONF_HW_BIT_RATE_54MBPS)
+
+/*
+ * Default rates for management traffic when operating in AP mode. This
+ * should be configured according to the basic rate set of the AP
+ */
+#define CONF_TX_AP_DEFAULT_MGMT_RATES  (CONF_HW_BIT_RATE_1MBPS | \
+       CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS)
+
 struct conf_tx_rate_class {
 
        /*
@@ -636,9 +656,9 @@ struct conf_tx_settings {
 
        /*
         * Configuration for rate classes for TX (currently only one
-        * rate class supported.)
+        * rate class supported). Used in non-AP mode.
         */
-       struct conf_tx_rate_class rc_conf;
+       struct conf_tx_rate_class sta_rc_conf;
 
        /*
         * Configuration for access categories for TX rate control.
@@ -646,6 +666,22 @@ struct conf_tx_settings {
        u8 ac_conf_count;
        struct conf_tx_ac_category ac_conf[CONF_TX_MAX_AC_COUNT];
 
+       /*
+        * Configuration for rate classes in AP-mode. These rate classes
+        * are for the AC TX queues
+        */
+       struct conf_tx_rate_class ap_rc_conf[CONF_TX_MAX_AC_COUNT];
+
+       /*
+        * Management TX rate class for AP-mode.
+        */
+       struct conf_tx_rate_class ap_mgmt_conf;
+
+       /*
+        * Broadcast TX rate class for AP-mode.
+        */
+       struct conf_tx_rate_class ap_bcst_conf;
+
        /*
         * Configuration for TID parameters.
         */
@@ -687,6 +723,12 @@ struct conf_tx_settings {
         * Range: CONF_HW_BIT_RATE_* bit mask
         */
        u32 basic_rate_5;
+
+       /*
+        * TX retry limits for templates
+        */
+       u8 tmpl_short_retry_limit;
+       u8 tmpl_long_retry_limit;
 };
 
 enum {
index 062247ef3ad2742378c7993649eef5780842c665..788959a5f0de2471124d64787c01245261216754 100644 (file)
@@ -116,11 +116,11 @@ static struct conf_drv_settings default_conf = {
        },
        .tx = {
                .tx_energy_detection         = 0,
-               .rc_conf                     = {
+               .sta_rc_conf                 = {
                        .enabled_rates       = 0,
                        .short_retry_limit   = 10,
                        .long_retry_limit    = 10,
-                       .aflags              = 0
+                       .aflags              = 0,
                },
                .ac_conf_count               = 4,
                .ac_conf                     = {
@@ -153,6 +153,45 @@ static struct conf_drv_settings default_conf = {
                                .tx_op_limit = 1504,
                        },
                },
+               .ap_rc_conf                  = {
+                       [0] = {
+                               .enabled_rates = CONF_TX_AP_ENABLED_RATES,
+                               .short_retry_limit = 10,
+                               .long_retry_limit = 10,
+                               .aflags      = 0,
+                       },
+                       [1] = {
+                               .enabled_rates = CONF_TX_AP_ENABLED_RATES,
+                               .short_retry_limit = 10,
+                               .long_retry_limit = 10,
+                               .aflags      = 0,
+                       },
+                       [2] = {
+                               .enabled_rates = CONF_TX_AP_ENABLED_RATES,
+                               .short_retry_limit = 10,
+                               .long_retry_limit = 10,
+                               .aflags      = 0,
+                       },
+                       [3] = {
+                               .enabled_rates = CONF_TX_AP_ENABLED_RATES,
+                               .short_retry_limit = 10,
+                               .long_retry_limit = 10,
+                               .aflags      = 0,
+                       },
+               },
+               .ap_mgmt_conf = {
+                       .enabled_rates       = CONF_TX_AP_DEFAULT_MGMT_RATES,
+                       .short_retry_limit   = 10,
+                       .long_retry_limit    = 10,
+                       .aflags              = 0,
+               },
+               .ap_bcst_conf = {
+                       .enabled_rates       = CONF_HW_BIT_RATE_1MBPS,
+                       .short_retry_limit   = 10,
+                       .long_retry_limit    = 10,
+                       .aflags              = 0,
+               },
+
                .tid_conf_count = 4,
                .tid_conf = {
                        [CONF_TX_AC_BE] = {
@@ -193,6 +232,8 @@ static struct conf_drv_settings default_conf = {
                .tx_compl_threshold          = 4,
                .basic_rate                  = CONF_HW_BIT_RATE_1MBPS,
                .basic_rate_5                = CONF_HW_BIT_RATE_6MBPS,
+               .tmpl_short_retry_limit      = 10,
+               .tmpl_long_retry_limit       = 10,
        },
        .conn = {
                .wake_up_event               = CONF_WAKE_UP_EVENT_DTIM,