Index: sys/conf/NOTES =================================================================== --- sys/conf/NOTES +++ sys/conf/NOTES @@ -2899,3 +2899,6 @@ # Kernel support for stats(3). options STATS + +# Enable (experimental) 11n support for the run(4) driver +options IF_RUN_11N Index: sys/conf/options =================================================================== --- sys/conf/options +++ sys/conf/options @@ -1035,3 +1035,6 @@ # gcov support GCOV opt_global.h LINDEBUGFS + +# 11n support for run(4) driver +IF_RUN_11N opt_run_11n.h Index: sys/dev/usb/wlan/if_run.c =================================================================== --- sys/dev/usb/wlan/if_run.c +++ sys/dev/usb/wlan/if_run.c @@ -809,6 +809,26 @@ IEEE80211_C_WME | /* WME */ IEEE80211_C_WPA; /* WPA1|WPA2(RSN) */ +#ifdef IF_RUN_11N + /* set device HT capabilities */ + /* HT Capabilities strictly for 11ng (we dont support 11ac yet..) */ + ic->ic_htcaps = IEEE80211_HTC_HT | IEEE80211_HTC_AMPDU | + /* IEEE80211_HTCAP_LDPC | */ + IEEE80211_HTCAP_CHWIDTH40 | + IEEE80211_HTCAP_GREENFIELD | + IEEE80211_HTCAP_SMPS_OFF | + IEEE80211_HTCAP_SHORTGI20 | + IEEE80211_HTCAP_SHORTGI40 | + IEEE80211_HTCAP_TXSTBC | + IEEE80211_HTCAP_RXSTBC_3STREAM | + /* IEEE80211_HTCAP_DSSSCCK40 | */ + IEEE80211_HTCAP_MAXRXAMPDU | + IEEE80211_HTCAP_MPDUDENSITY_4; + + /* TODO: Add other caps according to rt2x00 later */ + device_printf(sc->sc_dev, "ic_htcaps = 0x%x\n", ic->ic_htcaps); +#endif + ic->ic_cryptocaps = IEEE80211_CRYPTO_WEP | IEEE80211_CRYPTO_AES_CCM | @@ -4852,6 +4872,13 @@ memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); + +#ifdef IF_RUN_11N + if(sc->rf_rev == RT3593_RF_3053) { + device_printf(sc->sc_dev, "Adding 11ng channels.\n"); + setbit(bands, IEEE80211_MODE_11NG); + } +#endif ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850 || Index: sys/net80211/ieee80211_output.c =================================================================== --- sys/net80211/ieee80211_output.c +++ sys/net80211/ieee80211_output.c @@ -2417,6 +2417,21 @@ frm = ieee80211_add_htcap_ch(frm, vap, c); } +#ifdef IF_RUN_11N + if ((vap->iv_opmode == IEEE80211_M_STA) && + (vap->iv_flags_ht & IEEE80211_FHT_HT)) { + struct ieee80211_channel *c; + + /* + * Get the HT channel that we should try upgrading to. + * If we can do 40MHz then this'll upgrade it appropriately. + */ + c = ieee80211_ht_adjust_channel(ic, ic->ic_curchan, + vap->iv_flags_ht); + frm = ieee80211_add_htcap_ch(frm, vap, c); + } +#endif + /* * XXX TODO: need to figure out what/how to update the * VHT channel.