hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/wireless/broadcom/b43/phy_lp.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23
34 Broadcom B43 wireless driver
....@@ -6,23 +7,10 @@
67 Copyright (c) 2008-2009 Michael Buesch <m@bues.ch>
78 Copyright (c) 2009 Gábor Stefanik <netrolller.3d@gmail.com>
89
9
- This program is free software; you can redistribute it and/or modify
10
- it under the terms of the GNU General Public License as published by
11
- the Free Software Foundation; either version 2 of the License, or
12
- (at your option) any later version.
13
-
14
- This program is distributed in the hope that it will be useful,
15
- but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- GNU General Public License for more details.
18
-
19
- You should have received a copy of the GNU General Public License
20
- along with this program; see the file COPYING. If not, write to
21
- the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
22
- Boston, MA 02110-1301, USA.
2310
2411 */
2512
13
+#include <linux/cordic.h>
2614 #include <linux/slab.h>
2715
2816 #include "b43.h"
....@@ -82,7 +70,7 @@
8270 dev->phy.lp = NULL;
8371 }
8472
85
-/* http://bcm-v4.sipsolutions.net/802.11/PHY/LP/ReadBandSrom */
73
+/* https://bcm-v4.sipsolutions.net/802.11/PHY/LP/ReadBandSrom */
8674 static void lpphy_read_band_sprom(struct b43_wldev *dev)
8775 {
8876 struct ssb_sprom *sprom = dev->dev->bus_sprom;
....@@ -1780,9 +1768,9 @@
17801768 {
17811769 struct b43_phy_lp *lpphy = dev->phy.lp;
17821770 u16 buf[64];
1783
- int i, samples = 0, angle = 0;
1771
+ int i, samples = 0, theta = 0;
17841772 int rotation = (((36 * freq) / 20) << 16) / 100;
1785
- struct b43_c32 sample;
1773
+ struct cordic_iq sample;
17861774
17871775 lpphy->tx_tone_freq = freq;
17881776
....@@ -1798,10 +1786,10 @@
17981786 }
17991787
18001788 for (i = 0; i < samples; i++) {
1801
- sample = b43_cordic(angle);
1802
- angle += rotation;
1803
- buf[i] = CORDIC_CONVERT((sample.i * max) & 0xFF) << 8;
1804
- buf[i] |= CORDIC_CONVERT((sample.q * max) & 0xFF);
1789
+ sample = cordic_calc_iq(CORDIC_FIXED(theta));
1790
+ theta += rotation;
1791
+ buf[i] = CORDIC_FLOAT((sample.i * max) & 0xFF) << 8;
1792
+ buf[i] |= CORDIC_FLOAT((sample.q * max) & 0xFF);
18051793 }
18061794
18071795 b43_lptab_write_bulk(dev, B43_LPTAB16(5, 0), samples, buf);
....@@ -1825,12 +1813,6 @@
18251813 }
18261814
18271815
1828
-static void lpphy_papd_cal(struct b43_wldev *dev, struct lpphy_tx_gains gains,
1829
- int mode, bool useindex, u8 index)
1830
-{
1831
- //TODO
1832
-}
1833
-
18341816 static void lpphy_papd_cal_txpwr(struct b43_wldev *dev)
18351817 {
18361818 struct b43_phy_lp *lpphy = dev->phy.lp;
....@@ -1846,11 +1828,6 @@
18461828 old_bbmult = lpphy_get_bb_mult(dev);
18471829
18481830 lpphy_set_tx_power_control(dev, B43_LPPHY_TXPCTL_OFF);
1849
-
1850
- if (dev->dev->chip_id == 0x4325 && dev->dev->chip_rev == 0)
1851
- lpphy_papd_cal(dev, oldgains, 0, 1, 30);
1852
- else
1853
- lpphy_papd_cal(dev, oldgains, 0, 1, 65);
18541831
18551832 if (old_afe_ovr)
18561833 lpphy_set_tx_gains(dev, oldgains);