diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-16 20:24:53 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-16 20:24:53 -0400 |
commit | 492b057c426e4aa747484958e18e9da29003985d (patch) | |
tree | 34e08c24618688d8bcc190523028b5f94cce0c0b /drivers/net/irda/au1k_ir.c | |
parent | 313485175da221c388f6a8ecf4c30062ba9bea17 (diff) | |
parent | 300df7dc89cc276377fc020704e34875d5c473b6 (diff) |
Merge commit 'origin/master' into next
Diffstat (limited to 'drivers/net/irda/au1k_ir.c')
-rw-r--r-- | drivers/net/irda/au1k_ir.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c index 941164076a2b..c4361d466597 100644 --- a/drivers/net/irda/au1k_ir.c +++ b/drivers/net/irda/au1k_ir.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
25 | #include <linux/netdevice.h> | 25 | #include <linux/netdevice.h> |
26 | #include <linux/etherdevice.h> | ||
26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
27 | #include <linux/rtnetlink.h> | 28 | #include <linux/rtnetlink.h> |
28 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
@@ -198,6 +199,17 @@ static int au1k_irda_init_iobuf(iobuff_t *io, int size) | |||
198 | return io->head ? 0 : -ENOMEM; | 199 | return io->head ? 0 : -ENOMEM; |
199 | } | 200 | } |
200 | 201 | ||
202 | static const struct net_device_ops au1k_irda_netdev_ops = { | ||
203 | .ndo_open = au1k_irda_start, | ||
204 | .ndo_stop = au1k_irda_stop, | ||
205 | .ndo_start_xmit = au1k_irda_hard_xmit, | ||
206 | .ndo_tx_timeout = au1k_tx_timeout, | ||
207 | .ndo_do_ioctl = au1k_irda_ioctl, | ||
208 | .ndo_change_mtu = eth_change_mtu, | ||
209 | .ndo_validate_addr = eth_validate_addr, | ||
210 | .ndo_set_mac_address = eth_mac_addr, | ||
211 | }; | ||
212 | |||
201 | static int au1k_irda_net_init(struct net_device *dev) | 213 | static int au1k_irda_net_init(struct net_device *dev) |
202 | { | 214 | { |
203 | struct au1k_private *aup = netdev_priv(dev); | 215 | struct au1k_private *aup = netdev_priv(dev); |
@@ -209,11 +221,7 @@ static int au1k_irda_net_init(struct net_device *dev) | |||
209 | if (err) | 221 | if (err) |
210 | goto out1; | 222 | goto out1; |
211 | 223 | ||
212 | dev->open = au1k_irda_start; | 224 | dev->netdev_ops = &au1k_irda_netdev_ops; |
213 | dev->hard_start_xmit = au1k_irda_hard_xmit; | ||
214 | dev->stop = au1k_irda_stop; | ||
215 | dev->do_ioctl = au1k_irda_ioctl; | ||
216 | dev->tx_timeout = au1k_tx_timeout; | ||
217 | 225 | ||
218 | irda_init_max_qos_capabilies(&aup->qos); | 226 | irda_init_max_qos_capabilies(&aup->qos); |
219 | 227 | ||
@@ -504,13 +512,13 @@ static int au1k_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
504 | printk(KERN_DEBUG "%s: tx_full\n", dev->name); | 512 | printk(KERN_DEBUG "%s: tx_full\n", dev->name); |
505 | netif_stop_queue(dev); | 513 | netif_stop_queue(dev); |
506 | aup->tx_full = 1; | 514 | aup->tx_full = 1; |
507 | return 1; | 515 | return NETDEV_TX_BUSY; |
508 | } | 516 | } |
509 | else if (((aup->tx_head + 1) & (NUM_IR_DESC - 1)) == aup->tx_tail) { | 517 | else if (((aup->tx_head + 1) & (NUM_IR_DESC - 1)) == aup->tx_tail) { |
510 | printk(KERN_DEBUG "%s: tx_full\n", dev->name); | 518 | printk(KERN_DEBUG "%s: tx_full\n", dev->name); |
511 | netif_stop_queue(dev); | 519 | netif_stop_queue(dev); |
512 | aup->tx_full = 1; | 520 | aup->tx_full = 1; |
513 | return 1; | 521 | return NETDEV_TX_BUSY; |
514 | } | 522 | } |
515 | 523 | ||
516 | pDB = aup->tx_db_inuse[aup->tx_head]; | 524 | pDB = aup->tx_db_inuse[aup->tx_head]; |