mac80211: update to wireless-testing 2013-06-27, fix ATH_USER_REGD handling
[openwrt/svn-archive/archive.git] / package / kernel / mac80211 / patches / 605-rt2x00-pci-eeprom.patch
1 --- a/drivers/net/wireless/rt2x00/rt2800pci.c
2 +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
3 @@ -90,7 +90,7 @@ static void rt2800pci_mcu_status(struct
4 rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
5 }
6
7 -static int rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
8 +static int rt2800pci_read_eeprom_file(struct rt2x00_dev *rt2x00dev)
9 {
10 memcpy(rt2x00dev->eeprom, rt2x00dev->eeprom_file->data, EEPROM_SIZE);
11 return 0;
12 @@ -1093,8 +1093,9 @@ static int rt2800pci_read_eeprom(struct
13 {
14 int retval;
15
16 - if (rt2x00_is_soc(rt2x00dev))
17 - retval = rt2800pci_read_eeprom_soc(rt2x00dev);
18 + if (rt2x00_is_soc(rt2x00dev) ||
19 + test_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags))
20 + retval = rt2800pci_read_eeprom_file(rt2x00dev);
21 else if (rt2800pci_efuse_detect(rt2x00dev))
22 retval = rt2800pci_read_eeprom_efuse(rt2x00dev);
23 else
24 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c
25 +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
26 @@ -78,6 +78,7 @@ exit:
27 int rt2x00pci_probe(struct pci_dev *pci_dev, const struct rt2x00_ops *ops)
28 {
29 struct ieee80211_hw *hw;
30 + struct rt2x00_platform_data *pdata;
31 struct rt2x00_dev *rt2x00dev;
32 int retval;
33 u16 chip;
34 @@ -125,6 +126,12 @@ int rt2x00pci_probe(struct pci_dev *pci_
35 rt2x00dev->irq = pci_dev->irq;
36 rt2x00dev->name = pci_name(pci_dev);
37
38 + /* if we get passed the name of a eeprom_file_name, then use this in
39 + favour of the eeprom */
40 + pdata = rt2x00dev->dev->platform_data;
41 + if (pdata && pdata->eeprom_file_name)
42 + set_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags);
43 +
44 if (pci_is_pcie(pci_dev))
45 rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCIE);
46 else