Commit 243eeb51 authored by Kalle Valo's avatar Kalle Valo Committed by John W. Linville

wl1271: modify wl1271_acx_ac_cfg() to use function parameters

For WMM we need to configure each queue separately so modify
wl1271_acx_ac_cfg() to take the configuration from function parameters
instead.
Signed-off-by: default avatarKalle Valo <kalle.valo@nokia.com>
Reviewed-by: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 30240fc7
...@@ -830,12 +830,14 @@ int wl1271_acx_rate_policies(struct wl1271 *wl) ...@@ -830,12 +830,14 @@ int wl1271_acx_rate_policies(struct wl1271 *wl)
return ret; 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; 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); acx = kzalloc(sizeof(*acx), GFP_KERNEL);
...@@ -844,21 +846,16 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl) ...@@ -844,21 +846,16 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl)
goto out; goto out;
} }
for (i = 0; i < wl->conf.tx.ac_conf_count; i++) { acx->ac = ac;
struct conf_tx_ac_category *c = &(wl->conf.tx.ac_conf[i]); acx->cw_min = cw_min;
acx->ac = c->ac; acx->cw_max = cpu_to_le16(cw_max);
acx->cw_min = c->cw_min; acx->aifsn = aifsn;
acx->cw_max = cpu_to_le16(c->cw_max); acx->tx_op_limit = cpu_to_le16(txop);
acx->aifsn = c->aifsn;
acx->reserved = 0;
acx->tx_op_limit = cpu_to_le16(c->tx_op_limit);
ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx)); ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx));
if (ret < 0) { if (ret < 0) {
wl1271_warning("Setting of access category " wl1271_warning("acx ac cfg failed: %d", ret);
"config: %d", ret); goto out;
goto out;
}
} }
out: out:
......
...@@ -1070,7 +1070,8 @@ int wl1271_acx_cts_protect(struct wl1271 *wl, ...@@ -1070,7 +1070,8 @@ int wl1271_acx_cts_protect(struct wl1271 *wl,
enum acx_ctsprotect_type ctsprotect); enum acx_ctsprotect_type ctsprotect);
int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats); int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats);
int wl1271_acx_rate_policies(struct wl1271 *wl); int wl1271_acx_rate_policies(struct wl1271 *wl);
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);
int wl1271_acx_tid_cfg(struct wl1271 *wl); int wl1271_acx_tid_cfg(struct wl1271 *wl);
int wl1271_acx_frag_threshold(struct wl1271 *wl); int wl1271_acx_frag_threshold(struct wl1271 *wl);
int wl1271_acx_tx_config_options(struct wl1271 *wl); int wl1271_acx_tx_config_options(struct wl1271 *wl);
......
...@@ -195,7 +195,8 @@ static int wl1271_init_beacon_broadcast(struct wl1271 *wl) ...@@ -195,7 +195,8 @@ static int wl1271_init_beacon_broadcast(struct wl1271 *wl)
int wl1271_hw_init(struct wl1271 *wl) int wl1271_hw_init(struct wl1271 *wl)
{ {
int ret; struct conf_tx_ac_category *conf_ac;
int ret, i;
ret = wl1271_cmd_general_parms(wl); ret = wl1271_cmd_general_parms(wl);
if (ret < 0) if (ret < 0)
...@@ -279,9 +280,14 @@ int wl1271_hw_init(struct wl1271 *wl) ...@@ -279,9 +280,14 @@ int wl1271_hw_init(struct wl1271 *wl)
goto out_free_memmap; goto out_free_memmap;
/* Default AC configuration */ /* Default AC configuration */
ret = wl1271_acx_ac_cfg(wl); for (i = 0; i < wl->conf.tx.ac_conf_count; i++) {
if (ret < 0) conf_ac = &wl->conf.tx.ac_conf[i];
goto out_free_memmap; ret = wl1271_acx_ac_cfg(wl, conf_ac->ac, conf_ac->cw_min,
conf_ac->cw_max, conf_ac->aifsn,
conf_ac->tx_op_limit);
if (ret < 0)
goto out_free_memmap;
}
/* Configure TX rate classes */ /* Configure TX rate classes */
ret = wl1271_acx_rate_policies(wl); ret = wl1271_acx_rate_policies(wl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment