From owner-svn-src-head@FreeBSD.ORG Sat May 12 20:36:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E0291065670; Sat, 12 May 2012 20:36:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 293178FC14; Sat, 12 May 2012 20:36:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4CKaDj4051087; Sat, 12 May 2012 20:36:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4CKaCpc051085; Sat, 12 May 2012 20:36:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205122036.q4CKaCpc051085@svn.freebsd.org> From: Adrian Chadd Date: Sat, 12 May 2012 20:36:12 +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: r235367 - head/sys/dev/etherswitch/arswitch 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: Sat, 12 May 2012 20:36:13 -0000 Author: adrian Date: Sat May 12 20:36:12 2012 New Revision: 235367 URL: http://svn.freebsd.org/changeset/base/235367 Log: * Add in the AR7240 global control field for setting the maximum frame size for the AR7240. * Include SM/MS macros, thanks to ath_hal(4). * This field is for normal packets, VLAN and other headers are added to this by the switch device. * Set the MTU to 1536, to match what is done in Linux. Use the SM macro to write this field. Obtained from: Atheros (AR7240 datasheet), Linux OpenWRT (MTU default) Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Sat May 12 20:34:22 2012 (r235366) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Sat May 12 20:36:12 2012 (r235367) @@ -29,6 +29,15 @@ #ifndef __AR8X16_SWITCHREG_H__ #define __AR8X16_SWITCHREG_H__ +/* XXX doesn't belong here; stolen shamelessly from ath_hal/ah_internal.h */ +/* + * Register manipulation macros that expect bit field defines + * to follow the convention that an _S suffix is appended for + * a shift count, while the field mask has no suffix. + */ +#define SM(_v, _f) (((_v) << _f##_S) & (_f)) +#define MS(_v, _f) (((_v) & (_f)) >> _f##_S) + /* Atheros specific MII registers */ #define MII_ATH_DBG_ADDR 0x1d #define MII_ATH_DBG_DATA 0x1e @@ -77,8 +86,13 @@ #define AR8X16_REG_GLOBAL_CTRL 0x0030 #define AR8216_GLOBAL_CTRL_MTU_MASK 0x00000fff +#define AR8216_GLOBAL_CTRL_MTU_MASK_S 0 #define AR8316_GLOBAL_CTRL_MTU_MASK 0x00007fff +#define AR8316_GLOBAL_CTRL_MTU_MASK_S 0 #define AR8236_GLOBAL_CTRL_MTU_MASK 0x00007fff +#define AR8236_GLOBAL_CTRL_MTU_MASK_S 0 +#define AR7240_GLOBAL_CTRL_MTU_MASK 0x00003fff +#define AR7240_GLOBAL_CTRL_MTU_MASK_S 0 #define AR8X16_REG_VLAN_CTRL 0x0040 #define AR8X16_VLAN_OP 0x00000007