From owner-p4-projects@FreeBSD.ORG Mon Feb 2 14:49:35 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6580316A4E0; Mon, 2 Feb 2004 14:49:35 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C72816A522 for ; Mon, 2 Feb 2004 14:49:35 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 147D043D39 for ; Mon, 2 Feb 2004 14:49:32 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i12MnV0B089381 for ; Mon, 2 Feb 2004 14:49:31 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i12MnVv3089378 for perforce@freebsd.org; Mon, 2 Feb 2004 14:49:31 -0800 (PST) (envelope-from sam@freebsd.org) Date: Mon, 2 Feb 2004 14:49:31 -0800 (PST) Message-Id: <200402022249.i12MnVv3089378@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 Subject: PERFORCE change 46380 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2004 22:49:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=46380 Change 46380 by sam@sam_ebb on 2004/02/02 14:48:53 beacons may have dtim or atim dependiny on whether they are for ibss or ap operation; change various names to be agnostic Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#14 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.h#6 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_var.h#9 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#14 (text+ko) ==== @@ -687,6 +687,7 @@ pktlen += 3; /* ERP information element */ if (rs->rs_nrates > IEEE80211_RATE_SIZE) pktlen += 2; /* extended rate set */ + /* XXX may be better to just allocate a max-sized buffer */ m = ieee80211_getmgtframe(&frm, pktlen); if (m == NULL) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY, @@ -733,14 +734,13 @@ *frm++ = 1; *frm++ = ieee80211_chan2ieee(ic, ni->ni_chan); } + bo->bo_tim = frm; if (ic->ic_opmode == IEEE80211_M_IBSS) { *frm++ = IEEE80211_ELEMID_IBSSPARMS; *frm++ = 2; *frm++ = 0; *frm++ = 0; /* TODO: ATIM window */ - bo->bo_dtim = NULL; - bo->bo_dtim_len = 0; + bo->bo_tim_len = 4; } else { - bo->bo_dtim = frm; /* TODO: TIM */ *frm++ = IEEE80211_ELEMID_TIM; *frm++ = 4; /* length */ @@ -748,7 +748,7 @@ *frm++ = 1; /* DTIM period */ *frm++ = 0; /* bitmap control */ *frm++ = 0; /* Partial Virtual Bitmap (variable length) */ - bo->bo_dtim_len = 6; + bo->bo_tim_len = 6; } if (ic->ic_curmode == IEEE80211_MODE_11G) frm = ieee80211_add_erp(frm, ic); @@ -787,16 +787,18 @@ capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME; *bo->bo_caps = htole16(capinfo); - if (ic->ic_flags & IEEE80211_F_DTIMUPDATE) { + if (ic->ic_flags & IEEE80211_F_TIMUPDATE) { /* - * DTIM needs updating. If it fits in the current - * space allocated then just copy in the new bits. - * Otherwise we need to move any extended rate set - * the follows and, possibly, allocate a new mbuf - * if the this current mbuf isn't large enough. + * ATIM/DTIM needs updating. If it fits in the + * current space allocated then just copy in the + * new bits. Otherwise we need to move any extended + * rate set the follows and, possibly, allocate a + * new buffer if the this current one isn't large + * enough. XXX It may be better to just allocate + * a max-sized buffer so we don't re-allocate. */ /* XXX fillin */ - ic->ic_flags &= ~IEEE80211_F_DTIMUPDATE; + ic->ic_flags &= ~IEEE80211_F_TIMUPDATE; } return 0; } ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.h#6 (text+ko) ==== @@ -87,12 +87,12 @@ */ struct ieee80211_beacon_offsets { u_int16_t *bo_caps; /* capabilities */ - u_int8_t *bo_dtim; /* start of dtim */ + u_int8_t *bo_tim; /* start of atim/dtim */ u_int8_t *bo_xrates; /* start of extended rates */ - u_int16_t bo_dtim_len; /* dtim length in bytes */ + u_int16_t bo_tim_len; /* atim/dtim length in bytes */ u_int16_t bo_xrates_len; /* xrates length in bytes */ }; -extern struct mbuf * ieee80211_beacon_alloc(struct ieee80211com *, +extern struct mbuf *ieee80211_beacon_alloc(struct ieee80211com *, struct ieee80211_node *, struct ieee80211_beacon_offsets *); extern int ieee80211_beacon_update(struct ieee80211com *, struct ieee80211_node *, struct ieee80211_beacon_offsets *, ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_var.h#9 (text+ko) ==== @@ -263,7 +263,7 @@ #define IEEE80211_F_DATAPAD 0x00080000 /* CONF: do alignment pad */ #define IEEE80211_F_USEPROT 0x00100000 /* STATUS: protection enabled */ #define IEEE80211_F_USEBARKER 0x00200000 /* STATUS: use barker preamble*/ -#define IEEE80211_F_DTIMUPDATE 0x00400000 /* STATUS: update beacon dtim */ +#define IEEE80211_F_TIMUPDATE 0x00400000 /* STATUS: update beacon tim */ /* ic_caps */ #define IEEE80211_C_WEP 0x00000001 /* CAPABILITY: WEP available */