aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1251_main.c
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@nokia.com>2009-11-17 11:48:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-18 17:09:20 -0500
commitc74ddfd5ea9c0c67d0aae77eeb5b610188cb8bc4 (patch)
tree83b9b65950079b8c4d1ee1428009fa4832791fd8 /drivers/net/wireless/wl12xx/wl1251_main.c
parentd5da79ac1f5050cccaa68d814ccce292371f25fa (diff)
wl1251: allocate space for firmware with vmalloc()
Earlier firmware was stored to a memory area allocated with kmalloc() but finding a a contiguous area of memory long enough for the firmware is very difficult in certain cases. better to allocate the memory for firmware with vmalloc() instead and use a small buffer for DMA transfers. Thanks to Eero Tamminen for the idea. Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1251_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index b5e3bdb08448..1f4c238a3371 100644
--- a/drivers/net/wireless/wl12xx/wl1251_main.c
+++ b/drivers/net/wireless/wl12xx/wl1251_main.c
@@ -28,6 +28,7 @@
28#include <linux/irq.h> 28#include <linux/irq.h>
29#include <linux/crc32.h> 29#include <linux/crc32.h>
30#include <linux/etherdevice.h> 30#include <linux/etherdevice.h>
31#include <linux/vmalloc.h>
31 32
32#include "wl1251.h" 33#include "wl1251.h"
33#include "wl12xx_80211.h" 34#include "wl12xx_80211.h"
@@ -83,7 +84,7 @@ static int wl1251_fetch_firmware(struct wl1251 *wl)
83 } 84 }
84 85
85 wl->fw_len = fw->size; 86 wl->fw_len = fw->size;
86 wl->fw = kmalloc(wl->fw_len, GFP_KERNEL); 87 wl->fw = vmalloc(wl->fw_len);
87 88
88 if (!wl->fw) { 89 if (!wl->fw) {
89 wl1251_error("could not allocate memory for the firmware"); 90 wl1251_error("could not allocate memory for the firmware");
@@ -1427,7 +1428,7 @@ int wl1251_free_hw(struct wl1251 *wl)
1427 1428
1428 kfree(wl->target_mem_map); 1429 kfree(wl->target_mem_map);
1429 kfree(wl->data_path); 1430 kfree(wl->data_path);
1430 kfree(wl->fw); 1431 vfree(wl->fw);
1431 wl->fw = NULL; 1432 wl->fw = NULL;
1432 kfree(wl->nvs); 1433 kfree(wl->nvs);
1433 wl->nvs = NULL; 1434 wl->nvs = NULL;