Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Dec 2004 23:33:39 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 67098 for review
Message-ID:  <200412142333.iBENXdCl082891@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=67098

Change 67098 by sam@sam_ebb on 2004/12/14 23:33:10

	o teach ieee80211_dump_pkt about QoS and TKIP/CCM-encrypted
	  frames
	o also handle h/w padding--this requires changing the calling
	  covention to pass in struct ieee80211com
	
	Update drivers that ieee80211_dump_pkt to match.

Affected files ...

.. //depot/projects/wifi/sys/dev/ath/if_ath.c#42 edit
.. //depot/projects/wifi/sys/dev/wi/if_wi.c#8 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_proto.c#18 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_proto.h#11 edit

Differences ...

==== //depot/projects/wifi/sys/dev/ath/if_ath.c#42 (text+ko) ====

@@ -2679,7 +2679,7 @@
 		}
 
 		if (IFF_DUMPPKTS(sc, ATH_DEBUG_RECV)) {
-			ieee80211_dump_pkt(mtod(m, caddr_t), len,
+			ieee80211_dump_pkt(ic, mtod(m, caddr_t), len,
 				   sc->sc_hwmap[ds->ds_rxstat.rs_rate],
 				   ds->ds_rxstat.rs_rssi);
 		}
@@ -3219,7 +3219,7 @@
 		ctsrate = 0;
 
 	if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT))
-		ieee80211_dump_pkt(mtod(m0, caddr_t), m0->m_len,
+		ieee80211_dump_pkt(ic, mtod(m0, caddr_t), m0->m_len,
 			sc->sc_hwmap[txrate], -1);
 
 	if (ic->ic_rawbpf)

==== //depot/projects/wifi/sys/dev/wi/if_wi.c#8 (text+ko) ====

@@ -148,7 +148,8 @@
 static int  wi_scan_ap(struct wi_softc *, u_int16_t, u_int16_t);
 static void wi_scan_result(struct wi_softc *, int, int);
 
-static void wi_dump_pkt(struct wi_frame *, struct ieee80211_node *, int rssi);
+static void wi_dump_pkt(struct ieee80211com *,
+		struct wi_frame *, struct ieee80211_node *, int rssi);
 
 static int wi_get_debug(struct wi_softc *, struct wi_req *);
 static int wi_set_debug(struct wi_softc *, struct wi_req *);
@@ -982,7 +983,7 @@
 		m_adj(m0, sizeof(struct ieee80211_frame));
 		frmhdr.wi_dat_len = htole16(m0->m_pkthdr.len);
 		if (IFF_DUMPPKTS(ifp))
-			wi_dump_pkt(&frmhdr, NULL, -1);
+			wi_dump_pkt(ic, &frmhdr, NULL, -1);
 		fid = sc->sc_txd[cur].d_fid;
 		off = sizeof(frmhdr);
 		error = wi_write_bap(sc, fid, 0, &frmhdr, sizeof(frmhdr)) != 0
@@ -1439,7 +1440,7 @@
 	}
 
 	if (IFF_DUMPPKTS(ifp))
-		wi_dump_pkt(&frmhdr, NULL, frmhdr.wi_rx_signal);
+		wi_dump_pkt(ic, &frmhdr, NULL, frmhdr.wi_rx_signal);
 
 	/*
 	 * Drop undecryptable or packets with receive errors here
@@ -2836,9 +2837,10 @@
 }
 
 static void
-wi_dump_pkt(struct wi_frame *wh, struct ieee80211_node *ni, int rssi)
+wi_dump_pkt(struct ieee80211com *ic,
+	struct wi_frame *wh, struct ieee80211_node *ni, int rssi)
 {
-	ieee80211_dump_pkt((u_int8_t *) &wh->wi_whdr, sizeof(wh->wi_whdr),
+	ieee80211_dump_pkt(ic, (u_int8_t *) &wh->wi_whdr, sizeof(wh->wi_whdr),
 	    ni ? ni->ni_rates.rs_rates[ni->ni_txrate] & IEEE80211_RATE_VAL : -1, rssi);
 	printf(" status 0x%x rx_tstamp1 %u rx_tstamp0 0x%u rx_silence %u\n",
 		le16toh(wh->wi_status), le16toh(wh->wi_rx_tstamp1),

==== //depot/projects/wifi/sys/net80211/ieee80211_proto.c#18 (text+ko) ====

@@ -258,7 +258,8 @@
 }
 
 void
-ieee80211_dump_pkt(const u_int8_t *buf, int len, int rate, int rssi)
+ieee80211_dump_pkt(struct ieee80211com *ic,
+	const u_int8_t *buf, int len, int rate, int rssi)
 {
 	const struct ieee80211_frame *wh;
 	int i;
@@ -300,12 +301,22 @@
 		printf(" type#%d", wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK);
 		break;
 	}
+	if (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS) {
+		const struct ieee80211_qosframe *qwh = 
+			(const struct ieee80211_qosframe *)buf;
+		printf(" QoS [TID %u%s]", qwh->i_qos[0] & IEEE80211_QOS_TID,
+			qwh->i_qos[0] & IEEE80211_QOS_ACKPOLICY ? " ACM" : "");
+	}
 	if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
-		int i;
-		printf(" WEP [IV");
-		for (i = 0; i < IEEE80211_WEP_IVLEN; i++)
-			printf(" %.02x", buf[sizeof(*wh)+i]);
-		printf(" KID %u]", buf[sizeof(*wh)+i] >> 6);
+		int off;
+
+		off = ieee80211_anyhdrspace(ic, wh);
+		printf(" WEP [IV %.02x %.02x %.02x",
+			buf[off+0], buf[off+1], buf[off+2]);
+		if (buf[off+IEEE80211_WEP_IVLEN] & IEEE80211_WEP_EXTIV)
+			printf(" %.02x %.02x %.02x",
+				buf[off+4], buf[off+5], buf[off+6]);
+		printf(" KID %u]", buf[off+IEEE80211_WEP_IVLEN] >> 6);
 	}
 	if (rate >= 0)
 		printf(" %dM", rate / 2);

==== //depot/projects/wifi/sys/net80211/ieee80211_proto.h#11 (text+ko) ====

@@ -207,7 +207,8 @@
 #define	ieee80211_new_state(_ic, _nstate, _arg) \
 	(((_ic)->ic_newstate)((_ic), (_nstate), (_arg)))
 extern	void ieee80211_print_essid(const u_int8_t *, int);
-extern	void ieee80211_dump_pkt(const u_int8_t *, int, int, int);
+extern	void ieee80211_dump_pkt(struct ieee80211com *,
+		const u_int8_t *, int, int, int);
 
 extern	const char *ieee80211_state_name[IEEE80211_S_MAX];
 extern	const char *ieee80211_wme_acnames[];



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