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

Last change on this file since 21988 was 21988, checked in by nbd, 6 years ago

mac80211: update to wireless-testing 2010-06-28

File size: 769 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  
    451452                common->macaddr[2 * i] = eeval >> 8; 
    452453                common->macaddr[2 * i + 1] = eeval & 0xff; 
    453454        } 
    454         if (sum == 0 || sum == 0xffff * 3) 
    455                 return -EADDRNOTAVAIL; 
     455        if (!is_valid_ether_addr(common->macaddr)) { 
     456                ath_print(common, ATH_DBG_EEPROM, 
     457                        "eeprom contains invalid mac address: %pM\n", 
     458                        common->macaddr); 
     459 
     460                random_ether_addr(common->macaddr); 
     461                ath_print(common, ATH_DBG_EEPROM, 
     462                        "random mac address will be used: %pM\n", 
     463                        common->macaddr); 
     464        } 
    456465 
    457466        return 0; 
    458467} 
Note: See TracBrowser for help on using the repository browser.