Date: Sat, 9 Aug 2008 08:06:31 GMT From: Weongyo Jeong <weongyo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 146961 for review Message-ID: <200808090806.m7986VlT033659@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=146961 Change 146961 by weongyo@weongyo_ws on 2008/08/09 08:06:00 fix a memory alignment problem on sparc64. With this fix upgt(4) works on sparc64 also. Submitted by: yongari Affected files ... .. //depot/projects/vap/sys/dev/usb/if_upgt.c#2 edit Differences ... ==== //depot/projects/vap/sys/dev/usb/if_upgt.c#2 (text+ko) ==== @@ -1719,15 +1719,16 @@ /* create mbuf which is suitable for strict alignment archs */ KASSERT((pkglen + ETHER_ALIGN) < MCLBYTES, ("A current mbuf storage is small (%d)", pkglen + ETHER_ALIGN)); - m = m_devget(rxdesc->data - ETHER_ALIGN, pkglen + ETHER_ALIGN, 0, ifp, - NULL); + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { device_printf(sc->sc_dev, "could not create RX mbuf!\n"); return; } m_adj(m, ETHER_ALIGN); + bcopy(rxdesc->data, mtod(m, char *), pkglen); /* trim FCS */ - m_adj(m, -IEEE80211_CRC_LEN); + m->m_len = m->m_pkthdr.len = pkglen - IEEE80211_CRC_LEN; + m->m_pkthdr.rcvif = ifp; if (bpf_peers_present(ifp->if_bpf)) { struct upgt_rx_radiotap_header *tap = &sc->sc_rxtap;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808090806.m7986VlT033659>