Other things such as netconsole may wish to enable the net polling netdevice
functions, so it's better to use a standalone config variable, rather than
CONFIG_KGDB.




 Documentation/i386/kgdb/kgdbeth.txt |    2 +-
 drivers/net/3c59x.c                 |   13 ++++++-------
 drivers/net/Kconfig                 |    3 +++
 drivers/net/e100/e100_main.c        |    6 +++---
 drivers/net/kgdb_eth.c              |    4 ++--
 include/linux/netdevice.h           |    4 +++-
 6 files changed, 18 insertions(+), 14 deletions(-)

diff -puN drivers/net/3c59x.c~kgdb-CONFIG_NET_POLL_CONTROLLER drivers/net/3c59x.c
--- 25/drivers/net/3c59x.c~kgdb-CONFIG_NET_POLL_CONTROLLER	2003-10-02 01:29:24.000000000 -0700
+++ 25-akpm/drivers/net/3c59x.c	2003-10-02 01:29:24.000000000 -0700
@@ -1063,7 +1063,7 @@ static int __devinit vortex_init_one (st
 	return rc;
 }
 
-#ifdef CONFIG_KGDB
+#ifdef CONFIG_NET_POLL_CONTROLLER
 static void vortex_rx_poll(struct net_device *dev)
 {
 	disable_irq(dev->irq);
@@ -1466,12 +1466,11 @@ static int __devinit vortex_probe1(struc
 	dev->set_multicast_list = set_rx_mode;
 	dev->tx_timeout = vortex_tx_timeout;
 	dev->watchdog_timeo = (watchdog * HZ) / 1000;
-#ifdef CONFIG_KGDB
-	if (vp->full_bus_master_tx) {
-		dev->kgdb_net_poll_rx = boomerang_rx_poll;
-	} else {
-		dev->kgdb_net_poll_rx = vortex_rx_poll;
-	}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	if (vp->full_bus_master_tx)
+		dev->poll_controller = boomerang_rx_poll;
+	else
+		dev->poll_controller = vortex_rx_poll;
 #endif
 
 	if (pdev) {
diff -puN drivers/net/e100/e100_main.c~kgdb-CONFIG_NET_POLL_CONTROLLER drivers/net/e100/e100_main.c
--- 25/drivers/net/e100/e100_main.c~kgdb-CONFIG_NET_POLL_CONTROLLER	2003-10-02 01:29:24.000000000 -0700
+++ 25-akpm/drivers/net/e100/e100_main.c	2003-10-02 01:29:24.000000000 -0700
@@ -539,7 +539,7 @@ e100_trigger_SWI(struct e100_private *bd
 	readw(&(bdp->scb->scb_status));	/* flushes last write, read-safe */
 }
 
-#ifdef CONFIG_KGDB
+#ifdef CONFIG_NET_POLL_CONTROLLER
 static void e100_rx_poll(struct net_device *dev)
 {
 	disable_irq(dev->irq);
@@ -640,8 +640,8 @@ e100_found1(struct pci_dev *pcid, const 
 	dev->set_multicast_list = &e100_set_multi;
 	dev->set_mac_address = &e100_set_mac;
 	dev->do_ioctl = &e100_ioctl;
-#ifdef CONFIG_KGDB
-	dev->kgdb_net_poll_rx = e100_rx_poll;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = e100_rx_poll;
 #endif
 	if (bdp->flags & USE_IPCB)
 	dev->features = NETIF_F_SG | NETIF_F_IP_CSUM |
diff -puN drivers/net/Kconfig~kgdb-CONFIG_NET_POLL_CONTROLLER drivers/net/Kconfig
--- 25/drivers/net/Kconfig~kgdb-CONFIG_NET_POLL_CONTROLLER	2003-10-02 01:29:24.000000000 -0700
+++ 25-akpm/drivers/net/Kconfig	2003-10-02 01:29:24.000000000 -0700
@@ -2441,6 +2441,9 @@ config SHAPER
 	  To compile this driver as a module, choose M here: the module
 	  will be called shaper.  If unsure, say N.
 
+config NET_POLL_CONTROLLER
+	def_bool KGDB
+
 source "drivers/net/wan/Kconfig"
 
 source "drivers/net/pcmcia/Kconfig"
diff -puN include/linux/netdevice.h~kgdb-CONFIG_NET_POLL_CONTROLLER include/linux/netdevice.h
--- 25/include/linux/netdevice.h~kgdb-CONFIG_NET_POLL_CONTROLLER	2003-10-02 01:29:24.000000000 -0700
+++ 25-akpm/include/linux/netdevice.h	2003-10-02 01:29:24.000000000 -0700
@@ -458,7 +458,9 @@ struct net_device
 
 #ifdef CONFIG_KGDB
 	int			kgdb_is_trapped;
-	void			(*kgdb_net_poll_rx)(struct net_device *);
+#endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	void			(*poll_controller)(struct net_device *);
 #endif
 
 #ifdef CONFIG_NET_FASTROUTE
diff -puN Documentation/i386/kgdb/kgdbeth.txt~kgdb-CONFIG_NET_POLL_CONTROLLER Documentation/i386/kgdb/kgdbeth.txt
--- 25/Documentation/i386/kgdb/kgdbeth.txt~kgdb-CONFIG_NET_POLL_CONTROLLER	2003-10-02 01:29:24.000000000 -0700
+++ 25-akpm/Documentation/i386/kgdb/kgdbeth.txt	2003-10-02 01:29:24.000000000 -0700
@@ -103,7 +103,7 @@ New devices
 -----------
 
 Supporting a new device is straightforward.  Just add a "poll" routine to
-the driver and hook it into the kgdb_net_poll_rx field in the netdevice
+the driver and hook it into the poll_controller field in the netdevice
 structure.  For an example, look in drivers/net/3c59x.c and search
 for CONFIG_KGDB (two places.)
 
diff -puN drivers/net/kgdb_eth.c~kgdb-CONFIG_NET_POLL_CONTROLLER drivers/net/kgdb_eth.c
--- 25/drivers/net/kgdb_eth.c~kgdb-CONFIG_NET_POLL_CONTROLLER	2003-10-02 01:29:24.000000000 -0700
+++ 25-akpm/drivers/net/kgdb_eth.c	2003-10-02 01:29:26.000000000 -0700
@@ -435,8 +435,8 @@ eth_getDebugChar(void)
 		if (send_skb) {
 			kgdb_eth_reply_arp();
 		}
-		if (kgdb_netdevice->kgdb_net_poll_rx) {
-			kgdb_netdevice->kgdb_net_poll_rx(kgdb_netdevice);
+		if (kgdb_netdevice->poll_controller) {
+			kgdb_netdevice->poll_controller(kgdb_netdevice);
 		} else {
 			printk("KGDB NET: Error - Device %s is not supported!\n", kgdb_netdevice->name);
 			panic("Please add support for kgdb net to this driver");

_