From owner-svn-src-all@FreeBSD.ORG Thu Mar 11 17:15:40 2010 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 9572810656B8; Thu, 11 Mar 2010 17:15:40 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6916C8FC15; Thu, 11 Mar 2010 17:15:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2BHFeif004552; Thu, 11 Mar 2010 17:15:40 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BHFeDc004549; Thu, 11 Mar 2010 17:15:40 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201003111715.o2BHFeDc004549@svn.freebsd.org> From: Bernhard Schmidt Date: Thu, 11 Mar 2010 17:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205023 - stable/8/sys/dev/iwn 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: Thu, 11 Mar 2010 17:15:40 -0000 Author: bschmidt Date: Thu Mar 11 17:15:40 2010 New Revision: 205023 URL: http://svn.freebsd.org/changeset/base/205023 Log: MFC r203934: Fix for the Intel WiFi Link 1000. The EEPROM image is in the OTPROM block before the last block, not in the last block itself. Approved by: rpaulo (mentor) Obtained from: OpenBSD Modified: stable/8/sys/dev/iwn/if_iwn.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Thu Mar 11 17:11:07 2010 (r205022) +++ stable/8/sys/dev/iwn/if_iwn.c Thu Mar 11 17:15:40 2010 (r205023) @@ -972,8 +972,7 @@ iwn_eeprom_unlock(struct iwn_softc *sc) int iwn_init_otprom(struct iwn_softc *sc) { - uint32_t base; - uint16_t next; + uint16_t prev, base, next; int count, error; /* Wait for clock stabilization before accessing prph. */ @@ -1000,25 +999,26 @@ iwn_init_otprom(struct iwn_softc *sc) IWN_OTP_GP_ECC_CORR_STTS | IWN_OTP_GP_ECC_UNCORR_STTS); /* - * Find last valid OTP block (contains the EEPROM image) for HW - * without OTP shadow RAM. + * Find the block before last block (contains the EEPROM image) + * for HW without OTP shadow RAM. */ if (sc->hw_type == IWN_HW_REV_TYPE_1000) { /* Switch to absolute addressing mode. */ IWN_CLRBITS(sc, IWN_OTP_GP, IWN_OTP_GP_RELATIVE_ACCESS); - base = 0; + base = prev = 0; for (count = 0; count < IWN1000_OTP_NBLOCKS; count++) { error = iwn_read_prom_data(sc, base, &next, 2); if (error != 0) return error; if (next == 0) /* End of linked-list. */ break; + prev = base; base = le16toh(next); } - if (base == 0 || count == IWN1000_OTP_NBLOCKS) + if (count == 0 || count == IWN1000_OTP_NBLOCKS) return EIO; /* Skip "next" word. */ - sc->prom_base = base + 1; + sc->prom_base = prev + 1; } return 0; }