Changeset 64cf7a3 in mainline for uspace/drv/block/ata_bd/ata_bd.h


Ignore:
Timestamp:
2024-05-06T18:33:22Z (8 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
2791fbb7
Parents:
21989e5
Message:

ATA Block Driver support for IRQ

You can fall back to PIO mode by not assigning an IRQ resource to
the driver instance.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/ata_bd/ata_bd.h

    r21989e5 r64cf7a3  
    11/*
    2  * Copyright (c) 2009 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4040#include <ddf/driver.h>
    4141#include <fibril_synch.h>
     42#include <stdbool.h>
    4243#include <str.h>
    4344#include <stdint.h>
     
    4748#define NAME "ata_bd"
    4849
    49 /** Base addresses for ATA I/O blocks. */
     50/** ATA hardware resources */
    5051typedef struct {
    5152        uintptr_t cmd;  /**< Command block base address. */
    5253        uintptr_t ctl;  /**< Control block base address. */
    53 } ata_base_t;
     54        int irq;        /**< IRQ */
     55} ata_hwres_t;
    5456
    5557/** Timeout definitions. Unit is 10 ms. */
     
    140142        /** Control registers */
    141143        ata_ctl_t *ctl;
     144        /** IRQ (-1 if not used) */
     145        int irq;
     146        /** IRQ handle */
     147        cap_irq_handle_t ihandle;
    142148
    143149        /** Per-disk state. */
    144150        disk_t disk[MAX_DISKS];
    145151
     152        /** Synchronize controller access */
    146153        fibril_mutex_t lock;
     154        /** Synchronize access to irq_fired/irq_status */
     155        fibril_mutex_t irq_lock;
     156        /** Signalled by IRQ handler */
     157        fibril_condvar_t irq_cv;
     158        /** Set to true when interrupt occurs */
     159        bool irq_fired;
     160        /** Value of status register read by interrupt handler */
     161        uint8_t irq_status;
    147162} ata_ctrl_t;
    148163
     
    153168} ata_fun_t;
    154169
    155 extern errno_t ata_ctrl_init(ata_ctrl_t *, ata_base_t *);
     170extern errno_t ata_ctrl_init(ata_ctrl_t *, ata_hwres_t *);
    156171extern errno_t ata_ctrl_remove(ata_ctrl_t *);
    157172extern errno_t ata_ctrl_gone(ata_ctrl_t *);
Note: See TracChangeset for help on using the changeset viewer.