]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
wl12xx: AP mode - AP specific CMD_CONFIGURE sub-commands
authorArik Nemtsov <arik@wizery.com>
Sat, 16 Oct 2010 15:52:59 +0000 (17:52 +0200)
committerLuciano Coelho <coelho@ti.com>
Mon, 24 Jan 2011 20:11:46 +0000 (22:11 +0200)
Add AP max retries and rate policy configuration.
Rename STA rate policy configuration function.

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/acx.h
drivers/net/wireless/wl12xx/conf.h
drivers/net/wireless/wl12xx/init.c
drivers/net/wireless/wl12xx/main.c
drivers/net/wireless/wl12xx/tx.c

index d6885d7c4256305f35875af1fc1868c16356e359..646d278bd9440e000c57dd7128482b90139e1306 100644 (file)
@@ -751,9 +751,9 @@ int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats)
        return 0;
 }
 
-int wl1271_acx_rate_policies(struct wl1271 *wl)
+int wl1271_acx_sta_rate_policies(struct wl1271 *wl)
 {
-       struct acx_rate_policy *acx;
+       struct acx_sta_rate_policy *acx;
        struct conf_tx_rate_class *c = &wl->conf.tx.sta_rc_conf;
        int idx = 0;
        int ret = 0;
@@ -794,6 +794,38 @@ out:
        return ret;
 }
 
+int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c,
+                     u8 idx)
+{
+       struct acx_ap_rate_policy *acx;
+       int ret = 0;
+
+       wl1271_debug(DEBUG_ACX, "acx ap rate policy");
+
+       acx = kzalloc(sizeof(*acx), GFP_KERNEL);
+       if (!acx) {
+               ret = -ENOMEM;
+               goto out;
+       }
+
+       acx->rate_policy.enabled_rates = cpu_to_le32(c->enabled_rates);
+       acx->rate_policy.short_retry_limit = c->short_retry_limit;
+       acx->rate_policy.long_retry_limit = c->long_retry_limit;
+       acx->rate_policy.aflags = c->aflags;
+
+       acx->rate_policy_idx = idx;
+
+       ret = wl1271_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx));
+       if (ret < 0) {
+               wl1271_warning("Setting of ap rate policy failed: %d", ret);
+               goto out;
+       }
+
+out:
+       kfree(acx);
+       return ret;
+}
+
 int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max,
                      u8 aifsn, u16 txop)
 {
@@ -1335,3 +1367,27 @@ out:
        kfree(tsf_info);
        return ret;
 }
+
+int wl1271_acx_max_tx_retry(struct wl1271 *wl)
+{
+       struct wl1271_acx_max_tx_retry *acx = NULL;
+       int ret;
+
+       wl1271_debug(DEBUG_ACX, "acx max tx retry");
+
+       acx = kzalloc(sizeof(*acx), GFP_KERNEL);
+       if (!acx)
+               return -ENOMEM;
+
+       acx->max_tx_retry = cpu_to_le16(wl->conf.tx.ap_max_tx_retries);
+
+       ret = wl1271_cmd_configure(wl, ACX_MAX_TX_FAILURE, acx, sizeof(*acx));
+       if (ret < 0) {
+               wl1271_warning("acx max tx retry failed: %d", ret);
+               goto out;
+       }
+
+out:
+       kfree(acx);
+       return ret;
+}
index 7bd8e4db4a71368f0fb756888124b9d28ea6a68c..62a269d84ebe4bc183d3c1b198b629e1f8c09999 100644 (file)
@@ -747,13 +747,23 @@ struct acx_rate_class {
 #define ACX_TX_BASIC_RATE      0
 #define ACX_TX_AP_FULL_RATE    1
 #define ACX_TX_RATE_POLICY_CNT 2
-struct acx_rate_policy {
+struct acx_sta_rate_policy {
        struct acx_header header;
 
        __le32 rate_class_cnt;
        struct acx_rate_class rate_class[CONF_TX_MAX_RATE_CLASSES];
 } __packed;
 
+
+#define ACX_TX_AP_MODE_MGMT_RATE 4
+#define ACX_TX_AP_MODE_BCST_RATE 5
+struct acx_ap_rate_policy {
+       struct acx_header header;
+
+       __le32 rate_policy_idx;
+       struct acx_rate_class rate_policy;
+} __packed;
+
 struct acx_ac_cfg {
        struct acx_header header;
        u8 ac;
@@ -1062,6 +1072,17 @@ struct wl1271_acx_fw_tsf_information {
        u8 padding[3];
 } __packed;
 
+struct wl1271_acx_max_tx_retry {
+       struct acx_header header;
+
+       /*
+        * the number of frames transmission failures before
+        * issuing the aging event.
+        */
+       __le16 max_tx_retry;
+       u8 padding_1[2];
+} __packed;
+
 enum {
        ACX_WAKE_UP_CONDITIONS      = 0x0002,
        ACX_MEM_CFG                 = 0x0003,
@@ -1119,6 +1140,7 @@ enum {
        ACX_HT_BSS_OPERATION        = 0x0058,
        ACX_COEX_ACTIVITY           = 0x0059,
        ACX_SET_DCO_ITRIM_PARAMS    = 0x0061,
+       ACX_MAX_TX_FAILURE          = 0x0072,
        DOT11_RX_MSDU_LIFE_TIME     = 0x1004,
        DOT11_CUR_TX_PWR            = 0x100D,
        DOT11_RX_DOT11_MODE         = 0x1012,
@@ -1160,7 +1182,9 @@ int wl1271_acx_set_preamble(struct wl1271 *wl, enum acx_preamble_type preamble);
 int wl1271_acx_cts_protect(struct wl1271 *wl,
                           enum acx_ctsprotect_type ctsprotect);
 int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats);
-int wl1271_acx_rate_policies(struct wl1271 *wl);
+int wl1271_acx_sta_rate_policies(struct wl1271 *wl);
+int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c,
+                     u8 idx);
 int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max,
                      u8 aifsn, u16 txop);
 int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type,
@@ -1186,5 +1210,6 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
 int wl1271_acx_set_ht_information(struct wl1271 *wl,
                                   u16 ht_operation_mode);
 int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime);
+int wl1271_acx_max_tx_retry(struct wl1271 *wl);
 
 #endif /* __WL1271_ACX_H__ */
index 7563ce3a9f66ee6eb130f52787b7d3c98d5e2c97..f5c048c9bea45ee17010e4543a3a986ef0c38ce1 100644 (file)
@@ -682,6 +682,12 @@ struct conf_tx_settings {
         */
        struct conf_tx_rate_class ap_bcst_conf;
 
+       /*
+        * AP-mode - allow this number of TX retries to a station before an
+        * event is triggered from FW.
+        */
+       u16 ap_max_tx_retries;
+
        /*
         * Configuration for TID parameters.
         */
index 785a5304bfc4435c592791589b19b504978b32dc..f468d7178a9fab98ae14d58083688bdcad99a157 100644 (file)
@@ -322,7 +322,7 @@ int wl1271_hw_init(struct wl1271 *wl)
        }
 
        /* Configure TX rate classes */
-       ret = wl1271_acx_rate_policies(wl);
+       ret = wl1271_acx_sta_rate_policies(wl);
        if (ret < 0)
                goto out_free_memmap;
 
index 788959a5f0de2471124d64787c01245261216754..b40568e89eb40426a144e285f4154183eb299040 100644 (file)
@@ -191,7 +191,7 @@ static struct conf_drv_settings default_conf = {
                        .long_retry_limit    = 10,
                        .aflags              = 0,
                },
-
+               .ap_max_tx_retries = 100,
                .tid_conf_count = 4,
                .tid_conf = {
                        [CONF_TX_AC_BE] = {
@@ -1393,7 +1393,7 @@ static int wl1271_handle_idle(struct wl1271 *wl, bool idle)
                }
                wl->rate_set = wl1271_min_rate_get(wl);
                wl->sta_rate_set = 0;
-               ret = wl1271_acx_rate_policies(wl);
+               ret = wl1271_acx_sta_rate_policies(wl);
                if (ret < 0)
                        goto out;
                ret = wl1271_acx_keep_alive_config(
@@ -1468,7 +1468,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
                        wl1271_set_band_rate(wl);
 
                wl->basic_rate = wl1271_min_rate_get(wl);
-               ret = wl1271_acx_rate_policies(wl);
+               ret = wl1271_acx_sta_rate_policies(wl);
                if (ret < 0)
                        wl1271_warning("rate policy for update channel "
                                       "failed %d", ret);
@@ -2017,7 +2017,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
                        wl->basic_rate_set = wl1271_tx_enabled_rates_get(wl,
                                                                         rates);
                        wl->basic_rate = wl1271_min_rate_get(wl);
-                       ret = wl1271_acx_rate_policies(wl);
+                       ret = wl1271_acx_sta_rate_policies(wl);
                        if (ret < 0)
                                goto out_sleep;
 
@@ -2071,7 +2071,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
                        /* revert back to minimum rates for the current band */
                        wl1271_set_band_rate(wl);
                        wl->basic_rate = wl1271_min_rate_get(wl);
-                       ret = wl1271_acx_rate_policies(wl);
+                       ret = wl1271_acx_sta_rate_policies(wl);
                        if (ret < 0)
                                goto out_sleep;
 
index b44c75cd8c1e714d8e4f2cf83c8099475fca795b..0cf210d6aa46ecb3331cea8ff1b7fb2487b3fbdf 100644 (file)
@@ -303,7 +303,7 @@ void wl1271_tx_work_locked(struct wl1271 *wl)
                woken_up = true;
 
                wl->rate_set = wl1271_tx_enabled_rates_get(wl, sta_rates);
-               wl1271_acx_rate_policies(wl);
+               wl1271_acx_sta_rate_policies(wl);
        }
 
        while ((skb = wl1271_skb_dequeue(wl))) {