aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c196
1 files changed, 110 insertions, 86 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 09a67905c230..baa1468a56a8 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -84,20 +84,22 @@ static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token)
84 rt2800_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0); 84 rt2800_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
85} 85}
86 86
87#ifdef CONFIG_RT2800PCI_SOC 87#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
88static void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev) 88static void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
89{ 89{
90 u32 *base_addr = (u32 *) KSEG1ADDR(0x1F040000); /* XXX for RT3052 */ 90 void __iomem *base_addr = ioremap(0x1F040000, EEPROM_SIZE);
91 91
92 memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE); 92 memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE);
93
94 iounmap(base_addr);
93} 95}
94#else 96#else
95static inline void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev) 97static inline void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
96{ 98{
97} 99}
98#endif /* CONFIG_RT2800PCI_SOC */ 100#endif /* CONFIG_RALINK_RT288X || CONFIG_RALINK_RT305X */
99 101
100#ifdef CONFIG_RT2800PCI_PCI 102#ifdef CONFIG_PCI
101static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom) 103static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom)
102{ 104{
103 struct rt2x00_dev *rt2x00dev = eeprom->data; 105 struct rt2x00_dev *rt2x00dev = eeprom->data;
@@ -181,7 +183,78 @@ static inline int rt2800pci_efuse_detect(struct rt2x00_dev *rt2x00dev)
181static inline void rt2800pci_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev) 183static inline void rt2800pci_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev)
182{ 184{
183} 185}
184#endif /* CONFIG_RT2800PCI_PCI */ 186#endif /* CONFIG_PCI */
187
188/*
189 * Queue handlers.
190 */
191static void rt2800pci_start_queue(struct data_queue *queue)
192{
193 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
194 u32 reg;
195
196 switch (queue->qid) {
197 case QID_RX:
198 rt2800_register_read(rt2x00dev, MAC_SYS_CTRL, &reg);
199 rt2x00_set_field32(&reg, MAC_SYS_CTRL_ENABLE_RX, 1);
200 rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, reg);
201 break;
202 case QID_BEACON:
203 rt2800_register_read(rt2x00dev, BCN_TIME_CFG, &reg);
204 rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 1);
205 rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 1);
206 rt2x00_set_field32(&reg, BCN_TIME_CFG_BEACON_GEN, 1);
207 rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
208 break;
209 default:
210 break;
211 };
212}
213
214static void rt2800pci_kick_queue(struct data_queue *queue)
215{
216 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
217 struct queue_entry *entry;
218
219 switch (queue->qid) {
220 case QID_AC_VO:
221 case QID_AC_VI:
222 case QID_AC_BE:
223 case QID_AC_BK:
224 entry = rt2x00queue_get_entry(queue, Q_INDEX);
225 rt2800_register_write(rt2x00dev, TX_CTX_IDX(queue->qid), entry->entry_idx);
226 break;
227 case QID_MGMT:
228 entry = rt2x00queue_get_entry(queue, Q_INDEX);
229 rt2800_register_write(rt2x00dev, TX_CTX_IDX(5), entry->entry_idx);
230 break;
231 default:
232 break;
233 }
234}
235
236static void rt2800pci_stop_queue(struct data_queue *queue)
237{
238 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
239 u32 reg;
240
241 switch (queue->qid) {
242 case QID_RX:
243 rt2800_register_read(rt2x00dev, MAC_SYS_CTRL, &reg);
244 rt2x00_set_field32(&reg, MAC_SYS_CTRL_ENABLE_RX, 0);
245 rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, reg);
246 break;
247 case QID_BEACON:
248 rt2800_register_read(rt2x00dev, BCN_TIME_CFG, &reg);
249 rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 0);
250 rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 0);
251 rt2x00_set_field32(&reg, BCN_TIME_CFG_BEACON_GEN, 0);
252 rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
253 break;
254 default:
255 break;
256 }
257}
185 258
186/* 259/*
187 * Firmware functions 260 * Firmware functions
@@ -321,18 +394,6 @@ static int rt2800pci_init_queues(struct rt2x00_dev *rt2x00dev)
321/* 394/*
322 * Device state switch handlers. 395 * Device state switch handlers.
323 */ 396 */
324static void rt2800pci_toggle_rx(struct rt2x00_dev *rt2x00dev,
325 enum dev_state state)
326{
327 u32 reg;
328
329 rt2800_register_read(rt2x00dev, MAC_SYS_CTRL, &reg);
330 rt2x00_set_field32(&reg, MAC_SYS_CTRL_ENABLE_RX,
331 (state == STATE_RADIO_RX_ON) ||
332 (state == STATE_RADIO_RX_ON_LINK));
333 rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, reg);
334}
335
336static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, 397static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev,
337 enum dev_state state) 398 enum dev_state state)
338{ 399{
@@ -442,7 +503,7 @@ static int rt2800pci_set_state(struct rt2x00_dev *rt2x00dev,
442 * if the device is booting and wasn't asleep it will return 503 * if the device is booting and wasn't asleep it will return
443 * failure when attempting to wakeup. 504 * failure when attempting to wakeup.
444 */ 505 */
445 rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2); 506 rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0xff, 2);
446 507
447 if (state == STATE_AWAKE) { 508 if (state == STATE_AWAKE) {
448 rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKUP, 0, 0); 509 rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKUP, 0, 0);
@@ -476,12 +537,6 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
476 rt2800pci_disable_radio(rt2x00dev); 537 rt2800pci_disable_radio(rt2x00dev);
477 rt2800pci_set_state(rt2x00dev, STATE_SLEEP); 538 rt2800pci_set_state(rt2x00dev, STATE_SLEEP);
478 break; 539 break;
479 case STATE_RADIO_RX_ON:
480 case STATE_RADIO_RX_ON_LINK:
481 case STATE_RADIO_RX_OFF:
482 case STATE_RADIO_RX_OFF_LINK:
483 rt2800pci_toggle_rx(rt2x00dev, state);
484 break;
485 case STATE_RADIO_IRQ_ON: 540 case STATE_RADIO_IRQ_ON:
486 case STATE_RADIO_IRQ_ON_ISR: 541 case STATE_RADIO_IRQ_ON_ISR:
487 case STATE_RADIO_IRQ_OFF: 542 case STATE_RADIO_IRQ_OFF:
@@ -567,41 +622,6 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry,
567} 622}
568 623
569/* 624/*
570 * TX data initialization
571 */
572static void rt2800pci_kick_tx_queue(struct data_queue *queue)
573{
574 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
575 struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX);
576 unsigned int qidx;
577
578 if (queue->qid == QID_MGMT)
579 qidx = 5;
580 else
581 qidx = queue->qid;
582
583 rt2800_register_write(rt2x00dev, TX_CTX_IDX(qidx), entry->entry_idx);
584}
585
586static void rt2800pci_kill_tx_queue(struct data_queue *queue)
587{
588 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
589 u32 reg;
590
591 if (queue->qid == QID_BEACON) {
592 rt2800_register_write(rt2x00dev, BCN_TIME_CFG, 0);
593 return;
594 }
595
596 rt2800_register_read(rt2x00dev, WPDMA_RST_IDX, &reg);
597 rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX0, (queue->qid == QID_AC_BE));
598 rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX1, (queue->qid == QID_AC_BK));
599 rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX2, (queue->qid == QID_AC_VI));
600 rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX3, (queue->qid == QID_AC_VO));
601 rt2800_register_write(rt2x00dev, WPDMA_RST_IDX, reg);
602}
603
604/*
605 * RX control handlers 625 * RX control handlers
606 */ 626 */
607static void rt2800pci_fill_rxdone(struct queue_entry *entry, 627static void rt2800pci_fill_rxdone(struct queue_entry *entry,
@@ -683,7 +703,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
683 * this tx status. 703 * this tx status.
684 */ 704 */
685 WARNING(rt2x00dev, "Got TX status report with " 705 WARNING(rt2x00dev, "Got TX status report with "
686 "unexpected pid %u, dropping", qid); 706 "unexpected pid %u, dropping\n", qid);
687 break; 707 break;
688 } 708 }
689 709
@@ -694,7 +714,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
694 * processing here and drop the tx status 714 * processing here and drop the tx status
695 */ 715 */
696 WARNING(rt2x00dev, "Got TX status for an unavailable " 716 WARNING(rt2x00dev, "Got TX status for an unavailable "
697 "queue %u, dropping", qid); 717 "queue %u, dropping\n", qid);
698 break; 718 break;
699 } 719 }
700 720
@@ -704,7 +724,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
704 * and drop the tx status. 724 * and drop the tx status.
705 */ 725 */
706 WARNING(rt2x00dev, "Got TX status for an empty " 726 WARNING(rt2x00dev, "Got TX status for an empty "
707 "queue %u, dropping", qid); 727 "queue %u, dropping\n", qid);
708 break; 728 break;
709 } 729 }
710 730
@@ -777,7 +797,7 @@ static void rt2800pci_txstatus_interrupt(struct rt2x00_dev *rt2x00dev)
777 * Since we have only one producer and one consumer we don't 797 * Since we have only one producer and one consumer we don't
778 * need to lock the kfifo. 798 * need to lock the kfifo.
779 */ 799 */
780 for (i = 0; i < TX_ENTRIES; i++) { 800 for (i = 0; i < rt2x00dev->ops->tx->entry_num; i++) {
781 rt2800_register_read(rt2x00dev, TX_STA_FIFO, &status); 801 rt2800_register_read(rt2x00dev, TX_STA_FIFO, &status);
782 802
783 if (!rt2x00_get_field32(status, TX_STA_FIFO_VALID)) 803 if (!rt2x00_get_field32(status, TX_STA_FIFO_VALID))
@@ -944,6 +964,8 @@ static const struct ieee80211_ops rt2800pci_mac80211_ops = {
944 .get_tsf = rt2800_get_tsf, 964 .get_tsf = rt2800_get_tsf,
945 .rfkill_poll = rt2x00mac_rfkill_poll, 965 .rfkill_poll = rt2x00mac_rfkill_poll,
946 .ampdu_action = rt2800_ampdu_action, 966 .ampdu_action = rt2800_ampdu_action,
967 .flush = rt2x00mac_flush,
968 .get_survey = rt2800_get_survey,
947}; 969};
948 970
949static const struct rt2800_ops rt2800pci_rt2800_ops = { 971static const struct rt2800_ops rt2800pci_rt2800_ops = {
@@ -976,11 +998,12 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
976 .link_stats = rt2800_link_stats, 998 .link_stats = rt2800_link_stats,
977 .reset_tuner = rt2800_reset_tuner, 999 .reset_tuner = rt2800_reset_tuner,
978 .link_tuner = rt2800_link_tuner, 1000 .link_tuner = rt2800_link_tuner,
1001 .start_queue = rt2800pci_start_queue,
1002 .kick_queue = rt2800pci_kick_queue,
1003 .stop_queue = rt2800pci_stop_queue,
979 .write_tx_desc = rt2800pci_write_tx_desc, 1004 .write_tx_desc = rt2800pci_write_tx_desc,
980 .write_tx_data = rt2800_write_tx_data, 1005 .write_tx_data = rt2800_write_tx_data,
981 .write_beacon = rt2800_write_beacon, 1006 .write_beacon = rt2800_write_beacon,
982 .kick_tx_queue = rt2800pci_kick_tx_queue,
983 .kill_tx_queue = rt2800pci_kill_tx_queue,
984 .fill_rxdone = rt2800pci_fill_rxdone, 1007 .fill_rxdone = rt2800pci_fill_rxdone,
985 .config_shared_key = rt2800_config_shared_key, 1008 .config_shared_key = rt2800_config_shared_key,
986 .config_pairwise_key = rt2800_config_pairwise_key, 1009 .config_pairwise_key = rt2800_config_pairwise_key,
@@ -992,21 +1015,21 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
992}; 1015};
993 1016
994static const struct data_queue_desc rt2800pci_queue_rx = { 1017static const struct data_queue_desc rt2800pci_queue_rx = {
995 .entry_num = RX_ENTRIES, 1018 .entry_num = 128,
996 .data_size = AGGREGATION_SIZE, 1019 .data_size = AGGREGATION_SIZE,
997 .desc_size = RXD_DESC_SIZE, 1020 .desc_size = RXD_DESC_SIZE,
998 .priv_size = sizeof(struct queue_entry_priv_pci), 1021 .priv_size = sizeof(struct queue_entry_priv_pci),
999}; 1022};
1000 1023
1001static const struct data_queue_desc rt2800pci_queue_tx = { 1024static const struct data_queue_desc rt2800pci_queue_tx = {
1002 .entry_num = TX_ENTRIES, 1025 .entry_num = 64,
1003 .data_size = AGGREGATION_SIZE, 1026 .data_size = AGGREGATION_SIZE,
1004 .desc_size = TXD_DESC_SIZE, 1027 .desc_size = TXD_DESC_SIZE,
1005 .priv_size = sizeof(struct queue_entry_priv_pci), 1028 .priv_size = sizeof(struct queue_entry_priv_pci),
1006}; 1029};
1007 1030
1008static const struct data_queue_desc rt2800pci_queue_bcn = { 1031static const struct data_queue_desc rt2800pci_queue_bcn = {
1009 .entry_num = 8 * BEACON_ENTRIES, 1032 .entry_num = 8,
1010 .data_size = 0, /* No DMA required for beacons */ 1033 .data_size = 0, /* No DMA required for beacons */
1011 .desc_size = TXWI_DESC_SIZE, 1034 .desc_size = TXWI_DESC_SIZE,
1012 .priv_size = sizeof(struct queue_entry_priv_pci), 1035 .priv_size = sizeof(struct queue_entry_priv_pci),
@@ -1034,12 +1057,15 @@ static const struct rt2x00_ops rt2800pci_ops = {
1034/* 1057/*
1035 * RT2800pci module information. 1058 * RT2800pci module information.
1036 */ 1059 */
1037#ifdef CONFIG_RT2800PCI_PCI 1060#ifdef CONFIG_PCI
1038static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = { 1061static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = {
1039 { PCI_DEVICE(0x1814, 0x0601), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1062 { PCI_DEVICE(0x1814, 0x0601), PCI_DEVICE_DATA(&rt2800pci_ops) },
1040 { PCI_DEVICE(0x1814, 0x0681), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1063 { PCI_DEVICE(0x1814, 0x0681), PCI_DEVICE_DATA(&rt2800pci_ops) },
1041 { PCI_DEVICE(0x1814, 0x0701), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1064 { PCI_DEVICE(0x1814, 0x0701), PCI_DEVICE_DATA(&rt2800pci_ops) },
1042 { PCI_DEVICE(0x1814, 0x0781), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1065 { PCI_DEVICE(0x1814, 0x0781), PCI_DEVICE_DATA(&rt2800pci_ops) },
1066 { PCI_DEVICE(0x1814, 0x3090), PCI_DEVICE_DATA(&rt2800pci_ops) },
1067 { PCI_DEVICE(0x1814, 0x3091), PCI_DEVICE_DATA(&rt2800pci_ops) },
1068 { PCI_DEVICE(0x1814, 0x3092), PCI_DEVICE_DATA(&rt2800pci_ops) },
1043 { PCI_DEVICE(0x1432, 0x7708), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1069 { PCI_DEVICE(0x1432, 0x7708), PCI_DEVICE_DATA(&rt2800pci_ops) },
1044 { PCI_DEVICE(0x1432, 0x7727), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1070 { PCI_DEVICE(0x1432, 0x7727), PCI_DEVICE_DATA(&rt2800pci_ops) },
1045 { PCI_DEVICE(0x1432, 0x7728), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1071 { PCI_DEVICE(0x1432, 0x7728), PCI_DEVICE_DATA(&rt2800pci_ops) },
@@ -1047,12 +1073,10 @@ static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = {
1047 { PCI_DEVICE(0x1432, 0x7748), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1073 { PCI_DEVICE(0x1432, 0x7748), PCI_DEVICE_DATA(&rt2800pci_ops) },
1048 { PCI_DEVICE(0x1432, 0x7758), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1074 { PCI_DEVICE(0x1432, 0x7758), PCI_DEVICE_DATA(&rt2800pci_ops) },
1049 { PCI_DEVICE(0x1432, 0x7768), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1075 { PCI_DEVICE(0x1432, 0x7768), PCI_DEVICE_DATA(&rt2800pci_ops) },
1050 { PCI_DEVICE(0x1a3b, 0x1059), PCI_DEVICE_DATA(&rt2800pci_ops) },
1051#ifdef CONFIG_RT2800PCI_RT30XX
1052 { PCI_DEVICE(0x1814, 0x3090), PCI_DEVICE_DATA(&rt2800pci_ops) },
1053 { PCI_DEVICE(0x1814, 0x3091), PCI_DEVICE_DATA(&rt2800pci_ops) },
1054 { PCI_DEVICE(0x1814, 0x3092), PCI_DEVICE_DATA(&rt2800pci_ops) },
1055 { PCI_DEVICE(0x1462, 0x891a), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1076 { PCI_DEVICE(0x1462, 0x891a), PCI_DEVICE_DATA(&rt2800pci_ops) },
1077 { PCI_DEVICE(0x1a3b, 0x1059), PCI_DEVICE_DATA(&rt2800pci_ops) },
1078#ifdef CONFIG_RT2800PCI_RT33XX
1079 { PCI_DEVICE(0x1814, 0x3390), PCI_DEVICE_DATA(&rt2800pci_ops) },
1056#endif 1080#endif
1057#ifdef CONFIG_RT2800PCI_RT35XX 1081#ifdef CONFIG_RT2800PCI_RT35XX
1058 { PCI_DEVICE(0x1814, 0x3060), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1082 { PCI_DEVICE(0x1814, 0x3060), PCI_DEVICE_DATA(&rt2800pci_ops) },
@@ -1063,19 +1087,19 @@ static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = {
1063#endif 1087#endif
1064 { 0, } 1088 { 0, }
1065}; 1089};
1066#endif /* CONFIG_RT2800PCI_PCI */ 1090#endif /* CONFIG_PCI */
1067 1091
1068MODULE_AUTHOR(DRV_PROJECT); 1092MODULE_AUTHOR(DRV_PROJECT);
1069MODULE_VERSION(DRV_VERSION); 1093MODULE_VERSION(DRV_VERSION);
1070MODULE_DESCRIPTION("Ralink RT2800 PCI & PCMCIA Wireless LAN driver."); 1094MODULE_DESCRIPTION("Ralink RT2800 PCI & PCMCIA Wireless LAN driver.");
1071MODULE_SUPPORTED_DEVICE("Ralink RT2860 PCI & PCMCIA chipset based cards"); 1095MODULE_SUPPORTED_DEVICE("Ralink RT2860 PCI & PCMCIA chipset based cards");
1072#ifdef CONFIG_RT2800PCI_PCI 1096#ifdef CONFIG_PCI
1073MODULE_FIRMWARE(FIRMWARE_RT2860); 1097MODULE_FIRMWARE(FIRMWARE_RT2860);
1074MODULE_DEVICE_TABLE(pci, rt2800pci_device_table); 1098MODULE_DEVICE_TABLE(pci, rt2800pci_device_table);
1075#endif /* CONFIG_RT2800PCI_PCI */ 1099#endif /* CONFIG_PCI */
1076MODULE_LICENSE("GPL"); 1100MODULE_LICENSE("GPL");
1077 1101
1078#ifdef CONFIG_RT2800PCI_SOC 1102#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
1079static int rt2800soc_probe(struct platform_device *pdev) 1103static int rt2800soc_probe(struct platform_device *pdev)
1080{ 1104{
1081 return rt2x00soc_probe(pdev, &rt2800pci_ops); 1105 return rt2x00soc_probe(pdev, &rt2800pci_ops);
@@ -1092,9 +1116,9 @@ static struct platform_driver rt2800soc_driver = {
1092 .suspend = rt2x00soc_suspend, 1116 .suspend = rt2x00soc_suspend,
1093 .resume = rt2x00soc_resume, 1117 .resume = rt2x00soc_resume,
1094}; 1118};
1095#endif /* CONFIG_RT2800PCI_SOC */ 1119#endif /* CONFIG_RALINK_RT288X || CONFIG_RALINK_RT305X */
1096 1120
1097#ifdef CONFIG_RT2800PCI_PCI 1121#ifdef CONFIG_PCI
1098static struct pci_driver rt2800pci_driver = { 1122static struct pci_driver rt2800pci_driver = {
1099 .name = KBUILD_MODNAME, 1123 .name = KBUILD_MODNAME,
1100 .id_table = rt2800pci_device_table, 1124 .id_table = rt2800pci_device_table,
@@ -1103,21 +1127,21 @@ static struct pci_driver rt2800pci_driver = {
1103 .suspend = rt2x00pci_suspend, 1127 .suspend = rt2x00pci_suspend,
1104 .resume = rt2x00pci_resume, 1128 .resume = rt2x00pci_resume,
1105}; 1129};
1106#endif /* CONFIG_RT2800PCI_PCI */ 1130#endif /* CONFIG_PCI */
1107 1131
1108static int __init rt2800pci_init(void) 1132static int __init rt2800pci_init(void)
1109{ 1133{
1110 int ret = 0; 1134 int ret = 0;
1111 1135
1112#ifdef CONFIG_RT2800PCI_SOC 1136#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
1113 ret = platform_driver_register(&rt2800soc_driver); 1137 ret = platform_driver_register(&rt2800soc_driver);
1114 if (ret) 1138 if (ret)
1115 return ret; 1139 return ret;
1116#endif 1140#endif
1117#ifdef CONFIG_RT2800PCI_PCI 1141#ifdef CONFIG_PCI
1118 ret = pci_register_driver(&rt2800pci_driver); 1142 ret = pci_register_driver(&rt2800pci_driver);
1119 if (ret) { 1143 if (ret) {
1120#ifdef CONFIG_RT2800PCI_SOC 1144#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
1121 platform_driver_unregister(&rt2800soc_driver); 1145 platform_driver_unregister(&rt2800soc_driver);
1122#endif 1146#endif
1123 return ret; 1147 return ret;
@@ -1129,10 +1153,10 @@ static int __init rt2800pci_init(void)
1129 1153
1130static void __exit rt2800pci_exit(void) 1154static void __exit rt2800pci_exit(void)
1131{ 1155{
1132#ifdef CONFIG_RT2800PCI_PCI 1156#ifdef CONFIG_PCI
1133 pci_unregister_driver(&rt2800pci_driver); 1157 pci_unregister_driver(&rt2800pci_driver);
1134#endif 1158#endif
1135#ifdef CONFIG_RT2800PCI_SOC 1159#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
1136 platform_driver_unregister(&rt2800soc_driver); 1160 platform_driver_unregister(&rt2800soc_driver);
1137#endif 1161#endif
1138} 1162}