aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm
diff options
context:
space:
mode:
Diffstat (limited to 'net/atm')
-rw-r--r--net/atm/br2684.c8
-rw-r--r--net/atm/clip.c4
-rw-r--r--net/atm/ioctl.c3
-rw-r--r--net/atm/lec.c15
-rw-r--r--net/atm/mpc.c17
-rw-r--r--net/atm/signaling.c2
6 files changed, 27 insertions, 22 deletions
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index ec4ebd3299e3..0e9f00c5c899 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -173,7 +173,7 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
173 } 173 }
174 skb_push(skb, minheadroom); 174 skb_push(skb, minheadroom);
175 if (brvcc->encaps == e_llc) 175 if (brvcc->encaps == e_llc)
176 memcpy(skb->data, llc_oui_pid_pad, 10); 176 skb_copy_to_linear_data(skb, llc_oui_pid_pad, 10);
177 else 177 else
178 memset(skb->data, 0, 2); 178 memset(skb->data, 0, 2);
179#endif /* FASTER_VERSION */ 179#endif /* FASTER_VERSION */
@@ -375,11 +375,11 @@ packet_fails_filter(__be16 type, struct br2684_vcc *brvcc, struct sk_buff *skb)
375{ 375{
376 if (brvcc->filter.netmask == 0) 376 if (brvcc->filter.netmask == 0)
377 return 0; /* no filter in place */ 377 return 0; /* no filter in place */
378 if (type == __constant_htons(ETH_P_IP) && 378 if (type == htons(ETH_P_IP) &&
379 (((struct iphdr *) (skb->data))->daddr & brvcc->filter. 379 (((struct iphdr *) (skb->data))->daddr & brvcc->filter.
380 netmask) == brvcc->filter.prefix) 380 netmask) == brvcc->filter.prefix)
381 return 0; 381 return 0;
382 if (type == __constant_htons(ETH_P_ARP)) 382 if (type == htons(ETH_P_ARP))
383 return 0; 383 return 0;
384 /* TODO: we should probably filter ARPs too.. don't want to have 384 /* TODO: we should probably filter ARPs too.. don't want to have
385 * them returning values that don't make sense, or is that ok? 385 * them returning values that don't make sense, or is that ok?
@@ -458,7 +458,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
458 /* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier, 458 /* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier,
459 than should be. What else should I set? */ 459 than should be. What else should I set? */
460 skb_pull(skb, plen); 460 skb_pull(skb, plen);
461 skb->mac.raw = ((char *) (skb->data)) - ETH_HLEN; 461 skb_set_mac_header(skb, -ETH_HLEN);
462 skb->pkt_type = PACKET_HOST; 462 skb->pkt_type = PACKET_HOST;
463#ifdef CONFIG_BR2684_FAST_TRANS 463#ifdef CONFIG_BR2684_FAST_TRANS
464 skb->protocol = ((u16 *) skb->data)[-1]; 464 skb->protocol = ((u16 *) skb->data)[-1];
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 8c3825816085..876b77f14745 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -213,7 +213,7 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb)
213 return; 213 return;
214 } 214 }
215 ATM_SKB(skb)->vcc = vcc; 215 ATM_SKB(skb)->vcc = vcc;
216 skb->mac.raw = skb->data; 216 skb_reset_mac_header(skb);
217 if (!clip_vcc->encap 217 if (!clip_vcc->encap
218 || skb->len < RFC1483LLC_LEN 218 || skb->len < RFC1483LLC_LEN
219 || memcmp(skb->data, llc_oui, sizeof (llc_oui))) 219 || memcmp(skb->data, llc_oui, sizeof (llc_oui)))
@@ -702,7 +702,7 @@ static struct atm_dev atmarpd_dev = {
702 .ops = &atmarpd_dev_ops, 702 .ops = &atmarpd_dev_ops,
703 .type = "arpd", 703 .type = "arpd",
704 .number = 999, 704 .number = 999,
705 .lock = SPIN_LOCK_UNLOCKED 705 .lock = __SPIN_LOCK_UNLOCKED(atmarpd_dev.lock)
706}; 706};
707 707
708 708
diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c
index 8ccee4591f65..7afd8e7754fd 100644
--- a/net/atm/ioctl.c
+++ b/net/atm/ioctl.c
@@ -82,6 +82,9 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
82 case SIOCGSTAMP: /* borrowed from IP */ 82 case SIOCGSTAMP: /* borrowed from IP */
83 error = sock_get_timestamp(sk, argp); 83 error = sock_get_timestamp(sk, argp);
84 goto done; 84 goto done;
85 case SIOCGSTAMPNS: /* borrowed from IP */
86 error = sock_get_timestampns(sk, argp);
87 goto done;
85 case ATM_SETSC: 88 case ATM_SETSC:
86 printk(KERN_WARNING "ATM_SETSC is obsolete\n"); 89 printk(KERN_WARNING "ATM_SETSC is obsolete\n");
87 error = 0; 90 error = 0;
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 3d804d61f656..4dc5f2b8c43c 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -283,8 +283,8 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
283 } 283 }
284 284
285 DPRINTK("skbuff head:%lx data:%lx tail:%lx end:%lx\n", 285 DPRINTK("skbuff head:%lx data:%lx tail:%lx end:%lx\n",
286 (long)skb->head, (long)skb->data, (long)skb->tail, 286 (long)skb->head, (long)skb->data, (long)skb_tail_pointer(skb),
287 (long)skb->end); 287 (long)skb_end_pointer(skb));
288#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) 288#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
289 if (memcmp(skb->data, bridge_ula_lec, sizeof(bridge_ula_lec)) == 0) 289 if (memcmp(skb->data, bridge_ula_lec, sizeof(bridge_ula_lec)) == 0)
290 lec_handle_bridge(skb, dev); 290 lec_handle_bridge(skb, dev);
@@ -576,8 +576,8 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
576 break; 576 break;
577 } 577 }
578 skb2->len = sizeof(struct atmlec_msg); 578 skb2->len = sizeof(struct atmlec_msg);
579 memcpy(skb2->data, mesg, 579 skb_copy_to_linear_data(skb2, mesg,
580 sizeof(struct atmlec_msg)); 580 sizeof(*mesg));
581 atm_force_charge(priv->lecd, skb2->truesize); 581 atm_force_charge(priv->lecd, skb2->truesize);
582 sk = sk_atm(priv->lecd); 582 sk = sk_atm(priv->lecd);
583 skb_queue_tail(&sk->sk_receive_queue, skb2); 583 skb_queue_tail(&sk->sk_receive_queue, skb2);
@@ -630,7 +630,7 @@ static struct atm_dev lecatm_dev = {
630 .ops = &lecdev_ops, 630 .ops = &lecdev_ops,
631 .type = "lec", 631 .type = "lec",
632 .number = 999, /* dummy device number */ 632 .number = 999, /* dummy device number */
633 .lock = SPIN_LOCK_UNLOCKED 633 .lock = __SPIN_LOCK_UNLOCKED(lecatm_dev.lock)
634}; 634};
635 635
636/* 636/*
@@ -825,7 +825,6 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
825 if (!hlist_empty(&priv->lec_arp_empty_ones)) { 825 if (!hlist_empty(&priv->lec_arp_empty_ones)) {
826 lec_arp_check_empties(priv, vcc, skb); 826 lec_arp_check_empties(priv, vcc, skb);
827 } 827 }
828 skb->dev = dev;
829 skb_pull(skb, 2); /* skip lec_id */ 828 skb_pull(skb, 2); /* skip lec_id */
830#ifdef CONFIG_TR 829#ifdef CONFIG_TR
831 if (priv->is_trdev) 830 if (priv->is_trdev)
@@ -1338,7 +1337,7 @@ static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force,
1338 if (skb == NULL) 1337 if (skb == NULL)
1339 return -1; 1338 return -1;
1340 skb->len = *sizeoftlvs; 1339 skb->len = *sizeoftlvs;
1341 memcpy(skb->data, *tlvs, *sizeoftlvs); 1340 skb_copy_to_linear_data(skb, *tlvs, *sizeoftlvs);
1342 retval = send_to_lecd(priv, l_arp_xmt, dst_mac, NULL, skb); 1341 retval = send_to_lecd(priv, l_arp_xmt, dst_mac, NULL, skb);
1343 } 1342 }
1344 return retval; 1343 return retval;
@@ -1372,7 +1371,7 @@ static int lane2_associate_req(struct net_device *dev, u8 *lan_dst,
1372 if (skb == NULL) 1371 if (skb == NULL)
1373 return 0; 1372 return 0;
1374 skb->len = sizeoftlvs; 1373 skb->len = sizeoftlvs;
1375 memcpy(skb->data, tlvs, sizeoftlvs); 1374 skb_copy_to_linear_data(skb, tlvs, sizeoftlvs);
1376 retval = send_to_lecd(priv, l_associate_req, NULL, NULL, skb); 1375 retval = send_to_lecd(priv, l_associate_req, NULL, NULL, skb);
1377 if (retval != 0) 1376 if (retval != 0)
1378 printk("lec.c: lane2_associate_req() failed\n"); 1377 printk("lec.c: lane2_associate_req() failed\n");
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index cb3c004ff022..7c85aa551d5e 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -504,11 +504,13 @@ static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc)
504 tagged_llc_snap_hdr.tag = entry->ctrl_info.tag; 504 tagged_llc_snap_hdr.tag = entry->ctrl_info.tag;
505 skb_pull(skb, ETH_HLEN); /* get rid of Eth header */ 505 skb_pull(skb, ETH_HLEN); /* get rid of Eth header */
506 skb_push(skb, sizeof(tagged_llc_snap_hdr)); /* add LLC/SNAP header */ 506 skb_push(skb, sizeof(tagged_llc_snap_hdr)); /* add LLC/SNAP header */
507 memcpy(skb->data, &tagged_llc_snap_hdr, sizeof(tagged_llc_snap_hdr)); 507 skb_copy_to_linear_data(skb, &tagged_llc_snap_hdr,
508 sizeof(tagged_llc_snap_hdr));
508 } else { 509 } else {
509 skb_pull(skb, ETH_HLEN); /* get rid of Eth header */ 510 skb_pull(skb, ETH_HLEN); /* get rid of Eth header */
510 skb_push(skb, sizeof(struct llc_snap_hdr)); /* add LLC/SNAP header + tag */ 511 skb_push(skb, sizeof(struct llc_snap_hdr)); /* add LLC/SNAP header + tag */
511 memcpy(skb->data, &llc_snap_mpoa_data, sizeof(struct llc_snap_hdr)); 512 skb_copy_to_linear_data(skb, &llc_snap_mpoa_data,
513 sizeof(struct llc_snap_hdr));
512 } 514 }
513 515
514 atomic_add(skb->truesize, &sk_atm(entry->shortcut)->sk_wmem_alloc); 516 atomic_add(skb->truesize, &sk_atm(entry->shortcut)->sk_wmem_alloc);
@@ -711,11 +713,12 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
711 return; 713 return;
712 } 714 }
713 skb_push(new_skb, eg->ctrl_info.DH_length); /* add MAC header */ 715 skb_push(new_skb, eg->ctrl_info.DH_length); /* add MAC header */
714 memcpy(new_skb->data, eg->ctrl_info.DLL_header, eg->ctrl_info.DH_length); 716 skb_copy_to_linear_data(new_skb, eg->ctrl_info.DLL_header,
717 eg->ctrl_info.DH_length);
715 new_skb->protocol = eth_type_trans(new_skb, dev); 718 new_skb->protocol = eth_type_trans(new_skb, dev);
716 new_skb->nh.raw = new_skb->data; 719 skb_reset_network_header(new_skb);
717 720
718 eg->latest_ip_addr = new_skb->nh.iph->saddr; 721 eg->latest_ip_addr = ip_hdr(new_skb)->saddr;
719 eg->packets_rcvd++; 722 eg->packets_rcvd++;
720 mpc->eg_ops->put(eg); 723 mpc->eg_ops->put(eg);
721 724
@@ -734,7 +737,7 @@ static struct atm_dev mpc_dev = {
734 .ops = &mpc_ops, 737 .ops = &mpc_ops,
735 .type = "mpc", 738 .type = "mpc",
736 .number = 42, 739 .number = 42,
737 .lock = SPIN_LOCK_UNLOCKED 740 .lock = __SPIN_LOCK_UNLOCKED(mpc_dev.lock)
738 /* members not explicitly initialised will be 0 */ 741 /* members not explicitly initialised will be 0 */
739}; 742};
740 743
@@ -936,7 +939,7 @@ int msg_to_mpoad(struct k_message *mesg, struct mpoa_client *mpc)
936 if (skb == NULL) 939 if (skb == NULL)
937 return -ENOMEM; 940 return -ENOMEM;
938 skb_put(skb, sizeof(struct k_message)); 941 skb_put(skb, sizeof(struct k_message));
939 memcpy(skb->data, mesg, sizeof(struct k_message)); 942 skb_copy_to_linear_data(skb, mesg, sizeof(*mesg));
940 atm_force_charge(mpc->mpoad_vcc, skb->truesize); 943 atm_force_charge(mpc->mpoad_vcc, skb->truesize);
941 944
942 sk = sk_atm(mpc->mpoad_vcc); 945 sk = sk_atm(mpc->mpoad_vcc);
diff --git a/net/atm/signaling.c b/net/atm/signaling.c
index 31d98b57e1de..d14baaf1f4c3 100644
--- a/net/atm/signaling.c
+++ b/net/atm/signaling.c
@@ -256,7 +256,7 @@ static struct atm_dev sigd_dev = {
256 .ops = &sigd_dev_ops, 256 .ops = &sigd_dev_ops,
257 .type = "sig", 257 .type = "sig",
258 .number = 999, 258 .number = 999,
259 .lock = SPIN_LOCK_UNLOCKED 259 .lock = __SPIN_LOCK_UNLOCKED(sigd_dev.lock)
260}; 260};
261 261
262 262