Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 May 2016 20:09:37 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299757 - head/sys/dev/bwn
Message-ID:  <201605142009.u4EK9bXd021880@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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__ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605142009.u4EK9bXd021880>