aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-08-01 19:17:48 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-02 15:33:54 -0400
commit574e2af7c0af3273836def5e66f236521bb433c9 (patch)
tree5cfa1b92c82a86426a906ee9203a1548f0e3d993 /include/linux
parente216975ad97cfcfc436789aa66d59a0e93f337f7 (diff)
include: Convert ethernet mac address declarations to use ETH_ALEN
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dm9000.h4
-rw-r--r--include/linux/fs_enet_pd.h3
-rw-r--r--include/linux/ieee80211.h59
-rw-r--r--include/linux/mlx4/device.h11
-rw-r--r--include/linux/mlx4/qp.h5
-rw-r--r--include/linux/mv643xx_eth.h3
-rw-r--r--include/linux/sh_eth.h3
-rw-r--r--include/linux/smsc911x.h3
-rw-r--r--include/linux/uwb/spec.h5
9 files changed, 53 insertions, 43 deletions
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
index 96e87693d933..841925fbfe8a 100644
--- a/include/linux/dm9000.h
+++ b/include/linux/dm9000.h
@@ -14,6 +14,8 @@
14#ifndef __DM9000_PLATFORM_DATA 14#ifndef __DM9000_PLATFORM_DATA
15#define __DM9000_PLATFORM_DATA __FILE__ 15#define __DM9000_PLATFORM_DATA __FILE__
16 16
17#include <linux/if_ether.h>
18
17/* IO control flags */ 19/* IO control flags */
18 20
19#define DM9000_PLATF_8BITONLY (0x0001) 21#define DM9000_PLATF_8BITONLY (0x0001)
@@ -27,7 +29,7 @@
27 29
28struct dm9000_plat_data { 30struct dm9000_plat_data {
29 unsigned int flags; 31 unsigned int flags;
30 unsigned char dev_addr[6]; 32 unsigned char dev_addr[ETH_ALEN];
31 33
32 /* allow replacement IO routines */ 34 /* allow replacement IO routines */
33 35
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
index 51b793466ff3..343d82a54468 100644
--- a/include/linux/fs_enet_pd.h
+++ b/include/linux/fs_enet_pd.h
@@ -18,6 +18,7 @@
18 18
19#include <linux/string.h> 19#include <linux/string.h>
20#include <linux/of_mdio.h> 20#include <linux/of_mdio.h>
21#include <linux/if_ether.h>
21#include <asm/types.h> 22#include <asm/types.h>
22 23
23#define FS_ENET_NAME "fs_enet" 24#define FS_ENET_NAME "fs_enet"
@@ -135,7 +136,7 @@ struct fs_platform_info {
135 const struct fs_mii_bus_info *bus_info; 136 const struct fs_mii_bus_info *bus_info;
136 137
137 int rx_ring, tx_ring; /* number of buffers on rx */ 138 int rx_ring, tx_ring; /* number of buffers on rx */
138 __u8 macaddr[6]; /* mac address */ 139 __u8 macaddr[ETH_ALEN]; /* mac address */
139 int rx_copybreak; /* limit we copy small frames */ 140 int rx_copybreak; /* limit we copy small frames */
140 int use_napi; /* use NAPI */ 141 int use_napi; /* use NAPI */
141 int napi_weight; /* NAPI weight */ 142 int napi_weight; /* NAPI weight */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index b0dc87a2a376..4e101af9c1ff 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -16,6 +16,7 @@
16#define LINUX_IEEE80211_H 16#define LINUX_IEEE80211_H
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/if_ether.h>
19#include <asm/byteorder.h> 20#include <asm/byteorder.h>
20 21
21/* 22/*
@@ -209,28 +210,28 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
209struct ieee80211_hdr { 210struct ieee80211_hdr {
210 __le16 frame_control; 211 __le16 frame_control;
211 __le16 duration_id; 212 __le16 duration_id;
212 u8 addr1[6]; 213 u8 addr1[ETH_ALEN];
213 u8 addr2[6]; 214 u8 addr2[ETH_ALEN];
214 u8 addr3[6]; 215 u8 addr3[ETH_ALEN];
215 __le16 seq_ctrl; 216 __le16 seq_ctrl;
216 u8 addr4[6]; 217 u8 addr4[ETH_ALEN];
217} __packed __aligned(2); 218} __packed __aligned(2);
218 219
219struct ieee80211_hdr_3addr { 220struct ieee80211_hdr_3addr {
220 __le16 frame_control; 221 __le16 frame_control;
221 __le16 duration_id; 222 __le16 duration_id;
222 u8 addr1[6]; 223 u8 addr1[ETH_ALEN];
223 u8 addr2[6]; 224 u8 addr2[ETH_ALEN];
224 u8 addr3[6]; 225 u8 addr3[ETH_ALEN];
225 __le16 seq_ctrl; 226 __le16 seq_ctrl;
226} __packed __aligned(2); 227} __packed __aligned(2);
227 228
228struct ieee80211_qos_hdr { 229struct ieee80211_qos_hdr {
229 __le16 frame_control; 230 __le16 frame_control;
230 __le16 duration_id; 231 __le16 duration_id;
231 u8 addr1[6]; 232 u8 addr1[ETH_ALEN];
232 u8 addr2[6]; 233 u8 addr2[ETH_ALEN];
233 u8 addr3[6]; 234 u8 addr3[ETH_ALEN];
234 __le16 seq_ctrl; 235 __le16 seq_ctrl;
235 __le16 qos_ctrl; 236 __le16 qos_ctrl;
236} __packed __aligned(2); 237} __packed __aligned(2);
@@ -608,8 +609,8 @@ struct ieee80211s_hdr {
608 u8 flags; 609 u8 flags;
609 u8 ttl; 610 u8 ttl;
610 __le32 seqnum; 611 __le32 seqnum;
611 u8 eaddr1[6]; 612 u8 eaddr1[ETH_ALEN];
612 u8 eaddr2[6]; 613 u8 eaddr2[ETH_ALEN];
613} __packed __aligned(2); 614} __packed __aligned(2);
614 615
615/* Mesh flags */ 616/* Mesh flags */
@@ -758,7 +759,7 @@ struct ieee80211_rann_ie {
758 u8 rann_flags; 759 u8 rann_flags;
759 u8 rann_hopcount; 760 u8 rann_hopcount;
760 u8 rann_ttl; 761 u8 rann_ttl;
761 u8 rann_addr[6]; 762 u8 rann_addr[ETH_ALEN];
762 __le32 rann_seq; 763 __le32 rann_seq;
763 __le32 rann_interval; 764 __le32 rann_interval;
764 __le32 rann_metric; 765 __le32 rann_metric;
@@ -802,9 +803,9 @@ enum ieee80211_vht_opmode_bits {
802struct ieee80211_mgmt { 803struct ieee80211_mgmt {
803 __le16 frame_control; 804 __le16 frame_control;
804 __le16 duration; 805 __le16 duration;
805 u8 da[6]; 806 u8 da[ETH_ALEN];
806 u8 sa[6]; 807 u8 sa[ETH_ALEN];
807 u8 bssid[6]; 808 u8 bssid[ETH_ALEN];
808 __le16 seq_ctrl; 809 __le16 seq_ctrl;
809 union { 810 union {
810 struct { 811 struct {
@@ -833,7 +834,7 @@ struct ieee80211_mgmt {
833 struct { 834 struct {
834 __le16 capab_info; 835 __le16 capab_info;
835 __le16 listen_interval; 836 __le16 listen_interval;
836 u8 current_ap[6]; 837 u8 current_ap[ETH_ALEN];
837 /* followed by SSID and Supported rates */ 838 /* followed by SSID and Supported rates */
838 u8 variable[0]; 839 u8 variable[0];
839 } __packed reassoc_req; 840 } __packed reassoc_req;
@@ -966,21 +967,21 @@ struct ieee80211_vendor_ie {
966struct ieee80211_rts { 967struct ieee80211_rts {
967 __le16 frame_control; 968 __le16 frame_control;
968 __le16 duration; 969 __le16 duration;
969 u8 ra[6]; 970 u8 ra[ETH_ALEN];
970 u8 ta[6]; 971 u8 ta[ETH_ALEN];
971} __packed __aligned(2); 972} __packed __aligned(2);
972 973
973struct ieee80211_cts { 974struct ieee80211_cts {
974 __le16 frame_control; 975 __le16 frame_control;
975 __le16 duration; 976 __le16 duration;
976 u8 ra[6]; 977 u8 ra[ETH_ALEN];
977} __packed __aligned(2); 978} __packed __aligned(2);
978 979
979struct ieee80211_pspoll { 980struct ieee80211_pspoll {
980 __le16 frame_control; 981 __le16 frame_control;
981 __le16 aid; 982 __le16 aid;
982 u8 bssid[6]; 983 u8 bssid[ETH_ALEN];
983 u8 ta[6]; 984 u8 ta[ETH_ALEN];
984} __packed __aligned(2); 985} __packed __aligned(2);
985 986
986/* TDLS */ 987/* TDLS */
@@ -989,14 +990,14 @@ struct ieee80211_pspoll {
989struct ieee80211_tdls_lnkie { 990struct ieee80211_tdls_lnkie {
990 u8 ie_type; /* Link Identifier IE */ 991 u8 ie_type; /* Link Identifier IE */
991 u8 ie_len; 992 u8 ie_len;
992 u8 bssid[6]; 993 u8 bssid[ETH_ALEN];
993 u8 init_sta[6]; 994 u8 init_sta[ETH_ALEN];
994 u8 resp_sta[6]; 995 u8 resp_sta[ETH_ALEN];
995} __packed; 996} __packed;
996 997
997struct ieee80211_tdls_data { 998struct ieee80211_tdls_data {
998 u8 da[6]; 999 u8 da[ETH_ALEN];
999 u8 sa[6]; 1000 u8 sa[ETH_ALEN];
1000 __be16 ether_type; 1001 __be16 ether_type;
1001 u8 payload_type; 1002 u8 payload_type;
1002 u8 category; 1003 u8 category;
@@ -1090,8 +1091,8 @@ struct ieee80211_p2p_noa_attr {
1090struct ieee80211_bar { 1091struct ieee80211_bar {
1091 __le16 frame_control; 1092 __le16 frame_control;
1092 __le16 duration; 1093 __le16 duration;
1093 __u8 ra[6]; 1094 __u8 ra[ETH_ALEN];
1094 __u8 ta[6]; 1095 __u8 ta[ETH_ALEN];
1095 __le16 control; 1096 __le16 control;
1096 __le16 start_seq_num; 1097 __le16 start_seq_num;
1097} __packed; 1098} __packed;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 6aebdfe0ed8b..09ef2f448a00 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -33,6 +33,7 @@
33#ifndef MLX4_DEVICE_H 33#ifndef MLX4_DEVICE_H
34#define MLX4_DEVICE_H 34#define MLX4_DEVICE_H
35 35
36#include <linux/if_ether.h>
36#include <linux/pci.h> 37#include <linux/pci.h>
37#include <linux/completion.h> 38#include <linux/completion.h>
38#include <linux/radix-tree.h> 39#include <linux/radix-tree.h>
@@ -620,7 +621,7 @@ struct mlx4_eth_av {
620 u8 dgid[16]; 621 u8 dgid[16];
621 u32 reserved4[2]; 622 u32 reserved4[2];
622 __be16 vlan; 623 __be16 vlan;
623 u8 mac[6]; 624 u8 mac[ETH_ALEN];
624}; 625};
625 626
626union mlx4_ext_av { 627union mlx4_ext_av {
@@ -914,10 +915,10 @@ enum mlx4_net_trans_promisc_mode {
914}; 915};
915 916
916struct mlx4_spec_eth { 917struct mlx4_spec_eth {
917 u8 dst_mac[6]; 918 u8 dst_mac[ETH_ALEN];
918 u8 dst_mac_msk[6]; 919 u8 dst_mac_msk[ETH_ALEN];
919 u8 src_mac[6]; 920 u8 src_mac[ETH_ALEN];
920 u8 src_mac_msk[6]; 921 u8 src_mac_msk[ETH_ALEN];
921 u8 ether_type_enable; 922 u8 ether_type_enable;
922 __be16 ether_type; 923 __be16 ether_type;
923 __be16 vlan_id_msk; 924 __be16 vlan_id_msk;
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 262deac02c9e..6d351473c292 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -34,6 +34,7 @@
34#define MLX4_QP_H 34#define MLX4_QP_H
35 35
36#include <linux/types.h> 36#include <linux/types.h>
37#include <linux/if_ether.h>
37 38
38#include <linux/mlx4/device.h> 39#include <linux/mlx4/device.h>
39 40
@@ -143,7 +144,7 @@ struct mlx4_qp_path {
143 u8 feup; 144 u8 feup;
144 u8 fvl_rx; 145 u8 fvl_rx;
145 u8 reserved4[2]; 146 u8 reserved4[2];
146 u8 dmac[6]; 147 u8 dmac[ETH_ALEN];
147}; 148};
148 149
149enum { /* fl */ 150enum { /* fl */
@@ -318,7 +319,7 @@ struct mlx4_wqe_datagram_seg {
318 __be32 dqpn; 319 __be32 dqpn;
319 __be32 qkey; 320 __be32 qkey;
320 __be16 vlan; 321 __be16 vlan;
321 u8 mac[6]; 322 u8 mac[ETH_ALEN];
322}; 323};
323 324
324struct mlx4_wqe_lso_seg { 325struct mlx4_wqe_lso_seg {
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index 6e8215b15998..61a0da38d0cb 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -6,6 +6,7 @@
6#define __LINUX_MV643XX_ETH_H 6#define __LINUX_MV643XX_ETH_H
7 7
8#include <linux/mbus.h> 8#include <linux/mbus.h>
9#include <linux/if_ether.h>
9 10
10#define MV643XX_ETH_SHARED_NAME "mv643xx_eth" 11#define MV643XX_ETH_SHARED_NAME "mv643xx_eth"
11#define MV643XX_ETH_NAME "mv643xx_eth_port" 12#define MV643XX_ETH_NAME "mv643xx_eth_port"
@@ -48,7 +49,7 @@ struct mv643xx_eth_platform_data {
48 * Use this MAC address if it is valid, overriding the 49 * Use this MAC address if it is valid, overriding the
49 * address that is already in the hardware. 50 * address that is already in the hardware.
50 */ 51 */
51 u8 mac_addr[6]; 52 u8 mac_addr[ETH_ALEN];
52 53
53 /* 54 /*
54 * If speed is 0, autonegotiation is enabled. 55 * If speed is 0, autonegotiation is enabled.
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index fc305713fc6d..6205eeba392b 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -2,6 +2,7 @@
2#define __ASM_SH_ETH_H__ 2#define __ASM_SH_ETH_H__
3 3
4#include <linux/phy.h> 4#include <linux/phy.h>
5#include <linux/if_ether.h>
5 6
6enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; 7enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
7enum { 8enum {
@@ -18,7 +19,7 @@ struct sh_eth_plat_data {
18 phy_interface_t phy_interface; 19 phy_interface_t phy_interface;
19 void (*set_mdio_gate)(void *addr); 20 void (*set_mdio_gate)(void *addr);
20 21
21 unsigned char mac_addr[6]; 22 unsigned char mac_addr[ETH_ALEN];
22 unsigned no_ether_link:1; 23 unsigned no_ether_link:1;
23 unsigned ether_link_active_low:1; 24 unsigned ether_link_active_low:1;
24 unsigned needs_init:1; 25 unsigned needs_init:1;
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h
index 4dde70e74822..eec3efd19beb 100644
--- a/include/linux/smsc911x.h
+++ b/include/linux/smsc911x.h
@@ -22,6 +22,7 @@
22#define __LINUX_SMSC911X_H__ 22#define __LINUX_SMSC911X_H__
23 23
24#include <linux/phy.h> 24#include <linux/phy.h>
25#include <linux/if_ether.h>
25 26
26/* platform_device configuration data, should be assigned to 27/* platform_device configuration data, should be assigned to
27 * the platform_device's dev.platform_data */ 28 * the platform_device's dev.platform_data */
@@ -31,7 +32,7 @@ struct smsc911x_platform_config {
31 unsigned int flags; 32 unsigned int flags;
32 unsigned int shift; 33 unsigned int shift;
33 phy_interface_t phy_interface; 34 phy_interface_t phy_interface;
34 unsigned char mac[6]; 35 unsigned char mac[ETH_ALEN];
35}; 36};
36 37
37/* Constants for platform_device irq polarity configuration */ 38/* Constants for platform_device irq polarity configuration */
diff --git a/include/linux/uwb/spec.h b/include/linux/uwb/spec.h
index b52e44f1bd33..0df24bfcdb38 100644
--- a/include/linux/uwb/spec.h
+++ b/include/linux/uwb/spec.h
@@ -32,6 +32,7 @@
32 32
33#include <linux/types.h> 33#include <linux/types.h>
34#include <linux/bitmap.h> 34#include <linux/bitmap.h>
35#include <linux/if_ether.h>
35 36
36#define i1480_FW 0x00000303 37#define i1480_FW 0x00000303
37/* #define i1480_FW 0x00000302 */ 38/* #define i1480_FW 0x00000302 */
@@ -130,7 +131,7 @@ enum { UWB_DRP_BACKOFF_WIN_MAX = 16 };
130 * it is also used to define headers sent down and up the wire/radio). 131 * it is also used to define headers sent down and up the wire/radio).
131 */ 132 */
132struct uwb_mac_addr { 133struct uwb_mac_addr {
133 u8 data[6]; 134 u8 data[ETH_ALEN];
134} __attribute__((packed)); 135} __attribute__((packed));
135 136
136 137
@@ -568,7 +569,7 @@ struct uwb_rc_evt_confirm {
568/* Device Address Management event. [WHCI] section 3.1.3.2. */ 569/* Device Address Management event. [WHCI] section 3.1.3.2. */
569struct uwb_rc_evt_dev_addr_mgmt { 570struct uwb_rc_evt_dev_addr_mgmt {
570 struct uwb_rceb rceb; 571 struct uwb_rceb rceb;
571 u8 baAddr[6]; 572 u8 baAddr[ETH_ALEN];
572 u8 bResultCode; 573 u8 bResultCode;
573} __attribute__((packed)); 574} __attribute__((packed));
574 575