Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 May 2007 10:27:40 +0200
From:      Hans Petter Selasky <hselasky@freebsd.org>
To:        Sepherosa Ziehau <sephe@freebsd.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 119878 for review
Message-ID:  <200705171027.40294.hselasky@freebsd.org>
In-Reply-To: <200705151133.l4FBXE1F006105@repoman.freebsd.org>
References:  <200705151133.l4FBXE1F006105@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

1) Maybe you should bump __FreeBSD_version when this is introduced into HEAD.

2) Are you sure that you want to do this?

If you look at the implementation of "m_adj()" for a negative number it is not 
too efficient. With regard to "if_ural.c" it is faster to remove those bytes 
at an earlier point. And then just never set M_HASFCS at all.

--HPS

>
> ==== //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);
>
>

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705171027.40294.hselasky>