summaryrefslogtreecommitdiff
path: root/drivers/net/irda/smsc-ircc2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-03-20 19:35:42 +0000
committerDavid S. Miller <davem@davemloft.net>2009-03-21 19:33:47 -0700
commit02087be61af0e48eae42566d3c5783f2f44337c8 (patch)
tree424d20756e2cb1fed39d01e3077a6a16a765b887 /drivers/net/irda/smsc-ircc2.c
parent30a5d7f7e3c77e3b00b8c981b7af4e5adc331353 (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>
Diffstat (limited to 'drivers/net/irda/smsc-ircc2.c')
-rw-r--r--drivers/net/irda/smsc-ircc2.c30
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)
return ret;
}
+static int smsc_ircc_net_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct smsc_ircc_cb *self = netdev_priv(dev);
+
+ if (self->io.speed > 115200)
+ return smsc_ircc_hard_xmit_fir(skb, dev);
+ else
+ return smsc_ircc_hard_xmit_sir(skb, dev);
+}
+
+static const struct net_device_ops smsc_ircc_netdev_ops = {
+ .ndo_open = smsc_ircc_net_open,
+ .ndo_stop = smsc_ircc_net_close,
+ .ndo_do_ioctl = smsc_ircc_net_ioctl,
+ .ndo_start_xmit = smsc_ircc_net_xmit,
+#if SMSC_IRCC2_C_NET_TIMEOUT
+ .ndo_tx_timeout = smsc_ircc_timeout,
+#endif
+};
+
/*
* Function smsc_ircc_open (firbase, sirbase, dma, irq)
*
@@ -519,14 +539,10 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u
goto err_out1;
}
- dev->hard_start_xmit = smsc_ircc_hard_xmit_sir;
#if SMSC_IRCC2_C_NET_TIMEOUT
- dev->tx_timeout = smsc_ircc_timeout;
dev->watchdog_timeo = HZ * 2; /* Allow enough time for speed change */
#endif
- dev->open = smsc_ircc_net_open;
- dev->stop = smsc_ircc_net_close;
- dev->do_ioctl = smsc_ircc_net_ioctl;
+ dev->netdev_ops = &smsc_ircc_netdev_ops;
self = netdev_priv(dev);
self->netdev = dev;
@@ -995,9 +1011,6 @@ static void smsc_ircc_fir_start(struct smsc_ircc_cb *self)
/* Reset everything */
- /* Install FIR transmit handler */
- dev->hard_start_xmit = smsc_ircc_hard_xmit_fir;
-
/* Clear FIFO */
outb(inb(fir_base + IRCC_LCR_A) | IRCC_LCR_A_FIFO_RESET, fir_base + IRCC_LCR_A);
@@ -1894,7 +1907,6 @@ static void smsc_ircc_sir_start(struct smsc_ircc_cb *self)
IRDA_ASSERT(self != NULL, return;);
dev = self->netdev;
IRDA_ASSERT(dev != NULL, return;);
- dev->hard_start_xmit = &smsc_ircc_hard_xmit_sir;
fir_base = self->io.fir_base;
sir_base = self->io.sir_base;