Changeset 07039850 in mainline for uspace/lib/ata/src/ata.c


Ignore:
Timestamp:
2025-03-05T21:41:03Z (16 hours ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Parents:
a64970e1
Message:

Implement quiesce in ISA and PCI IDE and in PC Floppy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ata/src/ata.c

    ra64970e1 r07039850  
    8484static uint8_t ata_read_cmd_8(ata_channel_t *, uint16_t);
    8585static void ata_write_cmd_8(ata_channel_t *, uint16_t, uint8_t);
     86static void ata_write_ctl_8(ata_channel_t *, uint16_t, uint8_t);
    8687
    8788static errno_t ata_bd_init_irq(ata_channel_t *);
     
    279280}
    280281
     282/** Quiesce ATA channel. */
     283void ata_channel_quiesce(ata_channel_t *chan)
     284{
     285        ata_msg_debug(chan, ": ata_channel_quiesce()");
     286
     287        fibril_mutex_lock(&chan->lock);
     288        ata_write_ctl_8(chan, REG_DEVCTL, DCR_SRST | DCR_nIEN);
     289        fibril_mutex_unlock(&chan->lock);
     290}
     291
    281292/** Add ATA device.
    282293 *
     
    348359{
    349360        return chan->params.write_cmd_8(chan->params.arg, port, value);
     361}
     362
     363/** Write 8 bits to 8-bit control port.
     364 *
     365 * @param chan ATA channel
     366 * @param port Port number
     367 * @param value Register value
     368 */
     369static void ata_write_ctl_8(ata_channel_t *chan, uint16_t port, uint8_t value)
     370{
     371        return chan->params.write_ctl_8(chan->params.arg, port, value);
    350372}
    351373
Note: See TracChangeset for help on using the changeset viewer.