]> Pileus Git - ~andy/linux/commitdiff
include: Convert ethernet mac address declarations to use ETH_ALEN
authorJoe Perches <joe@perches.com>
Thu, 1 Aug 2013 23:17:48 +0000 (16:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Aug 2013 19:33:54 +0000 (12:33 -0700)
It's convenient to have ethernet mac addresses use
ETH_ALEN to be able to grep for them a bit easier and
also to ensure that the addresses are __aligned(2).

Add #include <linux/if_ether.h> as necessary.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/dm9000.h
include/linux/fs_enet_pd.h
include/linux/ieee80211.h
include/linux/mlx4/device.h
include/linux/mlx4/qp.h
include/linux/mv643xx_eth.h
include/linux/sh_eth.h
include/linux/smsc911x.h
include/linux/uwb/spec.h
include/media/tveeprom.h
include/net/irda/irlan_common.h

index 96e87693d93349c92563585f1abf59efd8d4c029..841925fbfe8a737f4953deb85cc4f5841be2302b 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef __DM9000_PLATFORM_DATA
 #define __DM9000_PLATFORM_DATA __FILE__
 
+#include <linux/if_ether.h>
+
 /* IO control flags */
 
 #define DM9000_PLATF_8BITONLY  (0x0001)
@@ -27,7 +29,7 @@
 
 struct dm9000_plat_data {
        unsigned int    flags;
-       unsigned char   dev_addr[6];
+       unsigned char   dev_addr[ETH_ALEN];
 
        /* allow replacement IO routines */
 
index 51b793466ff3adcadb4e6bcc0d372494dbf7440c..343d82a5446877c7f641ed27e01fd8927cc48036 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <linux/string.h>
 #include <linux/of_mdio.h>
+#include <linux/if_ether.h>
 #include <asm/types.h>
 
 #define FS_ENET_NAME   "fs_enet"
@@ -135,7 +136,7 @@ struct fs_platform_info {
        const struct fs_mii_bus_info *bus_info;
 
        int rx_ring, tx_ring;   /* number of buffers on rx     */
-       __u8 macaddr[6];        /* mac address                 */
+       __u8 macaddr[ETH_ALEN]; /* mac address                 */
        int rx_copybreak;       /* limit we copy small frames  */
        int use_napi;           /* use NAPI                    */
        int napi_weight;        /* NAPI weight                 */
index b0dc87a2a376e2583d2d28363a0cdd13f859536c..4e101af9c1ff092649c63cac582919ec1a0a035b 100644 (file)
@@ -16,6 +16,7 @@
 #define LINUX_IEEE80211_H
 
 #include <linux/types.h>
+#include <linux/if_ether.h>
 #include <asm/byteorder.h>
 
 /*
@@ -209,28 +210,28 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
 struct ieee80211_hdr {
        __le16 frame_control;
        __le16 duration_id;
-       u8 addr1[6];
-       u8 addr2[6];
-       u8 addr3[6];
+       u8 addr1[ETH_ALEN];
+       u8 addr2[ETH_ALEN];
+       u8 addr3[ETH_ALEN];
        __le16 seq_ctrl;
-       u8 addr4[6];
+       u8 addr4[ETH_ALEN];
 } __packed __aligned(2);
 
 struct ieee80211_hdr_3addr {
        __le16 frame_control;
        __le16 duration_id;
-       u8 addr1[6];
-       u8 addr2[6];
-       u8 addr3[6];
+       u8 addr1[ETH_ALEN];
+       u8 addr2[ETH_ALEN];
+       u8 addr3[ETH_ALEN];
        __le16 seq_ctrl;
 } __packed __aligned(2);
 
 struct ieee80211_qos_hdr {
        __le16 frame_control;
        __le16 duration_id;
-       u8 addr1[6];
-       u8 addr2[6];
-       u8 addr3[6];
+       u8 addr1[ETH_ALEN];
+       u8 addr2[ETH_ALEN];
+       u8 addr3[ETH_ALEN];
        __le16 seq_ctrl;
        __le16 qos_ctrl;
 } __packed __aligned(2);
@@ -608,8 +609,8 @@ struct ieee80211s_hdr {
        u8 flags;
        u8 ttl;
        __le32 seqnum;
-       u8 eaddr1[6];
-       u8 eaddr2[6];
+       u8 eaddr1[ETH_ALEN];
+       u8 eaddr2[ETH_ALEN];
 } __packed __aligned(2);
 
 /* Mesh flags */
@@ -758,7 +759,7 @@ struct ieee80211_rann_ie {
        u8 rann_flags;
        u8 rann_hopcount;
        u8 rann_ttl;
-       u8 rann_addr[6];
+       u8 rann_addr[ETH_ALEN];
        __le32 rann_seq;
        __le32 rann_interval;
        __le32 rann_metric;
@@ -802,9 +803,9 @@ enum ieee80211_vht_opmode_bits {
 struct ieee80211_mgmt {
        __le16 frame_control;
        __le16 duration;
-       u8 da[6];
-       u8 sa[6];
-       u8 bssid[6];
+       u8 da[ETH_ALEN];
+       u8 sa[ETH_ALEN];
+       u8 bssid[ETH_ALEN];
        __le16 seq_ctrl;
        union {
                struct {
@@ -833,7 +834,7 @@ struct ieee80211_mgmt {
                struct {
                        __le16 capab_info;
                        __le16 listen_interval;
-                       u8 current_ap[6];
+                       u8 current_ap[ETH_ALEN];
                        /* followed by SSID and Supported rates */
                        u8 variable[0];
                } __packed reassoc_req;
@@ -966,21 +967,21 @@ struct ieee80211_vendor_ie {
 struct ieee80211_rts {
        __le16 frame_control;
        __le16 duration;
-       u8 ra[6];
-       u8 ta[6];
+       u8 ra[ETH_ALEN];
+       u8 ta[ETH_ALEN];
 } __packed __aligned(2);
 
 struct ieee80211_cts {
        __le16 frame_control;
        __le16 duration;
-       u8 ra[6];
+       u8 ra[ETH_ALEN];
 } __packed __aligned(2);
 
 struct ieee80211_pspoll {
        __le16 frame_control;
        __le16 aid;
-       u8 bssid[6];
-       u8 ta[6];
+       u8 bssid[ETH_ALEN];
+       u8 ta[ETH_ALEN];
 } __packed __aligned(2);
 
 /* TDLS */
@@ -989,14 +990,14 @@ struct ieee80211_pspoll {
 struct ieee80211_tdls_lnkie {
        u8 ie_type; /* Link Identifier IE */
        u8 ie_len;
-       u8 bssid[6];
-       u8 init_sta[6];
-       u8 resp_sta[6];
+       u8 bssid[ETH_ALEN];
+       u8 init_sta[ETH_ALEN];
+       u8 resp_sta[ETH_ALEN];
 } __packed;
 
 struct ieee80211_tdls_data {
-       u8 da[6];
-       u8 sa[6];
+       u8 da[ETH_ALEN];
+       u8 sa[ETH_ALEN];
        __be16 ether_type;
        u8 payload_type;
        u8 category;
@@ -1090,8 +1091,8 @@ struct ieee80211_p2p_noa_attr {
 struct ieee80211_bar {
        __le16 frame_control;
        __le16 duration;
-       __u8 ra[6];
-       __u8 ta[6];
+       __u8 ra[ETH_ALEN];
+       __u8 ta[ETH_ALEN];
        __le16 control;
        __le16 start_seq_num;
 } __packed;
index 6aebdfe0ed8be7e88d6fd02cfe562c5a0680c9c6..09ef2f448a001f6771852f87215437b1e0561fa7 100644 (file)
@@ -33,6 +33,7 @@
 #ifndef MLX4_DEVICE_H
 #define MLX4_DEVICE_H
 
+#include <linux/if_ether.h>
 #include <linux/pci.h>
 #include <linux/completion.h>
 #include <linux/radix-tree.h>
@@ -620,7 +621,7 @@ struct mlx4_eth_av {
        u8              dgid[16];
        u32             reserved4[2];
        __be16          vlan;
-       u8              mac[6];
+       u8              mac[ETH_ALEN];
 };
 
 union mlx4_ext_av {
@@ -914,10 +915,10 @@ enum mlx4_net_trans_promisc_mode {
 };
 
 struct mlx4_spec_eth {
-       u8      dst_mac[6];
-       u8      dst_mac_msk[6];
-       u8      src_mac[6];
-       u8      src_mac_msk[6];
+       u8      dst_mac[ETH_ALEN];
+       u8      dst_mac_msk[ETH_ALEN];
+       u8      src_mac[ETH_ALEN];
+       u8      src_mac_msk[ETH_ALEN];
        u8      ether_type_enable;
        __be16  ether_type;
        __be16  vlan_id_msk;
index 262deac02c9ea87cdf5e3dea5cc64fc15bdd6e08..6d351473c29200526a98bbbf275b479f79cfa146 100644 (file)
@@ -34,6 +34,7 @@
 #define MLX4_QP_H
 
 #include <linux/types.h>
+#include <linux/if_ether.h>
 
 #include <linux/mlx4/device.h>
 
@@ -143,7 +144,7 @@ struct mlx4_qp_path {
        u8                      feup;
        u8                      fvl_rx;
        u8                      reserved4[2];
-       u8                      dmac[6];
+       u8                      dmac[ETH_ALEN];
 };
 
 enum { /* fl */
@@ -318,7 +319,7 @@ struct mlx4_wqe_datagram_seg {
        __be32                  dqpn;
        __be32                  qkey;
        __be16                  vlan;
-       u8                      mac[6];
+       u8                      mac[ETH_ALEN];
 };
 
 struct mlx4_wqe_lso_seg {
index 6e8215b159982378847cc7aacd75747da9c604d6..61a0da38d0cbc163e88b46e0b0fdf0fb50c62934 100644 (file)
@@ -6,6 +6,7 @@
 #define __LINUX_MV643XX_ETH_H
 
 #include <linux/mbus.h>
+#include <linux/if_ether.h>
 
 #define MV643XX_ETH_SHARED_NAME                "mv643xx_eth"
 #define MV643XX_ETH_NAME               "mv643xx_eth_port"
@@ -48,7 +49,7 @@ struct mv643xx_eth_platform_data {
         * Use this MAC address if it is valid, overriding the
         * address that is already in the hardware.
         */
-       u8                      mac_addr[6];
+       u8                      mac_addr[ETH_ALEN];
 
        /*
         * If speed is 0, autonegotiation is enabled.
index fc305713fc6d4e09d05ef30dd1be1ce24407cfd4..6205eeba392b6b72d80d26bb55ce1b5df8b48afe 100644 (file)
@@ -2,6 +2,7 @@
 #define __ASM_SH_ETH_H__
 
 #include <linux/phy.h>
+#include <linux/if_ether.h>
 
 enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
 enum {
@@ -18,7 +19,7 @@ struct sh_eth_plat_data {
        phy_interface_t phy_interface;
        void (*set_mdio_gate)(void *addr);
 
-       unsigned char mac_addr[6];
+       unsigned char mac_addr[ETH_ALEN];
        unsigned no_ether_link:1;
        unsigned ether_link_active_low:1;
        unsigned needs_init:1;
index 4dde70e74822be5d13198a15c0816978f3ff4b2a..eec3efd19beb0b8fb059acd97939f0efba09d7fb 100644 (file)
@@ -22,6 +22,7 @@
 #define __LINUX_SMSC911X_H__
 
 #include <linux/phy.h>
+#include <linux/if_ether.h>
 
 /* platform_device configuration data, should be assigned to
  * the platform_device's dev.platform_data */
@@ -31,7 +32,7 @@ struct smsc911x_platform_config {
        unsigned int flags;
        unsigned int shift;
        phy_interface_t phy_interface;
-       unsigned char mac[6];
+       unsigned char mac[ETH_ALEN];
 };
 
 /* Constants for platform_device irq polarity configuration */
index b52e44f1bd33039b6317e6702212138275db2c45..0df24bfcdb3891408556253a5602cf0d9ddb0ffd 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <linux/types.h>
 #include <linux/bitmap.h>
+#include <linux/if_ether.h>
 
 #define i1480_FW 0x00000303
 /* #define i1480_FW 0x00000302 */
@@ -130,7 +131,7 @@ enum { UWB_DRP_BACKOFF_WIN_MAX = 16 };
  * it is also used to define headers sent down and up the wire/radio).
  */
 struct uwb_mac_addr {
-       u8 data[6];
+       u8 data[ETH_ALEN];
 } __attribute__((packed));
 
 
@@ -568,7 +569,7 @@ struct uwb_rc_evt_confirm {
 /* Device Address Management event. [WHCI] section 3.1.3.2. */
 struct uwb_rc_evt_dev_addr_mgmt {
        struct uwb_rceb rceb;
-       u8 baAddr[6];
+       u8 baAddr[ETH_ALEN];
        u8 bResultCode;
 } __attribute__((packed));
 
index 4a1191abd936df57986be2f99b44cfcd1f0203ee..f7119ee3977b22541cb5faa8d0282d62b435fe2c 100644 (file)
@@ -12,6 +12,8 @@ enum tveeprom_audio_processor {
        TVEEPROM_AUDPROC_OTHER,
 };
 
+#include <linux/if_ether.h>
+
 struct tveeprom {
        u32 has_radio;
        /* If has_ir == 0, then it is unknown what the IR capabilities are,
@@ -40,7 +42,7 @@ struct tveeprom {
        u32 revision;
        u32 serial_number;
        char rev_str[5];
-       u8 MAC_address[6];
+       u8 MAC_address[ETH_ALEN];
 };
 
 void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
index 0af8b8dfbc227898badec117e2abe759889f8a20..550c2d6ec7ffefdaaf40c528042d19d8955bf090 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/types.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
+#include <linux/if_ether.h>
 
 #include <net/irda/irttp.h>
 
@@ -161,7 +162,7 @@ struct irlan_provider_cb {
        int access_type;     /* Access type */
        __u16 send_arb_val;
 
-       __u8 mac_address[6]; /* Generated MAC address for peer device */
+       __u8 mac_address[ETH_ALEN]; /* Generated MAC address for peer device */
 };
 
 /*