aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dn.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/dn.h')
-rw-r--r--include/net/dn.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/net/dn.h b/include/net/dn.h
index 627778384c84..e5469f7b67a3 100644
--- a/include/net/dn.h
+++ b/include/net/dn.h
@@ -4,9 +4,7 @@
4#include <linux/dn.h> 4#include <linux/dn.h>
5#include <net/sock.h> 5#include <net/sock.h>
6#include <asm/byteorder.h> 6#include <asm/byteorder.h>
7 7#include <asm/unaligned.h>
8#define dn_ntohs(x) le16_to_cpu(x)
9#define dn_htons(x) cpu_to_le16(x)
10 8
11struct dn_scp /* Session Control Port */ 9struct dn_scp /* Session Control Port */
12{ 10{
@@ -175,7 +173,7 @@ struct dn_skb_cb {
175 173
176static inline __le16 dn_eth2dn(unsigned char *ethaddr) 174static inline __le16 dn_eth2dn(unsigned char *ethaddr)
177{ 175{
178 return dn_htons(ethaddr[4] | (ethaddr[5] << 8)); 176 return get_unaligned((__le16 *)(ethaddr + 4));
179} 177}
180 178
181static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr) 179static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr)
@@ -185,7 +183,7 @@ static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr)
185 183
186static inline void dn_dn2eth(unsigned char *ethaddr, __le16 addr) 184static inline void dn_dn2eth(unsigned char *ethaddr, __le16 addr)
187{ 185{
188 __u16 a = dn_ntohs(addr); 186 __u16 a = le16_to_cpu(addr);
189 ethaddr[0] = 0xAA; 187 ethaddr[0] = 0xAA;
190 ethaddr[1] = 0x00; 188 ethaddr[1] = 0x00;
191 ethaddr[2] = 0x04; 189 ethaddr[2] = 0x04;