diff options
author | adrian <adrian@FreeBSD.org> | 2013-02-27 00:25:44 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2013-02-27 00:25:44 +0000 |
commit | 3c9d9a484c356b0ab902d7216044b61d991bfc76 (patch) | |
tree | 2db2d77c0ef6d5c12e7aa782bb95b71cb0159f69 | |
parent | cc89d0bd92235897b82b75614fcf8d8f6b33e551 (diff) | |
download | FreeBSD-src-3c9d9a484c356b0ab902d7216044b61d991bfc76.zip FreeBSD-src-3c9d9a484c356b0ab902d7216044b61d991bfc76.tar.gz |
Add in the STBC TX/RX capability support into the HAL and driver.
The HAL already included the STBC fields; it just needed to be exposed
to the driver and net80211 stack.
This should allow single-stream STBC TX and RX to be negotiated; however
the driver and rate control code currently don't do anything with it.
-rw-r--r-- | sys/dev/ath/ath_hal/ah.c | 4 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ah.h | 3 | ||||
-rw-r--r-- | sys/dev/ath/if_ath.c | 22 | ||||
-rw-r--r-- | sys/dev/ath/if_athvar.h | 4 |
4 files changed, 32 insertions, 1 deletions
diff --git a/sys/dev/ath/ath_hal/ah.c b/sys/dev/ath/ath_hal/ah.c index d1ce7a8..551c225 100644 --- a/sys/dev/ath/ath_hal/ah.c +++ b/sys/dev/ath/ath_hal/ah.c @@ -692,6 +692,10 @@ ath_hal_getcapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, return pCap->hal4AddrAggrSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_EXT_CHAN_DFS: return pCap->halExtChanDfsSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_RX_STBC: + return pCap->halRxStbcSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_TX_STBC: + return pCap->halTxStbcSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_COMBINED_RADAR_RSSI: return pCap->halUseCombinedRadarRssi ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_AUTO_SLEEP: diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h index 0e3d5ab..ca2e7ca 100644 --- a/sys/dev/ath/ath_hal/ah.h +++ b/sys/dev/ath/ath_hal/ah.h @@ -137,6 +137,9 @@ typedef enum { HAL_CAP_RIFS_RX_ENABLED = 53, HAL_CAP_BB_DFS_HANG = 54, + HAL_CAP_RX_STBC = 58, + HAL_CAP_TX_STBC = 59, + HAL_CAP_BT_COEX = 60, /* hardware is capable of bluetooth coexistence */ HAL_CAP_DYNAMIC_SMPS = 61, /* Dynamic MIMO Power Save hardware support */ diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index a614d6f..fd1a7c3 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -781,6 +781,28 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) ic->ic_txstream = txs; ic->ic_rxstream = rxs; + /* + * Setup TX and RX STBC based on what the HAL allows and + * the currently configured chainmask set. + * Ie - don't enable STBC TX if only one chain is enabled. + * STBC RX is fine on a single RX chain; it just won't + * provide any real benefit. + */ + if (ath_hal_getcapability(ah, HAL_CAP_RX_STBC, 0, + NULL) == HAL_OK) { + sc->sc_rx_stbc = 1; + device_printf(sc->sc_dev, + "[HT] 1 stream STBC receive enabled\n"); + ic->ic_htcaps |= IEEE80211_HTCAP_RXSTBC_1STREAM; + } + if (txs > 1 && ath_hal_getcapability(ah, HAL_CAP_TX_STBC, 0, + NULL) == HAL_OK) { + sc->sc_tx_stbc = 1; + device_printf(sc->sc_dev, + "[HT] 1 stream STBC transmit enabled\n"); + ic->ic_htcaps |= IEEE80211_HTCAP_TXSTBC; + } + (void) ath_hal_getcapability(ah, HAL_CAP_RTS_AGGR_LIMIT, 1, &sc->sc_rts_aggr_limit); if (sc->sc_rts_aggr_limit != (64 * 1024)) diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index e8fdeff..42442de 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -567,7 +567,9 @@ struct ath_softc { /* * Second set of flags. */ - u_int32_t sc_use_ent : 1; + u_int32_t sc_use_ent : 1, + sc_rx_stbc : 1, + sc_tx_stbc : 1; /* * Enterprise mode configuration for AR9380 and later chipsets. |