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" <linux-wireless@vger.kernel.org>,
	"John W. Linville" <linville@tuxdriver.com>
Cc: "bcm43xx-dev@lists.berlios.de" <bcm43xx-dev@lists.berlios.de>
Subject: [PATCH 5/5] b43: N-PHY: minor init code work
Date: Wed, 06 Jan 2010 16:45:20 +0100	[thread overview]
Message-ID: <op.u54bduin9lhzdc@linux-g0th.site> (raw)

[-- Attachment #1: Type: text/plain, Size: 2529 bytes --]

b43: N-PHY: minor init code work


 From b17c3a6da3eff05d49c97c87d13740c0915a21aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Wed, 6 Jan 2010 16:36:56 +0100
Subject: [PATCH 5/5] b43: N-PHY: minor init code work
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
  drivers/net/wireless/b43/phy_n.c |   32 +++++++++++++++++++++++++++++++-
  drivers/net/wireless/b43/phy_n.h |    3 +++
  2 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 2b99d86..4e3565a 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -668,7 +668,37 @@ int b43_phy_initn(struct b43_wldev *dev)
  	}

  	if (!((nphy->measure_hold & 0x6) != 0)) {
-		//TODO
+		if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
+			do_cal = (nphy->iqcal_chanspec_2G == 0);
+		else
+			do_cal = (nphy->iqcal_chanspec_5G == 0);
+
+		if (nphy->mute)
+			do_cal = false;
+
+		if (do_cal) {
+			struct nphy_txgains target =
+				b43_nphy_get_tx_gains(dev);
+
+			if (nphy->antsel_type == 2)
+				;//TODO N PHY Superswitch Init with argument 1
+			if (nphy->perical != 2) {
+				b43_nphy_rssi_cal(dev);
+				if (phy->rev >= 3) {
+					//FIXME: nphy->cal_orig_pwr_idx[0] = nphy->txpwrindex[0].index_internal;
+					//FIXME: nphy->cal_orig_pwr_idx[1] = nphy->txpwrindex[1].index_internal;
+					//TODO N PHY Pre Calibrate TX Gain
+					target = b43_nphy_get_tx_gains(dev);
+				}
+				/* TODO: If the output of N PHY Cal TX Iqlo with target, 1 0 as arguments is 0
+					If the output of N PHY Cal RX Iqlo with target, 2 0 as arguments is 0
+						Call N PHY Save Cal */
+			} else if (nphy->mphase_cal_phase_id == 0) {
+				//TODO N PHY Periodic Calibration with argument 3
+			}
+		} else {
+			//TODO N PHY Restore Calibration
+		}
  	}

  	//TODO N PHY TX Power Control Coef Setup
diff --git a/drivers/net/wireless/b43/phy_n.h b/drivers/net/wireless/b43/phy_n.h
index e63c371..f90e905 100644
--- a/drivers/net/wireless/b43/phy_n.h
+++ b/drivers/net/wireless/b43/phy_n.h
@@ -926,9 +926,12 @@ struct b43_wldev;

  struct b43_phy_n {
  	u8 txpwrctrl;
+	u8 cal_orig_pwr_idx[2];
  	u8 measure_hold;
  	u8 phyrxchain;
+	u8 perical;
  	u8 mphase_cal_phase_id;
+	u8 antsel_type;
  	u32 deaf_count;
  	bool hang_avoid;
  	bool mute;
-- 
1.6.4.2

[-- Attachment #2: 0005-b43-N-PHY-minor-init-code-work.patch --]
[-- Type: application/octet-stream, Size: 2410 bytes --]

From b17c3a6da3eff05d49c97c87d13740c0915a21aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Wed, 6 Jan 2010 16:36:56 +0100
Subject: [PATCH 5/5] b43: N-PHY: minor init code work
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/net/wireless/b43/phy_n.c |   32 +++++++++++++++++++++++++++++++-
 drivers/net/wireless/b43/phy_n.h |    3 +++
 2 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 2b99d86..4e3565a 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -668,7 +668,37 @@ int b43_phy_initn(struct b43_wldev *dev)
 	}
 
 	if (!((nphy->measure_hold & 0x6) != 0)) {
-		//TODO
+		if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
+			do_cal = (nphy->iqcal_chanspec_2G == 0);
+		else
+			do_cal = (nphy->iqcal_chanspec_5G == 0);
+
+		if (nphy->mute)
+			do_cal = false;
+
+		if (do_cal) {
+			struct nphy_txgains target =
+				b43_nphy_get_tx_gains(dev);
+
+			if (nphy->antsel_type == 2)
+				;//TODO N PHY Superswitch Init with argument 1 
+			if (nphy->perical != 2) {
+				b43_nphy_rssi_cal(dev);
+				if (phy->rev >= 3) {
+					//FIXME: nphy->cal_orig_pwr_idx[0] = nphy->txpwrindex[0].index_internal;
+					//FIXME: nphy->cal_orig_pwr_idx[1] = nphy->txpwrindex[1].index_internal;
+					//TODO N PHY Pre Calibrate TX Gain
+					target = b43_nphy_get_tx_gains(dev);
+				}
+				/* TODO: If the output of N PHY Cal TX Iqlo with target, 1 0 as arguments is 0 
+					If the output of N PHY Cal RX Iqlo with target, 2 0 as arguments is 0 
+						Call N PHY Save Cal */
+			} else if (nphy->mphase_cal_phase_id == 0) {
+				//TODO N PHY Periodic Calibration with argument 3 
+			}
+		} else {
+			//TODO N PHY Restore Calibration
+		}
 	}
 
 	//TODO N PHY TX Power Control Coef Setup 
diff --git a/drivers/net/wireless/b43/phy_n.h b/drivers/net/wireless/b43/phy_n.h
index e63c371..f90e905 100644
--- a/drivers/net/wireless/b43/phy_n.h
+++ b/drivers/net/wireless/b43/phy_n.h
@@ -926,9 +926,12 @@ struct b43_wldev;
 
 struct b43_phy_n {
 	u8 txpwrctrl;
+	u8 cal_orig_pwr_idx[2];
 	u8 measure_hold;
 	u8 phyrxchain;
+	u8 perical;
 	u8 mphase_cal_phase_id;
+	u8 antsel_type;
 	u32 deaf_count;
 	bool hang_avoid;
 	bool mute;
-- 
1.6.4.2


                 reply	other threads:[~2010-01-06 15:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=op.u54bduin9lhzdc@linux-g0th.site \
    --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).