Commit c279b8c9 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

irda: convert nsc_ircc driver to net_device_ops

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4113a1a6
...@@ -331,6 +331,20 @@ static void __exit nsc_ircc_cleanup(void) ...@@ -331,6 +331,20 @@ static void __exit nsc_ircc_cleanup(void)
pnp_registered = 0; pnp_registered = 0;
} }
static const struct net_device_ops nsc_ircc_sir_ops = {
.ndo_open = nsc_ircc_net_open,
.ndo_stop = nsc_ircc_net_close,
.ndo_start_xmit = nsc_ircc_hard_xmit_sir,
.ndo_do_ioctl = nsc_ircc_net_ioctl,
};
static const struct net_device_ops nsc_ircc_fir_ops = {
.ndo_open = nsc_ircc_net_open,
.ndo_stop = nsc_ircc_net_close,
.ndo_start_xmit = nsc_ircc_hard_xmit_fir,
.ndo_do_ioctl = nsc_ircc_net_ioctl,
};
/* /*
* Function nsc_ircc_open (iobase, irq) * Function nsc_ircc_open (iobase, irq)
* *
...@@ -441,10 +455,7 @@ static int __init nsc_ircc_open(chipio_t *info) ...@@ -441,10 +455,7 @@ static int __init nsc_ircc_open(chipio_t *info)
self->tx_fifo.tail = self->tx_buff.head; self->tx_fifo.tail = self->tx_buff.head;
/* Override the network functions we need to use */ /* Override the network functions we need to use */
dev->hard_start_xmit = nsc_ircc_hard_xmit_sir; dev->netdev_ops = &nsc_ircc_sir_ops;
dev->open = nsc_ircc_net_open;
dev->stop = nsc_ircc_net_close;
dev->do_ioctl = nsc_ircc_net_ioctl;
err = register_netdev(dev); err = register_netdev(dev);
if (err) { if (err) {
...@@ -1320,12 +1331,12 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed) ...@@ -1320,12 +1331,12 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed)
switch_bank(iobase, BANK0); switch_bank(iobase, BANK0);
if (speed > 115200) { if (speed > 115200) {
/* Install FIR xmit handler */ /* Install FIR xmit handler */
dev->hard_start_xmit = nsc_ircc_hard_xmit_fir; dev->netdev_ops = &nsc_ircc_fir_ops;
ier = IER_SFIF_IE; ier = IER_SFIF_IE;
nsc_ircc_dma_receive(self); nsc_ircc_dma_receive(self);
} else { } else {
/* Install SIR xmit handler */ /* Install SIR xmit handler */
dev->hard_start_xmit = nsc_ircc_hard_xmit_sir; dev->netdev_ops = &nsc_ircc_sir_ops;
ier = IER_RXHDL_IE; ier = IER_RXHDL_IE;
} }
/* Set our current interrupt mask */ /* Set our current interrupt mask */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment