aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/hdlc_fr.c
diff options
context:
space:
mode:
authorKrzysztof Halasa <khc@pm.waw.pl>2007-04-27 07:13:33 -0400
committerJeff Garzik <jeff@garzik.org>2007-04-28 11:01:07 -0400
commitabf17ffda7b7b6c83a29d7ccea91d46065c6ca3e (patch)
tree1ef35e54cb8bfc2fbaf9c1b2b821b5ef7f6bd1c5 /drivers/net/wan/hdlc_fr.c
parent27345bb684140f5f306963e0d6e25a60c7857dfe (diff)
Generic HDLC sparse annotations
Sparse annotations, including two minor bugfixes. Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/wan/hdlc_fr.c')
-rw-r--r--drivers/net/wan/hdlc_fr.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index aeb2789adf26..15b6e07a4382 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -288,31 +288,31 @@ static int fr_hard_header(struct sk_buff **skb_p, u16 dlci)
288 struct sk_buff *skb = *skb_p; 288 struct sk_buff *skb = *skb_p;
289 289
290 switch (skb->protocol) { 290 switch (skb->protocol) {
291 case __constant_ntohs(NLPID_CCITT_ANSI_LMI): 291 case __constant_htons(NLPID_CCITT_ANSI_LMI):
292 head_len = 4; 292 head_len = 4;
293 skb_push(skb, head_len); 293 skb_push(skb, head_len);
294 skb->data[3] = NLPID_CCITT_ANSI_LMI; 294 skb->data[3] = NLPID_CCITT_ANSI_LMI;
295 break; 295 break;
296 296
297 case __constant_ntohs(NLPID_CISCO_LMI): 297 case __constant_htons(NLPID_CISCO_LMI):
298 head_len = 4; 298 head_len = 4;
299 skb_push(skb, head_len); 299 skb_push(skb, head_len);
300 skb->data[3] = NLPID_CISCO_LMI; 300 skb->data[3] = NLPID_CISCO_LMI;
301 break; 301 break;
302 302
303 case __constant_ntohs(ETH_P_IP): 303 case __constant_htons(ETH_P_IP):
304 head_len = 4; 304 head_len = 4;
305 skb_push(skb, head_len); 305 skb_push(skb, head_len);
306 skb->data[3] = NLPID_IP; 306 skb->data[3] = NLPID_IP;
307 break; 307 break;
308 308
309 case __constant_ntohs(ETH_P_IPV6): 309 case __constant_htons(ETH_P_IPV6):
310 head_len = 4; 310 head_len = 4;
311 skb_push(skb, head_len); 311 skb_push(skb, head_len);
312 skb->data[3] = NLPID_IPV6; 312 skb->data[3] = NLPID_IPV6;
313 break; 313 break;
314 314
315 case __constant_ntohs(ETH_P_802_3): 315 case __constant_htons(ETH_P_802_3):
316 head_len = 10; 316 head_len = 10;
317 if (skb_headroom(skb) < head_len) { 317 if (skb_headroom(skb) < head_len) {
318 struct sk_buff *skb2 = skb_realloc_headroom(skb, 318 struct sk_buff *skb2 = skb_realloc_headroom(skb,
@@ -340,7 +340,7 @@ static int fr_hard_header(struct sk_buff **skb_p, u16 dlci)
340 skb->data[5] = FR_PAD; 340 skb->data[5] = FR_PAD;
341 skb->data[6] = FR_PAD; 341 skb->data[6] = FR_PAD;
342 skb->data[7] = FR_PAD; 342 skb->data[7] = FR_PAD;
343 *(u16*)(skb->data + 8) = skb->protocol; 343 *(__be16*)(skb->data + 8) = skb->protocol;
344 } 344 }
345 345
346 dlci_to_q922(skb->data, dlci); 346 dlci_to_q922(skb->data, dlci);
@@ -974,8 +974,8 @@ static int fr_rx(struct sk_buff *skb)
974 974
975 } else if (skb->len > 10 && data[3] == FR_PAD && 975 } else if (skb->len > 10 && data[3] == FR_PAD &&
976 data[4] == NLPID_SNAP && data[5] == FR_PAD) { 976 data[4] == NLPID_SNAP && data[5] == FR_PAD) {
977 u16 oui = ntohs(*(u16*)(data + 6)); 977 u16 oui = ntohs(*(__be16*)(data + 6));
978 u16 pid = ntohs(*(u16*)(data + 8)); 978 u16 pid = ntohs(*(__be16*)(data + 8));
979 skb_pull(skb, 10); 979 skb_pull(skb, 10);
980 980
981 switch ((((u32)oui) << 16) | pid) { 981 switch ((((u32)oui) << 16) | pid) {
@@ -1127,7 +1127,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
1127 memcpy(dev->dev_addr, "\x00\x01", 2); 1127 memcpy(dev->dev_addr, "\x00\x01", 2);
1128 get_random_bytes(dev->dev_addr + 2, ETH_ALEN - 2); 1128 get_random_bytes(dev->dev_addr + 2, ETH_ALEN - 2);
1129 } else { 1129 } else {
1130 *(u16*)dev->dev_addr = htons(dlci); 1130 *(__be16*)dev->dev_addr = htons(dlci);
1131 dlci_to_q922(dev->broadcast, dlci); 1131 dlci_to_q922(dev->broadcast, dlci);
1132 } 1132 }
1133 dev->hard_start_xmit = pvc_xmit; 1133 dev->hard_start_xmit = pvc_xmit;