PERFORCE change 146961 for review
Weongyo Jeong
weongyo at FreeBSD.org
Sat Aug 9 08:06:32 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=146961
Change 146961 by weongyo at 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;
More information about the p4-projects
mailing list