Date: Sat, 9 Aug 2008 05:33:56 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 146956 for review Message-ID: <200808090533.m795Xu3S016559@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808090533.m795Xu3S016559>