PERFORCE change 137213 for review

Sepherosa Ziehau sephe at FreeBSD.org
Sun Mar 9 10:40:39 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=137213

Change 137213 by sephe at sephe_zealot:sam_wifi on 2008/03/09 10:39:49

	Only one TX sequence is needed for non-QOS frames, mgmt frames and
	mcast(addr1) QOS data frames.
	
	Pointed-out-by: sam

Affected files ...

.. //depot/projects/wifi/sys/dev/ral/rt2560.c#36 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#92 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_output.c#81 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_var.h#67 edit

Differences ...

==== //depot/projects/wifi/sys/dev/ral/rt2560.c#36 (text) ====

@@ -1334,11 +1334,11 @@
 
 	ieee80211_beacon_update(data->ni, &sc->sc_bo, data->m, 1);
 
-	/* 2560 needs software to setup seuqence */
+	/* 2560 needs software to setup beacon's sequence */
 	wh = mtod(data->m, struct ieee80211_frame *);
 	*(uint16_t *)wh->i_seq =
-	htole16(ic->ic_txseqs[IEEE80211_NONQOS_TID] << IEEE80211_SEQ_SEQ_SHIFT);
-	ic->ic_txseqs[IEEE80211_NONQOS_TID]++;
+		htole16(ic->ic_txseq << IEEE80211_SEQ_SEQ_SHIFT);
+	ic->ic_txseq++;
 
 	if (bpf_peers_present(ic->ic_rawbpf))
 		bpf_mtap(ic->ic_rawbpf, data->m);

==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#92 (text+ko) ====

@@ -575,10 +575,11 @@
 	si->isi_txpower = ni->ni_txpower;
 	si->isi_vlan = ni->ni_vlan;
 	if (ni->ni_flags & IEEE80211_NODE_QOS) {
-		memcpy(si->isi_txseqs, ic->ic_txseqs, sizeof(ic->ic_txseqs));
 		memcpy(si->isi_rxseqs, ni->ni_rxseqs, sizeof(ni->ni_rxseqs));
+		memcpy(si->isi_txseqs, ni->ni_txseqs, sizeof(ni->ni_txseqs));
+		si->isi_txseqs[IEEE80211_NONQOS_TID] = ic->ic_txseq;
 	} else {
-		si->isi_txseqs[0] = ic->ic_txseqs[IEEE80211_NONQOS_TID];
+		si->isi_txseqs[0] = ic->ic_txseq;
 		si->isi_rxseqs[0] = ni->ni_rxseqs[IEEE80211_NONQOS_TID];
 	}
 	/* NB: leave all cases in case we relax ni_associd == 0 check */

==== //depot/projects/wifi/sys/net80211/ieee80211_output.c#81 (text+ko) ====

@@ -141,8 +141,8 @@
 	*(uint16_t *)&wh->i_dur[0] = 0;
 	/* NB: use non-QoS tid */
 	*(uint16_t *)&wh->i_seq[0] =
-	    htole16(ic->ic_txseqs[IEEE80211_NONQOS_TID] << IEEE80211_SEQ_SEQ_SHIFT);
-	ic->ic_txseqs[IEEE80211_NONQOS_TID]++;
+	    htole16(ic->ic_txseq << IEEE80211_SEQ_SEQ_SHIFT);
+	ic->ic_txseq++;
 #undef WH4
 }
 
@@ -770,6 +770,7 @@
 	if (addqos) {
 		struct ieee80211_qosframe *qwh =
 			(struct ieee80211_qosframe *) wh;
+		uint16_t txseq;
 		int ac, tid;
 
 		ac = M_WME_GETAC(m);
@@ -810,13 +811,17 @@
 		qwh->i_qos[1] = 0;
 		qwh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_QOS;
 
+		if (IEEE80211_IS_MULTICAST(wh->i_addr1))
+			txseq = ic->ic_txseq++;
+		else
+			txseq = ni->ni_txseqs[tid]++;
+
 		*(uint16_t *)wh->i_seq =
-		    htole16(ic->ic_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT);
-		ic->ic_txseqs[tid]++;
+		    htole16(txseq << IEEE80211_SEQ_SEQ_SHIFT);
 	} else {
 		*(uint16_t *)wh->i_seq =
-		    htole16(ic->ic_txseqs[IEEE80211_NONQOS_TID] << IEEE80211_SEQ_SEQ_SHIFT);
-		ic->ic_txseqs[IEEE80211_NONQOS_TID]++;
+		    htole16(ic->ic_txseq << IEEE80211_SEQ_SEQ_SHIFT);
+		ic->ic_txseq++;
 	}
 	/* check if xmit fragmentation is required */
 	txfrag = (m->m_pkthdr.len > ic->ic_fragthreshold &&

==== //depot/projects/wifi/sys/net80211/ieee80211_var.h#67 (text+ko) ====

@@ -222,8 +222,7 @@
 	int			ic_inact_auth;	/* auth but not assoc setting */
 	int			ic_inact_run;	/* authorized setting */
 	int			ic_inact_probe;	/* inactive probe time */
-						/* tx seq per-tid */
-	uint16_t		ic_txseqs[IEEE80211_TID_SIZE];
+	uint16_t		ic_txseq;	/* global tx seq */
 
 	/*
 	 * Cipher state/configuration.


More information about the p4-projects mailing list