aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-03-28 16:29:51 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-03-28 16:29:51 -0400
commited40d0c472b136682b2fcba05f89762859c7374f (patch)
tree076b83a26bcd63d6158463735dd34c10bbc591dc /drivers/net/irda
parent9e495834e59ca9b29f1a1f63b9f5533bb022ac49 (diff)
parent5d80f8e5a9dc9c9a94d4aeaa567e219a808b8a4a (diff)
Merge branch 'origin' into devel
Conflicts: sound/soc/pxa/pxa2xx-i2s.c
Diffstat (limited to 'drivers/net/irda')
-rw-r--r--drivers/net/irda/ali-ircc.c23
-rw-r--r--drivers/net/irda/donauboe.c12
-rw-r--r--drivers/net/irda/irda-usb.c18
-rw-r--r--drivers/net/irda/kingsun-sir.c11
-rw-r--r--drivers/net/irda/ks959-sir.c11
-rw-r--r--drivers/net/irda/ksdazzle-sir.c12
-rw-r--r--drivers/net/irda/mcs7780.c13
-rw-r--r--drivers/net/irda/nsc-ircc.c23
-rw-r--r--drivers/net/irda/sir_dev.c17
-rw-r--r--drivers/net/irda/smsc-ircc2.c30
-rw-r--r--drivers/net/irda/stir4200.c12
-rw-r--r--drivers/net/irda/via-ircc.c22
-rw-r--r--drivers/net/irda/vlsi_ir.c14
-rw-r--r--drivers/net/irda/w83977af_ir.c13
14 files changed, 154 insertions, 77 deletions
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index 17779f9bffc4..ad1795580028 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -259,6 +259,20 @@ static void __exit ali_ircc_cleanup(void)
259 IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__); 259 IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__);
260} 260}
261 261
262static const struct net_device_ops ali_ircc_sir_ops = {
263 .ndo_open = ali_ircc_net_open,
264 .ndo_stop = ali_ircc_net_close,
265 .ndo_start_xmit = ali_ircc_sir_hard_xmit,
266 .ndo_do_ioctl = ali_ircc_net_ioctl,
267};
268
269static const struct net_device_ops ali_ircc_fir_ops = {
270 .ndo_open = ali_ircc_net_open,
271 .ndo_stop = ali_ircc_net_close,
272 .ndo_start_xmit = ali_ircc_fir_hard_xmit,
273 .ndo_do_ioctl = ali_ircc_net_ioctl,
274};
275
262/* 276/*
263 * Function ali_ircc_open (int i, chipio_t *inf) 277 * Function ali_ircc_open (int i, chipio_t *inf)
264 * 278 *
@@ -361,10 +375,7 @@ static int ali_ircc_open(int i, chipio_t *info)
361 self->tx_fifo.tail = self->tx_buff.head; 375 self->tx_fifo.tail = self->tx_buff.head;
362 376
363 /* Override the network functions we need to use */ 377 /* Override the network functions we need to use */
364 dev->hard_start_xmit = ali_ircc_sir_hard_xmit; 378 dev->netdev_ops = &ali_ircc_sir_ops;
365 dev->open = ali_ircc_net_open;
366 dev->stop = ali_ircc_net_close;
367 dev->do_ioctl = ali_ircc_net_ioctl;
368 379
369 err = register_netdev(dev); 380 err = register_netdev(dev);
370 if (err) { 381 if (err) {
@@ -974,7 +985,7 @@ static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud)
974 ali_ircc_fir_change_speed(self, baud); 985 ali_ircc_fir_change_speed(self, baud);
975 986
976 /* Install FIR xmit handler*/ 987 /* Install FIR xmit handler*/
977 dev->hard_start_xmit = ali_ircc_fir_hard_xmit; 988 dev->netdev_ops = &ali_ircc_fir_ops;
978 989
979 /* Enable Interuupt */ 990 /* Enable Interuupt */
980 self->ier = IER_EOM; // benjamin 2000/11/20 07:24PM 991 self->ier = IER_EOM; // benjamin 2000/11/20 07:24PM
@@ -988,7 +999,7 @@ static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud)
988 ali_ircc_sir_change_speed(self, baud); 999 ali_ircc_sir_change_speed(self, baud);
989 1000
990 /* Install SIR xmit handler*/ 1001 /* Install SIR xmit handler*/
991 dev->hard_start_xmit = ali_ircc_sir_hard_xmit; 1002 dev->netdev_ops = &ali_ircc_sir_ops;
992 } 1003 }
993 1004
994 1005
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index 6f3e7f71658d..6b6548b9fda0 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -1524,6 +1524,13 @@ toshoboe_close (struct pci_dev *pci_dev)
1524 free_netdev(self->netdev); 1524 free_netdev(self->netdev);
1525} 1525}
1526 1526
1527static const struct net_device_ops toshoboe_netdev_ops = {
1528 .ndo_open = toshoboe_net_open,
1529 .ndo_stop = toshoboe_net_close,
1530 .ndo_start_xmit = toshoboe_hard_xmit,
1531 .ndo_do_ioctl = toshoboe_net_ioctl,
1532};
1533
1527static int 1534static int
1528toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid) 1535toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
1529{ 1536{
@@ -1657,10 +1664,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
1657#endif 1664#endif
1658 1665
1659 SET_NETDEV_DEV(dev, &pci_dev->dev); 1666 SET_NETDEV_DEV(dev, &pci_dev->dev);
1660 dev->hard_start_xmit = toshoboe_hard_xmit; 1667 dev->netdev_ops = &toshoboe_netdev_ops;
1661 dev->open = toshoboe_net_open;
1662 dev->stop = toshoboe_net_close;
1663 dev->do_ioctl = toshoboe_net_ioctl;
1664 1668
1665 err = register_netdev(dev); 1669 err = register_netdev(dev);
1666 if (err) 1670 if (err)
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 3a22dc41b656..006ba23110db 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1401,6 +1401,14 @@ static inline void irda_usb_init_qos(struct irda_usb_cb *self)
1401} 1401}
1402 1402
1403/*------------------------------------------------------------------*/ 1403/*------------------------------------------------------------------*/
1404static const struct net_device_ops irda_usb_netdev_ops = {
1405 .ndo_open = irda_usb_net_open,
1406 .ndo_stop = irda_usb_net_close,
1407 .ndo_do_ioctl = irda_usb_net_ioctl,
1408 .ndo_start_xmit = irda_usb_hard_xmit,
1409 .ndo_tx_timeout = irda_usb_net_timeout,
1410};
1411
1404/* 1412/*
1405 * Initialise the network side of the irda-usb instance 1413 * Initialise the network side of the irda-usb instance
1406 * Called when a new USB instance is registered in irda_usb_probe() 1414 * Called when a new USB instance is registered in irda_usb_probe()
@@ -1411,15 +1419,9 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
1411 1419
1412 IRDA_DEBUG(1, "%s()\n", __func__); 1420 IRDA_DEBUG(1, "%s()\n", __func__);
1413 1421
1414 irda_usb_init_qos(self); 1422 netdev->netdev_ops = &irda_usb_netdev_ops;
1415 1423
1416 /* Override the network functions we need to use */ 1424 irda_usb_init_qos(self);
1417 netdev->hard_start_xmit = irda_usb_hard_xmit;
1418 netdev->tx_timeout = irda_usb_net_timeout;
1419 netdev->watchdog_timeo = 250*HZ/1000; /* 250 ms > USB timeout */
1420 netdev->open = irda_usb_net_open;
1421 netdev->stop = irda_usb_net_close;
1422 netdev->do_ioctl = irda_usb_net_ioctl;
1423 1425
1424 return register_netdev(netdev); 1426 return register_netdev(netdev);
1425} 1427}
diff --git a/drivers/net/irda/kingsun-sir.c b/drivers/net/irda/kingsun-sir.c
index b4a61717254a..9d813bc4502e 100644
--- a/drivers/net/irda/kingsun-sir.c
+++ b/drivers/net/irda/kingsun-sir.c
@@ -418,6 +418,12 @@ static int kingsun_net_ioctl(struct net_device *netdev, struct ifreq *rq,
418 return ret; 418 return ret;
419} 419}
420 420
421static const struct net_device_ops kingsun_ops = {
422 .ndo_start_xmit = kingsun_hard_xmit,
423 .ndo_open = kingsun_net_open,
424 .ndo_stop = kingsun_net_close,
425 .ndo_do_ioctl = kingsun_net_ioctl,
426};
421 427
422/* 428/*
423 * This routine is called by the USB subsystem for each new device 429 * This routine is called by the USB subsystem for each new device
@@ -520,10 +526,7 @@ static int kingsun_probe(struct usb_interface *intf,
520 irda_qos_bits_to_value(&kingsun->qos); 526 irda_qos_bits_to_value(&kingsun->qos);
521 527
522 /* Override the network functions we need to use */ 528 /* Override the network functions we need to use */
523 net->hard_start_xmit = kingsun_hard_xmit; 529 net->netdev_ops = &kingsun_ops;
524 net->open = kingsun_net_open;
525 net->stop = kingsun_net_close;
526 net->do_ioctl = kingsun_net_ioctl;
527 530
528 ret = register_netdev(net); 531 ret = register_netdev(net);
529 if (ret != 0) 532 if (ret != 0)
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c
index 55322fb92cf1..b6ffe9715b61 100644
--- a/drivers/net/irda/ks959-sir.c
+++ b/drivers/net/irda/ks959-sir.c
@@ -668,6 +668,12 @@ static int ks959_net_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
668 return ret; 668 return ret;
669} 669}
670 670
671static const struct net_device_ops ks959_ops = {
672 .ndo_start_xmit = ks959_hard_xmit,
673 .ndo_open = ks959_net_open,
674 .ndo_stop = ks959_net_close,
675 .ndo_do_ioctl = ks959_net_ioctl,
676};
671/* 677/*
672 * This routine is called by the USB subsystem for each new device 678 * This routine is called by the USB subsystem for each new device
673 * in the system. We need to check if the device is ours, and in 679 * in the system. We need to check if the device is ours, and in
@@ -780,10 +786,7 @@ static int ks959_probe(struct usb_interface *intf,
780 irda_qos_bits_to_value(&kingsun->qos); 786 irda_qos_bits_to_value(&kingsun->qos);
781 787
782 /* Override the network functions we need to use */ 788 /* Override the network functions we need to use */
783 net->hard_start_xmit = ks959_hard_xmit; 789 net->netdev_ops = &ks959_ops;
784 net->open = ks959_net_open;
785 net->stop = ks959_net_close;
786 net->do_ioctl = ks959_net_ioctl;
787 790
788 ret = register_netdev(net); 791 ret = register_netdev(net);
789 if (ret != 0) 792 if (ret != 0)
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c
index 5b327b09acd8..64df27f2bfd4 100644
--- a/drivers/net/irda/ksdazzle-sir.c
+++ b/drivers/net/irda/ksdazzle-sir.c
@@ -562,6 +562,13 @@ static int ksdazzle_net_ioctl(struct net_device *netdev, struct ifreq *rq,
562 return ret; 562 return ret;
563} 563}
564 564
565static const struct net_device_ops ksdazzle_ops = {
566 .ndo_start_xmit = ksdazzle_hard_xmit,
567 .ndo_open = ksdazzle_net_open,
568 .ndo_stop = ksdazzle_net_close,
569 .ndo_do_ioctl = ksdazzle_net_ioctl,
570};
571
565/* 572/*
566 * This routine is called by the USB subsystem for each new device 573 * This routine is called by the USB subsystem for each new device
567 * in the system. We need to check if the device is ours, and in 574 * in the system. We need to check if the device is ours, and in
@@ -684,10 +691,7 @@ static int ksdazzle_probe(struct usb_interface *intf,
684 irda_qos_bits_to_value(&kingsun->qos); 691 irda_qos_bits_to_value(&kingsun->qos);
685 692
686 /* Override the network functions we need to use */ 693 /* Override the network functions we need to use */
687 net->hard_start_xmit = ksdazzle_hard_xmit; 694 net->netdev_ops = &ksdazzle_ops;
688 net->open = ksdazzle_net_open;
689 net->stop = ksdazzle_net_close;
690 net->do_ioctl = ksdazzle_net_ioctl;
691 695
692 ret = register_netdev(net); 696 ret = register_netdev(net);
693 if (ret != 0) 697 if (ret != 0)
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c
index 85e88daab21a..fac504d0cfd8 100644
--- a/drivers/net/irda/mcs7780.c
+++ b/drivers/net/irda/mcs7780.c
@@ -873,6 +873,13 @@ static int mcs_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
873 return ret; 873 return ret;
874} 874}
875 875
876static const struct net_device_ops mcs_netdev_ops = {
877 .ndo_open = mcs_net_open,
878 .ndo_stop = mcs_net_close,
879 .ndo_start_xmit = mcs_hard_xmit,
880 .ndo_do_ioctl = mcs_net_ioctl,
881};
882
876/* 883/*
877 * This function is called by the USB subsystem for each new device in the 884 * This function is called by the USB subsystem for each new device in the
878 * system. Need to verify the device and if it is, then start handling it. 885 * system. Need to verify the device and if it is, then start handling it.
@@ -919,11 +926,7 @@ static int mcs_probe(struct usb_interface *intf,
919 /* Speed change work initialisation*/ 926 /* Speed change work initialisation*/
920 INIT_WORK(&mcs->work, mcs_speed_work); 927 INIT_WORK(&mcs->work, mcs_speed_work);
921 928
922 /* Override the network functions we need to use */ 929 ndev->netdev_ops = &mcs_netdev_ops;
923 ndev->hard_start_xmit = mcs_hard_xmit;
924 ndev->open = mcs_net_open;
925 ndev->stop = mcs_net_close;
926 ndev->do_ioctl = mcs_net_ioctl;
927 930
928 if (!intf->cur_altsetting) 931 if (!intf->cur_altsetting)
929 goto error2; 932 goto error2;
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 61e509cb712a..45fd9c1eb343 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -331,6 +331,20 @@ static void __exit nsc_ircc_cleanup(void)
331 pnp_registered = 0; 331 pnp_registered = 0;
332} 332}
333 333
334static const struct net_device_ops nsc_ircc_sir_ops = {
335 .ndo_open = nsc_ircc_net_open,
336 .ndo_stop = nsc_ircc_net_close,
337 .ndo_start_xmit = nsc_ircc_hard_xmit_sir,
338 .ndo_do_ioctl = nsc_ircc_net_ioctl,
339};
340
341static const struct net_device_ops nsc_ircc_fir_ops = {
342 .ndo_open = nsc_ircc_net_open,
343 .ndo_stop = nsc_ircc_net_close,
344 .ndo_start_xmit = nsc_ircc_hard_xmit_fir,
345 .ndo_do_ioctl = nsc_ircc_net_ioctl,
346};
347
334/* 348/*
335 * Function nsc_ircc_open (iobase, irq) 349 * Function nsc_ircc_open (iobase, irq)
336 * 350 *
@@ -441,10 +455,7 @@ static int __init nsc_ircc_open(chipio_t *info)
441 self->tx_fifo.tail = self->tx_buff.head; 455 self->tx_fifo.tail = self->tx_buff.head;
442 456
443 /* Override the network functions we need to use */ 457 /* Override the network functions we need to use */
444 dev->hard_start_xmit = nsc_ircc_hard_xmit_sir; 458 dev->netdev_ops = &nsc_ircc_sir_ops;
445 dev->open = nsc_ircc_net_open;
446 dev->stop = nsc_ircc_net_close;
447 dev->do_ioctl = nsc_ircc_net_ioctl;
448 459
449 err = register_netdev(dev); 460 err = register_netdev(dev);
450 if (err) { 461 if (err) {
@@ -1320,12 +1331,12 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed)
1320 switch_bank(iobase, BANK0); 1331 switch_bank(iobase, BANK0);
1321 if (speed > 115200) { 1332 if (speed > 115200) {
1322 /* Install FIR xmit handler */ 1333 /* Install FIR xmit handler */
1323 dev->hard_start_xmit = nsc_ircc_hard_xmit_fir; 1334 dev->netdev_ops = &nsc_ircc_fir_ops;
1324 ier = IER_SFIF_IE; 1335 ier = IER_SFIF_IE;
1325 nsc_ircc_dma_receive(self); 1336 nsc_ircc_dma_receive(self);
1326 } else { 1337 } else {
1327 /* Install SIR xmit handler */ 1338 /* Install SIR xmit handler */
1328 dev->hard_start_xmit = nsc_ircc_hard_xmit_sir; 1339 dev->netdev_ops = &nsc_ircc_sir_ops;
1329 ier = IER_RXHDL_IE; 1340 ier = IER_RXHDL_IE;
1330 } 1341 }
1331 /* Set our current interrupt mask */ 1342 /* Set our current interrupt mask */
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c
index 5b5862499def..d940809762ec 100644
--- a/drivers/net/irda/sir_dev.c
+++ b/drivers/net/irda/sir_dev.c
@@ -753,7 +753,8 @@ static int sirdev_alloc_buffers(struct sir_dev *dev)
753 dev->rx_buff.truesize = IRDA_SKB_MAX_MTU; 753 dev->rx_buff.truesize = IRDA_SKB_MAX_MTU;
754 754
755 /* Bootstrap ZeroCopy Rx */ 755 /* Bootstrap ZeroCopy Rx */
756 dev->rx_buff.skb = __dev_alloc_skb(dev->rx_buff.truesize, GFP_KERNEL); 756 dev->rx_buff.skb = __netdev_alloc_skb(dev->netdev, dev->rx_buff.truesize,
757 GFP_KERNEL);
757 if (dev->rx_buff.skb == NULL) 758 if (dev->rx_buff.skb == NULL)
758 return -ENOMEM; 759 return -ENOMEM;
759 skb_reserve(dev->rx_buff.skb, 1); 760 skb_reserve(dev->rx_buff.skb, 1);
@@ -779,8 +780,7 @@ static int sirdev_alloc_buffers(struct sir_dev *dev)
779 780
780static void sirdev_free_buffers(struct sir_dev *dev) 781static void sirdev_free_buffers(struct sir_dev *dev)
781{ 782{
782 if (dev->rx_buff.skb) 783 kfree_skb(dev->rx_buff.skb);
783 kfree_skb(dev->rx_buff.skb);
784 kfree(dev->tx_buff.head); 784 kfree(dev->tx_buff.head);
785 dev->rx_buff.head = dev->tx_buff.head = NULL; 785 dev->rx_buff.head = dev->tx_buff.head = NULL;
786 dev->rx_buff.skb = NULL; 786 dev->rx_buff.skb = NULL;
@@ -865,6 +865,12 @@ out:
865 return 0; 865 return 0;
866} 866}
867 867
868static const struct net_device_ops sirdev_ops = {
869 .ndo_start_xmit = sirdev_hard_xmit,
870 .ndo_open = sirdev_open,
871 .ndo_stop = sirdev_close,
872 .ndo_do_ioctl = sirdev_ioctl,
873};
868/* ----------------------------------------------------------------------------- */ 874/* ----------------------------------------------------------------------------- */
869 875
870struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *name) 876struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *name)
@@ -908,10 +914,7 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n
908 dev->netdev = ndev; 914 dev->netdev = ndev;
909 915
910 /* Override the network functions we need to use */ 916 /* Override the network functions we need to use */
911 ndev->hard_start_xmit = sirdev_hard_xmit; 917 ndev->netdev_ops = &sirdev_ops;
912 ndev->open = sirdev_open;
913 ndev->stop = sirdev_close;
914 ndev->do_ioctl = sirdev_ioctl;
915 918
916 if (register_netdev(ndev)) { 919 if (register_netdev(ndev)) {
917 IRDA_ERROR("%s(), register_netdev() failed!\n", __func__); 920 IRDA_ERROR("%s(), register_netdev() failed!\n", __func__);
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index dd73cce10991..59d79807b4d5 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -486,6 +486,26 @@ static int __init smsc_ircc_init(void)
486 return ret; 486 return ret;
487} 487}
488 488
489static int smsc_ircc_net_xmit(struct sk_buff *skb, struct net_device *dev)
490{
491 struct smsc_ircc_cb *self = netdev_priv(dev);
492
493 if (self->io.speed > 115200)
494 return smsc_ircc_hard_xmit_fir(skb, dev);
495 else
496 return smsc_ircc_hard_xmit_sir(skb, dev);
497}
498
499static const struct net_device_ops smsc_ircc_netdev_ops = {
500 .ndo_open = smsc_ircc_net_open,
501 .ndo_stop = smsc_ircc_net_close,
502 .ndo_do_ioctl = smsc_ircc_net_ioctl,
503 .ndo_start_xmit = smsc_ircc_net_xmit,
504#if SMSC_IRCC2_C_NET_TIMEOUT
505 .ndo_tx_timeout = smsc_ircc_timeout,
506#endif
507};
508
489/* 509/*
490 * Function smsc_ircc_open (firbase, sirbase, dma, irq) 510 * Function smsc_ircc_open (firbase, sirbase, dma, irq)
491 * 511 *
@@ -519,14 +539,10 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u
519 goto err_out1; 539 goto err_out1;
520 } 540 }
521 541
522 dev->hard_start_xmit = smsc_ircc_hard_xmit_sir;
523#if SMSC_IRCC2_C_NET_TIMEOUT 542#if SMSC_IRCC2_C_NET_TIMEOUT
524 dev->tx_timeout = smsc_ircc_timeout;
525 dev->watchdog_timeo = HZ * 2; /* Allow enough time for speed change */ 543 dev->watchdog_timeo = HZ * 2; /* Allow enough time for speed change */
526#endif 544#endif
527 dev->open = smsc_ircc_net_open; 545 dev->netdev_ops = &smsc_ircc_netdev_ops;
528 dev->stop = smsc_ircc_net_close;
529 dev->do_ioctl = smsc_ircc_net_ioctl;
530 546
531 self = netdev_priv(dev); 547 self = netdev_priv(dev);
532 self->netdev = dev; 548 self->netdev = dev;
@@ -995,9 +1011,6 @@ static void smsc_ircc_fir_start(struct smsc_ircc_cb *self)
995 1011
996 /* Reset everything */ 1012 /* Reset everything */
997 1013
998 /* Install FIR transmit handler */
999 dev->hard_start_xmit = smsc_ircc_hard_xmit_fir;
1000
1001 /* Clear FIFO */ 1014 /* Clear FIFO */
1002 outb(inb(fir_base + IRCC_LCR_A) | IRCC_LCR_A_FIFO_RESET, fir_base + IRCC_LCR_A); 1015 outb(inb(fir_base + IRCC_LCR_A) | IRCC_LCR_A_FIFO_RESET, fir_base + IRCC_LCR_A);
1003 1016
@@ -1894,7 +1907,6 @@ static void smsc_ircc_sir_start(struct smsc_ircc_cb *self)
1894 IRDA_ASSERT(self != NULL, return;); 1907 IRDA_ASSERT(self != NULL, return;);
1895 dev = self->netdev; 1908 dev = self->netdev;
1896 IRDA_ASSERT(dev != NULL, return;); 1909 IRDA_ASSERT(dev != NULL, return;);
1897 dev->hard_start_xmit = &smsc_ircc_hard_xmit_sir;
1898 1910
1899 fir_base = self->io.fir_base; 1911 fir_base = self->io.fir_base;
1900 sir_base = self->io.sir_base; 1912 sir_base = self->io.sir_base;
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c
index 8b1658c6c925..8e5e45caf2f1 100644
--- a/drivers/net/irda/stir4200.c
+++ b/drivers/net/irda/stir4200.c
@@ -1007,6 +1007,13 @@ static int stir_net_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
1007 return ret; 1007 return ret;
1008} 1008}
1009 1009
1010static const struct net_device_ops stir_netdev_ops = {
1011 .ndo_open = stir_net_open,
1012 .ndo_stop = stir_net_close,
1013 .ndo_start_xmit = stir_hard_xmit,
1014 .ndo_do_ioctl = stir_net_ioctl,
1015};
1016
1010/* 1017/*
1011 * This routine is called by the USB subsystem for each new device 1018 * This routine is called by the USB subsystem for each new device
1012 * in the system. We need to check if the device is ours, and in 1019 * in the system. We need to check if the device is ours, and in
@@ -1054,10 +1061,7 @@ static int stir_probe(struct usb_interface *intf,
1054 irda_qos_bits_to_value(&stir->qos); 1061 irda_qos_bits_to_value(&stir->qos);
1055 1062
1056 /* Override the network functions we need to use */ 1063 /* Override the network functions we need to use */
1057 net->hard_start_xmit = stir_hard_xmit; 1064 net->netdev_ops = &stir_netdev_ops;
1058 net->open = stir_net_open;
1059 net->stop = stir_net_close;
1060 net->do_ioctl = stir_net_ioctl;
1061 1065
1062 ret = register_netdev(net); 1066 ret = register_netdev(net);
1063 if (ret != 0) 1067 if (ret != 0)
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 8b3e545924cc..864798502ff9 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -310,6 +310,19 @@ static void __exit via_ircc_cleanup(void)
310 pci_unregister_driver (&via_driver); 310 pci_unregister_driver (&via_driver);
311} 311}
312 312
313static const struct net_device_ops via_ircc_sir_ops = {
314 .ndo_start_xmit = via_ircc_hard_xmit_sir,
315 .ndo_open = via_ircc_net_open,
316 .ndo_stop = via_ircc_net_close,
317 .ndo_do_ioctl = via_ircc_net_ioctl,
318};
319static const struct net_device_ops via_ircc_fir_ops = {
320 .ndo_start_xmit = via_ircc_hard_xmit_fir,
321 .ndo_open = via_ircc_net_open,
322 .ndo_stop = via_ircc_net_close,
323 .ndo_do_ioctl = via_ircc_net_ioctl,
324};
325
313/* 326/*
314 * Function via_ircc_open (iobase, irq) 327 * Function via_ircc_open (iobase, irq)
315 * 328 *
@@ -428,10 +441,7 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
428 self->tx_fifo.tail = self->tx_buff.head; 441 self->tx_fifo.tail = self->tx_buff.head;
429 442
430 /* Override the network functions we need to use */ 443 /* Override the network functions we need to use */
431 dev->hard_start_xmit = via_ircc_hard_xmit_sir; 444 dev->netdev_ops = &via_ircc_sir_ops;
432 dev->open = via_ircc_net_open;
433 dev->stop = via_ircc_net_close;
434 dev->do_ioctl = via_ircc_net_ioctl;
435 445
436 err = register_netdev(dev); 446 err = register_netdev(dev);
437 if (err) 447 if (err)
@@ -798,11 +808,11 @@ static void via_ircc_change_speed(struct via_ircc_cb *self, __u32 speed)
798 808
799 if (speed > 115200) { 809 if (speed > 115200) {
800 /* Install FIR xmit handler */ 810 /* Install FIR xmit handler */
801 dev->hard_start_xmit = via_ircc_hard_xmit_fir; 811 dev->netdev_ops = &via_ircc_fir_ops;
802 via_ircc_dma_receive(self); 812 via_ircc_dma_receive(self);
803 } else { 813 } else {
804 /* Install SIR xmit handler */ 814 /* Install SIR xmit handler */
805 dev->hard_start_xmit = via_ircc_hard_xmit_sir; 815 dev->netdev_ops = &via_ircc_sir_ops;
806 } 816 }
807 netif_wake_queue(dev); 817 netif_wake_queue(dev);
808} 818}
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index 723c4588c803..1243bc8e0035 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -1573,6 +1573,14 @@ static int vlsi_close(struct net_device *ndev)
1573 return 0; 1573 return 0;
1574} 1574}
1575 1575
1576static const struct net_device_ops vlsi_netdev_ops = {
1577 .ndo_open = vlsi_open,
1578 .ndo_stop = vlsi_close,
1579 .ndo_start_xmit = vlsi_hard_start_xmit,
1580 .ndo_do_ioctl = vlsi_ioctl,
1581 .ndo_tx_timeout = vlsi_tx_timeout,
1582};
1583
1576static int vlsi_irda_init(struct net_device *ndev) 1584static int vlsi_irda_init(struct net_device *ndev)
1577{ 1585{
1578 vlsi_irda_dev_t *idev = netdev_priv(ndev); 1586 vlsi_irda_dev_t *idev = netdev_priv(ndev);
@@ -1608,11 +1616,7 @@ static int vlsi_irda_init(struct net_device *ndev)
1608 ndev->flags |= IFF_PORTSEL | IFF_AUTOMEDIA; 1616 ndev->flags |= IFF_PORTSEL | IFF_AUTOMEDIA;
1609 ndev->if_port = IF_PORT_UNKNOWN; 1617 ndev->if_port = IF_PORT_UNKNOWN;
1610 1618
1611 ndev->open = vlsi_open; 1619 ndev->netdev_ops = &vlsi_netdev_ops;
1612 ndev->stop = vlsi_close;
1613 ndev->hard_start_xmit = vlsi_hard_start_xmit;
1614 ndev->do_ioctl = vlsi_ioctl;
1615 ndev->tx_timeout = vlsi_tx_timeout;
1616 ndev->watchdog_timeo = 500*HZ/1000; /* max. allowed turn time for IrLAP */ 1620 ndev->watchdog_timeo = 500*HZ/1000; /* max. allowed turn time for IrLAP */
1617 1621
1618 SET_NETDEV_DEV(ndev, &pdev->dev); 1622 SET_NETDEV_DEV(ndev, &pdev->dev);
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index dc0a2e4d830f..d0883835b0c6 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -140,6 +140,13 @@ static void __exit w83977af_cleanup(void)
140 } 140 }
141} 141}
142 142
143static const struct net_device_ops w83977_netdev_ops = {
144 .ndo_open = w83977af_net_open,
145 .ndo_stop = w83977af_net_close,
146 .ndo_start_xmit = w83977af_hard_xmit,
147 .ndo_do_ioctl = w83977af_net_ioctl,
148};
149
143/* 150/*
144 * Function w83977af_open (iobase, irq) 151 * Function w83977af_open (iobase, irq)
145 * 152 *
@@ -231,11 +238,7 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq,
231 self->rx_buff.data = self->rx_buff.head; 238 self->rx_buff.data = self->rx_buff.head;
232 self->netdev = dev; 239 self->netdev = dev;
233 240
234 /* Override the network functions we need to use */ 241 dev->netdev_ops = &w83977_netdev_ops;
235 dev->hard_start_xmit = w83977af_hard_xmit;
236 dev->open = w83977af_net_open;
237 dev->stop = w83977af_net_close;
238 dev->do_ioctl = w83977af_net_ioctl;
239 242
240 err = register_netdev(dev); 243 err = register_netdev(dev);
241 if (err) { 244 if (err) {