aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-10-17 03:42:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-10-18 14:06:59 -0400
commitb5cfde3fd9ff44c4ba831815a441d2b5a5af0b2f (patch)
tree6bd5175a29df49e83d0543b68d713e046c93e735 /drivers/net/wireless/rt2x00
parent9732497d4d7f6db7d5504f490f0d7631e24af396 (diff)
rt2x00: rt2800pci: use rt2800mmio prefix for interrupt functions
The functions are used for devices with memory mapped I/O and contain no PCI specific code at all. Use rt2800mmio prefix instead of rt2800pci in the function names to reflect that. The patch contains no functional changes. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c73
1 files changed, 37 insertions, 36 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 2cbaaac89e9a..a829ce59e026 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -448,8 +448,8 @@ static int rt2800pci_init_queues(struct rt2x00_dev *rt2x00dev)
448/* 448/*
449 * Device state switch handlers. 449 * Device state switch handlers.
450 */ 450 */
451static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, 451static void rt2800mmio_toggle_irq(struct rt2x00_dev *rt2x00dev,
452 enum dev_state state) 452 enum dev_state state)
453{ 453{
454 u32 reg; 454 u32 reg;
455 unsigned long flags; 455 unsigned long flags;
@@ -607,7 +607,7 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
607 break; 607 break;
608 case STATE_RADIO_IRQ_ON: 608 case STATE_RADIO_IRQ_ON:
609 case STATE_RADIO_IRQ_OFF: 609 case STATE_RADIO_IRQ_OFF:
610 rt2800pci_toggle_irq(rt2x00dev, state); 610 rt2800mmio_toggle_irq(rt2x00dev, state);
611 break; 611 break;
612 case STATE_DEEP_SLEEP: 612 case STATE_DEEP_SLEEP:
613 case STATE_SLEEP: 613 case STATE_SLEEP:
@@ -630,7 +630,7 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
630/* 630/*
631 * Interrupt functions. 631 * Interrupt functions.
632 */ 632 */
633static void rt2800pci_wakeup(struct rt2x00_dev *rt2x00dev) 633static void rt2800mmio_wakeup(struct rt2x00_dev *rt2x00dev)
634{ 634{
635 struct ieee80211_conf conf = { .flags = 0 }; 635 struct ieee80211_conf conf = { .flags = 0 };
636 struct rt2x00lib_conf libconf = { .conf = &conf }; 636 struct rt2x00lib_conf libconf = { .conf = &conf };
@@ -638,7 +638,7 @@ static void rt2800pci_wakeup(struct rt2x00_dev *rt2x00dev)
638 rt2800_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS); 638 rt2800_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS);
639} 639}
640 640
641static bool rt2800pci_txdone_entry_check(struct queue_entry *entry, u32 status) 641static bool rt2800mmio_txdone_entry_check(struct queue_entry *entry, u32 status)
642{ 642{
643 __le32 *txwi; 643 __le32 *txwi;
644 u32 word; 644 u32 word;
@@ -653,7 +653,7 @@ static bool rt2800pci_txdone_entry_check(struct queue_entry *entry, u32 status)
653 return (tx_wcid == wcid); 653 return (tx_wcid == wcid);
654} 654}
655 655
656static bool rt2800pci_txdone_find_entry(struct queue_entry *entry, void *data) 656static bool rt2800mmio_txdone_find_entry(struct queue_entry *entry, void *data)
657{ 657{
658 u32 status = *(u32 *)data; 658 u32 status = *(u32 *)data;
659 659
@@ -670,7 +670,7 @@ static bool rt2800pci_txdone_find_entry(struct queue_entry *entry, void *data)
670 * To mitigate this effect, associate the tx status to the first frame 670 * To mitigate this effect, associate the tx status to the first frame
671 * in the tx queue with a matching wcid. 671 * in the tx queue with a matching wcid.
672 */ 672 */
673 if (rt2800pci_txdone_entry_check(entry, status) && 673 if (rt2800mmio_txdone_entry_check(entry, status) &&
674 !test_bit(ENTRY_DATA_STATUS_SET, &entry->flags)) { 674 !test_bit(ENTRY_DATA_STATUS_SET, &entry->flags)) {
675 /* 675 /*
676 * Got a matching frame, associate the tx status with 676 * Got a matching frame, associate the tx status with
@@ -685,7 +685,7 @@ static bool rt2800pci_txdone_find_entry(struct queue_entry *entry, void *data)
685 return false; 685 return false;
686} 686}
687 687
688static bool rt2800pci_txdone_match_first(struct queue_entry *entry, void *data) 688static bool rt2800mmio_txdone_match_first(struct queue_entry *entry, void *data)
689{ 689{
690 u32 status = *(u32 *)data; 690 u32 status = *(u32 *)data;
691 691
@@ -706,8 +706,8 @@ static bool rt2800pci_txdone_match_first(struct queue_entry *entry, void *data)
706 /* Check the next frame */ 706 /* Check the next frame */
707 return false; 707 return false;
708} 708}
709static bool rt2800pci_txdone_release_entries(struct queue_entry *entry, 709static bool rt2800mmio_txdone_release_entries(struct queue_entry *entry,
710 void *data) 710 void *data)
711{ 711{
712 if (test_bit(ENTRY_DATA_STATUS_SET, &entry->flags)) { 712 if (test_bit(ENTRY_DATA_STATUS_SET, &entry->flags)) {
713 rt2800_txdone_entry(entry, entry->status, 713 rt2800_txdone_entry(entry, entry->status,
@@ -719,7 +719,7 @@ static bool rt2800pci_txdone_release_entries(struct queue_entry *entry,
719 return true; 719 return true;
720} 720}
721 721
722static bool rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) 722static bool rt2800mmio_txdone(struct rt2x00_dev *rt2x00dev)
723{ 723{
724 struct data_queue *queue; 724 struct data_queue *queue;
725 u32 status; 725 u32 status;
@@ -765,14 +765,14 @@ static bool rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
765 */ 765 */
766 if (!rt2x00queue_for_each_entry(queue, Q_INDEX_DONE, 766 if (!rt2x00queue_for_each_entry(queue, Q_INDEX_DONE,
767 Q_INDEX, &status, 767 Q_INDEX, &status,
768 rt2800pci_txdone_find_entry)) { 768 rt2800mmio_txdone_find_entry)) {
769 /* 769 /*
770 * We cannot match the tx status to any frame, so just 770 * We cannot match the tx status to any frame, so just
771 * use the first one. 771 * use the first one.
772 */ 772 */
773 if (!rt2x00queue_for_each_entry(queue, Q_INDEX_DONE, 773 if (!rt2x00queue_for_each_entry(queue, Q_INDEX_DONE,
774 Q_INDEX, &status, 774 Q_INDEX, &status,
775 rt2800pci_txdone_match_first)) { 775 rt2800mmio_txdone_match_first)) {
776 rt2x00_warn(rt2x00dev, "No frame found for TX status on queue %u, dropping\n", 776 rt2x00_warn(rt2x00dev, "No frame found for TX status on queue %u, dropping\n",
777 qid); 777 qid);
778 break; 778 break;
@@ -784,7 +784,7 @@ static bool rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
784 */ 784 */
785 rt2x00queue_for_each_entry(queue, Q_INDEX_DONE, 785 rt2x00queue_for_each_entry(queue, Q_INDEX_DONE,
786 Q_INDEX, NULL, 786 Q_INDEX, NULL,
787 rt2800pci_txdone_release_entries); 787 rt2800mmio_txdone_release_entries);
788 788
789 if (--max_tx_done == 0) 789 if (--max_tx_done == 0)
790 break; 790 break;
@@ -793,8 +793,8 @@ static bool rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
793 return !max_tx_done; 793 return !max_tx_done;
794} 794}
795 795
796static inline void rt2800pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, 796static inline void rt2800mmio_enable_interrupt(struct rt2x00_dev *rt2x00dev,
797 struct rt2x00_field32 irq_field) 797 struct rt2x00_field32 irq_field)
798{ 798{
799 u32 reg; 799 u32 reg;
800 800
@@ -809,10 +809,10 @@ static inline void rt2800pci_enable_interrupt(struct rt2x00_dev *rt2x00dev,
809 spin_unlock_irq(&rt2x00dev->irqmask_lock); 809 spin_unlock_irq(&rt2x00dev->irqmask_lock);
810} 810}
811 811
812static void rt2800pci_txstatus_tasklet(unsigned long data) 812static void rt2800mmio_txstatus_tasklet(unsigned long data)
813{ 813{
814 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 814 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
815 if (rt2800pci_txdone(rt2x00dev)) 815 if (rt2800mmio_txdone(rt2x00dev))
816 tasklet_schedule(&rt2x00dev->txstatus_tasklet); 816 tasklet_schedule(&rt2x00dev->txstatus_tasklet);
817 817
818 /* 818 /*
@@ -822,15 +822,15 @@ static void rt2800pci_txstatus_tasklet(unsigned long data)
822 */ 822 */
823} 823}
824 824
825static void rt2800pci_pretbtt_tasklet(unsigned long data) 825static void rt2800mmio_pretbtt_tasklet(unsigned long data)
826{ 826{
827 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 827 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
828 rt2x00lib_pretbtt(rt2x00dev); 828 rt2x00lib_pretbtt(rt2x00dev);
829 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) 829 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
830 rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_PRE_TBTT); 830 rt2800mmio_enable_interrupt(rt2x00dev, INT_MASK_CSR_PRE_TBTT);
831} 831}
832 832
833static void rt2800pci_tbtt_tasklet(unsigned long data) 833static void rt2800mmio_tbtt_tasklet(unsigned long data)
834{ 834{
835 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 835 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
836 struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; 836 struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
@@ -861,27 +861,28 @@ static void rt2800pci_tbtt_tasklet(unsigned long data)
861 } 861 }
862 862
863 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) 863 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
864 rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_TBTT); 864 rt2800mmio_enable_interrupt(rt2x00dev, INT_MASK_CSR_TBTT);
865} 865}
866 866
867static void rt2800pci_rxdone_tasklet(unsigned long data) 867static void rt2800mmio_rxdone_tasklet(unsigned long data)
868{ 868{
869 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 869 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
870 if (rt2x00mmio_rxdone(rt2x00dev)) 870 if (rt2x00mmio_rxdone(rt2x00dev))
871 tasklet_schedule(&rt2x00dev->rxdone_tasklet); 871 tasklet_schedule(&rt2x00dev->rxdone_tasklet);
872 else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) 872 else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
873 rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RX_DONE); 873 rt2800mmio_enable_interrupt(rt2x00dev, INT_MASK_CSR_RX_DONE);
874} 874}
875 875
876static void rt2800pci_autowake_tasklet(unsigned long data) 876static void rt2800mmio_autowake_tasklet(unsigned long data)
877{ 877{
878 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 878 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
879 rt2800pci_wakeup(rt2x00dev); 879 rt2800mmio_wakeup(rt2x00dev);
880 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) 880 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
881 rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_AUTO_WAKEUP); 881 rt2800mmio_enable_interrupt(rt2x00dev,
882 INT_MASK_CSR_AUTO_WAKEUP);
882} 883}
883 884
884static void rt2800pci_txstatus_interrupt(struct rt2x00_dev *rt2x00dev) 885static void rt2800mmio_txstatus_interrupt(struct rt2x00_dev *rt2x00dev)
885{ 886{
886 u32 status; 887 u32 status;
887 int i; 888 int i;
@@ -920,7 +921,7 @@ static void rt2800pci_txstatus_interrupt(struct rt2x00_dev *rt2x00dev)
920 tasklet_schedule(&rt2x00dev->txstatus_tasklet); 921 tasklet_schedule(&rt2x00dev->txstatus_tasklet);
921} 922}
922 923
923static irqreturn_t rt2800pci_interrupt(int irq, void *dev_instance) 924static irqreturn_t rt2800mmio_interrupt(int irq, void *dev_instance)
924{ 925{
925 struct rt2x00_dev *rt2x00dev = dev_instance; 926 struct rt2x00_dev *rt2x00dev = dev_instance;
926 u32 reg, mask; 927 u32 reg, mask;
@@ -943,7 +944,7 @@ static irqreturn_t rt2800pci_interrupt(int irq, void *dev_instance)
943 mask = ~reg; 944 mask = ~reg;
944 945
945 if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) { 946 if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) {
946 rt2800pci_txstatus_interrupt(rt2x00dev); 947 rt2800mmio_txstatus_interrupt(rt2x00dev);
947 /* 948 /*
948 * Never disable the TX_FIFO_STATUS interrupt. 949 * Never disable the TX_FIFO_STATUS interrupt.
949 */ 950 */
@@ -1035,12 +1036,12 @@ static const struct rt2800_ops rt2800pci_rt2800_ops = {
1035}; 1036};
1036 1037
1037static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { 1038static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
1038 .irq_handler = rt2800pci_interrupt, 1039 .irq_handler = rt2800mmio_interrupt,
1039 .txstatus_tasklet = rt2800pci_txstatus_tasklet, 1040 .txstatus_tasklet = rt2800mmio_txstatus_tasklet,
1040 .pretbtt_tasklet = rt2800pci_pretbtt_tasklet, 1041 .pretbtt_tasklet = rt2800mmio_pretbtt_tasklet,
1041 .tbtt_tasklet = rt2800pci_tbtt_tasklet, 1042 .tbtt_tasklet = rt2800mmio_tbtt_tasklet,
1042 .rxdone_tasklet = rt2800pci_rxdone_tasklet, 1043 .rxdone_tasklet = rt2800mmio_rxdone_tasklet,
1043 .autowake_tasklet = rt2800pci_autowake_tasklet, 1044 .autowake_tasklet = rt2800mmio_autowake_tasklet,
1044 .probe_hw = rt2800_probe_hw, 1045 .probe_hw = rt2800_probe_hw,
1045 .get_firmware_name = rt2800pci_get_firmware_name, 1046 .get_firmware_name = rt2800pci_get_firmware_name,
1046 .check_firmware = rt2800_check_firmware, 1047 .check_firmware = rt2800_check_firmware,