aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/main.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2010-11-08 04:51:07 -0500
committerLuciano Coelho <luciano.coelho@nokia.com>2010-11-22 09:45:13 -0500
commit68d069c45f73e8aeda0249891daec1f7e2f0e067 (patch)
tree03780680ec225b9428a5de30a4e50ad3b0230657 /drivers/net/wireless/wl12xx/main.c
parentfa97f46b30357a50f3ee193e6f82864f95bc55ec (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>
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r--drivers/net/wireless/wl12xx/main.c31
1 files changed, 30 insertions, 1 deletions
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
1748static 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
1770out:
1771 mutex_unlock(&wl->mutex);
1772
1773 return ret;
1774}
1775
1748static int wl1271_op_set_rts_threshold(struct ieee80211_hw *hw, u32 value) 1776static 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,