DragonOS/kernel/driver/disk/block_device.h
2022-04-02 19:14:35 +08:00

41 lines
862 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "../../common/glib.h"
#include "stdint.h"
struct block_device_operation
{
long (*open)();
long (*close)();
long (*ioctl)(long cmd, long arg);
long (*transfer)(long cmd, ul LBA_start, ul count, uint64_t buffer, uint8_t arg0, uint8_t arg1);
};
/**
* @brief 块设备请求队列内的packet
*
*/
struct block_device_request_packet
{
uchar cmd;
uint64_t LBA_start;
uint32_t count;
uint64_t buffer_vaddr;
uint8_t ahci_ctrl_num; // ahci控制器号 默认应为0
uint8_t port_num; // ahci的设备端口号
void (*end_handler)(ul num, ul arg);
struct List list;
};
/**
* @brief 块设备的请求队列
*
*/
struct block_device_request_queue
{
struct List queue_list;
struct block_device_request_packet * in_service; // 正在请求的结点
ul request_count;
};