aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-10-17 03:42:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-10-18 14:06:59 -0400
commiteeea863eba67adaa1a5b2ff34398207ef5506416 (patch)
treed3d03b124908d5342b17824eb03dd04a7ca0462a /drivers/net/wireless
parent1052e3a6ae461c5ebcc1f346382ca9bc3a93e1dd (diff)
rt2x00: rt2800pci: use separate ops for the SoC driver
This makes it possible to use different callback functions for PCI and SoC devices which will allow to move the SoC driver into a separate module. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c104
1 files changed, 102 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 5ae90df643db..344a73ddd3e5 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -356,6 +356,7 @@ static int rt2800pci_read_eeprom(struct rt2x00_dev *rt2x00dev)
356 return retval; 356 return retval;
357} 357}
358 358
359#ifdef CONFIG_PCI
359static const struct ieee80211_ops rt2800pci_mac80211_ops = { 360static const struct ieee80211_ops rt2800pci_mac80211_ops = {
360 .tx = rt2x00mac_tx, 361 .tx = rt2x00mac_tx,
361 .start = rt2x00mac_start, 362 .start = rt2x00mac_start,
@@ -459,7 +460,6 @@ static const struct rt2x00_ops rt2800pci_ops = {
459/* 460/*
460 * RT2800pci module information. 461 * RT2800pci module information.
461 */ 462 */
462#ifdef CONFIG_PCI
463static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = { 463static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = {
464 { PCI_DEVICE(0x1814, 0x0601) }, 464 { PCI_DEVICE(0x1814, 0x0601) },
465 { PCI_DEVICE(0x1814, 0x0681) }, 465 { PCI_DEVICE(0x1814, 0x0681) },
@@ -517,9 +517,109 @@ MODULE_DEVICE_TABLE(pci, rt2800pci_device_table);
517MODULE_LICENSE("GPL"); 517MODULE_LICENSE("GPL");
518 518
519#if defined(CONFIG_SOC_RT288X) || defined(CONFIG_SOC_RT305X) 519#if defined(CONFIG_SOC_RT288X) || defined(CONFIG_SOC_RT305X)
520static const struct ieee80211_ops rt2800soc_mac80211_ops = {
521 .tx = rt2x00mac_tx,
522 .start = rt2x00mac_start,
523 .stop = rt2x00mac_stop,
524 .add_interface = rt2x00mac_add_interface,
525 .remove_interface = rt2x00mac_remove_interface,
526 .config = rt2x00mac_config,
527 .configure_filter = rt2x00mac_configure_filter,
528 .set_key = rt2x00mac_set_key,
529 .sw_scan_start = rt2x00mac_sw_scan_start,
530 .sw_scan_complete = rt2x00mac_sw_scan_complete,
531 .get_stats = rt2x00mac_get_stats,
532 .get_tkip_seq = rt2800_get_tkip_seq,
533 .set_rts_threshold = rt2800_set_rts_threshold,
534 .sta_add = rt2x00mac_sta_add,
535 .sta_remove = rt2x00mac_sta_remove,
536 .bss_info_changed = rt2x00mac_bss_info_changed,
537 .conf_tx = rt2800_conf_tx,
538 .get_tsf = rt2800_get_tsf,
539 .rfkill_poll = rt2x00mac_rfkill_poll,
540 .ampdu_action = rt2800_ampdu_action,
541 .flush = rt2x00mac_flush,
542 .get_survey = rt2800_get_survey,
543 .get_ringparam = rt2x00mac_get_ringparam,
544 .tx_frames_pending = rt2x00mac_tx_frames_pending,
545};
546
547static const struct rt2800_ops rt2800soc_rt2800_ops = {
548 .register_read = rt2x00mmio_register_read,
549 .register_read_lock = rt2x00mmio_register_read, /* same for SoCs */
550 .register_write = rt2x00mmio_register_write,
551 .register_write_lock = rt2x00mmio_register_write, /* same for SoCs */
552 .register_multiread = rt2x00mmio_register_multiread,
553 .register_multiwrite = rt2x00mmio_register_multiwrite,
554 .regbusy_read = rt2x00mmio_regbusy_read,
555 .read_eeprom = rt2800pci_read_eeprom,
556 .hwcrypt_disabled = rt2800pci_hwcrypt_disabled,
557 .drv_write_firmware = rt2800pci_write_firmware,
558 .drv_init_registers = rt2800mmio_init_registers,
559 .drv_get_txwi = rt2800mmio_get_txwi,
560};
561
562static const struct rt2x00lib_ops rt2800soc_rt2x00_ops = {
563 .irq_handler = rt2800mmio_interrupt,
564 .txstatus_tasklet = rt2800mmio_txstatus_tasklet,
565 .pretbtt_tasklet = rt2800mmio_pretbtt_tasklet,
566 .tbtt_tasklet = rt2800mmio_tbtt_tasklet,
567 .rxdone_tasklet = rt2800mmio_rxdone_tasklet,
568 .autowake_tasklet = rt2800mmio_autowake_tasklet,
569 .probe_hw = rt2800_probe_hw,
570 .get_firmware_name = rt2800pci_get_firmware_name,
571 .check_firmware = rt2800_check_firmware,
572 .load_firmware = rt2800_load_firmware,
573 .initialize = rt2x00mmio_initialize,
574 .uninitialize = rt2x00mmio_uninitialize,
575 .get_entry_state = rt2800mmio_get_entry_state,
576 .clear_entry = rt2800mmio_clear_entry,
577 .set_device_state = rt2800pci_set_device_state,
578 .rfkill_poll = rt2800_rfkill_poll,
579 .link_stats = rt2800_link_stats,
580 .reset_tuner = rt2800_reset_tuner,
581 .link_tuner = rt2800_link_tuner,
582 .gain_calibration = rt2800_gain_calibration,
583 .vco_calibration = rt2800_vco_calibration,
584 .start_queue = rt2800mmio_start_queue,
585 .kick_queue = rt2800mmio_kick_queue,
586 .stop_queue = rt2800mmio_stop_queue,
587 .flush_queue = rt2x00mmio_flush_queue,
588 .write_tx_desc = rt2800mmio_write_tx_desc,
589 .write_tx_data = rt2800_write_tx_data,
590 .write_beacon = rt2800_write_beacon,
591 .clear_beacon = rt2800_clear_beacon,
592 .fill_rxdone = rt2800mmio_fill_rxdone,
593 .config_shared_key = rt2800_config_shared_key,
594 .config_pairwise_key = rt2800_config_pairwise_key,
595 .config_filter = rt2800_config_filter,
596 .config_intf = rt2800_config_intf,
597 .config_erp = rt2800_config_erp,
598 .config_ant = rt2800_config_ant,
599 .config = rt2800_config,
600 .sta_add = rt2800_sta_add,
601 .sta_remove = rt2800_sta_remove,
602};
603
604static const struct rt2x00_ops rt2800soc_ops = {
605 .name = KBUILD_MODNAME,
606 .drv_data_size = sizeof(struct rt2800_drv_data),
607 .max_ap_intf = 8,
608 .eeprom_size = EEPROM_SIZE,
609 .rf_size = RF_SIZE,
610 .tx_queues = NUM_TX_QUEUES,
611 .queue_init = rt2800mmio_queue_init,
612 .lib = &rt2800soc_rt2x00_ops,
613 .drv = &rt2800soc_rt2800_ops,
614 .hw = &rt2800soc_mac80211_ops,
615#ifdef CONFIG_RT2X00_LIB_DEBUGFS
616 .debugfs = &rt2800_rt2x00debug,
617#endif /* CONFIG_RT2X00_LIB_DEBUGFS */
618};
619
520static int rt2800soc_probe(struct platform_device *pdev) 620static int rt2800soc_probe(struct platform_device *pdev)
521{ 621{
522 return rt2x00soc_probe(pdev, &rt2800pci_ops); 622 return rt2x00soc_probe(pdev, &rt2800soc_ops);
523} 623}
524 624
525static struct platform_driver rt2800soc_driver = { 625static struct platform_driver rt2800soc_driver = {