diff options
author | Konstantin Ananyev <Konstantin.Ananyev@Sun.COM> | 2008-10-10 17:28:08 -0700 |
---|---|---|
committer | Konstantin Ananyev <Konstantin.Ananyev@Sun.COM> | 2008-10-10 17:28:08 -0700 |
commit | b9ee76db3dd20a04fb00f5d885ffb58006c581bf (patch) | |
tree | 9c68d30d7b491a0439fd62fa7a826a6be15f049d /usr/src | |
parent | 799aa485da68fdaa1850eaf833ad108e5af82adb (diff) | |
download | illumos-joyent-b9ee76db3dd20a04fb00f5d885ffb58006c581bf.tar.gz |
6755114 ath driver doesn't have quiesce
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/io/ath/ath_main.c | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/usr/src/uts/common/io/ath/ath_main.c b/usr/src/uts/common/io/ath/ath_main.c index 034c719c5d..facfbd4788 100644 --- a/usr/src/uts/common/io/ath/ath_main.c +++ b/usr/src/uts/common/io/ath/ath_main.c @@ -2396,8 +2396,60 @@ ath_detach(dev_info_t *devinfo, ddi_detach_cmd_t cmd) return (DDI_SUCCESS); } +/* + * quiesce(9E) entry point. + * + * This function is called when the system is single-threaded at high + * PIL with preemption disabled. Therefore, this function must not be + * blocked. + * + * This function returns DDI_SUCCESS on success, or DDI_FAILURE on failure. + * DDI_FAILURE indicates an error condition and should almost never happen. + */ +static int32_t +ath_quiesce(dev_info_t *devinfo) +{ + ath_t *asc; + struct ath_hal *ah; + int i; + + asc = ddi_get_soft_state(ath_soft_state_p, ddi_get_instance(devinfo)); + + if (asc == NULL || (ah = asc->asc_ah) == NULL) + return (DDI_FAILURE); + + /* + * Disable interrupts + */ + ATH_HAL_INTRSET(ah, 0); + + /* + * Disable TX HW + */ + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(asc, i)) { + ATH_HAL_STOPTXDMA(ah, asc->asc_txq[i].axq_qnum); + } + } + + /* + * Disable RX HW + */ + ATH_HAL_STOPPCURECV(ah); + ATH_HAL_SETRXFILTER(ah, 0); + ATH_HAL_STOPDMARECV(ah); + drv_usecwait(3000); + + /* + * Power down HW + */ + ATH_HAL_PHYDISABLE(ah); + + return (DDI_SUCCESS); +} + DDI_DEFINE_STREAM_OPS(ath_dev_ops, nulldev, nulldev, ath_attach, ath_detach, - nodev, NULL, D_MP, NULL, ddi_quiesce_not_supported); + nodev, NULL, D_MP, NULL, ath_quiesce); static struct modldrv ath_modldrv = { &mod_driverops, /* Type of module. This one is a driver */ |