Index: dev/ath/ath_hal/ah.c =================================================================== --- dev/ath/ath_hal/ah.c (revision 309329) +++ dev/ath/ath_hal/ah.c (working copy) @@ -1415,6 +1415,8 @@ /* * Get CCA setting. + * + * XXX TODO: this may not actually be the same on all chips! Grr! */ int ath_hal_getcca(struct ath_hal *ah) Index: dev/ath/if_ath.c =================================================================== --- dev/ath/if_ath.c (revision 309329) +++ dev/ath/if_ath.c (working copy) @@ -1010,6 +1010,28 @@ sc->sc_rx_lnamixer = ath_hal_hasrxlnamixer(ah); sc->sc_hasdivcomb = ath_hal_hasdivantcomb(ah); + /* + * Some WB335 cards do not support antenna diversity. Since + * we use a hardcoded value for AR9565 instead of using the + * EEPROM/OTP data, remove the combining feature from + * the HW capabilities bitmap. + */ + /* + * XXX TODO: check reference driver and ath9k for what to do + * here for WB335. I think we have to actually disable the + * LNA div processing in the HAL and instead use the hard + * coded values; and then use BT diversity. + * + * .. but also need to setup MCI too for WB335.. + */ +#if 0 + if (sc->sc_pci_devinfo & (ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_AR9565_2ANT)) { + device_printf(sc->sc_dev, "%s: WB335: disabling LNA mixer diversity\n", + __func__); + sc->sc_dolnadiv = 0; + } +#endif + if (ath_hal_hasfastframes(ah)) ic->ic_caps |= IEEE80211_C_FF; wmodes = ath_hal_getwirelessmodes(ah); @@ -5649,6 +5671,31 @@ */ IEEE80211_LOCK_ASSERT(ic); + /* + * XXX TODO: if nstate is _S_CAC, then we should disable + * ACK processing until CAC is completed. + */ + + /* + * XXX TODO: if we're on a passive channel, then we should + * not allow any ACKs or self-generated frames until we hear + * a beacon. Unfortunately there isn't a notification from + * net80211 so perhaps we could slot that particular check + * into the mgmt receive path and just ensure that we clear + * it on RX of beacons in passive mode (and only clear it + * once, obviously.) + */ + + /* + * XXX TODO: net80211 should be tracking whether channels + * have heard beacons and are thus considered "OK" for + * transmitting - and then inform the driver about this + * state change. That way if we hear an AP go quiet + * (and nothing else is beaconing on a channel) the + * channel can go back to being passive until another + * beacon is heard. + */ + if (nstate == IEEE80211_S_RUN) { /* NB: collect bss node again, it may have changed */ ieee80211_free_node(ni); @@ -5670,7 +5717,15 @@ case IEEE80211_M_HOSTAP: case IEEE80211_M_IBSS: case IEEE80211_M_MBSS: + /* + * TODO: Enable ACK processing (ie, clear AR_DIAG_ACK_DIS.) + * For channels that are in CAC, we may have disabled + * this during CAC to ensure we don't ACK frames + * sent to us. + */ + + /* * Allocate and setup the beacon frame. * * Stop any previous beacon DMA. This may be @@ -6274,7 +6329,16 @@ */ if (ath_dfs_process_radar_event(sc, sc->sc_curchan)) { /* DFS event found, initiate channel change */ + /* + * XXX TODO: immediately disable ACK processing + * on the current channel. This would be done + * by setting AR_DIAG_ACK_DIS (AR5212; may be + * different for others) until we are out of + * CAC. + */ + + /* * XXX doesn't currently tell us whether the event * XXX was found in the primary or extension * XXX channel! Index: modules/wlan/Makefile =================================================================== --- modules/wlan/Makefile (revision 309329) +++ modules/wlan/Makefile (working copy) @@ -12,7 +12,7 @@ ieee80211_ratectl_none.c ieee80211_regdomain.c \ ieee80211_ht.c ieee80211_hwmp.c ieee80211_adhoc.c ieee80211_hostap.c \ ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c \ - ieee80211_tdma.c ieee80211_superg.c + ieee80211_tdma.c ieee80211_superg.c ieee80211_alq.c SRCS+= bus_if.h device_if.h opt_ddb.h opt_inet.h opt_inet6.h \ opt_tdma.h opt_wlan.h Index: net/if_media.h =================================================================== --- net/if_media.h (revision 309329) +++ net/if_media.h (working copy) @@ -264,6 +264,7 @@ #define IFM_IEEE80211_OFDM27 23 /* OFDM 27Mbps */ /* NB: not enough bits to express MCS fully */ #define IFM_IEEE80211_MCS 24 /* HT MCS rate */ +#define IFM_IEEE80211_VHT 25 /* HT MCS rate */ #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ @@ -280,6 +281,8 @@ #define IFM_IEEE80211_FH 0x00040000 /* 2Ghz, GFSK mode */ #define IFM_IEEE80211_11NA 0x00050000 /* 5Ghz, HT mode */ #define IFM_IEEE80211_11NG 0x00060000 /* 2Ghz, HT mode */ +#define IFM_IEEE80211_VHT5G 0x00070000 /* 5Ghz, VHT mode */ +#define IFM_IEEE80211_VHT2G 0x00080000 /* 2Ghz, VHT mode */ /* * ATM Index: net80211/_ieee80211.h =================================================================== --- net80211/_ieee80211.h (revision 310127) +++ net80211/_ieee80211.h (working copy) @@ -45,6 +45,7 @@ IEEE80211_T_HT, /* high throughput */ IEEE80211_T_OFDM_HALF, /* 1/2 rate OFDM */ IEEE80211_T_OFDM_QUARTER, /* 1/4 rate OFDM */ + IEEE80211_T_VHT, /* VHT PHY */ }; #define IEEE80211_T_CCK IEEE80211_T_DS /* more common nomenclature */ @@ -68,8 +69,10 @@ IEEE80211_MODE_11NG = 9, /* 2GHz, w/ HT */ IEEE80211_MODE_HALF = 10, /* OFDM, 1/2x clock */ IEEE80211_MODE_QUARTER = 11, /* OFDM, 1/4x clock */ + IEEE80211_MODE_VHT_2GHZ = 12, /* 2GHz, VHT */ + IEEE80211_MODE_VHT_5GHZ = 13, /* 5GHz, VHT */ }; -#define IEEE80211_MODE_MAX (IEEE80211_MODE_QUARTER+1) +#define IEEE80211_MODE_MAX (IEEE80211_MODE_VHT_5GHZ+1) #define IEEE80211_MODE_BYTES howmany(IEEE80211_MODE_MAX, NBBY) /* @@ -134,7 +137,7 @@ */ struct ieee80211_channel { uint32_t ic_flags; /* see below */ - uint16_t ic_freq; /* setting in MHz */ + uint16_t ic_freq; /* primary centre frequency in MHz */ uint8_t ic_ieee; /* IEEE channel number */ int8_t ic_maxregpower; /* maximum regulatory tx power in dBm */ int8_t ic_maxpower; /* maximum tx power in .5 dBm */ @@ -144,9 +147,17 @@ int8_t ic_maxantgain; /* maximum antenna gain in .5 dBm */ uint8_t ic_pad; uint16_t ic_devdata; /* opaque device/driver data */ + uint8_t ic_vht_ch_freq1; /* VHT primary freq1 IEEE value */ + uint8_t ic_vht_ch_freq2; /* VHT secondary 80MHz freq2 IEEE value */ + uint16_t ic_freq2; /* VHT secondary 80MHz freq2 MHz */ }; -#define IEEE80211_CHAN_MAX 256 +/* + * Note: for VHT operation we will need significantly more than + * IEEE80211_CHAN_MAX channels because of the combinations of + * VHT20, VHT40, VHT80, VHT80+80 and VHT160. + */ +#define IEEE80211_CHAN_MAX 1024 #define IEEE80211_CHAN_BYTES howmany(IEEE80211_CHAN_MAX, NBBY) #define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ #define IEEE80211_CHAN_ANYC \ @@ -177,14 +188,26 @@ #define IEEE80211_CHAN_NOADHOC 0x00200000 /* adhoc mode not allowed */ #define IEEE80211_CHAN_NOHOSTAP 0x00400000 /* hostap mode not allowed */ #define IEEE80211_CHAN_11D 0x00800000 /* 802.11d required */ +#define IEEE80211_CHAN_VHT20 0x01000000 /* VHT20 channel */ +#define IEEE80211_CHAN_VHT40U 0x02000000 /* VHT40 channel, ext above */ +#define IEEE80211_CHAN_VHT40D 0x04000000 /* VHT40 channel, ext below */ +#define IEEE80211_CHAN_VHT80 0x08000000 /* VHT80 channel */ +#define IEEE80211_CHAN_VHT80_80 0x10000000 /* VHT80+80 channel */ +#define IEEE80211_CHAN_VHT160 0x20000000 /* VHT160 channel */ #define IEEE80211_CHAN_HT40 (IEEE80211_CHAN_HT40U | IEEE80211_CHAN_HT40D) #define IEEE80211_CHAN_HT (IEEE80211_CHAN_HT20 | IEEE80211_CHAN_HT40) +#define IEEE80211_CHAN_VHT40 (IEEE80211_CHAN_VHT40U | IEEE80211_CHAN_VHT40D) +#define IEEE80211_CHAN_VHT (IEEE80211_CHAN_VHT20 | IEEE80211_CHAN_VHT40 \ + | IEEE80211_CHAN_VHT80 | IEEE80211_CHAN_VHT80_80 \ + | IEEE80211_CHAN_VHT160) + #define IEEE80211_CHAN_BITS \ "\20\1PRIV0\2PRIV2\3PRIV3\4PRIV4\5TURBO\6CCK\7OFDM\0102GHZ\0115GHZ" \ "\12PASSIVE\13DYN\14GFSK\15GSM\16STURBO\17HALF\20QUARTER\21HT20" \ "\22HT40U\23HT40D\24DFS\0254MSXMIT\26NOADHOC\27NOHOSTAP\03011D" +/* XXX TODO: add VHT bits */ /* * Useful combinations of channel characteristics. @@ -210,7 +233,7 @@ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \ IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN | \ IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER | \ - IEEE80211_CHAN_HT) + IEEE80211_CHAN_HT | IEEE80211_CHAN_VHT) #define IEEE80211_CHAN_ALLTURBO \ (IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO) @@ -287,6 +310,29 @@ #define IEEE80211_IS_CHAN_11D(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_11D) != 0) +#define IEEE80211_IS_CHAN_VHT(_c) \ + (((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0) +#define IEEE80211_IS_CHAN_VHT20(_c) \ + (((_c)->ic_flags & IEEE80211_CHAN_VHT20) != 0) +#define IEEE80211_IS_CHAN_VHT40(_c) \ + (((_c)->ic_flags & IEEE80211_CHAN_VHT40) != 0) +#define IEEE80211_IS_CHAN_VHT40U(_c) \ + (((_c)->ic_flags & IEEE80211_CHAN_VHT40U) != 0) +#define IEEE80211_IS_CHAN_VHT40D(_c) \ + (((_c)->ic_flags & IEEE80211_CHAN_VHT40D) != 0) +#define IEEE80211_IS_CHAN_VHTA(_c) \ + (IEEE80211_IS_CHAN_5GHZ(_c) && \ + ((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0) +#define IEEE80211_IS_CHAN_VHTG(_c) \ + (IEEE80211_IS_CHAN_2GHZ(_c) && \ + ((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0) +#define IEEE80211_IS_CHAN_VHT80(_c) \ + (((_c)->ic_flags & IEEE80211_CHAN_VHT80) != 0) +#define IEEE80211_IS_CHAN_VHT80_80(_c) \ + (((_c)->ic_flags & IEEE80211_CHAN_VHT80_80) != 0) +#define IEEE80211_IS_CHAN_VHT160(_c) \ + (((_c)->ic_flags & IEEE80211_CHAN_VHT160) != 0) + #define IEEE80211_CHAN2IEEE(_c) (_c)->ic_ieee /* dynamic state */ Index: net80211/ieee80211.c =================================================================== --- net80211/ieee80211.c (revision 310127) +++ net80211/ieee80211.c (working copy) @@ -2020,6 +2020,10 @@ case IEEE80211_MODE_11NG: case IEEE80211_MODE_TURBO_G: return findmedia(rates, nitems(rates), rate | IFM_IEEE80211_11G); + case IEEE80211_MODE_VHT_2GHZ: + case IEEE80211_MODE_VHT_5GHZ: + /* XXX TODO: need to figure out mapping for VHT rates */ + return IFM_AUTO; } return IFM_AUTO; } @@ -2053,6 +2057,7 @@ 9, /* IFM_IEEE80211_OFDM4 */ 54, /* IFM_IEEE80211_OFDM27 */ -1, /* IFM_IEEE80211_MCS */ + -1, /* IFM_IEEE80211_VHT */ }; return IFM_SUBTYPE(mword) < nitems(ieeerates) ? ieeerates[IFM_SUBTYPE(mword)] : 0; @@ -2103,6 +2108,8 @@ return 'T'; if (IEEE80211_IS_CHAN_108G(c)) return 'G'; + if (IEEE80211_IS_CHAN_VHT(c)) + return 'v'; if (IEEE80211_IS_CHAN_HT(c)) return 'n'; if (IEEE80211_IS_CHAN_A(c)) Index: net80211/ieee80211_ioctl.c =================================================================== --- net80211/ieee80211_ioctl.c (revision 310127) +++ net80211/ieee80211_ioctl.c (working copy) @@ -855,6 +855,8 @@ * Tx power limit is the min of max regulatory * power, any user-set limit, and the max the * radio can do. + * + * TODO: methodize this */ ireq->i_val = 2*ic->ic_curchan->ic_maxregpower; if (ireq->i_val > ic->ic_txpowlimit) @@ -1013,6 +1015,7 @@ ireq->i_val |= 2; break; case IEEE80211_IOC_AMPDU_LIMIT: + /* XXX TODO: make this a per-node thing; and leave this as global */ if (vap->iv_opmode == IEEE80211_M_HOSTAP) ireq->i_val = vap->iv_ampdu_rxmax; else if (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) @@ -1026,6 +1029,7 @@ ireq->i_val = vap->iv_ampdu_limit; break; case IEEE80211_IOC_AMPDU_DENSITY: + /* XXX TODO: make this a per-node thing; and leave this as global */ if (vap->iv_opmode == IEEE80211_M_STA && (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP)) /* @@ -3094,6 +3098,7 @@ error = ERESTART; break; case IEEE80211_IOC_AMPDU_LIMIT: + /* XXX TODO: figure out ampdu_limit versus ampdu_rxmax */ if (!(IEEE80211_HTCAP_MAXRXAMPDU_8K <= ireq->i_val && ireq->i_val <= IEEE80211_HTCAP_MAXRXAMPDU_64K)) return EINVAL; Index: net80211/ieee80211_node.h =================================================================== --- net80211/ieee80211_node.h (revision 310127) +++ net80211/ieee80211_node.h (working copy) @@ -224,6 +224,15 @@ struct ieee80211_tx_ampdu ni_tx_ampdu[WME_NUM_TID]; struct ieee80211_rx_ampdu ni_rx_ampdu[WME_NUM_TID]; + /* VHT state */ + uint32_t ni_vhtcap; + uint32_t ni_vhtinfo; + struct ieee80211_vht_mcs_info ni_vht_mcsinfo; + uint8_t ni_vht_chan1; /* 20/40/80/160 - VHT chan1 */ + uint8_t ni_vht_chan2; /* 80+80 - VHT chan2 */ + uint16_t ni_vht_pad1; + uint32_t ni_vht_spare[8]; + /* fast-frames state */ struct mbuf * ni_tx_superg[WME_NUM_TID]; Index: net80211/ieee80211_var.h =================================================================== --- net80211/ieee80211_var.h (revision 310127) +++ net80211/ieee80211_var.h (working copy) @@ -229,6 +229,12 @@ uint8_t ic_rxstream; /* # RX streams */ uint8_t ic_txstream; /* # TX streams */ + /* VHT information */ + uint32_t ic_vhtcaps; /* VHT capabilities */ + uint32_t ic_vhtextcaps; /* VHT extended capabilities (TODO) */ + struct ieee80211_vht_mcs_info iv_vht_mcsinfo; /* Support TX/RX VHT MCS */ + uint32_t ic_vht_spare[4]; + /* optional state for Atheros SuperG protocol extensions */ struct ieee80211_superg *ic_superg; @@ -390,6 +396,13 @@ int iv_inact_run; /* authorized setting */ int iv_inact_probe; /* inactive probe time */ + /* VHT flags */ + uint32_t iv_flags_vht; /* VHT state flags */ + uint32_t iv_vhtcaps; /* VHT capabilities */ + uint32_t iv_vhtextcaps; /* VHT extended capabilities (TODO) */ + struct ieee80211_vht_mcs_info iv_vht_mcsinfo; + uint32_t iv_vht_spare[4]; + int iv_des_nssid; /* # desired ssids */ struct ieee80211_scan_ssid iv_des_ssid[1];/* desired ssid table */ uint8_t iv_des_bssid[IEEE80211_ADDR_LEN]; Index: sys/param.h =================================================================== --- sys/param.h (revision 309329) +++ sys/param.h (working copy) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200017 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200018 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Index: x86/iommu/intel_fault.c =================================================================== --- x86/iommu/intel_fault.c (revision 309329) +++ x86/iommu/intel_fault.c (working copy) @@ -232,7 +232,7 @@ DMAR_UNLOCK(unit); printf( "pci%d:%d:%d sid %x fault acc %x adt 0x%x reason 0x%x " - "addr %jx\n", + "addr 0x%jx\n", bus, slot, func, sid, DMAR_FRCD2_T(fault_rec[1]), DMAR_FRCD2_AT(fault_rec[1]), DMAR_FRCD2_FR(fault_rec[1]), (uintmax_t)fault_rec[0]);