source: trunk/src/os2ahci/trace.c

Last change on this file was 211, checked in by David Azarewicz, 2 years ago

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 size: 3.0 KB
RevLine 
[205]1/**
[114]2 *
[211]3 * Copyright (c) 2013-2023 David Azarewicz <david@88watts.net>
[114]4 *
5 */
6
[207]7#define INCL_LONGLONG
[114]8#include "os2ahci.h"
9
[205]10/**
[154]11 * Create adapter/port/device list for user output.
12 */
[178]13void build_user_info(void)
[154]14{
15 int a;
16 int p;
17 int d;
[193]18 int iFlag;
[154]19
[178]20 for (a = 0; a < ad_info_cnt; a++)
21 {
[154]22 AD_INFO *ai = ad_infos + a;
23
[211]24 dprintf(0,"Adapter %d: %d:%d:%d ID=%04x:%04x %s %s irq=%d adr=%x version=%x\n", a,
25 PCI_BUS_FROM_BDF(ai->BusDevFunc), PCI_DEV_FROM_BDF(ai->BusDevFunc),
26 PCI_FUNC_FROM_BDF(ai->BusDevFunc),
27 ai->PciVendor, ai->PciDevice, vendor_from_id(ai->PciVendor), ai->pChipName,
[164]28 ai->irq, ai->mmio_phys,
29 ai->bios_config[HOST_VERSION / sizeof(u32)]);
[154]30
[200]31 for (p = 0; p <= ai->port_max; p++)
[178]32 {
[154]33 P_INFO *pi = &ai->ports[p];
[193]34 iFlag = 1;
[154]35
[178]36 for (d = 0; d <= pi->dev_max; d++)
37 {
[193]38 if (pi->devs[d].present)
[178]39 {
[207]40 if (iFlag) dprintf(0," Port %d:", p);
[193]41 iFlag = 0;
[184]42 if (pi->devs[d].atapi) dprintf(0," atapi");
43 if (pi->devs[d].removable) dprintf(0," removable");
[209]44 if (pi->devs[d].dev_info.pMethod != NULL)
[178]45 {
[184]46 dprintf(0," %d cylinders, %d heads, %d sectors per track (%dMB) (%s)",
[209]47 pi->devs[d].dev_info.ulCylinders, pi->devs[d].dev_info.usHeadsPerCylinder,
48 pi->devs[d].dev_info.usSectorsPerTrack,
49 (ULONG)(pi->devs[d].dev_info.ullTotalSectors/2048), pi->devs[d].dev_info.pMethod);
[181]50 }
[207]51 if (pi->devs[d].ignored) dprintf(0," Unusable");
[184]52 dprintf(0,"\n");
[207]53 dprintf(0," Model: %s\n", pi->devs[d].dev_name);
[193]54 }
[209]55 else if (iVerbose > 0)
[193]56 {
[207]57 if (iFlag) dprintf(0," Port %d: No drive present\n", p);
[169]58 } /* if */
59 } /* for d */
60 } /* for p */
61 } /* for a */
[154]62}
63
[178]64#ifdef DEBUG
[211]65void DumpIorb(IORBH *pIorb, IORBH FAR16DATA *vIorb)
[178]66{
[211]67 //if (!(D32g_DbgLevel & DBG_DETAILED)) return;
68 if (ad_infos[iorb_unit_adapter(pIorb)].ports[iorb_unit_port(pIorb)].devs[iorb_unit_device(pIorb)].atapi) return;
[186]69
70 dprintf(0,"IORB %x: Size=%x Len=%x Handle=%x CmdCode=%x\n",
[211]71 vIorb, sizeof(IORBH), pIorb->Length, pIorb->UnitHandle, pIorb->CommandCode);
[186]72 dprintf(0," CmdMod=%x ReqCtrl=%x Status=%x ErrorCode=%x\n",
[178]73 pIorb->CommandModifier, pIorb->RequestControl, pIorb->Status, pIorb->ErrorCode);
[204]74 dprintf(0," Timeout=%x StatusBlkLen=%x pStatusBlk=%x Res=%x f16NxtIORB=%x\n",
[178]75 pIorb->Timeout, pIorb->StatusBlockLen, pIorb->pStatusBlock, pIorb->Reserved_1,
[204]76 pIorb->f16NxtIORB);
[211]77
78 if (pIorb->CommandCode == IOCC_EXECUTE_IO || pIorb->CommandCode == IOCC_EXECUTE_IO_64)
79 {
80 IORB_EXECUTEIO64 *pIo = (IORB_EXECUTEIO64*)pIorb;
81 ULONGLONG ullLba;
82
83 ullLba = pIo->RBA;
84 if (pIorb->CommandCode == IOCC_EXECUTE_IO_64) ullLba = pIo->ullRBA;
85
86 dprintf(0," I/O: Block=%llx Count=%x Xferred=%x Size=%x Flags=%x\n",
87 ullLba, pIo->BlockCount, pIo->BlocksXferred, pIo->BlockSize, pIo->Flags);
88 }
[178]89}
90#endif
91
Note: See TracBrowser for help on using the repository browser.