605-rt2x00-pci-eeprom.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. -static int rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
  7. +static int rt2800pci_read_eeprom_file(struct rt2x00_dev *rt2x00dev)
  8. {
  9. memcpy(rt2x00dev->eeprom, rt2x00dev->eeprom_file->data, EEPROM_SIZE);
  10. return 0;
  11. @@ -1097,8 +1097,9 @@ static int rt2800pci_read_eeprom(struct
  12. {
  13. int retval;
  14. - if (rt2x00_is_soc(rt2x00dev))
  15. - retval = rt2800pci_read_eeprom_soc(rt2x00dev);
  16. + if (rt2x00_is_soc(rt2x00dev) ||
  17. + test_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags))
  18. + retval = rt2800pci_read_eeprom_file(rt2x00dev);
  19. else if (rt2800pci_efuse_detect(rt2x00dev))
  20. retval = rt2800pci_read_eeprom_efuse(rt2x00dev);
  21. else
  22. --- a/drivers/net/wireless/rt2x00/rt2x00pci.c
  23. +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
  24. @@ -78,6 +78,7 @@ exit:
  25. int rt2x00pci_probe(struct pci_dev *pci_dev, const struct rt2x00_ops *ops)
  26. {
  27. struct ieee80211_hw *hw;
  28. + struct rt2x00_platform_data *pdata;
  29. struct rt2x00_dev *rt2x00dev;
  30. int retval;
  31. u16 chip;
  32. @@ -125,6 +126,12 @@ int rt2x00pci_probe(struct pci_dev *pci_
  33. rt2x00dev->irq = pci_dev->irq;
  34. rt2x00dev->name = pci_name(pci_dev);
  35. + /* if we get passed the name of a eeprom_file_name, then use this in
  36. + favour of the eeprom */
  37. + pdata = rt2x00dev->dev->platform_data;
  38. + if (pdata && pdata->eeprom_file_name)
  39. + set_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags);
  40. +
  41. if (pci_is_pcie(pci_dev))
  42. rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCIE);
  43. else