From owner-p4-projects@FreeBSD.ORG Mon Feb 11 03:43:12 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DB02E16A46B; Mon, 11 Feb 2008 03:43:11 +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 8754616A421 for ; Mon, 11 Feb 2008 03:43:11 +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 7368013C4D5 for ; Mon, 11 Feb 2008 03:43:11 +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 m1B3hBRB024448 for ; Mon, 11 Feb 2008 03:43:11 GMT (envelope-from sephe@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1B3hB6l024445 for perforce@freebsd.org; Mon, 11 Feb 2008 03:43:11 GMT (envelope-from sephe@FreeBSD.org) Date: Mon, 11 Feb 2008 03:43:11 GMT Message-Id: <200802110343.m1B3hB6l024445@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 135189 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: Mon, 11 Feb 2008 03:43:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=135189 Change 135189 by sephe@sephe_zealot:sam_wifi on 2008/02/11 03:42:55 - Embed current channel's rate table in ieee80211com - When set current channel (no matter whether channel switching really happens or not), update current channel's rate table accordingly Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211.c#63 edit .. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#90 edit .. //depot/projects/wifi/sys/net80211/ieee80211_var.h#65 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211.c#63 (text+ko) ==== @@ -191,7 +191,7 @@ ic->ic_bsschan = IEEE80211_CHAN_ANYC; ic->ic_prevchan = NULL; /* arbitrarily pick the first channel */ - ic->ic_curchan = &ic->ic_channels[0]; + ieee80211_update_curchan(ic, &ic->ic_channels[0]); /* fillin well-known rate sets if driver has not specified */ DEFAULTRATES(IEEE80211_MODE_11B, ieee80211_rateset_11b); @@ -1227,8 +1227,15 @@ } void +ieee80211_update_curchan(struct ieee80211com *ic, struct ieee80211_channel *c) +{ + ic->ic_curchan = c; + ic->ic_currates = ieee80211_get_ratetable(c); +} + +void ieee80211_set_channel(struct ieee80211com *ic, struct ieee80211_channel *c) { - ic->ic_curchan = c; + ieee80211_update_curchan(ic, c); ic->ic_set_channel(ic); } ==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#90 (text+ko) ==== @@ -1760,7 +1760,7 @@ if (ic->ic_state == IEEE80211_S_RUN) ieee80211_set_channel(ic, ic->ic_des_chan); else - ic->ic_curchan = ic->ic_des_chan; + ieee80211_update_curchan(ic, ic->ic_des_chan); } else { /* * Need to go through the state machine in case we @@ -1775,7 +1775,7 @@ * been specified fix the current channel so * there is immediate feedback; e.g. via ifconfig. */ - ic->ic_curchan = ic->ic_des_chan; + ieee80211_update_curchan(ic, ic->ic_des_chan); } } return error; ==== //depot/projects/wifi/sys/net80211/ieee80211_var.h#65 (text+ko) ==== @@ -85,6 +85,7 @@ #define IEEE80211_TU_TO_MS(x) (((x) * 1024) / 1000) #define IEEE80211_TU_TO_TICKS(x)(((x) * 1024 * hz) / (1000 * 1000)) +struct ieee80211_rate_table; struct ieee80211_aclator; struct sysctl_ctx_list; @@ -145,6 +146,8 @@ uint8_t ic_chan_avail[IEEE80211_CHAN_BYTES]; uint8_t ic_chan_active[IEEE80211_CHAN_BYTES]; uint8_t ic_chan_scan[IEEE80211_CHAN_BYTES]; + /* current channel ratetable */ + const struct ieee80211_rate_table *ic_currates; struct ieee80211_channel *ic_curchan; /* current channel */ struct ieee80211_channel *ic_bsschan; /* bss channel */ struct ieee80211_channel *ic_prevchan; /* previous channel */ @@ -430,6 +433,8 @@ enum ieee80211_phymode ieee80211_chan2mode(const struct ieee80211_channel *); void ieee80211_set_channel(struct ieee80211com *, struct ieee80211_channel *); +void ieee80211_update_curchan(struct ieee80211com *, + struct ieee80211_channel *); /* * Key update synchronization methods. XXX should not be visible.