xref: /onnv-gate/usr/src/uts/intel/io/dktp/controller/ata/ata_debug.c (revision 1709:39a1331cb1e3)
1*1709Smlf /*
2*1709Smlf  * CDDL HEADER START
3*1709Smlf  *
4*1709Smlf  * The contents of this file are subject to the terms of the
5*1709Smlf  * Common Development and Distribution License (the "License").
6*1709Smlf  * You may not use this file except in compliance with the License.
7*1709Smlf  *
8*1709Smlf  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*1709Smlf  * or http://www.opensolaris.org/os/licensing.
10*1709Smlf  * See the License for the specific language governing permissions
11*1709Smlf  * and limitations under the License.
12*1709Smlf  *
13*1709Smlf  * When distributing Covered Code, include this CDDL HEADER in each
14*1709Smlf  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*1709Smlf  * If applicable, add the following below this CDDL HEADER, with the
16*1709Smlf  * fields enclosed by brackets "[]" replaced with your own identifying
17*1709Smlf  * information: Portions Copyright [yyyy] [name of copyright owner]
18*1709Smlf  *
19*1709Smlf  * CDDL HEADER END
20*1709Smlf  */
21*1709Smlf 
22*1709Smlf /*
23*1709Smlf  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*1709Smlf  * Use is subject to license terms.
25*1709Smlf  */
26*1709Smlf 
27*1709Smlf #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*1709Smlf 
29*1709Smlf #include <sys/types.h>
30*1709Smlf #include <sys/debug.h>
31*1709Smlf 
32*1709Smlf #include "ata_common.h"
33*1709Smlf #include "ata_disk.h"
34*1709Smlf #include "atapi.h"
35*1709Smlf #include "pciide.h"
36*1709Smlf 
37*1709Smlf 
38*1709Smlf #ifdef ATA_DEBUG
39*1709Smlf 
40*1709Smlf void
dump_ata_ctl(ata_ctl_t * P)41*1709Smlf dump_ata_ctl(ata_ctl_t *P)
42*1709Smlf {
43*1709Smlf 	ghd_err("dip 0x%p flags 0x%x timing 0x%x\n",
44*1709Smlf 		P->ac_dip, P->ac_flags, P->ac_timing_flags);
45*1709Smlf 	ghd_err("drvp[0][0..7] 0x%p 0x%p 0x%p 0x%p 0x%p 0x%p 0x%p 0x%p\n",
46*1709Smlf 		P->ac_drvp[0][0], P->ac_drvp[0][1], P->ac_drvp[0][2],
47*1709Smlf 		P->ac_drvp[0][3], P->ac_drvp[0][4], P->ac_drvp[0][5],
48*1709Smlf 		P->ac_drvp[0][6], P->ac_drvp[0][7]);
49*1709Smlf 	ghd_err("drvp[1][0..7] 0x%p 0x%p 0x%p 0x%p 0x%p 0x%p 0x%p 0x%p\n",
50*1709Smlf 		P->ac_drvp[1][0], P->ac_drvp[1][1], P->ac_drvp[1][2],
51*1709Smlf 		P->ac_drvp[1][3], P->ac_drvp[1][4], P->ac_drvp[1][5],
52*1709Smlf 		P->ac_drvp[1][6], P->ac_drvp[1][7]);
53*1709Smlf 	ghd_err("max tran 0x%x &ccc_t 0x%p actv drvp 0x%p actv pktp 0x%p\n",
54*1709Smlf 		P->ac_max_transfer, &P->ac_ccc,
55*1709Smlf 		P->ac_active_drvp, P->ac_active_pktp);
56*1709Smlf 	ghd_err("state %d hba tranp 0x%p\n", P->ac_state, P->ac_atapi_tran);
57*1709Smlf 	ghd_err("iohdl1 0x%p 0x%p D 0x%p E 0x%p F 0x%p C 0x%p S 0x%p LC 0x%p "
58*1709Smlf 		"HC 0x%p HD 0x%p ST 0x%p CMD 0x%p\n",
59*1709Smlf 		P->ac_iohandle1, P->ac_ioaddr1, P->ac_data, P->ac_error,
60*1709Smlf 		P->ac_feature, P->ac_count, P->ac_sect, P->ac_lcyl,
61*1709Smlf 		P->ac_hcyl, P->ac_drvhd, P->ac_status, P->ac_cmd);
62*1709Smlf 	ghd_err("iohdl2 0x%p 0x%p AST 0x%p DC 0x%p\n",
63*1709Smlf 		P->ac_iohandle2, P->ac_ioaddr2, P->ac_altstatus, P->ac_devctl);
64*1709Smlf 	ghd_err("bm hdl 0x%p 0x%p pciide %d BM %d sg_list 0x%p paddr 0x%llx "
65*1709Smlf 		"acc hdl 0x%p sg hdl 0x%p\n",
66*1709Smlf 		P->ac_bmhandle, P->ac_bmaddr, P->ac_pciide, P->ac_pciide_bm,
67*1709Smlf 		P->ac_sg_list, (unsigned long long) P->ac_sg_paddr,
68*1709Smlf 		P->ac_sg_acc_handle, P->ac_sg_handle);
69*1709Smlf 	ghd_err("arq pktp 0x%p flt pktp 0x%p &cdb 0x%p\n",
70*1709Smlf 		P->ac_arq_pktp, P->ac_fault_pktp, &P->ac_arq_cdb);
71*1709Smlf }
72*1709Smlf 
73*1709Smlf void
dump_ata_drv(ata_drv_t * P)74*1709Smlf dump_ata_drv(ata_drv_t *P)
75*1709Smlf {
76*1709Smlf 
77*1709Smlf 
78*1709Smlf 	ghd_err("ctlp 0x%p &ata_id 0x%p flags 0x%x pciide dma 0x%x\n",
79*1709Smlf 		P->ad_ctlp, &P->ad_id, P->ad_flags, P->ad_pciide_dma);
80*1709Smlf 
81*1709Smlf 	ghd_err("targ %d lun %d driv 0x%x state %d cdb len %d "
82*1709Smlf 		"bogus %d nec %d\n", P->ad_targ, P->ad_lun, P->ad_drive_bits,
83*1709Smlf 		P->ad_state, P->ad_cdb_len, P->ad_bogus_drq,
84*1709Smlf 		P->ad_nec_bad_status);
85*1709Smlf 
86*1709Smlf 	ghd_err("ata &scsi_dev 0x%p &scsi_inquiry 0x%p &ctl_obj 0x%p\n",
87*1709Smlf 		&P->ad_device, &P->ad_inquiry, &P->ad_ctl_obj);
88*1709Smlf 
89*1709Smlf 	ghd_err("ata rd cmd 0x%x wr cmd 0x%x acyl 0x%x\n",
90*1709Smlf 		P->ad_rd_cmd, P->ad_wr_cmd, P->ad_acyl);
91*1709Smlf 
92*1709Smlf 	ghd_err("ata bios cyl %d hd %d sec %d  phs hd %d sec %d\n",
93*1709Smlf 		P->ad_drvrcyl, P->ad_drvrhd, P->ad_drvrsec, P->ad_phhd,
94*1709Smlf 		P->ad_phsec);
95*1709Smlf 
96*1709Smlf 	ghd_err("block factor %d bpb %d\n",
97*1709Smlf 		P->ad_block_factor, P->ad_bytes_per_block);
98*1709Smlf }
99*1709Smlf 
100*1709Smlf void
dump_ata_pkt(ata_pkt_t * P)101*1709Smlf dump_ata_pkt(ata_pkt_t *P)
102*1709Smlf {
103*1709Smlf 	ghd_err("gcmdp 0x%p flags 0x%x v_addr 0x%p dma %d\n",
104*1709Smlf 		P->ap_gcmdp, P->ap_flags, P->ap_v_addr, P->ap_pciide_dma);
105*1709Smlf 	ghd_err("&sg_list 0x%p sg cnt 0x%x resid 0x%lx bcnt 0x%lx\n",
106*1709Smlf 		P->ap_sg_list, P->ap_sg_cnt, P->ap_resid, P->ap_bcount);
107*1709Smlf 	ghd_err("sec 0x%x cnt 0x%x lc 0x%x hc 0x%x hd 0x%x cmd 0x%x\n",
108*1709Smlf 		P->ap_sec, P->ap_count, P->ap_lwcyl, P->ap_hicyl,
109*1709Smlf 		P->ap_hd, P->ap_cmd);
110*1709Smlf 	ghd_err("status 0x%x error 0x%x\n", P->ap_status, P->ap_error);
111*1709Smlf 	ghd_err("start 0x%p intr 0x%p complete 0x%p\n",
112*1709Smlf 		P->ap_start, P->ap_intr, P->ap_complete);
113*1709Smlf 	ghd_err("ata cdb 0x%x scb 0x%x bpb 0x%x wrt cnt 0x%x\n",
114*1709Smlf 		P->ap_cdb, P->ap_scb, P->ap_bytes_per_block, P->ap_wrt_count);
115*1709Smlf 	ghd_err("atapi cdbp 0x%p cdb len %d cdb pad %d\n",
116*1709Smlf 		P->ap_cdbp, P->ap_cdb_len, P->ap_cdb_pad);
117*1709Smlf 	ghd_err("scbp 0x%p statuslen 0x%x\n", P->ap_scbp, P->ap_statuslen);
118*1709Smlf }
119*1709Smlf 
120*1709Smlf #endif
121