From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 06:06:23 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20CC2106564A; Mon, 3 Nov 2008 06:06:23 +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 0ECAB8FC19; Mon, 3 Nov 2008 06:06:23 +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 mA366M8I058287; Mon, 3 Nov 2008 06:06:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA366Mlf058286; Mon, 3 Nov 2008 06:06:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811030606.mA366Mlf058286@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Nov 2008 06:06:22 +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: r184581 - head/sys/dev/cardbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 06:06:23 -0000 Author: imp Date: Mon Nov 3 06:06:22 2008 New Revision: 184581 URL: http://svn.freebsd.org/changeset/base/184581 Log: Use child (the card) in preference to cbdev (the bridge) when allocating resources to read the CIS. I'm not sure when this changed, but it is totally wrong. Also, add a minor improvement to the debugging. This should help everybody trying to run dumpcis on atheros wireless card as well. MFC after: 2 days Modified: head/sys/dev/cardbus/cardbus_cis.c Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Mon Nov 3 05:53:10 2008 (r184580) +++ head/sys/dev/cardbus/cardbus_cis.c Mon Nov 3 06:06:22 2008 (r184581) @@ -511,7 +511,7 @@ cardbus_read_tuple_init(device_t cbdev, device_printf(cbdev, "Bad header in rom %d: " "[%x] %04x\n", romnum, imagebase + CARDBUS_EXROM_SIGNATURE, romsig); - bus_release_resource(cbdev, SYS_RES_MEMORY, + bus_release_resource(child, SYS_RES_MEMORY, *rid, res); *rid = 0; return (NULL); @@ -548,7 +548,7 @@ cardbus_read_tuple_init(device_t cbdev, CARDBUS_EXROM_DATA_INDICATOR) & 0x80) != 0) { device_printf(cbdev, "Cannot find CIS in " "Option ROM\n"); - bus_release_resource(cbdev, SYS_RES_MEMORY, + bus_release_resource(child, SYS_RES_MEMORY, *rid, res); *rid = 0; return (NULL); @@ -559,6 +559,8 @@ 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); return (res); }