diff options
author | Ido Yariv <ido@wizery.com> | 2010-09-30 07:28:27 -0400 |
---|---|---|
committer | Luciano Coelho <luciano.coelho@nokia.com> | 2010-10-05 09:27:29 -0400 |
commit | 1f37cbc9363462c99794699442da39f36be0aaf7 (patch) | |
tree | 3f7bf42c5fa78b08010071da8f1977234e255c64 /drivers/net/wireless/wl12xx/wl1271_main.c | |
parent | 5c57a901dc96fc81d0041282269b43542f170d2a (diff) |
wl1271: Support firmware RX packet aggregation
Instead of retrieving one packet at a time from the firmware, try to
retrieve all available packets at once.
This optimization decreases the number of transactions, which saves
CPU cycles and increases network throughput.
Signed-off-by: Ido Yariv <ido@wizery.com>
Tested-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_main.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index cb18f22bbc5c..8071da10dbc9 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -2459,6 +2459,7 @@ struct ieee80211_hw *wl1271_alloc_hw(void) | |||
2459 | struct platform_device *plat_dev = NULL; | 2459 | struct platform_device *plat_dev = NULL; |
2460 | struct wl1271 *wl; | 2460 | struct wl1271 *wl; |
2461 | int i, ret; | 2461 | int i, ret; |
2462 | unsigned int order; | ||
2462 | 2463 | ||
2463 | hw = ieee80211_alloc_hw(sizeof(*wl), &wl1271_ops); | 2464 | hw = ieee80211_alloc_hw(sizeof(*wl), &wl1271_ops); |
2464 | if (!hw) { | 2465 | if (!hw) { |
@@ -2517,11 +2518,18 @@ struct ieee80211_hw *wl1271_alloc_hw(void) | |||
2517 | 2518 | ||
2518 | wl1271_debugfs_init(wl); | 2519 | wl1271_debugfs_init(wl); |
2519 | 2520 | ||
2521 | order = get_order(WL1271_AGGR_BUFFER_SIZE); | ||
2522 | wl->aggr_buf = (u8 *)__get_free_pages(GFP_KERNEL, order); | ||
2523 | if (!wl->aggr_buf) { | ||
2524 | ret = -ENOMEM; | ||
2525 | goto err_hw; | ||
2526 | } | ||
2527 | |||
2520 | /* Register platform device */ | 2528 | /* Register platform device */ |
2521 | ret = platform_device_register(wl->plat_dev); | 2529 | ret = platform_device_register(wl->plat_dev); |
2522 | if (ret) { | 2530 | if (ret) { |
2523 | wl1271_error("couldn't register platform device"); | 2531 | wl1271_error("couldn't register platform device"); |
2524 | goto err_hw; | 2532 | goto err_aggr; |
2525 | } | 2533 | } |
2526 | dev_set_drvdata(&wl->plat_dev->dev, wl); | 2534 | dev_set_drvdata(&wl->plat_dev->dev, wl); |
2527 | 2535 | ||
@@ -2547,6 +2555,9 @@ err_bt_coex_state: | |||
2547 | err_platform: | 2555 | err_platform: |
2548 | platform_device_unregister(wl->plat_dev); | 2556 | platform_device_unregister(wl->plat_dev); |
2549 | 2557 | ||
2558 | err_aggr: | ||
2559 | free_pages((unsigned long)wl->aggr_buf, order); | ||
2560 | |||
2550 | err_hw: | 2561 | err_hw: |
2551 | wl1271_debugfs_exit(wl); | 2562 | wl1271_debugfs_exit(wl); |
2552 | kfree(plat_dev); | 2563 | kfree(plat_dev); |
@@ -2563,6 +2574,8 @@ EXPORT_SYMBOL_GPL(wl1271_alloc_hw); | |||
2563 | int wl1271_free_hw(struct wl1271 *wl) | 2574 | int wl1271_free_hw(struct wl1271 *wl) |
2564 | { | 2575 | { |
2565 | platform_device_unregister(wl->plat_dev); | 2576 | platform_device_unregister(wl->plat_dev); |
2577 | free_pages((unsigned long)wl->aggr_buf, | ||
2578 | get_order(WL1271_AGGR_BUFFER_SIZE)); | ||
2566 | kfree(wl->plat_dev); | 2579 | kfree(wl->plat_dev); |
2567 | 2580 | ||
2568 | wl1271_debugfs_exit(wl); | 2581 | wl1271_debugfs_exit(wl); |