source: trunk/src/os2ahci/trace.c@ 207

Last change on this file since 207 was 207, checked in by David Azarewicz, 4 years ago

Add 64/48 bit LBA support.

File size: 2.5 KB
Line 
1/**
2 *
3 * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net>
4 *
5 */
6
7#define INCL_LONGLONG
8#include "os2ahci.h"
9
10/**
11 * Create adapter/port/device list for user output.
12 */
13void build_user_info(void)
14{
15 int a;
16 int p;
17 int d;
18 int iFlag;
19
20 for (a = 0; a < ad_info_cnt; a++)
21 {
22 AD_INFO *ai = ad_infos + a;
23
24 dprintf(0,"Adapter %d: PCI=%d:%d:%d ID=%04x:%04x %s %s irq=%d addr=0x%x version=%x\n", a,
25 PCI_BUS_FROM_BDF(ai->bus_dev_func), PCI_DEV_FROM_BDF(ai->bus_dev_func),
26 PCI_FUNC_FROM_BDF(ai->bus_dev_func),
27 ai->pci_vendor, ai->pci_device, vendor_from_id(ai->pci_vendor), ai->pci->chipname,
28 ai->irq, ai->mmio_phys,
29 ai->bios_config[HOST_VERSION / sizeof(u32)]);
30
31 for (p = 0; p <= ai->port_max; p++)
32 {
33 P_INFO *pi = &ai->ports[p];
34 iFlag = 1;
35
36 for (d = 0; d <= pi->dev_max; d++)
37 {
38 if (pi->devs[d].present)
39 {
40 if (iFlag) dprintf(0," Port %d:", p);
41 iFlag = 0;
42 if (pi->devs[d].atapi) dprintf(0," atapi");
43 if (pi->devs[d].removable) dprintf(0," removable");
44 if (pi->devs[d].dev_info.Method != NULL)
45 {
46 dprintf(0," %d cylinders, %d heads, %d sectors per track (%dMB) (%s)",
47 pi->devs[d].dev_info.Cylinders, pi->devs[d].dev_info.HeadsPerCylinder, pi->devs[d].dev_info.SectorsPerTrack,
48 (ULONG)(pi->devs[d].dev_info.TotalSectors/2048), pi->devs[d].dev_info.Method);
49 }
50 if (pi->devs[d].ignored) dprintf(0," Unusable");
51 dprintf(0,"\n");
52 dprintf(0," Model: %s\n", pi->devs[d].dev_name);
53 }
54 else if (verbosity > 0)
55 {
56 if (iFlag) dprintf(0," Port %d: No drive present\n", p);
57 } /* if */
58 } /* for d */
59 } /* for p */
60 } /* for a */
61}
62
63#ifdef DEBUG
64void DumpIorb(IORBH *pIorb)
65{
66 if (D32g_DbgLevel < 2) return;
67 if (!ad_infos[iorb_unit_adapter(pIorb)].ports[iorb_unit_port(pIorb)].devs[iorb_unit_device(pIorb)].atapi) return;
68
69 dprintf(0,"IORB %x: Size=%x Len=%x Handle=%x CmdCode=%x\n",
70 pIorb, sizeof(IORBH), pIorb->Length, pIorb->UnitHandle, pIorb->CommandCode);
71 dprintf(0," CmdMod=%x ReqCtrl=%x Status=%x ErrorCode=%x\n",
72 pIorb->CommandModifier, pIorb->RequestControl, pIorb->Status, pIorb->ErrorCode);
73 dprintf(0," Timeout=%x StatusBlkLen=%x pStatusBlk=%x Res=%x f16NxtIORB=%x\n",
74 pIorb->Timeout, pIorb->StatusBlockLen, pIorb->pStatusBlock, pIorb->Reserved_1,
75 pIorb->f16NxtIORB);
76}
77#endif
78
Note: See TracBrowser for help on using the repository browser.