| 382 | int Init(); |
| 383 | |
| 384 | inline void startCMD(hba_port_t *port) |
| 385 | { |
| 386 | port->cmd &= ~HBA_PxCMD_ST; |
| 387 | |
| 388 | // Wait until CR (bit15) is cleared |
| 389 | while (port->cmd & HBA_PxCMD_CR); |
| 390 | |
| 391 | // Set FRE (bit4) and ST (bit0) |
| 392 | port->cmd |= HBA_PxCMD_FRE; |
| 393 | port->cmd |= HBA_PxCMD_ST; |
| 394 | } |
| 395 | |
| 396 | // Stop command engine |
| 397 | inline void stopCMD(hba_port_t *port) |