Changeset 57 for trunk/src/os2ahci/ata.c


Ignore:
Timestamp:
Dec 14, 2010, 9:35:35 PM (15 years ago)
Author:
markus
Message:

fixed ata_cmd to FIS mapping (LBA-28); removed sector mapping test code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/ata.c

    r56 r57  
    118118      /* 28-bit sector address */
    119119      ata_cmd.lba_l = va_arg(va, u32);
     120      dprintf("LBA28: 0x%08lx\n", ata_cmd.lba_l);
    120121      if (ata_cmd.lba_l & 0xf0000000UL) {
    121122        dprintf("error: LBA-28 address %ld has more than 28 bits\n", ata_cmd.lba_l);
    122123        return(-1);
    123124      }
    124       dprintf("LBA28: 0x%08lx\n", ata_cmd.lba_l);
     125      /* add upper 4 bits to device field */
     126      ata_cmd.device |= (ata_cmd.lba_l >> 24) & 0x0fU;
     127      /* only lower 24 bits come into _debug lba_l */
     128      ata_cmd.lba_l &= 0x00ffffffUL;
    125129      break;
    126130
     
    133137
    134138    case AP_DEVICE:
    135       /* ATA device byte */
    136       ata_cmd.device = va_arg(va, u16) >> 8;
     139      /* ATA device byte; note that this byte contains the highest
     140       * 4 bits of LBA-28 address; we have to leave them alone here. */
     141      ata_cmd.device |= (va_arg(va, u16) & 0xf000U) >> 8;
    137142      break;
    138143
     
    313318  fis[12] = (u8) ata_cmd->count;
    314319  fis[13] = (u8) (ata_cmd->count >> 8);
    315 
    316   phex(fis, 14, "FIS:\n");
    317320}
    318321
Note: See TracChangeset for help on using the changeset viewer.