Commit f2982181 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

b43: N-PHY: use cordic to generate samples

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6f98e62a
...@@ -821,8 +821,9 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max, ...@@ -821,8 +821,9 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
bool test) bool test)
{ {
int i; int i;
u16 bw, len, num, rot, angle; u16 bw, len, rot, angle;
/* TODO: *buffer; */ b43_c32 *samples;
bw = (dev->phy.is_40mhz) ? 40 : 20; bw = (dev->phy.is_40mhz) ? 40 : 20;
len = bw << 3; len = bw << 3;
...@@ -839,18 +840,20 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max, ...@@ -839,18 +840,20 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
len = bw << 1; len = bw << 1;
} }
/* TODO: buffer = kzalloc(len * sizeof(u32), GFP_KERNEL); */ samples = kzalloc(len * sizeof(b43_c32), GFP_KERNEL);
num = len;
rot = (((freq * 36) / bw) << 16) / 100; rot = (((freq * 36) / bw) << 16) / 100;
angle = 0; angle = 0;
for (i = 0; i < num; i++) { for (i = 0; i < len; i++) {
/* TODO */ samples[i] = b43_cordic(angle);
angle += rot;
samples[i].q = CORDIC_CONVERT(samples[i].q * max);
samples[i].i = CORDIC_CONVERT(samples[i].i * max);
} }
/* TODO: Call N PHY Load Sample Table with buffer, num as arguments */ /* TODO: Call N PHY Load Sample Table with buffer, len as arguments */
/* TODO: kfree(buffer); */ kfree(samples);
return num; return len;
} }
/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RunSamples */ /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RunSamples */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment