Ticket #1590: if_bge.diff
File if_bge.diff, 3.1 KB (added by , 16 years ago) |
---|
-
add-ons/kernel/drivers/network/broadcom_bcm570x/dev/bge/glue.c
5 5 6 6 7 7 #include <sys/bus.h> 8 #include "if_bgereg.h" 8 9 9 10 10 11 HAIKU_FBSD_DRIVER_GLUE(broadcom_bcm570x, bge, pci); … … 25 26 return __haiku_probe_miibus(dev, drivers); 26 27 } 27 28 29 int 30 __haiku_disable_interrupts(device_t dev) 31 { 32 // Honestly, I don't know if this is correct. 33 // I just copied it from if_bge searching for disable interrupts 34 struct bge_softc *sc = device_get_softc(dev); 35 BGE_SETBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR); 36 CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 1); 37 38 // TODO: should we check if this succeeded and return appropriately? 39 return 1; 40 } 41 42 43 void 44 __haiku_reenable_interrupts(device_t dev) 45 { 46 // Honestly, I don't know if this is correct. 47 // I just copied it from if_bge searching for enable interrupts 48 struct bge_softc *sc = device_get_softc(dev); 49 BGE_CLRBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR); 50 CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 0); 51 } -
libs/compat/freebsd_network/compat/sys/mbuf.h
82 82 83 83 #define M_BCAST 0x00000200 84 84 #define M_MCAST 0x00000400 85 #define M_FRAG 0x00000800 86 #define M_FIRSTFRAG 0x00001000 87 #define M_LASTFRAG 0x00002000 85 88 #define M_VLANTAG 0x00010000 86 89 87 90 #define CSUM_IP 0x0001 … … 124 127 struct mbuf *m_get(int how, short type); 125 128 struct mbuf *m_gethdr(int how, short type); 126 129 void m_clget(struct mbuf *m, int how); 130 void * m_cljget(struct mbuf *m, int how, int size); 127 131 128 132 void m_extadd(struct mbuf *m, caddr_t buffer, u_int size, 129 133 void (*freeHook)(void *, void *), void *args, int flags, int type); -
libs/compat/freebsd_network/mbuf.c
150 150 construct_ext_mbuf(m, how); 151 151 } 152 152 153 /* 154 * Comment from the freebsd (mbuf.h): 155 * m_cljget() is different from m_clget() as it can allocate clusters without 156 * attaching them to an mbuf. In that case the return value is the pointer 157 * to the cluster of the requested size. If an mbuf was specified, it gets 158 * the cluster attached to it and the return value can be safely ignored. 159 * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. 160 */ 161 void * 162 m_cljget(struct mbuf *m, int how, int size) 163 { 164 // TODO: implement this 165 panic("m_cljget not yet implemented"); 166 return (void *) NULL; 153 167 168 /* 169 // This is the freebsd code 170 uma_zone_t zone; 171 172 if (m && m->m_flags & M_EXT) 173 printf("%s: %p mbuf already has cluster\n", __func__, m); 174 if (m != NULL) 175 m->m_ext.ext_buf = NULL; 176 177 zone = m_getzone(size); 178 return (uma_zalloc_arg(zone, m, how)); 179 */ 180 } 181 182 154 183 void 155 184 m_freem(struct mbuf *mb) 156 185 {