From owner-p4-projects@FreeBSD.ORG Fri Sep 5 23:32:09 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8F11D106567C; Fri, 5 Sep 2008 23:32:09 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 539111065675 for ; Fri, 5 Sep 2008 23:32:09 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3C8948FC16 for ; Fri, 5 Sep 2008 23:32:09 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m85NW9OC015131 for ; Fri, 5 Sep 2008 23:32:09 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m85NW9hm015129 for perforce@freebsd.org; Fri, 5 Sep 2008 23:32:09 GMT (envelope-from sam@freebsd.org) Date: Fri, 5 Sep 2008 23:32:09 GMT Message-Id: <200809052332.m85NW9hm015129@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 149295 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2008 23:32:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=149295 Change 149295 by sam@sam_ebb on 2008/09/05 23:31:33 Reuse now free M_PROTO1 flag to mark frames as encapsulted with an 802.11 header (M_ENCAP); this is going to be used shortly. Also fixed some straggler mis-merges (not critical except for fixing send of 4-address null data frames). Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_freebsd.h#33 edit .. //depot/projects/vap/sys/net80211/ieee80211_output.c#55 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_freebsd.h#33 (text+ko) ==== @@ -239,7 +239,7 @@ struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen); /* tx path usage */ -#define M_LINK0 M_PROTO1 /* WEP requested */ +#define M_ENCAP M_PROTO1 /* 802.11 encap done */ #define M_WDS M_PROTO2 /* WDS frame */ #define M_EAPOL M_PROTO3 /* PAE/EAPOL frame */ #define M_PWR_SAV M_PROTO4 /* bypass PS handling */ @@ -248,7 +248,7 @@ #define M_TXCB M_PROTO7 /* do tx complete callback */ #define M_AMPDU_MPDU M_PROTO8 /* ok for A-MPDU aggregation */ #define M_80211_TX \ - (M_LINK0|M_WDS|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) + (M_ENCAP|M_WDS|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) /* rx path usage */ #define M_AMPDU M_PROTO1 /* A-MPDU subframe */ ==== //depot/projects/vap/sys/net80211/ieee80211_output.c#55 (text+ko) ==== @@ -515,6 +515,7 @@ "encrypting frame (%s)", __func__); wh->i_fc[1] |= IEEE80211_FC1_WEP; } + m->m_flags |= M_ENCAP; /* mark encapsulated */ KASSERT(type != IEEE80211_FC0_SUBTYPE_PROBE_RESP, ("probe response?")); M_WME_SETAC(m, params->ibp_pri); @@ -593,9 +594,10 @@ if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && vap->iv_opmode != IEEE80211_M_HOSTAP) wh->i_fc[1] |= IEEE80211_FC1_PWR_MGT; - m->m_len = m->m_pkthdr.len = sizeof(struct ieee80211_frame); } m->m_len = m->m_pkthdr.len = hdrlen; + m->m_flags |= M_ENCAP; /* mark encapsulated */ + M_WME_SETAC(m, WME_AC_BE); IEEE80211_NODE_STAT(ni, tx_data); @@ -1127,6 +1129,8 @@ key != NULL ? key->wk_cipher->ic_header : 0, vap->iv_fragthreshold)) goto bad; + m->m_flags |= M_ENCAP; /* mark encapsulated */ + IEEE80211_NODE_STAT(ni, tx_data); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) IEEE80211_NODE_STAT(ni, tx_mcast); @@ -1735,14 +1739,18 @@ KASSERT(M_LEADINGSPACE(m) >= sizeof(struct ieee80211_frame), ("leading space %d", M_LEADINGSPACE(m))); M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); - if (m == NULL) + if (m == NULL) { + /* NB: cannot happen */ + ieee80211_free_node(ni); return ENOMEM; + } wh = mtod(m, struct ieee80211_frame *); ieee80211_send_setup(ni, wh, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_REQ, sa, da, bssid); /* XXX power management? */ + m->m_flags |= M_ENCAP; /* mark encapsulated */ M_WME_SETAC(m, WME_AC_BE); @@ -2332,6 +2340,7 @@ IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_RESP, vap->iv_myaddr, da, bss->ni_bssid); /* XXX power management? */ + m->m_flags |= M_ENCAP; /* mark encapsulated */ M_WME_SETAC(m, WME_AC_BE);