Skip to contentSkip to conversation

b43: N-PHY: set band width

RFC PATCH New Rafał Miłecki 2 participants 2 messages Mar 30, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 b43: N-PHY: set band width

---
I've problem with deciding how to keep some data needed by band width setting code. Generally these band width-related routines are considered "common", to be used by more than just N-PHY. So probably the most /correct/ way should be to add some variables like maccontrol, wake_override, clk and other to struct b43_phy which is shared between all PHYs. However we would not use these vars in anything except N-PHY, so we would just waste users memory.

Could you help me decide correct way to handle this?

---
 drivers/net/wireless/b43/b43.h        |    1 +
 drivers/net/wireless/b43/phy_common.c |  186 +++++++++++++++++++++++++++++++++
 drivers/net/wireless/b43/phy_common.h |    7 ++
 drivers/net/wireless/b43/phy_n.c      |    4 +-
 drivers/net/wireless/b43/phy_n.h      |    1 +
 5 files changed, 197 insertions(+), 2 deletions(-)
drivers/net/wireless/b43/b43.h +1 -0
index 3a003e6..d75926f 100644
@@ -57,6 +57,7 @@
 #define B43_MMIO_TSF_CFP_REP		0x188
 #define B43_MMIO_TSF_CFP_START		0x18C
 #define B43_MMIO_TSF_CFP_MAXDUR		0x190
+#define B43_MMIO_CLKCTL			0x1E0	/* clock control status */
 
 /* 32-bit DMA */
 #define B43_MMIO_DMA32_BASE0		0x200
drivers/net/wireless/b43/phy_common.c +186 -0

189 lines not on this page · raw message

drivers/net/wireless/b43/phy_common.h +7 -0
index bd480b4..215fb05 100644
@@ -429,4 +429,11 @@ void b43_phyop_switch_analog_generic(struct b43_wldev *dev, bool on);
 
 struct b43_c32 b43_cordic(int theta);
 
+void b43_mhf(struct b43_wldev *dev, u8 idx, u16 sel, u16 val, u8 band);
+
+/**
+ * b43_bmac_set_b_width - Set band width
+ */
+void b43_bmac_set_b_width(struct b43_wldev *dev, u8 b_width);
+
 #endif /* LINUX_B43_PHY_COMMON_H_ */
drivers/net/wireless/b43/phy_n.c +2 -2
index 1ae232c..b19922d 100644
@@ -1096,7 +1096,7 @@ static void b43_nphy_workarounds(struct b43_wldev *dev)
 
 		if (dev->phy.rev < 2) {
 			if (b43_phy_read(dev, B43_NPHY_RXCTL) & 0x2)
-				; /*TODO: b43_mhf(dev, 2, 0x0010, 0x0010, 3);*/
+				b43_mhf(dev, 2, 0x0010, 0x0010, 3);
 		} else if (dev->phy.rev == 2) {
 			b43_phy_write(dev, B43_NPHY_CRSCHECK2, 0);
 			b43_phy_write(dev, B43_NPHY_CRSCHECK3, 0);
@@ -3356,7 +3356,7 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev,
 	nphy->radio_chanspec = chanspec;
 
 	if (chanspec.b_width != nphy->b_width)
-		; /* TODO: BMAC BW Set (chanspec.b_width) */
+		b43_bmac_set_b_width(chanspec.b_width);
 
 	/* TODO: use defines */
 	if (chanspec.b_width == 3) {
drivers/net/wireless/b43/phy_n.h +1 -0
index 8b6d570..1ec768e 100644
@@ -987,6 +987,7 @@ struct b43_phy_n {
 	u8 b_width;
 	struct b43_chanspec radio_chanspec;
 
+	bool forcefastclk;
 	bool gain_boost;
 	bool elna_gain_config;
 	bool band5g_pwrgain;
Signature · 1 line
1.6.4.2
#1 lore raw

RFC PATCH 1/1 b43: N-PHY: set band width

Quoted 9 lines · Rafa? Mi?ecki

---
I've problem with deciding how to keep some data needed by band width setting code. Generally these band width-related routines are considered "common", to be used by more than just N-PHY. So probably the most /correct/ way should be to add some variables like maccontrol, wake_override, clk and other to struct b43_phy which is shared between all PHYs. However we would not use these vars in anything except N-PHY, so we would just waste users memory.

Could you help me decide correct way to handle this?

I have not done the RE yet, but the SSLPN PHY is multi-band and will likely need all the band width parameters needed by the N PHY. I would vote for putting them in a "common" struct.

Larry