Ignore:
Timestamp:
Mar 6, 2021, 7:44:15 PM (4 years ago)
Author:
David Azarewicz
Message:

Debugging support changes.

File:
1 edited

Legend:

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

    r208 r209  
    263263      if ((sg_addr & 1) || (chunk & 1))
    264264      {
    265         DPRINTF(0,"warning: ata_cmd() called with unaligned S/G element(s)\n");
     265        DPRINTF(0, DBG_PREFIX": warning: ata_cmd() called with unaligned S/G element(s)\n");
    266266        return(ATA_CMD_UNALIGNED_ADDR);
    267267      }
     
    277277  cmd_hdr->options |= n << 16;
    278278
    279   #ifdef DEBUG
    280   if ((D32g_DbgLevel >= 5) /*|| (atapi_cmd != NULL)*/)
    281   {
    282     DPRINTF(0,"ATA command for %d.%d.%d, slot %d:\n", ad_no(ai), p, d, slot);
    283     dHexDump(0,cmd_hdr, offsetof(AHCI_CMD_HDR, reserved), "cmd_hdr: ");
    284     dHexDump(0,&ata_cmd, sizeof(ata_cmd), "ata_cmd: ");
    285     if (atapi_cmd != NULL)
    286     {
    287       dHexDump(0,atapi_cmd, atapi_cmd_len, "atapi_cmd: ");
    288     }
    289     if (n > 0)
    290     {
    291       dHexDump(0,cmd_tbl->sg_list, sizeof(*cmd_tbl->sg_list) * n, "sg_list: ");
    292     }
     279  #if DEBUG & DBG_DETAILED
     280  dprintf(0,"ATA command for %d.%d.%d, slot %d:\n", ad_no(ai), p, d, slot);
     281  dHexDump(0,cmd_hdr, offsetof(AHCI_CMD_HDR, reserved), "cmd_hdr: ");
     282  dHexDump(0,&ata_cmd, sizeof(ata_cmd), "ata_cmd: ");
     283  if (atapi_cmd != NULL)
     284  {
     285    dHexDump(0,atapi_cmd, atapi_cmd_len, "atapi_cmd: ");
     286  }
     287  if (n > 0)
     288  {
     289    dHexDump(0,cmd_tbl->sg_list, sizeof(*cmd_tbl->sg_list) * n, "sg_list: ");
    293290  }
    294291  #endif
     
    447444  if (rc) return 0;
    448445
    449   DHEXDUMP(5,pDLA, sizeof(DLA_Table_Sector), "DLA sector %d:\n", sector-1);
     446  DHEXDUMP(DBG_DETAILED, pDLA, sizeof(DLA_Table_Sector), "DLA sector %d:\n", sector-1);
    450447
    451448  if ((pDLA->DLA_Signature1 == DLA_TABLE_SIGNATURE1) && (pDLA->DLA_Signature2 == DLA_TABLE_SIGNATURE2))
    452449  {
    453     DPRINTF(3,__func__": DLA found at sector %d\n", sector-1);
     450    DPRINTF(DBG_ATTACH, DBG_PREFIX": DLA found at sector %d\n", sector-1);
    454451    geometry->TotalCylinders = pDLA->Cylinders;
    455452    geometry->NumHeads = pDLA->Heads_Per_Cylinder;
     
    482479  int p = iorb_unit_port(pIorb);
    483480  int d = iorb_unit_device(pIorb);
    484   DPRINTF(3,__func__" (%d.%d.%d)\n", ad_no(ai), p, d);
     481  dprintf(DBG_DETAILED, DBG_PREFIX": (%d.%d.%d)\n", ad_no(ai), p, d);
    485482  #endif
    486483
     
    607604  }
    608605
    609   DPRINTF(2,"Physical geometry: %d cylinders, %d heads, %d sectors per track (%dMB) (%s)\n",
     606  DPRINTF(DBG_ATTACH, DBG_PREFIX": Physical geometry: %d cylinders, %d heads, %d sectors per track (%dMB) (%s)\n",
    610607      geometry->TotalCylinders, geometry->NumHeads, geometry->SectorsPerTrack,
    611608      (ULONG)(ullTotalSectors / 2048), Method);
     
    616613  else ullTotalSectors = geometry->TotalSectors;
    617614
    618   ad_infos[a].ports[p].devs[0].dev_info.Cylinders = geometry->TotalCylinders;
    619   ad_infos[a].ports[p].devs[0].dev_info.HeadsPerCylinder = geometry->NumHeads;
    620   ad_infos[a].ports[p].devs[0].dev_info.SectorsPerTrack = geometry->SectorsPerTrack;
    621   ad_infos[a].ports[p].devs[0].dev_info.TotalSectors = ullTotalSectors;
    622   ad_infos[a].ports[p].devs[0].dev_info.Method = Method;
     615  ad_infos[a].ports[p].devs[0].dev_info.ulCylinders = geometry->TotalCylinders;
     616  ad_infos[a].ports[p].devs[0].dev_info.usHeadsPerCylinder = geometry->NumHeads;
     617  ad_infos[a].ports[p].devs[0].dev_info.usSectorsPerTrack = geometry->SectorsPerTrack;
     618  ad_infos[a].ports[p].devs[0].dev_info.ullTotalSectors = ullTotalSectors;
     619  ad_infos[a].ports[p].devs[0].dev_info.pMethod = Method;
    623620
    624621  //DAZ DPRINTF(2,"Reported geometry: %d cylinders, %d heads, %d sectors per track (%dMB) (%s)\n",
    625   DPRINTF(0,"Reported geometry: %d cylinders, %d heads, %d sectors per track (%dMB) (%s)\n",
     622  DPRINTF(DBG_ATTACH, DBG_PREFIX": Reported geometry: %d cylinders, %d heads, %d sectors per track (%dMB) (%s)\n",
    626623      geometry->TotalCylinders, geometry->NumHeads, geometry->SectorsPerTrack,
    627624      (ULONG)(ullTotalSectors / 2048), Method);
     
    799796  }
    800797
    801   DPRINTF(7,"ata_read_unaligned(%d.%d.%d, %lld)\n", ad_no(ai), p, d, ullLba);
     798  DPRINTF(DBG_DETAILED, DBG_PREFIX": ata_read_unaligned(%d.%d.%d, %lld)\n", ad_no(ai), p, d, ullLba);
    802799  ai->ports[p].unaligned_read_count++;
    803800
     
    848845
    849846  io->BlocksXferred += add_workspace(pIorb)->blocks;
    850   DPRINTF(7,__func__": blocks transferred = %d\n", io->BlocksXferred);
     847  DPRINTF(DBG_DETAILED, DBG_PREFIX": blocks transferred = %d\n", io->BlocksXferred);
    851848
    852849  if (io->BlocksXferred >= io->BlockCount)
     
    10591056  }
    10601057
    1061   DPRINTF(7,"ata_write_unaligned(%d.%d.%d, %lld)\n", ad_no(ai), p, d, ullLba);
     1058  DPRINTF(DBG_DETAILED, DBG_PREFIX": ata_write_unaligned(%d.%d.%d, %lld)\n", ad_no(ai), p, d, ullLba);
    10621059
    10631060  /* allocate transfer buffer */
     
    11061103
    11071104  io->BlocksXferred += add_workspace(pIorb)->blocks;
    1108   DPRINTF(7,"ata_write_pp(): blocks transferred = %d\n", io->BlocksXferred);
     1105  DPRINTF(DBG_DETAILED, DBG_PREFIX": ata_write_pp(): blocks transferred = %d\n", io->BlocksXferred);
    11091106
    11101107  if (io->BlocksXferred >= io->BlockCount)
     
    11761173  {
    11771174    /* this is not a D2H FIS - give up silently */
    1178     DPRINTF(3,"ata_execute_ata_pp(): D2H FIS type incorrect: %d\n", fis[0]);
     1175    DPRINTF(DBG_DETAILED, DBG_PREFIX": ata_execute_ata_pp(): D2H FIS type incorrect: %d\n", fis[0]);
    11791176    add_workspace(pIorb)->complete = 1;
    11801177    return;
     
    11971194                | ((u16) fis[13] << 8);
    11981195
    1199   DHEXDUMP(5,cmd, sizeof(*cmd), "ahci_execute_ata_pp(): cmd after completion:\n");
     1196  DHEXDUMP(DBG_DETAILED, cmd, sizeof(*cmd), "ahci_execute_ata_pp(): cmd after completion:\n");
    12001197
    12011198  /* signal completion to interrupt handler */
Note: See TracChangeset for help on using the changeset viewer.