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

Last change on this file since 186 was 186, checked in by David Azarewicz, 8 years ago

Doc changes
Warpin package changes

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