diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-03-20 15:35:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-21 22:33:47 -0400 |
commit | 02087be61af0e48eae42566d3c5783f2f44337c8 (patch) | |
tree | 424d20756e2cb1fed39d01e3077a6a16a765b887 | |
parent | 30a5d7f7e3c77e3b00b8c981b7af4e5adc331353 (diff) |
irda: convert smsc driver to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/irda/smsc-ircc2.c | 30 |
1 files changed, 21 insertions, 9 deletions
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 | ||
489 | static 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 | |||
499 | static 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; |