Replaced "ide_channel_cookie channel" and "ide_adapter_channel_info *" with "void *channel_cookie".
This improves abstraction and allows bus drivers that are independant of ide_adapter. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18794 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -298,9 +298,6 @@ enum {
|
||||
} ide_error_mask;
|
||||
|
||||
|
||||
typedef struct ide_channel_info *ide_channel_cookie;
|
||||
|
||||
|
||||
// Controller Driver Node
|
||||
|
||||
// attributes:
|
||||
@@ -322,21 +319,21 @@ typedef struct {
|
||||
driver_module_info info;
|
||||
|
||||
status_t (*write_command_block_regs)
|
||||
(ide_channel_cookie channel, ide_task_file *tf, ide_reg_mask mask);
|
||||
(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask);
|
||||
status_t (*read_command_block_regs)
|
||||
(ide_channel_cookie channel, ide_task_file *tf, ide_reg_mask mask);
|
||||
(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask);
|
||||
|
||||
uint8 (*get_altstatus) (ide_channel_cookie channel);
|
||||
status_t (*write_device_control) (ide_channel_cookie channel, uint8 val);
|
||||
uint8 (*get_altstatus) (void *channel_cookie);
|
||||
status_t (*write_device_control) (void *channel_cookie, uint8 val);
|
||||
|
||||
status_t (*write_pio) (ide_channel_cookie channel, uint16 *data, int count, bool force_16bit );
|
||||
status_t (*read_pio) (ide_channel_cookie channel, uint16 *data, int count, bool force_16bit );
|
||||
status_t (*write_pio) (void *channel_cookie, uint16 *data, int count, bool force_16bit );
|
||||
status_t (*read_pio) (void *channel_cookie, uint16 *data, int count, bool force_16bit );
|
||||
|
||||
status_t (*prepare_dma)(ide_channel_cookie channel,
|
||||
status_t (*prepare_dma)(void *channel_cookie,
|
||||
const physical_entry *sg_list, size_t sg_list_count,
|
||||
bool write);
|
||||
status_t (*start_dma)(ide_channel_cookie channel);
|
||||
status_t (*finish_dma)(ide_channel_cookie channel);
|
||||
status_t (*start_dma)(void *channel_cookie);
|
||||
status_t (*finish_dma)(void *channel_cookie);
|
||||
} ide_controller_interface;
|
||||
|
||||
|
||||
|
||||
@@ -322,21 +322,21 @@ typedef struct {
|
||||
driver_module_info info;
|
||||
|
||||
status_t (*write_command_block_regs)
|
||||
(ide_channel_cookie channel, ide_task_file *tf, ide_reg_mask mask);
|
||||
(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask);
|
||||
status_t (*read_command_block_regs)
|
||||
(ide_channel_cookie channel, ide_task_file *tf, ide_reg_mask mask);
|
||||
(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask);
|
||||
|
||||
uint8 (*get_altstatus) (ide_channel_cookie channel);
|
||||
status_t (*write_device_control) (ide_channel_cookie channel, uint8 val);
|
||||
uint8 (*get_altstatus) (void *channel_cookie);
|
||||
status_t (*write_device_control) (void *channel_cookie, uint8 val);
|
||||
|
||||
status_t (*write_pio) (ide_channel_cookie channel, uint16 *data, int count, bool force_16bit );
|
||||
status_t (*read_pio) (ide_channel_cookie channel, uint16 *data, int count, bool force_16bit );
|
||||
status_t (*write_pio) (void *channel_cookie, uint16 *data, int count, bool force_16bit );
|
||||
status_t (*read_pio) (void *channel_cookie, uint16 *data, int count, bool force_16bit );
|
||||
|
||||
status_t (*prepare_dma)(ide_channel_cookie channel,
|
||||
status_t (*prepare_dma)(void *channel_cookie,
|
||||
const physical_entry *sg_list, size_t sg_list_count,
|
||||
bool write);
|
||||
status_t (*start_dma)(ide_channel_cookie channel);
|
||||
status_t (*finish_dma)(ide_channel_cookie channel);
|
||||
status_t (*start_dma)(void *channel_cookie);
|
||||
status_t (*finish_dma)(void *channel_cookie);
|
||||
} ide_controller_interface;
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ check_rw_status(ide_device_info *device, bool drqStatus)
|
||||
ide_bus_info *bus = device->bus;
|
||||
int status;
|
||||
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
|
||||
if ((status & ide_status_bsy) != 0) {
|
||||
device->subsys_status = SCSI_SEQUENCE_FAIL;
|
||||
@@ -459,12 +459,12 @@ check_rw_error(ide_device_info *device, ide_qrequest *qrequest)
|
||||
ide_bus_info *bus = device->bus;
|
||||
uint8 status;
|
||||
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
|
||||
if ((status & ide_status_err) != 0) {
|
||||
uint8 error;
|
||||
|
||||
if (bus->controller->read_command_block_regs(bus->channel,
|
||||
if (bus->controller->read_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_error) != B_OK) {
|
||||
device->subsys_status = SCSI_HBA_ERR;
|
||||
return true;
|
||||
@@ -546,7 +546,7 @@ check_output(ide_device_info *device, bool drdy_required,
|
||||
return false;
|
||||
}
|
||||
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
|
||||
// if device is busy, other flags are indeterminate
|
||||
if ((status & ide_status_bsy) != 0) {
|
||||
@@ -562,7 +562,7 @@ check_output(ide_device_info *device, bool drdy_required,
|
||||
if ((status & ide_status_err) != 0) {
|
||||
uint8 error;
|
||||
|
||||
if (bus->controller->read_command_block_regs(bus->channel,
|
||||
if (bus->controller->read_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_error) != B_OK) {
|
||||
device->subsys_status = SCSI_HBA_ERR;
|
||||
return false;
|
||||
@@ -658,7 +658,7 @@ configure_rmsn(ide_device_info *device)
|
||||
if (!device_set_feature(device, IDE_CMD_SET_FEATURES_ENABLE_MSN))
|
||||
return false;
|
||||
|
||||
bus->controller->read_command_block_regs(bus->channel, &device->tf,
|
||||
bus->controller->read_command_block_regs(bus->channel_cookie, &device->tf,
|
||||
ide_mask_LBA_mid | ide_mask_LBA_high);
|
||||
|
||||
for (i = 0; i < 5; ++i) {
|
||||
|
||||
@@ -36,14 +36,14 @@ check_packet_error(ide_device_info *device, ide_qrequest *qrequest)
|
||||
ide_bus_info *bus = device->bus;
|
||||
int status;
|
||||
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
|
||||
if ((status & (ide_status_err | ide_status_df)) != 0) {
|
||||
int error;
|
||||
|
||||
SHOW_FLOW(3, "packet error, status=%02x", status);
|
||||
|
||||
if (bus->controller->read_command_block_regs(bus->channel,
|
||||
if (bus->controller->read_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_error) != B_OK) {
|
||||
device->subsys_status = SCSI_HBA_ERR;
|
||||
return true;
|
||||
@@ -101,10 +101,10 @@ packet_dpc(ide_qrequest *qrequest)
|
||||
|
||||
SHOW_FLOW0(3, "");
|
||||
|
||||
bus->controller->read_command_block_regs(bus->channel,
|
||||
bus->controller->read_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_error | ide_mask_ireason);
|
||||
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
|
||||
if (qrequest->packet_irq) {
|
||||
// device requests packet
|
||||
@@ -120,7 +120,7 @@ packet_dpc(ide_qrequest *qrequest)
|
||||
start_waiting_nolock(device->bus, timeout, ide_state_async_waiting);
|
||||
|
||||
// send packet
|
||||
if (bus->controller->write_pio(bus->channel,
|
||||
if (bus->controller->write_pio(bus->channel_cookie,
|
||||
(uint16 *)device->packet, sizeof(device->packet) / sizeof(uint16),
|
||||
true) != B_OK) {
|
||||
SHOW_ERROR0( 1, "Error sending command packet" );
|
||||
@@ -209,7 +209,7 @@ packet_dpc(ide_qrequest *qrequest)
|
||||
}
|
||||
|
||||
// ask device how much data it wants to transmit
|
||||
bus->controller->read_command_block_regs(bus->channel,
|
||||
bus->controller->read_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_byte_count);
|
||||
|
||||
length = device->tf.packet_res.byte_count_0_7
|
||||
@@ -371,7 +371,7 @@ send_packet(ide_device_info *device, ide_qrequest *qrequest, bool write)
|
||||
SHOW_FLOW0(3, "6");
|
||||
|
||||
// make sure device really asks for command packet
|
||||
bus->controller->read_command_block_regs(bus->channel, &device->tf,
|
||||
bus->controller->read_command_block_regs(bus->channel_cookie, &device->tf,
|
||||
ide_mask_ireason);
|
||||
|
||||
if (!device->tf.packet_res.cmd_or_data
|
||||
@@ -393,7 +393,7 @@ send_packet(ide_device_info *device, ide_qrequest *qrequest, bool write)
|
||||
// sent (avoid sending 16 bits as controller may transmit 32 bit chunks)
|
||||
|
||||
// write packet
|
||||
if (bus->controller->write_pio(bus->channel,
|
||||
if (bus->controller->write_pio(bus->channel_cookie,
|
||||
(uint16 *)device->packet, sizeof(device->packet) / sizeof(uint16) - 2,
|
||||
true) != B_OK) {
|
||||
goto err_packet;
|
||||
@@ -401,7 +401,7 @@ send_packet(ide_device_info *device, ide_qrequest *qrequest, bool write)
|
||||
|
||||
IDE_LOCK(bus);
|
||||
|
||||
if (bus->controller->write_pio(bus->channel,
|
||||
if (bus->controller->write_pio(bus->channel_cookie,
|
||||
(uint16 *)device->packet + sizeof(device->packet) / sizeof(uint16) - 2,
|
||||
2, true) != B_OK) {
|
||||
goto err_packet2;
|
||||
|
||||
@@ -62,7 +62,7 @@ reset_bus(ide_device_info *device, ide_qrequest *ignore)
|
||||
{
|
||||
ide_bus_info *bus = device->bus;
|
||||
ide_controller_interface *controller = bus->controller;
|
||||
ide_channel_cookie channel = bus->channel;
|
||||
ide_channel_cookie channel = bus->channel_cookie;
|
||||
|
||||
FAST_LOG0(bus->log, ev_ide_reset_bus);
|
||||
|
||||
@@ -147,7 +147,7 @@ reset_device(ide_device_info *device, ide_qrequest *ignore)
|
||||
}
|
||||
|
||||
// select device
|
||||
if (bus->controller->write_command_block_regs(bus->channel, &device->tf,
|
||||
if (bus->controller->write_command_block_regs(bus->channel_cookie, &device->tf,
|
||||
ide_mask_device_head) != B_OK)
|
||||
goto err;
|
||||
|
||||
@@ -157,7 +157,7 @@ reset_device(ide_device_info *device, ide_qrequest *ignore)
|
||||
// send device reset, independ of current device state
|
||||
// (that's the point of a reset)
|
||||
device->tf.write.command = IDE_CMD_DEVICE_RESET;
|
||||
res = bus->controller->write_command_block_regs(bus->channel,
|
||||
res = bus->controller->write_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_command);
|
||||
device->tf.write.command = orig_command;
|
||||
|
||||
@@ -211,7 +211,7 @@ retry:
|
||||
// XXX can we avoid that with the IDE_LOCK trick? It would
|
||||
// save some work and the bug workaround!
|
||||
if (irq_guard) {
|
||||
if (bus->controller->write_device_control(bus->channel,
|
||||
if (bus->controller->write_device_control(bus->channel_cookie,
|
||||
ide_devctrl_nien | ide_devctrl_bit3) != B_OK)
|
||||
goto err;
|
||||
|
||||
@@ -219,7 +219,7 @@ retry:
|
||||
}
|
||||
|
||||
// select device
|
||||
if (bus->controller->write_command_block_regs(bus->channel, &device->tf,
|
||||
if (bus->controller->write_command_block_regs(bus->channel_cookie, &device->tf,
|
||||
ide_mask_device_head) != B_OK)
|
||||
goto err;
|
||||
|
||||
@@ -230,7 +230,7 @@ retry:
|
||||
|
||||
SHOW_FLOW0(1, "device is not ready");
|
||||
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
if (status == 0xff) {
|
||||
// there is no device (should happen during detection only)
|
||||
SHOW_FLOW0(1, "there is no device");
|
||||
@@ -255,14 +255,14 @@ retry:
|
||||
}
|
||||
|
||||
if (need_drdy
|
||||
&& (bus->controller->get_altstatus(bus->channel) & ide_status_drdy) == 0) {
|
||||
&& (bus->controller->get_altstatus(bus->channel_cookie) & ide_status_drdy) == 0) {
|
||||
SHOW_FLOW0(3, "drdy not set");
|
||||
device->subsys_status = SCSI_SEQUENCE_FAIL;
|
||||
return false;
|
||||
}
|
||||
|
||||
// write parameters
|
||||
if (bus->controller->write_command_block_regs(bus->channel, &device->tf,
|
||||
if (bus->controller->write_command_block_regs(bus->channel_cookie, &device->tf,
|
||||
device->tf_param_mask) != B_OK)
|
||||
goto err;
|
||||
|
||||
@@ -293,14 +293,14 @@ retry:
|
||||
|
||||
if (irq_guard) {
|
||||
// now it's clear why IRQs gets fired, so we can enable them again
|
||||
if (bus->controller->write_device_control(bus->channel,
|
||||
if (bus->controller->write_device_control(bus->channel_cookie,
|
||||
ide_devctrl_bit3) != B_OK)
|
||||
goto err1;
|
||||
}
|
||||
|
||||
// write command code - this will start the actual command
|
||||
SHOW_FLOW(3, "Writing command 0x%02x", (int)device->tf.write.command);
|
||||
if (bus->controller->write_command_block_regs(bus->channel,
|
||||
if (bus->controller->write_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_command) != B_OK)
|
||||
goto err1;
|
||||
|
||||
@@ -345,7 +345,7 @@ ide_wait(ide_device_info *device, int mask, int not_mask,
|
||||
// to update its status register
|
||||
spin(1);
|
||||
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
|
||||
if ((status & mask) == mask && (status & not_mask) == 0)
|
||||
return true;
|
||||
@@ -390,7 +390,7 @@ device_start_service(ide_device_info *device, int *tag)
|
||||
if (bus->active_device != device) {
|
||||
// don't apply any precautions in terms of IRQ
|
||||
// -> the bus is in accessing state, so IRQs are ignored anyway
|
||||
if (bus->controller->write_command_block_regs(bus->channel,
|
||||
if (bus->controller->write_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_device_head) != B_OK)
|
||||
// on error, pretend that this device asks for service
|
||||
// -> the disappeared controller will be recognized soon ;)
|
||||
@@ -403,7 +403,7 @@ device_start_service(ide_device_info *device, int *tag)
|
||||
}
|
||||
|
||||
// here we go...
|
||||
if (bus->controller->write_command_block_regs(bus->channel, &device->tf,
|
||||
if (bus->controller->write_command_block_regs(bus->channel_cookie, &device->tf,
|
||||
ide_mask_command) != B_OK)
|
||||
goto err;
|
||||
|
||||
@@ -412,7 +412,7 @@ device_start_service(ide_device_info *device, int *tag)
|
||||
return false;
|
||||
|
||||
// read tag
|
||||
if (bus->controller->read_command_block_regs(bus->channel, &device->tf,
|
||||
if (bus->controller->read_command_block_regs(bus->channel_cookie, &device->tf,
|
||||
ide_mask_sector_count) != B_OK)
|
||||
goto err;
|
||||
|
||||
@@ -448,7 +448,7 @@ check_service_req(ide_device_info *device)
|
||||
if (bus->active_device != device) {
|
||||
// don't apply any precautions in terms of IRQ
|
||||
// -> the bus is in accessing state, so IRQs are ignored anyway
|
||||
if (bus->controller->write_command_block_regs(bus->channel,
|
||||
if (bus->controller->write_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_device_head) != B_OK)
|
||||
// on error, pretend that this device asks for service
|
||||
// -> the disappeared controller will be recognized soon ;)
|
||||
@@ -460,7 +460,7 @@ check_service_req(ide_device_info *device)
|
||||
spin(1);
|
||||
}
|
||||
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
|
||||
return (status & ide_status_service) != 0;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ scan_device_int(ide_device_info *device, bool atapi)
|
||||
|
||||
// initialize device selection flags,
|
||||
// this is the only place where this bit gets initialized in the task file
|
||||
if (bus->controller->read_command_block_regs(bus->channel, &device->tf,
|
||||
if (bus->controller->read_command_block_regs(bus->channel_cookie, &device->tf,
|
||||
ide_mask_device_head) != B_OK)
|
||||
return false;
|
||||
|
||||
@@ -218,7 +218,7 @@ scan_device_int(ide_device_info *device, bool atapi)
|
||||
// check the busy flag - if it's still set, there's probably no device
|
||||
IDE_LOCK(bus);
|
||||
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
SHOW_FLOW(3, "status=%x", (int)status);
|
||||
cont = (status & ide_status_bsy) == ide_status_bsy;
|
||||
|
||||
@@ -250,7 +250,7 @@ scan_device_int(ide_device_info *device, bool atapi)
|
||||
|
||||
ide_wait(device, ide_status_drq, ide_status_bsy, true, 1000);
|
||||
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
|
||||
if ((status & ide_status_err) != 0) {
|
||||
// if there's no device, all bits including the error bit are set
|
||||
@@ -259,7 +259,7 @@ scan_device_int(ide_device_info *device, bool atapi)
|
||||
}
|
||||
|
||||
// get the infoblock
|
||||
bus->controller->read_pio(bus->channel, (uint16 *)&device->infoblock,
|
||||
bus->controller->read_pio(bus->channel_cookie, (uint16 *)&device->infoblock,
|
||||
sizeof(device->infoblock) / sizeof(uint16), false);
|
||||
|
||||
if (!wait_for_drqdown(device))
|
||||
|
||||
@@ -76,7 +76,7 @@ abort_dma(ide_device_info *device, ide_qrequest *qrequest)
|
||||
|
||||
SHOW_FLOW0(0, "");
|
||||
|
||||
bus->controller->finish_dma(bus->channel);
|
||||
bus->controller->finish_dma(bus->channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ prepare_dma(ide_device_info *device, ide_qrequest *qrequest)
|
||||
scsi_ccb *request = qrequest->request;
|
||||
status_t res;
|
||||
|
||||
res = bus->controller->prepare_dma(bus->channel, request->sg_list,
|
||||
res = bus->controller->prepare_dma(bus->channel_cookie, request->sg_list,
|
||||
request->sg_cnt, qrequest->is_write);
|
||||
|
||||
if (res != B_OK)
|
||||
@@ -109,7 +109,7 @@ start_dma_wait(ide_device_info *device, ide_qrequest *qrequest)
|
||||
{
|
||||
ide_bus_info *bus = device->bus;
|
||||
|
||||
bus->controller->start_dma(bus->channel);
|
||||
bus->controller->start_dma(bus->channel_cookie);
|
||||
|
||||
start_waiting(bus, qrequest->request->timeout > 0 ?
|
||||
qrequest->request->timeout : IDE_STD_TIMEOUT, ide_state_async_waiting);
|
||||
@@ -136,7 +136,7 @@ finish_dma(ide_device_info *device)
|
||||
ide_bus_info *bus = device->bus;
|
||||
status_t dma_res;
|
||||
|
||||
dma_res = bus->controller->finish_dma(bus->channel);
|
||||
dma_res = bus->controller->finish_dma(bus->channel_cookie);
|
||||
|
||||
return dma_res == B_OK || dma_res == B_DEV_DATA_OVERRUN;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ struct ide_bus_info {
|
||||
|
||||
// controller
|
||||
ide_controller_interface *controller;
|
||||
ide_channel_cookie channel;
|
||||
void *channel_cookie;
|
||||
|
||||
// lock, used for changes of bus state
|
||||
spinlock lock;
|
||||
@@ -294,7 +294,7 @@ ide_device_info *get_current_device(ide_bus_info *bus)
|
||||
{
|
||||
ide_task_file tf;
|
||||
|
||||
bus->controller->read_command_block_regs(bus->channel, &tf,
|
||||
bus->controller->read_command_block_regs(bus->channel_cookie, &tf,
|
||||
ide_mask_device_head);
|
||||
|
||||
return bus->devices[tf.lba.device];
|
||||
@@ -308,7 +308,7 @@ device_released_bus(ide_device_info *device)
|
||||
{
|
||||
ide_bus_info *bus = device->bus;
|
||||
|
||||
bus->controller->read_command_block_regs(bus->channel,
|
||||
bus->controller->read_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_sector_count);
|
||||
|
||||
return device->tf.queued.release;
|
||||
|
||||
@@ -660,7 +660,7 @@ ide_sim_init_bus(device_node_handle node, void *user_cookie, void **cookie)
|
||||
parent = pnp->get_parent(node);
|
||||
|
||||
status = pnp->init_driver(parent, bus, (driver_module_info **)&bus->controller,
|
||||
(void **)&bus->channel);
|
||||
(void **)&bus->channel_cookie);
|
||||
|
||||
pnp->put_device_node(parent);
|
||||
if (status != B_OK)
|
||||
|
||||
@@ -71,7 +71,7 @@ transfer_PIO_virtcont(ide_device_info *device, uint8 *virtualAddress, int length
|
||||
{
|
||||
ide_bus_info *bus = device->bus;
|
||||
ide_controller_interface *controller = bus->controller;
|
||||
ide_channel_cookie cookie = bus->channel;
|
||||
void * channel_cookie = bus->channel_cookie;
|
||||
|
||||
if (write) {
|
||||
// if there is a byte left from last chunk, transmit it together
|
||||
@@ -83,13 +83,13 @@ transfer_PIO_virtcont(ide_device_info *device, uint8 *virtualAddress, int length
|
||||
buffer[0] = device->odd_byte;
|
||||
buffer[1] = *virtualAddress++;
|
||||
|
||||
controller->write_pio(cookie, (uint16 *)buffer, 1, false);
|
||||
controller->write_pio(channel_cookie, (uint16 *)buffer, 1, false);
|
||||
|
||||
--length;
|
||||
*transferred += 2;
|
||||
}
|
||||
|
||||
controller->write_pio(cookie, (uint16 *)virtualAddress, length / 2, false);
|
||||
controller->write_pio(channel_cookie, (uint16 *)virtualAddress, length / 2, false);
|
||||
|
||||
// take care if chunk size was odd, which means that 1 byte remains
|
||||
virtualAddress += length & ~1;
|
||||
@@ -108,7 +108,7 @@ transfer_PIO_virtcont(ide_device_info *device, uint8 *virtualAddress, int length
|
||||
|
||||
SHOW_FLOW(4, "Reading PIO to %p, %d bytes", virtualAddress, length);
|
||||
|
||||
controller->read_pio(cookie, (uint16 *)virtualAddress, length / 2, false);
|
||||
controller->read_pio(channel_cookie, (uint16 *)virtualAddress, length / 2, false);
|
||||
|
||||
// take care of odd chunk size;
|
||||
// in this case we read 1 byte to few!
|
||||
@@ -122,7 +122,7 @@ transfer_PIO_virtcont(ide_device_info *device, uint8 *virtualAddress, int length
|
||||
|
||||
// now read the missing byte; as we have to read 2 bytes at once,
|
||||
// we'll read one byte too much
|
||||
controller->read_pio(cookie, (uint16 *)buffer, 1, false);
|
||||
controller->read_pio(channel_cookie, (uint16 *)buffer, 1, false);
|
||||
|
||||
*virtualAddress = buffer[0];
|
||||
device->odd_byte = buffer[1];
|
||||
@@ -247,7 +247,7 @@ write_discard_PIO(ide_device_info *device, int length)
|
||||
// make length even (this is the "length + 1" term)
|
||||
cur_len = min(length + 1, (int)(sizeof(buffer))) / 2;
|
||||
|
||||
bus->controller->write_pio(bus->channel, (uint16 *)buffer, cur_len, false);
|
||||
bus->controller->write_pio(bus->channel_cookie, (uint16 *)buffer, cur_len, false);
|
||||
|
||||
length -= cur_len * 2;
|
||||
}
|
||||
@@ -269,7 +269,7 @@ read_discard_PIO(ide_device_info *device, int length)
|
||||
// read extra byte if length is odd (that's the "length + 1")
|
||||
cur_len = min(length + 1, (int)sizeof(buffer)) / 2;
|
||||
|
||||
bus->controller->read_pio(bus->channel, (uint16 *)buffer, cur_len, false);
|
||||
bus->controller->read_pio(bus->channel_cookie, (uint16 *)buffer, cur_len, false);
|
||||
|
||||
length -= cur_len * 2;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ write_PIO_block(ide_qrequest *qrequest, int length)
|
||||
qrequest->request->data_resid -= 1;
|
||||
transferred += 2;
|
||||
|
||||
device->bus->controller->write_pio(device->bus->channel, (uint16 *)buffer, 1, false);
|
||||
device->bus->controller->write_pio(device->bus->channel_cookie, (uint16 *)buffer, 1, false);
|
||||
}
|
||||
|
||||
// "transferred" may actually be larger then length because the last odd-byte
|
||||
|
||||
@@ -350,12 +350,12 @@ send_abort_queue(ide_device_info *device)
|
||||
goto err;
|
||||
|
||||
// device must answer "command rejected" and discard outstanding commands
|
||||
status = bus->controller->get_altstatus(bus->channel);
|
||||
status = bus->controller->get_altstatus(bus->channel_cookie);
|
||||
|
||||
if ((status & ide_status_err) == 0)
|
||||
goto err;
|
||||
|
||||
if (!bus->controller->read_command_block_regs(bus->channel,
|
||||
if (!bus->controller->read_command_block_regs(bus->channel_cookie,
|
||||
&device->tf, ide_mask_error)) {
|
||||
// don't bother trying bus_reset as controller disappeared
|
||||
device->subsys_status = SCSI_HBA_ERR;
|
||||
|
||||
@@ -33,95 +33,92 @@ static ide_adapter_interface *ide_adapter;
|
||||
device_manager_info *pnp;
|
||||
|
||||
|
||||
static int
|
||||
write_command_block_regs(ide_adapter_channel_info *channel, ide_task_file *tf,
|
||||
ide_reg_mask mask)
|
||||
static status_t
|
||||
write_command_block_regs(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask)
|
||||
{
|
||||
return ide_adapter->write_command_block_regs(channel, tf, mask);
|
||||
return ide_adapter->write_command_block_regs((ide_adapter_channel_info *)channel_cookie, tf, mask);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
read_command_block_regs(ide_adapter_channel_info *channel, ide_task_file *tf,
|
||||
ide_reg_mask mask)
|
||||
read_command_block_regs(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask)
|
||||
{
|
||||
return ide_adapter->read_command_block_regs(channel, tf, mask);
|
||||
return ide_adapter->read_command_block_regs((ide_adapter_channel_info *)channel_cookie, tf, mask);
|
||||
}
|
||||
|
||||
|
||||
static uint8
|
||||
get_altstatus(ide_adapter_channel_info *channel)
|
||||
get_altstatus(void *channel_cookie)
|
||||
{
|
||||
return ide_adapter->get_altstatus(channel);
|
||||
return ide_adapter->get_altstatus((ide_adapter_channel_info *)channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
write_device_control(ide_adapter_channel_info *channel, uint8 val)
|
||||
write_device_control(void *channel_cookie, uint8 val)
|
||||
{
|
||||
return ide_adapter->write_device_control(channel, val);
|
||||
return ide_adapter->write_device_control((ide_adapter_channel_info *)channel_cookie, val);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
write_pio(ide_adapter_channel_info *channel, uint16 *data, int count,
|
||||
bool force_16bit)
|
||||
write_pio(void *channel_cookie, uint16 *data, int count, bool force_16bit)
|
||||
{
|
||||
return ide_adapter->write_pio(channel, data, count, force_16bit);
|
||||
return ide_adapter->write_pio((ide_adapter_channel_info *)channel_cookie, data, count, force_16bit);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
read_pio(ide_adapter_channel_info *channel, uint16 *data, int count,
|
||||
bool force_16bit)
|
||||
read_pio(void *channel_cookie, uint16 *data, int count, bool force_16bit)
|
||||
{
|
||||
return ide_adapter->read_pio(channel, data, count, force_16bit);
|
||||
return ide_adapter->read_pio((ide_adapter_channel_info *)channel_cookie, data, count, force_16bit);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
prepare_dma(ide_adapter_channel_info *channel,
|
||||
prepare_dma(void *channel_cookie,
|
||||
const physical_entry *sg_list, size_t sg_list_count,
|
||||
bool to_device)
|
||||
{
|
||||
return ide_adapter->prepare_dma(channel, sg_list, sg_list_count, to_device);
|
||||
return ide_adapter->prepare_dma((ide_adapter_channel_info *)channel_cookie, sg_list, sg_list_count, to_device);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
start_dma(ide_adapter_channel_info *channel)
|
||||
start_dma(void *channel_cookie)
|
||||
{
|
||||
return ide_adapter->start_dma(channel);
|
||||
return ide_adapter->start_dma((ide_adapter_channel_info *)channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
finish_dma(ide_adapter_channel_info *channel)
|
||||
finish_dma(void *channel_cookie)
|
||||
{
|
||||
return ide_adapter->finish_dma(channel);
|
||||
return ide_adapter->finish_dma((ide_adapter_channel_info *)channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
init_channel(device_node_handle node, ide_channel ide_channel,
|
||||
ide_adapter_channel_info **cookie)
|
||||
void **channel_cookie)
|
||||
{
|
||||
return ide_adapter->init_channel(node, ide_channel, cookie,
|
||||
return ide_adapter->init_channel(node, ide_channel,
|
||||
(ide_adapter_channel_info **)channel_cookie,
|
||||
sizeof(ide_adapter_channel_info), ide_adapter->inthand);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
uninit_channel(ide_adapter_channel_info *channel)
|
||||
uninit_channel(void *channel_cookie)
|
||||
{
|
||||
return ide_adapter->uninit_channel(channel);
|
||||
return ide_adapter->uninit_channel((ide_adapter_channel_info *)channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
channel_removed(device_node_handle node, ide_adapter_channel_info *channel)
|
||||
channel_removed(device_node_handle node, void *channel_cookie)
|
||||
{
|
||||
return ide_adapter->channel_removed(node, channel);
|
||||
return ide_adapter->channel_removed(node, (ide_adapter_channel_info *)channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
@@ -231,27 +228,24 @@ static ide_controller_interface channel_interface = {
|
||||
NULL, // supports device
|
||||
NULL, // register device
|
||||
(status_t (*)(device_node_handle, void *, void **))init_channel,
|
||||
(status_t (*)(void *))uninit_channel,
|
||||
(void (*)(device_node_handle, void *))channel_removed,
|
||||
uninit_channel,
|
||||
channel_removed,
|
||||
NULL, // cleanup
|
||||
NULL, // get_paths
|
||||
},
|
||||
|
||||
(status_t (*)(ide_channel_cookie,
|
||||
ide_task_file*,ide_reg_mask)) &write_command_block_regs,
|
||||
(status_t (*)(ide_channel_cookie,
|
||||
ide_task_file*,ide_reg_mask)) &read_command_block_regs,
|
||||
&write_command_block_regs,
|
||||
&read_command_block_regs,
|
||||
|
||||
(uint8 (*)(ide_channel_cookie)) &get_altstatus,
|
||||
(status_t (*)(ide_channel_cookie,uint8)) &write_device_control,
|
||||
&get_altstatus,
|
||||
&write_device_control,
|
||||
|
||||
(status_t (*)(ide_channel_cookie,uint16*,int,bool)) &write_pio,
|
||||
(status_t (*)(ide_channel_cookie,uint16*,int,bool)) &read_pio,
|
||||
&write_pio,
|
||||
&read_pio,
|
||||
|
||||
(status_t (*)(ide_channel_cookie,
|
||||
const physical_entry *,size_t,bool)) &prepare_dma,
|
||||
(status_t (*)(ide_channel_cookie)) &start_dma,
|
||||
(status_t (*)(ide_channel_cookie)) &finish_dma,
|
||||
&prepare_dma,
|
||||
&start_dma,
|
||||
&finish_dma,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -60,11 +60,12 @@ typedef struct channel_info {
|
||||
} channel_info;
|
||||
|
||||
|
||||
static int
|
||||
write_command_block_regs(channel_info *channel, ide_task_file *tf, ide_reg_mask mask)
|
||||
static status_t
|
||||
write_command_block_regs(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask)
|
||||
{
|
||||
int i;
|
||||
channel_info *channel = channel_cookie;
|
||||
uint16 ioaddr = channel->command_block_base;
|
||||
int i;
|
||||
|
||||
if (channel->lost)
|
||||
return B_ERROR;
|
||||
@@ -86,10 +87,11 @@ write_command_block_regs(channel_info *channel, ide_task_file *tf, ide_reg_mask
|
||||
|
||||
|
||||
static status_t
|
||||
read_command_block_regs(channel_info *channel, ide_task_file *tf, ide_reg_mask mask)
|
||||
read_command_block_regs(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask)
|
||||
{
|
||||
int i;
|
||||
channel_info *channel = channel_cookie;
|
||||
uint16 ioaddr = channel->command_block_base;
|
||||
int i;
|
||||
|
||||
if (channel->lost)
|
||||
return B_ERROR;
|
||||
@@ -106,8 +108,9 @@ read_command_block_regs(channel_info *channel, ide_task_file *tf, ide_reg_mask m
|
||||
|
||||
|
||||
static uint8
|
||||
get_altstatus(channel_info *channel)
|
||||
get_altstatus(void *channel_cookie)
|
||||
{
|
||||
channel_info *channel = channel_cookie;
|
||||
uint16 altstatusaddr = channel->control_block_base;
|
||||
|
||||
if (channel->lost)
|
||||
@@ -118,8 +121,9 @@ get_altstatus(channel_info *channel)
|
||||
|
||||
|
||||
static status_t
|
||||
write_device_control(channel_info *channel, uint8 val)
|
||||
write_device_control(void *channel_cookie, uint8 val)
|
||||
{
|
||||
channel_info *channel = channel_cookie;
|
||||
uint16 device_control_addr = channel->control_block_base;
|
||||
|
||||
SHOW_FLOW(3, "%x", (int)val);
|
||||
@@ -134,8 +138,9 @@ write_device_control(channel_info *channel, uint8 val)
|
||||
|
||||
|
||||
static status_t
|
||||
write_pio_16(channel_info *channel, uint16 *data, int count, bool force_16bit)
|
||||
write_pio_16(void *channel_cookie, uint16 *data, int count, bool force_16bit)
|
||||
{
|
||||
channel_info *channel = channel_cookie;
|
||||
uint16 ioaddr = channel->command_block_base;
|
||||
|
||||
if (channel->lost)
|
||||
@@ -160,8 +165,9 @@ write_pio_16(channel_info *channel, uint16 *data, int count, bool force_16bit)
|
||||
|
||||
|
||||
static status_t
|
||||
read_pio_16(channel_info *channel, uint16 *data, int count, bool force_16bit)
|
||||
read_pio_16(void *channel_cookie, uint16 *data, int count, bool force_16bit)
|
||||
{
|
||||
channel_info *channel = channel_cookie;
|
||||
uint16 ioaddr = channel->command_block_base;
|
||||
|
||||
if (channel->lost)
|
||||
@@ -202,22 +208,23 @@ inthand(void *arg)
|
||||
|
||||
|
||||
static status_t
|
||||
prepare_dma(channel_info *channel, const physical_entry *sg_list, size_t sg_list_count,
|
||||
uint32 startbyte, uint32 blocksize, size_t *numBytes, bool to_device)
|
||||
prepare_dma(void *channel_cookie,
|
||||
const physical_entry *sg_list, size_t sg_list_count,
|
||||
bool write)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
start_dma(void *channel)
|
||||
start_dma(void *channel_cookie)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
finish_dma(void *channel)
|
||||
finish_dma(void *channel_cookie)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
@@ -302,8 +309,9 @@ err0:
|
||||
|
||||
|
||||
static status_t
|
||||
uninit_channel(channel_info *channel)
|
||||
uninit_channel(void *channel_cookie)
|
||||
{
|
||||
channel_info *channel = channel_cookie;
|
||||
// disable IRQs
|
||||
write_device_control(channel, ide_devctrl_bit3 | ide_devctrl_nien);
|
||||
|
||||
@@ -403,8 +411,9 @@ register_device(device_node_handle node)
|
||||
|
||||
|
||||
static void
|
||||
channel_removed(device_node_handle node, channel_info *channel)
|
||||
channel_removed(device_node_handle node, void *channel_cookie)
|
||||
{
|
||||
channel_info *channel = channel_cookie;
|
||||
SHOW_FLOW0(3, "");
|
||||
|
||||
if (channel != NULL)
|
||||
@@ -458,27 +467,24 @@ ide_controller_interface isa_controller_interface = {
|
||||
supports_device,
|
||||
register_device,
|
||||
(status_t (*)(device_node_handle, void *, void **)) init_channel,
|
||||
(status_t (*)(void *)) uninit_channel,
|
||||
(void (*)(device_node_handle, void *)) channel_removed,
|
||||
uninit_channel,
|
||||
channel_removed,
|
||||
NULL, // cleanup
|
||||
get_paths
|
||||
},
|
||||
|
||||
(status_t (*)(ide_channel_cookie,
|
||||
ide_task_file*, ide_reg_mask)) &write_command_block_regs,
|
||||
(status_t (*)(ide_channel_cookie,
|
||||
ide_task_file*, ide_reg_mask)) &read_command_block_regs,
|
||||
|
||||
(uint8 (*)(ide_channel_cookie)) &get_altstatus,
|
||||
(status_t (*)(ide_channel_cookie, uint8)) &write_device_control,
|
||||
&write_command_block_regs,
|
||||
&read_command_block_regs,
|
||||
|
||||
(status_t (*)(ide_channel_cookie, uint16*, int, bool)) &write_pio_16,
|
||||
(status_t (*)(ide_channel_cookie, uint16*, int, bool)) &read_pio_16,
|
||||
&get_altstatus,
|
||||
&write_device_control,
|
||||
|
||||
(status_t (*)(ide_channel_cookie,
|
||||
const physical_entry *, size_t, bool)) &prepare_dma,
|
||||
(status_t (*)(ide_channel_cookie)) &start_dma,
|
||||
(status_t (*)(ide_channel_cookie)) &finish_dma,
|
||||
&write_pio_16,
|
||||
&read_pio_16,
|
||||
|
||||
&prepare_dma,
|
||||
&start_dma,
|
||||
&finish_dma,
|
||||
};
|
||||
|
||||
module_info *modules[] = {
|
||||
|
||||
@@ -31,49 +31,45 @@ static ide_adapter_interface *ide_adapter;
|
||||
static device_manager_info *pnp;
|
||||
|
||||
|
||||
static int
|
||||
write_command_block_regs(ide_adapter_channel_info *channel,
|
||||
ide_task_file *tf, ide_reg_mask mask)
|
||||
static status_t
|
||||
write_command_block_regs(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask)
|
||||
{
|
||||
return ide_adapter->write_command_block_regs(channel, tf, mask);
|
||||
return ide_adapter->write_command_block_regs((ide_adapter_channel_info *)channel_cookie, tf, mask);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
read_command_block_regs(ide_adapter_channel_info *channel,
|
||||
ide_task_file *tf, ide_reg_mask mask)
|
||||
read_command_block_regs(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask)
|
||||
{
|
||||
return ide_adapter->read_command_block_regs(channel, tf, mask);
|
||||
return ide_adapter->read_command_block_regs((ide_adapter_channel_info *)channel_cookie, tf, mask);
|
||||
}
|
||||
|
||||
|
||||
static uint8
|
||||
get_altstatus(ide_adapter_channel_info *channel)
|
||||
get_altstatus(void *channel_cookie)
|
||||
{
|
||||
return ide_adapter->get_altstatus(channel);
|
||||
return ide_adapter->get_altstatus((ide_adapter_channel_info *)channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
write_device_control(ide_adapter_channel_info *channel, uint8 val)
|
||||
write_device_control(void *channel_cookie, uint8 val)
|
||||
{
|
||||
return ide_adapter->write_device_control(channel, val);
|
||||
return ide_adapter->write_device_control((ide_adapter_channel_info *)channel_cookie, val);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
write_pio(ide_adapter_channel_info *channel, uint16 *data, int count,
|
||||
bool force_16bit)
|
||||
write_pio(void *channel_cookie, uint16 *data, int count, bool force_16bit)
|
||||
{
|
||||
return ide_adapter->write_pio(channel, data, count, force_16bit);
|
||||
return ide_adapter->write_pio((ide_adapter_channel_info *)channel_cookie, data, count, force_16bit);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
read_pio(ide_adapter_channel_info *channel, uint16 *data, int count,
|
||||
bool force_16bit)
|
||||
read_pio(void *channel_cookie, uint16 *data, int count, bool force_16bit)
|
||||
{
|
||||
return ide_adapter->read_pio(channel, data, count, force_16bit);
|
||||
return ide_adapter->read_pio((ide_adapter_channel_info *)channel_cookie, data, count, force_16bit);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,46 +110,46 @@ inthand(void *arg)
|
||||
|
||||
|
||||
static status_t
|
||||
prepare_dma(ide_adapter_channel_info *channel, const physical_entry *sg_list,
|
||||
prepare_dma(void *channel_cookie, const physical_entry *sg_list,
|
||||
size_t sg_list_count, bool to_device)
|
||||
{
|
||||
return ide_adapter->prepare_dma(channel, sg_list, sg_list_count, to_device);
|
||||
return ide_adapter->prepare_dma((ide_adapter_channel_info *)channel_cookie, sg_list, sg_list_count, to_device);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
start_dma(ide_adapter_channel_info *channel)
|
||||
start_dma(void *channel_cookie)
|
||||
{
|
||||
return ide_adapter->start_dma(channel);
|
||||
return ide_adapter->start_dma((ide_adapter_channel_info *)channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
finish_dma(ide_adapter_channel_info *channel)
|
||||
finish_dma(void *channel_cookie)
|
||||
{
|
||||
return ide_adapter->finish_dma(channel);
|
||||
return ide_adapter->finish_dma((ide_adapter_channel_info *)channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
init_channel(device_node_handle node, ide_channel ide_channel,
|
||||
ide_adapter_channel_info **cookie)
|
||||
void **channel_cookie)
|
||||
{
|
||||
return ide_adapter->init_channel(node, ide_channel, cookie,
|
||||
sizeof( ide_adapter_channel_info ), inthand);
|
||||
return ide_adapter->init_channel(node, ide_channel, (ide_adapter_channel_info **)channel_cookie,
|
||||
sizeof(ide_adapter_channel_info), inthand);
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
uninit_channel(ide_adapter_channel_info *channel)
|
||||
uninit_channel(void *channel_cookie)
|
||||
{
|
||||
return ide_adapter->uninit_channel(channel);
|
||||
return ide_adapter->uninit_channel((ide_adapter_channel_info *)channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
static void channel_removed(device_node_handle node, ide_adapter_channel_info *channel)
|
||||
static void channel_removed(device_node_handle node, void *channel_cookie)
|
||||
{
|
||||
return ide_adapter->channel_removed(node, channel);
|
||||
return ide_adapter->channel_removed(node, (ide_adapter_channel_info *)channel_cookie);
|
||||
}
|
||||
|
||||
|
||||
@@ -336,25 +332,22 @@ static ide_controller_interface channel_interface = {
|
||||
NULL, // supported devices
|
||||
NULL,
|
||||
(status_t (*)( device_node_handle , void *, void ** )) init_channel,
|
||||
(status_t (*)( void * )) uninit_channel,
|
||||
(void (*)( device_node_handle , void * )) channel_removed
|
||||
uninit_channel,
|
||||
channel_removed
|
||||
},
|
||||
|
||||
(status_t (*)(ide_channel_cookie,
|
||||
ide_task_file*,ide_reg_mask)) &write_command_block_regs,
|
||||
(status_t (*)(ide_channel_cookie,
|
||||
ide_task_file*,ide_reg_mask)) &read_command_block_regs,
|
||||
&write_command_block_regs,
|
||||
&read_command_block_regs,
|
||||
|
||||
(uint8 (*)(ide_channel_cookie)) &get_altstatus,
|
||||
(status_t (*)(ide_channel_cookie,uint8)) &write_device_control,
|
||||
&get_altstatus,
|
||||
&write_device_control,
|
||||
|
||||
(status_t (*)(ide_channel_cookie,uint16*,int,bool)) &write_pio,
|
||||
(status_t (*)(ide_channel_cookie,uint16*,int,bool)) &read_pio,
|
||||
&write_pio,
|
||||
&read_pio,
|
||||
|
||||
(status_t (*)(ide_channel_cookie,
|
||||
const physical_entry *,size_t,bool)) &prepare_dma,
|
||||
(status_t (*)(ide_channel_cookie)) &start_dma,
|
||||
(status_t (*)(ide_channel_cookie)) &finish_dma,
|
||||
&prepare_dma,
|
||||
&start_dma,
|
||||
&finish_dma,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -391,62 +391,62 @@ channel_removed(device_node_handle node, void *cookie)
|
||||
|
||||
|
||||
static status_t
|
||||
task_file_write(ide_channel_cookie channel, ide_task_file *tf, ide_reg_mask mask)
|
||||
task_file_write(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
task_file_read(ide_channel_cookie channel, ide_task_file *tf, ide_reg_mask mask)
|
||||
task_file_read(void *channel_cookie, ide_task_file *tf, ide_reg_mask mask)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
static uint8
|
||||
altstatus_read(ide_channel_cookie channel)
|
||||
altstatus_read(void *channel_cookie)
|
||||
{
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
device_control_write(ide_channel_cookie channel, uint8 val)
|
||||
device_control_write(void *channel_cookie, uint8 val)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
pio_write(ide_channel_cookie channel, uint16 *data, int count, bool force_16bit)
|
||||
pio_write(void *channel_cookie, uint16 *data, int count, bool force_16bit)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
static status_t
|
||||
pio_read(ide_channel_cookie channel, uint16 *data, int count, bool force_16bit)
|
||||
pio_read(void *channel_cookie, uint16 *data, int count, bool force_16bit)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
dma_prepare(ide_channel_cookie channel, const physical_entry *sg_list, size_t sg_list_count, bool write)
|
||||
dma_prepare(void *channel_cookie, const physical_entry *sg_list, size_t sg_list_count, bool write)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
dma_start(ide_channel_cookie channel)
|
||||
dma_start(void *channel_cookie)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
dma_finish(ide_channel_cookie channel)
|
||||
dma_finish(void *channel_cookie)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user