diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2010-05-08 17:40:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-05-10 14:56:49 -0400 |
commit | 3b9f0ed78cf2eb678edd60d74a4a36f5947d003d (patch) | |
tree | 984eda3371e142b3d96669686f84901da0928463 | |
parent | f224f4ef794c4a9146a7fa7303018fecab8c9328 (diff) |
rt2x00: Fix beaconing on rt2800.
According to the Ralink vendor driver for rt2800 we don't need a full
TXD for a beacon but just a TXWI in front of the actual beacon.
Fix the rt2800pci and rt2800usb beaconing code accordingly.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 14 |
2 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 80c67681cf9f..7d4778d66e77 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -682,7 +682,6 @@ static void rt2800pci_write_beacon(struct queue_entry *entry, | |||
682 | struct txentry_desc *txdesc) | 682 | struct txentry_desc *txdesc) |
683 | { | 683 | { |
684 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 684 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
685 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
686 | unsigned int beacon_base; | 685 | unsigned int beacon_base; |
687 | u32 reg; | 686 | u32 reg; |
688 | 687 | ||
@@ -695,15 +694,17 @@ static void rt2800pci_write_beacon(struct queue_entry *entry, | |||
695 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | 694 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); |
696 | 695 | ||
697 | /* | 696 | /* |
698 | * Write entire beacon with descriptor to register. | 697 | * Add the TXWI for the beacon to the skb. |
698 | */ | ||
699 | rt2800_write_txwi(entry->skb, txdesc); | ||
700 | skb_push(entry->skb, TXWI_DESC_SIZE); | ||
701 | |||
702 | /* | ||
703 | * Write entire beacon with TXWI to register. | ||
699 | */ | 704 | */ |
700 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | 705 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); |
701 | rt2800_register_multiwrite(rt2x00dev, | 706 | rt2800_register_multiwrite(rt2x00dev, beacon_base, |
702 | beacon_base, | 707 | entry->skb->data, entry->skb->len); |
703 | skbdesc->desc, skbdesc->desc_len); | ||
704 | rt2800_register_multiwrite(rt2x00dev, | ||
705 | beacon_base + skbdesc->desc_len, | ||
706 | entry->skb->data, entry->skb->len); | ||
707 | 708 | ||
708 | /* | 709 | /* |
709 | * Enable beaconing again. | 710 | * Enable beaconing again. |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index d992a9352ed7..00e7906dc208 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -431,18 +431,10 @@ static void rt2800usb_write_beacon(struct queue_entry *entry, | |||
431 | struct txentry_desc *txdesc) | 431 | struct txentry_desc *txdesc) |
432 | { | 432 | { |
433 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 433 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
434 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
435 | unsigned int beacon_base; | 434 | unsigned int beacon_base; |
436 | u32 reg; | 435 | u32 reg; |
437 | 436 | ||
438 | /* | 437 | /* |
439 | * Add the descriptor in front of the skb. | ||
440 | */ | ||
441 | skb_push(entry->skb, entry->queue->desc_size); | ||
442 | memcpy(entry->skb->data, skbdesc->desc, skbdesc->desc_len); | ||
443 | skbdesc->desc = entry->skb->data; | ||
444 | |||
445 | /* | ||
446 | * Disable beaconing while we are reloading the beacon data, | 438 | * Disable beaconing while we are reloading the beacon data, |
447 | * otherwise we might be sending out invalid data. | 439 | * otherwise we might be sending out invalid data. |
448 | */ | 440 | */ |
@@ -451,6 +443,12 @@ static void rt2800usb_write_beacon(struct queue_entry *entry, | |||
451 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | 443 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); |
452 | 444 | ||
453 | /* | 445 | /* |
446 | * Add the TXWI for the beacon to the skb. | ||
447 | */ | ||
448 | rt2800_write_txwi(entry->skb, txdesc); | ||
449 | skb_push(entry->skb, TXWI_DESC_SIZE); | ||
450 | |||
451 | /* | ||
454 | * Write entire beacon with descriptor to register. | 452 | * Write entire beacon with descriptor to register. |
455 | */ | 453 | */ |
456 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | 454 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); |