]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/wl12xx/wl1271_acx.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke...
[mv-sheeva.git] / drivers / net / wireless / wl12xx / wl1271_acx.c
index 5cc89bbdac7abe11130df407361e65f20b93c3f3..60f10dce48000f7a54dbaa7bd7b91ce10a9af636 100644 (file)
@@ -390,6 +390,35 @@ out:
        return ret;
 }
 
+int wl1271_acx_dco_itrim_params(struct wl1271 *wl)
+{
+       struct acx_dco_itrim_params *dco;
+       struct conf_itrim_settings *c = &wl->conf.itrim;
+       int ret;
+
+       wl1271_debug(DEBUG_ACX, "acx dco itrim parameters");
+
+       dco = kzalloc(sizeof(*dco), GFP_KERNEL);
+       if (!dco) {
+               ret = -ENOMEM;
+               goto out;
+       }
+
+       dco->enable = c->enable;
+       dco->timeout = cpu_to_le32(c->timeout);
+
+       ret = wl1271_cmd_configure(wl, ACX_SET_DCO_ITRIM_PARAMS,
+                                  dco, sizeof(*dco));
+       if (ret < 0) {
+               wl1271_warning("failed to set dco itrim parameters: %d", ret);
+               goto out;
+       }
+
+out:
+       kfree(dco);
+       return ret;
+}
+
 int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter)
 {
        struct acx_beacon_filter_option *beacon_filter = NULL;
@@ -758,10 +787,11 @@ int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats)
        return 0;
 }
 
-int wl1271_acx_rate_policies(struct wl1271 *wl, u32 enabled_rates)
+int wl1271_acx_rate_policies(struct wl1271 *wl)
 {
        struct acx_rate_policy *acx;
        struct conf_tx_rate_class *c = &wl->conf.tx.rc_conf;
+       int idx = 0;
        int ret = 0;
 
        wl1271_debug(DEBUG_ACX, "acx rate policies");
@@ -773,12 +803,21 @@ int wl1271_acx_rate_policies(struct wl1271 *wl, u32 enabled_rates)
                goto out;
        }
 
-       /* configure one default (one-size-fits-all) rate class */
-       acx->rate_class_cnt = cpu_to_le32(1);
-       acx->rate_class[0].enabled_rates = cpu_to_le32(enabled_rates);
-       acx->rate_class[0].short_retry_limit = c->short_retry_limit;
-       acx->rate_class[0].long_retry_limit = c->long_retry_limit;
-       acx->rate_class[0].aflags = c->aflags;
+       /* configure one basic rate class */
+       idx = ACX_TX_BASIC_RATE;
+       acx->rate_class[idx].enabled_rates = cpu_to_le32(wl->basic_rate_set);
+       acx->rate_class[idx].short_retry_limit = c->short_retry_limit;
+       acx->rate_class[idx].long_retry_limit = c->long_retry_limit;
+       acx->rate_class[idx].aflags = c->aflags;
+
+       /* configure one AP supported rate class */
+       idx = ACX_TX_AP_FULL_RATE;
+       acx->rate_class[idx].enabled_rates = cpu_to_le32(wl->rate_set);
+       acx->rate_class[idx].short_retry_limit = c->short_retry_limit;
+       acx->rate_class[idx].long_retry_limit = c->long_retry_limit;
+       acx->rate_class[idx].aflags = c->aflags;
+
+       acx->rate_class_cnt = cpu_to_le32(ACX_TX_RATE_POLICY_CNT);
 
        ret = wl1271_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx));
        if (ret < 0) {
@@ -791,12 +830,14 @@ out:
        return ret;
 }
 
-int wl1271_acx_ac_cfg(struct wl1271 *wl)
+int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max,
+                     u8 aifsn, u16 txop)
 {
        struct acx_ac_cfg *acx;
-       int i, ret = 0;
+       int ret = 0;
 
-       wl1271_debug(DEBUG_ACX, "acx access category config");
+       wl1271_debug(DEBUG_ACX, "acx ac cfg %d cw_ming %d cw_max %d "
+                    "aifs %d txop %d", ac, cw_min, cw_max, aifsn, txop);
 
        acx = kzalloc(sizeof(*acx), GFP_KERNEL);
 
@@ -805,21 +846,16 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl)
                goto out;
        }
 
-       for (i = 0; i < wl->conf.tx.ac_conf_count; i++) {
-               struct conf_tx_ac_category *c = &(wl->conf.tx.ac_conf[i]);
-               acx->ac = c->ac;
-               acx->cw_min = c->cw_min;
-               acx->cw_max = cpu_to_le16(c->cw_max);
-               acx->aifsn = c->aifsn;
-               acx->reserved = 0;
-               acx->tx_op_limit = cpu_to_le16(c->tx_op_limit);
+       acx->ac = ac;
+       acx->cw_min = cw_min;
+       acx->cw_max = cpu_to_le16(cw_max);
+       acx->aifsn = aifsn;
+       acx->tx_op_limit = cpu_to_le16(txop);
 
-               ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx));
-               if (ret < 0) {
-                       wl1271_warning("Setting of access category "
-                                      "config: %d", ret);
-                       goto out;
-               }
+       ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx));
+       if (ret < 0) {
+               wl1271_warning("acx ac cfg failed: %d", ret);
+               goto out;
        }
 
 out:
@@ -827,10 +863,12 @@ out:
        return ret;
 }
 
-int wl1271_acx_tid_cfg(struct wl1271 *wl)
+int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type,
+                      u8 tsid, u8 ps_scheme, u8 ack_policy,
+                      u32 apsd_conf0, u32 apsd_conf1)
 {
        struct acx_tid_config *acx;
-       int i, ret = 0;
+       int ret = 0;
 
        wl1271_debug(DEBUG_ACX, "acx tid config");
 
@@ -841,21 +879,18 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl)
                goto out;
        }
 
-       for (i = 0; i < wl->conf.tx.tid_conf_count; i++) {
-               struct conf_tx_tid *c = &(wl->conf.tx.tid_conf[i]);
-               acx->queue_id = c->queue_id;
-               acx->channel_type = c->channel_type;
-               acx->tsid = c->tsid;
-               acx->ps_scheme = c->ps_scheme;
-               acx->ack_policy = c->ack_policy;
-               acx->apsd_conf[0] = cpu_to_le32(c->apsd_conf[0]);
-               acx->apsd_conf[1] = cpu_to_le32(c->apsd_conf[1]);
+       acx->queue_id = queue_id;
+       acx->channel_type = channel_type;
+       acx->tsid = tsid;
+       acx->ps_scheme = ps_scheme;
+       acx->ack_policy = ack_policy;
+       acx->apsd_conf[0] = cpu_to_le32(apsd_conf0);
+       acx->apsd_conf[1] = cpu_to_le32(apsd_conf1);
 
-               ret = wl1271_cmd_configure(wl, ACX_TID_CFG, acx, sizeof(*acx));
-               if (ret < 0) {
-                       wl1271_warning("Setting of tid config failed: %d", ret);
-                       goto out;
-               }
+       ret = wl1271_cmd_configure(wl, ACX_TID_CFG, acx, sizeof(*acx));
+       if (ret < 0) {
+               wl1271_warning("Setting of tid config failed: %d", ret);
+               goto out;
        }
 
 out:
@@ -1012,59 +1047,6 @@ out:
        return ret;
 }
 
-int wl1271_acx_smart_reflex(struct wl1271 *wl)
-{
-       struct acx_smart_reflex_state *sr_state = NULL;
-       struct acx_smart_reflex_config_params *sr_param = NULL;
-       int i, ret;
-
-       wl1271_debug(DEBUG_ACX, "acx smart reflex");
-
-       sr_param = kzalloc(sizeof(*sr_param), GFP_KERNEL);
-       if (!sr_param) {
-               ret = -ENOMEM;
-               goto out;
-       }
-
-       for (i = 0; i < CONF_SR_ERR_TBL_COUNT; i++) {
-               struct conf_mart_reflex_err_table *e =
-                       &(wl->conf.init.sr_err_tbl[i]);
-
-               sr_param->error_table[i].len = e->len;
-               sr_param->error_table[i].upper_limit = e->upper_limit;
-               memcpy(sr_param->error_table[i].values, e->values, e->len);
-       }
-
-       ret = wl1271_cmd_configure(wl, ACX_SET_SMART_REFLEX_PARAMS,
-                                  sr_param, sizeof(*sr_param));
-       if (ret < 0) {
-               wl1271_warning("failed to set smart reflex params: %d", ret);
-               goto out;
-       }
-
-       sr_state = kzalloc(sizeof(*sr_state), GFP_KERNEL);
-       if (!sr_state) {
-               ret = -ENOMEM;
-               goto out;
-       }
-
-       /* enable smart reflex */
-       sr_state->enable = wl->conf.init.sr_enable;
-
-       ret = wl1271_cmd_configure(wl, ACX_SET_SMART_REFLEX_STATE,
-                                  sr_state, sizeof(*sr_state));
-       if (ret < 0) {
-               wl1271_warning("failed to set smart reflex params: %d", ret);
-               goto out;
-       }
-
-out:
-       kfree(sr_state);
-       kfree(sr_param);
-       return ret;
-
-}
-
 int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable)
 {
        struct wl1271_acx_bet_enable *acx = NULL;
@@ -1132,3 +1114,31 @@ out:
        kfree(acx);
        return ret;
 }
+
+int wl1271_acx_pm_config(struct wl1271 *wl)
+{
+       struct wl1271_acx_pm_config *acx = NULL;
+       struct  conf_pm_config_settings *c = &wl->conf.pm_config;
+       int ret = 0;
+
+       wl1271_debug(DEBUG_ACX, "acx pm config");
+
+       acx = kzalloc(sizeof(*acx), GFP_KERNEL);
+       if (!acx) {
+               ret = -ENOMEM;
+               goto out;
+       }
+
+       acx->host_clk_settling_time = cpu_to_le32(c->host_clk_settling_time);
+       acx->host_fast_wakeup_support = c->host_fast_wakeup_support;
+
+       ret = wl1271_cmd_configure(wl, ACX_PM_CONFIG, acx, sizeof(*acx));
+       if (ret < 0) {
+               wl1271_warning("acx pm config failed: %d", ret);
+               goto out;
+       }
+
+out:
+       kfree(acx);
+       return ret;
+}