aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800pci.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-08-16 04:23:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-08-16 14:17:50 -0400
commitae1b1c5dcdef1ebd4b37a7d56ad767add757a660 (patch)
treea54e5e5035e4604f28706c7151b46a84d1acd37b /drivers/net/wireless/rt2x00/rt2800pci.c
parentd074e8d547853cc8b40cf93a460e8fbf9eaa3d00 (diff)
rt2x00: rt2800lib: introduce rt2800_get_txwi_rxwi_size helper
The rt2800pci driver uses the same [RT]XWI size for all chipsets, however some chips requires different values. The size of the [RT]XWI structures is a constant value for a given chipset and it does not depend on the underlying interface. Add a helper function which returns the correct values for the actual chipset and use the new helper both in the rt2800usb and in the rt2800pci drivers. This ensures that both drivers are using the correct values. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 00055627eb8d..dcad90c80542 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -1189,12 +1189,17 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
1189 1189
1190static void rt2800pci_queue_init(struct data_queue *queue) 1190static void rt2800pci_queue_init(struct data_queue *queue)
1191{ 1191{
1192 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
1193 unsigned short txwi_size, rxwi_size;
1194
1195 rt2800_get_txwi_rxwi_size(rt2x00dev, &txwi_size, &rxwi_size);
1196
1192 switch (queue->qid) { 1197 switch (queue->qid) {
1193 case QID_RX: 1198 case QID_RX:
1194 queue->limit = 128; 1199 queue->limit = 128;
1195 queue->data_size = AGGREGATION_SIZE; 1200 queue->data_size = AGGREGATION_SIZE;
1196 queue->desc_size = RXD_DESC_SIZE; 1201 queue->desc_size = RXD_DESC_SIZE;
1197 queue->winfo_size = RXWI_DESC_SIZE_4WORDS; 1202 queue->winfo_size = rxwi_size;
1198 queue->priv_size = sizeof(struct queue_entry_priv_mmio); 1203 queue->priv_size = sizeof(struct queue_entry_priv_mmio);
1199 break; 1204 break;
1200 1205
@@ -1205,7 +1210,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
1205 queue->limit = 64; 1210 queue->limit = 64;
1206 queue->data_size = AGGREGATION_SIZE; 1211 queue->data_size = AGGREGATION_SIZE;
1207 queue->desc_size = TXD_DESC_SIZE; 1212 queue->desc_size = TXD_DESC_SIZE;
1208 queue->winfo_size = TXWI_DESC_SIZE_4WORDS; 1213 queue->winfo_size = txwi_size;
1209 queue->priv_size = sizeof(struct queue_entry_priv_mmio); 1214 queue->priv_size = sizeof(struct queue_entry_priv_mmio);
1210 break; 1215 break;
1211 1216
@@ -1213,7 +1218,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
1213 queue->limit = 8; 1218 queue->limit = 8;
1214 queue->data_size = 0; /* No DMA required for beacons */ 1219 queue->data_size = 0; /* No DMA required for beacons */
1215 queue->desc_size = TXD_DESC_SIZE; 1220 queue->desc_size = TXD_DESC_SIZE;
1216 queue->winfo_size = TXWI_DESC_SIZE_4WORDS; 1221 queue->winfo_size = txwi_size;
1217 queue->priv_size = sizeof(struct queue_entry_priv_mmio); 1222 queue->priv_size = sizeof(struct queue_entry_priv_mmio);
1218 break; 1223 break;
1219 1224