Stop command engine
| 395 | |
| 396 | // Stop command engine |
| 397 | inline void stopCMD(hba_port_t *port) |
| 398 | { |
| 399 | // Clear ST (bit0) |
| 400 | port->cmd &= ~HBA_PxCMD_ST; |
| 401 | |
| 402 | // Wait until FR (bit14), CR (bit15) are cleared |
| 403 | while(1) |
| 404 | { |
| 405 | if (port->cmd & HBA_PxCMD_CR) |
| 406 | continue; |
| 407 | break; |
| 408 | } |
| 409 | |
| 410 | // Clear FRE (bit4) |
| 411 | port->cmd &= ~HBA_PxCMD_FRE; |
| 412 | } |
| 413 | } |