aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-01-25 13:00:01 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-25 16:40:36 -0500
commitf2982181e0531c0b12752336a1578626f99e7828 (patch)
tree76efd275e4942a3d7d5480ffb2c41fb899ff63b9 /drivers/net/wireless
parent6f98e62a9f1bdbd83d8d1be8c2ca6f58099846ef (diff)
b43: N-PHY: use cordic to generate samples
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/b43/phy_n.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 061b01b814d1..df4bf435e218 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -821,8 +821,9 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
821 bool test) 821 bool test)
822{ 822{
823 int i; 823 int i;
824 u16 bw, len, num, rot, angle; 824 u16 bw, len, rot, angle;
825 /* TODO: *buffer; */ 825 b43_c32 *samples;
826
826 827
827 bw = (dev->phy.is_40mhz) ? 40 : 20; 828 bw = (dev->phy.is_40mhz) ? 40 : 20;
828 len = bw << 3; 829 len = bw << 3;
@@ -839,18 +840,20 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
839 len = bw << 1; 840 len = bw << 1;
840 } 841 }
841 842
842 /* TODO: buffer = kzalloc(len * sizeof(u32), GFP_KERNEL); */ 843 samples = kzalloc(len * sizeof(b43_c32), GFP_KERNEL);
843 num = len;
844 rot = (((freq * 36) / bw) << 16) / 100; 844 rot = (((freq * 36) / bw) << 16) / 100;
845 angle = 0; 845 angle = 0;
846 846
847 for (i = 0; i < num; i++) { 847 for (i = 0; i < len; i++) {
848 /* TODO */ 848 samples[i] = b43_cordic(angle);
849 angle += rot;
850 samples[i].q = CORDIC_CONVERT(samples[i].q * max);
851 samples[i].i = CORDIC_CONVERT(samples[i].i * max);
849 } 852 }
850 853
851 /* TODO: Call N PHY Load Sample Table with buffer, num as arguments */ 854 /* TODO: Call N PHY Load Sample Table with buffer, len as arguments */
852 /* TODO: kfree(buffer); */ 855 kfree(samples);
853 return num; 856 return len;
854} 857}
855 858
856/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RunSamples */ 859/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RunSamples */