Changeset 42494


Ignore:
Timestamp:
2014-09-12T08:52:21+02:00 (3 years ago)
Author:
blogic
Message:

atheros: update ether addresses handling

  • use ether_foo() routines to work with addresses
    • use ETH_ALEN inplace of magic '6'

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/atheros/patches-3.14/100-board.patch

    r42488 r42494  
    8585--- /dev/null 
    8686+++ b/arch/mips/ar231x/board.c 
    87 @@ -0,0 +1,263 @@ 
     87@@ -0,0 +1,260 @@ 
    8888+/* 
    8989+ * This file is subject to the terms and conditions of the GNU General Public 
     
    256256+               pr_warn("WARNING: broken board data detected\n"); 
    257257+               config = ar231x_board.config; 
    258 +               if (!memcmp(config->enet0_mac, "\x00\x00\x00\x00\x00\x00", 6)) { 
     258+               if (is_zero_ether_addr(config->enet0_mac)) { 
    259259+                       pr_info("Fixing up empty mac addresses\n"); 
    260260+                       config->reset_config_gpio = 0xffff; 
     
    267267+       } 
    268268+ 
    269 + 
    270269+       /* Radio config starts 0x100 bytes after board config, regardless 
    271270+        * of what the physical layout on the flash chip looks like */ 
     
    290289+       if (is_broadcast_ether_addr(mac_addr)) { 
    291290+               pr_info("Radio MAC is blank; using board-data\n"); 
    292 +               memcpy(mac_addr, ar231x_board.config->wlan0_mac, ETH_ALEN); 
     291+               ether_addr_copy(mac_addr, ar231x_board.config->wlan0_mac); 
    293292+       } 
    294293+ 
     
    317316+} 
    318317+ 
    319 + 
    320318+asmlinkage void 
    321319+plat_irq_dispatch(void) 
     
    347345+       ar2315_irq_init(); 
    348346+} 
    349 + 
    350347+ 
    351348--- /dev/null 
     
    391388--- /dev/null 
    392389+++ b/arch/mips/include/asm/mach-ar231x/ar231x_platform.h 
    393 @@ -0,0 +1,83 @@ 
     390@@ -0,0 +1,85 @@ 
    394391+#ifndef __ASM_MACH_AR231X_PLATFORM_H 
    395392+#define __ASM_MACH_AR231X_PLATFORM_H 
     393+ 
     394+#include <linux/etherdevice.h> 
    396395+ 
    397396+/* 
     
    436435+       u32 cnt_freq;                /* Calculated C0_COUNT frequency */ 
    437436+ 
    438 +       u8  wlan0_mac[6]; 
    439 +       u8  enet0_mac[6]; 
    440 +       u8  enet1_mac[6]; 
     437+       u8  wlan0_mac[ETH_ALEN]; 
     438+       u8  enet0_mac[ETH_ALEN]; 
     439+       u8  enet1_mac[ETH_ALEN]; 
    441440+ 
    442441+       u16 pci_id;                  /* Pseudo PCIID for common code */ 
     
    444443+ 
    445444+       /* version 3 */ 
    446 +       u8  wlan1_mac[6];            /* (ar5212) */ 
     445+       u8  wlan1_mac[ETH_ALEN];     /* (ar5212) */ 
    447446+}; 
    448447+ 
     
    19301929+ 
    19311930+       /* Fix up MAC addresses if necessary */ 
    1932 +       if (!memcmp(config->enet0_mac, "\xff\xff\xff\xff\xff\xff", 6)) 
    1933 +               memcpy(config->enet0_mac, config->enet1_mac, 6); 
     1931+       if (is_broadcast_ether_addr(config->enet0_mac)) 
     1932+               ether_addr_copy(config->enet0_mac, config->enet1_mac); 
    19341933+ 
    19351934+       /* If ENET0 and ENET1 have the same mac address, 
    19361935+        * increment the one from ENET1 */ 
    1937 +       if (memcmp(config->enet0_mac, config->enet1_mac, 6) == 0) { 
     1936+       if (ether_addr_equal(config->enet0_mac, config->enet1_mac)) { 
    19381937+               c = config->enet1_mac + 5; 
    19391938+               while ((c >= config->enet1_mac) && !(++(*c))) 
Note: See TracChangeset for help on using the changeset viewer.