Changeset f031251c in rtems for c/src/libchip/i2c/spi-sd-card.c


Ignore:
Timestamp:
Aug 2, 2008, 6:26:29 AM (11 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
c0cc985
Parents:
2eb89ad
Message:

2008-08-02 Chris Johns <chrisj@…>

  • libchip/i2c/spi-sd-card.c, libchip/ide/ata.c: Remove rtems_blkdev_request count and start references. Use RTEMS_BLKDEV_START_BLOCK.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/libchip/i2c/spi-sd-card.c

    r2eb89ad rf031251c  
    563563        rtems_status_code sc = RTEMS_SUCCESSFUL;
    564564        int rv = 0;
    565         uint32_t start_address = r->start << e->block_size_shift;
     565        uint32_t start_address = RTEMS_BLKDEV_START_BLOCK (r) << e->block_size_shift;
    566566        uint32_t i = 0;
    567567
    568         DEBUG_PRINT( "start = %u, count = %u, bufnum = %u\n", r->start, r->count, r->bufnum);
     568        DEBUG_PRINT( "start = %u, bufnum = %u\n", r->start, r->bufnum);
    569569
    570570#ifdef DEBUG
    571571        /* Check request */
    572         if (r->count != r->bufnum) {
    573                 SYSLOG_ERROR( "Block count and buffer number are not equal");
    574                 return -RTEMS_INTERNAL_ERROR;
    575         } else if (r->start >= e->block_number) {
     572  if (r->bufs[0].block >= e->block_number) {
    576573                SYSLOG_ERROR( "Start block number out of range");
    577574                return -RTEMS_INTERNAL_ERROR;
    578         } else if (r->count > e->block_number - r->start) {
     575        } else if (r->bufnum > e->block_number - RTEMS_BLKDEV_START_BLOCK (r)) {
    579576                SYSLOG_ERROR( "Block count out of range");
    580577                return -RTEMS_INTERNAL_ERROR;
     
    586583        CLEANUP_SCRV( sc, rv, sd_card_disk_block_read_cleanup, "Start");
    587584
    588         if (r->count == 1) {
     585        if (r->bufnum == 1) {
    589586#ifdef DEBUG
    590587                /* Check buffer */
     
    606603
    607604                /* Multiple block read */
    608                 for (i = 0; i < r->count; ++i) {
     605                for (i = 0; i < r->bufnum; ++i) {
    609606#ifdef DEBUG
    610607                        /* Check buffer */
     
    653650        rtems_status_code sc = RTEMS_SUCCESSFUL;
    654651        int rv = 0;
    655         uint32_t start_address = r->start << e->block_size_shift;
     652        uint32_t start_address = RTEMS_BLKDEV_START_BLOCK (r) << e->block_size_shift;
    656653        uint32_t i = 0;
    657654
     
    660657#ifdef DEBUG
    661658        /* Check request */
    662         if (r->count != r->bufnum) {
    663                 SYSLOG_ERROR( "Block count and buffer number are not equal");
    664                 return -RTEMS_INTERNAL_ERROR;
    665         } else if (r->start >= e->block_number) {
     659  if (r->bufs[0].block >= e->block_number) {
    666660                SYSLOG_ERROR( "Start block number out of range");
    667661                return -RTEMS_INTERNAL_ERROR;
    668         } else if (r->count > e->block_number - r->start) {
     662        } else if (r->bufnum > e->block_number - RTEMS_BLKDEV_START_BLOCK (r)) {
    669663                SYSLOG_ERROR( "Block count out of range");
    670664                return -RTEMS_INTERNAL_ERROR;
     
    676670        CLEANUP_SCRV( sc, rv, sd_card_disk_block_write_cleanup, "Start");
    677671
    678         if (r->count == 1) {
     672        if (r->bufnum == 1) {
    679673#ifdef DEBUG
    680674                /* Check buffer */
     
    696690
    697691                /* Multiple block write */
    698                 for (i = 0; i < r->count; ++i) {
     692                for (i = 0; i < r->bufnum; ++i) {
    699693#ifdef DEBUG
    700694                        /* Check buffer */
     
    759753                        case RTEMS_BLKDEV_REQ_WRITE:
    760754                                return sd_card_disk_block_write( e, r);
     755                        case RTEMS_BLKDEV_CAPABILITIES:
     756                                *((uint32_t*) arg)  = RTEMS_BLKDEV_CAP_MULTISECTOR_CONT;
     757                                return 0;
    761758                        default:
    762759                                errno = EBADRQC;
Note: See TracChangeset for help on using the changeset viewer.