This patch is for openwrt_12.09 (AA) kernel 3.3.8
 It adds the function for the case that having calibration data in eeprom of 
wifi pci card.
 Compat-wireless provides the way "AH_USE_EEPROM"(see the macro below) to read 
the calibration data, 
 but the ap91_pci_init functionalities does has the correspond API. Thus 
ap91_pci_init() is not perfect.
  
 macro in hw.h of compat-wireless
/* ah_flags */
#define AH_USE_EEPROM   0x1
  
  
 After using the below patch, we can init the card(most of thoes are 5GHz pci 
card, such as AR958x) like thie way:
         ...
         ap91_pci_init(NULL, NULL);
         ...
  
  
 
Signed-off-by: banglang.huang<banglang.hu...@foxmail.com>
---
diff --git a/arch/mips/ath79/dev-ap9x-pci.c b/arch/mips/ath79/dev-ap9x-pci.c
index c08e438..561e9b2 100644
--- a/arch/mips/ath79/dev-ap9x-pci.c
+++ b/arch/mips/ath79/dev-ap9x-pci.c
@@ -92,6 +92,12 @@ static int ap91_pci_plat_dev_init(struct pci_dev *dev)
  return 0;
 }
 
+static int ap91_pci_plat_dev_init_simple(struct pci_dev *dev)
+{
+ dev->dev.platform_data = NULL;
+
+ return 0;
+}
 __init void ap91_pci_init(u8 *cal_data, u8 *mac_addr)
 {
  if (cal_data)
@@ -103,7 +109,11 @@ __init void ap91_pci_init(u8 *cal_data, u8 *mac_addr)
   ap9x_wmac0_data.macaddr = ap9x_wmac0_mac;
  }
 
- ath79_pci_set_plat_dev_init(ap91_pci_plat_dev_init);
+ if((!cal_data) && (!mac_addr))
+  ath79_pci_set_plat_dev_init(ap91_pci_plat_dev_init_simple);
+ else
+  ath79_pci_set_plat_dev_init(ap91_pci_plat_dev_init);
+
  ath79_register_pci();
 
  pci_enable_ath9k_fixup(0, ap9x_wmac0_data.eeprom_data);
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to