Changeset 57 for trunk/src/os2ahci/ata.c
- Timestamp:
- Dec 14, 2010, 9:35:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ata.c
r56 r57 118 118 /* 28-bit sector address */ 119 119 ata_cmd.lba_l = va_arg(va, u32); 120 dprintf("LBA28: 0x%08lx\n", ata_cmd.lba_l); 120 121 if (ata_cmd.lba_l & 0xf0000000UL) { 121 122 dprintf("error: LBA-28 address %ld has more than 28 bits\n", ata_cmd.lba_l); 122 123 return(-1); 123 124 } 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; 125 129 break; 126 130 … … 133 137 134 138 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; 137 142 break; 138 143 … … 313 318 fis[12] = (u8) ata_cmd->count; 314 319 fis[13] = (u8) (ata_cmd->count >> 8); 315 316 phex(fis, 14, "FIS:\n");317 320 } 318 321
Note:
See TracChangeset
for help on using the changeset viewer.