1186 /* free the soft state. */
1187 ddi_soft_state_free(ahci_statep, instance);
1188
1189 return (DDI_SUCCESS);
1190
1191 case DDI_SUSPEND:
1192
1193 /*
1194 * The steps associated with suspension must include putting
1195 * the underlying device into a quiescent state so that it
1196 * will not generate interrupts or modify or access memory.
1197 */
1198 mutex_enter(&ahci_ctlp->ahcictl_mutex);
1199 if (ahci_ctlp->ahcictl_flags & AHCI_SUSPEND) {
1200 mutex_exit(&ahci_ctlp->ahcictl_mutex);
1201 return (DDI_SUCCESS);
1202 }
1203
1204 ahci_ctlp->ahcictl_flags |= AHCI_SUSPEND;
1205
1206 ahci_em_suspend(ahci_ctlp);
1207
1208 /* stop the watchdog handler */
1209 if (ahci_ctlp->ahcictl_timeout_id) {
1210 (void) untimeout(ahci_ctlp->ahcictl_timeout_id);
1211 ahci_ctlp->ahcictl_timeout_id = 0;
1212 }
1213
1214 mutex_exit(&ahci_ctlp->ahcictl_mutex);
1215
1216 /*
1217 * drain the taskq
1218 */
1219 ahci_drain_ports_taskq(ahci_ctlp);
1220
1221 /*
1222 * Disable the interrupts and stop all the ports.
1223 */
1224 ahci_uninitialize_controller(ahci_ctlp);
1225
1226 return (DDI_SUCCESS);
1227
1228 default:
1229 return (DDI_FAILURE);
1230 }
1231 }
1232
1233 /*
1234 * The info entry point for dev_ops.
1235 *
|
1186 /* free the soft state. */
1187 ddi_soft_state_free(ahci_statep, instance);
1188
1189 return (DDI_SUCCESS);
1190
1191 case DDI_SUSPEND:
1192
1193 /*
1194 * The steps associated with suspension must include putting
1195 * the underlying device into a quiescent state so that it
1196 * will not generate interrupts or modify or access memory.
1197 */
1198 mutex_enter(&ahci_ctlp->ahcictl_mutex);
1199 if (ahci_ctlp->ahcictl_flags & AHCI_SUSPEND) {
1200 mutex_exit(&ahci_ctlp->ahcictl_mutex);
1201 return (DDI_SUCCESS);
1202 }
1203
1204 ahci_ctlp->ahcictl_flags |= AHCI_SUSPEND;
1205
1206 /* stop the watchdog handler */
1207 if (ahci_ctlp->ahcictl_timeout_id) {
1208 (void) untimeout(ahci_ctlp->ahcictl_timeout_id);
1209 ahci_ctlp->ahcictl_timeout_id = 0;
1210 }
1211
1212 mutex_exit(&ahci_ctlp->ahcictl_mutex);
1213
1214 ahci_em_suspend(ahci_ctlp);
1215
1216 /*
1217 * drain the taskq
1218 */
1219 ahci_drain_ports_taskq(ahci_ctlp);
1220
1221 /*
1222 * Disable the interrupts and stop all the ports.
1223 */
1224 ahci_uninitialize_controller(ahci_ctlp);
1225
1226 return (DDI_SUCCESS);
1227
1228 default:
1229 return (DDI_FAILURE);
1230 }
1231 }
1232
1233 /*
1234 * The info entry point for dev_ops.
1235 *
|