From owner-p4-projects@FreeBSD.ORG Sun Mar 9 10:40:39 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 01E071065675; Sun, 9 Mar 2008 10:40:39 +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 B3D4B1065671 for ; Sun, 9 Mar 2008 10:40:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 92FA58FC18 for ; Sun, 9 Mar 2008 10:40:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m29AecrQ076553 for ; Sun, 9 Mar 2008 10:40:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m29AecPQ076551 for perforce@freebsd.org; Sun, 9 Mar 2008 10:40:38 GMT (envelope-from sephe@FreeBSD.org) Date: Sun, 9 Mar 2008 10:40:38 GMT Message-Id: <200803091040.m29AecPQ076551@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau To: Perforce Change Reviews Cc: Subject: PERFORCE change 137213 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: Sun, 09 Mar 2008 10:40:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=137213 Change 137213 by sephe@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.