summaryrefslogtreecommitdiffstats
path: root/c/src/libchip
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-10-31 11:54:39 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-02 09:40:58 +0100
commit9f0a68ce5afca9d21d34bab83d42fbe4bb0cf8ef (patch)
treedb24c42e065ac766c55215f39eb729a337609cde /c/src/libchip
parentbsp/mpc55xx: SMSC9218i avoid mbuf migration (diff)
downloadrtems-9f0a68ce5afca9d21d34bab83d42fbe4bb0cf8ef.tar.bz2
libblock: Block device transfer request API change
Add and use rtems_blkdev_request_done(). Block device transfer requests must signal the completion status now with rtems_blkdev_request_done(). The return value of the block device IO control will be ignored for transfer requests. The first parameter of rtems_blkdev_request_cb is now the transfer request structure. Renamed rtems_blkdev_request::req_done to rtems_blkdev_request::done to break third party drivers at compile time, otherwise this API change would result in runtime errors.
Diffstat (limited to 'c/src/libchip')
-rw-r--r--c/src/libchip/i2c/spi-sd-card.c12
-rw-r--r--c/src/libchip/ide/ata.c3
-rw-r--r--c/src/libchip/ide/ata_internal.h4
3 files changed, 10 insertions, 9 deletions
diff --git a/c/src/libchip/i2c/spi-sd-card.c b/c/src/libchip/i2c/spi-sd-card.c
index bdd6fe0ade..d85c1774d6 100644
--- a/c/src/libchip/i2c/spi-sd-card.c
+++ b/c/src/libchip/i2c/spi-sd-card.c
@@ -1117,7 +1117,7 @@ static int sd_card_disk_block_read( sd_card_driver_entry *e, rtems_blkdev_reques
RTEMS_CHECK_SC_RV( sc, "Stop");
/* Done */
- r->req_done( r->done_arg, RTEMS_SUCCESSFUL);
+ rtems_blkdev_request_done( r, RTEMS_SUCCESSFUL);
return 0;
@@ -1132,9 +1132,9 @@ sd_card_disk_block_read_cleanup:
sd_card_stop( e);
/* Done */
- r->req_done( r->done_arg, RTEMS_IO_ERROR);
+ rtems_blkdev_request_done( r, RTEMS_IO_ERROR);
- return rv;
+ return 0;
}
static int sd_card_disk_block_write( sd_card_driver_entry *e, rtems_blkdev_request *r)
@@ -1206,7 +1206,7 @@ static int sd_card_disk_block_write( sd_card_driver_entry *e, rtems_blkdev_reque
RTEMS_CHECK_SC_RV( sc, "Stop");
/* Done */
- r->req_done( r->done_arg, RTEMS_SUCCESSFUL);
+ rtems_blkdev_request_done( r, RTEMS_SUCCESSFUL);
return 0;
@@ -1225,9 +1225,9 @@ sd_card_disk_block_write_cleanup:
sd_card_stop( e);
/* Done */
- r->req_done( r->done_arg, RTEMS_IO_ERROR);
+ rtems_blkdev_request_done( r, RTEMS_IO_ERROR);
- return rv;
+ return 0;
}
static int sd_card_disk_ioctl( rtems_disk_device *dd, uint32_t req, void *arg)
diff --git a/c/src/libchip/ide/ata.c b/c/src/libchip/ide/ata.c
index 18d8d14386..1e25003698 100644
--- a/c/src/libchip/ide/ata.c
+++ b/c/src/libchip/ide/ata.c
@@ -185,7 +185,8 @@ ata_io_data_request(dev_t device, rtems_blkdev_request *req)
areq = malloc(sizeof(ata_req_t));
if (areq == NULL)
{
- return RTEMS_NO_MEMORY;
+ rtems_blkdev_request_done(req, RTEMS_NO_MEMORY);
+ return RTEMS_SUCCESSFUL;
}
areq->breq = req;
diff --git a/c/src/libchip/ide/ata_internal.h b/c/src/libchip/ide/ata_internal.h
index 3eea2d1dd4..32c9422563 100644
--- a/c/src/libchip/ide/ata_internal.h
+++ b/c/src/libchip/ide/ata_internal.h
@@ -218,8 +218,8 @@ typedef struct ata_req_s {
/* call callback provided by block device request if it is defined */
#define ATA_EXEC_CALLBACK(areq, status) \
do {\
- if (((areq)->breq != NULL) && ((areq)->breq->req_done != NULL)) \
- (areq)->breq->req_done((areq)->breq->done_arg, status); \
+ if ((areq)->breq != NULL) \
+ rtems_blkdev_request_done((areq)->breq, status); \
} while (0)
/* ATA RTEMS driver events types */