Changeset 07039850 in mainline for uspace/drv/block/isa-ide


Ignore:
Timestamp:
2025-03-05T21:41:03Z (12 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
1c7b0db7
Parents:
a64970e1
Message:

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

Location:
uspace/drv/block/isa-ide
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/isa-ide/isa-ide.c

    ra64970e1 r07039850  
    101101        ata_params_t params;
    102102
    103         ddf_msg(LVL_DEBUG, "isa_ide_ctrl_init()");
     103        ddf_msg(LVL_DEBUG, "isa_ide_channel_init()");
    104104
    105105        memset(&params, 0, sizeof(params));
     
    135135        irq_inited = true;
    136136
    137         ddf_msg(LVL_DEBUG, "isa_ide_ctrl_init(): Initialize IDE channel");
     137        ddf_msg(LVL_DEBUG, "isa_ide_channel_init(): Initialize IDE channel");
    138138
    139139        params.arg = (void *)chan;
     
    163163                goto error;
    164164
    165         ddf_msg(LVL_DEBUG, "isa_ide_ctrl_init: DONE");
     165        ddf_msg(LVL_DEBUG, "isa_ide_channel_init: DONE");
    166166        return EOK;
    167167error:
     
    181181        errno_t rc;
    182182
    183         ddf_msg(LVL_DEBUG, ": isa_ide_ctrl_remove()");
     183        ddf_msg(LVL_DEBUG, ": isa_ide_channel_fini()");
    184184
    185185        fibril_mutex_lock(&chan->lock);
     
    196196
    197197        return EOK;
     198}
     199
     200/** Quiesce ISA IDE channel. */
     201void isa_ide_channel_quiesce(isa_ide_channel_t *chan)
     202{
     203        ddf_msg(LVL_DEBUG, ": isa_ide_channel_quiesce()");
     204
     205        fibril_mutex_lock(&chan->lock);
     206        ata_channel_quiesce(chan->channel);
     207        fibril_mutex_unlock(&chan->lock);
    198208}
    199209
  • uspace/drv/block/isa-ide/isa-ide.h

    ra64970e1 r07039850  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    104104    unsigned, isa_ide_hwres_t *);
    105105extern errno_t isa_ide_channel_fini(isa_ide_channel_t *);
     106extern void isa_ide_channel_quiesce(isa_ide_channel_t *);
    106107
    107108#endif
  • uspace/drv/block/isa-ide/main.c

    ra64970e1 r07039850  
    4949static errno_t isa_ide_dev_remove(ddf_dev_t *dev);
    5050static errno_t isa_ide_dev_gone(ddf_dev_t *dev);
     51static errno_t isa_ide_dev_quiesce(ddf_dev_t *dev);
    5152static errno_t isa_ide_fun_online(ddf_fun_t *fun);
    5253static errno_t isa_ide_fun_offline(ddf_fun_t *fun);
     
    5556
    5657static driver_ops_t driver_ops = {
    57         .dev_add = &isa_ide_dev_add,
    58         .dev_remove = &isa_ide_dev_remove,
    59         .dev_gone = &isa_ide_dev_gone,
    60         .fun_online = &isa_ide_fun_online,
    61         .fun_offline = &isa_ide_fun_offline
     58        .dev_add = isa_ide_dev_add,
     59        .dev_remove = isa_ide_dev_remove,
     60        .dev_gone = isa_ide_dev_gone,
     61        .dev_quiesce = isa_ide_dev_quiesce,
     62        .fun_online = isa_ide_fun_online,
     63        .fun_offline = isa_ide_fun_offline
    6264};
    6365
     
    379381}
    380382
     383static errno_t isa_ide_dev_quiesce(ddf_dev_t *dev)
     384{
     385        isa_ide_ctrl_t *ctrl = (isa_ide_ctrl_t *)ddf_dev_data_get(dev);
     386
     387        ddf_msg(LVL_DEBUG, "isa_ide_dev_quiesce(%p)", dev);
     388
     389        isa_ide_channel_quiesce(&ctrl->channel[0]);
     390        isa_ide_channel_quiesce(&ctrl->channel[1]);
     391        return EOK;
     392}
     393
    381394static errno_t isa_ide_fun_online(ddf_fun_t *fun)
    382395{
Note: See TracChangeset for help on using the changeset viewer.