Ticket #1474: disk.patch

File disk.patch, 7.6 KB (added by Sebastian Huber, on Dec 7, 2009 at 2:35:52 PM)

Proposed changes

  • c/src/libchip/i2c/spi-sd-card.c

    RCS file: /usr1/CVS/rtems/c/src/libchip/i2c/spi-sd-card.c,v
    retrieving revision 1.13
    diff -u -r1.13 spi-sd-card.c
     
    11221122{
    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;
    11281128                switch (r->req) {
  • c/src/libchip/ide/ata.c

    RCS file: /usr1/CVS/rtems/c/src/libchip/ide/ata.c,v
    retrieving revision 1.33
    diff -u -r1.33 ata.c
     
    10091009static int
    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;
    10151015
  • cpukit/libblock/include/rtems/diskdevs.h

    RCS file: /usr1/CVS/rtems/cpukit/libblock/include/rtems/diskdevs.h,v
    retrieving revision 1.17
    diff -u -r1.17 diskdevs.h
     
    143143 * @{
    144144 */
    145145
    146 static inline dev_t rtems_disk_physical_device_number(
     146static inline dev_t rtems_disk_get_device_identifier(
    147147  const rtems_disk_device *dd
    148148)
    149149{
    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)
    168 {
    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)
    175156{
    176157  return rtems_filesystem_dev_major_t(dd->dev);
    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)
    182163{
    183164  return rtems_filesystem_dev_minor_t(dd->dev);
    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;
    199179}
  • cpukit/libblock/src/bdbuf.c

    RCS file: /usr1/CVS/rtems/cpukit/libblock/src/bdbuf.c,v
    retrieving revision 1.45
    diff -u -r1.45 bdbuf.c
     
    19141914    req->status = RTEMS_RESOURCE_IN_USE;
    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)
    19201920    {
     
    23242324           * Perform the transfer. No cache locks, no preemption, only the disk
    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          {
    23302331            rtems_bdbuf_lock_cache ();
  • cpukit/libblock/src/blkdev.c

    RCS file: /usr1/CVS/rtems/cpukit/libblock/src/blkdev.c,v
    retrieving revision 1.21
    diff -u -r1.21 blkdev.c
     
    251251            break;
    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);
     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;
    257260            break;
    258         }
    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    }
    265268    rtems_disk_release(dd);
  • cpukit/libblock/src/flashdisk.c

    RCS file: /usr1/CVS/rtems/cpukit/libblock/src/flashdisk.c,v
    retrieving revision 1.13
    diff -u -r1.13 flashdisk.c
     
    23432343static int
    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;
    23492349  rtems_status_code         sc;
  • cpukit/libblock/src/nvdisk.c

    RCS file: /usr1/CVS/rtems/cpukit/libblock/src/nvdisk.c,v
    retrieving revision 1.12
    diff -u -r1.12 nvdisk.c
     
    682682static int
    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;
    688688  rtems_status_code         sc;
  • cpukit/libblock/src/ramdisk-driver.c

    RCS file: /usr1/CVS/rtems/cpukit/libblock/src/ramdisk-driver.c,v
    retrieving revision 1.3
    diff -u -r1.3 ramdisk-driver.c
     
    101101        case RTEMS_BLKIO_REQUEST:
    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)
    107107            {