diff options
author | Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> | 2014-03-14 16:23:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-14 22:15:25 -0400 |
commit | 376b7bd3558eaf12d3e5c24aa71d0c162d2701fd (patch) | |
tree | 6d73521c4d4eb2d0a41cd848eb311670c7722e14 /net/ieee802154 | |
parent | 177943260a6088bec51fc6c04643d84e43bef423 (diff) |
ieee802154: rename struct ieee802154_addr to *_sa
The struct as currently defined uses host byte order for some fields,
and most big endian/EUI display byte order for other fields. Inside the
stack, endianness should ideally match network byte order where possible
to minimize the number of byteswaps done in critical paths, but this
patch does not address this; it is only preparatory.
Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee802154')
-rw-r--r-- | net/ieee802154/6lowpan_rtnl.c | 4 | ||||
-rw-r--r-- | net/ieee802154/af802154.h | 2 | ||||
-rw-r--r-- | net/ieee802154/af_ieee802154.c | 2 | ||||
-rw-r--r-- | net/ieee802154/dgram.c | 8 | ||||
-rw-r--r-- | net/ieee802154/nl-mac.c | 12 | ||||
-rw-r--r-- | net/ieee802154/reassembly.c | 6 | ||||
-rw-r--r-- | net/ieee802154/reassembly.h | 15 |
7 files changed, 25 insertions, 24 deletions
diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c index 48a8f52b5991..331180e617ca 100644 --- a/net/ieee802154/6lowpan_rtnl.c +++ b/net/ieee802154/6lowpan_rtnl.c | |||
@@ -91,7 +91,7 @@ static int lowpan_header_create(struct sk_buff *skb, | |||
91 | { | 91 | { |
92 | const u8 *saddr = _saddr; | 92 | const u8 *saddr = _saddr; |
93 | const u8 *daddr = _daddr; | 93 | const u8 *daddr = _daddr; |
94 | struct ieee802154_addr sa, da; | 94 | struct ieee802154_addr_sa sa, da; |
95 | 95 | ||
96 | /* TODO: | 96 | /* TODO: |
97 | * if this package isn't ipv6 one, where should it be routed? | 97 | * if this package isn't ipv6 one, where should it be routed? |
@@ -171,7 +171,7 @@ static int lowpan_give_skb_to_devices(struct sk_buff *skb, | |||
171 | static int process_data(struct sk_buff *skb) | 171 | static int process_data(struct sk_buff *skb) |
172 | { | 172 | { |
173 | u8 iphc0, iphc1; | 173 | u8 iphc0, iphc1; |
174 | const struct ieee802154_addr *_saddr, *_daddr; | 174 | const struct ieee802154_addr_sa *_saddr, *_daddr; |
175 | 175 | ||
176 | raw_dump_table(__func__, "raw skb data dump", skb->data, skb->len); | 176 | raw_dump_table(__func__, "raw skb data dump", skb->data, skb->len); |
177 | /* at least two bytes will be used for the encoding */ | 177 | /* at least two bytes will be used for the encoding */ |
diff --git a/net/ieee802154/af802154.h b/net/ieee802154/af802154.h index b1ec52537522..331d15cb93a7 100644 --- a/net/ieee802154/af802154.h +++ b/net/ieee802154/af802154.h | |||
@@ -31,6 +31,6 @@ extern struct proto ieee802154_dgram_prot; | |||
31 | void ieee802154_raw_deliver(struct net_device *dev, struct sk_buff *skb); | 31 | void ieee802154_raw_deliver(struct net_device *dev, struct sk_buff *skb); |
32 | int ieee802154_dgram_deliver(struct net_device *dev, struct sk_buff *skb); | 32 | int ieee802154_dgram_deliver(struct net_device *dev, struct sk_buff *skb); |
33 | struct net_device *ieee802154_get_dev(struct net *net, | 33 | struct net_device *ieee802154_get_dev(struct net *net, |
34 | struct ieee802154_addr *addr); | 34 | struct ieee802154_addr_sa *addr); |
35 | 35 | ||
36 | #endif | 36 | #endif |
diff --git a/net/ieee802154/af_ieee802154.c b/net/ieee802154/af_ieee802154.c index a56ab9c47278..a8db341581ac 100644 --- a/net/ieee802154/af_ieee802154.c +++ b/net/ieee802154/af_ieee802154.c | |||
@@ -44,7 +44,7 @@ | |||
44 | * Utility function for families | 44 | * Utility function for families |
45 | */ | 45 | */ |
46 | struct net_device *ieee802154_get_dev(struct net *net, | 46 | struct net_device *ieee802154_get_dev(struct net *net, |
47 | struct ieee802154_addr *addr) | 47 | struct ieee802154_addr_sa *addr) |
48 | { | 48 | { |
49 | struct net_device *dev = NULL; | 49 | struct net_device *dev = NULL; |
50 | struct net_device *tmp; | 50 | struct net_device *tmp; |
diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index 1846c1fe0d06..405fdf9bf5e1 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c | |||
@@ -41,8 +41,8 @@ static DEFINE_RWLOCK(dgram_lock); | |||
41 | struct dgram_sock { | 41 | struct dgram_sock { |
42 | struct sock sk; | 42 | struct sock sk; |
43 | 43 | ||
44 | struct ieee802154_addr src_addr; | 44 | struct ieee802154_addr_sa src_addr; |
45 | struct ieee802154_addr dst_addr; | 45 | struct ieee802154_addr_sa dst_addr; |
46 | 46 | ||
47 | unsigned int bound:1; | 47 | unsigned int bound:1; |
48 | unsigned int want_ack:1; | 48 | unsigned int want_ack:1; |
@@ -113,7 +113,7 @@ static int dgram_bind(struct sock *sk, struct sockaddr *uaddr, int len) | |||
113 | goto out_put; | 113 | goto out_put; |
114 | } | 114 | } |
115 | 115 | ||
116 | memcpy(&ro->src_addr, &addr->addr, sizeof(struct ieee802154_addr)); | 116 | memcpy(&ro->src_addr, &addr->addr, sizeof(struct ieee802154_addr_sa)); |
117 | 117 | ||
118 | ro->bound = 1; | 118 | ro->bound = 1; |
119 | err = 0; | 119 | err = 0; |
@@ -181,7 +181,7 @@ static int dgram_connect(struct sock *sk, struct sockaddr *uaddr, | |||
181 | goto out; | 181 | goto out; |
182 | } | 182 | } |
183 | 183 | ||
184 | memcpy(&ro->dst_addr, &addr->addr, sizeof(struct ieee802154_addr)); | 184 | memcpy(&ro->dst_addr, &addr->addr, sizeof(struct ieee802154_addr_sa)); |
185 | 185 | ||
186 | out: | 186 | out: |
187 | release_sock(sk); | 187 | release_sock(sk); |
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c index ba5c1e002f37..7ae93e1f8aa0 100644 --- a/net/ieee802154/nl-mac.c +++ b/net/ieee802154/nl-mac.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #include "ieee802154.h" | 40 | #include "ieee802154.h" |
41 | 41 | ||
42 | int ieee802154_nl_assoc_indic(struct net_device *dev, | 42 | int ieee802154_nl_assoc_indic(struct net_device *dev, |
43 | struct ieee802154_addr *addr, u8 cap) | 43 | struct ieee802154_addr_sa *addr, u8 cap) |
44 | { | 44 | { |
45 | struct sk_buff *msg; | 45 | struct sk_buff *msg; |
46 | 46 | ||
@@ -99,7 +99,7 @@ nla_put_failure: | |||
99 | EXPORT_SYMBOL(ieee802154_nl_assoc_confirm); | 99 | EXPORT_SYMBOL(ieee802154_nl_assoc_confirm); |
100 | 100 | ||
101 | int ieee802154_nl_disassoc_indic(struct net_device *dev, | 101 | int ieee802154_nl_disassoc_indic(struct net_device *dev, |
102 | struct ieee802154_addr *addr, u8 reason) | 102 | struct ieee802154_addr_sa *addr, u8 reason) |
103 | { | 103 | { |
104 | struct sk_buff *msg; | 104 | struct sk_buff *msg; |
105 | 105 | ||
@@ -304,7 +304,7 @@ static struct net_device *ieee802154_nl_get_dev(struct genl_info *info) | |||
304 | int ieee802154_associate_req(struct sk_buff *skb, struct genl_info *info) | 304 | int ieee802154_associate_req(struct sk_buff *skb, struct genl_info *info) |
305 | { | 305 | { |
306 | struct net_device *dev; | 306 | struct net_device *dev; |
307 | struct ieee802154_addr addr; | 307 | struct ieee802154_addr_sa addr; |
308 | u8 page; | 308 | u8 page; |
309 | int ret = -EOPNOTSUPP; | 309 | int ret = -EOPNOTSUPP; |
310 | 310 | ||
@@ -351,7 +351,7 @@ out: | |||
351 | int ieee802154_associate_resp(struct sk_buff *skb, struct genl_info *info) | 351 | int ieee802154_associate_resp(struct sk_buff *skb, struct genl_info *info) |
352 | { | 352 | { |
353 | struct net_device *dev; | 353 | struct net_device *dev; |
354 | struct ieee802154_addr addr; | 354 | struct ieee802154_addr_sa addr; |
355 | int ret = -EOPNOTSUPP; | 355 | int ret = -EOPNOTSUPP; |
356 | 356 | ||
357 | if (!info->attrs[IEEE802154_ATTR_STATUS] || | 357 | if (!info->attrs[IEEE802154_ATTR_STATUS] || |
@@ -383,7 +383,7 @@ out: | |||
383 | int ieee802154_disassociate_req(struct sk_buff *skb, struct genl_info *info) | 383 | int ieee802154_disassociate_req(struct sk_buff *skb, struct genl_info *info) |
384 | { | 384 | { |
385 | struct net_device *dev; | 385 | struct net_device *dev; |
386 | struct ieee802154_addr addr; | 386 | struct ieee802154_addr_sa addr; |
387 | int ret = -EOPNOTSUPP; | 387 | int ret = -EOPNOTSUPP; |
388 | 388 | ||
389 | if ((!info->attrs[IEEE802154_ATTR_DEST_HW_ADDR] && | 389 | if ((!info->attrs[IEEE802154_ATTR_DEST_HW_ADDR] && |
@@ -425,7 +425,7 @@ out: | |||
425 | int ieee802154_start_req(struct sk_buff *skb, struct genl_info *info) | 425 | int ieee802154_start_req(struct sk_buff *skb, struct genl_info *info) |
426 | { | 426 | { |
427 | struct net_device *dev; | 427 | struct net_device *dev; |
428 | struct ieee802154_addr addr; | 428 | struct ieee802154_addr_sa addr; |
429 | 429 | ||
430 | u8 channel, bcn_ord, sf_ord; | 430 | u8 channel, bcn_ord, sf_ord; |
431 | u8 page; | 431 | u8 page; |
diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c index 1dae1991883d..f08b37a24b1d 100644 --- a/net/ieee802154/reassembly.c +++ b/net/ieee802154/reassembly.c | |||
@@ -36,8 +36,8 @@ static int lowpan_frag_reasm(struct lowpan_frag_queue *fq, | |||
36 | struct sk_buff *prev, struct net_device *dev); | 36 | struct sk_buff *prev, struct net_device *dev); |
37 | 37 | ||
38 | static unsigned int lowpan_hash_frag(__be16 tag, u16 d_size, | 38 | static unsigned int lowpan_hash_frag(__be16 tag, u16 d_size, |
39 | const struct ieee802154_addr *saddr, | 39 | const struct ieee802154_addr_sa *saddr, |
40 | const struct ieee802154_addr *daddr) | 40 | const struct ieee802154_addr_sa *daddr) |
41 | { | 41 | { |
42 | u32 c; | 42 | u32 c; |
43 | 43 | ||
@@ -103,7 +103,7 @@ out: | |||
103 | 103 | ||
104 | static inline struct lowpan_frag_queue * | 104 | static inline struct lowpan_frag_queue * |
105 | fq_find(struct net *net, const struct ieee802154_frag_info *frag_info, | 105 | fq_find(struct net *net, const struct ieee802154_frag_info *frag_info, |
106 | const struct ieee802154_addr *src, const struct ieee802154_addr *dst) | 106 | const struct ieee802154_addr_sa *src, const struct ieee802154_addr_sa *dst) |
107 | { | 107 | { |
108 | struct inet_frag_queue *q; | 108 | struct inet_frag_queue *q; |
109 | struct lowpan_create_arg arg; | 109 | struct lowpan_create_arg arg; |
diff --git a/net/ieee802154/reassembly.h b/net/ieee802154/reassembly.h index 055518b9da2d..895721ae71e1 100644 --- a/net/ieee802154/reassembly.h +++ b/net/ieee802154/reassembly.h | |||
@@ -6,8 +6,8 @@ | |||
6 | struct lowpan_create_arg { | 6 | struct lowpan_create_arg { |
7 | __be16 tag; | 7 | __be16 tag; |
8 | u16 d_size; | 8 | u16 d_size; |
9 | const struct ieee802154_addr *src; | 9 | const struct ieee802154_addr_sa *src; |
10 | const struct ieee802154_addr *dst; | 10 | const struct ieee802154_addr_sa *dst; |
11 | }; | 11 | }; |
12 | 12 | ||
13 | /* Equivalent of ipv4 struct ip | 13 | /* Equivalent of ipv4 struct ip |
@@ -17,11 +17,11 @@ struct lowpan_frag_queue { | |||
17 | 17 | ||
18 | __be16 tag; | 18 | __be16 tag; |
19 | u16 d_size; | 19 | u16 d_size; |
20 | struct ieee802154_addr saddr; | 20 | struct ieee802154_addr_sa saddr; |
21 | struct ieee802154_addr daddr; | 21 | struct ieee802154_addr_sa daddr; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | static inline u32 ieee802154_addr_hash(const struct ieee802154_addr *a) | 24 | static inline u32 ieee802154_addr_hash(const struct ieee802154_addr_sa *a) |
25 | { | 25 | { |
26 | switch (a->addr_type) { | 26 | switch (a->addr_type) { |
27 | case IEEE802154_ADDR_LONG: | 27 | case IEEE802154_ADDR_LONG: |
@@ -34,8 +34,9 @@ static inline u32 ieee802154_addr_hash(const struct ieee802154_addr *a) | |||
34 | } | 34 | } |
35 | } | 35 | } |
36 | 36 | ||
37 | static inline bool ieee802154_addr_addr_equal(const struct ieee802154_addr *a1, | 37 | static inline bool |
38 | const struct ieee802154_addr *a2) | 38 | ieee802154_addr_addr_equal(const struct ieee802154_addr_sa *a1, |
39 | const struct ieee802154_addr_sa *a2) | ||
39 | { | 40 | { |
40 | if (a1->pan_id != a2->pan_id) | 41 | if (a1->pan_id != a2->pan_id) |
41 | return false; | 42 | return false; |