Index: build/jam/HaikuImage
===================================================================
--- build/jam/HaikuImage	(revision 28623)
+++ build/jam/HaikuImage	(working copy)
@@ -143,6 +143,7 @@
 	#vlance
 	$(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect usb_ecm
 	$(GPL_ONLY)bcm570x
+	broadcom570x
 ;
 #BEOS_ADD_ONS_DRIVERS_ACPI = $(X86_ONLY)acpi_button ;
 BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi
@@ -161,8 +162,8 @@
 	: generic_ide_pci it8211 legacy_sata silicon_image_3112 $(X86_ONLY)ide_isa ;
 AddFilesToHaikuImage beos system add-ons kernel busses scsi
 	: ahci ;
-AddFilesToHaikuImage beos system add-ons kernel busses usb
-	: <usb>uhci <usb>ohci <usb>ehci ;
+#AddFilesToHaikuImage beos system add-ons kernel busses usb
+#	: <usb>uhci <usb>ohci <usb>ehci ;
 AddFilesToHaikuImage beos system add-ons kernel console : vga_text ;
 AddFilesToHaikuImage beos system add-ons kernel debugger
 	: $(X86_ONLY)<kdebug>disasm <kdebug>hangman <kdebug>invalidate_on_exit ;
@@ -385,7 +386,7 @@
 	$(PPC_ONLY)openpic
 	ide_adapter locked_pool scsi_periph
 	ahci generic_ide_pci it8211 legacy_sata silicon_image_3112 $(X86_ONLY)ide_isa
-	<usb>uhci <usb>ohci <usb>ehci
+#	<usb>uhci <usb>ohci <usb>ehci
 	scsi_cd scsi_disk usb_disk
 	intel
 	bfs
Index: src/add-ons/kernel/drivers/network/broadcom570x/dev/bge/if_bge.c
===================================================================
--- src/add-ons/kernel/drivers/network/broadcom570x/dev/bge/if_bge.c	(revision 28623)
+++ src/add-ons/kernel/drivers/network/broadcom570x/dev/bge/if_bge.c	(working copy)
@@ -398,7 +398,7 @@
 static void bge_sig_legacy(struct bge_softc *, int);
 static void bge_sig_pre_reset(struct bge_softc *, int);
 static int bge_reset(struct bge_softc *);
-static void bge_link_upd(struct bge_softc *);
+/*static*/ void bge_link_upd(struct bge_softc *);
 
 /*
  * The BGE_REGISTER_DEBUG option is only for low-level debugging.  It may
@@ -3025,6 +3025,7 @@
 	if (sc->bge_rx_saved_considx ==
 	    sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx)
 		return;
+	//dprintf("bge_rxeof\n");
 
 	ifp = sc->bge_ifp;
 
@@ -3194,6 +3195,7 @@
 	    sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx)
 		return;
 
+	//dprintf("bge_txeof\n");
 	ifp = sc->bge_ifp;
 
 	bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag,
@@ -3318,7 +3320,7 @@
 	 * Do the mandatory PCI flush as well as get the link status.
 	 */
 	statusword = CSR_READ_4(sc, BGE_MAC_STS) & BGE_MACSTAT_LINK_CHANGED;
-
+	//dprintf("bge_intr statusword=0x%x\n", statusword);
 	/* Make sure the descriptor ring indexes are coherent. */
 	bus_dmamap_sync(sc->bge_cdata.bge_status_tag,
 	    sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD);
@@ -4320,7 +4322,7 @@
 	return (0);
 }
 
-static void
+/*static */void
 bge_link_upd(struct bge_softc *sc)
 {
 	struct mii_data *mii;
@@ -4330,6 +4332,7 @@
 
 	/* Clear 'pending link event' flag. */
 	sc->bge_link_evt = 0;
+	dprintf("bge_link_upd\n");
 
 	/*
 	 * Process link state changes.
@@ -4348,20 +4351,24 @@
 
 	if (sc->bge_asicrev == BGE_ASICREV_BCM5700 &&
 	    sc->bge_chipid != BGE_CHIPID_BCM5700_B2) {
+		dprintf("case 1\n");
 		status = CSR_READ_4(sc, BGE_MAC_STS);
 		if (status & BGE_MACSTAT_MI_INTERRUPT) {
+			dprintf("interrupt\n");
 			mii = device_get_softc(sc->bge_miibus);
 			mii_pollstat(mii);
 			if (!sc->bge_link &&
 			    mii->mii_media_status & IFM_ACTIVE &&
 			    IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
 				sc->bge_link++;
+				dprintf("link UP\n");
 				if (bootverbose)
 					if_printf(sc->bge_ifp, "link UP\n");
 			} else if (sc->bge_link &&
 			    (!(mii->mii_media_status & IFM_ACTIVE) ||
 			    IFM_SUBTYPE(mii->mii_media_active) == IFM_NONE)) {
 				sc->bge_link = 0;
+				dprintf("link DOWN\n");
 				if (bootverbose)
 					if_printf(sc->bge_ifp, "link DOWN\n");
 			}
@@ -4377,8 +4384,10 @@
 	}
 
 	if (sc->bge_flags & BGE_FLAG_TBI) {
+		dprintf("case 2\n");
 		status = CSR_READ_4(sc, BGE_MAC_STS);
 		if (status & BGE_MACSTAT_TBI_PCS_SYNCHED) {
+			dprintf("TBI_PCS_SYNCHED\n");
 			if (!sc->bge_link) {
 				sc->bge_link++;
 				if (sc->bge_asicrev == BGE_ASICREV_BCM5704)
@@ -4403,21 +4412,28 @@
 		 * PHY link status directly.
 		 */
 		link = (CSR_READ_4(sc, BGE_MI_STS) & BGE_MISTS_LINK) ? 1 : 0;
+		dprintf("Case 3: link=0x%x, sc->bge_link=0x%x\n", link, 
+			sc->bge_link);
 
 		if (link != sc->bge_link ||
 		    sc->bge_asicrev == BGE_ASICREV_BCM5700) {
 			mii = device_get_softc(sc->bge_miibus);
 			mii_pollstat(mii);
+			dprintf("link changed mii->mii_media_status=0x%x"
+				"mii->mii_media_active=0x%x\n",
+				mii->mii_media_status, mii->mii_media_active);
 			if (!sc->bge_link &&
 			    mii->mii_media_status & IFM_ACTIVE &&
 			    IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
 				sc->bge_link++;
+				dprintf("link UP\n");
 				if (bootverbose)
 					if_printf(sc->bge_ifp, "link UP\n");
 			} else if (sc->bge_link &&
 			    (!(mii->mii_media_status & IFM_ACTIVE) ||
 			    IFM_SUBTYPE(mii->mii_media_active) == IFM_NONE)) {
 				sc->bge_link = 0;
+				dprintf("link DOWN\n");
 				if (bootverbose)
 					if_printf(sc->bge_ifp, "link DOWN\n");
 			}
Index: src/add-ons/kernel/drivers/network/broadcom570x/dev/bge/glue.c
===================================================================
--- src/add-ons/kernel/drivers/network/broadcom570x/dev/bge/glue.c	(revision 28623)
+++ src/add-ons/kernel/drivers/network/broadcom570x/dev/bge/glue.c	(working copy)
@@ -39,18 +39,71 @@
 	CSR_WRITE_4(sc, off, val);
 }
 
+/*
+#define	BGE_MACSTAT_TBI_PCS_SYNCHED	0x00000001
+#define	BGE_MACSTAT_TBI_SIGNAL_DETECT	0x00000002
+#define	BGE_MACSTAT_RX_CFG		0x00000004
+#define	BGE_MACSTAT_CFG_CHANGED		0x00000008
+#define	BGE_MACSTAT_SYNC_CHANGED	0x00000010
+#define	BGE_MACSTAT_PORT_DECODE_ERROR	0x00000400
+#define	BGE_MACSTAT_LINK_CHANGED	0x00001000
+#define	BGE_MACSTAT_MI_COMPLETE		0x00400000
+#define	BGE_MACSTAT_MI_INTERRUPT	0x00800000
+#define	BGE_MACSTAT_AUTOPOLL_ERROR	0x01000000
+#define	BGE_MACSTAT_ODI_ERROR		0x02000000
+#define	BGE_MACSTAT_RXSTAT_OFLOW	0x04000000
+#define	BGE_MACSTAT_TXSTAT_OFLOW	0x08000000
 
+ *
+ * PCI state register -- note, this register is read only
+ * unless the PCISTATE_WR bit of the PCI Misc. Host Control
+ * register is set.
+ *
+#define	BGE_PCISTATE_FORCE_RESET	0x00000001
+#define	BGE_PCISTATE_INTR_STATE		0x00000002
+#define	BGE_PCISTATE_PCI_BUSMODE	0x00000004 * 1 = PCI, 0 = PCI-X *
+#define	BGE_PCISTATE_PCI_BUSSPEED	0x00000008 * 1 = 66/133, 0 = 33/66 *
+#define	BGE_PCISTATE_32BIT_BUS		0x00000010 * 1 = 32bit, 0 = 64bit *
+#define	BGE_PCISTATE_WANT_EXPROM	0x00000020
+#define	BGE_PCISTATE_EXPROM_RETRY	0x00000040
+#define	BGE_PCISTATE_FLATVIEW_MODE	0x00000100
+#define	BGE_PCISTATE_PCI_TGT_RETRY_MAX	0x00000E00
+
+#define IFF_DRV_RUNNING		0x10000
+#define IFF_DRV_OACTIVE		0x20000
+#define IFF_LINK0			0x40000
+#define IFF_DEBUG			0x80000
+
+*/
+
+
 int
 __haiku_disable_interrupts(device_t dev)
 {
 	struct bge_softc *sc = device_get_softc(dev);
 
-	uint32 statusword = CSR_READ_4(sc, BGE_MAC_STS) & BGE_MACSTAT_LINK_CHANGED;
+	uint32 macstatusword = CSR_READ_4(sc, BGE_MAC_STS);
+	uint32 pcistate = pci_read_config(sc->bge_dev, BGE_PCI_PCISTATE,4);
+	uint32 linkchanged = macstatusword & BGE_MACSTAT_LINK_CHANGED;
+	uint32 pci_interrupted = !(pcistate & BGE_PCISTATE_INTR_STATE);
+	uint32 if_drv_running = sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING;
+	
 
-	if ((sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 && !statusword
-		&& (pci_read_config(sc->bge_dev, BGE_PCI_PCISTATE,4) & BGE_PCISTATE_INTR_STATE))
+
+	if (!pci_interrupted) /* if_drv_running == 0 &&  */
 		return 0;
+/*	dprintf("__haiku_disable_interrupts handling macstatusword=0x%x, pcistate=0x%x, "
+		"if_drv_flags=0x%x, linkchanged=0x%x, pci_interrupted=0x%x, "
+		"if_drv_running=0x%x, sc->bge_link_evt=0x%x\n",
+		macstatusword, pcistate, sc->bge_ifp->if_drv_flags, linkchanged,
+		pci_interrupted, if_drv_running, sc->bge_link_evt);
+*/
 
+	if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 &&
+	    sc->bge_chipid != BGE_CHIPID_BCM5700_B2) ||
+	    linkchanged || sc->bge_link_evt)
+		bge_link_upd(sc);
+
 	BGE_SETBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR);
 	bge_writembx(sc, BGE_MBX_IRQ0_LO, 1);
 
Index: src/libs/compat/freebsd_network/fbsd_mii_physubr.c
===================================================================
--- src/libs/compat/freebsd_network/fbsd_mii_physubr.c	(revision 28623)
+++ src/libs/compat/freebsd_network/fbsd_mii_physubr.c	(working copy)
@@ -510,9 +510,11 @@
 	}
 
 	if (sc->mii_capabilities & BMSR_ANEG) {
-		ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst),
-		    MII_NMEDIA);	/* intentionally invalid index */
+		//ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst),
+		//    MII_NMEDIA);	/* intentionally invalid index */
+		dprintf("don't know how to handle sc->mii_capabilities & BMSR_ANEG\n");
 		PRINT("auto");
 	}
 #undef ADD
 #undef PRINT
