All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC wireless-next 1/4] wifi: b43: 11ac chanspec for the AC microcode
  2026-11-12 17:56 [PATCH RFC wireless-next 0/4] wifi: b43: AC microcode TX and RX formats (series 3/4) Andreas Wendleder
@ 2026-11-12 17:56   ` Andreas Wendleder
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Wendleder @ 2026-11-12 17:56 UTC (permalink / raw)
  To: linux-wireless
  Cc: jpeisach, julian.calaby, kvalo, linux-kernel, rosenp, b43-dev,
	Michael Buesch, Johannes Berg

The AC microcode keeps an 11ac chanspec of the current channel in SHM
(where older microcode keeps the channel cookie) and takes one in every
TX descriptor and puts one in every RX header: the channel, 0x1000 for
20 MHz and 0xc000 on 5 GHz.

Add b43_ac_chanspec() and use it for the channel cookie in
b43_switch_channel(). The TX and RX header patches that follow use it too.
Signed-off-by: Andreas Wendleder <gonsolo@gmail.com>
---
 drivers/net/wireless/broadcom/b43/phy_common.c | 13 +++++++++++++
 drivers/net/wireless/broadcom/b43/phy_common.h |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/drivers/net/wireless/broadcom/b43/phy_common.c b/drivers/net/wireless/broadcom/b43/phy_common.c
index 285490f..cfc14c1 100644
--- a/drivers/net/wireless/broadcom/b43/phy_common.c
+++ b/drivers/net/wireless/broadcom/b43/phy_common.c
@@ -413,6 +413,17 @@ void b43_phy_take_out_of_reset(struct b43_wldev *dev)
 	}
 }
 
+/*
+ * The 11ac chanspec of a primary channel as the AC microcode takes it in
+ * SHM and in the TX and RX headers: channel, 0x1000 for 20 MHz, 0xc000 on
+ * 5 GHz.
+ */
+u16 b43_ac_chanspec(struct b43_wldev *dev, unsigned int channel)
+{
+	return channel | 0x1000 |
+	       (b43_current_band(dev->wl) == NL80211_BAND_5GHZ ? 0xc000 : 0);
+}
+
 int b43_switch_channel(struct b43_wldev *dev, unsigned int new_channel)
 {
 	struct b43_phy *phy = &(dev->phy);
@@ -428,6 +439,8 @@ int b43_switch_channel(struct b43_wldev *dev, unsigned int new_channel)
 	/* FIXME: set 40Mhz flag if required */
 	if (0)
 		channelcookie |= B43_SHM_SH_CHAN_40MHZ;
+	if (b43_ucode_is_ac(dev))
+		channelcookie = b43_ac_chanspec(dev, new_channel);
 	savedcookie = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_CHAN);
 	b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_CHAN, channelcookie);
 
diff --git a/drivers/net/wireless/broadcom/b43/phy_common.h b/drivers/net/wireless/broadcom/b43/phy_common.h
index 5ec5233..c20a20e 100644
--- a/drivers/net/wireless/broadcom/b43/phy_common.h
+++ b/drivers/net/wireless/broadcom/b43/phy_common.h
@@ -390,6 +390,13 @@ void b43_phy_take_out_of_reset(struct b43_wldev *dev);
  */
 int b43_switch_channel(struct b43_wldev *dev, unsigned int new_channel);
 
+/*
+ * 11ac chanspec of the AC microcode, and the centre channel of the 80 MHz block
+ * of a 5 GHz primary (0: none)
+ */
+u16 b43_ac_chanspec(struct b43_wldev *dev, unsigned int channel);
+unsigned int b43_ac_80mhz_centre(unsigned int channel);
+
 /**
  * b43_software_rfkill - Turn the radio ON or OFF in software.
  */

_______________________________________________
b43-dev mailing list
b43-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev

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

* [PATCH RFC wireless-next 1/4] wifi: b43: 11ac chanspec for the AC microcode
@ 2026-11-12 17:56   ` Andreas Wendleder
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Wendleder @ 2026-11-12 17:56 UTC (permalink / raw)
  To: linux-wireless
  Cc: Johannes Berg, b43-dev, Michael Buesch, Alessio Ferri, kvalo,
	julian.calaby, jpeisach, rosenp, linux-kernel

The AC microcode keeps an 11ac chanspec of the current channel in SHM
(where older microcode keeps the channel cookie) and takes one in every
TX descriptor and puts one in every RX header: the channel, 0x1000 for
20 MHz and 0xc000 on 5 GHz.

Add b43_ac_chanspec() and use it for the channel cookie in
b43_switch_channel(). The TX and RX header patches that follow use it too.
Signed-off-by: Andreas Wendleder <gonsolo@gmail.com>
---
 drivers/net/wireless/broadcom/b43/phy_common.c | 13 +++++++++++++
 drivers/net/wireless/broadcom/b43/phy_common.h |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/drivers/net/wireless/broadcom/b43/phy_common.c b/drivers/net/wireless/broadcom/b43/phy_common.c
index 285490f..cfc14c1 100644
--- a/drivers/net/wireless/broadcom/b43/phy_common.c
+++ b/drivers/net/wireless/broadcom/b43/phy_common.c
@@ -413,6 +413,17 @@ void b43_phy_take_out_of_reset(struct b43_wldev *dev)
 	}
 }
 
+/*
+ * The 11ac chanspec of a primary channel as the AC microcode takes it in
+ * SHM and in the TX and RX headers: channel, 0x1000 for 20 MHz, 0xc000 on
+ * 5 GHz.
+ */
+u16 b43_ac_chanspec(struct b43_wldev *dev, unsigned int channel)
+{
+	return channel | 0x1000 |
+	       (b43_current_band(dev->wl) == NL80211_BAND_5GHZ ? 0xc000 : 0);
+}
+
 int b43_switch_channel(struct b43_wldev *dev, unsigned int new_channel)
 {
 	struct b43_phy *phy = &(dev->phy);
@@ -428,6 +439,8 @@ int b43_switch_channel(struct b43_wldev *dev, unsigned int new_channel)
 	/* FIXME: set 40Mhz flag if required */
 	if (0)
 		channelcookie |= B43_SHM_SH_CHAN_40MHZ;
+	if (b43_ucode_is_ac(dev))
+		channelcookie = b43_ac_chanspec(dev, new_channel);
 	savedcookie = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_CHAN);
 	b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_CHAN, channelcookie);
 
diff --git a/drivers/net/wireless/broadcom/b43/phy_common.h b/drivers/net/wireless/broadcom/b43/phy_common.h
index 5ec5233..c20a20e 100644
--- a/drivers/net/wireless/broadcom/b43/phy_common.h
+++ b/drivers/net/wireless/broadcom/b43/phy_common.h
@@ -390,6 +390,13 @@ void b43_phy_take_out_of_reset(struct b43_wldev *dev);
  */
 int b43_switch_channel(struct b43_wldev *dev, unsigned int new_channel);
 
+/*
+ * 11ac chanspec of the AC microcode, and the centre channel of the 80 MHz block
+ * of a 5 GHz primary (0: none)
+ */
+u16 b43_ac_chanspec(struct b43_wldev *dev, unsigned int channel);
+unsigned int b43_ac_80mhz_centre(unsigned int channel);
+
 /**
  * b43_software_rfkill - Turn the radio ON or OFF in software.
  */

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

* Re: [PATCH RFC wireless-next 1/4] wifi: b43: 11ac chanspec for the AC microcode
@ 2026-11-21 10:27 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-11-21 10:27 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "linux-review patch is more than 7 days old, verify it wasn't already superseded"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20261112175640.40603-2-gonsolo@gmail.com>
References: <20261112175640.40603-2-gonsolo@gmail.com>
TO: Andreas Wendleder <gonsolo@gmail.com>

Hi Andreas,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on wireless-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Andreas-Wendleder/wifi-b43-11ac-chanspec-for-the-AC-microcode/20261112-185637
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/20261112175640.40603-2-gonsolo%40gmail.com
patch subject: [PATCH RFC wireless-next 1/4] wifi: b43: 11ac chanspec for the AC microcode
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20261121/202611211858.oiGGCs8R-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 16.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261121/202611211858.oiGGCs8R-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202611211858.oiGGCs8R-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/net/wireless/broadcom/b43/phy_common.c: In function 'b43_switch_channel':
>> drivers/net/wireless/broadcom/b43/phy_common.c:442:13: error: implicit declaration of function 'b43_ucode_is_ac' [-Wimplicit-function-declaration]
     442 |         if (b43_ucode_is_ac(dev))
         |             ^~~~~~~~~~~~~~~


vim +/b43_ucode_is_ac +442 drivers/net/wireless/broadcom/b43/phy_common.c

d7012183113b1b drivers/net/wireless/broadcom/b43/phy_common.c Andreas Wendleder 2026-11-12  426  
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  427  int b43_switch_channel(struct b43_wldev *dev, unsigned int new_channel)
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  428  {
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  429  	struct b43_phy *phy = &(dev->phy);
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  430  	u16 channelcookie, savedcookie;
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  431  	int err;
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  432  
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  433  	/* First we set the channel radio code to prevent the
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  434  	 * firmware from sending ghost packets.
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  435  	 */
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  436  	channelcookie = new_channel;
57fbcce37be7c1 drivers/net/wireless/broadcom/b43/phy_common.c Johannes Berg     2016-04-12  437  	if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ)
106cb09a145a5c drivers/net/wireless/b43/phy_common.c          Rafał Miłecki     2010-10-06  438  		channelcookie |= B43_SHM_SH_CHAN_5GHZ;
106cb09a145a5c drivers/net/wireless/b43/phy_common.c          Rafał Miłecki     2010-10-06  439  	/* FIXME: set 40Mhz flag if required */
106cb09a145a5c drivers/net/wireless/b43/phy_common.c          Rafał Miłecki     2010-10-06  440  	if (0)
106cb09a145a5c drivers/net/wireless/b43/phy_common.c          Rafał Miłecki     2010-10-06  441  		channelcookie |= B43_SHM_SH_CHAN_40MHZ;
d7012183113b1b drivers/net/wireless/broadcom/b43/phy_common.c Andreas Wendleder 2026-11-12 @442  	if (b43_ucode_is_ac(dev))
d7012183113b1b drivers/net/wireless/broadcom/b43/phy_common.c Andreas Wendleder 2026-11-12  443  		channelcookie = b43_ac_chanspec(dev, new_channel);
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  444  	savedcookie = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_CHAN);
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  445  	b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_CHAN, channelcookie);
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  446  
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  447  	/* Now try to switch the PHY hardware channel. */
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  448  	err = phy->ops->switch_channel(dev, new_channel);
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  449  	if (err)
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  450  		goto err_restore_cookie;
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  451  
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  452  	/* Wait for the radio to tune to the channel and stabilize. */
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  453  	msleep(8);
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  454  
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  455  	return 0;
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  456  
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  457  err_restore_cookie:
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  458  	b43_shm_write16(dev, B43_SHM_SHARED,
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  459  			B43_SHM_SH_CHAN, savedcookie);
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  460  
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  461  	return err;
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  462  }
ef1a628d83fc04 drivers/net/wireless/b43/phy_common.c          Michael Buesch    2008-08-27  463  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2026-11-21 10:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21 10:27 [PATCH RFC wireless-next 1/4] wifi: b43: 11ac chanspec for the AC microcode kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-11-12 17:56 [PATCH RFC wireless-next 0/4] wifi: b43: AC microcode TX and RX formats (series 3/4) Andreas Wendleder
2026-11-12 17:56 ` [PATCH RFC wireless-next 1/4] wifi: b43: 11ac chanspec for the AC microcode Andreas Wendleder
2026-11-12 17:56   ` Andreas Wendleder

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.