rt2x00: rt2800 detection improvements.
cover rt2x00: rt2800 detection improvements.
Some general rt2800 detection improvements. This make SOC a special interface, and thus simplifying SOC detection a bit, and unifies rt2800pci and rt2800usb further in detecting with what kind of rt2800 device we are dealing with.
Gertjan van Wingerde (3):
rt2x00: Introduce SoC interface type.
rt2x00: Reorganize RT chipset setting for PCI/SOC devices.
rt2x00: rework RT chipset and revision determination for PCI an SOC
devices.
drivers/net/wireless/rt2x00/rt2400pci.c | 4 +- drivers/net/wireless/rt2x00/rt2400pci.h | 1 + drivers/net/wireless/rt2x00/rt2500pci.c | 4 +- drivers/net/wireless/rt2x00/rt2500pci.h | 1 + drivers/net/wireless/rt2x00/rt2500usb.c | 4 +- drivers/net/wireless/rt2x00/rt2800.h | 14 ++-- drivers/net/wireless/rt2x00/rt2800lib.c | 115 +++++++++++++++++------------ drivers/net/wireless/rt2x00/rt2800pci.c | 29 +++----- drivers/net/wireless/rt2x00/rt2800usb.c | 20 ++--- drivers/net/wireless/rt2x00/rt2x00.h | 66 +++++++---------- drivers/net/wireless/rt2x00/rt2x00debug.c | 4 +- drivers/net/wireless/rt2x00/rt2x00pci.c | 7 -- drivers/net/wireless/rt2x00/rt2x00pci.h | 1 + drivers/net/wireless/rt2x00/rt2x00soc.c | 11 +-- drivers/net/wireless/rt2x00/rt2x00soc.h | 10 +-- drivers/net/wireless/rt2x00/rt61pci.c | 14 ++-- drivers/net/wireless/rt2x00/rt61pci.h | 9 ++ drivers/net/wireless/rt2x00/rt73usb.c | 7 +- drivers/net/wireless/rt2x00/rt73usb.h | 2 + 19 files changed, 156 insertions(+), 167 deletions(-)
PATCH 1/3 rt2x00: Introduce SoC interface type.
Introduce the SoC interface type to detect SoC devices, instead of having them mimic being PCI devices.
This allows for easier detection of SoC devices.
--- drivers/net/wireless/rt2x00/rt2800lib.c | 38 +++++++++++++++--------------- drivers/net/wireless/rt2x00/rt2800pci.c | 18 +++++--------- drivers/net/wireless/rt2x00/rt2x00.h | 10 ++++++- drivers/net/wireless/rt2x00/rt2x00soc.c | 6 +---- 4 files changed, 34 insertions(+), 38 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +19 -19
@@ -89,7 +89,7 @@ static void rt2800_bbp_write(struct rt2x00_dev *rt2x00dev,rt2x00_set_field32 (®,BBP_CSR_CFG_REGNUM , word);rt2x00_set_field32 (®,BBP_CSR_CFG_BUSY ,1 );rt2x00_set_field32 (®,BBP_CSR_CFG_READ_CONTROL ,0 ); -if (rt2x00_intf_is_pci (rt2x00dev)) +if (rt2x00_is_pci (rt2x00dev) ||rt2x00_is_soc (rt2x00dev))rt2x00_set_field32 (®,BBP_CSR_CFG_BBP_RW_MODE ,1 );rt2800_register_write_lock (rt2x00dev,BBP_CSR_CFG , reg);
@@ -118,7 +118,7 @@ static void rt2800_bbp_read(struct rt2x00_dev *rt2x00dev,rt2x00_set_field32 (®,BBP_CSR_CFG_REGNUM , word);rt2x00_set_field32 (®,BBP_CSR_CFG_BUSY ,1 );rt2x00_set_field32 (®,BBP_CSR_CFG_READ_CONTROL ,1 ); -if (rt2x00_intf_is_pci (rt2x00dev)) +if (rt2x00_is_pci (rt2x00dev) ||rt2x00_is_soc (rt2x00dev))rt2x00_set_field32 (®,BBP_CSR_CFG_BBP_RW_MODE ,1 );rt2800_register_write_lock (rt2x00dev,BBP_CSR_CFG , reg);
@@ -218,9 +218,9 @@ void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev,u32 reg;/* -* RT2880 and RT3052 don't support MCU requests. +* SOC devices don't support MCU requests. */ -if (rt2x00_rt (rt2x00dev,RT2880 ) ||rt2x00_rt (rt2x00dev,RT3052 )) +if (rt2x00_is_soc (rt2x00dev))return ;mutex_lock (&rt2x00dev->csr_mutex);
@@ -660,7 +660,7 @@ void rt2800_config_ant(struct rt2x00_dev *rt2x00dev, struct antenna_setup *ant)switch ((int )ant->tx) {case 1 :rt2x00_set_field8 (&r1,BBP1_TX_ANTENNA ,0 ); -if (rt2x00_intf_is_pci (rt2x00dev)) +if (rt2x00_is_pci (rt2x00dev) ||rt2x00_is_soc (rt2x00dev))rt2x00_set_field8 (&r3,BBP3_RX_ANTENNA ,0 );break ;case 2 :
@@ -1057,7 +1057,7 @@ EXPORT_SYMBOL_GPL(rt2800_link_stats);static u8 rt2800_get_default_vgc (struct rt2x00_dev *rt2x00dev) {if (rt2x00dev->curr_band ==IEEE80211_BAND_2GHZ ) { -if (rt2x00_intf_is_usb (rt2x00dev) && +if (rt2x00_is_usb (rt2x00dev) &&rt2x00_rev (rt2x00dev) ==RT3070_VERSION )return 0x1c + (2 * rt2x00dev->lna_gain);else
@@ -1109,7 +1109,7 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)u32 reg;unsigned int i; -if (rt2x00_intf_is_usb (rt2x00dev)) { +if (rt2x00_is_usb (rt2x00dev)) {/* * Wait until BBP and RF are ready. */
@@ -1128,7 +1128,7 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)rt2800_register_read (rt2x00dev,PBF_SYS_CTRL , ®);rt2800_register_write (rt2x00dev,PBF_SYS_CTRL , reg & ~0x00002000 ); - }else if (rt2x00_intf_is_pci (rt2x00dev)) + }else if (rt2x00_is_pci (rt2x00dev) ||rt2x00_is_soc (rt2x00dev))rt2800_register_write (rt2x00dev,PWR_PIN_CFG ,0x00000003 );rt2800_register_read (rt2x00dev,MAC_SYS_CTRL , ®);
@@ -1136,7 +1136,7 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)rt2x00_set_field32 (®,MAC_SYS_CTRL_RESET_BBP ,1 );rt2800_register_write (rt2x00dev,MAC_SYS_CTRL , reg); -if (rt2x00_intf_is_usb (rt2x00dev)) { +if (rt2x00_is_usb (rt2x00dev)) {rt2800_register_write (rt2x00dev,USB_DMA_CFG ,0x00000000 );#if defined(CONFIG_RT2X00_LIB_USB ) || defined(CONFIG_RT2X00_LIB_USB_MODULE ) rt2x00usb_vendor_request_sw(rt2x00dev, USB_DEVICE_MODE, 0,
@@ -1174,7 +1174,7 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)rt2x00_set_field32 (®,BCN_TIME_CFG_TX_TIME_COMPENSATE ,0 );rt2800_register_write (rt2x00dev,BCN_TIME_CFG , reg); -if (rt2x00_intf_is_usb (rt2x00dev) && +if (rt2x00_is_usb (rt2x00dev) &&rt2x00_rev (rt2x00dev) ==RT3070_VERSION ) {rt2800_register_write (rt2x00dev,TX_SW_CFG0 ,0x00000400 );rt2800_register_write (rt2x00dev,TX_SW_CFG1 ,0x00000000 );
@@ -1293,7 +1293,7 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)rt2x00_set_field32 (®,GF40_PROT_CFG_TX_OP_ALLOW_GF40 ,1 );rt2800_register_write (rt2x00dev,GF40_PROT_CFG , reg); -if (rt2x00_intf_is_usb (rt2x00dev)) { +if (rt2x00_is_usb (rt2x00dev)) {rt2800_register_write (rt2x00dev,PBF_CFG ,0xf40006 );rt2800_register_read (rt2x00dev,WPDMA_GLO_CFG , ®);
@@ -1353,7 +1353,7 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)rt2800_register_write (rt2x00dev,HW_BEACON_BASE6 ,0 );rt2800_register_write (rt2x00dev,HW_BEACON_BASE7 ,0 ); -if (rt2x00_intf_is_usb (rt2x00dev)) { +if (rt2x00_is_usb (rt2x00dev)) {rt2800_register_read (rt2x00dev,USB_CYC_CFG , ®);rt2x00_set_field32 (®,USB_CYC_CFG_CLOCK_CYCLE ,30 );rt2800_register_write (rt2x00dev,USB_CYC_CFG , reg);
@@ -1490,7 +1490,7 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)if (rt2x00_rev (rt2x00dev) >RT2860D_VERSION )rt2800_bbp_write (rt2x00dev,84 ,0x19 ); -if (rt2x00_intf_is_usb (rt2x00dev) && +if (rt2x00_is_usb (rt2x00dev) &&rt2x00_rev (rt2x00dev) ==RT3070_VERSION ) {rt2800_bbp_write (rt2x00dev,70 ,0x0a );rt2800_bbp_write (rt2x00dev,84 ,0x99 );
@@ -1582,11 +1582,11 @@ int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)u8 rfcsr;u8 bbp; -if (rt2x00_intf_is_usb (rt2x00dev) && +if (rt2x00_is_usb (rt2x00dev) &&rt2x00_rev (rt2x00dev) !=RT3070_VERSION )return 0 ; -if (rt2x00_intf_is_pci (rt2x00dev)) { +if (rt2x00_is_pci (rt2x00dev) ||rt2x00_is_soc (rt2x00dev)) {if (!rt2x00_rf (rt2x00dev,RF3020 ) && !rt2x00_rf (rt2x00dev,RF3021 ) && !rt2x00_rf (rt2x00dev,RF3022 ))
@@ -1603,7 +1603,7 @@ int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)rt2x00_set_field8 (&rfcsr,RFCSR30_RF_CALIBRATION ,0 );rt2800_rfcsr_write (rt2x00dev,30 , rfcsr); -if (rt2x00_intf_is_usb (rt2x00dev)) { +if (rt2x00_is_usb (rt2x00dev)) {rt2800_rfcsr_write (rt2x00dev,4 ,0x40 );rt2800_rfcsr_write (rt2x00dev,5 ,0x03 );rt2800_rfcsr_write (rt2x00dev,6 ,0x02 );
@@ -1624,7 +1624,7 @@ int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)rt2800_rfcsr_write (rt2x00dev,25 ,0x01 );rt2800_rfcsr_write (rt2x00dev,27 ,0x03 );rt2800_rfcsr_write (rt2x00dev,29 ,0x1f ); - }else if (rt2x00_intf_is_pci (rt2x00dev)) { + }else if (rt2x00_is_pci (rt2x00dev) ||rt2x00_is_soc (rt2x00dev)) {rt2800_rfcsr_write (rt2x00dev,0 ,0x50 );rt2800_rfcsr_write (rt2x00dev,1 ,0x01 );rt2800_rfcsr_write (rt2x00dev,2 ,0xf7 );
@@ -1855,7 +1855,7 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)rt2x00_set_chip_rf (rt2x00dev, value, reg); -if (rt2x00_intf_is_usb (rt2x00dev)) { +if (rt2x00_is_usb (rt2x00dev)) {/* * The check for rt2860 is not a typo, some rt2870 hardware * identifies itself as rt2860 in the CSR register.
@@ -2039,7 +2039,7 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)/* * Disable powersaving as default on PCI devices. */ -if (rt2x00_intf_is_pci (rt2x00dev)) +if (rt2x00_is_pci (rt2x00dev) ||rt2x00_is_soc (rt2x00dev)) rt2x00dev->hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT ;/*
drivers/net/wireless/rt2x00/rt2800pci.c +6 -12
@@ -1041,18 +1041,12 @@ static int rt2800pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)/* * Read EEPROM into buffer */ -switch (rt2x00dev->chip.rt) { -case RT2880 : -case RT3052 : +if (rt2x00_is_soc (rt2x00dev))rt2800pci_read_eeprom_soc (rt2x00dev); -break ; -default : -if (rt2800pci_efuse_detect (rt2x00dev)) -rt2800pci_read_eeprom_efuse (rt2x00dev); -else -rt2800pci_read_eeprom_pci (rt2x00dev); -break ; - } +else if (rt2800pci_efuse_detect (rt2x00dev)) +rt2800pci_read_eeprom_efuse (rt2x00dev); +else +rt2800pci_read_eeprom_pci (rt2x00dev);return rt2800_validate_eeprom (rt2x00dev); }
@@ -1103,7 +1097,7 @@ static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev)/* * This device requires firmware. */ -if (!rt2x00_rt (rt2x00dev,RT2880 ) && !rt2x00_rt (rt2x00dev,RT3052 )) +if (!rt2x00_is_soc (rt2x00dev))__set_bit (DRIVER_REQUIRE_FIRMWARE , &rt2x00dev->flags);__set_bit (DRIVER_REQUIRE_DMA , &rt2x00dev->flags);__set_bit (DRIVER_REQUIRE_L2PAD , &rt2x00dev->flags);
drivers/net/wireless/rt2x00/rt2x00.h +8 -2
@@ -160,6 +160,7 @@ struct avg_val {enum rt2x00_chip_intf {RT2X00_CHIP_INTF_PCI ,RT2X00_CHIP_INTF_USB , +RT2X00_CHIP_INTF_SOC , };/*
@@ -976,16 +977,21 @@ static inline bool rt2x00_intf(struct rt2x00_dev *rt2x00dev,return (rt2x00dev->chip.intf == intf); } -static inline bool rt2x00_intf_is_pci (struct rt2x00_dev *rt2x00dev) +static inline bool rt2x00_is_pci (struct rt2x00_dev *rt2x00dev) {return rt2x00_intf (rt2x00dev,RT2X00_CHIP_INTF_PCI ); } -static inline bool rt2x00_intf_is_usb (struct rt2x00_dev *rt2x00dev) +static inline bool rt2x00_is_usb (struct rt2x00_dev *rt2x00dev) {return rt2x00_intf (rt2x00dev,RT2X00_CHIP_INTF_USB ); } +static inline bool rt2x00_is_soc (struct rt2x00_dev *rt2x00dev) +{ +return rt2x00_intf (rt2x00dev,RT2X00_CHIP_INTF_SOC ); +} +/** * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes. * @rt2x00dev: Pointer to &struct rt2x00_dev.
drivers/net/wireless/rt2x00/rt2x00soc.c +1 -5
@@ -94,11 +94,7 @@ int rt2x00soc_probe(struct platform_device *pdev, rt2x00dev->irq =platform_get_irq (pdev,0 ); rt2x00dev->name = pdev->dev.driver->name; -/* -* SoC devices mimic PCI behavior. -*/ -rt2x00_set_chip_intf (rt2x00dev,RT2X00_CHIP_INTF_PCI ); - +rt2x00_set_chip_intf (rt2x00dev,RT2X00_CHIP_INTF_SOC );rt2x00_set_chip_rt (rt2x00dev, chipset); retval =rt2x00soc_alloc_reg (rt2x00dev);
Signature · 1 line
1.6.6.1
PATCH 2/3 rt2x00: Reorganize RT chipset setting for PCI/SOC devices.
Don't set the RT chipset for a device from within the generic PCI/SOC code, but rather from the individual drivers, so that individual drivers have more control over what RT chipset is set.
Preparation for chip handling updates for rt2800 devices.
--- drivers/net/wireless/rt2x00/rt2400pci.c | 9 +++++- drivers/net/wireless/rt2x00/rt2500pci.c | 9 +++++- drivers/net/wireless/rt2x00/rt2500usb.c | 1 - drivers/net/wireless/rt2x00/rt2800lib.c | 39 +++++++++++++++++++++++-------- drivers/net/wireless/rt2x00/rt2800pci.c | 11 ++++---- drivers/net/wireless/rt2x00/rt2x00.h | 15 ------------ drivers/net/wireless/rt2x00/rt2x00pci.c | 7 ----- drivers/net/wireless/rt2x00/rt2x00pci.h | 1 + drivers/net/wireless/rt2x00/rt2x00soc.c | 5 +--- drivers/net/wireless/rt2x00/rt2x00soc.h | 10 +------- drivers/net/wireless/rt2x00/rt61pci.c | 9 +++++- drivers/net/wireless/rt2x00/rt73usb.c | 1 - 12 files changed, 58 insertions(+), 59 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +7 -2
@@ -1327,6 +1327,7 @@ static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)static int rt2400pci_init_eeprom (struct rt2x00_dev *rt2x00dev) {u32 reg; +u16 chip;u16 value;u16 eeprom;
@@ -1336,12 +1337,16 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)rt2x00_eeprom_read (rt2x00dev,EEPROM_ANTENNA , &eeprom);/* +* Identify RT chipset. +*/ +pci_read_config_word (to_pci_dev (rt2x00dev->dev),PCI_DEVICE_ID , &chip); + +/* * Identify RF chipset. */ value =rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RF_TYPE );rt2x00pci_register_read (rt2x00dev,CSR0 , ®); -rt2x00_set_chip_rf (rt2x00dev, value, reg); -rt2x00_print_chip (rt2x00dev); +rt2x00_set_chip (rt2x00dev, chip, value, reg);if (!rt2x00_rf (rt2x00dev,RF2420 ) && !rt2x00_rf (rt2x00dev,RF2421 )) {ERROR (rt2x00dev,"Invalid RF chipset detected.\n" );
drivers/net/wireless/rt2x00/rt2500pci.c +7 -2
@@ -1490,6 +1490,7 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)static int rt2500pci_init_eeprom (struct rt2x00_dev *rt2x00dev) {u32 reg; +u16 chip;u16 value;u16 eeprom;
@@ -1499,12 +1500,16 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)rt2x00_eeprom_read (rt2x00dev,EEPROM_ANTENNA , &eeprom);/* +* Identify RT chipset. +*/ +pci_read_config_word (to_pci_dev (rt2x00dev->dev),PCI_DEVICE_ID , &chip); + +/* * Identify RF chipset. */ value =rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RF_TYPE );rt2x00pci_register_read (rt2x00dev,CSR0 , ®); -rt2x00_set_chip_rf (rt2x00dev, value, reg); -rt2x00_print_chip (rt2x00dev); +rt2x00_set_chip (rt2x00dev, chip, value, reg); if (!rt2x00_rf(rt2x00dev, RF2522) && !rt2x00_rf(rt2x00dev, RF2523) &&
drivers/net/wireless/rt2x00/rt2500usb.c +0 -1
@@ -1408,7 +1408,6 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev) value =rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RF_TYPE );rt2500usb_register_read (rt2x00dev,MAC_CSR0 , ®);rt2x00_set_chip (rt2x00dev,RT2570 , value, reg); -rt2x00_print_chip (rt2x00dev);if (!rt2x00_check_rev (rt2x00dev,0x000ffff0 ,0 ) ||rt2x00_check_rev (rt2x00dev,0x0000000f ,0 )) {
drivers/net/wireless/rt2x00/rt2800lib.c +29 -10
@@ -40,6 +40,9 @@#if defined(CONFIG_RT2X00_LIB_USB ) || defined(CONFIG_RT2X00_LIB_USB_MODULE )#include "rt2x00usb.h" #endif +#if defined(CONFIG_RT2X00_LIB_PCI ) || defined(CONFIG_RT2X00_LIB_PCI_MODULE ) +#include "rt2x00pci.h" +#endif #include "rt2800lib.h" #include "rt2800.h" #include "rt2800usb.h"
@@ -1839,6 +1842,7 @@ EXPORT_SYMBOL_GPL(rt2800_validate_eeprom);int rt2800_init_eeprom (struct rt2x00_dev *rt2x00dev) {u32 reg; +u16 chip;u16 value;u16 eeprom;
@@ -1853,25 +1857,40 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) value =rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RF_TYPE );rt2800_register_read (rt2x00dev,MAC_CSR0 , ®); -rt2x00_set_chip_rf (rt2x00dev, value, reg); - -if (rt2x00_is_usb (rt2x00dev)) { +if (rt2x00_is_pci (rt2x00dev)) { +#if defined(CONFIG_RT2X00_LIB_PCI ) || defined(CONFIG_RT2X00_LIB_PCI_MODULE ) +pci_read_config_word (to_pci_dev (rt2x00dev->dev), +PCI_DEVICE_ID , + &chip); +#else +BUG (); +#endif + }else if (rt2x00_is_usb (rt2x00dev)) {/* * The check for rt2860 is not a typo, some rt2870 hardware * identifies itself as rt2860 in the CSR register. */ -if (rt2x00_check_rev (rt2x00dev,0xfff00000 ,0x28600000 ) || -rt2x00_check_rev (rt2x00dev,0xfff00000 ,0x28700000 ) || -rt2x00_check_rev (rt2x00dev,0xfff00000 ,0x28800000 )) { -rt2x00_set_chip_rt (rt2x00dev,RT2870 ); - }else if (rt2x00_check_rev (rt2x00dev,0xffff0000 ,0x30700000 )) { -rt2x00_set_chip_rt (rt2x00dev,RT3070 ); +if (((reg &0xfff00000 ) ==0x28600000 ) || + ((reg &0xfff00000 ) ==0x28700000 ) || + ((reg &0xfff00000 ) ==0x28800000 )) { + chip =RT2870 ; + }else if ((reg &0xffff0000 ) ==0x30700000 ) { + chip =RT3070 ; }else {ERROR (rt2x00dev,"Invalid RT chipset detected.\n" );return -ENODEV ; } + }else if (rt2x00_is_soc (rt2x00dev)) { +#if defined(CONFIG_RALINK_RT288X ) + chip =RT2880 ; +#elif defined(CONFIG_RALINK_RT305X ) + chip =RT3052 ; +#else +BUG (); +#endif } -rt2x00_print_chip (rt2x00dev); + +rt2x00_set_chip (rt2x00dev, chip, value, reg); if (!rt2x00_rf(rt2x00dev, RF2820) && !rt2x00_rf(rt2x00dev, RF2850) &&
drivers/net/wireless/rt2x00/rt2800pci.c +5 -6
@@ -1219,11 +1219,10 @@ MODULE_DEVICE_TABLE(pci, rt2800pci_device_table);MODULE_LICENSE ("GPL" ); #ifdef CONFIG_RT2800PCI_SOC -#if defined(CONFIG_RALINK_RT288X) -__rt2x00soc_probe(RT2880, &rt2800pci_ops); -#elif defined(CONFIG_RALINK_RT305X) -__rt2x00soc_probe(RT3052, &rt2800pci_ops); -#endif +static int rt2800soc_probe(struct platform_device *pdev) +{ + return rt2x00soc_probe(pdev, rt2800pci_ops); +} static struct platform_driver rt2800soc_driver = { .driver = {
@@ -1231,7 +1230,7 @@ static struct platform_driver rt2800soc_driver = { .owner = THIS_MODULE, .mod_name = KBUILD_MODNAME, }, - .probe = __rt2x00soc_probe, + .probe = rt2800soc_probe, .remove = __devexit_p(rt2x00soc_remove), .suspend = rt2x00soc_suspend, .resume = rt2x00soc_resume,
drivers/net/wireless/rt2x00/rt2x00.h +0 -15
@@ -923,22 +923,7 @@ static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev, rt2x00dev->chip.rt = rt; rt2x00dev->chip.rf = rf; rt2x00dev->chip.rev = rev; -} - -static inline void rt2x00_set_chip_rt (struct rt2x00_dev *rt2x00dev, -const u16 rt) -{ - rt2x00dev->chip.rt = rt; -} -static inline void rt2x00_set_chip_rf (struct rt2x00_dev *rt2x00dev, -const u16 rf,const u32 rev) -{ -rt2x00_set_chip (rt2x00dev, rt2x00dev->chip.rt, rf, rev); -} - -static inline void rt2x00_print_chip (struct rt2x00_dev *rt2x00dev) -{INFO (rt2x00dev,"Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n" , rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev);
drivers/net/wireless/rt2x00/rt2x00pci.c +0 -7
@@ -272,7 +272,6 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)struct ieee80211_hw *hw;struct rt2x00_dev *rt2x00dev;int retval; -u16 chip; retval =pci_request_regions (pci_dev,pci_name (pci_dev));if (retval) {
@@ -315,12 +314,6 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)rt2x00_set_chip_intf (rt2x00dev,RT2X00_CHIP_INTF_PCI ); -/* -* Determine RT chipset by reading PCI header. -*/ -pci_read_config_word (pci_dev,PCI_DEVICE_ID , &chip); -rt2x00_set_chip_rt (rt2x00dev, chip); - retval =rt2x00pci_alloc_reg (rt2x00dev);if (retval) goto exit_free_device;
drivers/net/wireless/rt2x00/rt2x00pci.h +1 -0
@@ -27,6 +27,7 @@#define RT2X00PCI_H #include <linux/io.h> +#include <linux/pci.h> /* * This variable should be used with the
drivers/net/wireless/rt2x00/rt2x00soc.c +1 -4
@@ -71,9 +71,7 @@ exit:return -ENOMEM ; } -int rt2x00soc_probe (struct platform_device *pdev, -const unsigned short chipset, -const struct rt2x00_ops *ops) +int rt2x00soc_probe (struct platform_device *pdev,const struct rt2x00_ops *ops) {struct ieee80211_hw *hw;struct rt2x00_dev *rt2x00dev;
@@ -95,7 +93,6 @@ int rt2x00soc_probe(struct platform_device *pdev, rt2x00dev->name = pdev->dev.driver->name;rt2x00_set_chip_intf (rt2x00dev,RT2X00_CHIP_INTF_SOC ); -rt2x00_set_chip_rt (rt2x00dev, chipset); retval =rt2x00soc_alloc_reg (rt2x00dev);if (retval)
drivers/net/wireless/rt2x00/rt2x00soc.h +1 -9
@@ -28,18 +28,10 @@#define KSEG1ADDR (__ptr) __ptr -#define __rt2x00soc_probe (__chipset, __ops) \ -static int __rt2x00soc_probe(struct platform_device *pdev) \ -{ \ - return rt2x00soc_probe(pdev, (__chipset), (__ops)); \ -} -/* * SoC driver handlers. */ -int rt2x00soc_probe (struct platform_device *pdev, -const unsigned short chipset, -const struct rt2x00_ops *ops); +int rt2x00soc_probe (struct platform_device *pdev,const struct rt2x00_ops *ops);int rt2x00soc_remove (struct platform_device *pdev);#ifdef CONFIG_PM int rt2x00soc_suspend (struct platform_device *pdev,pm_message_t state);
drivers/net/wireless/rt2x00/rt61pci.c +7 -2
@@ -2282,6 +2282,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)static int rt61pci_init_eeprom (struct rt2x00_dev *rt2x00dev) {u32 reg; +u16 chip;u16 value;u16 eeprom;
@@ -2291,12 +2292,16 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)rt2x00_eeprom_read (rt2x00dev,EEPROM_ANTENNA , &eeprom);/* +* Identify RT chipset. +*/ +pci_read_config_word (to_pci_dev (rt2x00dev->dev),PCI_DEVICE_ID , &chip); + +/* * Identify RF chipset. */ value =rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RF_TYPE );rt2x00pci_register_read (rt2x00dev,MAC_CSR0 , ®); -rt2x00_set_chip_rf (rt2x00dev, value, reg); -rt2x00_print_chip (rt2x00dev); +rt2x00_set_chip (rt2x00dev, chip, value, reg); if (!rt2x00_rf(rt2x00dev, RF5225) && !rt2x00_rf(rt2x00dev, RF5325) &&
drivers/net/wireless/rt2x00/rt73usb.c +0 -1
@@ -1821,7 +1821,6 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev) value =rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RF_TYPE );rt2x00usb_register_read (rt2x00dev,MAC_CSR0 , ®);rt2x00_set_chip (rt2x00dev,RT2571 , value, reg); -rt2x00_print_chip (rt2x00dev);if (!rt2x00_check_rev (rt2x00dev,0x000ffff0 ,0x25730 ) ||rt2x00_check_rev (rt2x00dev,0x0000000f ,0 )) {
Signature · 1 line
1.6.6.1
PATCH 3/3 rt2x00: rework RT chipset and revision determination for PCI an SOC devices.
The recent rt2800 devices are no longer really identified by their PCI ID's, but rather by the contents of their CSR0 register. Also for the other chipsets is the contents of this CSR0 register important. Change the chipset determination logic to be more aligned with the rt2800 model.
Preparation for the support of rt3070 / rt3090 based devices.
--- drivers/net/wireless/rt2x00/rt2400pci.c | 9 +-- drivers/net/wireless/rt2x00/rt2400pci.h | 1 + drivers/net/wireless/rt2x00/rt2500pci.c | 9 +-- drivers/net/wireless/rt2x00/rt2500pci.h | 1 + drivers/net/wireless/rt2x00/rt2500usb.c | 3 +- drivers/net/wireless/rt2x00/rt2800.h | 14 ++-- drivers/net/wireless/rt2x00/rt2800lib.c | 92 +++++++++++++++-------------- drivers/net/wireless/rt2x00/rt2800usb.c | 20 +++---- drivers/net/wireless/rt2x00/rt2x00.h | 41 ++++++------- drivers/net/wireless/rt2x00/rt2x00debug.c | 4 +- drivers/net/wireless/rt2x00/rt61pci.c | 19 +++---- drivers/net/wireless/rt2x00/rt61pci.h | 9 +++ drivers/net/wireless/rt2x00/rt73usb.c | 6 +- drivers/net/wireless/rt2x00/rt73usb.h | 2 + 14 files changed, 112 insertions(+), 118 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +2 -7
@@ -1327,7 +1327,6 @@ static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)static int rt2400pci_init_eeprom (struct rt2x00_dev *rt2x00dev) {u32 reg; -u16 chip;u16 value;u16 eeprom;
@@ -1337,16 +1336,12 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)rt2x00_eeprom_read (rt2x00dev,EEPROM_ANTENNA , &eeprom);/* -* Identify RT chipset. -*/ -pci_read_config_word (to_pci_dev (rt2x00dev->dev),PCI_DEVICE_ID , &chip); - -/* * Identify RF chipset. */ value =rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RF_TYPE );rt2x00pci_register_read (rt2x00dev,CSR0 , ®); -rt2x00_set_chip (rt2x00dev, chip, value, reg); +rt2x00_set_chip (rt2x00dev,RT2460 , value, +rt2x00_get_field32 (reg,CSR0_REVISION ));if (!rt2x00_rf (rt2x00dev,RF2420 ) && !rt2x00_rf (rt2x00dev,RF2421 )) {ERROR (rt2x00dev,"Invalid RF chipset detected.\n" );
drivers/net/wireless/rt2x00/rt2400pci.h +1 -0
@@ -65,6 +65,7 @@* CSR0: ASIC revision number. */ #define CSR0 0x0000 +#define CSR0_REVISION FIELD32(0x0000ffff)/* * CSR1: System control register.
drivers/net/wireless/rt2x00/rt2500pci.c +2 -7
@@ -1490,7 +1490,6 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)static int rt2500pci_init_eeprom (struct rt2x00_dev *rt2x00dev) {u32 reg; -u16 chip;u16 value;u16 eeprom;
@@ -1500,16 +1499,12 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)rt2x00_eeprom_read (rt2x00dev,EEPROM_ANTENNA , &eeprom);/* -* Identify RT chipset. -*/ -pci_read_config_word (to_pci_dev (rt2x00dev->dev),PCI_DEVICE_ID , &chip); - -/* * Identify RF chipset. */ value =rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RF_TYPE );rt2x00pci_register_read (rt2x00dev,CSR0 , ®); -rt2x00_set_chip (rt2x00dev, chip, value, reg); +rt2x00_set_chip (rt2x00dev,RT2560 , value, +rt2x00_get_field32 (reg,CSR0_REVISION )); if (!rt2x00_rf(rt2x00dev, RF2522) && !rt2x00_rf(rt2x00dev, RF2523) &&
drivers/net/wireless/rt2x00/rt2500pci.h +1 -0
@@ -76,6 +76,7 @@* CSR0: ASIC revision number. */ #define CSR0 0x0000 +#define CSR0_REVISION FIELD32(0x0000ffff)/* * CSR1: System control register.
drivers/net/wireless/rt2x00/rt2500usb.c +1 -2
@@ -1409,8 +1409,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)rt2500usb_register_read (rt2x00dev,MAC_CSR0 , ®);rt2x00_set_chip (rt2x00dev,RT2570 , value, reg); -if (!rt2x00_check_rev (rt2x00dev,0x000ffff0 ,0 ) || -rt2x00_check_rev (rt2x00dev,0x0000000f ,0 )) { +if (((reg &0xfff0 ) !=0 ) || ((reg &0x0000000f ) ==0 )) {ERROR (rt2x00dev,"Invalid RT chipset detected.\n" );return -ENODEV ; }
drivers/net/wireless/rt2x00/rt2800.h +7 -7
@@ -60,11 +60,11 @@/* * Chipset version. */ -#define RT2860C_VERSION 0x28600100 -#define RT2860D_VERSION 0x28600101 -#define RT2880E_VERSION 0x28720200 -#define RT2883_VERSION 0x28830300 -#define RT3070_VERSION 0x30700200 +#define RT2860C_VERSION 0x0100 +#define RT2860D_VERSION 0x0101 +#define RT2880E_VERSION 0x0200 +#define RT2883_VERSION 0x0300 +#define RT3070_VERSION 0x0200/* * Signal information.
@@ -408,8 +408,8 @@* ASIC_VER: 2860 or 2870 */ #define MAC_CSR0 0x1000 -#define MAC_CSR0_ASIC_REV FIELD32(0x0000ffff) -#define MAC_CSR0_ASIC_VER FIELD32(0xffff0000) +#define MAC_CSR0_REVISION FIELD32(0x0000ffff) +#define MAC_CSR0_CHIPSET FIELD32(0xffff0000)/* * MAC_SYS_CTRL:
drivers/net/wireless/rt2x00/rt2800lib.c +47 -45
161 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2800usb.c +9 -11
@@ -92,7 +92,6 @@ static bool rt2800usb_check_crc(const u8 *data, const size_t len)static int rt2800usb_check_firmware (struct rt2x00_dev *rt2x00dev,const u8 *data,const size_t len) { -u16 chipset = (rt2x00_rev (rt2x00dev) >>16 ) &0xffff ;size_t offset =0 ;/*
@@ -111,9 +110,9 @@ static int rt2800usb_check_firmware(struct rt2x00_dev *rt2x00dev,* Check if we need the upper 4kb firmware data or not. */ if ((len ==4096 ) && - (chipset !=0x2860 ) && - (chipset !=0x2872 ) && - (chipset !=0x3070 )) + !rt2x00_rt (rt2x00dev,RT2860 ) && + !rt2x00_rt (rt2x00dev,RT2872 ) && + !rt2x00_rt (rt2x00dev,RT3070 ))return FW_BAD_VERSION ;/*
@@ -138,14 +137,13 @@ static int rt2800usb_load_firmware(struct rt2x00_dev *rt2x00dev,u32 reg;u32 offset;u32 length; -u16 chipset = (rt2x00_rev (rt2x00dev) >>16 ) &0xffff ;/* * Check which section of the firmware we need. */ -if ((chipset ==0x2860 ) || - (chipset ==0x2872 ) || - (chipset ==0x3070 )) { +if (rt2x00_rt (rt2x00dev,RT2860 ) || +rt2x00_rt (rt2x00dev,RT2872 ) || +rt2x00_rt (rt2x00dev,RT3070 )) { offset =0 ; length =4096 ; }else {
@@ -200,9 +198,9 @@ static int rt2800usb_load_firmware(struct rt2x00_dev *rt2x00dev,*/ rt2800_mcu_request (rt2x00dev,MCU_BOOT_SIGNAL ,0xff ,0 ,0 ); -if ((chipset ==0x3070 ) || - (chipset ==0x3071 ) || - (chipset ==0x3572 )) { +if (rt2x00_rt (rt2x00dev,RT3070 ) || +rt2x00_rt (rt2x00dev,RT3071 ) || +rt2x00_rt (rt2x00dev,RT3572 )) {udelay (200 );rt2800_mcu_request (rt2x00dev,MCU_CURRENT ,0 ,0 ,0 );udelay (10 );
drivers/net/wireless/rt2x00/rt2x00.h +18 -23
74 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00debug.c +2 -2
@@ -184,7 +184,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, dump_hdr->data_length =cpu_to_le32 (skb->len); dump_hdr->chip_rt =cpu_to_le16 (rt2x00dev->chip.rt); dump_hdr->chip_rf =cpu_to_le16 (rt2x00dev->chip.rf); - dump_hdr->chip_rev =cpu_to_le32 (rt2x00dev->chip.rev); + dump_hdr->chip_rev =cpu_to_le16 (rt2x00dev->chip.rev); dump_hdr->type =cpu_to_le16 (type); dump_hdr->queue_index = desc->entry->queue->qid; dump_hdr->entry_index = desc->entry->entry_idx;
@@ -573,7 +573,7 @@ static struct dentry *rt2x00debug_create_file_chipset(const char *name, blob->data = data; data +=sprintf (data,"rt chip:\t%04x\n" , intf->rt2x00dev->chip.rt); data +=sprintf (data,"rf chip:\t%04x\n" , intf->rt2x00dev->chip.rf); - data +=sprintf (data,"revision:\t%08x\n" , intf->rt2x00dev->chip.rev); + data +=sprintf (data,"revision:\t%04x\n" , intf->rt2x00dev->chip.rev); data +=sprintf (data,"\n" ); data +=sprintf (data,"register\tbase\twords\twordsize\n" ); data += sprintf(data, "csr\t%d\t%d\t%d\n",
drivers/net/wireless/rt2x00/rt61pci.c +8 -11
@@ -1131,16 +1131,18 @@ dynamic_cca_tune:*/ static char *rt61pci_get_firmware_name (struct rt2x00_dev *rt2x00dev) { +u16 chip;char *fw_name; -switch (rt2x00dev->chip.rt) { -case RT2561 : +pci_read_config_word (to_pci_dev (rt2x00dev->dev),PCI_DEVICE_ID , &chip); +switch (chip) { +case RT2561_PCI_ID : fw_name =FIRMWARE_RT2561 ;break ; -case RT2561s: +case RT2561s_PCI_ID: fw_name = FIRMWARE_RT2561s;break ; -case RT2661 : +case RT2661_PCI_ID : fw_name =FIRMWARE_RT2661 ;break ;default :
@@ -2282,7 +2284,6 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)static int rt61pci_init_eeprom (struct rt2x00_dev *rt2x00dev) {u32 reg; -u16 chip;u16 value;u16 eeprom;
@@ -2292,16 +2293,12 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)rt2x00_eeprom_read (rt2x00dev,EEPROM_ANTENNA , &eeprom);/* -* Identify RT chipset. -*/ -pci_read_config_word (to_pci_dev (rt2x00dev->dev),PCI_DEVICE_ID , &chip); - -/* * Identify RF chipset. */ value =rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RF_TYPE );rt2x00pci_register_read (rt2x00dev,MAC_CSR0 , ®); -rt2x00_set_chip (rt2x00dev, chip, value, reg); +rt2x00_set_chip (rt2x00dev,rt2x00_get_field32 (reg,MAC_CSR0_CHIPSET ), + value,rt2x00_get_field32 (reg,MAC_CSR0_REVISION )); if (!rt2x00_rf(rt2x00dev, RF5225) && !rt2x00_rf(rt2x00dev, RF5325) &&
drivers/net/wireless/rt2x00/rt61pci.h +9 -0
@@ -28,6 +28,13 @@#define RT61PCI_H /* +* RT chip PCI IDs. +*/ +#define RT2561s_PCI_ID 0x0301 +#define RT2561_PCI_ID 0x0302 +#define RT2661_PCI_ID 0x0401 + +/* * RF chip defines. */ #define RF5225 0x0001
@@ -225,6 +232,8 @@ struct hw_pairwise_ta_entry {* MAC_CSR0: ASIC revision number. */ #define MAC_CSR0 0x3000 +#define MAC_CSR0_REVISION FIELD32(0x0000000f) +#define MAC_CSR0_CHIPSET FIELD32(0x000ffff0)/* * MAC_CSR1: System control register.
drivers/net/wireless/rt2x00/rt73usb.c +3 -3
@@ -1820,10 +1820,10 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)*/ value =rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RF_TYPE );rt2x00usb_register_read (rt2x00dev,MAC_CSR0 , ®); -rt2x00_set_chip (rt2x00dev,RT2571 , value, reg); +rt2x00_set_chip (rt2x00dev,rt2x00_get_field32 (reg,MAC_CSR0_CHIPSET ), + value,rt2x00_get_field32 (reg,MAC_CSR0_REVISION )); -if (!rt2x00_check_rev (rt2x00dev,0x000ffff0 ,0x25730 ) || -rt2x00_check_rev (rt2x00dev,0x0000000f ,0 )) { +if (!rt2x00_rt (rt2x00dev,RT2573 ) || (rt2x00_rev (rt2x00dev) ==0 )) {ERROR (rt2x00dev,"Invalid RT chipset detected.\n" );return -ENODEV ; }
drivers/net/wireless/rt2x00/rt73usb.h +2 -0
@@ -142,6 +142,8 @@ struct hw_pairwise_ta_entry {* MAC_CSR0: ASIC revision number. */ #define MAC_CSR0 0x3000 +#define MAC_CSR0_REVISION FIELD32(0x0000000f) +#define MAC_CSR0_CHIPSET FIELD32(0x000ffff0)/* * MAC_CSR1: System control register.
Signature · 1 line
1.6.6.1
Re: [PATCH 3/3] rt2x00: rework RT chipset and revision determination for PCI an SOC devices.
Quoted 8 lines · Gertjan van Wingerde
The recent rt2800 devices are no longer really identified by their PCI ID's, but rather by the contents of their CSR0 register. Also for the other chipsets is the contents of this CSR0 register important. Change the chipset determination logic to be more aligned with the rt2800 model.
Preparation for the support of rt3070 / rt3090 based devices.Signed-off-by Gertjan van Wingerde <[email protected]>
Re: [PATCH 2/3] rt2x00: Reorganize RT chipset setting for PCI/SOC devices.
In reply to Gertjan van WingerdeHi,
drivers/net/wireless/rt2x00/rt2800lib.c line 45
Quoted 9 lines
drivers/net/wireless/rt2x00/rt2800lib.c +3
-0@@ -40,6 +40,9 @@#if defined(CONFIG_RT2X00_LIB_USB ) || defined(CONFIG_RT2X00_LIB_USB_MODULE )#include "rt2x00usb.h" #endif +#if defined(CONFIG_RT2X00_LIB_PCI ) || defined(CONFIG_RT2X00_LIB_PCI_MODULE ) +#include "rt2x00pci.h" +#endif
this is very ugly, but apparently it is unavoidable to make rt2800lib free from PCI and USB specific code... :(
Ivo
Re: [PATCH 2/3] rt2x00: Reorganize RT chipset setting for PCI/SOC devices.
Quoted 14 lines · Ivo van Doorn
Hi,
drivers/net/wireless/rt2x00/rt2800lib.c line 45
Quoted 9 lines
drivers/net/wireless/rt2x00/rt2800lib.c +3
-0@@ -40,6 +40,9 @@#if defined(CONFIG_RT2X00_LIB_USB ) || defined(CONFIG_RT2X00_LIB_USB_MODULE )#include "rt2x00usb.h" #endif +#if defined(CONFIG_RT2X00_LIB_PCI ) || defined(CONFIG_RT2X00_LIB_PCI_MODULE ) +#include "rt2x00pci.h" +#endif this is very ugly, but apparently it is unavoidable to make rt2800lib free from PCI and USB specific code... :(
I was about to write about a related issue. My kernel configuration only enables rt2800pci and rt73 drivers. lsmod shows that rt2800lib depends on rt2x00usb:
# lsmod Module Size Used by rt2800pci 9767 0 rt2800lib 24194 1 rt2800pci rt2x00usb 9474 1 rt2800lib rt2x00pci 5993 1 rt2800pci crc_ccitt 1445 1 rt2800pci rt2x00lib 27776 4 rt2800pci,rt2800lib,rt2x00usb,rt2x00pci mac80211 215322 3 rt2x00usb,rt2x00pci,rt2x00lib cfg80211 144471 2 rt2x00lib,mac80211 eeprom_93cx6 1520 1 rt2800pci
To be clear, the above dependency was not introduced by the patch. It would be nice to straighten it eventually. Maybe the rt2800lib code should look whether rt2800 (not the generic rt2x00) has USB or PCI enabled, both for function calls and for includes.
But I'm happy that rt2800pci is working at all! It was my first chance to test it.
Signature · 2 lines
Regards, Pavel Roskin
Re: [PATCH 2/3] rt2x00: Reorganize RT chipset setting for PCI/SOC devices.
In reply to Ivo van DoornQuoted 15 lines · Ivo van Doorn
Hi,
drivers/net/wireless/rt2x00/rt2800lib.c line 45
Quoted 9 lines
drivers/net/wireless/rt2x00/rt2800lib.c +3
-0@@ -40,6 +40,9 @@#if defined(CONFIG_RT2X00_LIB_USB ) || defined(CONFIG_RT2X00_LIB_USB_MODULE )#include "rt2x00usb.h" #endif +#if defined(CONFIG_RT2X00_LIB_PCI ) || defined(CONFIG_RT2X00_LIB_PCI_MODULE ) +#include "rt2x00pci.h" +#endif this is very ugly, but apparently it is unavoidable to make rt2800lib free from PCI and USB specific code... :(
Actually, this is a temporary situation, and this chunk can be removed again after patch 3 of the series has been applied.
I'll create a cleanup patch to exactly to that.
With respect to the USB specific code, I have to look at if there is a way to resolve that, as the USB specific code is only there in 1 place. Maybe a call-back function to the bus-specific rt2800 drivers could help here.
---
Gertjan.
Re: [PATCH 1/3] rt2x00: Introduce SoC interface type.
In reply to Gertjan van WingerdeQuoted 5 lines · Gertjan van Wingerde
Introduce the SoC interface type to detect SoC devices, instead of having them mimic being PCI devices.
This allows for easier detection of SoC devices.Signed-off-by Gertjan van Wingerde <[email protected]>
Quoted 10 lines · Gertjan van Wingerde
Some general rt2800 detection improvements. This make SOC a special interface, and thus simplifying SOC detection a bit, and unifies rt2800pci and rt2800usb further in detecting with what kind of rt2800 device we are dealing with.
Gertjan van Wingerde (3):
rt2x00: Introduce SoC interface type.
rt2x00: Reorganize RT chipset setting for PCI/SOC devices.
rt2x00: rework RT chipset and revision determination for PCI an SOC
devices.
Tested with rt73usb and rt2800pci. wpa_supplicant is working fine. No new sparse warnings are introduced.
Signature · 2 lines
Regards, Pavel Roskin