aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/mcs7780.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/irda/mcs7780.c')
-rw-r--r--drivers/net/irda/mcs7780.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c
index f0c61f3b2a82..0de867288a47 100644
--- a/drivers/net/irda/mcs7780.c
+++ b/drivers/net/irda/mcs7780.c
@@ -200,14 +200,14 @@ static inline int mcs_setup_transceiver_vishay(struct mcs_cb *mcs)
200/* Setup a communication between mcs7780 and agilent chip. */ 200/* Setup a communication between mcs7780 and agilent chip. */
201static inline int mcs_setup_transceiver_agilent(struct mcs_cb *mcs) 201static inline int mcs_setup_transceiver_agilent(struct mcs_cb *mcs)
202{ 202{
203 IRDA_WARNING("This transceiver type is not supported yet."); 203 IRDA_WARNING("This transceiver type is not supported yet.\n");
204 return 1; 204 return 1;
205} 205}
206 206
207/* Setup a communication between mcs7780 and sharp chip. */ 207/* Setup a communication between mcs7780 and sharp chip. */
208static inline int mcs_setup_transceiver_sharp(struct mcs_cb *mcs) 208static inline int mcs_setup_transceiver_sharp(struct mcs_cb *mcs)
209{ 209{
210 IRDA_WARNING("This transceiver type is not supported yet."); 210 IRDA_WARNING("This transceiver type is not supported yet.\n");
211 return 1; 211 return 1;
212} 212}
213 213
@@ -279,7 +279,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs)
279 break; 279 break;
280 280
281 default: 281 default:
282 IRDA_WARNING("Unknown transceiver type: %d", 282 IRDA_WARNING("Unknown transceiver type: %d\n",
283 mcs->transceiver_type); 283 mcs->transceiver_type);
284 ret = 1; 284 ret = 1;
285 } 285 }
@@ -318,7 +318,7 @@ static inline int mcs_setup_transceiver(struct mcs_cb *mcs)
318 return ret; 318 return ret;
319 319
320error: 320error:
321 IRDA_ERROR("%s", msg); 321 IRDA_ERROR("%s\n", msg);
322 return ret; 322 return ret;
323} 323}
324 324
@@ -353,7 +353,7 @@ static unsigned mcs_wrap_fir_skb(const struct sk_buff *skb, __u8 *buf)
353 buf[0] = len & 0xff; 353 buf[0] = len & 0xff;
354 buf[1] = (len >> 8) & 0xff; 354 buf[1] = (len >> 8) & 0xff;
355 /* copy the data into the tx buffer. */ 355 /* copy the data into the tx buffer. */
356 memcpy(buf+2, skb->data, skb->len); 356 skb_copy_from_linear_data(skb, buf + 2, skb->len);
357 /* put the fcs in the last four bytes in little endian order. */ 357 /* put the fcs in the last four bytes in little endian order. */
358 buf[len - 4] = fcs & 0xff; 358 buf[len - 4] = fcs & 0xff;
359 buf[len - 3] = (fcs >> 8) & 0xff; 359 buf[len - 3] = (fcs >> 8) & 0xff;
@@ -377,7 +377,7 @@ static unsigned mcs_wrap_mir_skb(const struct sk_buff *skb, __u8 *buf)
377 buf[0] = len & 0xff; 377 buf[0] = len & 0xff;
378 buf[1] = (len >> 8) & 0xff; 378 buf[1] = (len >> 8) & 0xff;
379 /* copy the data */ 379 /* copy the data */
380 memcpy(buf+2, skb->data, skb->len); 380 skb_copy_from_linear_data(skb, buf + 2, skb->len);
381 /* put the fcs in last two bytes in little endian order. */ 381 /* put the fcs in last two bytes in little endian order. */
382 buf[len - 2] = fcs & 0xff; 382 buf[len - 2] = fcs & 0xff;
383 buf[len - 1] = (fcs >> 8) & 0xff; 383 buf[len - 1] = (fcs >> 8) & 0xff;
@@ -426,9 +426,9 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len)
426 } 426 }
427 427
428 skb_reserve(skb, 1); 428 skb_reserve(skb, 1);
429 memcpy(skb->data, buf, new_len); 429 skb_copy_to_linear_data(skb, buf, new_len);
430 skb_put(skb, new_len); 430 skb_put(skb, new_len);
431 skb->mac.raw = skb->data; 431 skb_reset_mac_header(skb);
432 skb->protocol = htons(ETH_P_IRDA); 432 skb->protocol = htons(ETH_P_IRDA);
433 skb->dev = mcs->netdev; 433 skb->dev = mcs->netdev;
434 434
@@ -479,9 +479,9 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len)
479 } 479 }
480 480
481 skb_reserve(skb, 1); 481 skb_reserve(skb, 1);
482 memcpy(skb->data, buf, new_len); 482 skb_copy_to_linear_data(skb, buf, new_len);
483 skb_put(skb, new_len); 483 skb_put(skb, new_len);
484 skb->mac.raw = skb->data; 484 skb_reset_mac_header(skb);
485 skb->protocol = htons(ETH_P_IRDA); 485 skb->protocol = htons(ETH_P_IRDA);
486 skb->dev = mcs->netdev; 486 skb->dev = mcs->netdev;
487 487
@@ -587,7 +587,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
587 } while(cnt++ < 100 && (rval & MCS_IRINTX)); 587 } while(cnt++ < 100 && (rval & MCS_IRINTX));
588 588
589 if(cnt >= 100) { 589 if(cnt >= 100) {
590 IRDA_ERROR("unable to change speed"); 590 IRDA_ERROR("unable to change speed\n");
591 ret = -EIO; 591 ret = -EIO;
592 goto error; 592 goto error;
593 } 593 }
@@ -638,7 +638,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
638 638
639 default: 639 default:
640 ret = 1; 640 ret = 1;
641 IRDA_WARNING("Unknown transceiver type: %d", 641 IRDA_WARNING("Unknown transceiver type: %d\n",
642 mcs->transceiver_type); 642 mcs->transceiver_type);
643 } 643 }
644 if (unlikely(ret)) 644 if (unlikely(ret))
@@ -733,7 +733,7 @@ static int mcs_net_open(struct net_device *netdev)
733 sprintf(hwname, "usb#%d", mcs->usbdev->devnum); 733 sprintf(hwname, "usb#%d", mcs->usbdev->devnum);
734 mcs->irlap = irlap_open(netdev, &mcs->qos, hwname); 734 mcs->irlap = irlap_open(netdev, &mcs->qos, hwname);
735 if (!mcs->irlap) { 735 if (!mcs->irlap) {
736 IRDA_ERROR("mcs7780: irlap_open failed"); 736 IRDA_ERROR("mcs7780: irlap_open failed\n");
737 goto error2; 737 goto error2;
738 } 738 }
739 739
@@ -862,7 +862,7 @@ static int mcs_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
862 mcs->out_buf, wraplen, mcs_send_irq, mcs); 862 mcs->out_buf, wraplen, mcs_send_irq, mcs);
863 863
864 if ((ret = usb_submit_urb(mcs->tx_urb, GFP_ATOMIC))) { 864 if ((ret = usb_submit_urb(mcs->tx_urb, GFP_ATOMIC))) {
865 IRDA_ERROR("failed tx_urb: %d", ret); 865 IRDA_ERROR("failed tx_urb: %d\n", ret);
866 switch (ret) { 866 switch (ret) {
867 case -ENODEV: 867 case -ENODEV:
868 case -EPIPE: 868 case -EPIPE:
@@ -897,7 +897,7 @@ static int mcs_probe(struct usb_interface *intf,
897 if (!ndev) 897 if (!ndev)
898 goto error1; 898 goto error1;
899 899
900 IRDA_DEBUG(1, "MCS7780 USB-IrDA bridge found at %d.", udev->devnum); 900 IRDA_DEBUG(1, "MCS7780 USB-IrDA bridge found at %d.\n", udev->devnum);
901 901
902 /* what is it realy for? */ 902 /* what is it realy for? */
903 SET_MODULE_OWNER(ndev); 903 SET_MODULE_OWNER(ndev);
@@ -905,7 +905,7 @@ static int mcs_probe(struct usb_interface *intf,
905 905
906 ret = usb_reset_configuration(udev); 906 ret = usb_reset_configuration(udev);
907 if (ret != 0) { 907 if (ret != 0) {
908 IRDA_ERROR("mcs7780: usb reset configuration failed"); 908 IRDA_ERROR("mcs7780: usb reset configuration failed\n");
909 goto error2; 909 goto error2;
910 } 910 }
911 911
@@ -950,7 +950,7 @@ static int mcs_probe(struct usb_interface *intf,
950 if (ret != 0) 950 if (ret != 0)
951 goto error2; 951 goto error2;
952 952
953 IRDA_DEBUG(1, "IrDA: Registered MosChip MCS7780 device as %s", 953 IRDA_DEBUG(1, "IrDA: Registered MosChip MCS7780 device as %s\n",
954 ndev->name); 954 ndev->name);
955 955
956 mcs->transceiver_type = transceiver_type; 956 mcs->transceiver_type = transceiver_type;
@@ -981,7 +981,7 @@ static void mcs_disconnect(struct usb_interface *intf)
981 free_netdev(mcs->netdev); 981 free_netdev(mcs->netdev);
982 982
983 usb_set_intfdata(intf, NULL); 983 usb_set_intfdata(intf, NULL);
984 IRDA_DEBUG(0, "MCS7780 now disconnected."); 984 IRDA_DEBUG(0, "MCS7780 now disconnected.\n");
985} 985}
986 986
987/* Module insertion */ 987/* Module insertion */
@@ -992,7 +992,7 @@ static int __init mcs_init(void)
992 /* register this driver with the USB subsystem */ 992 /* register this driver with the USB subsystem */
993 result = usb_register(&mcs_driver); 993 result = usb_register(&mcs_driver);
994 if (result) 994 if (result)
995 IRDA_ERROR("usb_register failed. Error number %d", result); 995 IRDA_ERROR("usb_register failed. Error number %d\n", result);
996 996
997 return result; 997 return result;
998} 998}