mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
Update for block device API change.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2009-10-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* libchip/i2c/spi-sd-card.c, libchip/ide/ata.c: Update for block
|
||||||
|
device API change.
|
||||||
|
|
||||||
2009-10-08 Chris Johns <chrisj@rtems.org>
|
2009-10-08 Chris Johns <chrisj@rtems.org>
|
||||||
|
|
||||||
* libchip/ide/ata.c, c/src/libchip/ide/ata_internal.h: Remove the
|
* libchip/ide/ata.c, c/src/libchip/ide/ata_internal.h: Remove the
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <rtems/libi2c.h>
|
#include <rtems/libi2c.h>
|
||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include <rtems/diskdevs.h>
|
#include <rtems/diskdevs.h>
|
||||||
|
#include <rtems/blkdev.h>
|
||||||
|
|
||||||
#include <libchip/spi-sd-card.h>
|
#include <libchip/spi-sd-card.h>
|
||||||
|
|
||||||
@@ -1117,11 +1118,11 @@ sd_card_disk_block_write_cleanup:
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sd_card_disk_ioctl( dev_t dev, uint32_t req, void *arg)
|
static int sd_card_disk_ioctl( rtems_disk_device *dd, uint32_t req, void *arg)
|
||||||
{
|
{
|
||||||
RTEMS_DEBUG_PRINT( "dev = %u, req = %u, arg = 0x08%x\n", dev, req, arg);
|
RTEMS_DEBUG_PRINT( "dev = %u, req = %u, arg = 0x08%x\n", dev, req, arg);
|
||||||
if (req == RTEMS_BLKIO_REQUEST) {
|
if (req == RTEMS_BLKIO_REQUEST) {
|
||||||
rtems_device_minor_number minor = rtems_filesystem_dev_minor_t( dev);
|
rtems_device_minor_number minor = rtems_disk_physical_minor_number( dd);
|
||||||
sd_card_driver_entry *e = &sd_card_driver_table [minor];
|
sd_card_driver_entry *e = &sd_card_driver_table [minor];
|
||||||
rtems_blkdev_request *r = (rtems_blkdev_request *) arg;
|
rtems_blkdev_request *r = (rtems_blkdev_request *) arg;
|
||||||
switch (r->req) {
|
switch (r->req) {
|
||||||
@@ -1159,7 +1160,7 @@ static rtems_status_code sd_card_disk_init( rtems_device_major_number major, rte
|
|||||||
RTEMS_CHECK_SC( sc, "Initialize SD Card");
|
RTEMS_CHECK_SC( sc, "Initialize SD Card");
|
||||||
|
|
||||||
/* Create disk device */
|
/* Create disk device */
|
||||||
sc = rtems_disk_create_phys( dev, (int) e->block_size, (int) e->block_number, sd_card_disk_ioctl, e->device_name);
|
sc = rtems_disk_create_phys( dev, e->block_size, e->block_number, sd_card_disk_ioctl, NULL, e->device_name);
|
||||||
RTEMS_CHECK_SC( sc, "Create disk device");
|
RTEMS_CHECK_SC( sc, "Create disk device");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1006,12 +1006,12 @@ ata_queue_task(rtems_task_argument arg)
|
|||||||
* RETURNS:
|
* RETURNS:
|
||||||
* depend on 'cmd'
|
* depend on 'cmd'
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
ata_ioctl(dev_t device, int cmd, void *argp)
|
ata_ioctl(rtems_disk_device *dd, uint32_t cmd, void *argp)
|
||||||
{
|
{
|
||||||
|
dev_t device = rtems_disk_physical_device_number(dd);
|
||||||
rtems_status_code status;
|
rtems_status_code status;
|
||||||
rtems_device_minor_number rel_minor;
|
rtems_device_minor_number rel_minor;
|
||||||
uint8_t block_count;
|
|
||||||
|
|
||||||
rel_minor = (rtems_filesystem_dev_minor_t(device)) /
|
rel_minor = (rtems_filesystem_dev_minor_t(device)) /
|
||||||
ATA_MINOR_NUM_RESERVED_PER_ATA_DEVICE;
|
ATA_MINOR_NUM_RESERVED_PER_ATA_DEVICE;
|
||||||
@@ -1042,7 +1042,7 @@ ata_ioctl(dev_t device, int cmd, void *argp)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return rtems_blkdev_ioctl (device, cmd, argp);
|
return rtems_blkdev_ioctl (dd, cmd, argp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1457,7 +1457,7 @@ rtems_ata_initialize(rtems_device_major_number major,
|
|||||||
(ATA_DEV_INFO(ctrl_minor, dev).heads *
|
(ATA_DEV_INFO(ctrl_minor, dev).heads *
|
||||||
ATA_DEV_INFO(ctrl_minor, dev).cylinders *
|
ATA_DEV_INFO(ctrl_minor, dev).cylinders *
|
||||||
ATA_DEV_INFO(ctrl_minor, dev).sectors),
|
ATA_DEV_INFO(ctrl_minor, dev).sectors),
|
||||||
(rtems_block_device_ioctl) ata_ioctl, name);
|
ata_ioctl, NULL, name);
|
||||||
if (status != RTEMS_SUCCESSFUL)
|
if (status != RTEMS_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
ata_devs[ata_devs_number].device = ATA_UNDEFINED_VALUE;
|
ata_devs[ata_devs_number].device = ATA_UNDEFINED_VALUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user