Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

atp: convert to net_device_ops

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Stephen Hemminger and committed by
David S. Miller
3a1a27fa 887e53d2

+24 -8
+24 -8
drivers/net/atp.c
··· 204 204 static void net_rx(struct net_device *dev); 205 205 static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode); 206 206 static int net_close(struct net_device *dev); 207 - static void set_rx_mode_8002(struct net_device *dev); 208 - static void set_rx_mode_8012(struct net_device *dev); 207 + static void set_rx_mode(struct net_device *dev); 209 208 static void tx_timeout(struct net_device *dev); 210 209 211 210 ··· 240 241 241 242 return -ENODEV; 242 243 } 244 + 245 + static const struct net_device_ops atp_netdev_ops = { 246 + .ndo_open = net_open, 247 + .ndo_stop = net_close, 248 + .ndo_start_xmit = atp_send_packet, 249 + .ndo_set_multicast_list = set_rx_mode, 250 + .ndo_tx_timeout = tx_timeout, 251 + .ndo_change_mtu = eth_change_mtu, 252 + .ndo_set_mac_address = eth_mac_addr, 253 + .ndo_validate_addr = eth_validate_addr, 254 + }; 243 255 244 256 static int __init atp_probe1(long ioaddr) 245 257 { ··· 352 342 if (dev->mem_end & 0xf) 353 343 net_debug = dev->mem_end & 7; 354 344 355 - dev->open = net_open; 356 - dev->stop = net_close; 357 - dev->hard_start_xmit = atp_send_packet; 358 - dev->set_multicast_list = 359 - lp->chip_type == RTL8002 ? &set_rx_mode_8002 : &set_rx_mode_8012; 360 - dev->tx_timeout = tx_timeout; 345 + dev->netdev_ops = &atp_netdev_ops; 361 346 dev->watchdog_timeo = TX_TIMEOUT; 362 347 363 348 res = register_netdev(dev); ··· 907 902 write_reg_high(ioaddr, CMR2, lp->addr_mode); 908 903 write_reg(ioaddr, CMR2, CMR2_IRQOUT); /* Switch back to page 0 */ 909 904 } 905 + 906 + static void set_rx_mode(struct net_device *dev) 907 + { 908 + struct net_local *lp = netdev_priv(dev); 909 + 910 + if (lp->chip_type == RTL8002) 911 + return set_rx_mode_8002(dev); 912 + else 913 + return set_rx_mode_8012(dev); 914 + } 915 + 910 916 911 917 static int __init atp_init_module(void) { 912 918 if (debug) /* Emit version even if no cards detected. */