Ignore:
Timestamp:
Feb 18, 2011, 10:09:10 PM (14 years ago)
Author:
chris
Message:
  • APM support
  • Generic IOCTL interface for adapter passthrough commands (ATA and ATAPI)
  • Fixes to ATAPI sense data handling
  • Cosmetic changes to debug reporting
  • Fixed missing interrupt enable flag for PIO transfer completions
  • Added command line switch /I to ignore specific adapters
File:
1 edited

Legend:

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

    r75 r76  
    168168   * mechanism:" -- Storage Device Driver Reference, Scatter/Gather Lists
    169169   */
    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,
    174172               AP_ATAPI_CMD, (void _far *) cdb, cdb_len,
    175173               AP_SGLIST, pt->pSGList, pt->cSGList,
     
    280278    if (ssb->SenseData != NULL) {
    281279      memcpy(ssb->SenseData, psd, max(ssb->ReqSenseLen, ATAPI_SENSE_LEN));
    282       ssb->Flags != STATUS_SENSEDATA_VALID;
     280      ssb->Flags |= STATUS_SENSEDATA_VALID;
    283281    }
     282    iorb->Status |= IORB_STATUSBLOCK_AVAIL;
    284283  }
    285284
     
    333332
    334333/******************************************************************************
    335  * pad atapi commands; AHCI requires ATAPI commands to be either 12 or
     334 * Pad ATAPI commands; AHCI requires ATAPI commands to be either 12 or
    336335 * 16 bytes in length. This func converts commands that have a 12 byte
    337336 * equivalent, and pads the others to 12 bytes.
     
    343342{
    344343  ATAPI_CDB_12 _far *p12;
     344  u32 tmp;
    345345
    346346  if (cmd_in_len == ATAPI_MIN_CDB_LEN || cmd_in_len == ATAPI_MAX_CDB_LEN) {
     
    364364    p12->cmd = 0xa0 | (cmd_in[0] & 0x0f);
    365365    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]);
    369369    p12->control = cmd_in[5];
    370370    break;
     
    375375    p12->cmd = 0xa0 | (cmd_in[0] & 0x0f);
    376376    p12->flags = cmd_in[1];
     377    p12->control = cmd_in[9];
    377378    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);
    380381    break;
    381382
Note: See TracChangeset for help on using the changeset viewer.