last of the x86 net_device_ops
PATCH 12/30 wireless: convert arlan to net_device_ops
In reply to Stephen Hemmingerdrivers/net/wireless/arlan-main.c +12 -9
@@ -1030,7 +1030,17 @@ static int arlan_mac_addr(struct net_devreturn 0 ; } - +static const struct net_device_ops arlan_netdev_ops = { + .ndo_open = arlan_open, + .ndo_stop = arlan_close, + .ndo_start_xmit = arlan_tx, + .ndo_get_stats = arlan_statistics, + .ndo_set_multicast_list = arlan_set_multicast, + .ndo_change_mtu = arlan_change_mtu, + .ndo_set_mac_address = arlan_mac_addr, + .ndo_tx_timeout = arlan_tx_timeout, + .ndo_validate_addr = eth_validate_addr, +};static int __init arlan_setup_device (struct net_device *dev,int num) {
@@ -1042,14 +1052,7 @@ static int __init arlan_setup_device(str ap->conf = (struct arlan_shmem *)(ap+1 ); dev->tx_queue_len = tx_queue_len; - dev->open = arlan_open; - dev->stop = arlan_close; - dev->hard_start_xmit = arlan_tx; - dev->get_stats = arlan_statistics; - dev->set_multicast_list = arlan_set_multicast; - dev->change_mtu = arlan_change_mtu; - dev->set_mac_address = arlan_mac_addr; - dev->tx_timeout = arlan_tx_timeout; + dev->netdev_ops = &arlan_netdev_ops; dev->watchdog_timeo =3 *HZ ; ap->irq_test_done =0 ;
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 13/30 wireless: convert wavelan to net_device_ops
In reply to Stephen Hemminger--- drivers/net/wireless/wavelan.c | 79 +++++++++++++++++---------------------- drivers/net/wireless/wavelan.p.h | 9 ---- 2 files changed, 37 insertions(+), 51 deletions(-)
drivers/net/wireless/wavelan.c +36 -43
@@ -735,9 +735,9 @@ if (lp->tx_n_in_use > 0)if (tx_status &AC_SFLD_OK ) {int ncollisions; - lp->stats.tx_packets++; + dev->stats.tx_packets++; ncollisions = tx_status &AC_SFLD_MAXCOL ; - lp->stats.collisions += ncollisions; + dev->stats.collisions += ncollisions;#ifdef DEBUG_TX_INFO if (ncollisions >0 ) printk(KERN_DEBUG
@@ -745,9 +745,9 @@ if (lp->tx_n_in_use > 0) dev->name, ncollisions);#endif }else { - lp->stats.tx_errors++; + dev->stats.tx_errors++;if (tx_status &AC_SFLD_S10 ) { - lp->stats.tx_carrier_errors++; + dev->stats.tx_carrier_errors++;#ifdef DEBUG_TX_FAIL printk(KERN_DEBUG "%s: wv_complete(): tx error: no CS.\n",
@@ -755,7 +755,7 @@ if (lp->tx_n_in_use > 0)#endif }if (tx_status &AC_SFLD_S9 ) { - lp->stats.tx_carrier_errors++; + dev->stats.tx_carrier_errors++;#ifdef DEBUG_TX_FAIL printk(KERN_DEBUG "%s: wv_complete(): tx error: lost CTS.\n",
@@ -763,7 +763,7 @@ if (lp->tx_n_in_use > 0)#endif }if (tx_status &AC_SFLD_S8 ) { - lp->stats.tx_fifo_errors++; + dev->stats.tx_fifo_errors++;#ifdef DEBUG_TX_FAIL printk(KERN_DEBUG "%s: wv_complete(): tx error: slow DMA.\n",
@@ -771,7 +771,7 @@ if (lp->tx_n_in_use > 0)#endif }if (tx_status &AC_SFLD_S6 ) { - lp->stats.tx_heartbeat_errors++; + dev->stats.tx_heartbeat_errors++;#ifdef DEBUG_TX_FAIL printk(KERN_DEBUG "%s: wv_complete(): tx error: heart beat.\n",
@@ -779,7 +779,7 @@ if (lp->tx_n_in_use > 0)#endif }if (tx_status &AC_SFLD_S5 ) { - lp->stats.tx_aborted_errors++; + dev->stats.tx_aborted_errors++;#ifdef DEBUG_TX_FAIL printk(KERN_DEBUG "%s: wv_complete(): tx error: too many collisions.\n",
@@ -1346,20 +1346,6 @@ static void wv_init_info(struct net_devi* or wireless extensions */ -/*------------------------------------------------------------------*/ -/* -* Get the current Ethernet statistics. This may be called with the -* card open or closed. -* Used when the user read /proc/net/dev -*/ -static en_stats *wavelan_get_stats (struct net_device * dev) -{ -#ifdef DEBUG_IOCTL_TRACE -printk (KERN_DEBUG "%s: <>wavelan_get_stats()\n" , dev->name); -#endif - -return &((net_local *)netdev_priv (dev))->stats; -}/*------------------------------------------------------------------*/ /*
@@ -2466,7 +2452,7 @@ wv_packet_read(struct net_device * dev,"%s: wv_packet_read(): could not alloc_skb(%d, GFP_ATOMIC).\n" , dev->name, sksize);#endif - lp->stats.rx_dropped++; + dev->stats.rx_dropped++;return ; }
@@ -2526,8 +2512,8 @@ wv_packet_read(struct net_device * dev,netif_rx (skb);/* Keep statistics up to date */ - lp->stats.rx_packets++; - lp->stats.rx_bytes += sksize; + dev->stats.rx_packets++; + dev->stats.rx_bytes += sksize;#ifdef DEBUG_RX_TRACE printk (KERN_DEBUG "%s: <-wv_packet_read()\n" , dev->name);
@@ -2608,7 +2594,7 @@ static void wv_receive(struct net_device#endif }else {/* If reception was no successful */ - lp->stats.rx_errors++; + dev->stats.rx_errors++;#ifdef DEBUG_RX_INFO printk(KERN_DEBUG
@@ -2624,7 +2610,7 @@ static void wv_receive(struct net_device#endif if ((fd.fd_status &FD_STATUS_S7 ) !=0 ) { - lp->stats.rx_length_errors++; + dev->stats.rx_length_errors++;#ifdef DEBUG_RX_FAIL printk(KERN_DEBUG "%s: wv_receive(): frame too short.\n",
@@ -2633,7 +2619,7 @@ static void wv_receive(struct net_device }if ((fd.fd_status &FD_STATUS_S8 ) !=0 ) { - lp->stats.rx_over_errors++; + dev->stats.rx_over_errors++;#ifdef DEBUG_RX_FAIL printk(KERN_DEBUG "%s: wv_receive(): rx DMA overrun.\n",
@@ -2642,7 +2628,7 @@ static void wv_receive(struct net_device }if ((fd.fd_status &FD_STATUS_S9 ) !=0 ) { - lp->stats.rx_fifo_errors++; + dev->stats.rx_fifo_errors++;#ifdef DEBUG_RX_FAIL printk(KERN_DEBUG "%s: wv_receive(): ran out of resources.\n",
@@ -2651,7 +2637,7 @@ static void wv_receive(struct net_device }if ((fd.fd_status &FD_STATUS_S10 ) !=0 ) { - lp->stats.rx_frame_errors++; + dev->stats.rx_frame_errors++;#ifdef DEBUG_RX_FAIL printk(KERN_DEBUG "%s: wv_receive(): alignment error.\n",
@@ -2660,7 +2646,7 @@ static void wv_receive(struct net_device }if ((fd.fd_status &FD_STATUS_S11 ) !=0 ) { - lp->stats.rx_crc_errors++; + dev->stats.rx_crc_errors++;#ifdef DEBUG_RX_FAIL printk(KERN_DEBUG "%s: wv_receive(): CRC error.\n",
@@ -2826,7 +2812,7 @@ static int wv_packet_write(struct net_de dev->trans_start = jiffies;/* Keep stats up to date. */ - lp->stats.tx_bytes += length; + dev->stats.tx_bytes += length;if (lp->tx_first_in_use ==I82586NULL ) lp->tx_first_in_use = txblock;
@@ -4038,6 +4024,22 @@ static int wavelan_close(struct net_devireturn 0 ; } +static const struct net_device_ops wavelan_netdev_ops = { + .ndo_open = wavelan_open, + .ndo_stop = wavelan_close, + .ndo_start_xmit = wavelan_packet_xmit, + .ndo_set_multicast_list = wavelan_set_multicast_list, + .ndo_tx_timeout = wavelan_watchdog, + .ndo_change_mtu = eth_change_mtu, + .ndo_validate_addr = eth_validate_addr, +#ifdef SET_MAC_ADDRESS + .ndo_set_mac_address = wavelan_set_mac_address +#else + .ndo_set_mac_address = eth_mac_addr, +#endif +}; + +/*------------------------------------------------------------------*/ /* * Probe an I/O address, and if the WaveLAN is there configure the
@@ -4130,17 +4132,8 @@ static int __init wavelan_config(struct/* Init spinlock */ spin_lock_init (&lp->spinlock); - dev->open = wavelan_open; - dev->stop = wavelan_close; - dev->hard_start_xmit = wavelan_packet_xmit; - dev->get_stats = wavelan_get_stats; - dev->set_multicast_list = &wavelan_set_multicast_list; - dev->tx_timeout = &wavelan_watchdog; - dev->watchdog_timeo =WATCHDOG_JIFFIES ; -#ifdef SET_MAC_ADDRESS - dev->set_mac_address = &wavelan_set_mac_address; -#endif /* SET_MAC_ADDRESS */ - + dev->netdev_ops = &wavelan_netdev_ops; + dev->watchdog_timeo =WATCHDOG_JIFFIES ; dev->wireless_handlers = &wavelan_handler_def; lp->wireless_data.spy_data = &lp->spy_data; dev->wireless_data = &lp->wireless_data;
drivers/net/wireless/wavelan.p.h +1 -8
@@ -459,11 +459,9 @@ static const char *version = "wavelan.c/****************************** TYPES ******************************/ /* Shortcuts */ -typedef struct net_device_stats en_stats ;typedef struct iw_statistics iw_stats ;typedef struct iw_quality iw_qual ; -typedef struct iw_freq iw_freq ; -typedef struct net_local net_local ; +typedef struct iw_freq iw_freq ;typedef struct net_local net_local ;typedef struct timer_list timer_list ;/* Basic types */
@@ -475,15 +473,12 @@ typedef u_char mac_addr[WAVELAN_ADDR_SI* For each network interface, Linux keeps data in two structures: "device" * keeps the generic data (same format for everybody) and "net_local" keeps * additional specific data. -* Note that some of this specific data is in fact generic (en_stats, for -* example). */ struct net_local {net_local * next;/* linked list of the devices */ struct net_device * dev;/* reverse link */ spinlock_t spinlock;/* Serialize access to the hardware (SMP) */ -en_stats stats;/* Ethernet interface statistics */ int nresets;/* number of hardware resets */ u_char reconfig_82586;/* We need to reconfigure the controller. */ u_char promiscuous;/* promiscuous mode */
@@ -601,8 +596,6 @@ static voidstatic inline void wv_init_info (struct net_device *);/* display startup info */ /* ------------------- IOCTL, STATS & RECONFIG ------------------- */ -static en_stats * -wavelan_get_stats (struct net_device *);/* Give stats /proc/net/dev */ static iw_stats *wavelan_get_wireless_stats (struct net_device *); static void
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
cover last of the x86 net_device_ops
This sequence of patches makes all network drivers in net-next build on 32bit using net_device_ops.
Ie. allmodconfig and !CONFIG_COMPAT_NET_DEV_OPS
PATCH 1/30 3c503, smc-ultra: netdev_ops bugs
A couple of drivers have leftovers from netdev ops conversion.
drivers/net/3c503.c +0 -3
@@ -353,9 +353,6 @@ el2_probe1(struct net_device *dev, int i dev->netdev_ops = &el2_netdev_ops; dev->ethtool_ops = &netdev_ethtool_ops; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = eip_poll; -#endif retval =register_netdev (dev);if (retval)
drivers/net/smc-ultra.c +0 -3
@@ -142,9 +142,6 @@ static int __init do_ultra_probe(structint base_addr = dev->base_addr;int irq = dev->irq; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = &ultra_poll; -#endif if (base_addr >0x1ff )/* Check a single specified location. */ return ultra_probe1 (dev, base_addr);else if (base_addr !=0 )/* Don't probe at all. */
PATCH 2/30 uml: convert network device to internal network device stats
In reply to Stephen HemmingerConvert the UML network device to use internal network device stats.
arch/um/drivers/net_kern.c +6 -13
@@ -86,7 +86,7 @@ static int uml_net_rx(struct net_device drop_skb->dev = dev;/* Read a packet into drop_skb and don't do anything with it. */ (*lp->read)(lp->fd, drop_skb, lp); - lp->stats.rx_dropped++; + dev->stats.rx_dropped++;return 0 ; }
@@ -99,8 +99,8 @@ static int uml_net_rx(struct net_deviceskb_trim (skb, pkt_len); skb->protocol = (*lp->protocol)(skb); - lp->stats.rx_bytes += skb->len; - lp->stats.rx_packets++; + dev->stats.rx_bytes += skb->len; + dev->stats.rx_packets++;netif_rx (skb);return pkt_len; }
@@ -224,8 +224,8 @@ static int uml_net_start_xmit(struct sk_ len = (*lp->write)(lp->fd, skb, lp);if (len == skb->len) { - lp->stats.tx_packets++; - lp->stats.tx_bytes += skb->len; + dev->stats.tx_packets++; + dev->stats.tx_bytes += skb->len; dev->trans_start = jiffies;netif_start_queue (dev);
@@ -234,7 +234,7 @@ static int uml_net_start_xmit(struct sk_ }else if (len ==0 ) {netif_start_queue (dev); - lp->stats.tx_dropped++; + dev->stats.tx_dropped++; }else {netif_start_queue (dev);
@@ -248,12 +248,6 @@ static int uml_net_start_xmit(struct sk_return 0 ; } -static struct net_device_stats *uml_net_get_stats (struct net_device *dev) -{ -struct uml_net_private *lp =netdev_priv (dev); -return &lp->stats; -} -static void uml_net_set_multicast_list (struct net_device *dev) {return ;
@@ -476,7 +470,6 @@ static void eth_configure(int n, void *i dev->open = uml_net_open; dev->hard_start_xmit = uml_net_start_xmit; dev->stop = uml_net_close; - dev->get_stats = uml_net_get_stats; dev->set_multicast_list = uml_net_set_multicast_list; dev->tx_timeout = uml_net_tx_timeout; dev->set_mac_address = uml_net_set_mac;
arch/um/include/shared/net_kern.h +1 -1
@@ -26,7 +26,7 @@ struct uml_net_private {spinlock_t lock;struct net_device *dev;struct timer_list tl; -struct net_device_stats stats; +struct work_struct work;int fd;unsigned char mac[ETH_ALEN ];
PATCH 3/30 uml: convert network device to netdevice ops
In reply to Stephen Hemmingerarch/um/drivers/net_kern.c +13 -7
@@ -371,6 +371,18 @@ static void net_device_release(struct defree_netdev (netdev); } +static const struct net_device_ops uml_netdev_ops = { + .ndo_open = uml_net_open, + .ndo_stop = uml_net_close, + .ndo_start_xmit = uml_net_start_xmit, + .ndo_set_multicast_list = uml_net_set_multicast_list, + .ndo_tx_timeout = uml_net_tx_timeout, + .ndo_set_mac_address = uml_net_set_mac, + .ndo_change_mtu = uml_net_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +/* * Ensures that platform_driver_register is called only once by * eth_configure. Will be set in an initcall.
@@ -467,13 +479,7 @@ static void eth_configure(int n, void *iset_ether_mac (dev, device->mac); dev->mtu = transport->user->mtu; - dev->open = uml_net_open; - dev->hard_start_xmit = uml_net_start_xmit; - dev->stop = uml_net_close; - dev->set_multicast_list = uml_net_set_multicast_list; - dev->tx_timeout = uml_net_tx_timeout; - dev->set_mac_address = uml_net_set_mac; - dev->change_mtu = uml_net_change_mtu; + dev->netdev_ops = ¨_netdev_ops; dev->ethtool_ops = ¨_net_ethtool_ops; dev->watchdog_timeo = (HZ >>1 ); dev->irq =UM_ETH_IRQ ;
------------------------------------------------------------------------------
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 4/30 appletalk: convert cops to internal net_device_stats
In reply to Stephen Hemmingerdrivers/net/appletalk/cops.c +8 -20
@@ -171,7 +171,6 @@ static unsigned int cops_debug = COPS_DEstruct cops_local { -struct net_device_stats stats;int board;/* Holds what board type is. */ int nodeid;/* Set to 1 once have nodeid. */ unsigned char node_acquire;/* Node ID when acquired. */
@@ -197,7 +196,6 @@ static int cops_send_packet (struct sk_static void set_multicast_list (struct net_device *dev);static int cops_ioctl (struct net_device *dev,struct ifreq *rq,int cmd);static int cops_close (struct net_device *dev); -static struct net_device_stats *cops_get_stats (struct net_device *dev);static void cleanup_card (struct net_device *dev) {
@@ -337,7 +335,6 @@ static int __init cops_probe1(struct net dev->tx_timeout = cops_timeout; dev->watchdog_timeo =HZ *2 ; - dev->get_stats = cops_get_stats; dev->open = cops_open; dev->stop = cops_close; dev->do_ioctl = cops_ioctl;
@@ -797,7 +794,7 @@ static void cops_rx(struct net_device *d {printk (KERN_WARNING "%s: Memory squeeze, dropping packet.\n" , dev->name); - lp->stats.rx_dropped++; + dev->stats.rx_dropped++;while (pkt_len--)/* Discard packet */ inb (ioaddr);spin_unlock_irqrestore (&lp->lock, flags);
@@ -819,7 +816,7 @@ static void cops_rx(struct net_device *d {printk (KERN_WARNING "%s: Bad packet length of %d bytes.\n" , dev->name, pkt_len); - lp->stats.tx_errors++; + dev->stats.tx_errors++;dev_kfree_skb_any (skb);return ; }
@@ -836,7 +833,7 @@ static void cops_rx(struct net_device *dif (rsp_type !=LAP_RESPONSE ) {printk (KERN_WARNING "%s: Bad packet type %d.\n" , dev->name, rsp_type); - lp->stats.tx_errors++; + dev->stats.tx_errors++;dev_kfree_skb_any (skb);return ; }
@@ -846,8 +843,8 @@ static void cops_rx(struct net_device *dskb_reset_transport_header (skb);/* Point to data (Skip header). */ /* Update the counters. */ - lp->stats.rx_packets++; - lp->stats.rx_bytes += skb->len; + dev->stats.rx_packets++; + dev->stats.rx_bytes += skb->len;/* Send packet to a higher place. */ netif_rx (skb);
@@ -858,7 +855,7 @@ static void cops_timeout(struct net_devistruct cops_local *lp =netdev_priv (dev);int ioaddr = dev->base_addr; - lp->stats.tx_errors++; + dev->stats.tx_errors++;if (lp->board==TANGENT ) {if ((inb (ioaddr+TANG_CARD_STATUS )&TANG_TX_READY )==0 )
@@ -916,8 +913,8 @@ static int cops_send_packet(struct sk_buspin_unlock_irqrestore (&lp->lock, flags);/* Restore interrupts. */ /* Done sending packet, update counters and cleanup. */ - lp->stats.tx_packets++; - lp->stats.tx_bytes += skb->len; + dev->stats.tx_packets++; + dev->stats.tx_bytes += skb->len; dev->trans_start = jiffies;dev_kfree_skb (skb);return 0 ;
@@ -986,15 +983,6 @@ static int cops_close(struct net_devicereturn 0 ; } -/* -* Get the current statistics. -* This may be called with the card open or closed. -*/ -static struct net_device_stats *cops_get_stats (struct net_device *dev) -{ -struct cops_local *lp =netdev_priv (dev); -return &lp->stats; -}#ifdef MODULE static struct net_device *cops_dev;
PATCH 5/30 To: [email protected] Subjetct: appltetalk: convert cops device to net_device ops
In reply to Stephen Hemmingerdrivers/net/appletalk/cops.c +10 -7
@@ -258,6 +258,15 @@ out:return ERR_PTR (err); } +static const struct net_device_ops cops_netdev_ops = { + .ndo_open = cops_open, + .ndo_stop = cops_close, + .ndo_start_xmit = cops_send_packet, + .ndo_tx_timeout = cops_timeout, + .ndo_do_ioctl = cops_ioctl, + .ndo_set_multicast_list = set_multicast_list, +}; +/* * This is the real probe routine. Linux has a history of friendly device * probes on the ISA bus. A good device probes avoids doing writes, and
@@ -331,15 +340,9 @@ static int __init cops_probe1(struct net/* Copy local board variable to lp struct. */ lp->board = board; - dev->hard_start_xmit = cops_send_packet; - dev->tx_timeout = cops_timeout; + dev->netdev_ops = &cops_netdev_ops; dev->watchdog_timeo =HZ *2 ; - dev->open = cops_open; - dev->stop = cops_close; - dev->do_ioctl = cops_ioctl; - dev->set_multicast_list = set_multicast_list; - dev->mc_list =NULL ;/* Tell the user where the card is and what mode we're in. */ if (board==DAYNA )
PATCH 6/30 appletalk: convert LTPC to use internal net_device_stats
In reply to Stephen Hemmingerdrivers/net/appletalk/ltpc.c +4 -20
@@ -261,7 +261,6 @@ static unsigned char *ltdmacbuf;struct ltpc_private { -struct net_device_stats stats;struct atalk_addr my_addr; };
@@ -699,7 +698,6 @@ static int do_read(struct net_device *destatic struct timer_list ltpc_timer;static int ltpc_xmit (struct sk_buff *skb,struct net_device *dev); -static struct net_device_stats *ltpc_get_stats (struct net_device *dev);static int read_30 (struct net_device *dev) {
@@ -726,8 +724,6 @@ static int sendup_buffer (struct net_devint dnode, snode, llaptype, len;int sklen;struct sk_buff *skb; -struct ltpc_private *ltpc_priv =netdev_priv (dev); -struct net_device_stats *stats = <pc_priv->stats;struct lt_rcvlap *ltc = (struct lt_rcvlap *) ltdmacbuf;if (ltc->command !=LT_RCVLAP ) {
@@ -779,8 +775,8 @@ static int sendup_buffer (struct net_devskb_reset_transport_header (skb); - stats->rx_packets++; - stats->rx_bytes+=skb->len; + dev->stats.rx_packets++; + dev->stats.rx_bytes += skb->len;/* toss it onwards */ netif_rx (skb);
@@ -904,10 +900,6 @@ static int ltpc_xmit(struct sk_buff *skb/* in kernel 1.3.xx, on entry skb->data points to ddp header, * and skb->len is the length of the ddp data + ddp header */ - -struct ltpc_private *ltpc_priv =netdev_priv (dev); -struct net_device_stats *stats = <pc_priv->stats; -int i;struct lt_sendlap cbuf;unsigned char *hdr;
@@ -936,20 +928,13 @@ static int ltpc_xmit(struct sk_buff *skbprintk ("\n" ); } - stats->tx_packets++; - stats->tx_bytes+=skb->len; + dev->stats.tx_packets++; + dev->stats.tx_bytes += skb->len;dev_kfree_skb (skb);return 0 ; } -static struct net_device_stats *ltpc_get_stats (struct net_device *dev) -{ -struct ltpc_private *ltpc_priv =netdev_priv (dev); -struct net_device_stats *stats = <pc_priv->stats; -return stats; -} -/* initialization stuff */ static int __init ltpc_probe_dma (int base,int dma)
@@ -1135,7 +1120,6 @@ struct net_device * __init ltpc_probe(vo/* Fill in the fields of the device structure with ethernet-generic values. */ dev->hard_start_xmit = ltpc_xmit; - dev->get_stats = ltpc_get_stats;/* add the ltpc-specific things */ dev->do_ioctl = <pc_ioctl;
PATCH 7/30 appletalk: convert LTPC to net_device_ops
In reply to Stephen Hemmingerdrivers/net/appletalk/ltpc.c +7 -7
@@ -1012,6 +1012,12 @@ static int __init ltpc_probe_dma(int basreturn (want &2 ) ?3 :1 ; } +static const struct net_device_ops ltpc_netdev = { + .ndo_start_xmit = ltpc_xmit, + .ndo_do_ioctl = ltpc_ioctl, + .ndo_set_multicast_list = set_multicast_list, +}; +struct net_device *__init ltpc_probe (void ) {struct net_device *dev;
@@ -1118,13 +1124,7 @@ struct net_device * __init ltpc_probe(voelse printk (KERN_INFO "Apple/Farallon LocalTalk-PC card at %03x, DMA%d. Using polled mode.\n" ,io,dma); -/* Fill in the fields of the device structure with ethernet-generic values. */ - dev->hard_start_xmit = ltpc_xmit; - -/* add the ltpc-specific things */ - dev->do_ioctl = <pc_ioctl; - - dev->set_multicast_list = &set_multicast_list; + dev->netdev_ops = <pc_netdev; dev->mc_list =NULL ; dev->base_addr = io; dev->irq = irq;
PATCH 8/30 IRDA: convert donauboe to net_device_ops
In reply to Stephen Hemmingerdrivers/net/irda/donauboe.c +8 -4
@@ -1524,6 +1524,13 @@ toshoboe_close (struct pci_dev *pci_dev)free_netdev (self->netdev); } +static const struct net_device_ops toshoboe_netdev_ops = { + .ndo_open = toshoboe_net_open, + .ndo_stop = toshoboe_net_close, + .ndo_start_xmit = toshoboe_hard_xmit, + .ndo_do_ioctl = toshoboe_net_ioctl, +}; +static int toshoboe_open (struct pci_dev *pci_dev,const struct pci_device_id *pdid) {
@@ -1657,10 +1664,7 @@ toshoboe_open (struct pci_dev *pci_dev,#endif SET_NETDEV_DEV (dev, &pci_dev->dev); - dev->hard_start_xmit = toshoboe_hard_xmit; - dev->open = toshoboe_net_open; - dev->stop = toshoboe_net_close; - dev->do_ioctl = toshoboe_net_ioctl; + dev->netdev_ops = &toshoboe_netdev_ops; err =register_netdev (dev);if (err)
PATCH 9/30 tokenring: convert drivers to net_device_ops
In reply to Stephen HemmingerConvert madge and proteon drivers which are really just subclasses of tms380.
drivers/net/tokenring/madgemc.c +6 -5
@@ -142,7 +142,7 @@ static void madgemc_sifwritew(struct netreturn ; } - +static struct net_device_ops madgemc_netdev_ops__read_mostly ;static int __devinit madgemc_probe (struct device *device) {
@@ -168,7 +168,7 @@ static int __devinit madgemc_probe(struc goto getout; } - dev->dma =0 ; + dev->netdev_ops = &madgemc_netdev_ops; card =kmalloc (sizeof (struct card_info ),GFP_KERNEL );if (card==NULL ) {
@@ -348,9 +348,6 @@ static int __devinit madgemc_probe(strucmemcpy (tp->ProductID,"Madge MCA 16/4 " ,PROD_ID_SIZE +1 ); - dev->open = madgemc_open; - dev->stop = madgemc_close; - tp->tmspriv = card;dev_set_drvdata (device, dev);
@@ -758,6 +755,10 @@ static struct mca_driver madgemc_driverstatic int __init madgemc_init (void ) { + madgemc_netdev_ops = tms380tr_netdev_ops; + madgemc_netdev_ops.ndo_open = madgemc_open; + madgemc_netdev_ops.ndo_stop = madgemc_close; +return mca_register_driver (&madgemc_driver); }
drivers/net/tokenring/proteon.c +7 -2
@@ -116,6 +116,8 @@ nodev:return -ENODEV ; } +static struct net_device_ops proteon_netdev_ops__read_mostly ; +static int __init setup_card (struct net_device *dev,struct device *pdev) {struct net_local *tp;
@@ -167,8 +169,7 @@ static int __init setup_card(struct net_ tp->tmspriv =NULL ; - dev->open = proteon_open; - dev->stop = tms380tr_close; + dev->netdev_ops = &proteon_netdev_ops;if (dev->irq ==0 ) {
@@ -352,6 +353,10 @@ static int __init proteon_init(void)struct platform_device *pdev;int i, num =0 , err =0 ; + proteon_netdev_ops = tms380tr_netdev_ops; + proteon_netdev_ops.ndo_open = proteon_open; + proteon_netdev_ops.ndo_stop = tms380tr_close; + err =platform_driver_register (&proteon_driver);if (err)return err;
drivers/net/tokenring/skisa.c +7 -2
@@ -133,6 +133,8 @@ static int __init sk_isa_probe1(struct nreturn 0 ; } +static struct net_device_ops sk_isa_netdev_ops__read_mostly ; +static int __init setup_card (struct net_device *dev,struct device *pdev) {struct net_local *tp;
@@ -184,8 +186,7 @@ static int __init setup_card(struct net_ tp->tmspriv =NULL ; - dev->open = sk_isa_open; - dev->stop = tms380tr_close; + dev->netdev_ops = &sk_isa_netdev_ops;if (dev->irq ==0 ) {
@@ -362,6 +363,10 @@ static int __init sk_isa_init(void)struct platform_device *pdev;int i, num =0 , err =0 ; + sk_isa_netdev_ops = tms380tr_netdev_ops; + sk_isa_netdev_ops.ndo_open = sk_isa_open; + sk_isa_netdev_ops.ndo_stop = tms380tr_close; + err =platform_driver_register (&sk_isa_driver);if (err)return err;
PATCH 10/30 tokenring: convert smctr to net_device_ops
In reply to Stephen Hemmingerdrivers/net/tokenring/smctr.c +9 -7
@@ -124,7 +124,6 @@ static unsigned int smctr_get_num_rx_bdbstatic int smctr_get_physical_drop_number (struct net_device *dev);static __u8 *smctr_get_rx_pointer (struct net_device *dev,short queue);static int smctr_get_station_id (struct net_device *dev); -static struct net_device_stats *smctr_get_stats (struct net_device *dev);static FCBlock *smctr_get_tx_fcb (struct net_device *dev,__u16 queue,__u16 bytes_count);static int smctr_get_upstream_neighbor_addr (struct net_device *dev);
@@ -3633,6 +3632,14 @@ out:return ERR_PTR (err); } +static const struct net_device_ops smctr_netdev_ops = { + .ndo_open = smctr_open, + .ndo_stop = smctr_close, + .ndo_start_xmit = smctr_send_packet, + .ndo_tx_timeout = smctr_timeout, + .ndo_get_stats = smctr_get_stats, + .ndo_set_multicast_list = smctr_set_multicast_list, +};static int __init smctr_probe1 (struct net_device *dev,int ioaddr) {
@@ -3683,13 +3690,8 @@ static int __init smctr_probe1(struct ne (unsigned int )dev->base_addr, dev->irq, tp->rom_base, tp->ram_base); - dev->open = smctr_open; - dev->stop = smctr_close; - dev->hard_start_xmit = smctr_send_packet; - dev->tx_timeout = smctr_timeout; + dev->netdev_ops = &smctr_netdev_ops; dev->watchdog_timeo =HZ ; - dev->get_stats = smctr_get_stats; - dev->set_multicast_list = &smctr_set_multicast_list;return (0 ); out:
PATCH 11/30 wan: convert sdla driver to net_device_ops
In reply to Stephen HemmingerAlso use internal net_device_stats
drivers/net/wan/sdla.c +15 -21
@@ -714,19 +714,19 @@ static int sdla_transmit(struct sk_buffswitch (ret) {case SDLA_RET_OK : - flp->stats.tx_packets++; + dev->stats.tx_packets++; ret =DLCI_RET_OK ;break ;case SDLA_RET_CIR_OVERFLOW :case SDLA_RET_BUF_OVERSIZE :case SDLA_RET_NO_BUFS : - flp->stats.tx_dropped++; + dev->stats.tx_dropped++; ret =DLCI_RET_DROP ;break ;default : - flp->stats.tx_errors++; + dev->stats.tx_errors++; ret =DLCI_RET_ERR ;break ; }
@@ -807,7 +807,7 @@ static void sdla_receive(struct net_deviif (i ==CONFIG_DLCI_MAX ) {printk (KERN_NOTICE "%s: Received packet from invalid DLCI %i, ignoring." , dev->name, dlci); - flp->stats.rx_errors++; + dev->stats.rx_errors++; success =0 ; } }
@@ -819,7 +819,7 @@ static void sdla_receive(struct net_deviif (skb ==NULL ) {printk (KERN_NOTICE "%s: Memory squeeze, dropping packet.\n" , dev->name); - flp->stats.rx_dropped++; + dev->stats.rx_dropped++; success =0 ; }else
@@ -859,7 +859,7 @@ static void sdla_receive(struct net_deviif (success) { - flp->stats.rx_packets++; + dev->stats.rx_packets++; dlp =netdev_priv (master); (*dlp->receive)(skb, master); }
@@ -1590,13 +1590,14 @@ fail:return err; } -static struct net_device_stats *sdla_stats (struct net_device *dev) -{ -struct frad_local *flp; - flp =netdev_priv (dev); - -return (&flp->stats); -} +static const struct net_device_ops sdla_netdev_ops = { + .ndo_open = sdla_open, + .ndo_stop = sdla_close, + .ndo_do_ioctl = sdla_ioctl, + .ndo_set_config = sdla_set_config, + .ndo_start_xmit = sdla_transmit, + .ndo_change_mtu = sdla_change_mtu, +};static void setup_sdla (struct net_device *dev) {
@@ -1604,20 +1605,13 @@ static void setup_sdla(struct net_devicenetdev_boot_setup_check (dev); + dev->netdev_ops = &sdla_netdev_ops; dev->flags =0 ; dev->type =0xFFFF ; dev->hard_header_len =0 ; dev->addr_len =0 ; dev->mtu =SDLA_MAX_MTU ; - dev->open = sdla_open; - dev->stop = sdla_close; - dev->do_ioctl = sdla_ioctl; - dev->set_config = sdla_set_config; - dev->get_stats = sdla_stats; - dev->hard_start_xmit = sdla_transmit; - dev->change_mtu = sdla_change_mtu; - flp->activate = sdla_activate; flp->deactivate = sdla_deactivate; flp->assoc = sdla_assoc;
include/linux/if_frad.h +0 -1
@@ -153,7 +153,6 @@ struct frhdrstruct dlci_local { -struct net_device_stats stats;struct net_device *master;struct net_device *slave;struct dlci_conf config;
PATCH 14/30 netdev: seeq8005 convert to net_device_ops
In reply to Stephen Hemmingerdrivers/net/seeq8005.c +12 -5
@@ -143,6 +143,17 @@ out:return ERR_PTR (err); } +static const struct net_device_ops seeq8005_netdev_ops = { + .ndo_open = seeq8005_open, + .ndo_stop = seeq8005_close, + .ndo_start_xmit = seeq8005_send_packet, + .ndo_tx_timeout = seeq8005_timeout, + .ndo_set_multicast_list = set_multicast_list, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +/* This is the real probe routine. Linux has a history of friendly device probes on the ISA bus. A good device probes avoids doing writes, and verifies that the correct device exists and functions. */
@@ -332,12 +343,8 @@ static int __init seeq8005_probe1(struct } }#endif - dev->open = seeq8005_open; - dev->stop = seeq8005_close; - dev->hard_start_xmit = seeq8005_send_packet; - dev->tx_timeout = seeq8005_timeout; + dev->netdev_ops = &seeq8005_netdev_ops; dev->watchdog_timeo =HZ /20 ; - dev->set_multicast_list = set_multicast_list; dev->flags &= ~IFF_MULTICAST ;return 0 ;
PATCH 15/30 netdev: smc9194 convert to net_device_ops
In reply to Stephen Hemmingerdrivers/net/smc9194.c +12 -5
@@ -831,6 +831,17 @@ static int __init smc_findirq(int ioaddr#endif } +static const struct net_device_ops smc_netdev_ops = { + .ndo_open = smc_open, + .ndo_stop = smc_close, + .ndo_start_xmit = smc_wait_to_send_packet, + .ndo_tx_timeout = smc_timeout, + .ndo_set_multicast_list = smc_set_multicast_list, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +/*---------------------------------------------------------------------- . Function: smc_probe( int ioaddr ) .
@@ -1044,12 +1055,8 @@ static int __init smc_probe(struct net_d goto err_out; } - dev->open = smc_open; - dev->stop = smc_close; - dev->hard_start_xmit = smc_wait_to_send_packet; - dev->tx_timeout = smc_timeout; + dev->netdev_ops = &smc_netdev_ops; dev->watchdog_timeo =HZ /20 ; - dev->set_multicast_list = smc_set_multicast_list;return 0 ;
PATCH 16/30 netdev: smc-ultra32 convert to net_device_ops
In reply to Stephen Hemmingerdrivers/net/smc-ultra32.c +18 -5
@@ -153,6 +153,22 @@ out:return ERR_PTR (err); } + +static const struct net_device_ops ultra32_netdev_ops = { + .ndo_open = ultra32_open, + .ndo_stop = ultra32_close, + .ndo_start_xmit = ei_start_xmit, + .ndo_tx_timeout = ei_tx_timeout, + .ndo_get_stats = ei_get_stats, + .ndo_set_multicast_list = ei_set_multicast_list, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = eth_mac_addr, + .ndo_change_mtu = eth_change_mtu, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = ei_poll, +#endif +}; +static int __init ultra32_probe1 (struct net_device *dev,int ioaddr) {int i, edge, media, retval;
@@ -273,11 +289,8 @@ static int __init ultra32_probe1(struct ei_status.block_output = &ultra32_block_output; ei_status.get_8390_hdr = &ultra32_get_8390_hdr; ei_status.reset_8390 = &ultra32_reset_8390; - dev->open = &ultra32_open; - dev->stop = &ultra32_close; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = ei_poll; -#endif + + dev->netdev_ops = &ultra32_netdev_ops;NS8390_init (dev,0 );return 0 ;
PATCH 17/30 netdev: smc-ultra fix netpoll
In reply to Stephen Hemmingernet_device_ops conversion left the wrong poll_controller hook.
drivers/net/smc-ultra.c +1 -1
@@ -196,7 +196,7 @@ static const struct net_device_ops ultra .ndo_set_mac_address = eth_mac_addr, .ndo_change_mtu = eth_change_mtu, #ifdef CONFIG_NET_POLL_CONTROLLER - .ndo_poll_controller = ei_poll, + .ndo_poll_controller = ultra_poll,#endif };
PATCH 18/30 lance: convert to net_device_ops
In reply to Stephen Hemmingerdrivers/net/lance.c +13 -6
@@ -454,6 +454,18 @@ out: }#endif +static const struct net_device_ops lance_netdev_ops = { + .ndo_open = lance_open, + .ndo_start_xmit = lance_start_xmit, + .ndo_stop = lance_close, + .ndo_get_stats = lance_get_stats, + .ndo_set_multicast_list = set_multicast_list, + .ndo_tx_timeout = lance_tx_timeout, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +static int __init lance_probe1 (struct net_device *dev,int ioaddr,int irq,int options) {struct lance_private *lp;
@@ -714,12 +726,7 @@ static int __init lance_probe1(struct neprintk (version);/* The LANCE-specific entries in the device structure. */ - dev->open = lance_open; - dev->hard_start_xmit = lance_start_xmit; - dev->stop = lance_close; - dev->get_stats = lance_get_stats; - dev->set_multicast_list = set_multicast_list; - dev->tx_timeout = lance_tx_timeout; + dev->netdev_ops = &lance_netdev_ops; dev->watchdog_timeo =TX_TIMEOUT ; err =register_netdev (dev);
PATCH 19/30 netdev: ibmlana convert to net_device_ops
In reply to Stephen Hemmingerdrivers/net/ibmlana.c +12 -5
@@ -905,6 +905,17 @@ static char *ibmlana_adapter_names[] __d NULL }; + +static const struct net_device_ops ibmlana_netdev_ops = { + .ndo_open = ibmlana_open, + .ndo_stop = ibmlana_close, + .ndo_start_xmit = ibmlana_tx, + .ndo_set_multicast_list = ibmlana_set_multicast_list, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +static int __devinit ibmlana_init_one (struct device *kdev) {struct mca_device *mdev =to_mca_device (kdev);
@@ -973,11 +984,7 @@ static int __devinit ibmlana_init_one(stmca_device_set_claim (mdev,1 );/* set methods */ - - dev->open = ibmlana_open; - dev->stop = ibmlana_close; - dev->hard_start_xmit = ibmlana_tx; - dev->set_multicast_list = ibmlana_set_multicast_list; + dev->netdev_ops = &ibmlana_netdev_ops; dev->flags |=IFF_MULTICAST ;/* copy out MAC address */
PATCH 20/30 netdev: convert eexpress to net_device_ops
In reply to Stephen Hemmingerdrivers/net/eexpress.c +12 -5
@@ -1043,6 +1043,17 @@ static void eexp_hw_tx_pio(struct net_de lp->last_tx = jiffies; } +static const struct net_device_ops eexp_netdev_ops = { + .ndo_open = eexp_open, + .ndo_stop = eexp_close, + .ndo_start_xmit = eexp_xmit, + .ndo_set_multicast_list = eexp_set_multicast, + .ndo_tx_timeout = eexp_timeout, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +/* * Sanity check the suspected EtherExpress card * Read hardware address, reset card, size memory and initialize buffer
@@ -1163,11 +1174,7 @@ static int __init eexp_hw_probe(struct n lp->rx_buf_start =TX_BUF_START + (lp->num_tx_bufs*TX_BUF_SIZE ); lp->width = buswidth; - dev->open = eexp_open; - dev->stop = eexp_close; - dev->hard_start_xmit = eexp_xmit; - dev->set_multicast_list = &eexp_set_multicast; - dev->tx_timeout = eexp_timeout; + dev->netdev_ops = &eexp_netdev_ops; dev->watchdog_timeo =2 *HZ ;return register_netdev (dev);
PATCH 21/30 netdev: convert eexpro to net_device_ops
In reply to Stephen Hemmingerdrivers/net/eepro.c +12 -5
@@ -739,6 +739,17 @@ static void __init eepro_print_info (strstatic const struct ethtool_ops eepro_ethtool_ops; +static const struct net_device_ops eepro_netdev_ops = { + .ndo_open = eepro_open, + .ndo_stop = eepro_close, + .ndo_start_xmit = eepro_send_packet, + .ndo_set_multicast_list = set_multicast_list, + .ndo_tx_timeout = eepro_tx_timeout, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +/* This is the real probe routine. Linux has a history of friendly device probes on the ISA bus. A good device probe avoids doing writes, and verifies that the correct device exists and functions. */
@@ -851,11 +862,7 @@ static int __init eepro_probe1(struct ne } } - dev->open = eepro_open; - dev->stop = eepro_close; - dev->hard_start_xmit = eepro_send_packet; - dev->set_multicast_list = &set_multicast_list; - dev->tx_timeout = eepro_tx_timeout; + dev->netdev_ops = &eepro_netdev_ops; dev->watchdog_timeo =TX_TIMEOUT ; dev->ethtool_ops = &eepro_ethtool_ops;
PATCH 22/30 netdev: convert at1700 to net_device_ops
In reply to Stephen HemmingerRemove unneeded memset (alloc_etherdev does it already).
drivers/net/at1700.c +12 -7
@@ -249,6 +249,17 @@ out:return ERR_PTR (err); } +static const struct net_device_ops at1700_netdev_ops = { + .ndo_open = net_open, + .ndo_stop = net_close, + .ndo_start_xmit = net_send_packet, + .ndo_set_multicast_list = set_rx_mode, + .ndo_tx_timeout = net_tx_timeout, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +/* The Fujitsu datasheet suggests that the NIC be probed for by checking its "signature", the default bit pattern after a reset. This *doesn't* work -- there is no way to reset the bus interface without a complete power-cycle!
@@ -448,13 +459,7 @@ found:if (net_debug)printk (version); -memset (lp,0 ,sizeof (struct net_local )); - - dev->open = net_open; - dev->stop = net_close; - dev->hard_start_xmit = net_send_packet; - dev->set_multicast_list = &set_rx_mode; - dev->tx_timeout = net_tx_timeout; + dev->netdev_ops = &at1700_netdev_ops; dev->watchdog_timeo =TX_TIMEOUT ;spin_lock_init (&lp->lock);
PATCH 23/30 netdev: convert depca to net_device_ops
In reply to Stephen Hemmingerdrivers/net/depca.c +13 -6
@@ -566,6 +566,18 @@ MODULE_LICENSE("GPL");outw (CSR0 ,DEPCA_ADDR );\ outw(STOP, DEPCA_DATA) +static const struct net_device_ops depca_netdev_ops = { + .ndo_open = depca_open, + .ndo_start_xmit = depca_start_xmit, + .ndo_stop = depca_close, + .ndo_set_multicast_list = set_multicast_list, + .ndo_do_ioctl = depca_ioctl, + .ndo_tx_timeout = depca_tx_timeout, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +static int __init depca_hw_init (struct net_device *dev,struct device *device) {struct depca_private *lp;
@@ -793,12 +805,7 @@ static int __init depca_hw_init (struct }/* The DEPCA-specific entries in the device structure. */ - dev->open = &depca_open; - dev->hard_start_xmit = &depca_start_xmit; - dev->stop = &depca_close; - dev->set_multicast_list = &set_multicast_list; - dev->do_ioctl = &depca_ioctl; - dev->tx_timeout = depca_tx_timeout; + dev->netdev_ops = &depca_netdev_ops; dev->watchdog_timeo =TX_TIMEOUT ; dev->mem_start =0 ;
PATCH 24/30 netdev: convert ewrk3 to net_device_ops
In reply to Stephen Hemmingerdrivers/net/ewrk3.c +13 -6
@@ -388,6 +388,18 @@ static int __init ewrk3_probe1(struct nereturn err; } +static const struct net_device_ops ewrk3_netdev_ops = { + .ndo_open = ewrk3_open, + .ndo_start_xmit = ewrk3_queue_pkt, + .ndo_stop = ewrk3_close, + .ndo_set_multicast_list = set_multicast_list, + .ndo_do_ioctl = ewrk3_ioctl, + .ndo_tx_timeout = ewrk3_timeout, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +static int __init ewrk3_hw_init (struct net_device *dev,u_long iobase) {
@@ -603,16 +615,11 @@ ewrk3_hw_init(struct net_device *dev, u_printk (version); }/* The EWRK3-specific entries in the device structure. */ - dev->open = ewrk3_open; - dev->hard_start_xmit = ewrk3_queue_pkt; - dev->stop = ewrk3_close; - dev->set_multicast_list = set_multicast_list; - dev->do_ioctl = ewrk3_ioctl; + dev->netdev_ops = &ewrk3_netdev_ops;if (lp->adapter_name[4 ] =='3' )SET_ETHTOOL_OPS (dev, ðtool_ops_203);else SET_ETHTOOL_OPS (dev, ðtool_ops); - dev->tx_timeout = ewrk3_timeout; dev->watchdog_timeo =QUEUE_PKT_TIMEOUT ; dev->mem_start =0 ;
PATCH 25/30 netdev: convert ni52 to net_device_ops
In reply to Stephen Hemmingerdrivers/net/ni52.c +13 -8
@@ -441,6 +441,18 @@ out:return ERR_PTR (err); } +static const struct net_device_ops ni52_netdev_ops = { + .ndo_open = ni52_open, + .ndo_stop = ni52_close, + .ndo_get_stats = ni52_get_stats, + .ndo_tx_timeout = ni52_timeout, + .ndo_start_xmit = ni52_send_packet, + .ndo_set_multicast_list = set_multicast_list, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +static int __init ni52_probe1 (struct net_device *dev,int ioaddr) {int i, size, retval;
@@ -561,15 +573,8 @@ static int __init ni52_probe1(struct netprintk ("IRQ %d (assigned and not checked!).\n" , dev->irq); } - dev->open = ni52_open; - dev->stop = ni52_close; - dev->get_stats = ni52_get_stats; - dev->tx_timeout = ni52_timeout; + dev->netdev_ops = &ni52_netdev_ops; dev->watchdog_timeo =HZ /20 ; - dev->hard_start_xmit = ni52_send_packet; - dev->set_multicast_list = set_multicast_list; - - dev->if_port =0 ;return 0 ; out:
PATCH 26/30 netdev: convert ni65 to net_device_ops
In reply to Stephen HemmingerAlso, use internal net_device_stats.
drivers/net/ni65.c +32 -43
@@ -237,7 +237,7 @@ struct privvoid *tmdbounce[TMDNUM ];int tmdbouncenum;int lock,xmit_queued; -struct net_device_stats stats; +void *self;int cmdr_addr;int cardno;
@@ -257,7 +257,6 @@ static void ni65_timeout(struct net_devstatic int ni65_close (struct net_device *dev);static int ni65_alloc_buffer (struct net_device *dev);static void ni65_free_buffer (struct priv *p); -static struct net_device_stats *ni65_get_stats (struct net_device *);static void set_multicast_list (struct net_device *dev);static int irqtab[]__initdata = {9 ,12 ,15 ,5 };/* irq config-translate */
@@ -401,6 +400,17 @@ out:return ERR_PTR (err); } +static const struct net_device_ops ni65_netdev_ops = { + .ndo_open = ni65_open, + .ndo_stop = ni65_close, + .ndo_start_xmit = ni65_send_packet, + .ndo_tx_timeout = ni65_timeout, + .ndo_set_multicast_list = set_multicast_list, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +/* * this is the real card probe .. */
@@ -549,13 +559,9 @@ static int __init ni65_probe1(struct net } dev->base_addr = ioaddr; - dev->open = ni65_open; - dev->stop = ni65_close; - dev->hard_start_xmit = ni65_send_packet; - dev->tx_timeout = ni65_timeout; + dev->netdev_ops = &ni65_netdev_ops; dev->watchdog_timeo =HZ /2 ; - dev->get_stats = ni65_get_stats; - dev->set_multicast_list = set_multicast_list; +return 0 ;/* everything is OK */ }
@@ -901,13 +907,13 @@ static irqreturn_t ni65_interrupt(int irif (debuglevel >1 )printk (KERN_ERR "%s: general error: %04x.\n" ,dev->name,csr0);if (csr0 &CSR0_BABL ) - p->stats.tx_errors++; + dev->stats.tx_errors++;if (csr0 &CSR0_MISS ) {int i;for (i=0 ;i<RMDNUM ;i++)printk ("%02x " ,p->rmdhead[i].u.s.status);printk ("\n" ); - p->stats.rx_errors++; + dev->stats.rx_errors++; }if (csr0 &CSR0_MERR ) {if (debuglevel >1 )
@@ -997,12 +1003,12 @@ static void ni65_xmit_intr(struct net_de#endif /* checking some errors */ if (tmdp->status2 &XMIT_RTRY ) - p->stats.tx_aborted_errors++; + dev->stats.tx_aborted_errors++;if (tmdp->status2 &XMIT_LCAR ) - p->stats.tx_carrier_errors++; + dev->stats.tx_carrier_errors++;if (tmdp->status2 & (XMIT_BUFF |XMIT_UFLO )) {/* this stops the xmitter */ - p->stats.tx_fifo_errors++; + dev->stats.tx_fifo_errors++;if (debuglevel >0 )printk (KERN_ERR "%s: Xmit FIFO/BUFF error\n" ,dev->name);if (p->features &INIT_RING_BEFORE_START ) {
@@ -1016,12 +1022,12 @@ static void ni65_xmit_intr(struct net_deif (debuglevel >2 )printk (KERN_ERR "%s: xmit-error: %04x %02x-%04x\n" ,dev->name,csr0,(int ) tmdstat,(int ) tmdp->status2);if (!(csr0 &CSR0_BABL ))/* don't count errors twice */ - p->stats.tx_errors++; + dev->stats.tx_errors++; tmdp->status2 =0 ; }else { - p->stats.tx_bytes -= (short )(tmdp->blen); - p->stats.tx_packets++; + dev->stats.tx_bytes -= (short )(tmdp->blen); + dev->stats.tx_packets++; }#ifdef XMT_VIA_SKB
@@ -1057,7 +1063,7 @@ static void ni65_recv_intr(struct net_deif (!(rmdstat &RCV_ERR )) {if (rmdstat &RCV_START ) { - p->stats.rx_length_errors++; + dev->stats.rx_length_errors++;printk (KERN_ERR "%s: recv, packet too long: %d\n" ,dev->name,rmdp->mlen &0x0fff ); } }
@@ -1066,16 +1072,16 @@ static void ni65_recv_intr(struct net_deprintk (KERN_ERR "%s: receive-error: %04x, lance-status: %04x/%04x\n" , dev->name,(int ) rmdstat,csr0,(int )inw (PORT +L_DATAREG ) );if (rmdstat &RCV_FRAM ) - p->stats.rx_frame_errors++; + dev->stats.rx_frame_errors++;if (rmdstat &RCV_OFLO ) - p->stats.rx_over_errors++; + dev->stats.rx_over_errors++;if (rmdstat &RCV_CRC ) - p->stats.rx_crc_errors++; + dev->stats.rx_crc_errors++;if (rmdstat &RCV_BUF_ERR ) - p->stats.rx_fifo_errors++; + dev->stats.rx_fifo_errors++; }if (!(csr0 &CSR0_MISS ))/* don't count errors twice */ - p->stats.rx_errors++; + dev->stats.rx_errors++; }else if ( (len = (rmdp->mlen &0x0fff ) -4 ) >=60 ) {
@@ -1106,20 +1112,20 @@ static void ni65_recv_intr(struct net_deskb_put (skb,len);skb_copy_to_linear_data (skb, (unsigned char *) p->recvbounce[p->rmdnum],len);#endif - p->stats.rx_packets++; - p->stats.rx_bytes += len; + dev->stats.rx_packets++; + dev->stats.rx_bytes += len; skb->protocol=eth_type_trans (skb,dev);netif_rx (skb); }else {printk (KERN_ERR "%s: can't alloc new sk_buff\n" ,dev->name); - p->stats.rx_dropped++; + dev->stats.rx_dropped++; } }else {printk (KERN_INFO "%s: received runt packet\n" ,dev->name); - p->stats.rx_errors++; + dev->stats.rx_errors++; } rmdp->blen = -(R_BUF_SIZE -8 ); rmdp->mlen =0 ;
@@ -1213,23 +1219,6 @@ static int ni65_send_packet(struct sk_bureturn 0 ; } -static struct net_device_stats *ni65_get_stats (struct net_device *dev) -{ - -#if 0 -int i; -struct priv *p = dev->ml_priv; -for (i=0 ;i<RMDNUM ;i++) - { -struct rmd *rmdp = p->rmdhead + ((p->rmdnum + i) & (RMDNUM -1 )); -printk ("%02x " ,rmdp->u.s.status); - } -printk ("\n" ); -#endif - -return &((struct priv *)dev->ml_priv)->stats; -} -static void set_multicast_list (struct net_device *dev) {if (!ni65_lance_reinit (dev))
PATCH 27/30 netdev: convert ac3200 to net_device_ops
In reply to Stephen Hemmingerdrivers/net/ac3200.c +17 -5
@@ -143,6 +143,22 @@ out: }#endif +static const struct net_device_ops ac_netdev_ops = { + .ndo_open = ac_open, + .ndo_stop = ac_close_card, + + .ndo_start_xmit = ei_start_xmit, + .ndo_tx_timeout = ei_tx_timeout, + .ndo_get_stats = ei_get_stats, + .ndo_set_multicast_list = ei_set_multicast_list, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = eth_mac_addr, + .ndo_change_mtu = eth_change_mtu, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = ei_poll, +#endif +}; +static int __init ac_probe1 (int ioaddr,struct net_device *dev) {int i, retval;
@@ -253,11 +269,7 @@ static int __init ac_probe1(int ioaddr, ei_status.block_output = &ac_block_output; ei_status.get_8390_hdr = &ac_get_8390_hdr; - dev->open = &ac_open; - dev->stop = &ac_close_card; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = ei_poll; -#endif + dev->netdev_ops = &ac_netdev_ops;NS8390_init (dev,0 ); retval =register_netdev (dev);
PATCH 28/30 netdev: convert lp486e to net_device_ops
In reply to Stephen Hemmingerdrivers/net/lp486e.c +12 -5
@@ -952,6 +952,17 @@ static void print_eth(char *add) (unsigned char) add[12], (unsigned char) add[13]); } +static const struct net_device_ops i596_netdev_ops = { + .ndo_open = i596_open, + .ndo_stop = i596_close, + .ndo_start_xmit = i596_start_xmit, + .ndo_set_multicast_list = set_multicast_list, + .ndo_tx_timeout = i596_tx_timeout, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +static int __init lp486e_probe (struct net_device *dev) {struct i596_private *lp;unsigned char eth_addr[6 ] = {0 ,0xaa ,0 ,0 ,0 ,0 };
@@ -1014,12 +1025,8 @@ static int __init lp486e_probe(struct neprintk ("\n" );/* The LP486E-specific entries in the device structure. */ - dev->open = &i596_open; - dev->stop = &i596_close; - dev->hard_start_xmit = &i596_start_xmit; - dev->set_multicast_list = &set_multicast_list; + dev->netdev_ops = &i596_netdev_ops; dev->watchdog_timeo =5 *HZ ; - dev->tx_timeout = i596_tx_timeout;#if 0 /* selftest reports 0x320925ae - don't know what that means */
PATCH 29/30 netdev: convert cs89x0 to net_device_ops
In reply to Stephen Hemmingerdrivers/net/cs89x0.c +17 -11
@@ -501,6 +501,21 @@ static void net_poll_controller(struct n }#endif +static const struct net_device_ops net_ops = { + .ndo_open = net_open, + .ndo_stop = net_close, + .ndo_tx_timeout = net_timeout, + .ndo_start_xmit = net_send_packet, + .ndo_get_stats = net_get_stats, + .ndo_set_multicast_list = set_multicast_list, + .ndo_set_mac_address = set_mac_address, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = net_poll_controller, +#endif + .ndo_change_mtu = eth_change_mtu, + .ndo_validate_addr = eth_validate_addr, +}; +/* This is the real probe routine. Linux has a history of friendly device probes on the ISA bus. A good device probes avoids doing writes, and verifies that the correct device exists and functions.
@@ -843,17 +858,8 @@ cs89x0_probe1(struct net_device *dev, in/* print the ethernet address. */ printk (", MAC %pM" , dev->dev_addr); - dev->open = net_open; - dev->stop = net_close; - dev->tx_timeout = net_timeout; - dev->watchdog_timeo =HZ ; - dev->hard_start_xmit = net_send_packet; - dev->get_stats = net_get_stats; - dev->set_multicast_list = set_multicast_list; - dev->set_mac_address = set_mac_address; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = net_poll_controller; -#endif + dev->netdev_ops = &net_ops; + dev->watchdog_timeo =HZ ;printk ("\n" );if (net_debug)
PATCH 30/30 netdev: convert eth16i to net_device_ops
In reply to Stephen HemmingerAlso, get rid of unnecessary memset.
drivers/net/eth16i.c +12 -6
@@ -475,6 +475,17 @@ out: }#endif +static const struct net_device_ops eth16i_netdev_ops = { + .ndo_open = eth16i_open, + .ndo_stop = eth16i_close, + .ndo_start_xmit = eth16i_tx, + .ndo_set_multicast_list = eth16i_multicast, + .ndo_tx_timeout = eth16i_timeout, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; +static int __init eth16i_probe1 (struct net_device *dev,int ioaddr) {struct eth16i_local *lp =netdev_priv (dev);
@@ -549,12 +560,7 @@ static int __init eth16i_probe1(struct nBITCLR (ioaddr +CONFIG_REG_1 ,POWERUP );/* Initialize the device structure */ -memset (lp,0 ,sizeof (struct eth16i_local )); - dev->open = eth16i_open; - dev->stop = eth16i_close; - dev->hard_start_xmit = eth16i_tx; - dev->set_multicast_list = eth16i_multicast; - dev->tx_timeout = eth16i_timeout; + dev->netdev_ops = ð16i_netdev_ops; dev->watchdog_timeo =TX_TIMEOUT ;spin_lock_init (&lp->lock);
Re: [patch 01/30] 3c503, smc-ultra: netdev_ops bugs
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:15 -0700
Quoted 3 lines
A couple of drivers have leftovers from netdev ops conversion.
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 02/30] uml: convert network device to internal network device stats
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:16 -0700
Quoted 3 lines
Convert the UML network device to use internal network device stats.
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 03/30] uml: convert network device to netdevice ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:17 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 04/30] appletalk: convert cops to internal net_device_stats
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:18 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 05/30] appltetalk: convert cops device to net_device ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:19 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 06/30] appletalk: convert LTPC to use internal net_device_stats
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:20 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 07/30] appletalk: convert LTPC to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:21 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 08/30] IRDA: convert donauboe to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:22 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 09/30] tokenring: convert drivers to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:23 -0700
Quoted 4 lines
Convert madge and proteon drivers which are really just subclasses of tms380.
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 10/30] tokenring: convert smctr to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:24 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 13/30] wireless: convert wavelan to net_device_ops
In reply to a message not in the archiveFrom: Stephen Hemminger <shemminger-de/[email protected]>
Date: Thu, 26 Mar 2009 18:11:27 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 11/30] wan: convert sdla driver to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:25 -0700
Quoted 3 lines
Also use internal
net_device_statsSigned-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 12/30] wireless: convert arlan to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:26 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 14/30] netdev: seeq8005 convert to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:28 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 15/30] netdev: smc9194 convert to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:29 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 16/30] netdev: smc-ultra32 convert to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:30 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 17/30] netdev: smc-ultra fix netpoll
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:31 -0700
Quoted 3 lines
net_device_opsconversion left the wrongpoll_controllerhook.Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 18/30] lance: convert to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:32 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 19/30] netdev: ibmlana convert to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:33 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 20/30] netdev: convert eexpress to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:34 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 21/30] netdev: convert eexpro to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:35 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 22/30] netdev: convert at1700 to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:36 -0700
Quoted 3 lines
Remove unneeded memset (
alloc_etherdevdoes it already).Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 22/30] netdev: convert at1700 to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:36 -0700
Quoted 3 lines
Remove unneeded memset (
alloc_etherdevdoes it already).Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 23/30] netdev: convert depca to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:37 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 24/30] netdev: convert ewrk3 to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:38 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 25/30] netdev: convert ni52 to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:39 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 26/30] netdev: convert ni65 to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:40 -0700
Quoted 3 lines
Also, use internal
net_device_stats.Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 27/30] netdev: convert ac3200 to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:41 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 27/30] netdev: convert ac3200 to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:41 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 28/30] netdev: convert lp486e to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:42 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 29/30] netdev: convert cs89x0 to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:43 -0700
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>
Applied.
Re: [patch 30/30] netdev: convert eth16i to net_device_ops
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 26 Mar 2009 18:11:44 -0700
Quoted 3 lines
Also, get rid of unnecessary memset.
Signed-off-by Stephen Hemminger <[email protected]>
Applied.