linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] b43: N-PHY: some dummy PHY rev 3 calls
@ 2010-03-28 22:53 Rafał Miłecki
  2010-03-28 22:53 ` [PATCH 2/5] b43: N-PHY: use b43_phy_n_sfo_cfg rather than duplicating same fields Rafał Miłecki
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rafał Miłecki @ 2010-03-28 22:53 UTC (permalink / raw)
  To: linux-wireless, John W. Linville; +Cc: b43-dev, Rafał Miłecki

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

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 6fd140a..0586667 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -254,6 +254,16 @@ static void b43_radio_init2055(struct b43_wldev *dev)
 }
 
 /*
+ * Initialize a Broadcom 2056 N-radio
+ * http://bcm-v4.sipsolutions.net/802.11/Radio/2056/Init
+ */
+static void b43_radio_init2056(struct b43_wldev *dev)
+{
+	/* TODO */
+}
+
+
+/*
  * Upload the N-PHY tables.
  * http://bcm-v4.sipsolutions.net/802.11/PHY/N/InitTables
  */
@@ -3473,6 +3483,8 @@ static void b43_nphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value)
 static void b43_nphy_op_software_rfkill(struct b43_wldev *dev,
 					bool blocked)
 {
+	struct b43_phy_n *nphy = dev->phy.n;
+
 	if (b43_read32(dev, B43_MMIO_MACCTL) & B43_MACCTL_ENABLED)
 		b43err(dev->wl, "MAC not suspended\n");
 
@@ -3498,8 +3510,8 @@ static void b43_nphy_op_software_rfkill(struct b43_wldev *dev,
 		}
 	} else {
 		if (dev->phy.rev >= 3) {
-			/* TODO: b43_radio_init2056(dev); */
-			/* TODO: PHY Set Channel Spec (dev, radio_chanspec) */
+			b43_radio_init2056(dev);
+			b43_nphy_set_chanspec(dev, nphy->radio_chanspec);
 		} else {
 			b43_radio_init2055(dev);
 		}
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/5] b43: N-PHY: use b43_phy_n_sfo_cfg rather than duplicating same fields
  2010-03-28 22:53 [PATCH 1/5] b43: N-PHY: some dummy PHY rev 3 calls Rafał Miłecki
@ 2010-03-28 22:53 ` Rafał Miłecki
  2010-03-28 22:53 ` [PATCH 3/5] b43: N-PHY: find table entry earlier for setting chanspec Rafał Miłecki
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Rafał Miłecki @ 2010-03-28 22:53 UTC (permalink / raw)
  To: linux-wireless, John W. Linville; +Cc: b43-dev, Rafał Miłecki

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/net/wireless/b43/phy_n.c       |    6 +++---
 drivers/net/wireless/b43/tables_nphy.c |   12 ++++++------
 drivers/net/wireless/b43/tables_nphy.h |   15 +++++----------
 3 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 0586667..052119b 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -141,7 +141,7 @@ static void b43_chantab_radio_upload(struct b43_wldev *dev,
 }
 
 static void b43_chantab_phy_upload(struct b43_wldev *dev,
-				   const struct b43_nphy_channeltab_entry *e)
+				   const struct b43_phy_n_sfo_cfg *e)
 {
 	b43_phy_write(dev, B43_NPHY_BW1A, e->phy_bw1a);
 	b43_phy_write(dev, B43_NPHY_BW2, e->phy_bw2);
@@ -3270,7 +3270,7 @@ int b43_phy_initn(struct b43_wldev *dev)
 
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */
 static void b43_nphy_chanspec_setup(struct b43_wldev *dev,
-				const struct b43_nphy_channeltab_entry *e,
+				const struct b43_phy_n_sfo_cfg *e,
 				struct b43_chanspec chanspec)
 {
 	struct b43_phy *phy = &dev->phy;
@@ -3373,7 +3373,7 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
 		tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050;
 		b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp);
 		b43_radio_2055_setup(dev, tabent);
-		b43_nphy_chanspec_setup(dev, tabent, chanspec);
+		b43_nphy_chanspec_setup(dev, &(tabent->phy_regs), chanspec);
 	}
 
 	return 0;
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
index a00d509..237426d 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -318,12 +318,12 @@ void b2055_upload_inittab(struct b43_wldev *dev,
 	.radio_c2_tx_mxbgtrim	= r21
 
 #define PHYREGS(r0, r1, r2, r3, r4, r5)	\
-	.phy_bw1a	= r0,		\
-	.phy_bw2	= r1,		\
-	.phy_bw3	= r2,		\
-	.phy_bw4	= r3,		\
-	.phy_bw5	= r4,		\
-	.phy_bw6	= r5
+	.phy_regs.phy_bw1a	= r0,	\
+	.phy_regs.phy_bw2	= r1,	\
+	.phy_regs.phy_bw3	= r2,	\
+	.phy_regs.phy_bw4	= r3,	\
+	.phy_regs.phy_bw5	= r4,	\
+	.phy_regs.phy_bw6	= r5
 
 static const struct b43_nphy_channeltab_entry b43_nphy_channeltab[] = {
   {	.channel		= 184,
diff --git a/drivers/net/wireless/b43/tables_nphy.h b/drivers/net/wireless/b43/tables_nphy.h
index b23036f..84dea35 100644
--- a/drivers/net/wireless/b43/tables_nphy.h
+++ b/drivers/net/wireless/b43/tables_nphy.h
@@ -16,6 +16,10 @@ struct b43_phy_n_sfo_cfg {
 struct b43_nphy_channeltab_entry {
 	/* The channel number */
 	u8 channel;
+	/* The channel frequency in MHz */
+	u16 freq;
+	/* An unknown value */
+	u16 unk2;
 	/* Radio register values on channelswitch */
 	u8 radio_pll_ref;
 	u8 radio_rf_pllmod0;
@@ -40,16 +44,7 @@ struct b43_nphy_channeltab_entry {
 	u8 radio_c2_tx_pgapadtn;
 	u8 radio_c2_tx_mxbgtrim;
 	/* PHY register values on channelswitch */
-	u16 phy_bw1a;
-	u16 phy_bw2;
-	u16 phy_bw3;
-	u16 phy_bw4;
-	u16 phy_bw5;
-	u16 phy_bw6;
-	/* The channel frequency in MHz */
-	u16 freq;
-	/* An unknown value */
-	u16 unk2;
+	struct b43_phy_n_sfo_cfg phy_regs;
 };
 
 
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/5] b43: N-PHY: find table entry earlier for setting chanspec
  2010-03-28 22:53 [PATCH 1/5] b43: N-PHY: some dummy PHY rev 3 calls Rafał Miłecki
  2010-03-28 22:53 ` [PATCH 2/5] b43: N-PHY: use b43_phy_n_sfo_cfg rather than duplicating same fields Rafał Miłecki
@ 2010-03-28 22:53 ` Rafał Miłecki
  2010-03-28 22:53 ` [PATCH 4/5] b43: N-PHY: prepare for rev3+ channel tables Rafał Miłecki
  2010-03-28 22:53 ` [PATCH 5/5] b43: N-PHY: fix value written on 2055 radio setup Rafał Miłecki
  3 siblings, 0 replies; 5+ messages in thread
From: Rafał Miłecki @ 2010-03-28 22:53 UTC (permalink / raw)
  To: linux-wireless, John W. Linville; +Cc: b43-dev, Rafał Miłecki

We do not want to partially change chanspec just to find out there is not
entry in table for given channel.

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

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 052119b..d9e47ba 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -3343,6 +3343,10 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
 
 	if (dev->phy.rev >= 3) {
 		/* TODO */
+	} else {
+		tabent = b43_nphy_get_chantabent(dev, channel);
+		if (!tabent)
+			return -ESRCH;
 	}
 
 	nphy->radio_chanspec = chanspec;
@@ -3366,10 +3370,6 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
 		/* TODO: PHY Radio2056 Setup (chan_info_ptr[i]) */
 		/* TODO: N PHY Chanspec Setup (chan_info_ptr[i]) */
 	} else {
-		tabent = b43_nphy_get_chantabent(dev, channel);
-		if (!tabent)
-			return -ESRCH;
-
 		tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050;
 		b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp);
 		b43_radio_2055_setup(dev, tabent);
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/5] b43: N-PHY: prepare for rev3+ channel tables
  2010-03-28 22:53 [PATCH 1/5] b43: N-PHY: some dummy PHY rev 3 calls Rafał Miłecki
  2010-03-28 22:53 ` [PATCH 2/5] b43: N-PHY: use b43_phy_n_sfo_cfg rather than duplicating same fields Rafał Miłecki
  2010-03-28 22:53 ` [PATCH 3/5] b43: N-PHY: find table entry earlier for setting chanspec Rafał Miłecki
@ 2010-03-28 22:53 ` Rafał Miłecki
  2010-03-28 22:53 ` [PATCH 5/5] b43: N-PHY: fix value written on 2055 radio setup Rafał Miłecki
  3 siblings, 0 replies; 5+ messages in thread
From: Rafał Miłecki @ 2010-03-28 22:53 UTC (permalink / raw)
  To: linux-wireless, John W. Linville; +Cc: b43-dev, Rafał Miłecki

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/net/wireless/b43/phy_n.c       |   22 +++++++++++++---------
 drivers/net/wireless/b43/tables_nphy.c |    8 ++++----
 drivers/net/wireless/b43/tables_nphy.h |   17 ++++++++++++++---
 3 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index d9e47ba..34f80c4 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -104,7 +104,7 @@ static enum b43_txpwr_result b43_nphy_op_recalc_txpower(struct b43_wldev *dev,
 }
 
 static void b43_chantab_radio_upload(struct b43_wldev *dev,
-				     const struct b43_nphy_channeltab_entry *e)
+				const struct b43_nphy_channeltab_entry_rev2 *e)
 {
 	b43_radio_write(dev, B2055_PLL_REF, e->radio_pll_ref);
 	b43_radio_write(dev, B2055_RF_PLLMOD0, e->radio_rf_pllmod0);
@@ -159,7 +159,7 @@ static void b43_nphy_tx_power_fix(struct b43_wldev *dev)
 
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/Radio/2055Setup */
 static void b43_radio_2055_setup(struct b43_wldev *dev,
-				const struct b43_nphy_channeltab_entry *e)
+				const struct b43_nphy_channeltab_entry_rev2 *e)
 {
 	B43_WARN_ON(dev->phy.rev >= 3);
 
@@ -3336,16 +3336,20 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
 {
 	struct b43_phy_n *nphy = dev->phy.n;
 
-	const struct b43_nphy_channeltab_entry *tabent;
+	const struct b43_nphy_channeltab_entry_rev2 *tabent_r2;
+	const struct b43_nphy_channeltab_entry_rev3 *tabent_r3;
 
 	u8 tmp;
 	u8 channel = chanspec.channel;
 
 	if (dev->phy.rev >= 3) {
 		/* TODO */
+		tabent_r3 = NULL;
+		if (!tabent_r3)
+			return -ESRCH;
 	} else {
-		tabent = b43_nphy_get_chantabent(dev, channel);
-		if (!tabent)
+		tabent_r2 = b43_nphy_get_chantabent_rev2(dev, channel);
+		if (!tabent_r2)
 			return -ESRCH;
 	}
 
@@ -3367,13 +3371,13 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
 	if (dev->phy.rev >= 3) {
 		tmp = (chanspec.b_freq == 1) ? 4 : 0;
 		b43_radio_maskset(dev, 0x08, 0xFFFB, tmp);
-		/* TODO: PHY Radio2056 Setup (chan_info_ptr[i]) */
-		/* TODO: N PHY Chanspec Setup (chan_info_ptr[i]) */
+		/* TODO: PHY Radio2056 Setup (dev, tabent_r3); */
+		b43_nphy_chanspec_setup(dev, &(tabent_r3->phy_regs), chanspec);
 	} else {
 		tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050;
 		b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp);
-		b43_radio_2055_setup(dev, tabent);
-		b43_nphy_chanspec_setup(dev, &(tabent->phy_regs), chanspec);
+		b43_radio_2055_setup(dev, tabent_r2);
+		b43_nphy_chanspec_setup(dev, &(tabent_r2->phy_regs), chanspec);
 	}
 
 	return 0;
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
index 237426d..d96e870 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -325,7 +325,7 @@ void b2055_upload_inittab(struct b43_wldev *dev,
 	.phy_regs.phy_bw5	= r4,	\
 	.phy_regs.phy_bw6	= r5
 
-static const struct b43_nphy_channeltab_entry b43_nphy_channeltab[] = {
+static const struct b43_nphy_channeltab_entry_rev2 b43_nphy_channeltab[] = {
   {	.channel		= 184,
 	.freq			= 4920, /* MHz */
 	.unk2			= 3280,
@@ -1320,10 +1320,10 @@ static const struct b43_nphy_channeltab_entry b43_nphy_channeltab[] = {
   },
 };
 
-const struct b43_nphy_channeltab_entry *
-b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel)
+const struct b43_nphy_channeltab_entry_rev2 *
+b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel)
 {
-	const struct b43_nphy_channeltab_entry *e;
+	const struct b43_nphy_channeltab_entry_rev2 *e;
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(b43_nphy_channeltab); i++) {
diff --git a/drivers/net/wireless/b43/tables_nphy.h b/drivers/net/wireless/b43/tables_nphy.h
index 84dea35..8fc1da9 100644
--- a/drivers/net/wireless/b43/tables_nphy.h
+++ b/drivers/net/wireless/b43/tables_nphy.h
@@ -13,7 +13,7 @@ struct b43_phy_n_sfo_cfg {
 	u16 phy_bw6;
 };
 
-struct b43_nphy_channeltab_entry {
+struct b43_nphy_channeltab_entry_rev2 {
 	/* The channel number */
 	u8 channel;
 	/* The channel frequency in MHz */
@@ -47,6 +47,17 @@ struct b43_nphy_channeltab_entry {
 	struct b43_phy_n_sfo_cfg phy_regs;
 };
 
+struct b43_nphy_channeltab_entry_rev3 {
+	/* The channel number */
+	u8 channel;
+	/* The channel frequency in MHz */
+	u16 freq;
+	/* Radio register values on channelswitch */
+	/* TODO */
+	/* PHY register values on channelswitch */
+	struct b43_phy_n_sfo_cfg phy_regs;
+};
+
 
 struct b43_wldev;
 
@@ -81,8 +92,8 @@ void b2055_upload_inittab(struct b43_wldev *dev,
 
 /* Get the NPHY Channel Switch Table entry for a channel number.
  * Returns NULL on failure to find an entry. */
-const struct b43_nphy_channeltab_entry *
-b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel);
+const struct b43_nphy_channeltab_entry_rev2 *
+b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel);
 
 
 /* The N-PHY tables. */
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 5/5] b43: N-PHY: fix value written on 2055 radio setup
  2010-03-28 22:53 [PATCH 1/5] b43: N-PHY: some dummy PHY rev 3 calls Rafał Miłecki
                   ` (2 preceding siblings ...)
  2010-03-28 22:53 ` [PATCH 4/5] b43: N-PHY: prepare for rev3+ channel tables Rafał Miłecki
@ 2010-03-28 22:53 ` Rafał Miłecki
  3 siblings, 0 replies; 5+ messages in thread
From: Rafał Miłecki @ 2010-03-28 22:53 UTC (permalink / raw)
  To: linux-wireless, John W. Linville; +Cc: b43-dev, Rafał Miłecki

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

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 34f80c4..1ae232c 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -165,10 +165,10 @@ static void b43_radio_2055_setup(struct b43_wldev *dev,
 
 	b43_chantab_radio_upload(dev, e);
 	udelay(50);
-	b43_radio_write(dev, B2055_VCO_CAL10, 5);
-	b43_radio_write(dev, B2055_VCO_CAL10, 45);
+	b43_radio_write(dev, B2055_VCO_CAL10, 0x05);
+	b43_radio_write(dev, B2055_VCO_CAL10, 0x45);
 	b43_read32(dev, B43_MMIO_MACCTL); /* flush writes */
-	b43_radio_write(dev, B2055_VCO_CAL10, 65);
+	b43_radio_write(dev, B2055_VCO_CAL10, 0x65);
 	udelay(300);
 }
 
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-28 22:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-28 22:53 [PATCH 1/5] b43: N-PHY: some dummy PHY rev 3 calls Rafał Miłecki
2010-03-28 22:53 ` [PATCH 2/5] b43: N-PHY: use b43_phy_n_sfo_cfg rather than duplicating same fields Rafał Miłecki
2010-03-28 22:53 ` [PATCH 3/5] b43: N-PHY: find table entry earlier for setting chanspec Rafał Miłecki
2010-03-28 22:53 ` [PATCH 4/5] b43: N-PHY: prepare for rev3+ channel tables Rafał Miłecki
2010-03-28 22:53 ` [PATCH 5/5] b43: N-PHY: fix value written on 2055 radio setup Rafał Miłecki

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).