aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dn_dev.h
diff options
context:
space:
mode:
authorSteven Whitehouse <steve@chygwyn.com>2006-03-21 01:42:39 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 01:42:39 -0500
commitc4ea94ab3710eb2434abe2eab1a479c2dc01f8ac (patch)
tree72e07ca7d2d5fe2de31b3f5a4e64fa411efdf18d /include/net/dn_dev.h
parent2c7946a7bf45ae86736ab3b43d0085e43947945c (diff)
[DECnet]: Endian annotation and fixes for DECnet.
The typedef for dn_address has been removed in favour of using __le16 or __u16 directly as appropriate. All the DECnet header files are updated accordingly. The byte ordering of dn_eth2dn() and dn_dn2eth() are both changed since just about all their callers wanted network order rather than host order, so the conversion is now done in the functions themselves. Several missed endianess conversions have been picked up during the conversion process. The nh_gw field in struct dn_fib_info has been changed from a 32 bit field to 16 bits as it ought to be. One or two cases of using htons rather than dn_htons in the routing code have been found and fixed. There are still a few warnings to fix, but this patch deals with the important cases. Signed-off-by: Steven Whitehouse <steve@chygwyn.com> Signed-off-by: Patrick Caulfield <patrick@tykepenguin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dn_dev.h')
-rw-r--r--include/net/dn_dev.h88
1 files changed, 44 insertions, 44 deletions
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h
index 5a86e78081bf..cee46821dc53 100644
--- a/include/net/dn_dev.h
+++ b/include/net/dn_dev.h
@@ -7,11 +7,11 @@ struct dn_dev;
7struct dn_ifaddr { 7struct dn_ifaddr {
8 struct dn_ifaddr *ifa_next; 8 struct dn_ifaddr *ifa_next;
9 struct dn_dev *ifa_dev; 9 struct dn_dev *ifa_dev;
10 dn_address ifa_local; 10 __le16 ifa_local;
11 dn_address ifa_address; 11 __le16 ifa_address;
12 unsigned char ifa_flags; 12 __u8 ifa_flags;
13 unsigned char ifa_scope; 13 __u8 ifa_scope;
14 char ifa_label[IFNAMSIZ]; 14 char ifa_label[IFNAMSIZ];
15}; 15};
16 16
17#define DN_DEV_S_RU 0 /* Run - working normally */ 17#define DN_DEV_S_RU 0 /* Run - working normally */
@@ -91,7 +91,7 @@ struct dn_dev {
91 struct timer_list timer; 91 struct timer_list timer;
92 unsigned long t3; 92 unsigned long t3;
93 struct neigh_parms *neigh_parms; 93 struct neigh_parms *neigh_parms;
94 unsigned char addr[ETH_ALEN]; 94 __u8 addr[ETH_ALEN];
95 struct neighbour *router; /* Default router on circuit */ 95 struct neighbour *router; /* Default router on circuit */
96 struct neighbour *peer; /* Peer on pointopoint links */ 96 struct neighbour *peer; /* Peer on pointopoint links */
97 unsigned long uptime; /* Time device went up in jiffies */ 97 unsigned long uptime; /* Time device went up in jiffies */
@@ -99,56 +99,56 @@ struct dn_dev {
99 99
100struct dn_short_packet 100struct dn_short_packet
101{ 101{
102 unsigned char msgflg; 102 __u8 msgflg;
103 unsigned short dstnode; 103 __le16 dstnode;
104 unsigned short srcnode; 104 __le16 srcnode;
105 unsigned char forward; 105 __u8 forward;
106} __attribute__((packed)); 106} __attribute__((packed));
107 107
108struct dn_long_packet 108struct dn_long_packet
109{ 109{
110 unsigned char msgflg; 110 __u8 msgflg;
111 unsigned char d_area; 111 __u8 d_area;
112 unsigned char d_subarea; 112 __u8 d_subarea;
113 unsigned char d_id[6]; 113 __u8 d_id[6];
114 unsigned char s_area; 114 __u8 s_area;
115 unsigned char s_subarea; 115 __u8 s_subarea;
116 unsigned char s_id[6]; 116 __u8 s_id[6];
117 unsigned char nl2; 117 __u8 nl2;
118 unsigned char visit_ct; 118 __u8 visit_ct;
119 unsigned char s_class; 119 __u8 s_class;
120 unsigned char pt; 120 __u8 pt;
121} __attribute__((packed)); 121} __attribute__((packed));
122 122
123/*------------------------- DRP - Routing messages ---------------------*/ 123/*------------------------- DRP - Routing messages ---------------------*/
124 124
125struct endnode_hello_message 125struct endnode_hello_message
126{ 126{
127 unsigned char msgflg; 127 __u8 msgflg;
128 unsigned char tiver[3]; 128 __u8 tiver[3];
129 unsigned char id[6]; 129 __u8 id[6];
130 unsigned char iinfo; 130 __u8 iinfo;
131 unsigned short blksize; 131 __le16 blksize;
132 unsigned char area; 132 __u8 area;
133 unsigned char seed[8]; 133 __u8 seed[8];
134 unsigned char neighbor[6]; 134 __u8 neighbor[6];
135 unsigned short timer; 135 __le16 timer;
136 unsigned char mpd; 136 __u8 mpd;
137 unsigned char datalen; 137 __u8 datalen;
138 unsigned char data[2]; 138 __u8 data[2];
139} __attribute__((packed)); 139} __attribute__((packed));
140 140
141struct rtnode_hello_message 141struct rtnode_hello_message
142{ 142{
143 unsigned char msgflg; 143 __u8 msgflg;
144 unsigned char tiver[3]; 144 __u8 tiver[3];
145 unsigned char id[6]; 145 __u8 id[6];
146 unsigned char iinfo; 146 __u8 iinfo;
147 unsigned short blksize; 147 __le16 blksize;
148 unsigned char priority; 148 __u8 priority;
149 unsigned char area; 149 __u8 area;
150 unsigned short timer; 150 __le16 timer;
151 unsigned char mpd; 151 __u8 mpd;
152} __attribute__((packed)); 152} __attribute__((packed));
153 153
154 154
@@ -169,12 +169,12 @@ extern void dn_dev_down(struct net_device *);
169 169
170extern int dn_dev_set_default(struct net_device *dev, int force); 170extern int dn_dev_set_default(struct net_device *dev, int force);
171extern struct net_device *dn_dev_get_default(void); 171extern struct net_device *dn_dev_get_default(void);
172extern int dn_dev_bind_default(dn_address *addr); 172extern int dn_dev_bind_default(__le16 *addr);
173 173
174extern int register_dnaddr_notifier(struct notifier_block *nb); 174extern int register_dnaddr_notifier(struct notifier_block *nb);
175extern int unregister_dnaddr_notifier(struct notifier_block *nb); 175extern int unregister_dnaddr_notifier(struct notifier_block *nb);
176 176
177static inline int dn_dev_islocal(struct net_device *dev, dn_address addr) 177static inline int dn_dev_islocal(struct net_device *dev, __le16 addr)
178{ 178{
179 struct dn_dev *dn_db = dev->dn_ptr; 179 struct dn_dev *dn_db = dev->dn_ptr;
180 struct dn_ifaddr *ifa; 180 struct dn_ifaddr *ifa;