From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 05:31:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A0AA1065670; Fri, 13 Mar 2009 05:31:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1E498FC18; Fri, 13 Mar 2009 05:31:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2D5VRuU053308; Fri, 13 Mar 2009 05:31:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2D5VRMb053307; Fri, 13 Mar 2009 05:31:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903130531.n2D5VRMb053307@svn.freebsd.org> From: Warner Losh Date: Fri, 13 Mar 2009 05:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189755 - head/sys/dev/cardbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2009 05:31:28 -0000 Author: imp Date: Fri Mar 13 05:31:27 2009 New Revision: 189755 URL: http://svn.freebsd.org/changeset/base/189755 Log: Minorly improved debugging. Use the DEVPRINTF macro and report the offset for memory when mapping in the CIS. Modified: head/sys/dev/cardbus/cardbus_cis.c Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Fri Mar 13 03:51:41 2009 (r189754) +++ head/sys/dev/cardbus/cardbus_cis.c Fri Mar 13 05:31:27 2009 (r189755) @@ -451,8 +451,7 @@ cardbus_read_tuple_init(device_t cbdev, space = *start & PCIM_CIS_ASI_MASK; switch (space) { case PCIM_CIS_ASI_CONFIG: - if (cardbus_cis_debug) - device_printf(cbdev, "CIS in PCI config space\n"); + DEVPRINTF((cbdev, "CIS in PCI config space\n")); /* CIS in PCI config space need no initialization */ return (CIS_CONFIG_SPACE); case PCIM_CIS_ASI_BAR0: @@ -462,13 +461,11 @@ cardbus_read_tuple_init(device_t cbdev, case PCIM_CIS_ASI_BAR4: case PCIM_CIS_ASI_BAR5: *rid = PCIR_BAR(space - PCIM_CIS_ASI_BAR0); - if (cardbus_cis_debug) - device_printf(cbdev, "CIS in BAR %#x\n", *rid); + DEVPRINTF((cbdev, "CIS in BAR %#x\n", *rid)); break; case PCIM_CIS_ASI_ROM: *rid = PCIR_BIOS; - if (cardbus_cis_debug) - device_printf(cbdev, "CIS in option rom\n"); + DEVPRINTF((cbdev, "CIS in option rom\n")); break; default: device_printf(cbdev, "Unable to read CIS: Unknown space: %d\n", @@ -484,6 +481,7 @@ cardbus_read_tuple_init(device_t cbdev, "to read CIS.\n"); return (NULL); } + DEVPRINTF((cbdev, "CIS Mapped to %#lx\n", rman_get_start(res))); if (*rid == PCIR_BIOS) pci_write_config(child, *rid, rman_get_start(res) | PCIM_BIOS_ENABLE, 4); @@ -558,8 +556,7 @@ cardbus_read_tuple_init(device_t cbdev, } else { *start = *start & PCIM_CIS_ADDR_MASK; } - if (cardbus_cis_debug) - device_printf(cbdev, "CIS offset is %#x\n", *start); + DEVPRINTF((cbdev, "CIS offset is %#x\n", *start)); return (res); } @@ -598,13 +595,10 @@ cardbus_parse_cis(device_t cbdev, device bzero(tupledata, MAXTUPLESIZE); expect_linktarget = TRUE; if ((start = pci_read_config(child, PCIR_CIS, 4)) == 0) { - if (cardbus_cis_debug) - device_printf(cbdev, - "Warning: CIS pointer 0 (no CIS present)\n"); + DEVPRINTF((cbdev, "Warning: CIS pointer is 0: (no CIS)\n")); return (ENXIO); } - if (cardbus_cis_debug) - device_printf(cbdev, "CIS pointer is %#x\n", start); + DEVPRINTF((cbdev, "CIS pointer is %#x\n", start)); off = 0; res = cardbus_read_tuple_init(cbdev, child, &start, &rid); if (res == NULL) {