Add in a new driver feature to allow the TX and RX chainmask to be
overridden at attach time. Some 802.11n NICs may only have one physical antenna connected. The radios will be very upset if you try enabling radios which aren't connected to antennas. This allows hints to override the TX and RX chainmask. These hints are: hint.ath.X.rx_chainmask hint.ath.X.tx_chainmask They can be set at either boot time or in kenv before the module is loaded. This and the previous HAL commit were sponsored in late 2011 by Hobnob, Inc. Sponsored by: Hobnob, Inc.
This commit is contained in:
parent
fac2dffabb
commit
b18b86a306
@ -284,6 +284,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
|
||||
int error = 0, i;
|
||||
u_int wmodes;
|
||||
uint8_t macaddr[IEEE80211_ADDR_LEN];
|
||||
int rx_chainmask, tx_chainmask;
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid);
|
||||
|
||||
@ -633,6 +634,29 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Allow the TX and RX chainmasks to be overridden by
|
||||
* environment variables and/or device.hints.
|
||||
*
|
||||
* This must be done early - before the hardware is
|
||||
* calibrated or before the 802.11n stream calculation
|
||||
* is done.
|
||||
*/
|
||||
if (resource_int_value(device_get_name(sc->sc_dev),
|
||||
device_get_unit(sc->sc_dev), "rx_chainmask",
|
||||
&rx_chainmask) == 0) {
|
||||
device_printf(sc->sc_dev, "Setting RX chainmask to 0x%x\n",
|
||||
rx_chainmask);
|
||||
(void) ath_hal_setrxchainmask(sc->sc_ah, rx_chainmask);
|
||||
}
|
||||
if (resource_int_value(device_get_name(sc->sc_dev),
|
||||
device_get_unit(sc->sc_dev), "tx_chainmask",
|
||||
&tx_chainmask) == 0) {
|
||||
device_printf(sc->sc_dev, "Setting TX chainmask to 0x%x\n",
|
||||
tx_chainmask);
|
||||
(void) ath_hal_settxchainmask(sc->sc_ah, rx_chainmask);
|
||||
}
|
||||
|
||||
/*
|
||||
* The if_ath 11n support is completely not ready for normal use.
|
||||
* Enabling this option will likely break everything and everything.
|
||||
|
@ -888,6 +888,10 @@ void ath_intr(void *);
|
||||
(ath_hal_getcapability(_ah, HAL_CAP_RX_CHAINMASK, 0, _prxchainmask))
|
||||
#define ath_hal_gettxchainmask(_ah, _ptxchainmask) \
|
||||
(ath_hal_getcapability(_ah, HAL_CAP_TX_CHAINMASK, 0, _ptxchainmask))
|
||||
#define ath_hal_setrxchainmask(_ah, _rx) \
|
||||
(ath_hal_setcapability(_ah, HAL_CAP_RX_CHAINMASK, 1, _rx, NULL))
|
||||
#define ath_hal_settxchainmask(_ah, _tx) \
|
||||
(ath_hal_setcapability(_ah, HAL_CAP_TX_CHAINMASK, 1, _tx, NULL))
|
||||
#define ath_hal_split4ktrans(_ah) \
|
||||
(ath_hal_getcapability(_ah, HAL_CAP_SPLIT_4KB_TRANS, \
|
||||
0, NULL) == HAL_OK)
|
||||
|
Loading…
Reference in New Issue
Block a user