diff --git a/sys/dev/bwn/if_bwn_phy_lp.c b/sys/dev/bwn/if_bwn_phy_lp.c index d53a2dd488ae..79a986f6ae57 100644 --- a/sys/dev/bwn/if_bwn_phy_lp.c +++ b/sys/dev/bwn/if_bwn_phy_lp.c @@ -77,6 +77,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include static void bwn_phy_lp_readsprom(struct bwn_mac *); @@ -2271,57 +2273,6 @@ bwn_phy_lp_clear_deaf(struct bwn_mac *mac, uint8_t user) BWN_PHY_SETMASK(mac, BWN_PHY_CRSGAIN_CTL, 0xff1f, 0x20); } -static unsigned int -bwn_sqrt(struct bwn_mac *mac, unsigned int x) -{ - /* Table holding (10 * sqrt(x)) for x between 1 and 256. */ - static uint8_t sqrt_table[256] = { - 10, 14, 17, 20, 22, 24, 26, 28, - 30, 31, 33, 34, 36, 37, 38, 40, - 41, 42, 43, 44, 45, 46, 47, 48, - 50, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 60, 61, 62, 63, - 64, 64, 65, 66, 67, 67, 68, 69, - 70, 70, 71, 72, 72, 73, 74, 74, - 75, 76, 76, 77, 78, 78, 79, 80, - 80, 81, 81, 82, 83, 83, 84, 84, - 85, 86, 86, 87, 87, 88, 88, 89, - 90, 90, 91, 91, 92, 92, 93, 93, - 94, 94, 95, 95, 96, 96, 97, 97, - 98, 98, 99, 100, 100, 100, 101, 101, - 102, 102, 103, 103, 104, 104, 105, 105, - 106, 106, 107, 107, 108, 108, 109, 109, - 110, 110, 110, 111, 111, 112, 112, 113, - 113, 114, 114, 114, 115, 115, 116, 116, - 117, 117, 117, 118, 118, 119, 119, 120, - 120, 120, 121, 121, 122, 122, 122, 123, - 123, 124, 124, 124, 125, 125, 126, 126, - 126, 127, 127, 128, 128, 128, 129, 129, - 130, 130, 130, 131, 131, 131, 132, 132, - 133, 133, 133, 134, 134, 134, 135, 135, - 136, 136, 136, 137, 137, 137, 138, 138, - 138, 139, 139, 140, 140, 140, 141, 141, - 141, 142, 142, 142, 143, 143, 143, 144, - 144, 144, 145, 145, 145, 146, 146, 146, - 147, 147, 147, 148, 148, 148, 149, 149, - 150, 150, 150, 150, 151, 151, 151, 152, - 152, 152, 153, 153, 153, 154, 154, 154, - 155, 155, 155, 156, 156, 156, 157, 157, - 157, 158, 158, 158, 159, 159, 159, 160 - }; - - if (x == 0) - return (0); - if (x >= 256) { - unsigned int tmp; - - for (tmp = 0; x >= (2 * tmp) + 1; x -= (2 * tmp++) + 1) - /* do nothing */ ; - return (tmp); - } - return (sqrt_table[x - 1] / 10); -} - static int bwn_phy_lp_calc_rx_iq_comp(struct bwn_mac *mac, uint16_t sample) {