diff -ruP -X ../ignorediff linux-2.4.2-pre2-bk20010209.pre/drivers/net/bmac.c linux-2.4.2-pre2-bk20010209-JPG02/drivers/net/bmac.c
--- linux-2.4.2-pre2-bk20010209.pre/drivers/net/bmac.c	Fri Jan 12 15:58:13 2001
+++ linux-2.4.2-pre2-bk20010209-JPG02/drivers/net/bmac.c	Sun Feb 11 02:08:38 2001
@@ -134,6 +134,9 @@
 static struct pmu_sleep_notifier bmac_sleep_notifier = {
 	bmac_sleep_notify, SLEEP_LEVEL_NET,
 };
+#ifndef MODULE
+static int bmac_uses=0;
+#endif
 #endif
 
 /*
@@ -567,7 +570,11 @@
 	vaddr = skb->data;
 	baddr = virt_to_bus(vaddr);
 
+#ifdef BMAC_OLD
 	dbdma_setcmd(cp, (OUTPUT_LAST | INTR_ALWAYS | WAIT_IFCLR), len, baddr, 0);
+#else
+	dbdma_setcmd(cp, (OUTPUT_LAST | INTR_NEVER | WAIT_IFCLR), len, baddr, 0);
+#endif
 }
 
 static void
@@ -1092,6 +1099,12 @@
 	if (status & TxErrorMask) bp->stats.tx_errors++;
 	if (status & TxUnderrun) bp->stats.tx_fifo_errors++;
 	if (status & TxNormalCollExp) bp->stats.collisions++;
+#ifndef BMAC_OLD
+	if (status & (FrameSent | TxUnderrun)) {
+	  //		XXDEBUG ("bmac_misc_intr: calling bmac_txdma_intr to restart Xmit DMA!\n");
+		bmac_txdma_intr(irq, dev_id, regs);
+	}
+#endif /* CONFIG_BMAC_NO_STREAM_XMIT_DMA */
 }
 
 /*
@@ -1267,7 +1280,11 @@
 	if (bmac_devs != 0) {
 		proc_net_create ("bmac", 0, bmac_proc_info);
 #ifdef CONFIG_PMAC_PBOOK
+#ifdef MODULE
 		pmu_register_sleep_notifier(&bmac_sleep_notifier);
+#else
+		bmac_sleep_notify(0,PBOOK_SLEEP_NOW);
+#endif
 #endif
 	}
 	return 0;
@@ -1395,8 +1412,15 @@
 {
 	/* XXDEBUG(("bmac: enter open\n")); */
 	/* reset the chip */
+#ifdef MODULE
 	if (!bmac_reset_and_enable(dev, 1))
 		return -ENOMEM;
+#else
+	if (!bmac_uses++;){
+	  bmac_sleep_notify(0,PBOOK_WAKE);
+	  pmu_register_sleep_notifier(&bmac_sleep_notifier);
+       }
+#endif
 
 	dev->flags |= IFF_RUNNING;
 	return 0;
@@ -1443,6 +1466,12 @@
 	}
 	bp->reset_and_enabled = 0;
 	XXDEBUG(("bmac: all bufs freed\n"));
+#ifndef MODULE
+	if(--bmac_uses==0){
+	  pmu_unregister_sleep_notifier(&bmac_sleep_notifier);
+	  bmac_sleep_notify(0,PBOOK_SLEEP_NOW);
+	}
+#endif
 
 	return 0;
 }
