source: trunk/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch @ 27187

Last change on this file since 27187 was 27187, checked in by hauke, 5 years ago

package/mac80211: Add linux 3.0 compatibility

Add patches from Hauke adding linux 3.0 compatibility.

Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@…>

File size: 732 bytes
  • drivers/net/wireless/ath/ath9k/hw.c

    a b  
    1616 
    1717#include <linux/io.h> 
    1818#include <linux/slab.h> 
     19#include <linux/etherdevice.h> 
    1920#include <asm/unaligned.h> 
    2021 
    2122#include "hw.h" 
    static int ath9k_hw_init_macaddr(struct 
    434435                common->macaddr[2 * i] = eeval >> 8; 
    435436                common->macaddr[2 * i + 1] = eeval & 0xff; 
    436437        } 
    437         if (sum == 0 || sum == 0xffff * 3) 
    438                 return -EADDRNOTAVAIL; 
     438        if (!is_valid_ether_addr(common->macaddr)) { 
     439                ath_err(common, 
     440                        "eeprom contains invalid mac address: %pM\n", 
     441                        common->macaddr); 
     442 
     443                random_ether_addr(common->macaddr); 
     444                ath_err(common, 
     445                        "random mac address will be used: %pM\n", 
     446                        common->macaddr); 
     447        } 
    439448 
    440449        return 0; 
    441450} 
Note: See TracBrowser for help on using the repository browser.