Changeset 63


Ignore:
Timestamp:
Dec 18, 2010, 3:10:02 PM (15 years ago)
Author:
markus
Message:

added feature byte to ATAPI commands; fixed request sense CDB

Location:
trunk/src/os2ahci
Files:
4 edited

Legend:

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

    r61 r63  
    9393                 AP_SGLIST,    io->pSGList + sg_indx, (u16) sg_cnt,
    9494                 AP_DEVICE,    0x4000,
     95                 AP_FEATURES,  0x0001,
    9596                 AP_END);
    9697
     
    155156                             pt->ControllerCmdLen,
    156157               AP_SGLIST,    pt->pSGList, pt->cSGList,
     158               AP_FEATURES,  0x0001,
    157159               AP_END);
    158160
    159   if (rc == 0) {
    160     add_workspace(iorb)->blocks = pt->cSGList;
    161     /* no pp func needed */
    162 
    163   } else if (rc > 0) {
    164     iorb_seterr(iorb, IOERR_CMD_SGLIST_BAD);
    165 
    166   } else {
    167     iorb_seterr(iorb, IOERR_CMD_ADD_SOFTWARE_FAILURE);
     161  if (rc) {
     162    iorb_seterr(iorb, IOERR_DEVICE_NONSPECIFIC);
    168163  }
    169164 
     
    184179{
    185180  ADD_WORKSPACE _far *aws = add_workspace(iorb);
    186   ATAPI_CDB_REQ_SENSE cdb;
     181  ATAPI_CDB_6 cdb;
    187182  int rc;
    188183 
     
    198193  memset(&cdb, 0x00, sizeof(cdb));
    199194  cdb.cmd = ATAPI_CMD_REQUEST_SENSE;
     195  cdb.trans_len = (u8) ATAPI_SENSE_LEN;
     196 
    200197  aws->ppfunc = atapi_req_sense_pp;
    201198  rc = ata_cmd(ad_infos + iorb_unit_adapter(iorb),
  • trunk/src/os2ahci/atapi.h

    r62 r63  
    120120 * ATAPI_CDB_10 - describes layout of generic 10 byte ATAPI command
    121121 */
    122 typedef struct _ATAPI_CMD_10 {
     122typedef struct _ATAPI_CDB_10 {
    123123  u8   cmd;            /* SCSI/ATAPI command code */
    124124  u8   flags;          /* flags (DPO, FUA) */
     
    131131 * ATAPI_CDB_12 - describes layout of generic 12 byte ATAPI command
    132132 */
    133 typedef struct _ATAPI_CMD_12 {
     133typedef struct _ATAPI_CDB_12 {
    134134  u8   cmd;            /* SCSI/ATAPI command code */
    135135  u8   flags;          /* flags (DPO, FUA) */
     
    141141
    142142/******************************************************************************Ü
    143  * ATAPI_CDB_REQ_SENSE - describes request sense command
     143 * ATAPI_CDB_6 - describes 6 byte ATAPI command
    144144 */
    145 typedef struct _ATAPI_CMD_REQ_SENSE {
    146   u8   cmd;            /* command code (0x03) */
     145typedef struct _ATAPI_CDB_6 {
     146  u8   cmd;            /* command code */
    147147  u8   lun;            /* SCSI lun (ignored) */
    148148  u8   resvd[2];
    149   u8   buffer_len;     /* sense buffer length */
     149  u8   trans_len;      /* trasnfer length */
    150150  u8   control;
    151 } ATAPI_CDB_REQ_SENSE;
     151} ATAPI_CDB_6;
    152152
    153153
  • trunk/src/os2ahci/ctxhook.c

    r13 r63  
    120120        ccs = (int) ((readl(port_mmio + PORT_CMD) >> 8) & 0x0f);
    121121
    122         for (iorb = ai->ports[p].iorb_queue.root; iorb != NULL; iorb = next) {
     122       for (iorb = ai->ports[p].iorb_queue.root; iorb != NULL; iorb = next) {
    123123          ADD_WORKSPACE _far *aws = add_workspace(iorb);
    124124          next = iorb->pNxtIORB;
    125125
    126126          if (aws->queued_hw) {
    127             if (ai->ports[p].ncq_cmds != 0) {
     127            if (ai->ports[p].ncq_cmds & (1UL << aws->cmd_slot)) {
    128128              /* NCQ commands active; force non-NCQ mode and trigger port reset */
     129              ai->ports[p].ncq_cmds &= ~(1UL << aws->cmd_slot);
    129130              aws->no_ncq = 1;
    130131              need_reset = 1;
    131132            } else if (aws->cmd_slot == ccs) {
    132133              /* this is the non-NCQ comand that failed */
     134              ai->ports[p].reg_cmds &= ~(1UL << aws->cmd_slot);
    133135              problem_iorb = iorb;
    134136            }
    135137            iorb_requeue(iorb);
    136 
    137             /* remove requeued command from the issued command bitmaps */
    138             ai->ports[p].ncq_cmds &= ~(1UL << p);
    139             ai->ports[p].reg_cmds &= ~(1UL << p);
    140138          }
    141139        }
  • trunk/src/os2ahci/os2ahci.def

    r60 r63  
    11library os2ahci
    2 Description '$@#thi.guten (www.thiguten.de):1.00.20101216#@OS/2 AHCI Adapter Device Driver'
     2Description '$@#thi.guten (www.thiguten.de):1.00.20101218#@OS/2 AHCI Adapter Device Driver'
    33protmode
    44
Note: See TracChangeset for help on using the changeset viewer.