netdevice: safe convert to netdev_priv() #part-1
[deliverable/linux.git] / drivers / net / appletalk / ipddp.c
index 7f7dd450226a8f853224a987302a21b2bf24acc2..9a0be9b2eaad66d5bec2776c54871d29b08e5e6f 100644 (file)
@@ -65,7 +65,6 @@ static struct net_device * __init ipddp_init(void)
        if (!dev)
                return ERR_PTR(-ENOMEM);
 
-       SET_MODULE_OWNER(dev);
        strcpy(dev->name, "ipddp%d");
 
        if (version_printed++ == 0)
@@ -109,7 +108,7 @@ static struct net_device * __init ipddp_init(void)
  */
 static struct net_device_stats *ipddp_get_stats(struct net_device *dev)
 {
-        return dev->priv;
+       return netdev_priv(dev);
 }
 
 /*
@@ -117,7 +116,7 @@ static struct net_device_stats *ipddp_get_stats(struct net_device *dev)
  */
 static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       u32 paddr = ((struct rtable*)skb->dst)->rt_gateway;
+       __be32 paddr = ((struct rtable*)skb->dst)->rt_gateway;
         struct ddpehdr *ddp;
         struct ipddp_route *rt;
         struct atalk_addr *our_addr;
@@ -145,9 +144,7 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev)
 
        /* Create the Extended DDP header */
        ddp = (struct ddpehdr *)skb->data;
-        ddp->deh_len = skb->len;
-        ddp->deh_hops = 1;
-        ddp->deh_pad = 0;
+        ddp->deh_len_hops = htons(skb->len + (1<<10));
         ddp->deh_sum = 0;
 
        /*
@@ -170,12 +167,11 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev)
         ddp->deh_sport = 72;
 
         *((__u8 *)(ddp+1)) = 22;               /* ddp type = IP */
-        *((__u16 *)ddp)=ntohs(*((__u16 *)ddp));        /* fix up length field */
 
         skb->protocol = htons(ETH_P_ATALK);     /* Protocol has changed */
 
-       ((struct net_device_stats *) dev->priv)->tx_packets++;
-        ((struct net_device_stats *) dev->priv)->tx_bytes+=skb->len;
+       ((struct net_device_stats *) netdev_priv(dev))->tx_packets++;
+       ((struct net_device_stats *) netdev_priv(dev))->tx_bytes += skb->len;
 
         if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0)
                 dev_kfree_skb(skb);
@@ -189,7 +185,7 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev)
  */
 static int ipddp_create(struct ipddp_route *new_rt)
 {
-        struct ipddp_route *rt =(struct ipddp_route*) kmalloc(sizeof(*rt), GFP_KERNEL);
+        struct ipddp_route *rt = kmalloc(sizeof(*rt), GFP_KERNEL);
 
         if (rt == NULL)
                 return -ENOMEM;
This page took 0.02818 seconds and 5 git commands to generate.