]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/irda/mcs7780.c
[SK_BUFF]: Introduce skb_copy_to_linear_data{_offset}
[net-next-2.6.git] / drivers / net / irda / mcs7780.c
index 415ba8dc94ceb87c04b075e7656e2c663049aa06..54d1d543c92c9b35991edbc310bcceada43f290c 100644 (file)
@@ -353,7 +353,7 @@ static unsigned mcs_wrap_fir_skb(const struct sk_buff *skb, __u8 *buf)
        buf[0] = len & 0xff;
        buf[1] = (len >> 8) & 0xff;
        /* copy the data into the tx buffer. */
-       memcpy(buf+2, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, buf + 2, skb->len);
        /* put the fcs in the last four bytes in little endian order. */
        buf[len - 4] = fcs & 0xff;
        buf[len - 3] = (fcs >> 8) & 0xff;
@@ -377,7 +377,7 @@ static unsigned mcs_wrap_mir_skb(const struct sk_buff *skb, __u8 *buf)
        buf[0] = len & 0xff;
        buf[1] = (len >> 8) & 0xff;
        /* copy the data */
-       memcpy(buf+2, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, buf + 2, skb->len);
        /* put the fcs in last two bytes in little endian order. */
        buf[len - 2] = fcs & 0xff;
        buf[len - 1] = (fcs >> 8) & 0xff;
@@ -426,9 +426,9 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len)
        }
 
        skb_reserve(skb, 1);
-       memcpy(skb->data, buf, new_len);
+       skb_copy_to_linear_data(skb, buf, new_len);
        skb_put(skb, new_len);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->protocol = htons(ETH_P_IRDA);
        skb->dev = mcs->netdev;
 
@@ -479,9 +479,9 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len)
        }
 
        skb_reserve(skb, 1);
-       memcpy(skb->data, buf, new_len);
+       skb_copy_to_linear_data(skb, buf, new_len);
        skb_put(skb, new_len);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->protocol = htons(ETH_P_IRDA);
        skb->dev = mcs->netdev;
 
@@ -560,9 +560,9 @@ static inline int mcs_find_endpoints(struct mcs_cb *mcs,
        return ret;
 }
 
-static void mcs_speed_work(void *arg)
+static void mcs_speed_work(struct work_struct *work)
 {
-       struct mcs_cb *mcs = arg;
+       struct mcs_cb *mcs = container_of(work, struct mcs_cb, work);
        struct net_device *netdev = mcs->netdev;
 
        mcs_speed_change(mcs);
@@ -764,7 +764,7 @@ static struct net_device_stats *mcs_net_get_stats(struct net_device *netdev)
 }
 
 /* Receive callback function.  */
-static void mcs_receive_irq(struct urb *urb, struct pt_regs *regs)
+static void mcs_receive_irq(struct urb *urb)
 {
        __u8 *bytes;
        struct mcs_cb *mcs = urb->context;
@@ -813,7 +813,7 @@ static void mcs_receive_irq(struct urb *urb, struct pt_regs *regs)
 }
 
 /* Transmit callback funtion.  */
-static void mcs_send_irq(struct urb *urb, struct pt_regs *regs)
+static void mcs_send_irq(struct urb *urb)
 {
        struct mcs_cb *mcs = urb->context;
        struct net_device *ndev = mcs->netdev;
@@ -927,7 +927,7 @@ static int mcs_probe(struct usb_interface *intf,
        irda_qos_bits_to_value(&mcs->qos);
 
        /* Speed change work initialisation*/
-       INIT_WORK(&mcs->work, mcs_speed_work, mcs);
+       INIT_WORK(&mcs->work, mcs_speed_work);
 
        /* Override the network functions we need to use */
        ndev->hard_start_xmit = mcs_hard_xmit;