Date: Tue, 15 May 2007 11:33:14 GMT From: Sepherosa Ziehau <sephe@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 119878 for review Message-ID: <200705151133.l4FBXE1F006105@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=119878 Change 119878 by sephe@sephe_zealot:sam_wifi on 2007/05/15 11:32:57 - Stop using M_HASFCS in 802.11 drivers. - Stop processing M_HASFCS in 802.11 generic layer. These save us one mbuf flag. Discussed with: sam Approved by: sam Affected files ... .. //depot/projects/wifi/sys/dev/awi/awi.c#16 edit .. //depot/projects/wifi/sys/dev/usb/if_ural.c#25 edit .. //depot/projects/wifi/sys/net80211/ieee80211_input.c#104 edit Differences ... ==== //depot/projects/wifi/sys/dev/awi/awi.c#16 (text+ko) ==== @@ -1341,7 +1341,6 @@ m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = len; m->m_len = MHLEN; - m->m_flags |= M_HASFCS; } else { MGET(m, M_DONTWAIT, MT_DATA); if (m == NULL) { @@ -1371,6 +1370,10 @@ *mp = m; mp = &m->m_next; } + if (top != NULL) { + /* Strip trailing 802.11 MAC FCS. */ + m_adj(top, -IEEE80211_CRC_LEN); + } return top; } ==== //depot/projects/wifi/sys/dev/usb/if_ural.c#25 (text+ko) ==== @@ -939,7 +939,6 @@ /* finalize mbuf */ m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = (le32toh(desc->flags) >> 16) & 0xfff; - m->m_flags |= M_HASFCS; /* h/w leaves FCS */ if (bpf_peers_present(sc->sc_drvbpf)) { struct ural_rx_radiotap_header *tap = &sc->sc_rxtap; @@ -954,6 +953,9 @@ bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_rxtap_len, m); } + /* Strip trailing 802.11 MAC FCS. */ + m_adj(m, -IEEE80211_CRC_LEN); + wh = mtod(m, struct ieee80211_frame *); ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); ==== //depot/projects/wifi/sys/net80211/ieee80211_input.c#104 (text+ko) ==== @@ -133,11 +133,6 @@ KASSERT(ni != NULL, ("null node")); ni->ni_inact = ni->ni_inact_reload; - /* trim CRC here so WEP can find its own CRC at the end of packet. */ - if (m->m_flags & M_HASFCS) { - m_adj(m, -IEEE80211_CRC_LEN); - m->m_flags &= ~M_HASFCS; - } need_tap = 1; /* mbuf need to be tapped. */ type = -1; /* undefined */ /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705151133.l4FBXE1F006105>