diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2010-06-03 04:51:53 -0400 |
---|---|---|
committer | Ivo van Doorn <IvDoorn@gmail.com> | 2010-06-03 04:51:53 -0400 |
commit | f0194b2d5d01b99555fd8a6e42281809086f1ab1 (patch) | |
tree | 74eb78ca8c5b66c55e0bf4bfb6270e8c7e08384a /drivers/net/wireless/rt2x00/rt2800pci.c | |
parent | 96b61bafe22b2f2abcc833d651739edb977f1b1e (diff) |
rt2x00: Centralize rt2800 beacon writing.
The beacon writing functions of rt2800pci and rt2800usb are now identical.
Move them to rt2800lib to only have one central function.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 63 |
1 files changed, 1 insertions, 62 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index db61a78e32b0..f2718367d1a0 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -676,67 +676,6 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
676 | /* | 676 | /* |
677 | * TX data initialization | 677 | * TX data initialization |
678 | */ | 678 | */ |
679 | static void rt2800pci_write_beacon(struct queue_entry *entry, | ||
680 | struct txentry_desc *txdesc) | ||
681 | { | ||
682 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | ||
683 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
684 | unsigned int beacon_base; | ||
685 | u32 reg; | ||
686 | |||
687 | /* | ||
688 | * Disable beaconing while we are reloading the beacon data, | ||
689 | * otherwise we might be sending out invalid data. | ||
690 | */ | ||
691 | rt2800_register_read(rt2x00dev, BCN_TIME_CFG, ®); | ||
692 | rt2x00_set_field32(®, BCN_TIME_CFG_BEACON_GEN, 0); | ||
693 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | ||
694 | |||
695 | /* | ||
696 | * Add space for the TXWI in front of the skb. | ||
697 | */ | ||
698 | skb_push(entry->skb, TXWI_DESC_SIZE); | ||
699 | memset(entry->skb, 0, TXWI_DESC_SIZE); | ||
700 | |||
701 | /* | ||
702 | * Register descriptor details in skb frame descriptor. | ||
703 | */ | ||
704 | skbdesc->flags |= SKBDESC_DESC_IN_SKB; | ||
705 | skbdesc->desc = entry->skb->data; | ||
706 | skbdesc->desc_len = TXWI_DESC_SIZE; | ||
707 | |||
708 | /* | ||
709 | * Add the TXWI for the beacon to the skb. | ||
710 | */ | ||
711 | rt2800_write_txwi((__le32 *)entry->skb->data, txdesc); | ||
712 | |||
713 | /* | ||
714 | * Dump beacon to userspace through debugfs. | ||
715 | */ | ||
716 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb); | ||
717 | |||
718 | /* | ||
719 | * Write entire beacon with TXWI to register. | ||
720 | */ | ||
721 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | ||
722 | rt2800_register_multiwrite(rt2x00dev, beacon_base, | ||
723 | entry->skb->data, entry->skb->len); | ||
724 | |||
725 | /* | ||
726 | * Enable beaconing again. | ||
727 | */ | ||
728 | rt2x00_set_field32(®, BCN_TIME_CFG_TSF_TICKING, 1); | ||
729 | rt2x00_set_field32(®, BCN_TIME_CFG_TBTT_ENABLE, 1); | ||
730 | rt2x00_set_field32(®, BCN_TIME_CFG_BEACON_GEN, 1); | ||
731 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | ||
732 | |||
733 | /* | ||
734 | * Clean up beacon skb. | ||
735 | */ | ||
736 | dev_kfree_skb_any(entry->skb); | ||
737 | entry->skb = NULL; | ||
738 | } | ||
739 | |||
740 | static void rt2800pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | 679 | static void rt2800pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, |
741 | const enum data_queue_qid queue_idx) | 680 | const enum data_queue_qid queue_idx) |
742 | { | 681 | { |
@@ -1074,7 +1013,7 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { | |||
1074 | .write_tx_desc = rt2800pci_write_tx_desc, | 1013 | .write_tx_desc = rt2800pci_write_tx_desc, |
1075 | .write_tx_data = rt2x00pci_write_tx_data, | 1014 | .write_tx_data = rt2x00pci_write_tx_data, |
1076 | .write_tx_datadesc = rt2800pci_write_tx_datadesc, | 1015 | .write_tx_datadesc = rt2800pci_write_tx_datadesc, |
1077 | .write_beacon = rt2800pci_write_beacon, | 1016 | .write_beacon = rt2800_write_beacon, |
1078 | .kick_tx_queue = rt2800pci_kick_tx_queue, | 1017 | .kick_tx_queue = rt2800pci_kick_tx_queue, |
1079 | .kill_tx_queue = rt2800pci_kill_tx_queue, | 1018 | .kill_tx_queue = rt2800pci_kill_tx_queue, |
1080 | .fill_rxdone = rt2800pci_fill_rxdone, | 1019 | .fill_rxdone = rt2800pci_fill_rxdone, |