Re: [PATCH, RFC] b44: Add fw capabilities

2009-04-09 Thread Francesco Gringoli
On Apr 9, 2009, at 12:18 PM, Michael Buesch wrote:

 On Wednesday 08 April 2009 02:11:16 Michael Buesch wrote:
 Completely untested patch to implement firmware capabilities
 and automagic QoS-disabling.


 So could somebody who uses opensource fw test this?

 Module parameter qos=0 should not be needed anymore. So please test  
 opensource fw
 with qos=1.
Hi Michael,

cool! These are excerpts from dmesg. All the times connectivity was ok.

Cheers,
-FG

modprobe b43 qos=0
[  194.368042] b43-phy1: Loading OpenSource firmware version 410.31754
[  194.368054] b43-phy1: Hardware crypto acceleration not supported by  
firmware
[  194.368060] b43-phy1: QoS not supported by firmware

modprobe b43
[  264.328047] b43-phy3: Loading OpenSource firmware version 410.31754
[  264.328058] b43-phy3: Hardware crypto acceleration not supported by  
firmware
[  264.328064] b43-phy3: QoS not supported by firmware

modprobe b43 qos=1
[  309.224044] b43-phy5: Loading OpenSource firmware version 410.31754
[  309.224056] b43-phy5: Hardware crypto acceleration not supported by  
firmware
[  309.224062] b43-phy5: QoS not supported by firmware




 Index: wireless-testing/drivers/net/wireless/b43/b43.h
 ===
 --- wireless-testing.orig/drivers/net/wireless/b43/b43.h 2009-04-07  
 19:52:34.0 +0200
 +++ wireless-testing/drivers/net/wireless/b43/b43.h  2009-04-08  
 01:57:58.0 +0200
 @@ -163,6 +163,7 @@ enum {
 #define B43_SHM_SH_WLCOREREV 0x0016  /* 802.11 core revision */
 #define B43_SHM_SH_PCTLWDPOS 0x0008
 #define B43_SHM_SH_RXPADOFF  0x0034  /* RX Padding data offset (PIO  
 only) */
 +#define B43_SHM_SH_FWCAPA   0x0042  /* Firmware capabilities  
 (Opensource firmware only) */
 #define B43_SHM_SH_PHYVER0x0050  /* PHY version */
 #define B43_SHM_SH_PHYTYPE   0x0052  /* PHY type */
 #define B43_SHM_SH_ANTSWAP   0x005C  /* Antenna swap threshold */
 @@ -297,6 +298,10 @@ enum {
 #define B43_HF_MLADVW0x0010ULL /* N PHY ML ADV 
 workaround  
 (rev = 13 only) */
 #define B43_HF_PR45960W  0x0800ULL /* PR 45960 
 workaround  
 (rev = 13 only) */

 +/* Firmware capabilities field in SHM (Opensource firmware only) */
 +#define B43_FWCAPA_HWCRYPTO 0x0001
 +#define B43_FWCAPA_QOS  0x0002
 +
 /* MacFilter offsets. */
 #define B43_MACFILTER_SELF   0x
 #define B43_MACFILTER_BSSID  0x0003
 @@ -596,6 +601,13 @@ struct b43_wl {
  /* Pointer to the ieee80211 hardware data structure */
  struct ieee80211_hw *hw;

 +/* The number of queues that were registered with the mac80211  
 subsystem
 + * initially. This is a backup copy of hw-queues in case hw- 
 queues has
 + * to be dynamically lowered at runtime (Firmware does not  
 support QoS).
 + * hw-queues has to be restored to the original value before  
 unregistering
 + * from the mac80211 subsystem. */
 +u16 mac80211_initially_registered_queues;
 +
  struct mutex mutex;
  spinlock_t irq_lock;
  /* R/W lock for data transmission.
 @@ -752,6 +764,8 @@ struct b43_wldev {
  bool dfq_valid; /* Directed frame queue valid (IBSS PS mode,  
 ATIM) */
  bool radio_hw_enable;   /* saved state of radio hardware enabled  
 state */
  bool suspend_in_progress;   /* TRUE, if we are in a suspend/resume  
 cycle */
 +bool qos_enabled;   /* TRUE, if QoS is used. */
 +bool hwcrypto_enabled;  /* TRUE, if HW crypto acceleration is  
 enabled. */

  /* PHY/Radio device. */
  struct b43_phy phy;
 Index: wireless-testing/drivers/net/wireless/b43/dma.c
 ===
 --- wireless-testing.orig/drivers/net/wireless/b43/dma.c 2009-04-07  
 19:58:22.0 +0200
 +++ wireless-testing/drivers/net/wireless/b43/dma.c  2009-04-08  
 01:53:56.0 +0200
 @@ -1285,7 +1285,7 @@ static struct b43_dmaring *select_ring_b
 {
  struct b43_dmaring *ring;

 -if (b43_modparam_qos) {
 +if (dev-qos_enabled) {
  /* 0 = highest priority */
  switch (queue_prio) {
  default:
 Index: wireless-testing/drivers/net/wireless/b43/main.c
 ===
 --- wireless-testing.orig/drivers/net/wireless/b43/main.c 
 2009-04-07 19:55:03.0 +0200
 +++ wireless-testing/drivers/net/wireless/b43/main.c 2009-04-08  
 02:02:19.0 +0200
 @@ -80,8 +80,8 @@ static int modparam_nohwcrypt;
 module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
 MODULE_PARM_DESC(nohwcrypt, Disable hardware encryption.);

 -int b43_modparam_qos = 1;
 -module_param_named(qos, b43_modparam_qos, int, 0444);
 +static int modparam_qos = 1;
 +module_param_named(qos, modparam_qos, int, 0444);
 MODULE_PARM_DESC(qos, Enable QOS support (default on));

 static int modparam_btcoex = 1;
 @@ 

Re: [PATCH, RFC] b44: Add fw capabilities

2009-04-09 Thread Michael Buesch
On Wednesday 08 April 2009 02:11:16 Michael Buesch wrote:
 Completely untested patch to implement firmware capabilities
 and automagic QoS-disabling.
 

So could somebody who uses opensource fw test this?

Module parameter qos=0 should not be needed anymore. So please test opensource 
fw
with qos=1.


 Index: wireless-testing/drivers/net/wireless/b43/b43.h
 ===
 --- wireless-testing.orig/drivers/net/wireless/b43/b43.h  2009-04-07 
 19:52:34.0 +0200
 +++ wireless-testing/drivers/net/wireless/b43/b43.h   2009-04-08 
 01:57:58.0 +0200
 @@ -163,6 +163,7 @@ enum {
  #define B43_SHM_SH_WLCOREREV 0x0016  /* 802.11 core revision */
  #define B43_SHM_SH_PCTLWDPOS 0x0008
  #define B43_SHM_SH_RXPADOFF  0x0034  /* RX Padding data offset (PIO 
 only) */
 +#define B43_SHM_SH_FWCAPA0x0042  /* Firmware capabilities 
 (Opensource firmware only) */
  #define B43_SHM_SH_PHYVER0x0050  /* PHY version */
  #define B43_SHM_SH_PHYTYPE   0x0052  /* PHY type */
  #define B43_SHM_SH_ANTSWAP   0x005C  /* Antenna swap threshold */
 @@ -297,6 +298,10 @@ enum {
  #define B43_HF_MLADVW0x0010ULL /* N PHY ML ADV 
 workaround (rev = 13 only) */
  #define B43_HF_PR45960W  0x0800ULL /* PR 45960 
 workaround (rev = 13 only) */
  
 +/* Firmware capabilities field in SHM (Opensource firmware only) */
 +#define B43_FWCAPA_HWCRYPTO  0x0001
 +#define B43_FWCAPA_QOS   0x0002
 +
  /* MacFilter offsets. */
  #define B43_MACFILTER_SELF   0x
  #define B43_MACFILTER_BSSID  0x0003
 @@ -596,6 +601,13 @@ struct b43_wl {
   /* Pointer to the ieee80211 hardware data structure */
   struct ieee80211_hw *hw;
  
 + /* The number of queues that were registered with the mac80211 subsystem
 +  * initially. This is a backup copy of hw-queues in case hw-queues has
 +  * to be dynamically lowered at runtime (Firmware does not support QoS).
 +  * hw-queues has to be restored to the original value before 
 unregistering
 +  * from the mac80211 subsystem. */
 + u16 mac80211_initially_registered_queues;
 +
   struct mutex mutex;
   spinlock_t irq_lock;
   /* R/W lock for data transmission.
 @@ -752,6 +764,8 @@ struct b43_wldev {
   bool dfq_valid; /* Directed frame queue valid (IBSS PS mode, 
 ATIM) */
   bool radio_hw_enable;   /* saved state of radio hardware enabled state 
 */
   bool suspend_in_progress;   /* TRUE, if we are in a suspend/resume 
 cycle */
 + bool qos_enabled;   /* TRUE, if QoS is used. */
 + bool hwcrypto_enabled;  /* TRUE, if HW crypto acceleration is 
 enabled. */
  
   /* PHY/Radio device. */
   struct b43_phy phy;
 Index: wireless-testing/drivers/net/wireless/b43/dma.c
 ===
 --- wireless-testing.orig/drivers/net/wireless/b43/dma.c  2009-04-07 
 19:58:22.0 +0200
 +++ wireless-testing/drivers/net/wireless/b43/dma.c   2009-04-08 
 01:53:56.0 +0200
 @@ -1285,7 +1285,7 @@ static struct b43_dmaring *select_ring_b
  {
   struct b43_dmaring *ring;
  
 - if (b43_modparam_qos) {
 + if (dev-qos_enabled) {
   /* 0 = highest priority */
   switch (queue_prio) {
   default:
 Index: wireless-testing/drivers/net/wireless/b43/main.c
 ===
 --- wireless-testing.orig/drivers/net/wireless/b43/main.c 2009-04-07 
 19:55:03.0 +0200
 +++ wireless-testing/drivers/net/wireless/b43/main.c  2009-04-08 
 02:02:19.0 +0200
 @@ -80,8 +80,8 @@ static int modparam_nohwcrypt;
  module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
  MODULE_PARM_DESC(nohwcrypt, Disable hardware encryption.);
  
 -int b43_modparam_qos = 1;
 -module_param_named(qos, b43_modparam_qos, int, 0444);
 +static int modparam_qos = 1;
 +module_param_named(qos, modparam_qos, int, 0444);
  MODULE_PARM_DESC(qos, Enable QOS support (default on));
  
  static int modparam_btcoex = 1;
 @@ -538,6 +538,13 @@ void b43_hf_write(struct b43_wldev *dev,
   b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTFHI, hi);
  }
  
 +/* Read the firmware capabilities bitmask (Opensource firmware only) */
 +static u16 b43_fwcapa_read(struct b43_wldev *dev)
 +{
 + B43_WARN_ON(!dev-fw.opensource);
 + return b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_FWCAPA);
 +}
 +
  void b43_tsf_read(struct b43_wldev *dev, u64 *tsf)
  {
   u32 low, high;
 @@ -2330,12 +2337,34 @@ static int b43_upload_microcode(struct b
   dev-fw.patch = fwpatch;
   dev-fw.opensource = (fwdate == 0x);
  
 + /* Default to use-all-queues. */
 + dev-wl-hw-queues = dev-wl-mac80211_initially_registered_queues;
 + dev-qos_enabled = !!modparam_qos;
 + /* Default to firmware/hardware 

Re: [PATCH, RFC] b44: Add fw capabilities

2009-04-09 Thread Michael Buesch
On Thursday 09 April 2009 12:36:42 Francesco Gringoli wrote:
 On Apr 9, 2009, at 12:18 PM, Michael Buesch wrote:
 
  On Wednesday 08 April 2009 02:11:16 Michael Buesch wrote:
  Completely untested patch to implement firmware capabilities
  and automagic QoS-disabling.
 
 
  So could somebody who uses opensource fw test this?
 
  Module parameter qos=0 should not be needed anymore. So please test  
  opensource fw
  with qos=1.
 Hi Michael,
 
 cool! These are excerpts from dmesg. All the times connectivity was ok.

Ok nice.
If you guys think 0x42 still is a good SHM offset, I'll submit it upstream.

-- 
Greetings, Michael.
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


Re: [PATCH, RFC] b44: Add fw capabilities

2009-04-08 Thread Gábor Stefanik
I assume b44 in the title is a typo.

On Wed, Apr 8, 2009 at 2:11 AM, Michael Buesch m...@bu3sch.de wrote:
 Completely untested patch to implement firmware capabilities
 and automagic QoS-disabling.


 Index: wireless-testing/drivers/net/wireless/b43/b43.h
 ===
 --- wireless-testing.orig/drivers/net/wireless/b43/b43.h        2009-04-07 
 19:52:34.0 +0200
 +++ wireless-testing/drivers/net/wireless/b43/b43.h     2009-04-08 
 01:57:58.0 +0200
 @@ -163,6 +163,7 @@ enum {
  #define B43_SHM_SH_WLCOREREV           0x0016  /* 802.11 core revision */
  #define B43_SHM_SH_PCTLWDPOS           0x0008
  #define B43_SHM_SH_RXPADOFF            0x0034  /* RX Padding data offset 
 (PIO only) */
 +#define B43_SHM_SH_FWCAPA              0x0042  /* Firmware capabilities 
 (Opensource firmware only) */
  #define B43_SHM_SH_PHYVER              0x0050  /* PHY version */
  #define B43_SHM_SH_PHYTYPE             0x0052  /* PHY type */
  #define B43_SHM_SH_ANTSWAP             0x005C  /* Antenna swap threshold */
 @@ -297,6 +298,10 @@ enum {
  #define B43_HF_MLADVW          0x0010ULL /* N PHY ML ADV workaround 
 (rev = 13 only) */
  #define B43_HF_PR45960W                0x0800ULL /* PR 45960 
 workaround (rev = 13 only) */

 +/* Firmware capabilities field in SHM (Opensource firmware only) */
 +#define B43_FWCAPA_HWCRYPTO    0x0001
 +#define B43_FWCAPA_QOS         0x0002
 +
  /* MacFilter offsets. */
  #define B43_MACFILTER_SELF             0x
  #define B43_MACFILTER_BSSID            0x0003
 @@ -596,6 +601,13 @@ struct b43_wl {
        /* Pointer to the ieee80211 hardware data structure */
        struct ieee80211_hw *hw;

 +       /* The number of queues that were registered with the mac80211 
 subsystem
 +        * initially. This is a backup copy of hw-queues in case hw-queues 
 has
 +        * to be dynamically lowered at runtime (Firmware does not support 
 QoS).
 +        * hw-queues has to be restored to the original value before 
 unregistering
 +        * from the mac80211 subsystem. */
 +       u16 mac80211_initially_registered_queues;
 +
        struct mutex mutex;
        spinlock_t irq_lock;
        /* R/W lock for data transmission.
 @@ -752,6 +764,8 @@ struct b43_wldev {
        bool dfq_valid;         /* Directed frame queue valid (IBSS PS mode, 
 ATIM) */
        bool radio_hw_enable;   /* saved state of radio hardware enabled state 
 */
        bool suspend_in_progress;       /* TRUE, if we are in a suspend/resume 
 cycle */
 +       bool qos_enabled;               /* TRUE, if QoS is used. */
 +       bool hwcrypto_enabled;          /* TRUE, if HW crypto acceleration is 
 enabled. */

        /* PHY/Radio device. */
        struct b43_phy phy;
 Index: wireless-testing/drivers/net/wireless/b43/dma.c
 ===
 --- wireless-testing.orig/drivers/net/wireless/b43/dma.c        2009-04-07 
 19:58:22.0 +0200
 +++ wireless-testing/drivers/net/wireless/b43/dma.c     2009-04-08 
 01:53:56.0 +0200
 @@ -1285,7 +1285,7 @@ static struct b43_dmaring *select_ring_b
  {
        struct b43_dmaring *ring;

 -       if (b43_modparam_qos) {
 +       if (dev-qos_enabled) {
                /* 0 = highest priority */
                switch (queue_prio) {
                default:
 Index: wireless-testing/drivers/net/wireless/b43/main.c
 ===
 --- wireless-testing.orig/drivers/net/wireless/b43/main.c       2009-04-07 
 19:55:03.0 +0200
 +++ wireless-testing/drivers/net/wireless/b43/main.c    2009-04-08 
 02:02:19.0 +0200
 @@ -80,8 +80,8 @@ static int modparam_nohwcrypt;
  module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
  MODULE_PARM_DESC(nohwcrypt, Disable hardware encryption.);

 -int b43_modparam_qos = 1;
 -module_param_named(qos, b43_modparam_qos, int, 0444);
 +static int modparam_qos = 1;
 +module_param_named(qos, modparam_qos, int, 0444);
  MODULE_PARM_DESC(qos, Enable QOS support (default on));

  static int modparam_btcoex = 1;
 @@ -538,6 +538,13 @@ void b43_hf_write(struct b43_wldev *dev,
        b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTFHI, hi);
  }

 +/* Read the firmware capabilities bitmask (Opensource firmware only) */
 +static u16 b43_fwcapa_read(struct b43_wldev *dev)
 +{
 +       B43_WARN_ON(!dev-fw.opensource);
 +       return b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_FWCAPA);
 +}
 +
  void b43_tsf_read(struct b43_wldev *dev, u64 *tsf)
  {
        u32 low, high;
 @@ -2330,12 +2337,34 @@ static int b43_upload_microcode(struct b
        dev-fw.patch = fwpatch;
        dev-fw.opensource = (fwdate == 0x);

 +       /* Default to use-all-queues. */
 +       dev-wl-hw-queues = dev-wl-mac80211_initially_registered_queues;
 +       dev-qos_enabled = !!modparam_qos;
 +       /* Default to firmware/hardware crypto acceleration. */
 +       

Re: [PATCH, RFC] b44: Add fw capabilities

2009-04-08 Thread Michael Buesch
On Wednesday 08 April 2009 14:30:06 Gábor Stefanik wrote:
 I assume b44 in the title is a typo.

I assume you're right ;)

-- 
Greetings, Michael.
___
Bcm43xx-dev mailing list
Bcm43xx-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev


[PATCH, RFC] b44: Add fw capabilities

2009-04-07 Thread Michael Buesch
Completely untested patch to implement firmware capabilities
and automagic QoS-disabling.


Index: wireless-testing/drivers/net/wireless/b43/b43.h
===
--- wireless-testing.orig/drivers/net/wireless/b43/b43.h2009-04-07 
19:52:34.0 +0200
+++ wireless-testing/drivers/net/wireless/b43/b43.h 2009-04-08 
01:57:58.0 +0200
@@ -163,6 +163,7 @@ enum {
 #define B43_SHM_SH_WLCOREREV   0x0016  /* 802.11 core revision */
 #define B43_SHM_SH_PCTLWDPOS   0x0008
 #define B43_SHM_SH_RXPADOFF0x0034  /* RX Padding data offset (PIO 
only) */
+#define B43_SHM_SH_FWCAPA  0x0042  /* Firmware capabilities 
(Opensource firmware only) */
 #define B43_SHM_SH_PHYVER  0x0050  /* PHY version */
 #define B43_SHM_SH_PHYTYPE 0x0052  /* PHY type */
 #define B43_SHM_SH_ANTSWAP 0x005C  /* Antenna swap threshold */
@@ -297,6 +298,10 @@ enum {
 #define B43_HF_MLADVW  0x0010ULL /* N PHY ML ADV workaround 
(rev = 13 only) */
 #define B43_HF_PR45960W0x0800ULL /* PR 45960 
workaround (rev = 13 only) */
 
+/* Firmware capabilities field in SHM (Opensource firmware only) */
+#define B43_FWCAPA_HWCRYPTO0x0001
+#define B43_FWCAPA_QOS 0x0002
+
 /* MacFilter offsets. */
 #define B43_MACFILTER_SELF 0x
 #define B43_MACFILTER_BSSID0x0003
@@ -596,6 +601,13 @@ struct b43_wl {
/* Pointer to the ieee80211 hardware data structure */
struct ieee80211_hw *hw;
 
+   /* The number of queues that were registered with the mac80211 subsystem
+* initially. This is a backup copy of hw-queues in case hw-queues has
+* to be dynamically lowered at runtime (Firmware does not support QoS).
+* hw-queues has to be restored to the original value before 
unregistering
+* from the mac80211 subsystem. */
+   u16 mac80211_initially_registered_queues;
+
struct mutex mutex;
spinlock_t irq_lock;
/* R/W lock for data transmission.
@@ -752,6 +764,8 @@ struct b43_wldev {
bool dfq_valid; /* Directed frame queue valid (IBSS PS mode, 
ATIM) */
bool radio_hw_enable;   /* saved state of radio hardware enabled state 
*/
bool suspend_in_progress;   /* TRUE, if we are in a suspend/resume 
cycle */
+   bool qos_enabled;   /* TRUE, if QoS is used. */
+   bool hwcrypto_enabled;  /* TRUE, if HW crypto acceleration is 
enabled. */
 
/* PHY/Radio device. */
struct b43_phy phy;
Index: wireless-testing/drivers/net/wireless/b43/dma.c
===
--- wireless-testing.orig/drivers/net/wireless/b43/dma.c2009-04-07 
19:58:22.0 +0200
+++ wireless-testing/drivers/net/wireless/b43/dma.c 2009-04-08 
01:53:56.0 +0200
@@ -1285,7 +1285,7 @@ static struct b43_dmaring *select_ring_b
 {
struct b43_dmaring *ring;
 
-   if (b43_modparam_qos) {
+   if (dev-qos_enabled) {
/* 0 = highest priority */
switch (queue_prio) {
default:
Index: wireless-testing/drivers/net/wireless/b43/main.c
===
--- wireless-testing.orig/drivers/net/wireless/b43/main.c   2009-04-07 
19:55:03.0 +0200
+++ wireless-testing/drivers/net/wireless/b43/main.c2009-04-08 
02:02:19.0 +0200
@@ -80,8 +80,8 @@ static int modparam_nohwcrypt;
 module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
 MODULE_PARM_DESC(nohwcrypt, Disable hardware encryption.);
 
-int b43_modparam_qos = 1;
-module_param_named(qos, b43_modparam_qos, int, 0444);
+static int modparam_qos = 1;
+module_param_named(qos, modparam_qos, int, 0444);
 MODULE_PARM_DESC(qos, Enable QOS support (default on));
 
 static int modparam_btcoex = 1;
@@ -538,6 +538,13 @@ void b43_hf_write(struct b43_wldev *dev,
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTFHI, hi);
 }
 
+/* Read the firmware capabilities bitmask (Opensource firmware only) */
+static u16 b43_fwcapa_read(struct b43_wldev *dev)
+{
+   B43_WARN_ON(!dev-fw.opensource);
+   return b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_FWCAPA);
+}
+
 void b43_tsf_read(struct b43_wldev *dev, u64 *tsf)
 {
u32 low, high;
@@ -2330,12 +2337,34 @@ static int b43_upload_microcode(struct b
dev-fw.patch = fwpatch;
dev-fw.opensource = (fwdate == 0x);
 
+   /* Default to use-all-queues. */
+   dev-wl-hw-queues = dev-wl-mac80211_initially_registered_queues;
+   dev-qos_enabled = !!modparam_qos;
+   /* Default to firmware/hardware crypto acceleration. */
+   dev-hwcrypto_enabled = 1;
+
if (dev-fw.opensource) {
+   u16 fwcapa;
+
/* Patchlevel info is encoded in the time field. */
dev-fw.patch = fwtime;
-