From owner-svn-src-all@freebsd.org Sat May 14 20:09:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35892B3BB6C; Sat, 14 May 2016 20:09:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 068B91095; Sat, 14 May 2016 20:09:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EK9bWw021881; Sat, 14 May 2016 20:09:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EK9bXd021880; Sat, 14 May 2016 20:09:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142009.u4EK9bXd021880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 20:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299757 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Sat, 14 May 2016 20:09:38 -0000 Author: adrian Date: Sat May 14 20:09:37 2016 New Revision: 299757 URL: https://svnweb.freebsd.org/changeset/base/299757 Log: [bwn] add Q52 macros. The PHY-N code uses a different format for gain values, so these macros are used for converting to/from and print out values. Modified: head/sys/dev/bwn/if_bwn_util.h Modified: head/sys/dev/bwn/if_bwn_util.h ============================================================================== --- head/sys/dev/bwn/if_bwn_util.h Sat May 14 20:06:38 2016 (r299756) +++ head/sys/dev/bwn/if_bwn_util.h Sat May 14 20:09:37 2016 (r299757) @@ -55,6 +55,12 @@ bwn_clamp_val(int val, int lo, int hi) return val; } +/* Q52 format - used in PHY routines */ +#define INT_TO_Q52(i) ((i) << 2) +#define Q52_TO_INT(q52) ((q52) >> 2) +#define Q52_FMT "%u.%u" +#define Q52_ARG(q52) Q52_TO_INT(q52), ((((q52) & 0x3) * 100) / 4) + extern unsigned int bwn_sqrt(struct bwn_mac *mac, unsigned int x); #endif /* __IF_BWN_UTIL_H__ */