1 | /**
|
---|
2 | *
|
---|
3 | * Copyright (c) 2013-2021 David Azarewicz <david@88watts.net>
|
---|
4 | *
|
---|
5 | */
|
---|
6 |
|
---|
7 | #include "os2ahci.h"
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * Create adapter/port/device list for user output.
|
---|
11 | */
|
---|
12 | void build_user_info(void)
|
---|
13 | {
|
---|
14 | int a;
|
---|
15 | int p;
|
---|
16 | int d;
|
---|
17 | int iFlag;
|
---|
18 |
|
---|
19 | for (a = 0; a < ad_info_cnt; a++)
|
---|
20 | {
|
---|
21 | AD_INFO *ai = ad_infos + a;
|
---|
22 |
|
---|
23 | dprintf(0,"Adapter %d: PCI=%d:%d:%d ID=%04x:%04x %s %s irq=%d addr=0x%x version=%x\n", a,
|
---|
24 | PCI_BUS_FROM_BDF(ai->bus_dev_func), PCI_DEV_FROM_BDF(ai->bus_dev_func),
|
---|
25 | PCI_FUNC_FROM_BDF(ai->bus_dev_func),
|
---|
26 | ai->pci_vendor, ai->pci_device, vendor_from_id(ai->pci_vendor), ai->pci->chipname,
|
---|
27 | ai->irq, ai->mmio_phys,
|
---|
28 | ai->bios_config[HOST_VERSION / sizeof(u32)]);
|
---|
29 |
|
---|
30 | for (p = 0; p <= ai->port_max; p++)
|
---|
31 | {
|
---|
32 | P_INFO *pi = &ai->ports[p];
|
---|
33 | iFlag = 1;
|
---|
34 |
|
---|
35 | for (d = 0; d <= pi->dev_max; d++)
|
---|
36 | {
|
---|
37 | if (pi->devs[d].present)
|
---|
38 | {
|
---|
39 | if (iFlag) dprintf(0," Port %d:\n", p);
|
---|
40 | iFlag = 0;
|
---|
41 | dprintf(0," Drive %d:", d);
|
---|
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 | pi->devs[d].dev_info.TotalSectors/2048, pi->devs[d].dev_info.Method);
|
---|
49 | }
|
---|
50 | if (pi->devs[d].ignored) dprintf(0," Not a usable disk");
|
---|
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:\n", p);
|
---|
57 | iFlag = 0;
|
---|
58 | dprintf(0," No drive present\n");
|
---|
59 | } /* if */
|
---|
60 | } /* for d */
|
---|
61 | } /* for p */
|
---|
62 | } /* for a */
|
---|
63 | }
|
---|
64 |
|
---|
65 | #ifdef DEBUG
|
---|
66 | void DumpIorb(IORBH *pIorb)
|
---|
67 | {
|
---|
68 | if (D32g_DbgLevel < 2) return;
|
---|
69 | if (!ad_infos[iorb_unit_adapter(pIorb)].ports[iorb_unit_port(pIorb)].devs[iorb_unit_device(pIorb)].atapi) return;
|
---|
70 |
|
---|
71 | dprintf(0,"IORB %x: Size=%x Len=%x Handle=%x CmdCode=%x\n",
|
---|
72 | pIorb, sizeof(IORBH), pIorb->Length, pIorb->UnitHandle, pIorb->CommandCode);
|
---|
73 | dprintf(0," CmdMod=%x ReqCtrl=%x Status=%x ErrorCode=%x\n",
|
---|
74 | pIorb->CommandModifier, pIorb->RequestControl, pIorb->Status, pIorb->ErrorCode);
|
---|
75 | dprintf(0," Timeout=%x StatusBlkLen=%x pStatusBlk=%x Res=%x f16NxtIORB=%x\n",
|
---|
76 | pIorb->Timeout, pIorb->StatusBlockLen, pIorb->pStatusBlock, pIorb->Reserved_1,
|
---|
77 | pIorb->f16NxtIORB);
|
---|
78 | }
|
---|
79 | #endif
|
---|
80 |
|
---|