Ignore:
Timestamp:
Jul 24, 2023, 5:51:46 PM (2 years ago)
Author:
David Azarewicz
Message:

Added workaround to help with VirtualBox issues.
Improved diagnostic messages.
Changed how timeouts are reset and how ctx hooks are triggered.
Added quirk for devices with issues executing some standard commands.
Changed to make /N the default.

File:
1 edited

Legend:

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

    r209 r211  
    44 * Copyright (c) 2011 thi.guten Software Development
    55 * Copyright (c) 2011 Mensys B.V.
    6  * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net>
     6 * Copyright (c) 2013-2023 David Azarewicz <david@88watts.net>
    77 *
    88 * Authors: Christian Mueller, Markus Thielen
     
    121121      if (ata_cmd.lba_l & 0xf0000000UL)
    122122      {
    123         dprintf(0,"error: LBA-28 address %d has more than 28 bits\n", ata_cmd.lba_l);
     123        dprintf(0, DBG_PREFIX": error: LBA-28 address %d has more than 28 bits\n", ata_cmd.lba_l);
    124124        return(ATA_CMD_INVALID_PARM);
    125125      }
     
    172172
    173173    default:
    174       dprintf(0,"error: v_ata_cmd() called with invalid parameter type (%d)\n", (int) ap);
     174      dprintf(0, DBG_PREFIX": error: called with invalid parameter type (%d)\n", (int) ap);
    175175      return(ATA_CMD_INVALID_PARM);
    176176    }
     
    255255        if (sg_size)
    256256        {
    257           dprintf(0, __func__": unaligned SG element\n");
     257          dprintf(0, DBG_PREFIX": unaligned SG element\n");
    258258          return -1;
    259259        }
    260         dprintf(0, __func__": too many S/G elements\n");
     260        dprintf(0, DBG_PREFIX": too many S/G elements\n");
    261261        return(i - 1);
    262262      }
    263263      if ((sg_addr & 1) || (chunk & 1))
    264264      {
    265         DPRINTF(0, DBG_PREFIX": warning: ata_cmd() called with unaligned S/G element(s)\n");
     265        DPRINTF(0, DBG_PREFIX": warning: called with unaligned S/G element(s)\n");
    266266        return(ATA_CMD_UNALIGNED_ADDR);
    267267      }
     
    278278
    279279  #if DEBUG & DBG_DETAILED
    280   dprintf(0,"ATA command for %d.%d.%d, slot %d:\n", ad_no(ai), p, d, slot);
     280  dprintf(0, DBG_PREFIX": ATA command for %d.%d.%d, slot %d:\n", ad_no(ai), p, d, slot);
    281281  dHexDump(0,cmd_hdr, offsetof(AHCI_CMD_HDR, reserved), "cmd_hdr: ");
    282282  dHexDump(0,&ata_cmd, sizeof(ata_cmd), "ata_cmd: ");
     
    549549    {
    550550      /* more than 32 bits for number of sectors */
    551       dprintf(0,"warning: limiting disk %d.%d.%d to 2TB\n",
     551      dprintf(0, DBG_PREFIX": warning: limiting disk %d.%d.%d to 2TB\n",
    552552              iorb_unit_adapter(pIorb), iorb_unit_port(pIorb),
    553553              iorb_unit_device(pIorb));
     
    651651  int rc;
    652652
    653   if (ullLba >= (1UL << 28) || count > 256 || add_workspace(pIorb)->is_ncq)
     653  if (add_workspace(pIorb)->is_ncq || ullLba >= (1 << 28) || count > 256 || (ullLba+count) >= (1 << 28))
    654654  {
    655655    /* need LBA48 for this command */
Note: See TracChangeset for help on using the changeset viewer.