aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-15 03:34:44 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-15 03:34:44 -0400
commit63fe46da9c380b3f2bbdf3765044649517cc717c (patch)
tree9478c1aca1d692b408955aea20c9cd9a37e589c0 /drivers/net/wireless/rt2x00
parent99dd1a2b8347ac2ae802300b7862f6f7bcf17139 (diff)
parent066b2118976e6e7cc50eed39e2747c75343a23c4 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/wireless/iwlwifi/iwl-4965-rs.c drivers/net/wireless/rt2x00/rt61pci.c
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c11
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c31
3 files changed, 18 insertions, 29 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 9929b15e28ba..61510c519351 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -1028,8 +1028,10 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev)
1028 * Initialize the device. 1028 * Initialize the device.
1029 */ 1029 */
1030 status = rt2x00dev->ops->lib->initialize(rt2x00dev); 1030 status = rt2x00dev->ops->lib->initialize(rt2x00dev);
1031 if (status) 1031 if (status) {
1032 goto exit; 1032 rt2x00queue_uninitialize(rt2x00dev);
1033 return status;
1034 }
1033 1035
1034 __set_bit(DEVICE_INITIALIZED, &rt2x00dev->flags); 1036 __set_bit(DEVICE_INITIALIZED, &rt2x00dev->flags);
1035 1037
@@ -1039,11 +1041,6 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev)
1039 rt2x00rfkill_register(rt2x00dev); 1041 rt2x00rfkill_register(rt2x00dev);
1040 1042
1041 return 0; 1043 return 0;
1042
1043exit:
1044 rt2x00lib_uninitialize(rt2x00dev);
1045
1046 return status;
1047} 1044}
1048 1045
1049int rt2x00lib_start(struct rt2x00_dev *rt2x00dev) 1046int rt2x00lib_start(struct rt2x00_dev *rt2x00dev)
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 9e5d94e44c5c..c17078eac197 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -314,13 +314,14 @@ int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev)
314 if (status) { 314 if (status) {
315 ERROR(rt2x00dev, "IRQ %d allocation failed (error %d).\n", 315 ERROR(rt2x00dev, "IRQ %d allocation failed (error %d).\n",
316 pci_dev->irq, status); 316 pci_dev->irq, status);
317 return status; 317 goto exit;
318 } 318 }
319 319
320 return 0; 320 return 0;
321 321
322exit: 322exit:
323 rt2x00pci_uninitialize(rt2x00dev); 323 queue_for_each(rt2x00dev, queue)
324 rt2x00pci_free_queue_dma(rt2x00dev, queue);
324 325
325 return status; 326 return status;
326} 327}
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 98af4d26583d..b64f2f5d0d53 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2362,6 +2362,7 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
2362{ 2362{
2363 struct rt2x00_dev *rt2x00dev = hw->priv; 2363 struct rt2x00_dev *rt2x00dev = hw->priv;
2364 struct rt2x00_intf *intf = vif_to_intf(control->vif); 2364 struct rt2x00_intf *intf = vif_to_intf(control->vif);
2365 struct queue_entry_priv_pci_tx *priv_tx;
2365 struct skb_frame_desc *skbdesc; 2366 struct skb_frame_desc *skbdesc;
2366 unsigned int beacon_base; 2367 unsigned int beacon_base;
2367 u32 reg; 2368 u32 reg;
@@ -2369,21 +2370,8 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
2369 if (unlikely(!intf->beacon)) 2370 if (unlikely(!intf->beacon))
2370 return -ENOBUFS; 2371 return -ENOBUFS;
2371 2372
2372 /* 2373 priv_tx = intf->beacon->priv_data;
2373 * We need to append the descriptor in front of the 2374 memset(priv_tx->desc, 0, intf->beacon->queue->desc_size);
2374 * beacon frame.
2375 */
2376 if (skb_headroom(skb) < intf->beacon->queue->desc_size) {
2377 if (pskb_expand_head(skb, intf->beacon->queue->desc_size,
2378 0, GFP_ATOMIC))
2379 return -ENOMEM;
2380 }
2381
2382 /*
2383 * Add the descriptor in front of the skb.
2384 */
2385 skb_push(skb, intf->beacon->queue->desc_size);
2386 memset(skb->data, 0, intf->beacon->queue->desc_size);
2387 2375
2388 /* 2376 /*
2389 * Fill in skb descriptor 2377 * Fill in skb descriptor
@@ -2391,9 +2379,9 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
2391 skbdesc = get_skb_frame_desc(skb); 2379 skbdesc = get_skb_frame_desc(skb);
2392 memset(skbdesc, 0, sizeof(*skbdesc)); 2380 memset(skbdesc, 0, sizeof(*skbdesc));
2393 skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED; 2381 skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED;
2394 skbdesc->data = skb->data + intf->beacon->queue->desc_size; 2382 skbdesc->data = skb->data;
2395 skbdesc->data_len = skb->len - intf->beacon->queue->desc_size; 2383 skbdesc->data_len = skb->len;
2396 skbdesc->desc = skb->data; 2384 skbdesc->desc = priv_tx->desc;
2397 skbdesc->desc_len = intf->beacon->queue->desc_size; 2385 skbdesc->desc_len = intf->beacon->queue->desc_size;
2398 skbdesc->entry = intf->beacon; 2386 skbdesc->entry = intf->beacon;
2399 2387
@@ -2414,7 +2402,10 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
2414 rt2x00lib_write_tx_desc(rt2x00dev, skb, control); 2402 rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
2415 beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx); 2403 beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx);
2416 rt2x00pci_register_multiwrite(rt2x00dev, beacon_base, 2404 rt2x00pci_register_multiwrite(rt2x00dev, beacon_base,
2417 skb->data, skb->len); 2405 skbdesc->desc, skbdesc->desc_len);
2406 rt2x00pci_register_multiwrite(rt2x00dev,
2407 beacon_base + skbdesc->desc_len,
2408 skbdesc->data, skbdesc->data_len);
2418 rt61pci_kick_tx_queue(rt2x00dev, QID_BEACON); 2409 rt61pci_kick_tx_queue(rt2x00dev, QID_BEACON);
2419 2410
2420 return 0; 2411 return 0;
@@ -2479,7 +2470,7 @@ static const struct data_queue_desc rt61pci_queue_tx = {
2479 2470
2480static const struct data_queue_desc rt61pci_queue_bcn = { 2471static const struct data_queue_desc rt61pci_queue_bcn = {
2481 .entry_num = 4 * BEACON_ENTRIES, 2472 .entry_num = 4 * BEACON_ENTRIES,
2482 .data_size = MGMT_FRAME_SIZE, 2473 .data_size = 0, /* No DMA required for beacons */
2483 .desc_size = TXINFO_SIZE, 2474 .desc_size = TXINFO_SIZE,
2484 .priv_size = sizeof(struct queue_entry_priv_pci_tx), 2475 .priv_size = sizeof(struct queue_entry_priv_pci_tx),
2485}; 2476};