From owner-p4-projects@FreeBSD.ORG Thu Aug 4 16:14:52 2005 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 7A80416A421; Thu, 4 Aug 2005 16:14:52 +0000 (GMT) X-Original-To: perforce@freebsd.org 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 4FF3A16A41F for ; Thu, 4 Aug 2005 16:14:52 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2479D43D46 for ; Thu, 4 Aug 2005 16:14:52 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j74GEpjm096059 for ; Thu, 4 Aug 2005 16:14:52 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j74GEpDi096056 for perforce@freebsd.org; Thu, 4 Aug 2005 16:14:51 GMT (envelope-from sam@freebsd.org) Date: Thu, 4 Aug 2005 16:14:51 GMT Message-Id: <200508041614.j74GEpDi096056@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 Cc: Subject: PERFORCE change 81451 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: Thu, 04 Aug 2005 16:14:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=81451 Change 81451 by sam@sam_ebb on 2005/08/04 16:14:36 report negotiated settings for ff and dturbo when associated Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#45 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#45 (text+ko) ==== @@ -578,6 +578,20 @@ } /* + * Return the current ``state'' of an Atheros capbility. + * If associated in station mode report the negotiated + * setting. Otherwise report the current setting. + */ +static int +getathcap(struct ieee80211com *ic, int cap) +{ + if (ic->ic_opmode == IEEE80211_M_STA && ic->ic_state == IEEE80211_S_RUN) + return IEEE80211_ATH_CAP(ic, ic->ic_bss, cap) != 0; + else + return (ic->ic_flags & cap) != 0; +} + +/* * When building the kernel with -O2 on the i386 architecture, gcc * seems to want to inline this function into ieee80211_ioctl() * (which is the only routine that calls it). When this happens, @@ -808,10 +822,10 @@ ireq->i_val = (ic->ic_flags & IEEE80211_F_PUREG) != 0; break; case IEEE80211_IOC_FF: - ireq->i_val = (ic->ic_flags & IEEE80211_F_FF) != 0; + ireq->i_val = getathcap(ic, IEEE80211_F_FF); break; case IEEE80211_IOC_TURBOP: - ireq->i_val = (ic->ic_flags & IEEE80211_F_TURBOP) != 0; + ireq->i_val = getathcap(ic, IEEE80211_F_TURBOP); break; case IEEE80211_IOC_BGSCAN: ireq->i_val = (ic->ic_flags & IEEE80211_F_BGSCAN) != 0;