diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-08 03:27:57 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:21:28 -0500 |
commit | 1bc5d4483a83349f143e2bbf23ec144cd7e21e89 (patch) | |
tree | 9e20b3310ca8cbc2b04d12b481c84312afdd4474 /net/bluetooth/bnep | |
parent | e41d21697326a38a0a871c515db88fa310177e24 (diff) |
[BLUETOOTH]: bnep endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bluetooth/bnep')
-rw-r--r-- | net/bluetooth/bnep/bnep.h | 4 | ||||
-rw-r--r-- | net/bluetooth/bnep/core.c | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/net/bluetooth/bnep/bnep.h b/net/bluetooth/bnep/bnep.h index bbb1ed7097a9..0b6cd0e2528d 100644 --- a/net/bluetooth/bnep/bnep.h +++ b/net/bluetooth/bnep/bnep.h | |||
@@ -95,14 +95,14 @@ struct bnep_setup_conn_req { | |||
95 | struct bnep_set_filter_req { | 95 | struct bnep_set_filter_req { |
96 | __u8 type; | 96 | __u8 type; |
97 | __u8 ctrl; | 97 | __u8 ctrl; |
98 | __u16 len; | 98 | __be16 len; |
99 | __u8 list[0]; | 99 | __u8 list[0]; |
100 | } __attribute__((packed)); | 100 | } __attribute__((packed)); |
101 | 101 | ||
102 | struct bnep_control_rsp { | 102 | struct bnep_control_rsp { |
103 | __u8 type; | 103 | __u8 type; |
104 | __u8 ctrl; | 104 | __u8 ctrl; |
105 | __u16 resp; | 105 | __be16 resp; |
106 | } __attribute__((packed)); | 106 | } __attribute__((packed)); |
107 | 107 | ||
108 | struct bnep_ext_hdr { | 108 | struct bnep_ext_hdr { |
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index 4e822f08b87b..7ba6470dc507 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c | |||
@@ -128,7 +128,7 @@ static inline void bnep_set_default_proto_filter(struct bnep_session *s) | |||
128 | } | 128 | } |
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | static int bnep_ctrl_set_netfilter(struct bnep_session *s, u16 *data, int len) | 131 | static int bnep_ctrl_set_netfilter(struct bnep_session *s, __be16 *data, int len) |
132 | { | 132 | { |
133 | int n; | 133 | int n; |
134 | 134 | ||
@@ -180,7 +180,7 @@ static int bnep_ctrl_set_mcfilter(struct bnep_session *s, u8 *data, int len) | |||
180 | if (len < 2) | 180 | if (len < 2) |
181 | return -EILSEQ; | 181 | return -EILSEQ; |
182 | 182 | ||
183 | n = ntohs(get_unaligned((u16 *) data)); | 183 | n = ntohs(get_unaligned((__be16 *) data)); |
184 | data += 2; len -= 2; | 184 | data += 2; len -= 2; |
185 | 185 | ||
186 | if (len < n) | 186 | if (len < n) |
@@ -332,7 +332,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb) | |||
332 | if (!skb_pull(skb, __bnep_rx_hlen[type & BNEP_TYPE_MASK])) | 332 | if (!skb_pull(skb, __bnep_rx_hlen[type & BNEP_TYPE_MASK])) |
333 | goto badframe; | 333 | goto badframe; |
334 | 334 | ||
335 | s->eh.h_proto = get_unaligned((u16 *) (skb->data - 2)); | 335 | s->eh.h_proto = get_unaligned((__be16 *) (skb->data - 2)); |
336 | 336 | ||
337 | if (type & BNEP_EXT_HEADER) { | 337 | if (type & BNEP_EXT_HEADER) { |
338 | if (bnep_rx_extension(s, skb) < 0) | 338 | if (bnep_rx_extension(s, skb) < 0) |
@@ -343,7 +343,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb) | |||
343 | if (ntohs(s->eh.h_proto) == 0x8100) { | 343 | if (ntohs(s->eh.h_proto) == 0x8100) { |
344 | if (!skb_pull(skb, 4)) | 344 | if (!skb_pull(skb, 4)) |
345 | goto badframe; | 345 | goto badframe; |
346 | s->eh.h_proto = get_unaligned((u16 *) (skb->data - 2)); | 346 | s->eh.h_proto = get_unaligned((__be16 *) (skb->data - 2)); |
347 | } | 347 | } |
348 | 348 | ||
349 | /* We have to alloc new skb and copy data here :(. Because original skb | 349 | /* We have to alloc new skb and copy data here :(. Because original skb |
@@ -365,7 +365,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb) | |||
365 | case BNEP_COMPRESSED_SRC_ONLY: | 365 | case BNEP_COMPRESSED_SRC_ONLY: |
366 | memcpy(__skb_put(nskb, ETH_ALEN), s->eh.h_dest, ETH_ALEN); | 366 | memcpy(__skb_put(nskb, ETH_ALEN), s->eh.h_dest, ETH_ALEN); |
367 | memcpy(__skb_put(nskb, ETH_ALEN), skb->mac.raw, ETH_ALEN); | 367 | memcpy(__skb_put(nskb, ETH_ALEN), skb->mac.raw, ETH_ALEN); |
368 | put_unaligned(s->eh.h_proto, (u16 *) __skb_put(nskb, 2)); | 368 | put_unaligned(s->eh.h_proto, (__be16 *) __skb_put(nskb, 2)); |
369 | break; | 369 | break; |
370 | 370 | ||
371 | case BNEP_COMPRESSED_DST_ONLY: | 371 | case BNEP_COMPRESSED_DST_ONLY: |
@@ -375,7 +375,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb) | |||
375 | 375 | ||
376 | case BNEP_GENERAL: | 376 | case BNEP_GENERAL: |
377 | memcpy(__skb_put(nskb, ETH_ALEN * 2), skb->mac.raw, ETH_ALEN * 2); | 377 | memcpy(__skb_put(nskb, ETH_ALEN * 2), skb->mac.raw, ETH_ALEN * 2); |
378 | put_unaligned(s->eh.h_proto, (u16 *) __skb_put(nskb, 2)); | 378 | put_unaligned(s->eh.h_proto, (__be16 *) __skb_put(nskb, 2)); |
379 | break; | 379 | break; |
380 | } | 380 | } |
381 | 381 | ||