diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-03-20 15:35:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-21 22:33:46 -0400 |
commit | c279b8c996e99a3fca7806986415263f840b2fa1 (patch) | |
tree | 8591e0ee28c3ff1e19e2a2a59e106151fccb1808 /drivers/net/irda | |
parent | 4113a1a672e5b3f03fc99e7240d4c47e689af2c6 (diff) |
irda: convert nsc_ircc 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')
-rw-r--r-- | drivers/net/irda/nsc-ircc.c | 23 |
1 files changed, 17 insertions, 6 deletions
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 | ||
334 | static 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 | |||
341 | static 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 */ |