Skip to contentSkip to conversation

b43: N-PHY: add b43_nphy_get_ipa_gain_table and its tables

PATCH New Rafał Miłecki 1 participant 1 message Jan 9, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 b43: N-PHY: add b43_nphy_get_ipa_gain_table and its tables

---
 drivers/net/wireless/b43/phy_n.c       |   20 +++++-
 drivers/net/wireless/b43/tables_nphy.c |  140 ++++++++++++++++++++++++++++++++
 drivers/net/wireless/b43/tables_nphy.h |    5 +
 3 files changed, 164 insertions(+), 1 deletions(-)
drivers/net/wireless/b43/phy_n.c +19 -1
index 739973e..6452cb3 100644
@@ -413,6 +413,24 @@ static u16 b43_nphy_classifier(struct b43_wldev *dev, u16 mask, u16 val)
 	return tmp;
 }
 
+/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/GetIpaGainTbl */
+static const u32 * b43_nphy_get_ipa_gain_table(struct b43_wldev *dev)
+{
+	if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
+		if (dev->phy.rev >= 6) {
+			/* TODO If the chip is 47162
+				return txpwrctrl_tx_gain_ipa_rev5 */
+			return txpwrctrl_tx_gain_ipa_rev6;
+		} else if (dev->phy.rev >= 5) {
+			return txpwrctrl_tx_gain_ipa_rev5;
+		} else {
+			return txpwrctrl_tx_gain_ipa;
+		}
+	} else {
+		return txpwrctrl_tx_gain_ipa_5g;
+	}
+}
+
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/carriersearch */
 static void b43_nphy_stay_in_carrier_search(struct b43_wldev *dev, bool enable)
 {
@@ -483,7 +501,7 @@ static struct nphy_txgains b43_nphy_get_tx_gains(struct b43_wldev *dev)
 
 				if ((nphy->ipa2g_on && band == IEEE80211_BAND_2GHZ) ||
 				    (nphy->ipa5g_on && band == IEEE80211_BAND_5GHZ)) {
-					table = NULL; //FIXME: = output of N PHY Get IPA GainTbl
+					table = b43_nphy_get_ipa_gain_table(dev);
 				} else {
 					if (band == IEEE80211_BAND_5GHZ) {
 						if (dev->phy.rev == 3)
drivers/net/wireless/b43/tables_nphy.c +140 -0

146 lines not on this page · raw message

drivers/net/wireless/b43/tables_nphy.h +5 -0
index 423c884..62b1745 100644
@@ -137,4 +137,9 @@ extern const u32 b43_ntab_tx_gain_rev3_5ghz[];
 extern const u32 b43_ntab_tx_gain_rev4_5ghz[];
 extern const u32 b43_ntab_tx_gain_rev5plus_5ghz[];
 
+extern const u32 txpwrctrl_tx_gain_ipa[];
+extern const u32 txpwrctrl_tx_gain_ipa_rev5[];
+extern const u32 txpwrctrl_tx_gain_ipa_rev6[];
+extern const u32 txpwrctrl_tx_gain_ipa_5g[];
+
 #endif /* B43_TABLES_NPHY_H_ */
Signature · 1 line
1.6.4.2