diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-01-07 21:10:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-07 21:10:24 -0500 |
commit | 3a1a27fa46f6c3ce39fe02b73df6d8d4648d1679 (patch) | |
tree | 316175a413a8fc487d79f863321fd7f9343e8412 /drivers/net/atp.c | |
parent | 887e53d2d131fe0740326f66f1b417671fdfcf9a (diff) |
atp: convert 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/atp.c')
-rw-r--r-- | drivers/net/atp.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/net/atp.c b/drivers/net/atp.c index ea493ce23982..4317b3edb3d7 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c | |||
@@ -204,8 +204,7 @@ static irqreturn_t atp_interrupt(int irq, void *dev_id); | |||
204 | static void net_rx(struct net_device *dev); | 204 | static void net_rx(struct net_device *dev); |
205 | static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode); | 205 | static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode); |
206 | static int net_close(struct net_device *dev); | 206 | static int net_close(struct net_device *dev); |
207 | static void set_rx_mode_8002(struct net_device *dev); | 207 | static void set_rx_mode(struct net_device *dev); |
208 | static void set_rx_mode_8012(struct net_device *dev); | ||
209 | static void tx_timeout(struct net_device *dev); | 208 | static void tx_timeout(struct net_device *dev); |
210 | 209 | ||
211 | 210 | ||
@@ -242,6 +241,17 @@ static int __init atp_init(void) | |||
242 | return -ENODEV; | 241 | return -ENODEV; |
243 | } | 242 | } |
244 | 243 | ||
244 | static const struct net_device_ops atp_netdev_ops = { | ||
245 | .ndo_open = net_open, | ||
246 | .ndo_stop = net_close, | ||
247 | .ndo_start_xmit = atp_send_packet, | ||
248 | .ndo_set_multicast_list = set_rx_mode, | ||
249 | .ndo_tx_timeout = tx_timeout, | ||
250 | .ndo_change_mtu = eth_change_mtu, | ||
251 | .ndo_set_mac_address = eth_mac_addr, | ||
252 | .ndo_validate_addr = eth_validate_addr, | ||
253 | }; | ||
254 | |||
245 | static int __init atp_probe1(long ioaddr) | 255 | static int __init atp_probe1(long ioaddr) |
246 | { | 256 | { |
247 | struct net_device *dev = NULL; | 257 | struct net_device *dev = NULL; |
@@ -342,12 +352,7 @@ static int __init atp_probe1(long ioaddr) | |||
342 | if (dev->mem_end & 0xf) | 352 | if (dev->mem_end & 0xf) |
343 | net_debug = dev->mem_end & 7; | 353 | net_debug = dev->mem_end & 7; |
344 | 354 | ||
345 | dev->open = net_open; | 355 | dev->netdev_ops = &atp_netdev_ops; |
346 | dev->stop = net_close; | ||
347 | dev->hard_start_xmit = atp_send_packet; | ||
348 | dev->set_multicast_list = | ||
349 | lp->chip_type == RTL8002 ? &set_rx_mode_8002 : &set_rx_mode_8012; | ||
350 | dev->tx_timeout = tx_timeout; | ||
351 | dev->watchdog_timeo = TX_TIMEOUT; | 356 | dev->watchdog_timeo = TX_TIMEOUT; |
352 | 357 | ||
353 | res = register_netdev(dev); | 358 | res = register_netdev(dev); |
@@ -903,6 +908,17 @@ static void set_rx_mode_8012(struct net_device *dev) | |||
903 | write_reg(ioaddr, CMR2, CMR2_IRQOUT); /* Switch back to page 0 */ | 908 | write_reg(ioaddr, CMR2, CMR2_IRQOUT); /* Switch back to page 0 */ |
904 | } | 909 | } |
905 | 910 | ||
911 | static void set_rx_mode(struct net_device *dev) | ||
912 | { | ||
913 | struct net_local *lp = netdev_priv(dev); | ||
914 | |||
915 | if (lp->chip_type == RTL8002) | ||
916 | return set_rx_mode_8002(dev); | ||
917 | else | ||
918 | return set_rx_mode_8012(dev); | ||
919 | } | ||
920 | |||
921 | |||
906 | static int __init atp_init_module(void) { | 922 | static int __init atp_init_module(void) { |
907 | if (debug) /* Emit version even if no cards detected. */ | 923 | if (debug) /* Emit version even if no cards detected. */ |
908 | printk(KERN_INFO "%s", version); | 924 | printk(KERN_INFO "%s", version); |