From owner-svn-src-projects@FreeBSD.ORG Thu Feb 19 05:45:06 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BFB41065674; Thu, 19 Feb 2009 05:45:06 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC95B8FC20; Thu, 19 Feb 2009 05:45:05 +0000 (UTC) (envelope-from sam@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 n1J5j5hb086014; Thu, 19 Feb 2009 05:45:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J5j5UI086012; Thu, 19 Feb 2009 05:45:05 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190545.n1J5j5UI086012@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 05:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188788 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 05:45:06 -0000 Author: sam Date: Thu Feb 19 05:45:05 2009 New Revision: 188788 URL: http://svn.freebsd.org/changeset/base/188788 Log: merge r188771: add HAL_DIAG_SETREGS to write registers via the diag api Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ah.c projects/vap7/sys/dev/ath/ath_hal/ah_internal.h projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) Modified: projects/vap7/sys/dev/ath/ath_hal/ah.c ============================================================================== --- projects/vap7/sys/dev/ath/ath_hal/ah.c Thu Feb 19 05:44:25 2009 (r188787) +++ projects/vap7/sys/dev/ath/ath_hal/ah.c Thu Feb 19 05:45:05 2009 (r188788) @@ -539,6 +539,15 @@ ath_hal_getregdump(struct ath_hal *ah, c } return (char *) dp - (char *) dstbuf; } + +static void +ath_hal_setregs(struct ath_hal *ah, const HAL_REGWRITE *regs, int space) +{ + while (space >= sizeof(HAL_REGWRITE)) { + OS_REG_WRITE(ah, regs->addr, regs->value); + regs++, space -= sizeof(HAL_REGWRITE); + } +} HAL_BOOL ath_hal_getdiagstate(struct ath_hal *ah, int request, @@ -553,6 +562,10 @@ ath_hal_getdiagstate(struct ath_hal *ah, case HAL_DIAG_REGS: *resultsize = ath_hal_getregdump(ah, args, *result,*resultsize); return AH_TRUE; + case HAL_DIAG_SETREGS: + ath_hal_setregs(ah, args, argsize); + *resultsize = 0; + return AH_TRUE; case HAL_DIAG_FATALERR: *result = &AH_PRIVATE(ah)->ah_fatalState[0]; *resultsize = sizeof(AH_PRIVATE(ah)->ah_fatalState); Modified: projects/vap7/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- projects/vap7/sys/dev/ath/ath_hal/ah_internal.h Thu Feb 19 05:44:25 2009 (r188787) +++ projects/vap7/sys/dev/ath/ath_hal/ah_internal.h Thu Feb 19 05:45:05 2009 (r188788) @@ -49,6 +49,11 @@ typedef struct { uint16_t end; /* ending register or zero */ } HAL_REGRANGE; +typedef struct { + uint32_t addr; /* regiser address/offset */ + uint32_t value; /* value to write */ +} HAL_REGWRITE; + /* * Transmit power scale factor. * @@ -609,16 +614,14 @@ enum { HAL_DIAG_RESETKEY = 16, /* Reset keycache backdoor */ HAL_DIAG_EEREAD = 17, /* Read EEPROM word */ HAL_DIAG_EEWRITE = 18, /* Write EEPROM word */ - /* 19 was HAL_DIAG_TXCONT, 20-23 were for radar */ - HAL_DIAG_REGREAD = 24, /* Reg reads */ - HAL_DIAG_REGWRITE = 25, /* Reg writes */ - HAL_DIAG_GET_REGBASE = 26, /* Get register base */ + /* 19-26 removed, do not reuse */ HAL_DIAG_RDWRITE = 27, /* Write regulatory domain */ HAL_DIAG_RDREAD = 28, /* Get regulatory domain */ HAL_DIAG_FATALERR = 29, /* Read cached interrupt state */ HAL_DIAG_11NCOMPAT = 30, /* 11n compatibility tweaks */ HAL_DIAG_ANI_PARAMS = 31, /* ANI noise immunity parameters */ HAL_DIAG_CHECK_HANGS = 32, /* check h/w hangs */ + HAL_DIAG_SETREGS = 33, /* write registers */ }; enum {