Changeset 76 for trunk/src/os2ahci/atapi.c
- Timestamp:
- Feb 18, 2011, 10:09:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/atapi.c
r75 r76 168 168 * mechanism:" -- Storage Device Driver Reference, Scatter/Gather Lists 169 169 */ 170 rc = ata_cmd(ad_infos + iorb_unit_adapter(iorb), 171 iorb_unit_port(iorb), 172 iorb_unit_device(iorb), 173 slot, ATA_CMD_PACKET, 170 rc = ata_cmd(ad_infos + iorb_unit_adapter(iorb), iorb_unit_port(iorb), 171 iorb_unit_device(iorb), slot, ATA_CMD_PACKET, 174 172 AP_ATAPI_CMD, (void _far *) cdb, cdb_len, 175 173 AP_SGLIST, pt->pSGList, pt->cSGList, … … 280 278 if (ssb->SenseData != NULL) { 281 279 memcpy(ssb->SenseData, psd, max(ssb->ReqSenseLen, ATAPI_SENSE_LEN)); 282 ssb->Flags != STATUS_SENSEDATA_VALID;280 ssb->Flags |= STATUS_SENSEDATA_VALID; 283 281 } 282 iorb->Status |= IORB_STATUSBLOCK_AVAIL; 284 283 } 285 284 … … 333 332 334 333 /****************************************************************************** 335 * pad atapicommands; AHCI requires ATAPI commands to be either 12 or334 * Pad ATAPI commands; AHCI requires ATAPI commands to be either 12 or 336 335 * 16 bytes in length. This func converts commands that have a 12 byte 337 336 * equivalent, and pads the others to 12 bytes. … … 343 342 { 344 343 ATAPI_CDB_12 _far *p12; 344 u32 tmp; 345 345 346 346 if (cmd_in_len == ATAPI_MIN_CDB_LEN || cmd_in_len == ATAPI_MAX_CDB_LEN) { … … 364 364 p12->cmd = 0xa0 | (cmd_in[0] & 0x0f); 365 365 p12->flags = cmd_in[1] & 0xc0; /* 6byte cmds have no flags (FUA etc.) */ 366 SET_CDB_32(p12->lba, (u32) cmd_in[3] | (u32) cmd_in[2] << 8 |367 (u32) (cmd_in[1] & 0x1f) << 16);368 SET_CDB_32(p12->trans_len, (u32)cmd_in[4]);366 tmp = GET_CDB_24(cmd_in + 1) & 0x1fffffUL; 367 SET_CDB_32(p12->lba, tmp); 368 SET_CDB_32(p12->trans_len, cmd_in[4]); 369 369 p12->control = cmd_in[5]; 370 370 break; … … 375 375 p12->cmd = 0xa0 | (cmd_in[0] & 0x0f); 376 376 p12->flags = cmd_in[1]; 377 p12->control = cmd_in[9]; 377 378 memcpy(p12->lba, cmd_in + 2, 4); 378 SET_CDB_32(p12->trans_len, (u32) GET_CDB_16(cmd_in + 7));379 p12->control = cmd_in[9];379 tmp = GET_CDB_16(cmd_in + 7); 380 SET_CDB_32(p12->trans_len, tmp); 380 381 break; 381 382
Note:
See TracChangeset
for help on using the changeset viewer.