source: trunk/target/linux/ar71xx/patches-3.3/501-MIPS-ath79-add-mac-argument-to-ath79_register_wmac.patch @ 31602

Last change on this file since 31602 was 31602, checked in by juhosg, 5 years ago

ar71xx: update 3.3 patches

File size: 2.4 KB
  • arch/mips/ath79/dev-wmac.c

    a b  
    1515#include <linux/init.h> 
    1616#include <linux/delay.h> 
    1717#include <linux/irq.h> 
     18#include <linux/etherdevice.h> 
    1819#include <linux/platform_device.h> 
    1920#include <linux/ath9k_platform.h> 
    2021 
     
    2223#include <asm/mach-ath79/ar71xx_regs.h> 
    2324#include "dev-wmac.h" 
    2425 
     26static u8 ath79_wmac_mac[ETH_ALEN]; 
    2527static struct ath9k_platform_data ath79_wmac_data; 
    2628 
    2729static struct resource ath79_wmac_resources[] = { 
    static void ar934x_wmac_setup(void) 
    116118                ath79_wmac_data.is_clk_25mhz = true; 
    117119} 
    118120 
    119 void __init ath79_register_wmac(u8 *cal_data) 
     121void __init ath79_register_wmac(u8 *cal_data, u8 *mac_addr) 
    120122{ 
    121123        if (soc_is_ar913x()) 
    122124                ar913x_wmac_setup(); 
    void __init ath79_register_wmac(u8 *cal_ 
    131133                memcpy(ath79_wmac_data.eeprom_data, cal_data, 
    132134                       sizeof(ath79_wmac_data.eeprom_data)); 
    133135 
     136        if (mac_addr) { 
     137                memcpy(ath79_wmac_mac, mac_addr, sizeof(ath79_wmac_mac)); 
     138                ath79_wmac_data.macaddr = ath79_wmac_mac; 
     139        } 
     140 
    134141        platform_device_register(&ath79_wmac_device); 
    135142} 
  • arch/mips/ath79/dev-wmac.h

    a b  
    1212#ifndef _ATH79_DEV_WMAC_H 
    1313#define _ATH79_DEV_WMAC_H 
    1414 
    15 void ath79_register_wmac(u8 *cal_data); 
     15void ath79_register_wmac(u8 *cal_data, u8 *mac_addr); 
    1616 
    1717#endif /* _ATH79_DEV_WMAC_H */ 
  • arch/mips/ath79/mach-ap81.c

    a b static void __init ap81_setup(void) 
    9898                                        ap81_gpio_keys); 
    9999        ath79_register_spi(&ap81_spi_data, ap81_spi_info, 
    100100                           ARRAY_SIZE(ap81_spi_info)); 
    101         ath79_register_wmac(cal_data); 
     101        ath79_register_wmac(cal_data, NULL); 
    102102        ath79_register_usb(); 
    103103} 
    104104 
  • arch/mips/ath79/mach-db120.c

    a b static void __init db120_setup(void) 
    134134        ath79_register_spi(&db120_spi_data, db120_spi_info, 
    135135                           ARRAY_SIZE(db120_spi_info)); 
    136136        ath79_register_usb(); 
    137         ath79_register_wmac(art + DB120_WMAC_CALDATA_OFFSET); 
     137        ath79_register_wmac(art + DB120_WMAC_CALDATA_OFFSET, NULL); 
    138138        db120_pci_init(art + DB120_PCIE_CALDATA_OFFSET); 
    139139} 
    140140 
  • arch/mips/ath79/mach-ap121.c

    a b static void __init ap121_setup(void) 
    9191        ath79_register_spi(&ap121_spi_data, ap121_spi_info, 
    9292                           ARRAY_SIZE(ap121_spi_info)); 
    9393        ath79_register_usb(); 
    94         ath79_register_wmac(cal_data); 
     94        ath79_register_wmac(cal_data, NULL); 
    9595} 
    9696 
    9797MIPS_MACHINE(ATH79_MACH_AP121, "AP121", "Atheros AP121 reference board", 
Note: See TracBrowser for help on using the repository browser.