Changeset 209 for trunk/src/os2ahci/ata.c
- Timestamp:
- Mar 6, 2021, 7:44:15 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ata.c
r208 r209 263 263 if ((sg_addr & 1) || (chunk & 1)) 264 264 { 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"); 266 266 return(ATA_CMD_UNALIGNED_ADDR); 267 267 } … … 277 277 cmd_hdr->options |= n << 16; 278 278 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: "); 293 290 } 294 291 #endif … … 447 444 if (rc) return 0; 448 445 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); 450 447 451 448 if ((pDLA->DLA_Signature1 == DLA_TABLE_SIGNATURE1) && (pDLA->DLA_Signature2 == DLA_TABLE_SIGNATURE2)) 452 449 { 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); 454 451 geometry->TotalCylinders = pDLA->Cylinders; 455 452 geometry->NumHeads = pDLA->Heads_Per_Cylinder; … … 482 479 int p = iorb_unit_port(pIorb); 483 480 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); 485 482 #endif 486 483 … … 607 604 } 608 605 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", 610 607 geometry->TotalCylinders, geometry->NumHeads, geometry->SectorsPerTrack, 611 608 (ULONG)(ullTotalSectors / 2048), Method); … … 616 613 else ullTotalSectors = geometry->TotalSectors; 617 614 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; 623 620 624 621 //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", 626 623 geometry->TotalCylinders, geometry->NumHeads, geometry->SectorsPerTrack, 627 624 (ULONG)(ullTotalSectors / 2048), Method); … … 799 796 } 800 797 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); 802 799 ai->ports[p].unaligned_read_count++; 803 800 … … 848 845 849 846 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); 851 848 852 849 if (io->BlocksXferred >= io->BlockCount) … … 1059 1056 } 1060 1057 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); 1062 1059 1063 1060 /* allocate transfer buffer */ … … 1106 1103 1107 1104 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); 1109 1106 1110 1107 if (io->BlocksXferred >= io->BlockCount) … … 1176 1173 { 1177 1174 /* 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]); 1179 1176 add_workspace(pIorb)->complete = 1; 1180 1177 return; … … 1197 1194 | ((u16) fis[13] << 8); 1198 1195 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"); 1200 1197 1201 1198 /* signal completion to interrupt handler */
Note:
See TracChangeset
for help on using the changeset viewer.