Index: build/jam/HaikuImage
===================================================================
--- build/jam/HaikuImage	(wersja 28329)
+++ build/jam/HaikuImage	(kopia robocza)
@@ -136,7 +136,7 @@
 	$(X86_ONLY)via_rhine wb840 $(X86_ONLY)ipro100 $(X86_ONLY)nforce
 	#vlance
 	$(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect usb_ecm
-	$(GPL_ONLY)bcm440x $(GPL_ONLY)bcm570x
+	$(GPL_ONLY)bcm440x $(GPL_ONLY)bcm570x broadcom_bcm570x
 ;
 #BEOS_ADD_ONS_DRIVERS_ACPI = $(X86_ONLY)acpi_button ;
 BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi
Index: src/libs/compat/freebsd_network/compat/sys/mbuf.h
===================================================================
--- src/libs/compat/freebsd_network/compat/sys/mbuf.h	(wersja 28329)
+++ src/libs/compat/freebsd_network/compat/sys/mbuf.h	(kopia robocza)
@@ -82,6 +82,9 @@
 
 #define M_BCAST			0x00000200
 #define M_MCAST			0x00000400
+#define M_FRAG			0x00000800
+#define M_FIRSTFRAG		0x00001000
+#define M_LASTFRAG		0x00002000
 #define	M_VLANTAG		0x00010000
 
 #define CSUM_IP			0x0001
@@ -124,6 +127,7 @@
 struct mbuf *m_get(int how, short type);
 struct mbuf *m_gethdr(int how, short type);
 void m_clget(struct mbuf *m, int how);
+void * m_cljget(struct mbuf *m, int how, int size); 
 
 void m_extadd(struct mbuf *m, caddr_t buffer, u_int size,
     void (*freeHook)(void *, void *), void *args, int flags, int type);
Index: src/libs/compat/freebsd_network/mbuf.c
===================================================================
--- src/libs/compat/freebsd_network/mbuf.c	(wersja 28329)
+++ src/libs/compat/freebsd_network/mbuf.c	(kopia robocza)
@@ -150,6 +150,36 @@
 	construct_ext_mbuf(m, how);
 }
 
+	/* 
+	 * Comment from the freebsd (mbuf.h): 
+	 * m_cljget() is different from m_clget() as it can allocate clusters without 
+	 * attaching them to an mbuf.  In that case the return value is the pointer 
+	 * to the cluster of the requested size.  If an mbuf was specified, it gets 
+	 * the cluster attached to it and the return value can be safely ignored. 
+	 * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. 
+	 */ 
+	void * 
+	m_cljget(struct mbuf *m, int how, int size) 
+	{ 
+	        // TODO: implement this 
+	        panic("m_cljget not yet implemented"); 
+	        return (void *) NULL; 
+	 
+	/* 
+	//      This is the freebsd code 
+	        uma_zone_t zone; 
+	 
+	        if (m && m->m_flags & M_EXT) 
+	                printf("%s: %p mbuf already has cluster\n", __func__, m); 
+	        if (m != NULL) 
+	                m->m_ext.ext_buf = NULL; 
+	 
+	        zone = m_getzone(size); 
+	        return (uma_zalloc_arg(zone, m, how)); 
+	*/ 
+	} 
+	 
+	 
 
 void
 m_freem(struct mbuf *mb)
Index: src/libs/compat/freebsd_network/fbsd_mii_physubr.c
===================================================================
--- src/libs/compat/freebsd_network/fbsd_mii_physubr.c	(wersja 28329)
+++ src/libs/compat/freebsd_network/fbsd_mii_physubr.c	(kopia robocza)
@@ -510,8 +510,11 @@
 	}
 
 	if (sc->mii_capabilities & BMSR_ANEG) {
-		ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst),
-		    MII_NMEDIA);	/* intentionally invalid index */
+		dprintf("FIXME: sc->mii_capabilities & BMSR_ANEG\n");
+		//ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst),
+		    //MII_NMEDIA);	/* intentionally invalid index */
 		PRINT("auto");
 	}
 #undef ADD
Index: src/add-ons/kernel/drivers/network/broadcom_bcm570x/dev/bge/glue.c
===================================================================
--- src/add-ons/kernel/drivers/network/broadcom_bcm570x/dev/bge/glue.c	(wersja 28329)
+++ src/add-ons/kernel/drivers/network/broadcom_bcm570x/dev/bge/glue.c	(kopia robocza)
@@ -5,6 +5,7 @@
 
 
 #include <sys/bus.h>
+#include "if_bgereg.h"
 
 
 HAIKU_FBSD_DRIVER_GLUE(broadcom_bcm570x, bge, pci);
@@ -25,3 +26,51 @@
 	return __haiku_probe_miibus(dev, drivers);
 }
 
+int 
+__haiku_disable_interrupts(device_t dev) 
+{ 
+        struct bge_softc *sc = device_get_softc(dev); 
+ 
+        // Obtain the status and return 0 if the bge did not set the intr 
+        u_int32_t status = CSR_READ_4(sc, BGE_MAC_STS); 
+	
+	// sc->transmitting: a packet is being transmitted; status & 0x1000: link state change(?)
+	// checking BGE_PCI_PCISTATE register for interrupt like the linux driver does
+	 if ( ((status & 0x1000)==0)&&(sc->transmitting==0) && ((pci_read_config(sc->bge_dev, BGE_PCI_PCISTATE,4) & BGE_PCISTATE_INTR_STATE) != 0)) {
+                return 0; 
+        } 
+	sc->transmitting=0;
+ 
+        // Clear the interrupt, the bge intr handler will take care of it 
+        BGE_SETBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR); 
+        bge_writembx(sc, BGE_MBX_IRQ0_LO, 1); 
+ 
+        // save the status for the interrupt handler 
+        atomic_or((int32 *)&sc->bge_intr_status, status); 
+        return 1; 
+} 
+ 
+ 
+void 
+__haiku_reenable_interrupts(device_t dev) 
+{ 
+        struct bge_softc *sc = device_get_softc(dev); 
+        BGE_SETBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_CLEAR_INTA); 
+        BGE_CLRBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR); 
+        bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); 
+} 
