diff options
author | Arik Nemtsov <arik@wizery.com> | 2010-11-08 04:51:07 -0500 |
---|---|---|
committer | Luciano Coelho <luciano.coelho@nokia.com> | 2010-11-22 09:45:13 -0500 |
commit | 68d069c45f73e8aeda0249891daec1f7e2f0e067 (patch) | |
tree | 03780680ec225b9428a5de30a4e50ad3b0230657 | |
parent | fa97f46b30357a50f3ee193e6f82864f95bc55ec (diff) |
wl1271: add support for HW TX fragmentation
Indicate to mac80211 we support HW fragmentation.
Support updates of the fragmentation threshold via the
set_frag_threshold callback.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
-rw-r--r-- | drivers/net/wireless/wl12xx/acx.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/acx.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/init.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 31 |
4 files changed, 34 insertions, 5 deletions
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c index bc1085bb6cfb..7cbaeb6d2a37 100644 --- a/drivers/net/wireless/wl12xx/acx.c +++ b/drivers/net/wireless/wl12xx/acx.c | |||
@@ -862,7 +862,7 @@ out: | |||
862 | return ret; | 862 | return ret; |
863 | } | 863 | } |
864 | 864 | ||
865 | int wl1271_acx_frag_threshold(struct wl1271 *wl) | 865 | int wl1271_acx_frag_threshold(struct wl1271 *wl, u16 frag_threshold) |
866 | { | 866 | { |
867 | struct acx_frag_threshold *acx; | 867 | struct acx_frag_threshold *acx; |
868 | int ret = 0; | 868 | int ret = 0; |
@@ -876,7 +876,7 @@ int wl1271_acx_frag_threshold(struct wl1271 *wl) | |||
876 | goto out; | 876 | goto out; |
877 | } | 877 | } |
878 | 878 | ||
879 | acx->frag_threshold = cpu_to_le16(wl->conf.tx.frag_threshold); | 879 | acx->frag_threshold = cpu_to_le16(frag_threshold); |
880 | ret = wl1271_cmd_configure(wl, ACX_FRAG_CFG, acx, sizeof(*acx)); | 880 | ret = wl1271_cmd_configure(wl, ACX_FRAG_CFG, acx, sizeof(*acx)); |
881 | if (ret < 0) { | 881 | if (ret < 0) { |
882 | wl1271_warning("Setting of frag threshold failed: %d", ret); | 882 | wl1271_warning("Setting of frag threshold failed: %d", ret); |
diff --git a/drivers/net/wireless/wl12xx/acx.h b/drivers/net/wireless/wl12xx/acx.h index f41a9c1df12f..75a6306ff554 100644 --- a/drivers/net/wireless/wl12xx/acx.h +++ b/drivers/net/wireless/wl12xx/acx.h | |||
@@ -1161,7 +1161,7 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max, | |||
1161 | int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type, | 1161 | int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type, |
1162 | u8 tsid, u8 ps_scheme, u8 ack_policy, | 1162 | u8 tsid, u8 ps_scheme, u8 ack_policy, |
1163 | u32 apsd_conf0, u32 apsd_conf1); | 1163 | u32 apsd_conf0, u32 apsd_conf1); |
1164 | int wl1271_acx_frag_threshold(struct wl1271 *wl); | 1164 | int wl1271_acx_frag_threshold(struct wl1271 *wl, u16 frag_threshold); |
1165 | int wl1271_acx_tx_config_options(struct wl1271 *wl); | 1165 | int wl1271_acx_tx_config_options(struct wl1271 *wl); |
1166 | int wl1271_acx_mem_cfg(struct wl1271 *wl); | 1166 | int wl1271_acx_mem_cfg(struct wl1271 *wl); |
1167 | int wl1271_acx_init_mem_config(struct wl1271 *wl); | 1167 | int wl1271_acx_init_mem_config(struct wl1271 *wl); |
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c index 492edc0f7aca..7949d346aadb 100644 --- a/drivers/net/wireless/wl12xx/init.c +++ b/drivers/net/wireless/wl12xx/init.c | |||
@@ -290,7 +290,7 @@ int wl1271_hw_init(struct wl1271 *wl) | |||
290 | goto out_free_memmap; | 290 | goto out_free_memmap; |
291 | 291 | ||
292 | /* Default fragmentation threshold */ | 292 | /* Default fragmentation threshold */ |
293 | ret = wl1271_acx_frag_threshold(wl); | 293 | ret = wl1271_acx_frag_threshold(wl, wl->conf.tx.frag_threshold); |
294 | if (ret < 0) | 294 | if (ret < 0) |
295 | goto out_free_memmap; | 295 | goto out_free_memmap; |
296 | 296 | ||
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 6af270d382bb..31f0e2f6ffc3 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -425,7 +425,7 @@ static int wl1271_plt_init(struct wl1271 *wl) | |||
425 | goto out_free_memmap; | 425 | goto out_free_memmap; |
426 | 426 | ||
427 | /* Default fragmentation threshold */ | 427 | /* Default fragmentation threshold */ |
428 | ret = wl1271_acx_frag_threshold(wl); | 428 | ret = wl1271_acx_frag_threshold(wl, wl->conf.tx.frag_threshold); |
429 | if (ret < 0) | 429 | if (ret < 0) |
430 | goto out_free_memmap; | 430 | goto out_free_memmap; |
431 | 431 | ||
@@ -1745,6 +1745,34 @@ out: | |||
1745 | return ret; | 1745 | return ret; |
1746 | } | 1746 | } |
1747 | 1747 | ||
1748 | static int wl1271_op_set_frag_threshold(struct ieee80211_hw *hw, u32 value) | ||
1749 | { | ||
1750 | struct wl1271 *wl = hw->priv; | ||
1751 | int ret = 0; | ||
1752 | |||
1753 | mutex_lock(&wl->mutex); | ||
1754 | |||
1755 | if (unlikely(wl->state == WL1271_STATE_OFF)) { | ||
1756 | ret = -EAGAIN; | ||
1757 | goto out; | ||
1758 | } | ||
1759 | |||
1760 | ret = wl1271_ps_elp_wakeup(wl, false); | ||
1761 | if (ret < 0) | ||
1762 | goto out; | ||
1763 | |||
1764 | ret = wl1271_acx_frag_threshold(wl, (u16)value); | ||
1765 | if (ret < 0) | ||
1766 | wl1271_warning("wl1271_op_set_frag_threshold failed: %d", ret); | ||
1767 | |||
1768 | wl1271_ps_elp_sleep(wl); | ||
1769 | |||
1770 | out: | ||
1771 | mutex_unlock(&wl->mutex); | ||
1772 | |||
1773 | return ret; | ||
1774 | } | ||
1775 | |||
1748 | static int wl1271_op_set_rts_threshold(struct ieee80211_hw *hw, u32 value) | 1776 | static int wl1271_op_set_rts_threshold(struct ieee80211_hw *hw, u32 value) |
1749 | { | 1777 | { |
1750 | struct wl1271 *wl = hw->priv; | 1778 | struct wl1271 *wl = hw->priv; |
@@ -2421,6 +2449,7 @@ static const struct ieee80211_ops wl1271_ops = { | |||
2421 | .set_key = wl1271_op_set_key, | 2449 | .set_key = wl1271_op_set_key, |
2422 | .hw_scan = wl1271_op_hw_scan, | 2450 | .hw_scan = wl1271_op_hw_scan, |
2423 | .bss_info_changed = wl1271_op_bss_info_changed, | 2451 | .bss_info_changed = wl1271_op_bss_info_changed, |
2452 | .set_frag_threshold = wl1271_op_set_frag_threshold, | ||
2424 | .set_rts_threshold = wl1271_op_set_rts_threshold, | 2453 | .set_rts_threshold = wl1271_op_set_rts_threshold, |
2425 | .conf_tx = wl1271_op_conf_tx, | 2454 | .conf_tx = wl1271_op_conf_tx, |
2426 | .get_tsf = wl1271_op_get_tsf, | 2455 | .get_tsf = wl1271_op_get_tsf, |