diff options
author | Chris Johns <chrisj@rtems.org> | 2008-07-29 02:23:48 +0000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2008-07-29 02:23:48 +0000 |
commit | 3735f0859cbc6a3a3adcdb191b8b5f5881ccb47f (patch) | |
tree | 8342cf5e058f1a13d4d3c88df16bed3c3053ecfc /c/src/libchip/ide/ide_controller.c | |
parent | 2008-07-29 Chris Johns <chrisj@rtems.org> (diff) | |
download | rtems-3735f0859cbc6a3a3adcdb191b8b5f5881ccb47f.tar.bz2 |
2008-07-29 Chris Johns <chrisj@rtems.org>
* libchip/i2c/spi-sd-card.c: Updated to the libblock changes.
* libchip/ide/ata.c: Change to use a mutex rather than disable
pre-emption. Updated to the libblock changes.
* libchip/ide/ata_internal.h: Updated to the new chains API.
* libchip/ide/ide_controller.c: Updated to the libblock
changes. Added come debug tracing.
* libchip/ide/ide_ctrl_cfg.h, libchip/ide/ide_ctrl_io.h: Updated
to the libblock changes.
Diffstat (limited to '')
-rw-r--r-- | c/src/libchip/ide/ide_controller.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/c/src/libchip/ide/ide_controller.c b/c/src/libchip/ide/ide_controller.c index 31af233366..b4e45e8e2a 100644 --- a/c/src/libchip/ide/ide_controller.c +++ b/c/src/libchip/ide/ide_controller.c @@ -14,6 +14,9 @@ * $Id$ * */ + +#define IDE_CONTROLLER_TRACE 0 + #include <rtems/chain.h> #include <assert.h> #include <rtems/blkdev.h> @@ -21,6 +24,10 @@ #include <libchip/ide_ctrl_cfg.h> #include <libchip/ide_ctrl_io.h> +#if IDE_CONTROLLER_TRACE +int ide_controller_trace; +#endif + /* * ide_controller_initialize -- * Initializes all configured IDE controllers. Controllers configuration @@ -86,10 +93,14 @@ ide_controller_initialize(rtems_device_major_number major, void ide_controller_read_data_block(rtems_device_minor_number minor, uint16_t block_size, - blkdev_sg_buffer *bufs, - uint32_t *cbuf, - uint32_t *pos) + rtems_blkdev_sg_buffer *bufs, + uint32_t *cbuf, + uint32_t *pos) { +#if IDE_CONTROLLER_TRACE + if (ide_controller_trace) + printk ("IDE data block read: %d:%d\n", *cbuf, bufs[*cbuf].block); +#endif IDE_Controller_Table[minor].fns->ctrl_read_block(minor, block_size, bufs, cbuf, pos); } @@ -111,11 +122,15 @@ ide_controller_read_data_block(rtems_device_minor_number minor, void ide_controller_write_data_block(rtems_device_minor_number minor, uint16_t block_size, - blkdev_sg_buffer *bufs, - uint32_t *cbuf, - uint32_t *pos) + rtems_blkdev_sg_buffer *bufs, + uint32_t *cbuf, + uint32_t *pos) { +#if IDE_CONTROLLER_TRACE + if (ide_controller_trace) + printk ("IDE data block write: %d:%d\n", *cbuf, bufs[*cbuf].block); +#endif IDE_Controller_Table[minor].fns->ctrl_write_block(minor, block_size, bufs, cbuf, pos); } @@ -138,6 +153,10 @@ ide_controller_read_register(rtems_device_minor_number minor, uint16_t *value) { IDE_Controller_Table[minor].fns->ctrl_reg_read(minor, reg, value); +#if IDE_CONTROLLER_TRACE + if (ide_controller_trace) + printk ("IDE read reg: %d => %04x\n", reg, *value); +#endif } /* @@ -156,6 +175,10 @@ void ide_controller_write_register(rtems_device_minor_number minor, int reg, uint16_t value) { +#if IDE_CONTROLLER_TRACE + if (ide_controller_trace) + printk ("IDE write reg: %d => %04x\n", reg, value); +#endif IDE_Controller_Table[minor].fns->ctrl_reg_write(minor, reg, value); } |