aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2012-04-19 07:24:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-23 15:35:29 -0400
commit88211021a67250fd65029d7400f41ee8f91cb25d (patch)
tree7dcb1dd566c559dfe6a4d903bfbf47acc0249286 /drivers/net/wireless
parent0c0fdf6c80d4abd879e8bfaf48a20fd2b37e6c67 (diff)
rt2x00: Use GFP_KERNEL for rx buffer allocation on USB devices
Since the RX path on USB devices is handled in process context we can use GFP_KERNEL for RX buffer allocation. This should reduce the likelihood of allocation failures. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Tested-By: Marc Dietrich <marvin24@gmx.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c2
6 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 5583214721e0..ca36cccaba31 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -1282,7 +1282,7 @@ void rt2x00lib_dmadone(struct queue_entry *entry);
1282void rt2x00lib_txdone(struct queue_entry *entry, 1282void rt2x00lib_txdone(struct queue_entry *entry,
1283 struct txdone_entry_desc *txdesc); 1283 struct txdone_entry_desc *txdesc);
1284void rt2x00lib_txdone_noinfo(struct queue_entry *entry, u32 status); 1284void rt2x00lib_txdone_noinfo(struct queue_entry *entry, u32 status);
1285void rt2x00lib_rxdone(struct queue_entry *entry); 1285void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp);
1286 1286
1287/* 1287/*
1288 * mac80211 handlers. 1288 * mac80211 handlers.
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index dd87d41ac936..e5404e576251 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -588,7 +588,7 @@ static int rt2x00lib_rxdone_read_signal(struct rt2x00_dev *rt2x00dev,
588 return 0; 588 return 0;
589} 589}
590 590
591void rt2x00lib_rxdone(struct queue_entry *entry) 591void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp)
592{ 592{
593 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 593 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
594 struct rxdone_entry_desc rxdesc; 594 struct rxdone_entry_desc rxdesc;
@@ -608,7 +608,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry)
608 * Allocate a new sk_buffer. If no new buffer available, drop the 608 * Allocate a new sk_buffer. If no new buffer available, drop the
609 * received frame and reuse the existing buffer. 609 * received frame and reuse the existing buffer.
610 */ 610 */
611 skb = rt2x00queue_alloc_rxskb(entry); 611 skb = rt2x00queue_alloc_rxskb(entry, gfp);
612 if (!skb) 612 if (!skb)
613 goto submit_entry; 613 goto submit_entry;
614 614
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index 78bd43b8961f..a0935987fa3a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -103,7 +103,7 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
103 * rt2x00queue_alloc_rxskb - allocate a skb for RX purposes. 103 * rt2x00queue_alloc_rxskb - allocate a skb for RX purposes.
104 * @entry: The entry for which the skb will be applicable. 104 * @entry: The entry for which the skb will be applicable.
105 */ 105 */
106struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry); 106struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry, gfp_t gfp);
107 107
108/** 108/**
109 * rt2x00queue_free_skb - free a skb 109 * rt2x00queue_free_skb - free a skb
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 17148bb24426..0a4653a92cab 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -92,7 +92,7 @@ bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
92 /* 92 /*
93 * Send the frame to rt2x00lib for further processing. 93 * Send the frame to rt2x00lib for further processing.
94 */ 94 */
95 rt2x00lib_rxdone(entry); 95 rt2x00lib_rxdone(entry, GFP_ATOMIC);
96 } 96 }
97 97
98 return !max_rx; 98 return !max_rx;
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 8ecf409476cd..4c662eccf53c 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -33,7 +33,7 @@
33#include "rt2x00.h" 33#include "rt2x00.h"
34#include "rt2x00lib.h" 34#include "rt2x00lib.h"
35 35
36struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry) 36struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry, gfp_t gfp)
37{ 37{
38 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 38 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
39 struct sk_buff *skb; 39 struct sk_buff *skb;
@@ -68,7 +68,7 @@ struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry)
68 /* 68 /*
69 * Allocate skbuffer. 69 * Allocate skbuffer.
70 */ 70 */
71 skb = dev_alloc_skb(frame_size + head_size + tail_size); 71 skb = __dev_alloc_skb(frame_size + head_size + tail_size, gfp);
72 if (!skb) 72 if (!skb)
73 return NULL; 73 return NULL;
74 74
@@ -1163,7 +1163,7 @@ static int rt2x00queue_alloc_rxskbs(struct data_queue *queue)
1163 struct sk_buff *skb; 1163 struct sk_buff *skb;
1164 1164
1165 for (i = 0; i < queue->limit; i++) { 1165 for (i = 0; i < queue->limit; i++) {
1166 skb = rt2x00queue_alloc_rxskb(&queue->entries[i]); 1166 skb = rt2x00queue_alloc_rxskb(&queue->entries[i], GFP_KERNEL);
1167 if (!skb) 1167 if (!skb)
1168 return -ENOMEM; 1168 return -ENOMEM;
1169 queue->entries[i].skb = skb; 1169 queue->entries[i].skb = skb;
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 66094eb21b61..d357d1ed92f6 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -358,7 +358,7 @@ static void rt2x00usb_work_rxdone(struct work_struct *work)
358 /* 358 /*
359 * Send the frame to rt2x00lib for further processing. 359 * Send the frame to rt2x00lib for further processing.
360 */ 360 */
361 rt2x00lib_rxdone(entry); 361 rt2x00lib_rxdone(entry, GFP_KERNEL);
362 } 362 }
363} 363}
364 364