diff options
author | Igal Chernobelsky <igalc@ti.com> | 2012-07-29 11:21:12 -0400 |
---|---|---|
committer | Luciano Coelho <luca@coelho.fi> | 2012-09-27 05:13:51 -0400 |
commit | 26a309c7586140afd40628a7031993afbaae0f07 (patch) | |
tree | b216441d25225d449150c1978b2342f7508c12d6 /drivers/net/wireless/ti | |
parent | f1c434df6727ebb3068b67b06eae945a80f07ad3 (diff) |
wlcore/wl18xx/wl12xx: aggregation buffer size set
Aggregation buffer size is set separately per 18xx/12xx chip family.
For 18xx aggragation buffer is set to 13 pages to utilize all
the available tx/rx descriptors for aggregation.
[Arik - remove redundant parts from the patch]
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r-- | drivers/net/wireless/ti/wl12xx/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl12xx/wl12xx.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/wl18xx.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/main.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/rx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/tx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/wlcore.h | 3 |
8 files changed, 14 insertions, 9 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index f38e76942ccc..0a8bc0c7b6cc 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c | |||
@@ -1630,7 +1630,7 @@ static int __devinit wl12xx_probe(struct platform_device *pdev) | |||
1630 | struct ieee80211_hw *hw; | 1630 | struct ieee80211_hw *hw; |
1631 | struct wl12xx_priv *priv; | 1631 | struct wl12xx_priv *priv; |
1632 | 1632 | ||
1633 | hw = wlcore_alloc_hw(sizeof(*priv)); | 1633 | hw = wlcore_alloc_hw(sizeof(*priv), WL12XX_AGGR_BUFFER_SIZE); |
1634 | if (IS_ERR(hw)) { | 1634 | if (IS_ERR(hw)) { |
1635 | wl1271_error("can't allocate hw"); | 1635 | wl1271_error("can't allocate hw"); |
1636 | return PTR_ERR(hw); | 1636 | return PTR_ERR(hw); |
diff --git a/drivers/net/wireless/ti/wl12xx/wl12xx.h b/drivers/net/wireless/ti/wl12xx/wl12xx.h index c8ff7ec9fd41..9953374a307d 100644 --- a/drivers/net/wireless/ti/wl12xx/wl12xx.h +++ b/drivers/net/wireless/ti/wl12xx/wl12xx.h | |||
@@ -38,6 +38,8 @@ | |||
38 | #define WL128X_SUBTYPE_VER 2 | 38 | #define WL128X_SUBTYPE_VER 2 |
39 | #define WL128X_MINOR_VER 115 | 39 | #define WL128X_MINOR_VER 115 |
40 | 40 | ||
41 | #define WL12XX_AGGR_BUFFER_SIZE (4 * PAGE_SIZE) | ||
42 | |||
41 | #define WL12XX_NUM_TX_DESCRIPTORS 16 | 43 | #define WL12XX_NUM_TX_DESCRIPTORS 16 |
42 | #define WL12XX_NUM_RX_DESCRIPTORS 8 | 44 | #define WL12XX_NUM_RX_DESCRIPTORS 8 |
43 | 45 | ||
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index 934708b6db8d..3f4fbd80d4ae 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -1380,7 +1380,7 @@ static int __devinit wl18xx_probe(struct platform_device *pdev) | |||
1380 | struct wl18xx_priv *priv; | 1380 | struct wl18xx_priv *priv; |
1381 | int ret; | 1381 | int ret; |
1382 | 1382 | ||
1383 | hw = wlcore_alloc_hw(sizeof(*priv)); | 1383 | hw = wlcore_alloc_hw(sizeof(*priv), WL18XX_AGGR_BUFFER_SIZE); |
1384 | if (IS_ERR(hw)) { | 1384 | if (IS_ERR(hw)) { |
1385 | wl1271_error("can't allocate hw"); | 1385 | wl1271_error("can't allocate hw"); |
1386 | ret = PTR_ERR(hw); | 1386 | ret = PTR_ERR(hw); |
diff --git a/drivers/net/wireless/ti/wl18xx/wl18xx.h b/drivers/net/wireless/ti/wl18xx/wl18xx.h index 9882e29db4a8..a6e61a25124d 100644 --- a/drivers/net/wireless/ti/wl18xx/wl18xx.h +++ b/drivers/net/wireless/ti/wl18xx/wl18xx.h | |||
@@ -33,6 +33,8 @@ | |||
33 | 33 | ||
34 | #define WL18XX_CMD_MAX_SIZE 740 | 34 | #define WL18XX_CMD_MAX_SIZE 740 |
35 | 35 | ||
36 | #define WL18XX_AGGR_BUFFER_SIZE (13 * PAGE_SIZE) | ||
37 | |||
36 | #define WL18XX_NUM_TX_DESCRIPTORS 32 | 38 | #define WL18XX_NUM_TX_DESCRIPTORS 32 |
37 | #define WL18XX_NUM_RX_DESCRIPTORS 32 | 39 | #define WL18XX_NUM_RX_DESCRIPTORS 32 |
38 | 40 | ||
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 612008f32992..7fe19defa97f 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c | |||
@@ -5313,7 +5313,7 @@ static int wl1271_init_ieee80211(struct wl1271 *wl) | |||
5313 | 5313 | ||
5314 | #define WL1271_DEFAULT_CHANNEL 0 | 5314 | #define WL1271_DEFAULT_CHANNEL 0 |
5315 | 5315 | ||
5316 | struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size) | 5316 | struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size) |
5317 | { | 5317 | { |
5318 | struct ieee80211_hw *hw; | 5318 | struct ieee80211_hw *hw; |
5319 | struct wl1271 *wl; | 5319 | struct wl1271 *wl; |
@@ -5398,12 +5398,13 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size) | |||
5398 | mutex_init(&wl->mutex); | 5398 | mutex_init(&wl->mutex); |
5399 | mutex_init(&wl->flush_mutex); | 5399 | mutex_init(&wl->flush_mutex); |
5400 | 5400 | ||
5401 | order = get_order(WL1271_AGGR_BUFFER_SIZE); | 5401 | order = get_order(aggr_buf_size); |
5402 | wl->aggr_buf = (u8 *)__get_free_pages(GFP_KERNEL, order); | 5402 | wl->aggr_buf = (u8 *)__get_free_pages(GFP_KERNEL, order); |
5403 | if (!wl->aggr_buf) { | 5403 | if (!wl->aggr_buf) { |
5404 | ret = -ENOMEM; | 5404 | ret = -ENOMEM; |
5405 | goto err_wq; | 5405 | goto err_wq; |
5406 | } | 5406 | } |
5407 | wl->aggr_buf_size = aggr_buf_size; | ||
5407 | 5408 | ||
5408 | wl->dummy_packet = wl12xx_alloc_dummy_packet(wl); | 5409 | wl->dummy_packet = wl12xx_alloc_dummy_packet(wl); |
5409 | if (!wl->dummy_packet) { | 5410 | if (!wl->dummy_packet) { |
@@ -5466,8 +5467,7 @@ int wlcore_free_hw(struct wl1271 *wl) | |||
5466 | device_remove_file(wl->dev, &dev_attr_bt_coex_state); | 5467 | device_remove_file(wl->dev, &dev_attr_bt_coex_state); |
5467 | free_page((unsigned long)wl->fwlog); | 5468 | free_page((unsigned long)wl->fwlog); |
5468 | dev_kfree_skb(wl->dummy_packet); | 5469 | dev_kfree_skb(wl->dummy_packet); |
5469 | free_pages((unsigned long)wl->aggr_buf, | 5470 | free_pages((unsigned long)wl->aggr_buf, get_order(wl->aggr_buf_size)); |
5470 | get_order(WL1271_AGGR_BUFFER_SIZE)); | ||
5471 | 5471 | ||
5472 | wl1271_debugfs_exit(wl); | 5472 | wl1271_debugfs_exit(wl); |
5473 | 5473 | ||
diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c index f55e2f9e7ac5..9ee0ec6fd1db 100644 --- a/drivers/net/wireless/ti/wlcore/rx.c +++ b/drivers/net/wireless/ti/wlcore/rx.c | |||
@@ -221,7 +221,7 @@ int wlcore_rx(struct wl1271 *wl, struct wl_fw_status_1 *status) | |||
221 | pkt_len = wlcore_rx_get_buf_size(wl, des); | 221 | pkt_len = wlcore_rx_get_buf_size(wl, des); |
222 | align_pkt_len = wlcore_rx_get_align_buf_size(wl, | 222 | align_pkt_len = wlcore_rx_get_align_buf_size(wl, |
223 | pkt_len); | 223 | pkt_len); |
224 | if (buf_size + align_pkt_len > WL1271_AGGR_BUFFER_SIZE) | 224 | if (buf_size + align_pkt_len > wl->aggr_buf_size) |
225 | break; | 225 | break; |
226 | buf_size += align_pkt_len; | 226 | buf_size += align_pkt_len; |
227 | rx_counter++; | 227 | rx_counter++; |
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c index f9c26b19bff0..a90d3cd09408 100644 --- a/drivers/net/wireless/ti/wlcore/tx.c +++ b/drivers/net/wireless/ti/wlcore/tx.c | |||
@@ -193,7 +193,7 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
193 | int id, ret = -EBUSY, ac; | 193 | int id, ret = -EBUSY, ac; |
194 | u32 spare_blocks; | 194 | u32 spare_blocks; |
195 | 195 | ||
196 | if (buf_offset + total_len > WL1271_AGGR_BUFFER_SIZE) | 196 | if (buf_offset + total_len > wl->aggr_buf_size) |
197 | return -EAGAIN; | 197 | return -EAGAIN; |
198 | 198 | ||
199 | spare_blocks = wlcore_hw_get_spare_blocks(wl, is_gem); | 199 | spare_blocks = wlcore_hw_get_spare_blocks(wl, is_gem); |
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h index 81790a0aea08..a7e9d5869db4 100644 --- a/drivers/net/wireless/ti/wlcore/wlcore.h +++ b/drivers/net/wireless/ti/wlcore/wlcore.h | |||
@@ -237,6 +237,7 @@ struct wl1271 { | |||
237 | 237 | ||
238 | /* Intermediate buffer, used for packet aggregation */ | 238 | /* Intermediate buffer, used for packet aggregation */ |
239 | u8 *aggr_buf; | 239 | u8 *aggr_buf; |
240 | u32 aggr_buf_size; | ||
240 | 241 | ||
241 | /* Reusable dummy packet template */ | 242 | /* Reusable dummy packet template */ |
242 | struct sk_buff *dummy_packet; | 243 | struct sk_buff *dummy_packet; |
@@ -399,7 +400,7 @@ struct wl1271 { | |||
399 | 400 | ||
400 | int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev); | 401 | int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev); |
401 | int __devexit wlcore_remove(struct platform_device *pdev); | 402 | int __devexit wlcore_remove(struct platform_device *pdev); |
402 | struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size); | 403 | struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size); |
403 | int wlcore_free_hw(struct wl1271 *wl); | 404 | int wlcore_free_hw(struct wl1271 *wl); |
404 | int wlcore_set_key(struct wl1271 *wl, enum set_key_cmd cmd, | 405 | int wlcore_set_key(struct wl1271 *wl, enum set_key_cmd cmd, |
405 | struct ieee80211_vif *vif, | 406 | struct ieee80211_vif *vif, |