aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2009-02-01 03:45:17 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-01 03:45:17 -0500
commit09640e6365c679b5642b1c41b6d7078f51689ddf (patch)
treea2b80c153bd23fe59db8c6994fda29923819fcea /drivers/net/wan
parentee437770c42088b9b653e8b3bf28a61fa647f84e (diff)
net: replace uses of __constant_{endian}
Base versions handle constant folding now. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/hdlc.c2
-rw-r--r--drivers/net/wan/hdlc_cisco.c16
-rw-r--r--drivers/net/wan/hdlc_fr.c16
-rw-r--r--drivers/net/wan/hdlc_ppp.c4
-rw-r--r--drivers/net/wan/hdlc_raw.c2
-rw-r--r--drivers/net/wan/lapbether.c2
6 files changed, 21 insertions, 21 deletions
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c
index 43da8bd72973..5ce437205558 100644
--- a/drivers/net/wan/hdlc.c
+++ b/drivers/net/wan/hdlc.c
@@ -349,7 +349,7 @@ EXPORT_SYMBOL(attach_hdlc_protocol);
349EXPORT_SYMBOL(detach_hdlc_protocol); 349EXPORT_SYMBOL(detach_hdlc_protocol);
350 350
351static struct packet_type hdlc_packet_type = { 351static struct packet_type hdlc_packet_type = {
352 .type = __constant_htons(ETH_P_HDLC), 352 .type = cpu_to_be16(ETH_P_HDLC),
353 .func = hdlc_rcv, 353 .func = hdlc_rcv,
354}; 354};
355 355
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c
index af3fd4fead8a..cf5fd17ad707 100644
--- a/drivers/net/wan/hdlc_cisco.c
+++ b/drivers/net/wan/hdlc_cisco.c
@@ -117,7 +117,7 @@ static void cisco_keepalive_send(struct net_device *dev, u32 type,
117 data->type = htonl(type); 117 data->type = htonl(type);
118 data->par1 = par1; 118 data->par1 = par1;
119 data->par2 = par2; 119 data->par2 = par2;
120 data->rel = __constant_htons(0xFFFF); 120 data->rel = cpu_to_be16(0xFFFF);
121 /* we will need do_div here if 1000 % HZ != 0 */ 121 /* we will need do_div here if 1000 % HZ != 0 */
122 data->time = htonl((jiffies - INITIAL_JIFFIES) * (1000 / HZ)); 122 data->time = htonl((jiffies - INITIAL_JIFFIES) * (1000 / HZ));
123 123
@@ -136,20 +136,20 @@ static __be16 cisco_type_trans(struct sk_buff *skb, struct net_device *dev)
136 struct hdlc_header *data = (struct hdlc_header*)skb->data; 136 struct hdlc_header *data = (struct hdlc_header*)skb->data;
137 137
138 if (skb->len < sizeof(struct hdlc_header)) 138 if (skb->len < sizeof(struct hdlc_header))
139 return __constant_htons(ETH_P_HDLC); 139 return cpu_to_be16(ETH_P_HDLC);
140 140
141 if (data->address != CISCO_MULTICAST && 141 if (data->address != CISCO_MULTICAST &&
142 data->address != CISCO_UNICAST) 142 data->address != CISCO_UNICAST)
143 return __constant_htons(ETH_P_HDLC); 143 return cpu_to_be16(ETH_P_HDLC);
144 144
145 switch(data->protocol) { 145 switch(data->protocol) {
146 case __constant_htons(ETH_P_IP): 146 case cpu_to_be16(ETH_P_IP):
147 case __constant_htons(ETH_P_IPX): 147 case cpu_to_be16(ETH_P_IPX):
148 case __constant_htons(ETH_P_IPV6): 148 case cpu_to_be16(ETH_P_IPV6):
149 skb_pull(skb, sizeof(struct hdlc_header)); 149 skb_pull(skb, sizeof(struct hdlc_header));
150 return data->protocol; 150 return data->protocol;
151 default: 151 default:
152 return __constant_htons(ETH_P_HDLC); 152 return cpu_to_be16(ETH_P_HDLC);
153 } 153 }
154} 154}
155 155
@@ -194,7 +194,7 @@ static int cisco_rx(struct sk_buff *skb)
194 case CISCO_ADDR_REQ: /* Stolen from syncppp.c :-) */ 194 case CISCO_ADDR_REQ: /* Stolen from syncppp.c :-) */
195 in_dev = dev->ip_ptr; 195 in_dev = dev->ip_ptr;
196 addr = 0; 196 addr = 0;
197 mask = __constant_htonl(~0); /* is the mask correct? */ 197 mask = ~cpu_to_be32(0); /* is the mask correct? */
198 198
199 if (in_dev != NULL) { 199 if (in_dev != NULL) {
200 struct in_ifaddr **ifap = &in_dev->ifa_list; 200 struct in_ifaddr **ifap = &in_dev->ifa_list;
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 70e57cebc955..800530101093 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -278,31 +278,31 @@ static int fr_hard_header(struct sk_buff **skb_p, u16 dlci)
278 struct sk_buff *skb = *skb_p; 278 struct sk_buff *skb = *skb_p;
279 279
280 switch (skb->protocol) { 280 switch (skb->protocol) {
281 case __constant_htons(NLPID_CCITT_ANSI_LMI): 281 case cpu_to_be16(NLPID_CCITT_ANSI_LMI):
282 head_len = 4; 282 head_len = 4;
283 skb_push(skb, head_len); 283 skb_push(skb, head_len);
284 skb->data[3] = NLPID_CCITT_ANSI_LMI; 284 skb->data[3] = NLPID_CCITT_ANSI_LMI;
285 break; 285 break;
286 286
287 case __constant_htons(NLPID_CISCO_LMI): 287 case cpu_to_be16(NLPID_CISCO_LMI):
288 head_len = 4; 288 head_len = 4;
289 skb_push(skb, head_len); 289 skb_push(skb, head_len);
290 skb->data[3] = NLPID_CISCO_LMI; 290 skb->data[3] = NLPID_CISCO_LMI;
291 break; 291 break;
292 292
293 case __constant_htons(ETH_P_IP): 293 case cpu_to_be16(ETH_P_IP):
294 head_len = 4; 294 head_len = 4;
295 skb_push(skb, head_len); 295 skb_push(skb, head_len);
296 skb->data[3] = NLPID_IP; 296 skb->data[3] = NLPID_IP;
297 break; 297 break;
298 298
299 case __constant_htons(ETH_P_IPV6): 299 case cpu_to_be16(ETH_P_IPV6):
300 head_len = 4; 300 head_len = 4;
301 skb_push(skb, head_len); 301 skb_push(skb, head_len);
302 skb->data[3] = NLPID_IPV6; 302 skb->data[3] = NLPID_IPV6;
303 break; 303 break;
304 304
305 case __constant_htons(ETH_P_802_3): 305 case cpu_to_be16(ETH_P_802_3):
306 head_len = 10; 306 head_len = 10;
307 if (skb_headroom(skb) < head_len) { 307 if (skb_headroom(skb) < head_len) {
308 struct sk_buff *skb2 = skb_realloc_headroom(skb, 308 struct sk_buff *skb2 = skb_realloc_headroom(skb,
@@ -426,7 +426,7 @@ static int pvc_xmit(struct sk_buff *skb, struct net_device *dev)
426 skb_put(skb, pad); 426 skb_put(skb, pad);
427 memset(skb->data + len, 0, pad); 427 memset(skb->data + len, 0, pad);
428 } 428 }
429 skb->protocol = __constant_htons(ETH_P_802_3); 429 skb->protocol = cpu_to_be16(ETH_P_802_3);
430 } 430 }
431 if (!fr_hard_header(&skb, pvc->dlci)) { 431 if (!fr_hard_header(&skb, pvc->dlci)) {
432 dev->stats.tx_bytes += skb->len; 432 dev->stats.tx_bytes += skb->len;
@@ -496,10 +496,10 @@ static void fr_lmi_send(struct net_device *dev, int fullrep)
496 memset(skb->data, 0, len); 496 memset(skb->data, 0, len);
497 skb_reserve(skb, 4); 497 skb_reserve(skb, 4);
498 if (lmi == LMI_CISCO) { 498 if (lmi == LMI_CISCO) {
499 skb->protocol = __constant_htons(NLPID_CISCO_LMI); 499 skb->protocol = cpu_to_be16(NLPID_CISCO_LMI);
500 fr_hard_header(&skb, LMI_CISCO_DLCI); 500 fr_hard_header(&skb, LMI_CISCO_DLCI);
501 } else { 501 } else {
502 skb->protocol = __constant_htons(NLPID_CCITT_ANSI_LMI); 502 skb->protocol = cpu_to_be16(NLPID_CCITT_ANSI_LMI);
503 fr_hard_header(&skb, LMI_CCITT_ANSI_DLCI); 503 fr_hard_header(&skb, LMI_CCITT_ANSI_DLCI);
504 } 504 }
505 data = skb_tail_pointer(skb); 505 data = skb_tail_pointer(skb);
diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
index 7b8a5eae201d..72a7cdab4245 100644
--- a/drivers/net/wan/hdlc_ppp.c
+++ b/drivers/net/wan/hdlc_ppp.c
@@ -150,11 +150,11 @@ static __be16 ppp_type_trans(struct sk_buff *skb, struct net_device *dev)
150 return htons(ETH_P_HDLC); 150 return htons(ETH_P_HDLC);
151 151
152 switch (data->protocol) { 152 switch (data->protocol) {
153 case __constant_htons(PID_IP): 153 case cpu_to_be16(PID_IP):
154 skb_pull(skb, sizeof(struct hdlc_header)); 154 skb_pull(skb, sizeof(struct hdlc_header));
155 return htons(ETH_P_IP); 155 return htons(ETH_P_IP);
156 156
157 case __constant_htons(PID_IPV6): 157 case cpu_to_be16(PID_IPV6):
158 skb_pull(skb, sizeof(struct hdlc_header)); 158 skb_pull(skb, sizeof(struct hdlc_header));
159 return htons(ETH_P_IPV6); 159 return htons(ETH_P_IPV6);
160 160
diff --git a/drivers/net/wan/hdlc_raw.c b/drivers/net/wan/hdlc_raw.c
index 6e92c64ebd0f..19f51fdd5522 100644
--- a/drivers/net/wan/hdlc_raw.c
+++ b/drivers/net/wan/hdlc_raw.c
@@ -27,7 +27,7 @@ static int raw_ioctl(struct net_device *dev, struct ifreq *ifr);
27 27
28static __be16 raw_type_trans(struct sk_buff *skb, struct net_device *dev) 28static __be16 raw_type_trans(struct sk_buff *skb, struct net_device *dev)
29{ 29{
30 return __constant_htons(ETH_P_IP); 30 return cpu_to_be16(ETH_P_IP);
31} 31}
32 32
33static struct hdlc_proto proto = { 33static struct hdlc_proto proto = {
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 5b61b3eef45f..da9dcf59de24 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -422,7 +422,7 @@ static int lapbeth_device_event(struct notifier_block *this,
422/* ------------------------------------------------------------------------ */ 422/* ------------------------------------------------------------------------ */
423 423
424static struct packet_type lapbeth_packet_type = { 424static struct packet_type lapbeth_packet_type = {
425 .type = __constant_htons(ETH_P_DEC), 425 .type = cpu_to_be16(ETH_P_DEC),
426 .func = lapbeth_rcv, 426 .func = lapbeth_rcv,
427}; 427};
428 428