From owner-p4-projects@FreeBSD.ORG Sat Aug 9 05:33:56 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BA94A106567E; Sat, 9 Aug 2008 05:33:56 +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 7CEB0106567A for ; Sat, 9 Aug 2008 05:33:56 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6B5978FC0C for ; Sat, 9 Aug 2008 05:33:56 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m795Xukl016561 for ; Sat, 9 Aug 2008 05:33:56 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m795Xu3S016559 for perforce@freebsd.org; Sat, 9 Aug 2008 05:33:56 GMT (envelope-from sam@freebsd.org) Date: Sat, 9 Aug 2008 05:33:56 GMT Message-Id: <200808090533.m795Xu3S016559@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 146956 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, 09 Aug 2008 05:33:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=146956 Change 146956 by sam@sam_ebb on 2008/08/09 05:33:27 duh, only mark device HT capable when it is; blindly saying it's HT-capable means we'll try to setup HT operation which will blow up on a legacy device because there are no rate tables Affected files ... .. //depot/projects/vap/sys/dev/ath/if_ath.c#90 edit Differences ... ==== //depot/projects/vap/sys/dev/ath/if_ath.c#90 (text+ko) ==== @@ -114,6 +114,11 @@ ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8) | \ (((u_int8_t *)(p))[2] << 16) | (((u_int8_t *)(p))[3] << 24))) +#define HAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20) +#define HAL_MODE_HT40 \ + (HAL_MODE_11NG_HT40PLUS | HAL_MODE_11NG_HT40MINUS | \ + HAL_MODE_11NA_HT40PLUS | HAL_MODE_11NA_HT40MINUS) + static struct ieee80211vap *ath_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], @@ -294,6 +299,7 @@ struct ath_hal *ah = NULL; HAL_STATUS status; int error = 0, i; + u_int wmodes; DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); @@ -524,13 +530,6 @@ | IEEE80211_C_BGSCAN /* capable of bg scanning */ | IEEE80211_C_TXFRAG /* handle tx frags */ ; - ic->ic_htcaps = - IEEE80211_HTC_HT /* HT operation */ - /* h/w capabilities */ - | IEEE80211_HTCAP_CHWIDTH40 /* 40MHz channel width */ - | IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */ - | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ - ; /* * Query the hal to figure out h/w crypto support. */ @@ -605,8 +604,18 @@ sc->sc_hastsfadd = ath_hal_hastsfadjust(ah); if (ath_hal_hasfastframes(ah)) ic->ic_caps |= IEEE80211_C_FF; - if (ath_hal_getwirelessmodes(ah, ic->ic_regdomain.country) & (HAL_MODE_108G|HAL_MODE_TURBO)) + wmodes = ath_hal_getwirelessmodes(ah, ic->ic_regdomain.country); + if (wmodes & (HAL_MODE_108G|HAL_MODE_TURBO)) ic->ic_caps |= IEEE80211_C_TURBOP; + if (wmodes & HAL_MODE_HT20) { + /* XXX no capabilities for short GI */ + ic->ic_htcaps |= IEEE80211_HTC_HT; + ic->ic_htcaps |= IEEE80211_HTCAP_SHORTGI20; + if (wmodes & HAL_MODE_HT40) { + ic->ic_htcaps |= IEEE80211_HTCAP_CHWIDTH40; + ic->ic_htcaps |= IEEE80211_HTCAP_SHORTGI40; + } + } /* * Indicate we need the 802.11 header padded to a