diff -ruN /usr/src_working/pci/if_ti.c /usr/src/sys/pci/if_ti.c --- /usr/src_working/pci/if_ti.c Fri Oct 20 19:50:09 2000 +++ /usr/src/sys/pci/if_ti.c Fri Oct 20 20:02:44 2000 @@ -614,20 +614,12 @@ /* * Now divide it up into 9K pieces and save the addresses - * in an array. Note that we play an evil trick here by using - * the first few bytes in the buffer to hold the the address - * of the softc structure for this interface. This is because - * ti_jfree() needs it, but it is called by the mbuf management - * code which will not pass it to us explicitly. + * in an array. */ ptr = sc->ti_cdata.ti_jumbo_buf; for (i = 0; i < TI_JSLOTS; i++) { - u_int64_t **aptr; - aptr = (u_int64_t **)ptr; - aptr[0] = (u_int64_t *)sc; - ptr += sizeof(u_int64_t); - sc->ti_cdata.ti_jslots[i].ti_buf = ptr; - ptr += (TI_JLEN - sizeof(u_int64_t)); + sc->ti_cdata.ti_jslots[i] = ptr; + ptr += TI_JLEN; entry = malloc(sizeof(struct ti_jpool_entry), M_DEVBUF, M_NOWAIT); if (entry == NULL) { @@ -662,7 +654,7 @@ SLIST_REMOVE_HEAD(&sc->ti_jfree_listhead, jpool_entries); SLIST_INSERT_HEAD(&sc->ti_jinuse_listhead, entry, jpool_entries); - return(sc->ti_cdata.ti_jslots[entry->slot].ti_buf); + return(sc->ti_cdata.ti_jslots[entry->slot]); } /* @@ -673,19 +665,17 @@ void *args; { struct ti_softc *sc; - u_int64_t **aptr; int i; struct ti_jpool_entry *entry; /* Extract the softc struct pointer. */ - aptr = (u_int64_t **)(buf - sizeof(u_int64_t)); - sc = (struct ti_softc *)(aptr[0]); + sc = (struct ti_softc *)args; if (sc == NULL) - panic("ti_jfree: can't find softc pointer!"); + panic("ti_jfree: didn't get softc pointer!"); /* calculate the slot this buffer belongs to */ - i = ((vm_offset_t)aptr + i = ((vm_offset_t)buf - (vm_offset_t)sc->ti_cdata.ti_jumbo_buf) / TI_JLEN; if ((i < 0) || (i >= TI_JSLOTS)) @@ -824,7 +814,8 @@ /* Attach the buffer to the mbuf. */ m_new->m_data = (void *) buf; m_new->m_len = m_new->m_pkthdr.len = TI_JUMBO_FRAMELEN; - MEXTADD(m_new, buf, TI_JUMBO_FRAMELEN, ti_jfree, NULL); + MEXTADD(m_new, buf, TI_JUMBO_FRAMELEN, ti_jfree, + (struct ti_softc *)sc); } else { m_new = m; m_new->m_data = m_new->m_ext.ext_buf; diff -ruN /usr/src_working/pci/if_tireg.h /usr/src/sys/pci/if_tireg.h --- /usr/src_working/pci/if_tireg.h Fri Oct 20 19:50:09 2000 +++ /usr/src/sys/pci/if_tireg.h Fri Oct 20 19:48:26 2000 @@ -1037,17 +1037,13 @@ #define TI_MSLOTS 256 #define TI_JSLOTS 384 -#define TI_JRAWLEN (TI_JUMBO_FRAMELEN + ETHER_ALIGN + sizeof(u_int64_t)) +#define TI_JRAWLEN (TI_JUMBO_FRAMELEN + ETHER_ALIGN) #define TI_JLEN (TI_JRAWLEN + (sizeof(u_int64_t) - \ (TI_JRAWLEN % sizeof(u_int64_t)))) #define TI_JPAGESZ PAGE_SIZE #define TI_RESID (TI_JPAGESZ - (TI_JLEN * TI_JSLOTS) % TI_JPAGESZ) #define TI_JMEM ((TI_JLEN * TI_JSLOTS) + TI_RESID) -struct ti_jslot { - caddr_t ti_buf; -}; - /* * Ring structures. Most of these reside in host memory and we tell * the NIC where they are via the ring control blocks. The exceptions @@ -1087,7 +1083,7 @@ struct mbuf *ti_rx_jumbo_chain[TI_JUMBO_RX_RING_CNT]; struct mbuf *ti_rx_mini_chain[TI_MINI_RX_RING_CNT]; /* Stick the jumbo mem management stuff here too. */ - struct ti_jslot ti_jslots[TI_JSLOTS]; + caddr_t ti_jslots[TI_JSLOTS]; void *ti_jumbo_buf; };