Changeset 1e0a551 in rtems


Ignore:
Timestamp:
Dec 18, 2009, 3:59:30 PM (10 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, master
Children:
5b91459
Parents:
57674ef
Message:

Update for block device API change

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • c/src/ChangeLog

    r57674ef r1e0a551  
     12009-12-18      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        PR 1474
     4        * libchip/i2c/spi-sd-card.c, libchip/ide/ata.c: Update for block
     5        device API change.
     6
    172009-12-17      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • c/src/libchip/i2c/spi-sd-card.c

    r57674ef r1e0a551  
    11231123        RTEMS_DEBUG_PRINT( "dev = %u, req = %u, arg = 0x08%x\n", dev, req, arg);
    11241124        if (req == RTEMS_BLKIO_REQUEST) {
    1125                 rtems_device_minor_number minor = rtems_disk_physical_minor_number( dd);
     1125                rtems_device_minor_number minor = rtems_disk_get_minor_number( dd);
    11261126                sd_card_driver_entry *e = &sd_card_driver_table [minor];
    11271127                rtems_blkdev_request *r = (rtems_blkdev_request *) arg;
  • c/src/libchip/ide/ata.c

    r57674ef r1e0a551  
    10101010ata_ioctl(rtems_disk_device *dd, uint32_t cmd, void *argp)
    10111011{
    1012     dev_t                     device = rtems_disk_physical_device_number(dd);
     1012    dev_t                     device = rtems_disk_get_device_identifier(dd);
    10131013    rtems_status_code         status;
    10141014    rtems_device_minor_number rel_minor;
  • cpukit/ChangeLog

    r57674ef r1e0a551  
     12009-12-01      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        PR 1474
     4        * libblock/include/rtems/diskdevs.h, libblock/src/bdbuf.c,
     5        libblock/src/blkdev.c: Pass only physical disc devices to the block
     6        device driver.  Reject direct usage of RTEMS_BLKIO_REQUEST though an
     7        IO control.  Renamed and removed disk device structure access methods.
     8        * libblock/src/flashdisk.c, libblock/src/nvdisk.c,
     9        libblock/src/ramdisk-driver.c: Update for block device API change.
     10
    1112009-12-17      Joel Sherrill <joel.sherrill@oarcorp.com>
    212
  • cpukit/libblock/include/rtems/diskdevs.h

    r57674ef r1e0a551  
    144144 */
    145145
    146 static inline dev_t rtems_disk_physical_device_number(
    147   const rtems_disk_device *dd
    148 )
    149 {
    150   return dd->phys_dev->dev;
    151 }
    152 
    153 static inline rtems_device_major_number rtems_disk_physical_major_number(
    154   const rtems_disk_device *dd
    155 )
    156 {
    157   return rtems_filesystem_dev_major_t(dd->phys_dev->dev);
    158 }
    159 
    160 static inline rtems_device_minor_number rtems_disk_physical_minor_number(
    161   const rtems_disk_device *dd
    162 )
    163 {
    164   return rtems_filesystem_dev_minor_t(dd->phys_dev->dev);
    165 }
    166 
    167 static inline dev_t rtems_disk_device_number(const rtems_disk_device *dd)
     146static inline dev_t rtems_disk_get_device_identifier(
     147  const rtems_disk_device *dd
     148)
    168149{
    169150  return dd->dev;
    170151}
    171152
    172 static inline rtems_device_major_number rtems_disk_major_number(
     153static inline rtems_device_major_number rtems_disk_get_major_number(
    173154  const rtems_disk_device *dd
    174155)
     
    177158}
    178159
    179 static inline rtems_device_minor_number rtems_disk_minor_number(
     160static inline rtems_device_minor_number rtems_disk_get_minor_number(
    180161  const rtems_disk_device *dd
    181162)
     
    184165}
    185166
    186 static inline void *rtems_disk_driver_data(const rtems_disk_device *dd)
     167static inline void *rtems_disk_get_driver_data(
     168  const rtems_disk_device *dd
     169)
    187170{
    188171  return dd->driver_data;
    189172}
    190173
    191 static inline uint32_t rtems_disk_block_size(const rtems_disk_device *dd)
    192 {
    193   return dd->block_size;
    194 }
    195 
    196 static inline uint32_t rtems_disk_media_block_size(const rtems_disk_device *dd)
     174static inline uint32_t rtems_disk_get_media_block_size(
     175  const rtems_disk_device *dd
     176)
    197177{
    198178  return dd->media_block_size;
  • cpukit/libblock/src/bdbuf.c

    r57674ef r1e0a551  
    19151915    req->error = 0;
    19161916
    1917     result = dd->ioctl (dd, RTEMS_BLKIO_REQUEST, req);
     1917    result = dd->ioctl (dd->phys_dev, RTEMS_BLKIO_REQUEST, req);
    19181918
    19191919    if (result == 0)
     
    23252325           * device is being held.
    23262326           */
    2327           result = dd->ioctl (dd, RTEMS_BLKIO_REQUEST, transfer->write_req);
     2327          result = dd->ioctl (dd->phys_dev, RTEMS_BLKIO_REQUEST,
     2328                              transfer->write_req);
    23282329          if (result < 0)
    23292330          {
  • cpukit/libblock/src/blkdev.c

    r57674ef r1e0a551  
    252252
    253253        case RTEMS_BLKIO_REQUEST:
    254         {
    255             rtems_blkdev_request *req = args->buffer;
    256             args->ioctl_return = (uint32_t) dd->ioctl(dd, args->command, req);
    257             break;
    258         }
     254            /*
     255             * It is not allowed to directly access the driver circumventing
     256             * the cache.
     257             */
     258            rc = RTEMS_INVALID_NAME;
     259            args->ioctl_return = -1;
     260            break;
    259261
    260262        default:
    261             args->ioctl_return = (uint32_t) dd->ioctl(dd, args->command,
    262                                                       args->buffer);
     263            args->ioctl_return = (uint32_t) dd->ioctl(dd->phys_dev,
     264                                                      args->command,
     265                                                      args->buffer);
    263266            break;
    264267    }
  • cpukit/libblock/src/flashdisk.c

    r57674ef r1e0a551  
    23442344rtems_fdisk_ioctl (rtems_disk_device *dd, uint32_t req, void* argp)
    23452345{
    2346   dev_t                     dev = rtems_disk_physical_device_number (dd);
     2346  dev_t                     dev = rtems_disk_get_device_identifier (dd);
    23472347  rtems_device_minor_number minor = rtems_filesystem_dev_minor_t (dev);
    23482348  rtems_blkdev_request*     r = argp;
  • cpukit/libblock/src/nvdisk.c

    r57674ef r1e0a551  
    683683rtems_nvdisk_ioctl (rtems_disk_device *dd, uint32_t req, void* argp)
    684684{
    685   dev_t                     dev = rtems_disk_physical_device_number (dd);
     685  dev_t                     dev = rtems_disk_get_device_identifier (dd);
    686686  rtems_device_minor_number minor = rtems_filesystem_dev_minor_t (dev);
    687687  rtems_blkdev_request*     r = argp;
  • cpukit/libblock/src/ramdisk-driver.c

    r57674ef r1e0a551  
    102102        {
    103103            rtems_blkdev_request *r = argp;
    104             struct ramdisk *rd = rtems_disk_driver_data(dd);
     104            struct ramdisk *rd = rtems_disk_get_driver_data(dd);
    105105
    106106            switch (r->req)
Note: See TracChangeset for help on using the changeset viewer.