# --------------------------------------------
# 02/10/18	scott.feldman@intel.com	1.742.1.15
# e100 2/5:
# * Remove broken home-grown Rx polling mode (make way for NAPI)
# 
# --------------------------------------------
#
diff -Nru a/drivers/net/e100/e100.h b/drivers/net/e100/e100.h
--- a/drivers/net/e100/e100.h	Wed Oct 23 21:16:10 2002
+++ b/drivers/net/e100/e100.h	Wed Oct 23 21:16:10 2002
@@ -121,7 +121,6 @@
 #define E100_DEFAULT_CPUSAVER_BUNDLE_MAX	6
 #define E100_DEFAULT_CPUSAVER_INTERRUPT_DELAY	0x600
 #define E100_DEFAULT_BUNDLE_SMALL_FR		false
-#define E100_DEFAULT_RX_CONGESTION_CONTROL	true
 
 /* end of configurables */
 
@@ -146,8 +145,6 @@
 	unsigned long xmt_tco_pkts;
 	unsigned long rcv_tco_pkts;
 	unsigned long rx_intr_pkts;
-	unsigned long rx_tasklet_pkts;
-	unsigned long poll_intr_switch;
 };
 
 /* TODO: kill me when we can do C99 */
@@ -838,7 +835,6 @@
 #define PRM_FC           0x00000004
 #define PRM_IFS          0x00000008
 #define PRM_BUNDLE_SMALL 0x00000010
-#define PRM_RX_CONG      0x00000020
 
 struct cfg_params {
 	int e100_speed_duplex;
@@ -847,7 +843,6 @@
 	int IntDelay;
 	int BundleMax;
 	int ber;
-	int PollingMaxWork;
 	u32 b_params;
 };
 struct ethtool_lpbk_data{
@@ -948,8 +943,6 @@
 	struct timer_list hwi_timer;	/* hwi timer id */
 
 	u32 speed_duplex_caps;	/* adapter's speed/duplex capabilities */
-
-	struct tasklet_struct polling_tasklet;
 
 	/* WOL params for ethtool */
 	u32 wolsupported;
diff -Nru a/drivers/net/e100/e100_main.c b/drivers/net/e100/e100_main.c
--- a/drivers/net/e100/e100_main.c	Wed Oct 23 21:16:10 2002
+++ b/drivers/net/e100/e100_main.c	Wed Oct 23 21:16:10 2002
@@ -349,9 +349,7 @@
 }
 
 void e100_tx_srv(struct e100_private *);
-u32 e100_rx_srv(struct e100_private *, u32, int *);
-
-void e100_polling_tasklet(unsigned long);
+u32 e100_rx_srv(struct e100_private *);
 
 void e100_watchdog(struct net_device *);
 static void e100_do_hwi(struct net_device *);
@@ -379,9 +377,6 @@
 E100_PARAM(BundleSmallFr, "Disable or enable interrupt bundling of small frames");
 E100_PARAM(BundleMax, "Maximum number for CPU saver's packet bundling");
 E100_PARAM(IFS, "Disable or enable the adaptive IFS algorithm");
-E100_PARAM(RxCongestionControl, "Disable or enable switch to polling mode");
-E100_PARAM(PollingMaxWork, "Max number of receive packets processed on single "
-	   "polling call");
 
 /**
  * e100_exec_cmd - issue a comand
@@ -856,14 +851,6 @@
 			    0xFFFF, E100_DEFAULT_CPUSAVER_BUNDLE_MAX,
 			    "CPU saver bundle max value");
 
-	e100_set_bool_option(bdp, RxCongestionControl[board], PRM_RX_CONG,
-			     E100_DEFAULT_RX_CONGESTION_CONTROL,
-			     "Rx Congestion Control value");
-
-	e100_set_int_option(&(bdp->params.PollingMaxWork),
-			    PollingMaxWork[board], 1, E100_MAX_RFD,
-			    bdp->params.RxDescriptors,
-			    "Polling Max Work value");
 }
 
 /**
@@ -991,11 +978,6 @@
 		del_timer_sync(&bdp->watchdog_timer);
 		goto err_exit;
 	}
-	if (bdp->params.b_params & PRM_RX_CONG) {
-		DECLARE_TASKLET(polling_tasklet,
-				e100_polling_tasklet, (unsigned long) bdp);
-		bdp->polling_tasklet = polling_tasklet;
-	}
 	bdp->intr_mask = 0;
 	e100_set_intr_mask(bdp);
 
@@ -1024,10 +1006,6 @@
 	free_irq(dev->irq, dev);
 	e100_clear_pools(bdp);
 
-	if (bdp->params.b_params & PRM_RX_CONG) {
-		tasklet_kill(&(bdp->polling_tasklet));
-	}
-
 	/* set the isolate flag to false, so e100_open can be called */
 	bdp->driver_isolated = false;
 
@@ -1802,47 +1780,6 @@
 	}
 }
 
-void
-e100_polling_tasklet(unsigned long ptr)
-{
-	struct e100_private *bdp = (struct e100_private *) ptr;
-	unsigned int rx_congestion = 0;
-	u32 skb_cnt;
-
-	/* the device is closed, don't continue or else bad things may happen. */
-	if (!netif_running(bdp->device)) {
-		return;
-	}
-
-	read_lock(&(bdp->isolate_lock));
-	if (bdp->driver_isolated) {
-		tasklet_schedule(&(bdp->polling_tasklet));
-		goto exit;
-	}
-
-	e100_alloc_skbs(bdp);
-
-	skb_cnt = e100_rx_srv(bdp, bdp->params.PollingMaxWork, &rx_congestion);
-
-	bdp->drv_stats.rx_tasklet_pkts += skb_cnt;
-
-	if (rx_congestion || skb_cnt) {
-		tasklet_schedule(&(bdp->polling_tasklet));
-	} else {
-		bdp->intr_mask &= ~SCB_INT_MASK;
-
-		bdp->drv_stats.poll_intr_switch++;
-	}
-
-	bdp->tx_count = 0;	/* restart tx interrupt batch count */
-	e100_tx_srv(bdp);
-
-	e100_set_intr_mask(bdp);
-
-exit:
-	read_unlock(&(bdp->isolate_lock));
-}
-
 /**
  * e100intr - interrupt handler
  * @irq: the IRQ number
@@ -1892,18 +1829,8 @@
 
 	/* do recv work if any */
 	if (intr_status &
-	    (SCB_STATUS_ACK_FR | SCB_STATUS_ACK_RNR | SCB_STATUS_ACK_SWI)) {
-		int rx_congestion;
-
-		bdp->drv_stats.rx_intr_pkts +=
-			e100_rx_srv(bdp, 0, &rx_congestion);
-		if ((bdp->params.b_params & PRM_RX_CONG) && rx_congestion) {
-			bdp->intr_mask |= SCB_INT_MASK;
-			tasklet_schedule(&(bdp->polling_tasklet));
-
-			bdp->drv_stats.poll_intr_switch++;
-		}
-	}
+	    (SCB_STATUS_ACK_FR | SCB_STATUS_ACK_RNR | SCB_STATUS_ACK_SWI)) 
+		bdp->drv_stats.rx_intr_pkts += e100_rx_srv(bdp);
 
 	/* clean up after tx'ed packets */
 	if (intr_status & (SCB_STATUS_ACK_CNA | SCB_STATUS_ACK_CX)) {
@@ -1997,8 +1924,7 @@
  * It returns the number of serviced RFDs.
  */
 u32
-e100_rx_srv(struct e100_private *bdp, u32 max_number_of_rfds,
-	    int *rx_congestion)
+e100_rx_srv(struct e100_private *bdp)
 {
 	rfd_t *rfd;		/* new rfd, received rfd */
 	int i;
@@ -2009,10 +1935,6 @@
 	struct rx_list_elem *rx_struct;
 	u32 rfd_cnt = 0;
 
-	if (rx_congestion) {
-		*rx_congestion = 0;
-	}
-
 	dev = bdp->device;
 
 	/* current design of rx is as following:
@@ -2027,9 +1949,6 @@
 	 *    (watchdog trigger SWI intr and isr should allocate new skbs)
 	 */
 	for (i = 0; i < bdp->params.RxDescriptors; i++) {
-		if (max_number_of_rfds && (rfd_cnt >= max_number_of_rfds)) {
-			break;
-		}
 		if (list_empty(&(bdp->active_rx_list))) {
 			break;
 		}
@@ -2094,20 +2013,12 @@
 		} else {
 			skb->ip_summed = CHECKSUM_NONE;
 		}
-
 		switch (netif_rx(skb)) {
 		case NET_RX_BAD:
-			break;
-
 		case NET_RX_DROP:
 		case NET_RX_CN_MOD:
 		case NET_RX_CN_HIGH:
-			if (bdp->params.b_params & PRM_RX_CONG) {
-				if (rx_congestion) {
-					*rx_congestion = 1;
-				}
-			}
-			/* FALL THROUGH TO STATISTICS UPDATE */
+			break;
 		default:
 			bdp->drv_stats.net_stats.rx_bytes += skb->len;
 			break;
diff -Nru a/drivers/net/e100/e100_proc.c b/drivers/net/e100/e100_proc.c
--- a/drivers/net/e100/e100_proc.c	Wed Oct 23 21:16:10 2002
+++ b/drivers/net/e100/e100_proc.c	Wed Oct 23 21:16:10 2002
@@ -249,8 +249,6 @@
 	{"Rx_TCO_Packets",        read_gen_ulong, 0, bdp_drv_off(rcv_tco_pkts)},
 	{"\n",},
 	{"Rx_Interrupt_Packets",  read_gen_ulong, 0, bdp_drv_off(rx_intr_pkts)},
-	{"Rx_Polling_Packets",    read_gen_ulong, 0, bdp_drv_off(rx_tasklet_pkts)},
-	{"Polling_Interrupt_Switch", read_gen_ulong, 0, bdp_drv_off(poll_intr_switch)},
 	{"Identify_Adapter", 0, write_blink_led_timer, 0},
 	{"", 0, 0, 0}
 };
