From owner-p4-projects@FreeBSD.ORG Sat Jun 30 10:01:53 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1757F16A484; Sat, 30 Jun 2007 10:01:53 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6E2A16A400 for ; Sat, 30 Jun 2007 10:01:52 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id C5F8613C483 for ; Sat, 30 Jun 2007 10:01:52 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l5UA1qvN006356 for ; Sat, 30 Jun 2007 10:01:52 GMT (envelope-from thompsa@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l5UA1qw9006352 for perforce@freebsd.org; Sat, 30 Jun 2007 10:01:52 GMT (envelope-from thompsa@freebsd.org) Date: Sat, 30 Jun 2007 10:01:52 GMT Message-Id: <200706301001.l5UA1qw9006352@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to thompsa@freebsd.org using -f From: Andrew Thompson To: Perforce Change Reviews Cc: Subject: PERFORCE change 122568 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: Sat, 30 Jun 2007 10:01:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=122568 Change 122568 by thompsa@thompsa_heff on 2007/06/30 10:01:50 Provide a macro which directly dereferences ic_ieee from the channel. This can only be used in places where the channel is always valid. Suggested by: sam Affected files ... .. //depot/projects/wifi/sys/net80211/_ieee80211.h#24 edit .. //depot/projects/wifi/sys/net80211/ieee80211_input.c#109 edit .. //depot/projects/wifi/sys/net80211/ieee80211_scan.c#17 edit Differences ... ==== //depot/projects/wifi/sys/net80211/_ieee80211.h#24 (text+ko) ==== @@ -229,6 +229,8 @@ (IEEE80211_IS_CHAN_2GHZ(_c) && \ ((_c)->ic_flags & IEEE80211_CHAN_HT) != 0) +#define IEEE80211_CHAN2IEEE(_c) (_c)->ic_ieee + /* ni_chan encoding for FH phy */ #define IEEE80211_FH_CHANMOD 80 #define IEEE80211_FH_CHAN(set,pat) (((set)-1)*IEEE80211_FH_CHANMOD+(pat)) ==== //depot/projects/wifi/sys/net80211/ieee80211_input.c#109 (text+ko) ==== @@ -2090,7 +2090,7 @@ scan.tstamp = frm; frm += 8; scan.bintval = le16toh(*(uint16_t *)frm); frm += 2; scan.capinfo = le16toh(*(uint16_t *)frm); frm += 2; - scan.bchan = ieee80211_chan2ieee(ic, ic->ic_curchan); + scan.bchan = IEEE80211_CHAN2IEEE(ic->ic_curchan); scan.curchan = ic->ic_curchan; while (efrm - frm > 1) { @@ -2194,7 +2194,7 @@ return; } #endif - if (ieee80211_chan2ieee(ic, scan.curchan) != scan.bchan && + if (IEEE80211_CHAN2IEEE(scan.curchan) != scan.bchan && ic->ic_phytype != IEEE80211_T_FH) { /* * Frame was received on a channel different from the @@ -2211,7 +2211,7 @@ wh, ieee80211_mgt_subtype_name[subtype >> IEEE80211_FC0_SUBTYPE_SHIFT], "for off-channel %u", - ieee80211_chan2ieee(ic, scan.curchan)); + IEEE80211_CHAN2IEEE(scan.curchan)); ic->ic_stats.is_rx_chanmismatch++; return; } ==== //depot/projects/wifi/sys/net80211/ieee80211_scan.c#17 (text+ko) ==== @@ -840,7 +840,7 @@ #ifdef IEEE80211_DEBUG static void -dump_probe_beacon(struct ieee80211com *ic, uint8_t subtype, int isnew, +dump_probe_beacon(uint8_t subtype, int isnew, const uint8_t mac[IEEE80211_ADDR_LEN], const struct ieee80211_scanparams *sp) { @@ -848,7 +848,7 @@ printf("[%s] %s%s on chan %u (bss chan %u) ", ether_sprintf(mac), isnew ? "new " : "", ieee80211_mgt_subtype_name[subtype >> IEEE80211_FC0_SUBTYPE_SHIFT], - ieee80211_chan2ieee(ic, sp->curchan), sp->bchan); + IEEE80211_CHAN2IEEE(sp->curchan), sp->bchan); ieee80211_print_essid(sp->ssid + 2, sp->ssid[1]); printf("\n"); @@ -894,7 +894,7 @@ return; #ifdef IEEE80211_DEBUG if (ieee80211_msg_scan(ic) && (ic->ic_flags & IEEE80211_F_SCAN)) - dump_probe_beacon(ic, subtype, 1, wh->i_addr2, sp); + dump_probe_beacon(subtype, 1, wh->i_addr2, sp); #endif if (ss->ss_ops != NULL && ss->ss_ops->scan_add(ss, sp, wh, subtype, rssi, noise, rstamp)) {