linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>
Cc: bcm43xx-dev@lists.berlios.de, "Rafał Miłecki" <zajec5@gmail.com>
Subject: [PATCH 4/4] b43: N-PHY: use cordic to generate samples
Date: Mon, 25 Jan 2010 19:00:01 +0100	[thread overview]
Message-ID: <1264442401-6364-5-git-send-email-zajec5@gmail.com> (raw)
In-Reply-To: <1264442401-6364-1-git-send-email-zajec5@gmail.com>

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/net/wireless/b43/phy_n.c |   21 ++++++++++++---------
 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 061b01b..e15f05c 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,
 					bool test)
 {
 	int i;
-	u16 bw, len, num, rot, angle;
-	/* TODO: *buffer; */
+	u16 bw, len, rot, angle;
+	b43_c32 *samples;
+	
 
 	bw = (dev->phy.is_40mhz) ? 40 : 20;
 	len = bw << 3;
@@ -839,18 +840,20 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
 		len = bw << 1;
 	}
 
-	/* TODO: buffer = kzalloc(len * sizeof(u32), GFP_KERNEL); */
-	num = len;
+	samples = kzalloc(len * sizeof(b43_c32), GFP_KERNEL);
 	rot = (((freq * 36) / bw) << 16) / 100;
 	angle = 0;
 
-	for (i = 0; i < num; i++) {
-		/* TODO */
+	for (i = 0; i < len; i++) {
+		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: kfree(buffer); */
-	return num;
+	/* TODO: Call N PHY Load Sample Table with buffer, len as arguments */
+	kfree(samples);
+	return len;
 }
 
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RunSamples */
-- 
1.6.4.2


      parent reply	other threads:[~2010-01-25 18:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25 17:59 [PATCH 0/4] more N-PHY, cordic stuff Rafał Miłecki
2010-01-25 17:59 ` [PATCH 1/4] b43: N-PHY: fix one bit off in parsing RF Ctrl Override arguments Rafał Miłecki
2010-01-25 17:59 ` [PATCH 2/4] b43: make cordic common (LP-PHY and N-PHY need it) Rafał Miłecki
2010-01-25 18:32   ` Michael Buesch
2010-01-25 18:35     ` Rafał Miłecki
2010-01-25 18:36       ` Rafał Miłecki
2010-01-25 18:53         ` Michael Buesch
2010-01-25 22:19           ` John W. Linville
2010-01-25 23:17             ` Rafał Miłecki
2010-01-25 18:00 ` [PATCH 3/4] b43: update cordic code to match current specs Rafał Miłecki
2010-01-25 18:00 ` Rafał Miłecki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1264442401-6364-5-git-send-email-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=bcm43xx-dev@lists.berlios.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).