1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-26 11:47:31 +00:00

[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.
This commit is contained in:
Adrian Chadd 2016-05-14 20:09:37 +00:00
parent 0cc376c134
commit 020cb2200b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299757

View File

@ -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__ */