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

Last change on this file since 14532 was 14532, checked in by juhosg, 8 years ago

[package] mac80211: update compat-wireless to 2009-02-15

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

    a b static int ath9k_hw_init_macaddr(struct  
    493493                ah->macaddr[2 * i] = eeval >> 8; 
    494494                ah->macaddr[2 * i + 1] = eeval & 0xff; 
    495495        } 
    496         if (sum == 0 || sum == 0xffff * 3) { 
     496 
     497        if (!is_valid_ether_addr(ah->macaddr)) { 
     498                DECLARE_MAC_BUF(macbuf); 
     499 
     500                DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, 
     501                        "eeprom contains invalid mac address: %s\n", 
     502                        print_mac(macbuf, ah->macaddr)); 
     503 
     504                random_ether_addr(ah->macaddr); 
    497505                DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, 
    498                         "mac address read failed: %pM\n", 
    499                         ah->macaddr); 
    500                 return -EADDRNOTAVAIL; 
     506                        "random mac address will be used: %s\n", 
     507                        print_mac(macbuf, ah->macaddr)); 
    501508        } 
    502509 
    503510        return 0; 
Note: See TracBrowser for help on using the repository browser.