Changeset 13 for trunk


Ignore:
Timestamp:
Sep 14, 2010, 10:07:59 AM (15 years ago)
Author:
root
Message:

latest NCQ changes from Christian

Location:
trunk/src/os2ahci
Files:
1 added
17 moved

Legend:

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

    r12 r13  
    171171        if (val & HOST_CAP_EMS)        printf(" ems");
    172172        if (val & HOST_CAP_SXS)        printf(" sxs");
    173         printf(" ports:%d", (val & 0x1f) + 1);
     173        printf(" cmd_slots:%d", (u16) ((val >> 8) & 0x1f) + 1);
     174        printf(" ports:%d",     (u16) (val & 0x1f) + 1);
    174175
    175176      } else if (i == HOST_CTL) {
     
    829830  ULONG timeout = (iorb->Timeout > 0) ? iorb->Timeout : DEFAULT_TIMEOUT;
    830831  u8 _far *port_mmio = port_base(ai, iorb_unit_port(iorb));
     832  u16 cmd_max = ai->cmd_max;
    831833  int i;
    832834
    833835  /* determine whether this will be an NCQ request */
    834   aws->is_ncq = ((ai->cap & HOST_CAP_NCQ) && ncq_capable && !aws->no_ncq);
    835 
    836   /* NCQ disabled temporarily until non-NCQ commands are fully working */
    837836  aws->is_ncq = 0;
    838 
    839   /* check whether adapter is available */
     837  if (ncq_capable && port->devs[iorb_unit_device(iorb)].ncq_max > 1 &&
     838      (ai->cap & HOST_CAP_NCQ) && !aws->no_ncq && init_complete) {
     839
     840    /* We can make this an NCQ request; limit command slots to the maximum
     841     * NCQ tag number reported by the device - 1. Why "minus one"? I seem to
     842     * recall an issue related to using all 32 tag numbers but can't quite
     843     * pinpoint it right now. One less won't make much of a difference...
     844     */
     845    aws->is_ncq = 1;
     846    if ((cmd_max = port->devs[iorb_unit_device(iorb)].ncq_max - 1) > ai->cmd_max) {
     847      cmd_max = ai->cmd_max;
     848    }
     849    ddprintf("NCQ command; cmd_max = %d->%d\n", (u16) ai->cmd_max, cmd_max);
     850  }
     851
     852  /* make sure adapter is available */
    840853  spin_lock(drv_lock);
    841854  if (!ai->busy) {
     
    849862    }
    850863
    851     /* prevent NCQ/regular command mix */
    852     if (aws->is_ncq && port->reg_cmds == 0 ||
    853         !aws->is_ncq && port->ncq_cmds == 0) {
     864    /* make sure we don't mix NCQ and regular commands */
     865    if (aws->is_ncq && port->reg_cmds == 0 || !aws->is_ncq && port->ncq_cmds == 0) {
    854866
    855867      /* Find next available command slot. We use a simple round-robin
     
    858870       */
    859871      cmds = (aws->is_ncq) ? &port->ncq_cmds : &port->reg_cmds;
    860       for (i = 0; i <= ai->cmd_max; i++) {
     872      for (i = 0; i <= cmd_max; i++) {
     873        if (++(port->cmd_slot) > cmd_max) {
     874          port->cmd_slot = 0;
     875        }
    861876        if ((*cmds & (1UL << port->cmd_slot)) == 0) {
    862877          break;
    863         }
    864         if (++(port->cmd_slot) > ai->cmd_max) {
    865           port->cmd_slot = 0;
    866878        }
    867879      }
     
    895907        readl(port_mmio + PORT_CMD_ISSUE); /* flush */
    896908
    897         /* make sure next cmd won't use the same slot to prevent starvation */
    898         if (++(port->cmd_slot) > ai->cmd_max) {
    899           port->cmd_slot = 0;
    900         }
    901909        spin_unlock(drv_lock);
    902910        return;
     
    916924 *
    917925 *  - We need to restore the BIOS configuration after we're done with this
    918  *    command because someone might still call int 13 routines; sending
     926 *    command because someone might still call int 13h routines; sending
    919927 *    asynchronous commands and waiting for interrupts to indicate completion
    920928 *    won't work in such a scenario.
     
    12261234  u8 _far *port_mmio = port_base(ai, p);
    12271235  int reset_port = 0;
     1236  u32 tmp;
    12281237
    12291238  /* Handle adapter and interface errors. Those typically require a port
     
    13361345  dphex(((IORB_ADAPTER_PASSTHRU _far *) iorb)->pControllerCmd,
    13371346        ((IORB_ADAPTER_PASSTHRU _far *) iorb)->ControllerCmdLen,
    1338         "ahci_execute_cdb(%d.%d.%d)", (int) iorb_unit_adapter(iorb),
    1339         (int) iorb_unit_port(iorb), (int) iorb_unit_device(iorb));
     1347        "ahci_execute_cdb(%d.%d.%d)", a, p, d);
    13401348 
    13411349  if (ad_infos[a].ports[p].devs[d].atapi) {
     
    13581366  dphex(((IORB_ADAPTER_PASSTHRU _far *) iorb)->pControllerCmd,
    13591367        ((IORB_ADAPTER_PASSTHRU _far *) iorb)->ControllerCmdLen,
    1360         "ahci_execute_cdb(%d.%d.%d)", (int) iorb_unit_adapter(iorb),
    1361         (int) iorb_unit_port(iorb), (int) iorb_unit_device(iorb));
     1368        "ahci_execute_cdb(%d.%d.%d)", a, p, d);
    13621369 
    13631370  if (ad_infos[a].ports[p].devs[d].atapi) {
     
    14031410  } else {
    14041411    /* complete ATA-specific device information */
    1405     ai->ports[p].devs[d].ncq_max   = id_buf[ATA_ID_QUEUE_DEPTH] & 0x001fU;
    1406     if (id_buf[ATA_ID_CFS_ENABLE_2] & 0x40) {
     1412    if (!disable_ncq[ad_no(ai)][p]) {
     1413      ai->ports[p].devs[d].ncq_max = id_buf[ATA_ID_QUEUE_DEPTH] & 0x001fU;
     1414    }
     1415    if (id_buf[ATA_ID_CFS_ENABLE_2] & 0x0400U) {
    14071416      ai->ports[p].devs[d].lba48   = 1;
    14081417    }
  • trunk/src/os2ahci/ata.c

    r12 r13  
    9999
    100100    case AP_WRITE:
    101       ahci_flags |= AHCI_CMD_WRITE;
     101      if (va_arg(va, u16) != 0) {
     102        ahci_flags |= AHCI_CMD_WRITE;
     103      }
    102104      break;
    103105
     
    126128      ata_cmd.lba_h = va_arg(va, u16);
    127129      break;
    128 
     130   
    129131    case AP_DEVICE:
    130132      /* ATA device byte */
     
    147149
    148150    case AP_ATAPI_CMD:
     151      /* ATAPI command */
    149152      atapi_cmd = va_arg(va, void _far *);
    150153      atapi_cmd_len = va_arg(va, u16);
    151154      ahci_flags |= AHCI_CMD_ATAPI;
     155      break;
     156
     157    case AP_ATA_CMD:
     158      /* ATA command "pass-through" */
     159      memcpy(&ata_cmd, va_arg(va, void _far *), sizeof(ATA_CMD));
    152160      break;
    153161
     
    236244        return(i - 1);
    237245      }
    238       ddprintf("s/g list element: addr = 0x%08lx, size = 0x%04lx\n", sg_addr, chunk);
    239246      cmd_tbl->sg_list[n].addr = sg_addr;
    240247      cmd_tbl->sg_list[n].size = chunk - 1;
     
    515522    sg_cnt = io->cSGList - sg_indx;
    516523
    517     if (sector >= (1UL << 28) || count > 256) {
     524    if (sector >= (1UL << 28) || count > 256 || add_workspace(iorb)->is_ncq) {
    518525      /* need LBA48 for this command */
    519526      if (!ai->ports[p].devs[d].lba48) {
     
    521528        return(-1);
    522529      }
    523       rc = ata_cmd(ai, p, d, slot, ATA_CMD_READ_EXT,
    524                    AP_SECTOR_48, (u32) sector, (u16) 0,
    525                    AP_COUNT,     (u16) count,
    526                    AP_SGLIST,    io->pSGList + sg_indx, (u16) sg_cnt,
    527                    AP_DEVICE,    0x4000,
    528                    AP_END);
     530      if (add_workspace(iorb)->is_ncq) {
     531        /* use NCQ read; count goes into feature register, tag into count! */
     532        rc = ata_cmd(ai, p, d, slot, ATA_CMD_FPDMA_READ,
     533                     AP_SECTOR_48, (u32) sector, (u16) 0,
     534                     AP_FEATURES,  (u16) count,
     535                     AP_COUNT,     (u16) slot, /* tag = slot */
     536                     AP_SGLIST,    io->pSGList + sg_indx, (u16) sg_cnt,
     537                     AP_DEVICE,    0x4000,
     538                     AP_END);
     539      } else {
     540        rc = ata_cmd(ai, p, d, slot, ATA_CMD_READ_EXT,
     541                     AP_SECTOR_48, (u32) sector, (u16) 0,
     542                     AP_COUNT,     (u16) count,
     543                     AP_SGLIST,    io->pSGList + sg_indx, (u16) sg_cnt,
     544                     AP_DEVICE,    0x4000,
     545                     AP_END);
     546      }
     547
    529548    } else {
    530549      rc = ata_cmd(ai, p, d, slot, ATA_CMD_READ,
     
    630649    sg_cnt = io->cSGList - sg_indx;
    631650
    632     if (sector >= (1UL << 28) || count > 256) {
     651    if (sector >= (1UL << 28) || count > 256 || add_workspace(iorb)->is_ncq) {
    633652      /* need LBA48 for this command */
    634653      if (!ai->ports[p].devs[d].lba48) {
     
    636655        return(-1);
    637656      }
    638       rc = ata_cmd(ai, p, d, slot, ATA_CMD_WRITE_EXT,
    639                    AP_SECTOR_48, (u32) sector, (u16) 0,
    640                    AP_COUNT,     (u16) count,
    641                    AP_SGLIST,    io->pSGList + sg_indx, (u16) sg_cnt,
    642                    AP_DEVICE,    0x4000,
    643                    AP_WRITE,
    644                    AP_END);
     657      if (add_workspace(iorb)->is_ncq) {
     658        /* use NCQ write; count goes into feature register, tag into count! */
     659        rc = ata_cmd(ai, p, d, slot, ATA_CMD_FPDMA_WRITE,
     660                     AP_SECTOR_48, (u32) sector, (u16) 0,
     661                     AP_FEATURES,  (u16) count,
     662                     AP_COUNT,     (u16) slot, /* tag = slot */
     663                     AP_SGLIST,    io->pSGList + sg_indx, (u16) sg_cnt,
     664                     AP_DEVICE,    0xc000,   /* force unit access (FUA) */
     665                     AP_WRITE,     1,
     666                     AP_END);
     667      } else {
     668        rc = ata_cmd(ai, p, d, slot, ATA_CMD_WRITE_EXT,
     669                     AP_SECTOR_48, (u32) sector, (u16) 0,
     670                     AP_COUNT,     (u16) count,
     671                     AP_SGLIST,    io->pSGList + sg_indx, (u16) sg_cnt,
     672                     AP_DEVICE,    0x4000,
     673                     AP_WRITE,     1,
     674                     AP_END);
     675      }
     676     
    645677    } else {
    646678      rc = ata_cmd(ai, p, d, slot, ATA_CMD_WRITE,
     
    699731int ata_execute_ata(IORBH _far *iorb, int slot)
    700732{
    701   iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED);
    702   return(-1);
     733  IORB_ADAPTER_PASSTHRU _far *apt = (IORB_ADAPTER_PASSTHRU _far *) iorb;
     734  AD_INFO *ai = ad_infos + iorb_unit_adapter(iorb);
     735  int p = iorb_unit_port(iorb);
     736  int d = iorb_unit_device(iorb);
     737  int rc;
     738
     739  if (apt->ControllerCmdLen != sizeof(ATA_CMD)) {
     740    iorb_seterr(iorb, IOERR_CMD_SYNTAX);
     741    return(-1);
     742  }
     743
     744  rc = ata_cmd(ai, p, d, slot, 0,
     745               AP_SGLIST,   apt->pSGList, apt->ppSGLIST,
     746               AP_ATA_CMD,  apt->pControllerCmd,
     747               AP_WRITE,    !(apt->Flags & PT_DIRECTION_IN),
     748               AP_END);
     749
     750  return(rc);
    703751}
    704752
     
    745793  }
    746794
    747   /* TBD: fill in SCSI sense buffer in IORB */
    748 
    749795  /* Return an error to indicate there's no HW command to be submitted and
    750796   * that the IORB can be completed "as is" (the upstream code expects the
  • trunk/src/os2ahci/ata.h

    r12 r13  
    389389 */
    390390typedef enum {
    391   AP_FEATURES,     /* [u16]              ATA command features (read: flags) */
    392   AP_COUNT,        /* [u16]              number of sectors (0 = 65536)      */
    393   AP_SECTOR_28,    /* [u32]              28-bit sector address              */
    394   AP_SECTOR_48,    /* [u32, u16]         48-bit sector address              */
    395   AP_DEVICE,       /* [u16]              ATA command "device" field (LSB ignored) */
    396   AP_SGLIST,       /* [void _far *, u16] buffer S/G (SCATGATENTRY/count)    */
    397   AP_VADDR,        /* [void _far *, u16] buffer virtual address (buf/len)   */
    398   AP_WRITE,        /* []                 indicates a DMA write operation    */
    399   AP_AHCI_FLAGS,   /* [u16]              AHCI command header flags          */
    400   AP_ATAPI_CMD,    /* [void _far *, u16] ATAPI command (CDB) and length     */
    401   AP_END           /* []                 end of variable argument list      */
     391  AP_FEATURES,     /* [u16]               ATA command features (read: flags) */
     392  AP_COUNT,        /* [u16]               number of sectors (0 = 65536)      */
     393  AP_SECTOR_28,    /* [u32]               28-bit sector address              */
     394  AP_SECTOR_48,    /* [u32, u16]          48-bit sector address              */
     395  AP_DEVICE,       /* [u16]               ATA cmd "device" field (LSB masked) */
     396  AP_SGLIST,       /* [void _far *, u16]  buffer S/G (SCATGATENTRY/count)    */
     397  AP_VADDR,        /* [void _far *, u16]  buffer virtual address (buf/len)   */
     398  AP_WRITE,        /* [u16]               if != 0, data is written to device */
     399  AP_AHCI_FLAGS,   /* [u16]               AHCI command header flags          */
     400  AP_ATAPI_CMD,    /* [void _far *, u16]  ATAPI command (CDB) and length     */
     401  AP_ATA_CMD,      /* [void _far *]       ATA command (fixed len)            */
     402  AP_END           /* []                  end of variable argument list      */
    402403} ATA_PARM;
    403404
  • trunk/src/os2ahci/atapi.c

    r12 r13  
    8989
    9090/******************************************************************************
    91  * Request sense information.
     91 * Request sense information for a failed command.
     92 *
     93 * NOTE: This function must be called right after an ATAPI command has failed
     94 *       and before any other commands are queued on the corresponding device.
     95 *       This function is typically called in the port restart context hook
     96 *       which is triggered by an AHCI error interrupt.
     97 *
    9298 */
    9399int atapi_req_sense(IORBH _far *iorb, int slot)
  • trunk/src/os2ahci/init.asm

    r12 r13  
    158158
    159159
    160 ; Write long value to MMIO address;  need to do this here to get real
     160; Write long value to MMIO address; need to do this here to get real
    161161; 32-bit operations because at least the AHCI device in VirtualBox doesn't
    162162; seem to support reading 32-bit MMIO registers in two 16-bit steps and the
     
    182182                ; print debug message if debug level is 3+
    183183                CMP     _debug, 3
    184                 JB      no_debug2
     184                JB      no_debug
    185185                MOV     BX, AX          ; addr & 0x7f (port reg index)
    186186                AND     BX, 7FH
     
    193193                ADD     SP, 12
    194194
    195 no_debug2:      LEAVE
     195no_debug:       LEAVE
    196196                RET
    197197_writel         ENDP
  • trunk/src/os2ahci/libc.c

    r12 r13  
    2727                                       * for printing custom messages via
    2828                                       * DevHelp_Save_Message() */
    29 
    30 #define COM_BASE              0x03f8  /* base address of COM port (COM1) */
    3129
    3230/* heap management constants */
     
    5452
    5553/* ------------------------ global/static variables ------------------------ */
     54
     55/* debug COM port base address */
     56u16 com_base = 0x03f8;
    5657
    5758static char  hex_digits[] = "0123456789abcdef";
     
    99100
    100101  for (i = 0; com1_init_sequence[i].reg != -1; i++) {
    101     u16 port = COM_BASE + com1_init_sequence[i].reg;
     102    u16 port = com_base + com1_init_sequence[i].reg;
    102103    u8  data = com1_init_sequence[i].data;
    103104    _asm {
     
    248249     * The C equivalent would look like this:
    249250     *
    250      *   while (!(inp(COM_BASE + 5) & 0x20));
    251      *   outp(COM_BASE, *s);
     251     *   while (!(inp(com_base + 5) & 0x20));
     252     *   outp(com_base, *s);
    252253     */
    253254
    254255    _asm {
    255256      /* wait until COM transmitter is idle */
    256       mov  dx, COM_BASE + 5;
     257      mov  dx, com_base;
     258      add  dx, 5;
    257259    transmitter_not_idle:
    258260      in   al, dx;
     
    261263
    262264      /* output character to be sent */
    263       mov  dx, COM_BASE;
     265      mov  dx, com_base;
    264266      mov  bx, s;
    265267      mov  al, [bx];
     
    655657int disable(void)
    656658{
    657   int rc = 0;
     659  int rc;
    658660
    659661  _asm {
  • trunk/src/os2ahci/os2ahci.c

    r12 r13  
    3232      goto init_fail;                                     \
    3333    }                                                     \
    34     value = (type) strtol((s) + 2,                        \
    35                           (const char _far* _far*) &_ep,  \
    36                           radix);                         \
     34    value = (type) strtol((s) + 2, &_ep, radix);          \
    3735    s = _ep;                                              \
    3836  }
    39 
    40 
    41 /* MT: got to fix include paths... */
    42 #ifndef IOCM_EXECUTE_ATA
    43 #define IOCM_EXECUTE_ATA 0x0003
    44 #endif
    4537
    4638/* ------------------------ typedefs and structures ------------------------ */
     
    8476
    8577/* apapter/port-specific options saved when parsing the command line */
    86 int             link_speed[MAX_AD][AHCI_MAX_PORTS];
     78u8              link_speed[MAX_AD][AHCI_MAX_PORTS];
     79u8              disable_ncq[MAX_AD][AHCI_MAX_PORTS];
    8780
    8881static char     init_msg[] = "OS2AHCI driver version %d.%02d\n";
     
    123116  DDD_PARM_LIST _far *ddd_pl = (DDD_PARM_LIST _far *) req->InitArgs;
    124117  APIRET rmrc;
     118  PSEL p;
    125119  char _far *cmd_line;
     120  char _far *ep;
    126121  char _far *s;
    127122  int adapter_index;
     
    159154      s++;
    160155      switch(tolower(*s)) {
     156
     157      case 'c':
     158        /* set COM port base address for debug messages */
     159        drv_parm_int(s, com_base, u16, 16);
     160        break;
    161161
    162162      case 'd':
     
    210210        break;
    211211
     212      case 'n':
     213        /* disable NCQ on this port */
     214        drv_parm_int(s, disable_ncq[adapter_index][port_index], u8, 10);
     215        break;
     216
    212217      default:
    213218        cprintf("invalid option: /%c\n", *s);
     
    382387 * - This function is expected to be called with the spinlock aquired
    383388 *
    384  * - The handler functions are free to process more than one IORB (i.e.
    385  *   command queuing). The idea is that the root IORB (and potential next
    386  *   IORBs) are marked as "processing" which keeps trigger_engine() from
    387  *   touching this IORB queue until all of those IORBs have completed
    388  *   processing and have been removed from the queue.
    389  *
    390389 * - Adapters can be flagged as 'busy' which means no new IORBs are sent (they
    391390 *   just remain in the queue). This can be used to release the driver-level
     
    394393 *   need to invoke trigger_engine() after resetting the busy flag.
    395394 *
    396  *   - Handlers that use the adapter 'busy' flag when processing driver-level
    397  *     IORBs don't need to protect themselves against new IORBs on the driver
    398  *     level because those will always be queued at the end of the driver-
    399  *     level queue (there are no driver-level priority IORBs).
     395 * - Driver-level IORBs are not synchronized by adapter-level 'busy' flags.
     396 *   However, the driver-level queue is worked "one entry at a time" which
     397 *   means that no new IORBs will be queued on the driver-level queue until
     398 *   the head element has completed processing. This means that driver-
     399 *   level IORB handlers don't need to protect against each other. But they
     400 *   they do need to keep in mind interference with port-level IORBs:
     401 *
     402 *   - Driver-level IORB handlers must obtain the spinlock and/or flag all
     403 *     adapters as 'busy' which are affected by the driver-level IORB
     404 *
     405 *   - Driver-level IORB handlers must not access the hardware of a
     406 *     particular adapter if it's flagged as 'busy'
    400407 */
    401408int trigger_engine_1(void)
    402409{
    403410  IORBH _far *iorb;
     411  IORBH _far *next;
    404412  int iorbs_sent = 0;
    405413  int a;
     
    422430    }
    423431    for (p = 0; p <= ai->port_max; p++) {
    424       if ((iorb = ai->ports[p].iorb_queue.root) != NULL &&
    425           !add_workspace(iorb)->processing) {
    426         send_iorb(iorb);
    427         iorbs_sent++;
     432      /* send all queued IORBs on this port */
     433      next = NULL;
     434      for (iorb = ai->ports[p].iorb_queue.root; iorb != NULL; iorb = next) {
     435        next = iorb->pNxtIORB;
     436        if (!add_workspace(iorb)->processing) {
     437          send_iorb(iorb);
     438          iorbs_sent++;
     439        }
    428440      }
    429441    }
     
    447459   * invocations of trigger_engine() (e.g. at interrupt time) will ignore this
    448460   * IORB.
    449    *
    450    * NOTE: Handler functions are free to look at follow-up IORBs in order to
    451    *       queue them to the hardware (native command queueing). If they
    452    *       choose to do so, they must mark those IORBs as "processing" as
    453    *       well.
    454461   */
    455462  add_workspace(iorb)->processing = 1;
     
    511518     * use interrupts, timers and context hooks instead of polling).
    512519     */
    513     dprintf("leaving initialization mode\n");
    514     spin_lock(drv_lock);
    515520    if (!init_complete) {
     521      dprintf("leaving initialization mode\n");
     522      spin_lock(drv_lock);
    516523      for (a = 0; a < ad_info_cnt; a++) {
    517524        ahci_complete_init(ad_infos + a);
    518525      }
    519526      init_complete = 1;
    520     }
    521     spin_unlock(drv_lock);
     527      spin_unlock(drv_lock);
     528    }
    522529    iorb_done(iorb);
    523530    break;
     
    540547void iocc_device_control(IORBH _far *iorb)
    541548{
    542   AD_INFO *ai;
     549  AD_INFO *ai = ad_infos + iorb_unit_adapter(iorb);
    543550  IORBH _far *ptr;
    544551  IORBH _far *next = NULL;
    545   int a = iorb_unit_adapter(iorb);
    546552  int p = iorb_unit_port(iorb);
    547553  int d = iorb_unit_device(iorb);
     
    551557  case IOCM_ABORT:
    552558    /* abort all pending commands on specified port and device */
    553     ai = ad_infos + a;
    554559    spin_lock(drv_lock);
    555560    for (ptr = ai->ports[p].iorb_queue.root; ptr != NULL; ptr = next) {
     
    762767            ui->UnitHandle   = iorb_unit(a, p, d);
    763768            ui->UnitType     = ad_info->ports[p].devs[d].dev_type;
    764             ui->QueuingCount = AHCI_MAX_CMDS;
     769            ui->QueuingCount = ad_info->ports[p].devs[d].ncq_max;;
    765770            if (ad_info->ports[p].devs[d].removable) {
    766771              ui->UnitFlags |= UF_REMOVABLE;
     
    865870
    866871  case IOCM_EXECUTE_CDB:
     872    add_workspace(iorb)->idempotent = 0;
    867873    ahci_execute_cdb(iorb);
    868874    break;
    869875
    870876  case IOCM_EXECUTE_ATA:
     877    add_workspace(iorb)->idempotent = 0;
    871878    ahci_execute_ata(iorb);
    872879    break;
     
    900907  }
    901908
    902   ddprintf("IORB queued:  %d/%d (queue = %Fp, IORB = %Fp)\n",
    903            iorb->CommandCode, iorb->CommandModifier, queue, iorb);
     909  dprintf("IORB queued:  %d/%d (queue = %Fp, IORB = %Fp)\n",
     910          iorb->CommandCode, iorb->CommandModifier, queue, iorb);
    904911}
    905912
     
    931938
    932939  if (found) {
    933     ddprintf("IORB removed: %d/%d (queue = %Fp, IORB = %Fp) - %04x/%04x\n",
    934              iorb->CommandCode, iorb->CommandModifier, queue, iorb,
    935              iorb->Status, iorb->ErrorCode);
     940    dprintf("IORB removed: %d/%d (queue = %Fp, IORB = %Fp) - %04x/%04x\n",
     941            iorb->CommandCode, iorb->CommandModifier, queue, iorb,
     942            iorb->Status, iorb->ErrorCode);
    936943  } else {
    937     ddprintf("IORB %Fp not found in queue %Fp\n", iorb, queue);
     944    dprintf("IORB %Fp not found in queue %Fp\n", iorb, queue);
    938945  }
    939946
  • trunk/src/os2ahci/os2ahci.h

    r12 r13  
    261261  IORB_QUEUE    iorb_queue;            /* IORB queue for this port */
    262262  unsigned      dev_max   : 4;         /* maximum device number on this port (0-15) */
    263   unsigned      cmd_slot  : 4;         /* current command slot index (using round-
     263  unsigned      cmd_slot  : 5;         /* current command slot index (using round-
    264264                                        * robin indexes to prevent starvation) */
    265265
     
    284284  PCI_ID       *pci;                   /* pointer to corresponding PCI ID */
    285285
    286   unsigned      port_max : 4;          /* maximum port number (0-31) */
    287   unsigned      cmd_max : 4;           /* maximum cmd slot number (0-31) */
     286  unsigned      port_max : 5;          /* maximum port number (0-31) */
     287  unsigned      cmd_max : 5;           /* maximum cmd slot number (0-31) */
    288288  unsigned      port_scan_done : 1;    /* if != 0, port scan already done */
    289289  unsigned      busy : 1;              /* if != 0, adapter is busy */
     
    327327  unsigned      is_ncq        : 1;     /* should use native command queueing */
    328328  unsigned      complete      : 1;     /* IORB has completed processing */
    329   unsigned      cmd_slot      : 4;     /* AHCI command slot for this IORB */
     329  unsigned      cmd_slot      : 5;     /* AHCI command slot for this IORB */
    330330} ADD_WORKSPACE;
    331331
     
    452452extern int           init_complete; /* if != 0, initialization has completed */
    453453
     454extern u16           com_base;      /* debug COM port base address */
     455
    454456/* port restart context hook and input data */
    455457extern ULONG         restart_ctxhook_h;
     
    465467
    466468/* apapter/port-specific options saved when parsing the command line */
    467 extern int           link_speed[MAX_AD][AHCI_MAX_PORTS];
    468 
     469extern u8            link_speed[MAX_AD][AHCI_MAX_PORTS];
     470extern u8            disable_ncq[MAX_AD][AHCI_MAX_PORTS];
     471
  • trunk/src/os2ahci/pci.c

    r12 r13  
    483483  UCHAR dev_func  = data->find_class.dev_func;
    484484  ULONG val;
     485  UCHAR rc;
    485486  SEL gdt[PORT_DMA_BUF_SEGS + 1];
    486487  char tmp[40];
     
    829830{
    830831  void (_far *func)(void);
    831   unsigned short prot_idc_DS;
    832832  RP_GENIOCTL ioctl;
    833833
     
    867867  func = oemhlp.ProtIDCEntry;
    868868
    869   /* MT: the Watcom inline assembler does not support struct member reference,
    870    * so we have to pass it in a stack variable
    871    */
    872   prot_idc_DS = oemhlp.ProtIDC_DS;
    873 
    874869  _asm {
    875870    push ds;
     
    882877    pop  es
    883878    lea  bx, ioctl;
    884     mov  ds, prot_idc_DS;
     879    mov  ds, oemhlp.ProtIDC_DS;
    885880    call dword ptr [func];
    886881
Note: See TracChangeset for help on using the changeset viewer.