Linux wireless drivers development
 help / color / mirror / Atom feed
* pull request: wireless-next-2.6 2010-05-17
From: John W. Linville @ 2010-05-17 18:26 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev

Dave,

One last big batch intended for 2.6.35 -- these have all been in
linux-next for several days.  Included are the usual driver updates for
iwlwifi, ath9k, and rt2x00 along with a smattering of other bits
(including some trivial fixups).

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit 278554bd6579206921f5d8a523649a7a57f8850d:
  David S. Miller (1):
        Merge branch 'master' of master.kernel.org:/.../davem/net-2.6

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6.git for-davem

Abhijeet Kolekar (3):
      iwl3945: fix scan races
      iwl3945: add plcp error checking
      mac80211: fix paged defragmentation

Dan Carpenter (3):
      wl1271: add missing spin_lock()
      wl1271: fix notifier interface supported test
      wl1271: remove some unneeded code

Felix Fietkau (4):
      ath9k: use debugfs_remove_recursive() instead of keeping pointers to all entries
      ath9k: add debugfs files for reading/writing the rx and tx chainmask
      ath9k: add debugfs files for reading/writing registers
      ath9k_hw: clean up EEPROM endian handling on AR9003

Gertjan van Wingerde (6):
      rt2x00: Consistently name skb frame descriptor skbdesc.
      rt2x00: Fix beacon descriptor writing for rt61pci.
      rt2x00: Re-order tx descriptor writing code in drivers.
      rt2x00: Simplify TXD handling of beacons.
      rt2x00: Dump beacons under a different identifier than TX frames.
      rt2x00: In debugfs frame dumping allow the TX descriptor to be part of the skb.

Johannes Berg (34):
      iwlagn: wait for asynchronous firmware loading
      iwlwifi: use vif iwl_bss_info_changed
      iwl3945: use iwl3945_add_bcast_station
      iwlwifi: pass address to iwl_remove_station
      iwlwifi: manage IBSS station properly
      iwlagn: show and store firmware build number
      iwl3945: remove ucode access indirection
      iwlwifi: remove ucode virtual functions
      iwlwifi: move eeprom version printout to eeprom init
      iwlagn: prepare for new firmware file format
      iwlagn: implement loading a new firmware file type
      iwlwifi: remove rts_threshold
      iwlagn: move iwl_get_ra_sta_id to 4965
      iwlagn: use vif->type to check station
      iwlwifi: apply filter flags directly
      iwlwifi: push virtual interface through
      iwlagn: use virtual interface in TX aggregation handling
      iwlwifi: remove useless priv->vif check
      iwlwifi: use vif in iwl_ht_conf
      iwlwifi: note that priv->bssid is used only by 3945
      iwlwifi: fix iwl_sta_init_lq station ID
      iwlwifi: split allocation/sending local station LQ
      iwlwifi: rework broadcast station management
      iwlwifi: track station IDs
      iwlwifi: add iwl_sta_id()
      iwlwifi: use iwl_find_station less
      iwlagn: use iwl_sta_id() for aggregation
      iwlwifi: use iwl_sta_id() for TKIP key update
      iwlwifi: move iwl_find_station() to 4965
      iwlwifi: rename iwl_add_local_station
      iwlwifi: remove pointless HT check
      iwlwifi: clear driver stations when going down
      mac80211: don't process work item with wrong frame
      mac80211: add offload channel switch support

John W. Linville (2):
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next-2.6 into for-davem

Julia Lawall (1):
      drivers/net/wireless/hostap: Drop memory allocation cast

Luis R. Rodriguez (2):
      ath5k: drop warning on jumbo frames
      ath9k_hw: new initialization values for AR9003

Reinette Chatre (3):
      Merge branch 'wireless-2.6' into wireless-next-2.6
      iwlwifi: make bcast LQ command available for later restore actions
      iwlagn: work around rate scaling reset delay

Shanyu Zhao (2):
      iwlwifi: rename 6000 series Gen2 devices to Gen2a
      iwlwifi: dump firmware build info in error case

Steve Tanner (1):
      ar9170usb: add vendor and device ID for Qwest/Actiontec 802AIN Wireless N USB Network Adapter

Sujith.Manoharan@atheros.com (5):
      ath9k_htc: Lock sta_notify() callback
      ath9k_htc: Allocate URBs properly
      ath9k_htc: Reorder HTC initialization
      ath9k_htc: Fix target ready race condition
      ath9k_htc: Fix array overflow

Vasanthakumar Thiagarajan (2):
      ath9k: Fix bug in handling rx frames with invalid descriptor content
      ath9k: Remove unused rx_edma in ath_rx_addbuffer_edma()

Wey-Yi Guy (11):
      iwlwifi: remove powersave debugfs if it is not supported
      iwlwifi: rename "tx_power" to "chain_tx_power"
      iwlwifi: remove device type checking for tx power in debugfs
      iwlwifi: use .cfg to enable/disable continuous ucode trace
      iwlwifi: use cfg to configure calibration operation
      iwlwifi: give correct return information for tx power debugfs
      iwlwifi: wimax co-exist code clean up
      iwlwifi: checking for all the possible failure cases
      iwlwifi: "tx power per chain" are part of ucode_tx_stats
      iwlwifi: provide more comments for cfg structure
      mac80211: check channel switch mode for future frames transmit

 drivers/net/wireless/ath/ar9170/usb.c            |    2 +
 drivers/net/wireless/ath/ath5k/base.c            |   12 +-
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c   |  174 +++----
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.h   |   10 +-
 drivers/net/wireless/ath/ath9k/ar9003_initvals.h |  268 ++++++------
 drivers/net/wireless/ath/ath9k/debug.c           |  236 ++++++++--
 drivers/net/wireless/ath/ath9k/debug.h           |    8 +-
 drivers/net/wireless/ath/ath9k/hif_usb.c         |   58 ++--
 drivers/net/wireless/ath/ath9k/htc_drv_init.c    |    7 +
 drivers/net/wireless/ath/ath9k/htc_drv_main.c    |    4 +
 drivers/net/wireless/ath/ath9k/htc_hst.c         |   51 +-
 drivers/net/wireless/ath/ath9k/htc_hst.h         |   15 +-
 drivers/net/wireless/ath/ath9k/recv.c            |    3 +-
 drivers/net/wireless/hostap/hostap_80211_rx.c    |    3 +-
 drivers/net/wireless/hostap/hostap_ioctl.c       |    3 +-
 drivers/net/wireless/iwlwifi/iwl-1000.c          |    9 +-
 drivers/net/wireless/iwlwifi/iwl-3945.c          |  147 ++++--
 drivers/net/wireless/iwlwifi/iwl-3945.h          |   22 +-
 drivers/net/wireless/iwlwifi/iwl-4965.c          |  100 +++--
 drivers/net/wireless/iwlwifi/iwl-5000.c          |   27 +-
 drivers/net/wireless/iwlwifi/iwl-6000.c          |   51 ++-
 drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c   |   16 +
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c       |   31 +-
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c        |   29 +-
 drivers/net/wireless/iwlwifi/iwl-agn-ucode.c     |  109 +++--
 drivers/net/wireless/iwlwifi/iwl-agn.c           |  556 +++++++++++++++-------
 drivers/net/wireless/iwlwifi/iwl-agn.h           |   14 +-
 drivers/net/wireless/iwlwifi/iwl-commands.h      |    6 +-
 drivers/net/wireless/iwlwifi/iwl-core.c          |  199 +++-----
 drivers/net/wireless/iwlwifi/iwl-core.h          |   60 ++-
 drivers/net/wireless/iwlwifi/iwl-debugfs.c       |   66 +--
 drivers/net/wireless/iwlwifi/iwl-dev.h           |   89 +++-
 drivers/net/wireless/iwlwifi/iwl-eeprom.c        |    7 +
 drivers/net/wireless/iwlwifi/iwl-power.c         |    5 +-
 drivers/net/wireless/iwlwifi/iwl-rx.c            |    9 +-
 drivers/net/wireless/iwlwifi/iwl-scan.c          |   16 +-
 drivers/net/wireless/iwlwifi/iwl-sta.c           |  456 ++++++++----------
 drivers/net/wireless/iwlwifi/iwl-sta.h           |   60 ++-
 drivers/net/wireless/iwlwifi/iwl3945-base.c      |  163 ++++---
 drivers/net/wireless/rt2x00/rt2400pci.c          |   26 +-
 drivers/net/wireless/rt2x00/rt2500pci.c          |   26 +-
 drivers/net/wireless/rt2x00/rt2500usb.c          |   55 ++-
 drivers/net/wireless/rt2x00/rt2800pci.c          |   14 +-
 drivers/net/wireless/rt2x00/rt2800usb.c          |    8 +-
 drivers/net/wireless/rt2x00/rt2x00debug.c        |   21 +-
 drivers/net/wireless/rt2x00/rt2x00dump.h         |    3 +
 drivers/net/wireless/rt2x00/rt2x00pci.c          |    9 -
 drivers/net/wireless/rt2x00/rt2x00queue.c        |   15 +-
 drivers/net/wireless/rt2x00/rt2x00queue.h        |    3 +
 drivers/net/wireless/rt2x00/rt2x00usb.c          |    8 -
 drivers/net/wireless/rt2x00/rt61pci.c            |   35 +-
 drivers/net/wireless/rt2x00/rt73usb.c            |   71 ++--
 drivers/net/wireless/wl12xx/wl1271_main.c        |    5 +-
 include/net/mac80211.h                           |   39 ++
 net/mac80211/driver-ops.h                        |   11 +
 net/mac80211/driver-trace.h                      |   49 ++
 net/mac80211/ieee80211_i.h                       |    3 +-
 net/mac80211/mlme.c                              |   59 +++-
 net/mac80211/rx.c                                |    6 +
 net/mac80211/work.c                              |   27 +-
 60 files changed, 2152 insertions(+), 1442 deletions(-)

Omnibus patch available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6-2010-05-17.patch.bz2

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: A file to print the release of loaded compat-wireless stuff
From: Pavel Roskin @ 2010-05-17 19:10 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless
In-Reply-To: <AANLkTilrjw-Jq4MEQPT35fHTTqsaSdU5Jc7lt_2lUH2V@mail.gmail.com>

On Mon, 2010-05-17 at 10:54 -0700, Luis R. Rodriguez wrote:

> Oh wow, and look at that, even if you enable the module as built-in to
> the kernel you still get the module parameter sysfs file for it. For
> example I just built-in cfg80211 on my kernel and I still see the
> ieee80211_regdom module parameter:
> 
> mcgrof@tux ~ $ lsmod | grep cfg
> mcgrof@tux ~ $ cat /sys/module/cfg80211/parameters/ieee80211_regdom
> 00
> 
> This is important as some distributions [1] might built-in some stable
> compat-wireless releases into their older kernel releases.

I actually wanted to mention that, but decided that it's irrelevant to
compat-wireless.  It turns out I should have.

-- 
Regards,
Pavel Roskin

^ permalink raw reply

* [PATCH] fix several minor description typos
From: Walter Goldens @ 2010-05-17 19:33 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

Signed-off-by: Walter Goldens <goldenstranger@yahoo.com>
---

--- a/drivers/net/wireless/ath/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
@@ -715,7 +715,7 @@ ath5k_eeprom_convert_pcal_info_5111(stru
 
         /* Only one curve for RF5111
          * find out which one and place
-         * in in pd_curves.
+         * in pd_curves.
          * Note: ee_x_gain is reversed here */
         for (idx = 0; idx < AR5K_EEPROM_N_PD_CURVES; idx++) {
 
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -459,7 +459,7 @@ struct ath9k_hw_version {
 #define AR_GENTMR_BIT(_index)    (1 << (_index))
 
 /*
- * Using de Bruijin sequence to to look up 1's index in a 32 bit number
+ * Using de Bruijin sequence to look up 1's index in a 32 bit number
  * debruijn32 = 0000 0111 0111 1100 1011 0101 0011 0001
  */
 #define debruijn32 0x077CB531U
--- a/drivers/net/wireless/iwmc3200wifi/hal.c
+++ b/drivers/net/wireless/iwmc3200wifi/hal.c
@@ -54,7 +54,7 @@
  *   LMAC. If you look at LMAC commands you'll se that they
  *   are actually regular iwlwifi target commands encapsulated
  *   into a special UMAC command called UMAC passthrough.
- *   This is due to the fact the the host talks exclusively
+ *   This is due to the fact the host talks exclusively
  *   to the UMAC and so there needs to be a special UMAC
  *   command for talking to the LMAC.
  *   This is how a wifi command is layed out:
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -666,7 +666,7 @@ void lbs_scan_worker(struct work_struct 
 /**
  *  @brief Interpret a BSS scan response returned from the firmware
  *
- *  Parse the various fixed fields and IEs passed back for a a BSS probe
+ *  Parse the various fixed fields and IEs passed back for a BSS probe
  *  response or beacon from the scan command.  Record information as needed
  *  in the scan table struct bss_descriptor for that entry.
  *
--- a/drivers/net/wireless/orinoco/hermes_dld.c
+++ b/drivers/net/wireless/orinoco/hermes_dld.c
@@ -68,7 +68,7 @@ struct dblock {
 } __attribute__ ((packed));
 
 /*
- * Plug Data References are located in in the image after the last data
+ * Plug Data References are located in the image after the last data
  * block.  They refer to areas in the adapter memory where the plug data
  * items with matching ID should be written.
  */
--- a/drivers/net/wireless/orinoco/main.h
+++ b/drivers/net/wireless/orinoco/main.h
@@ -12,7 +12,7 @@
 /* Compile time configuration and compatibility stuff               */
 /********************************************************************/
 
-/* We do this this way to avoid ifdefs in the actual code */
+/* We do that this way to avoid ifdefs in the actual code */
 #ifdef WIRELESS_SPY
 #define SPY_NUMBER(priv)    (priv->spy_data.spy_number)
 #else
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -224,7 +224,7 @@ void rt2x00lib_txdone(struct queue_entry
     /*
      * If the IV/EIV data was stripped from the frame before it was
      * passed to the hardware, we should now reinsert it again because
-     * mac80211 will expect the the same data to be present it the
+     * mac80211 will expect the same data to be present it the
      * frame as it was passed to us.
      */
     if (test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags))
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -855,7 +855,7 @@ int zd_mac_rx(struct ieee80211_hw *hw, c
     if (skb == NULL)
         return -ENOMEM;
     if (need_padding) {
-        /* Make sure the the payload data is 4 byte aligned. */
+        /* Make sure the payload data is 4 byte aligned. */
         skb_reserve(skb, 2);
     }
 
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -844,7 +844,7 @@ out:
  * @usb: a &struct zd_usb pointer
  * @urb: URB to be freed
  *
- * Frees the the transmission URB, which means to put it on the free URB
+ * Frees the transmission URB, which means to put it on the free URB
  * list.
  */
 static void free_tx_urb(struct zd_usb *usb, struct urb *urb)
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -302,7 +302,7 @@ static inline int ieee80211_is_data_qos(
 static inline int ieee80211_is_data_present(__le16 fc)
 {
     /*
-     * mask with 0x40 and test that that bit is clear to only return true
+     * mask with 0x40 and test that this bit is clear to only return true
      * for the data-containing substypes.
      */
     return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | 0x40)) ==
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -132,7 +132,7 @@
  *     %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
  *     %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
  * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
- *     to the the specified ISO/IEC 3166-1 alpha2 country code. The core will
+ *     to the specified ISO/IEC 3166-1 alpha2 country code. The core will
  *     store this as a valid request and then query userspace for it.
  *
  * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -90,7 +90,7 @@ enum ieee80211_channel_flags {
  * @max_power: maximum transmission power (in dBm)
  * @beacon_found: helper to regulatory code to indicate when a beacon
  *    has been found on this channel. Use regulatory_hint_found_beacon()
- *    to enable this, this is is useful only on 5 GHz band.
+ *    to enable this, this is useful only on 5 GHz band.
  * @orig_mag: internal use
  * @orig_mpwr: internal use
  */
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1767,7 +1767,7 @@ static void ieee80211_sta_work(struct wo
 
     /*
      * ieee80211_queue_work() should have picked up most cases,
-     * here we'll pick the the rest.
+     * here we'll pick the rest.
      */
     if (WARN(local->suspended, "STA MLME work scheduled while "
          "going to suspend\n"))
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -47,7 +47,7 @@ static void ieee80211_handle_filtered_fr
     /*
      * This skb 'survived' a round-trip through the driver, and
      * hopefully the driver didn't mangle it too badly. However,
-     * we can definitely not rely on the the control information
+     * we can definitely not rely on the control information
      * being correct. Clear it so we don't get junk there, and
      * indicate that it needs new processing, but must not be
      * modified/encrypted again.
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -840,7 +840,7 @@ static void ieee80211_work_work(struct w
 
     /*
      * ieee80211_queue_work() should have picked up most cases,
-     * here we'll pick the the rest.
+     * here we'll pick the rest.
      */
     if (WARN(local->suspended, "work scheduled while going to suspend\n"))
         return;



      

^ permalink raw reply

* [PATCH] fix minor typos and small additions
From: Walter Goldens @ 2010-05-17 19:34 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless

Signed-off-by: Walter Goldens <goldenstranger@yahoo.com>
---

--- a/README
+++ b/README
@@ -59,7 +59,7 @@ helper script:
 
 Run that script to see more information.
 
-Building, and installing
+Building and installing
 ------------------------
 
 Build: build the latest linux wireless subsystem
@@ -104,14 +104,15 @@ Unload:
 Drivers
 -------
 
-This is the list of drivers this package provides. It adds
+This is the list of drivers the package provides. It adds
 all new drivers or drivers which keep being updated which you might
 be interested in.
 
 Driver
 adm8211
 ath5k
-ath9h
+ath9k
+ath9k_htc
 ar9170
 b43
 b43legacy
@@ -121,11 +122,13 @@ ipw2100
 ipw2200
 libertas_cs (Libertas)
 ub8xxx      (Libertas)
+orinoco
 p54pci
 p54usb
 rt2400pci (rt2x00)
 rt2500pci (rt2x00)
 rt2500usb (rt2x00)
+rt2800usb (rt2x00)
 rt61pci      (rt2x00)
 rt73usb      (rt2x00)
 rtl8180    (Realtek)
@@ -136,7 +139,7 @@ This package also provides more drivers 
 
 For a complete list see:
 
-http://wireless.kernel.org/en/users/Download
+http://linuxwireless.org/en/users/Drivers and http://wireless.kernel.org/en/users/Download
 
 Non-wireless drivers
 --------------------
@@ -144,7 +147,7 @@ Non-wireless drivers
 To support b43 ssb is also provided, and since ssb is also provided
 we provide b44 (the ethernet driver).
 
-The new rfkill drivers also provided and backported.
+The new rfkill drivers are also provided and backported.
 
 Bluetooth drivers:
 bluetooth
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -106,7 +106,7 @@ DRIVERS="$DRIVERS drivers/net/atlx"
 # Bluetooth drivers
 DRIVERS_BT="drivers/bluetooth"
 
-# Drivers that belong the the wireless directory
+# Drivers that belong to the wireless directory
 DRIVER_FILES="adm8211.c  adm8211.h"
 DRIVER_FILES="$DRIVER_FILES rndis_wlan.c"
 DRIVER_FILES="$DRIVER_FILES mac80211_hwsim.c"
--- a/scripts/driver-select
+++ b/scripts/driver-select
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 2009        Luis R. Rodriguez <mcgrof@gmail.com>
 #
-# This this to select your compat-wireless driver and
+# Use this to select your compat-wireless driver and
 # reduce compilation time.
 
 DRIVERS_MAKEFILE="drivers/net/wireless/Makefile"



      

^ permalink raw reply

* Re: [PATCH] fix several minor description typos
From: Dave @ 2010-05-17 21:49 UTC (permalink / raw)
  To: Walter Goldens; +Cc: John W. Linville, linux-wireless
In-Reply-To: <974011.51480.qm@web56808.mail.re3.yahoo.com>

You may want to prefix the patch title with 'wireless:', and include in
the commitlog a description what type of errors you are correcting. In
this case I'd guess 'avoid word repetition'.

Most of the changes seem obviously correct. However a couple:

On 17/05/10 20:33, Walter Goldens wrote:
> --- a/drivers/net/wireless/orinoco/main.h
> +++ b/drivers/net/wireless/orinoco/main.h
> @@ -12,7 +12,7 @@
>  /* Compile time configuration and compatibility stuff               */
>  /********************************************************************/
>  
> -/* We do this this way to avoid ifdefs in the actual code */
> +/* We do that this way to avoid ifdefs in the actual code */
>  #ifdef WIRELESS_SPY
>  #define SPY_NUMBER(priv)    (priv->spy_data.spy_number)
>  #else

The latter construction doesn't make sense (to me). The former does,
even if it is a little clumsy. If the comment is still useful, I suggest
rewording it as something like:

/* Define SPY_NUMBER like this to avoid ifdefs in the actual code */

> --- a/include/linux/ieee80211.h
> +++ b/include/linux/ieee80211.h
> @@ -302,7 +302,7 @@ static inline int ieee80211_is_data_qos(
>  static inline int ieee80211_is_data_present(__le16 fc)
>  {
>      /*
> -     * mask with 0x40 and test that that bit is clear to only return true
> +     * mask with 0x40 and test that this bit is clear to only return true
>       * for the data-containing substypes.
>       */
>      return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | 0x40)) ==

You may also want to correct the spelling of 'subtypes' here. I also
think that this could be reworded better. After consulting
IEE802.11-2007, section 7.1.3.1.2, I'd suggest:

/* Only return true for the data-containing subtypes.
 * Bit 0x40 indicates the frame subtype does not contain a Frame Body
 * field (i.e. there is no data). This bit should not be set.
 */

But I'd confirm with one of the core wireless developers before making
that change. It may also be worth changing the code to use
IEEE80211_STYPE_NULLFUNC instead of 0x40.


Regards,

Dave.

^ permalink raw reply

* Compat-wireless for 2.6.34 final - 802.11 and bluetooth backported
From: Luis R. Rodriguez @ 2010-05-18  1:27 UTC (permalink / raw)
  To: linux-wireless, linux-bluetooth
  Cc: linux-kernel, Pavel Roskin, Hauke Mehrtens

2.6.34 was released today and now we get a respective compat-wireless
stable [1] tarball based on it [2]. This gives us the 2.6.34 802.11
subsystem, bluetooth subsystem and new 802.11/bluetooth drivers
compilable and installable on older kernels. Please report any issues
ASAP. For details on changes you can refer to the
ChangeLog-2.6.34-wireless [3].

Worth mentioning for this release is I've updated the version tagging
for compat-wireless to allow distributions/users/developers to keep
better track of what exact revision is being used. This was based on
Pavel Roskin's suggestion to use read-only module parameters which are
kept even if you build this tarball into your kernel somehow. Here is
an example of the new files and example output based on this specific
new tarball release:

$ sudo grep '' /sys/module/compat/parameters/compat_*
/sys/module/compat/parameters/compat_base_tree:linux-2.6-allstable.git
/sys/module/compat/parameters/compat_base_tree_version:v2.6.34
/sys/module/compat/parameters/compat_version:compat-wireless-v2.6.34-6-g0ad438e

Upon loading the compat module you would also see this output:

Compat-wireless backport release: compat-wireless-v2.6.34-6-g0ad438e
Backport based on linux-2.6-allstable.git v2.6.34

Since git describe is being used to describe both the base tree and
the compat-wireless release you will be able to tell how many patches
on top of the base tree have been applied. This should account for any
deltas you have created and reflect that (hope is the delta is always
0 with respect to upstream). In the above example output there are 6
patches on top of the "compat-wireless-v2.6.34" tag I created for the
first release, I then found some bugs due to the new version scheme
changes and fixed some of them, so I have applied 6 patches on top of
the original release.

I should note there are a few modules which *do not* make use of the
compat module but do make use of a lot of the defines at build time,
an example of such a module is rndis_wlan so you'd have to load the
compat module manually to get the above info or run strings on the
module.

With bleeding edge releases you will now get:

$ sudo grep '' /sys/module/compat/parameters/compat_*
/sys/module/compat/parameters/compat_base_tree:linux-next.git
/sys/module/compat/parameters/compat_base_tree_version:next-20100517
/sys/module/compat/parameters/compat_version:compat-wireless-20100517-7-ged07f6b

The respective output upon load is:

Compat-wireless backport release: compat-wireless-20100517-7-ged07f6b
Backport based on linux-next.git next-20100517

If there are any questions please let me know.

On a final note thanks to all those who have contributed to this
2.6.34 release of both the generic kernel compatibility module and
compat-wireless, specially to Haukes and Pavel.

Below is the shortlog linux-2.6.33.y.. of compat-wireless:

Bala Shanmugam (1):
      compat-2.6: New targets to compile bluetooth alone

Hauke Mehrtens (17):
      compat-wireless: Add more functions into netdev oops backport
      compat-wireless: backport kfifo for libertas
      compat-wireless: Backport net_device_ops set_mac_address
      compat-wireless: activate usbnet for kernel > 2.6.28
      compat-wireless: Activate ssb and libertas
      compat-wireless: Add missing file
      This adds a refresh option to admin-update.sh using quilt.
      compat-wireless: Refresh patches
      compat-wireless: small fixes to admin-update.sh
      compat-wireless: Backport netdev_ops select_queue
      compat-wireless: remove device_type in usbnet.c
      compat-wireless: missing ksize export
      compat-wireless: fix constant name
      compat-wireless: fix bluetooth capi build
      compat-wireless: update .gitignore
      compat-wireless: update config options
      compat-wireless: Fix refresh script if no patches are available

Luis R. Rodriguez (55):
      Update patch hunk offsets for next-20091228
      Intel removed uts header, update patch for that
      Update patch hunks for next-20100106
      Remove pointless bt-install-scripts extra target
      Fix iwlagn patch offset breakage
      Update patch 01-netdev.patch offsets
      Update 17-netdev-queue.patch offsets
      Update hunk offsets for 15-symbol-export-conflicts.patch
      Update error message on old unsupported kernels
      Add support for driver-select to enable older kernels
      Stop carrying around bitops.h header
      Stop carrying around pm_qos_params.h
      Stop carrying around the include/linux/unaligned stuff
      Actually copy over the new headers from compat
      Move down bluetooth config.mk options
      Prevent CONFIG_COMPAT_BLUETOOTH_* options from going to compat_autoconf.h
      Disable bluetooth compat for kernels older than 2.6.27
      Enable CONFIG_BT_CMTP only if CONFIG_BT_CMTP is enabled
      Ran ./scripts/admin-update.sh refresh
      Fix driver-select for ath9k and ath5k
      Fix a few typos on config.mk and the new enable olde kernel patches
      Enable 2.6.23 for ath9k and ath5k
      Backport access to pcidev->is_pcie member for kernels < 2.6.24
      Add backport for netns for kernels <= 2.6.24 for 802.11
      Disable 2.6.24 for ath9k and ath5k
      ./scripts/admin-update.sh refresh
      Fix typo on 06-header-changes.patch
      Enable CONFIG_COMPAT_FIRMWARE_CLASS for kernels < 2.6.33
      Fix driver_select for ar9170
      Only build compat_firmware_class if CONFIG_FW_LOADER was enabled
      Copy over the new udev scripts/rules from compat.git
      ./scripts/admin-update.sh refresh
      Run admin-update-.sh refresh for 2010-02-01
      compat-wireless: fix patches/16-bluetooth.patch
      Run ./scripts/admin-update.sh refresh
      Fix patches/16-bluetooth.patch
      Enable CONFIG_BT_ATH3K
      ./scripts/admin-update.sh refresh for next-20100216
      Backport multiqueue support for kernels < 2.6.27
      Add linux-next cherry picked patches directory
      Skip empty patch directories if one is found.
      Some updates to make the patches apply to 2.6.34
      admin-update refresh
      compat-wireless: add test cherry pick patch
      Fix drivers usb Makefile for 2.6.34
      ./scripts/admin-update.sh refresh
      Change admin-update.sh to use system version files
      Split up the NOSTDINC_FLAGS into a few lines
      Use the defines to tag the compat module
      Document /sys/module/compat/parameters/compat_* on README
      Fix dependency on on WEXT
      Fix the CREL compat-wireless release name on top level Makefile
      Fix gen-compat-autoconf.sh for new version name changes
      Fix scripts/driver-select due to new version changes
      Add the compat to the unload of the modules

And the generic kernel compatibility module keeps moving along as
well, here's that shortlog:

Felix Fietkau (2):
      compat: fix firmware class compile on linux 2.6.32
      compat: add rcu_dereference_check

Grazvydas Ignotas (1):
      compat: fix uevent_suppress on 2.6.29 or older kernels

Hauke Mehrtens (19):
      compat: fix two return types
      compat: autoconf.h moved from linux/ to generated/ with kernel 2.6.33
      compat: build pccard and pcmcia condituinaly
      compat: fix build with CONFIG_USB=m
      compat: fix build on arm
      compat: backport genlmsg_unicast
      compat: backport some netdevice.h defs
      compat: backport some more of the netdev debug printk
      compat: fix some build problems with kernel 2.6.24
      compat: backport device_{lock,trylock,unlock}
      compat: update bitops.h
      compat: backport PCMCIA_DEVICE_PROD_ID3
      compat: Backport clamp
      compat: Add definitions needed for libertas sdio driver.
      compat: Add linux/version.h include before using it.
      compat: backport convert multicast list to list_head.
      compat: update compat_firmware_class.c to new version
      compat: backport sk_sleep
      compat: backport usb_alloc_coherent() and usb_free_coherent()

Luis R. Rodriguez (17):
      Add notes about why debugfs_remove_recursive() cannot be backported
      Update for next-20100113
      Backport the new firmware_class from > 2.6.33 down to 2.6.23
      Enable the compat_firmware_class to be built only on < 2.6.32
      Enable 2.6.33 compatibility
      Export CONFIG_COMPAT_FIRMWARE_CLASS
      Fix loading of compat_firmware_class due to class name conflict
      Only build compat_firmware_class if CONFIG_FW_LOADER was enabled
      Fix build with CONFIG_PCMCIA disabled
      Fix build with CONFIG_USB disabled
      Install udev rules and scripts needed for compat_firmware_class
      Add a print for v2.6.34-rc4
      compat: add compat_version read-only module parameter
      Modify compat main print
      Add the COMPAT_BASE_TREE and COMPAT_BASE_TREE_VERSION
      Add a COMPAT_PROJECT tag
      Fix the syntax for the defines passed for compat

Pavel Roskin (9):
      compat: backport for ARM dma_sync_single_range_*() helpers
      compat: backport debugfs_remove_recursive()
      compat: move debugfs_remove_recursive() to compat-2.6.27
      compat: define KEY_RFKILL, which appeared in Linux 2.6.33
      compat: add compat-2.6.35.h and IW_HANDLER
      compat: add qdisc_all_tx_empty for Linux 2.6.26 and older
      compat: add device_create() implementation for Linux 2.6.26 and older
      compat: add stub headers linux/tracepoint.h and trace/define_trace.h
      compat: add net/net_namespace.h stub for Linux 2.6.23 and older

[1] http://wireless.kernel.org/en/users/Download/stable
[2] http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.34/compat-wireless-2.6.34.tar.bz2
[3] http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.34/ChangeLog-2.6.34-wireless

  Luis

^ permalink raw reply

* Re: [PATCH 26/37] drivers/net/wireless/ipw2x00: Use kmemdup
From: Zhu Yi @ 2010-05-18  1:26 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Chatre, Reinette, Intel Linux Wireless, John W. Linville,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
In-Reply-To: <Pine.LNX.4.64.1005152320450.21345@ask.diku.dk>

On Sun, 2010-05-16 at 05:21 +0800, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
> 
> Use kmemdup when some other buffer is immediately copied into the
> allocated region.
> 
> A simplified version of the semantic patch that makes this change is
> as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression from,to,size,flag;
> statement S;
> @@
> 
> -  to = \(kmalloc\|kzalloc\)(size,flag);
> +  to = kmemdup(from,size,flag);
>    if (to==NULL || ...) S
> -  memcpy(to, from, size);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk> 

Acked-by: Zhu Yi <yi.zhu@intel.com>

Thanks,
-yi


^ permalink raw reply

* [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS for ar9003
From: Vasanthakumar Thiagarajan @ 2010-05-18  1:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

Add missing code to handle nullfunc frame completion in
ath_tx_edma_tasklet().

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/xmit.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 3db1917..debb62d 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2277,6 +2277,17 @@ void ath_tx_edma_tasklet(struct ath_softc *sc)
 
 		txok = !(txs.ts_status & ATH9K_TXERR_MASK);
 
+		/*
+		 * Make sure null func frame is acked before configuring
+		 * hw into ps mode.
+		 */
+		if (bf->bf_isnullfunc && txok) {
+			if ((sc->ps_flags & PS_ENABLED))
+				ath9k_enable_ps(sc);
+			else
+				sc->ps_flags |= PS_NULLFUNC_COMPLETED;
+		}
+
 		if (!bf_isampdu(bf)) {
 			bf->bf_retries = txs.ts_longretry;
 			if (txs.ts_status & ATH9K_TXERR_XRETRY)
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 2/3] ath9k: Fix power save with auto sleeping
From: Vasanthakumar Thiagarajan @ 2010-05-18  1:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1274147876-9228-1-git-send-email-vasanth@atheros.com>

Rx should not be disabed/disabled when hw supports auto sleeping.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 893b552..53e9c8f 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1296,7 +1296,8 @@ static int ath9k_tx(struct ieee80211_hw *hw,
 		 * completed and if needed, also for RX of buffered frames.
 		 */
 		ath9k_ps_wakeup(sc);
-		ath9k_hw_setrxabort(sc->sc_ah, 0);
+		if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
+			ath9k_hw_setrxabort(sc->sc_ah, 0);
 		if (ieee80211_is_pspoll(hdr->frame_control)) {
 			ath_print(common, ATH_DBG_PS,
 				  "Sending PS-Poll to pick a buffered frame\n");
@@ -1560,8 +1561,8 @@ void ath9k_enable_ps(struct ath_softc *sc)
 			ah->imask |= ATH9K_INT_TIM_TIMER;
 			ath9k_hw_set_interrupts(ah, ah->imask);
 		}
+		ath9k_hw_setrxabort(ah, 1);
 	}
-	ath9k_hw_setrxabort(ah, 1);
 }
 
 static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 3/3] ath9k_hw: Enable auto sleep for ar9003
From: Vasanthakumar Thiagarajan @ 2010-05-18  1:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1274147876-9228-1-git-send-email-vasanth@atheros.com>

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/hw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 1985d19..7997d0f 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2165,7 +2165,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
 		pCap->hw_caps |= ATH9K_HW_CAP_RFSILENT;
 	}
 #endif
-	if (AR_SREV_9271(ah))
+	if (AR_SREV_9271(ah) || AR_SREV_9300_20_OR_LATER(ah))
 		pCap->hw_caps |= ATH9K_HW_CAP_AUTOSLEEP;
 	else
 		pCap->hw_caps &= ~ATH9K_HW_CAP_AUTOSLEEP;
-- 
1.7.0.4


^ permalink raw reply related

* Re: [PATCH] Fix AR9285 always turn off LED on HP mini 210 [1/1]
From: Joey Lee @ 2010-05-18  2:39 UTC (permalink / raw)
  To: Matt Chen
  Cc: lrodriguez, Luis.Rodriguez, Gary Lin, Greg Kroah-Hartman,
	linux-net, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]

Hi Luis, 

Could you help kindly review my attahced patch (the same with my first
mail in this loop)?

Per our testing, this patch can fix the LED problem on HP mini 210, but
we are not good for wifi driver and just trace the LED behavior. We need
your professional suggestion to us.


thank's a lot!
Joey Lee

於 二,2010-05-18 於 09:55 +0800,Matt Chen 提到:
> Hi Luis,
> After testing the compat-wireless-2.6.34-rc4.tar.bz2,this issue is
> still.
> The wireless LED is always off no matter how many times I try to press
> the function key to enable/disable the wireless.
> I would like to ask is there a way to debug it ? 
> Thanks ~ ;-)
> 
> 2010/5/14 Luis R. Rodriguez <lrodriguez@atheros.com>
>         On Thu, May 13, 2010 at 04:13:18AM -0700, Matt Chen wrote:
>         > Hi Luis,
>         > Tried the driver,compat-wireless-2.6.33.
>         > 2.tar.bz2,  from
>         http://wireless.kernel.org/en/users/Download/stable, it
>         doesn't fix this issue. The LED is still keeping off whatever
>         you enable/disable it.
>         
>         
>         2.6.33 is ancient now, try the compat-wireles 2.6.34-rc stuff
>         and if
>         that doesn't help try bleeding edge. The fixes need to be
>         addressed
>         on bleedinge edge *first* but if bleedinge edge already has a
>         fix
>         then its a matter of cherry picking that and sending it to the
>         stable
>         gods.
>         
>          Luis
> 
> 
> 
> -- 
> Matt Chen
> Engineer
> Novell Asia Pacific
> Tel : +886- 2- 27370946 ext 507
> Fax : +886- 2- 27370947
> Novell Making IT Work As One


[-- Attachment #2: 0001-Fix-AR9285-always-turn-off-LED-on-HP-mini-210.patch --]
[-- Type: text/plain, Size: 1726 bytes --]

>From b725acf8fda0866aab49807a93c925e07994e2a4 Mon Sep 17 00:00:00 2001
From: Lee, Chun-Yi <jlee@novell.com>
Date: Sun, 9 May 2010 06:47:07 +0800
Subject: [PATCH] Fix AR9285 always turn off LED on HP mini 210

On 2.6.33 kernel, The AR9285 wifi module always turn off wifi LED
on fn+f11 function key on HP  mini 210.
After trace main.c, found it was always disable_radio after call
ath9k_config because the all_wiphys_idle is true on HP mini 210.

This LED works fine on 2.6.32 kernel, the following patch causes
this side effect:
ath9k: fix listening to idle requests
194b7c13b4c516db94db8ee004342f8935922739

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
---
 drivers/net/wireless/ath/ath9k/main.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 643bea3..d4ca82e 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2704,6 +2704,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
 		if (!idle && all_wiphys_idle)
 			enable_radio = true;
 
+		if (idle && all_wiphys_idle)
+			disable_radio = true;
+
 		/*
 		 * After we unlock here its possible another wiphy
 		 * can be re-renabled so to account for that we will
@@ -2804,10 +2807,6 @@ skip_chan_change:
 	if (changed & IEEE80211_CONF_CHANGE_POWER)
 		sc->config.txpowlimit = 2 * conf->power_level;
 
-	spin_lock_bh(&sc->wiphy_lock);
-	disable_radio = ath9k_all_wiphys_idle(sc);
-	spin_unlock_bh(&sc->wiphy_lock);
-
 	if (disable_radio) {
 		ath_print(common, ATH_DBG_CONFIG, "idle: disabling radio\n");
 		ath_radio_disable(sc, hw);
-- 
1.6.0.2


^ permalink raw reply related

* [PATCH] Select WIRELESS_EXT for the rndis_wlan driver to compile
From: Rogério Brito @ 2010-05-18  3:14 UTC (permalink / raw)
  To: Jussi Kivilinna; +Cc: linux-wireless, linux-kernel

The rndis_wlan.ko module needs the function wireless_send_event, which
is not included if the option WIRELESS_EXT is not selected by the
driver.  Otherwise, the user gets compilation problems like:

,----
| (...)
| Kernel: arch/x86/boot/bzImage is ready  (#3)
|   Building modules, stage 2.
|   MODPOST 427 modules
| ERROR: "wireless_send_event" [drivers/net/wireless/rndis_wlan.ko] undefined!
| make[1]: *** [__modpost] Error 1
| make: *** [modules] Error 2
`----
---

I don't know if this is a proper fix, but I would love to know a better
solution to the problem.

 drivers/net/wireless/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 5889436..0d5fff4 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -186,6 +186,7 @@ config USB_NET_RNDIS_WLAN
 	tristate "Wireless RNDIS USB support"
 	depends on USB && EXPERIMENTAL
 	depends on CFG80211
+	select WIRELESS_EXT
 	select USB_USBNET
 	select USB_NET_CDCETHER
 	select USB_NET_RNDIS_HOST
-- 
1.7.1


^ permalink raw reply related

* Re: pull request: wireless-next-2.6 2010-05-17
From: David Miller @ 2010-05-18  4:12 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20100517182653.GC2436@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Mon, 17 May 2010 14:26:53 -0400

> One last big batch intended for 2.6.35 -- these have all been in
> linux-next for several days.  Included are the usual driver updates for
> iwlwifi, ath9k, and rt2x00 along with a smattering of other bits
> (including some trivial fixups).
> 
> Please let me know if there are problems!

Pulled, thanks John.

^ permalink raw reply

* Re: [RFC] Libertas: Added 11d support using cfg80211
From: Dan Williams @ 2010-05-18  4:26 UTC (permalink / raw)
  To: Kiran Divekar
  Cc: linux-wireless@vger.kernel.org, libertas-dev@lists.infradead.org
In-Reply-To: <25B60CDC2F704E4E9D88FFD52780CB4C04D61E8DA4@SC-VEXCH1.marvell.com>

On Thu, 2010-05-13 at 04:00 -0700, Kiran Divekar wrote:
> Added 11d support for libertas driver using cfg80211. This is based on Holger Shurig's initial work to add cfg80211 support libertas.
> (https://patchwork.kernel.org/patch/64286/)
> 
> Please let us know, if there are any improvements comments.
> 
> Code is added to send 11d enable command to firmware while
> initialisation and pass 11d specific information to firmware
> when notifier handler is called by cfg80211.

Looks OK, though I'd prefer making 11D_DOMAIN_INFO a direct command
instead.  But if you don't want to do that right now, that's fine, just
send the final patch and I'll ack it.

Acked-by: Dan Williams <dcbw@redhat.com>

> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Kiran Divekar <dkiran@marvell.com>
> ---
>  drivers/net/wireless/libertas/cfg.c     |  110 +++++++++++++++++++++++++++++++
>  drivers/net/wireless/libertas/cfg.h     |    5 ++
>  drivers/net/wireless/libertas/cmd.c     |   65 ++++++++++++++++++
>  drivers/net/wireless/libertas/cmdresp.c |   50 ++++++++++++++
>  drivers/net/wireless/libertas/decl.h    |    5 ++
>  drivers/net/wireless/libertas/dev.h     |    3 +
>  drivers/net/wireless/libertas/host.h    |   28 ++++++++-
>  drivers/net/wireless/libertas/main.c    |    3 +
>  8 files changed, 268 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
> index 9b23728..7a44384 100644
> --- a/drivers/net/wireless/libertas/cfg.c
> +++ b/drivers/net/wireless/libertas/cfg.c
> @@ -8,6 +8,7 @@
>  
>  #include <linux/slab.h>
>  #include <linux/if_arp.h>
> +#include <linux/ieee80211.h>
>  #include <net/cfg80211.h>
>  #include <asm/unaligned.h>
>  
> @@ -2044,6 +2045,7 @@ int lbs_cfg_register(struct lbs_private *priv)
>  	 */
>  	wdev->wiphy->cipher_suites = cipher_suites;
>  	wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
> +	wdev->wiphy->reg_notifier = lbs_reg_notifier;
>  
>  	ret = wiphy_register(wdev->wiphy);
>  	if (ret < 0)
> @@ -2063,6 +2065,114 @@ int lbs_cfg_register(struct lbs_private *priv)
>  	return ret;
>  }
>  
> +/**
> + *  @brief This function sets DOMAIN INFO to FW
> + *  @param priv       pointer to struct lbs_private
> + *  @return          0; -1
> +*/
> +static int lbs_11d_set_domain_info(struct lbs_private *priv)
> +{
> +	int ret;
> +
> +	ret = lbs_prepare_and_send_command(priv, CMD_802_11D_DOMAIN_INFO,
> +			CMD_ACT_SET,
> +			CMD_OPTION_WAITFORRSP, 0, NULL);
> +	if (ret)
> +		lbs_deb_11d("fail to dnld domain info\n");
> +
> +	return ret;
> +}
> +
> +static void lbs_send_domain_info_cmd_fw(struct wiphy *wiphy,
> +					struct regulatory_request *request)
> +{
> +	u8   no_of_triplet = 0;
> +	u8   no_of_parsed_chan = 0;
> +	u8   first_channel = 0, next_chan = 0, max_pwr = 0;
> +	u8   i, flag = 0;
> +	enum ieee80211_band band;
> +	struct ieee80211_supported_band *sband;
> +	struct ieee80211_channel *ch;
> +	struct lbs_private *priv = wiphy_priv(wiphy);
> +	struct lbs_802_11d_domain_reg *domain_info = &priv->domain_reg;
> +	int ret = 0;
> +
> +	lbs_deb_enter(LBS_DEB_CFG80211);
> +
> +	/* Set country code */
> +	domain_info->country_code[0] = request->alpha2[0];
> +	domain_info->country_code[1] = request->alpha2[1];
> +	domain_info->country_code[2] = ' ';
> +
> +	for (band = 0; band < IEEE80211_NUM_BANDS ; band++) {
> +
> +		if (!wiphy->bands[band])
> +			continue;
> +
> +		sband = wiphy->bands[band];
> +
> +		for (i = 0; i < sband->n_channels ; i++) {
> +			ch = &sband->channels[i];
> +			if (ch->flags & IEEE80211_CHAN_DISABLED)
> +				continue;
> +
> +			if (!flag) {
> +				flag = 1;
> +				next_chan = first_channel = (u32) ch->hw_value;
> +				max_pwr = ch->max_power;
> +				no_of_parsed_chan = 1;
> +				continue;
> +			}
> +
> +			if (ch->hw_value == next_chan + 1 &&
> +					ch->max_power == max_pwr) {
> +				next_chan++;
> +				no_of_parsed_chan++;
> +			} else {
> +				domain_info->triplet[no_of_triplet]
> +					.chans.first_channel = first_channel;
> +				domain_info->triplet[no_of_triplet]
> +					.chans.num_channels = no_of_parsed_chan;
> +				domain_info->triplet[no_of_triplet]
> +					.chans.max_power = max_pwr;
> +				no_of_triplet++;
> +				flag = 0;
> +			}
> +		}
> +		if (flag) {
> +			domain_info->triplet[no_of_triplet]
> +				.chans.first_channel = first_channel;
> +			domain_info->triplet[no_of_triplet]
> +				.chans.num_channels = no_of_parsed_chan;
> +			domain_info->triplet[no_of_triplet]
> +				.chans.max_power = max_pwr;
> +			no_of_triplet++;
> +		}
> +	}
> +
> +	domain_info->no_triplet = no_of_triplet;
> +
> +	/* Set domain info */
> +	ret = lbs_11d_set_domain_info(priv);
> +	if (ret)
> +		lbs_pr_err("11D: error setting domain info in FW\n");
> +
> +	lbs_deb_leave(LBS_DEB_CFG80211);
> +}
> +
> +int lbs_reg_notifier(struct wiphy *wiphy,
> +		struct regulatory_request *request)
> +{
> +	lbs_deb_enter_args(LBS_DEB_CFG80211, "cfg80211 regulatory domain "
> +			"callback for domain %c%c\n", request->alpha2[0],
> +			request->alpha2[1]);
> +
> +	lbs_send_domain_info_cmd_fw(wiphy, request);
> +
> +	lbs_deb_leave(LBS_DEB_CFG80211);
> +
> +	return 0;
> +}
>  
>  void lbs_scan_deinit(struct lbs_private *priv)
>  {
> diff --git a/drivers/net/wireless/libertas/cfg.h b/drivers/net/wireless/libertas/cfg.h
> index eae3fd9..756fb98 100644
> --- a/drivers/net/wireless/libertas/cfg.h
> +++ b/drivers/net/wireless/libertas/cfg.h
> @@ -3,11 +3,16 @@
>  
>  struct device;
>  struct lbs_private;
> +struct regulatory_request;
> +struct wiphy;
>  
>  struct wireless_dev *lbs_cfg_alloc(struct device *dev);
>  int lbs_cfg_register(struct lbs_private *priv);
>  void lbs_cfg_free(struct lbs_private *priv);
>  
> +int lbs_reg_notifier(struct wiphy *wiphy,
> +		struct regulatory_request *request);
> +
>  /* All of those are TODOs: */
>  #define lbs_cmd_802_11_rssi(priv, cmdptr) (0)
>  #define lbs_ret_802_11_rssi(priv, resp) (0)
> diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
> index 10067ca..cb93de9 100644
> --- a/drivers/net/wireless/libertas/cmd.c
> +++ b/drivers/net/wireless/libertas/cmd.c
> @@ -877,6 +877,66 @@ void lbs_set_mac_control(struct lbs_private *priv)
>  }
>  
>  /**
> + *  @brief This function implements command CMD_802_11D_DOMAIN_INFO
> + *  @param priv       pointer to struct lbs_private
> + *  @param cmd        pointer to cmd buffer
> + *  @param cmdno      cmd ID
> + *  @param cmdOption  cmd action
> + *  @return           0
> +*/
> +int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
> +				 struct cmd_ds_command *cmd,
> +				 u16 cmdoption)
> +{
> +	struct cmd_ds_802_11d_domain_info *pdomaininfo =
> +	    &cmd->params.domaininfo;
> +	struct mrvl_ie_domain_param_set *domain = &pdomaininfo->domain;
> +	u8 nr_triplet = priv->domain_reg.no_triplet;
> +
> +	lbs_deb_enter(LBS_DEB_11D);
> +
> +	lbs_deb_11d("nr_triplet=%x\n", nr_triplet);
> +
> +	pdomaininfo->action = cpu_to_le16(cmdoption);
> +	if (cmdoption == CMD_ACT_GET) {
> +		cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
> +					sizeof(struct cmd_header));
> +		lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd,
> +			le16_to_cpu(cmd->size));
> +		goto done;
> +	}
> +
> +	domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN);
> +	memcpy(domain->countrycode, priv->domain_reg.country_code,
> +	       sizeof(domain->countrycode));
> +
> +	domain->header.len = cpu_to_le16(nr_triplet
> +				* sizeof(struct ieee80211_country_ie_triplet)
> +				+ sizeof(domain->countrycode));
> +
> +	if (nr_triplet) {
> +		memcpy(domain->triplet, priv->domain_reg.triplet,
> +				nr_triplet *
> +				sizeof(struct ieee80211_country_ie_triplet));
> +
> +		cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
> +					     le16_to_cpu(domain->header.len) +
> +					     sizeof(struct mrvl_ie_header) +
> +					     sizeof(struct cmd_header));
> +	} else {
> +		cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
> +					sizeof(struct cmd_header));
> +	}
> +
> +	lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd,
> +			le16_to_cpu(cmd->size));
> +
> +done:
> +	lbs_deb_enter(LBS_DEB_11D);
> +	return 0;
> +}
> +
> +/**
>   *  @brief This function prepare the command before send to firmware.
>   *
>   *  @param priv		A pointer to struct lbs_private structure
> @@ -974,6 +1034,11 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
>  		ret = 0;
>  		goto done;
>  
> +	case CMD_802_11D_DOMAIN_INFO:
> +		cmdptr->command = cpu_to_le16(cmd_no);
> +		ret = lbs_cmd_802_11d_domain_info(priv, cmdptr, cmd_action);
> +		break;
> +
>  	case CMD_802_11_TPC_CFG:
>  		cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG);
>  		cmdptr->size =
> diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
> index d6c61bd..c31b32d 100644
> --- a/drivers/net/wireless/libertas/cmdresp.c
> +++ b/drivers/net/wireless/libertas/cmdresp.c
> @@ -97,6 +97,52 @@ static int lbs_ret_reg_access(struct lbs_private *priv,
>  	return ret;
>  }
>  
> +/**
> + *  @brief This function parses countryinfo from AP and download country info to FW
> + *  @param priv    pointer to struct lbs_private
> + *  @param resp    pointer to command response buffer
> + *  @return        0; -1
> + */
> +int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp)
> +{
> +	struct cmd_ds_802_11d_domain_info *domaininfo =
> +			&resp->params.domaininforesp;
> +	struct mrvl_ie_domain_param_set *domain = &domaininfo->domain;
> +	u16 action = le16_to_cpu(domaininfo->action);
> +	s16 ret = 0;
> +	u8 nr_triplet = 0;
> +
> +	lbs_deb_enter(LBS_DEB_11D);
> +
> +	lbs_deb_hex(LBS_DEB_11D, "domain info resp", (u8 *) resp,
> +			(int)le16_to_cpu(resp->size));
> +
> +	nr_triplet = (le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) /
> +		sizeof(struct ieee80211_country_ie_triplet);
> +
> +	lbs_deb_11d("domain info resp: nr_triplet %d\n", nr_triplet);
> +
> +	if (nr_triplet > MRVDRV_MAX_TRIPLET_802_11D) {
> +		lbs_deb_11d("invalid number of triplets returned!!\n");
> +		return -1;
> +	}
> +
> +	switch (action) {
> +	case CMD_ACT_SET:	/*Proc set action */
> +		break;
> +
> +	case CMD_ACT_GET:
> +		break;
> +	default:
> +		lbs_deb_11d("invalid action:%d\n", domaininfo->action);
> +		ret = -1;
> +		break;
> +	}
> +
> +	lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
> +	return ret;
> +}
> +
>  static inline int handle_cmd_response(struct lbs_private *priv,
>  				      struct cmd_header *cmd_response)
>  {
> @@ -130,6 +176,10 @@ static inline int handle_cmd_response(struct lbs_private *priv,
>  		ret = lbs_ret_802_11_rssi(priv, resp);
>  		break;
>  
> +	case CMD_RET(CMD_802_11D_DOMAIN_INFO):
> +		ret = lbs_ret_802_11d_domain_info(resp);
> +		break;
> +
>  	case CMD_RET(CMD_802_11_TPC_CFG):
>  		spin_lock_irqsave(&priv->driver_lock, flags);
>  		memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
> diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h
> index 2bccad3..9d2566e 100644
> --- a/drivers/net/wireless/libertas/decl.h
> +++ b/drivers/net/wireless/libertas/decl.h
> @@ -13,6 +13,7 @@
>  struct lbs_private;
>  struct sk_buff;
>  struct net_device;
> +struct cmd_ds_command;
>  
> 
>  /* ethtool.c */
> @@ -52,5 +53,9 @@ int lbs_exit_auto_deep_sleep(struct lbs_private *priv);
>  u32 lbs_fw_index_to_data_rate(u8 index);
>  u8 lbs_data_rate_to_fw_index(u32 rate);
>  
> +int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
> +		struct cmd_ds_command *cmd, u16 cmdoption);
> +
> +int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp);
>  
>  #endif
> diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
> index afbd891..d9dad5d 100644
> --- a/drivers/net/wireless/libertas/dev.h
> +++ b/drivers/net/wireless/libertas/dev.h
> @@ -60,6 +60,9 @@ struct lbs_private {
>  	struct dentry *regs_dir;
>  	struct dentry *debugfs_regs_files[6];
>  
> +	/** 11D and domain regulatory data */
> +	struct lbs_802_11d_domain_reg domain_reg;
> +
>  	/* Hardware debugging */
>  	u32 mac_offset;
>  	u32 bbp_offset;
> diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
> index 3809c0b..112fbf1 100644
> --- a/drivers/net/wireless/libertas/host.h
> +++ b/drivers/net/wireless/libertas/host.h
> @@ -389,6 +389,30 @@ struct lbs_offset_value {
>  	u32 value;
>  } __attribute__ ((packed));
>  
> +#define MRVDRV_MAX_TRIPLET_802_11D              83
> +
> +#define COUNTRY_CODE_LEN                        3
> +
> +struct mrvl_ie_domain_param_set {
> +	struct mrvl_ie_header header;
> +
> +	u8 countrycode[COUNTRY_CODE_LEN];
> +	struct ieee80211_country_ie_triplet triplet[1];
> +} __attribute__ ((packed));
> +
> +struct cmd_ds_802_11d_domain_info {
> +	__le16 action;
> +	struct mrvl_ie_domain_param_set domain;
> +} __attribute__ ((packed));
> +
> +struct lbs_802_11d_domain_reg {
> +	/** Country code*/
> +	u8 country_code[COUNTRY_CODE_LEN];
> +	/** No. of triplet*/
> +	u8 no_triplet;
> +	struct ieee80211_country_ie_triplet triplet[MRVDRV_MAX_TRIPLET_802_11D];
> +} __attribute__ ((packed));
> +
>  /*
>   * Define data structure for CMD_GET_HW_SPEC
>   * This structure defines the response for the GET_HW_SPEC command
> @@ -949,6 +973,9 @@ struct cmd_ds_command {
>  		struct cmd_ds_bbp_reg_access bbpreg;
>  		struct cmd_ds_rf_reg_access rfreg;
>  
> +		struct cmd_ds_802_11d_domain_info domaininfo;
> +		struct cmd_ds_802_11d_domain_info domaininforesp;
> +
>  		struct cmd_ds_802_11_tpc_cfg tpccfg;
>  		struct cmd_ds_802_11_afc afc;
>  		struct cmd_ds_802_11_led_ctrl ledgpio;
> @@ -958,5 +985,4 @@ struct cmd_ds_command {
>  		struct cmd_ds_802_11_beacon_control bcn_ctrl;
>  	} params;
>  } __attribute__ ((packed));
> -
>  #endif
> diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
> index 2fd5042..ff4380e 100644
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -629,6 +629,9 @@ static int lbs_setup_firmware(struct lbs_private *priv)
>  		priv->txpower_max = maxlevel;
>  	}
>  
> +	/* Send cmd to FW to enable 11D function */
> +	ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_11D_ENABLE, 1);
> +
>  	lbs_set_mac_control(priv);
>  done:
>  	lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);



^ permalink raw reply

* Re: [PATCH v3] libertas: Added callback functions to support SDIO suspend/resume.
From: Dan Williams @ 2010-05-18  4:32 UTC (permalink / raw)
  To: Amitkumar Karwar
  Cc: linux-wireless@vger.kernel.org, libertas-dev@lists.infradead.org,
	Kiran Divekar
In-Reply-To: <5FF020A1CFFEEC49BD1E09530C4FF595056D1B6FCD@SC-VEXCH1.marvell.com>

On Fri, 2010-05-14 at 02:32 -0700, Amitkumar Karwar wrote:
> In suspend() host sleep is activated using already configured
> host sleep parameters through wol command, and in resume() host
> sleep is cancelled. Earlier priv->fw_ready flag used to reset and
> set in suspend and resume handler respectively. Since after suspend
> only host goes into sleep state and firmware is always ready, those
> changes in flag state are removed.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Kiran Divekar <dkiran@marvell.com>

Looks OK to me...

Acked-by: Dan Williams <dcbw@redhat.com>

> ---
>  drivers/net/wireless/libertas/cmd.c     |   37 ++++++++++++--
>  drivers/net/wireless/libertas/cmdresp.c |   30 ++---------
>  drivers/net/wireless/libertas/decl.h    |    2 +-
>  drivers/net/wireless/libertas/dev.h     |    6 ++
>  drivers/net/wireless/libertas/ethtool.c |   15 +++---
>  drivers/net/wireless/libertas/if_sdio.c |   58 ++++++++++++++++++++++
>  drivers/net/wireless/libertas/if_usb.c  |    6 ++
>  drivers/net/wireless/libertas/main.c    |   79 +++++++++++++++++++++---------
>  8 files changed, 171 insertions(+), 62 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
> index cdb9b96..0fa6b0e 100644
> --- a/drivers/net/wireless/libertas/cmd.c
> +++ b/drivers/net/wireless/libertas/cmd.c
> @@ -70,6 +70,8 @@ static u8 is_command_allowed_in_ps(u16 cmd)
>  	switch (cmd) {
>  	case CMD_802_11_RSSI:
>  		return 1;
> +	case CMD_802_11_HOST_SLEEP_CFG:
> +		return 1;
>  	default:
>  		break;
>  	}
> @@ -185,6 +187,23 @@ out:
>  	return ret;
>  }
>  
> +static int lbs_ret_host_sleep_cfg(struct lbs_private *priv, unsigned long dummy,
> +			struct cmd_header *resp)
> +{
> +	lbs_deb_enter(LBS_DEB_CMD);
> +	if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
> +		priv->is_host_sleep_configured = 0;
> +		if (priv->psstate == PS_STATE_FULL_POWER) {
> +			priv->is_host_sleep_activated = 0;
> +			wake_up_interruptible(&priv->host_sleep_q);
> +		}
> +	} else {
> +		priv->is_host_sleep_configured = 1;
> +	}
> +	lbs_deb_leave(LBS_DEB_CMD);
> +	return 0;
> +}
> +
>  int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
>  		struct wol_config *p_wol_config)
>  {
> @@ -202,12 +221,11 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
>  	else
>  		cmd_config.wol_conf.action = CMD_ACT_ACTION_NONE;
>  
> -	ret = lbs_cmd_with_response(priv, CMD_802_11_HOST_SLEEP_CFG, &cmd_config);
> +	ret = __lbs_cmd(priv, CMD_802_11_HOST_SLEEP_CFG, &cmd_config.hdr,
> +			le16_to_cpu(cmd_config.hdr.size),
> +			lbs_ret_host_sleep_cfg, 0);
>  	if (!ret) {
> -		if (criteria) {
> -			lbs_deb_cmd("Set WOL criteria to %x\n", criteria);
> -			priv->wol_criteria = criteria;
> -		} else
> +		if (p_wol_config)
>  			memcpy((uint8_t *) p_wol_config,
>  					(uint8_t *)&cmd_config.wol_conf,
>  					sizeof(struct wol_config));
> @@ -712,6 +730,10 @@ static void lbs_queue_cmd(struct lbs_private *priv,
>  		}
>  	}
>  
> +	if (le16_to_cpu(cmdnode->cmdbuf->command) ==
> +			CMD_802_11_WAKEUP_CONFIRM)
> +		addtail = 0;
> +
>  	spin_lock_irqsave(&priv->driver_lock, flags);
>  
>  	if (addtail)
> @@ -1353,6 +1375,11 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
>  	/* We don't get a response on the sleep-confirmation */
>  	priv->dnld_sent = DNLD_RES_RECEIVED;
>  
> +	if (priv->is_host_sleep_configured) {
> +		priv->is_host_sleep_activated = 1;
> +		wake_up_interruptible(&priv->host_sleep_q);
> +	}
> +
>  	/* If nothing to do, go back to sleep (?) */
>  	if (!kfifo_len(&priv->event_fifo) && !priv->resp_len[priv->resp_idx])
>  		priv->psstate = PS_STATE_SLEEP;
> diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
> index 88f7131..d6c3063 100644
> --- a/drivers/net/wireless/libertas/cmdresp.c
> +++ b/drivers/net/wireless/libertas/cmdresp.c
> @@ -17,6 +17,7 @@
>  #include "dev.h"
>  #include "assoc.h"
>  #include "wext.h"
> +#include "cmd.h"
>  
>  /**
>   *  @brief This function handles disconnect event. it
> @@ -341,32 +342,10 @@ done:
>  	return ret;
>  }
>  
> -static int lbs_send_confirmwake(struct lbs_private *priv)
> -{
> -	struct cmd_header cmd;
> -	int ret = 0;
> -
> -	lbs_deb_enter(LBS_DEB_HOST);
> -
> -	cmd.command = cpu_to_le16(CMD_802_11_WAKEUP_CONFIRM);
> -	cmd.size = cpu_to_le16(sizeof(cmd));
> -	cmd.seqnum = cpu_to_le16(++priv->seqnum);
> -	cmd.result = 0;
> -
> -	lbs_deb_hex(LBS_DEB_HOST, "wake confirm", (u8 *) &cmd,
> -		sizeof(cmd));
> -
> -	ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &cmd, sizeof(cmd));
> -	if (ret)
> -		lbs_pr_alert("SEND_WAKEC_CMD: Host to Card failed for Confirm Wake\n");
> -
> -	lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret);
> -	return ret;
> -}
> -
>  int lbs_process_event(struct lbs_private *priv, u32 event)
>  {
>  	int ret = 0;
> +	struct cmd_header cmd;
>  
>  	lbs_deb_enter(LBS_DEB_CMD);
>  
> @@ -410,7 +389,10 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
>  		if (priv->reset_deep_sleep_wakeup)
>  			priv->reset_deep_sleep_wakeup(priv);
>  		priv->is_deep_sleep = 0;
> -		lbs_send_confirmwake(priv);
> +		lbs_cmd_async(priv, CMD_802_11_WAKEUP_CONFIRM, &cmd,
> +				sizeof(cmd));
> +		priv->is_host_sleep_activated = 0;
> +		wake_up_interruptible(&priv->host_sleep_q);
>  		break;
>  
>  	case MACREG_INT_CODE_DEEP_SLEEP_AWAKE:
> diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h
> index 709ffca..61db8bc 100644
> --- a/drivers/net/wireless/libertas/decl.h
> +++ b/drivers/net/wireless/libertas/decl.h
> @@ -38,7 +38,7 @@ int lbs_set_mac_address(struct net_device *dev, void *addr);
>  void lbs_set_multicast_list(struct net_device *dev);
>  
>  int lbs_suspend(struct lbs_private *priv);
> -void lbs_resume(struct lbs_private *priv);
> +int lbs_resume(struct lbs_private *priv);
>  
>  void lbs_queue_event(struct lbs_private *priv, u32 event);
>  void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx);
> diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
> index a54880e..71c5ad4 100644
> --- a/drivers/net/wireless/libertas/dev.h
> +++ b/drivers/net/wireless/libertas/dev.h
> @@ -75,6 +75,7 @@ struct lbs_private {
>  
>  	/* Deep sleep */
>  	int is_deep_sleep;
> +	int deep_sleep_required;
>  	int is_auto_deep_sleep_enabled;
>  	int wakeup_dev_required;
>  	int is_activity_detected;
> @@ -82,6 +83,11 @@ struct lbs_private {
>  	wait_queue_head_t ds_awake_q;
>  	struct timer_list auto_deepsleep_timer;
>  
> +	/* Host sleep*/
> +	int is_host_sleep_configured;
> +	int is_host_sleep_activated;
> +	wait_queue_head_t host_sleep_q;
> +
>  	/* Hardware access */
>  	void *card;
>  	u8 fw_ready;
> diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
> index 3804a58..6a36c99 100644
> --- a/drivers/net/wireless/libertas/ethtool.c
> +++ b/drivers/net/wireless/libertas/ethtool.c
> @@ -91,23 +91,22 @@ static int lbs_ethtool_set_wol(struct net_device *dev,
>  			       struct ethtool_wolinfo *wol)
>  {
>  	struct lbs_private *priv = dev->ml_priv;
> -	uint32_t criteria = 0;
>  
>  	if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY))
>  		return -EOPNOTSUPP;
>  
> +	priv->wol_criteria = 0;
>  	if (wol->wolopts & WAKE_UCAST)
> -		criteria |= EHS_WAKE_ON_UNICAST_DATA;
> +		priv->wol_criteria |= EHS_WAKE_ON_UNICAST_DATA;
>  	if (wol->wolopts & WAKE_MCAST)
> -		criteria |= EHS_WAKE_ON_MULTICAST_DATA;
> +		priv->wol_criteria |= EHS_WAKE_ON_MULTICAST_DATA;
>  	if (wol->wolopts & WAKE_BCAST)
> -		criteria |= EHS_WAKE_ON_BROADCAST_DATA;
> +		priv->wol_criteria |= EHS_WAKE_ON_BROADCAST_DATA;
>  	if (wol->wolopts & WAKE_PHY)
> -		criteria |= EHS_WAKE_ON_MAC_EVENT;
> +		priv->wol_criteria |= EHS_WAKE_ON_MAC_EVENT;
>  	if (wol->wolopts == 0)
> -		criteria |= EHS_REMOVE_WAKEUP;
> -
> -	return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL);
> +		priv->wol_criteria |= EHS_REMOVE_WAKEUP;
> +	return 0;
>  }
>  
>  const struct ethtool_ops lbs_ethtool_ops = {
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index 64dd345..575d433 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -1182,11 +1182,69 @@ static void if_sdio_remove(struct sdio_func *func)
>  	lbs_deb_leave(LBS_DEB_SDIO);
>  }
>  
> +static int if_sdio_suspend(struct device *dev)
> +{
> +	struct sdio_func *func = dev_to_sdio_func(dev);
> +	int ret;
> +	struct if_sdio_card *card = sdio_get_drvdata(func);
> +
> +	mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
> +
> +	lbs_pr_info("%s: suspend: PM flags = 0x%x\n",
> +						sdio_func_id(func), flags);
> +
> +	/* If we aren't being asked to wake on anything, we should bail out
> +	 * and let the SD stack power down the card.
> +	 */
> +	if (card->priv->wol_criteria == EHS_REMOVE_WAKEUP) {
> +		lbs_pr_info("Suspend without wake params -- "
> +						"powering down card.");
> +		return -ENOSYS;
> +	}
> +
> +	if (!(flags & MMC_PM_KEEP_POWER)) {
> +		lbs_pr_err("%s: cannot remain alive while host is suspended\n",
> +			sdio_func_id(func));
> +		return -ENOSYS;
> +	}
> +
> +	ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
> +	if (ret)
> +		return ret;
> +
> +	ret = lbs_suspend(card->priv);
> +	if (ret)
> +		return ret;
> +
> +	return sdio_set_host_pm_flags(func, MMC_PM_WAKE_SDIO_IRQ);
> +}
> +
> +static int if_sdio_resume(struct device *dev)
> +{
> +	struct sdio_func *func = dev_to_sdio_func(dev);
> +	struct if_sdio_card *card = sdio_get_drvdata(func);
> +	int ret;
> +
> +	lbs_pr_info("%s: resume: we're back\n", sdio_func_id(func));
> +
> +	ret = lbs_resume(card->priv);
> +
> +	return ret;
> +}
> +
> +static struct const dev_pm_ops if_sdio_pm_ops = {
> +	.suspend	= if_sdio_suspend,
> +	.resume		= if_sdio_resume,
> +};
> +
>  static struct sdio_driver if_sdio_driver = {
>  	.name		= "libertas_sdio",
>  	.id_table	= if_sdio_ids,
>  	.probe		= if_sdio_probe,
>  	.remove		= if_sdio_remove,
> +	.drv = {
> +		.pm = &if_sdio_pm_ops,
> +	},
>  };
>  
>  /*******************************************************************/
> diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
> index fcea574..e5e6801 100644
> --- a/drivers/net/wireless/libertas/if_usb.c
> +++ b/drivers/net/wireless/libertas/if_usb.c
> @@ -1047,6 +1047,12 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
>  	if (priv->psstate != PS_STATE_FULL_POWER)
>  		return -1;
>  
> +	if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
> +		lbs_pr_info("Suspend attempt without "
> +						"configuring wake params!\n");
> +		return -ENOSYS;
> +	}
> +
>  	ret = lbs_suspend(priv);
>  	if (ret)
>  		goto out;
> diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
> index d35ebca..25c5734 100644
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -625,16 +625,13 @@ static int lbs_thread(void *data)
>  	return 0;
>  }
>  
> -static int lbs_suspend_callback(struct lbs_private *priv, unsigned long dummy,
> -				struct cmd_header *cmd)
> +static int lbs_ret_host_sleep_activate(struct lbs_private *priv,
> +		unsigned long dummy,
> +		struct cmd_header *cmd)
>  {
>  	lbs_deb_enter(LBS_DEB_FW);
> -
> -	netif_device_detach(priv->dev);
> -	if (priv->mesh_dev)
> -		netif_device_detach(priv->mesh_dev);
> -
> -	priv->fw_ready = 0;
> +	priv->is_host_sleep_activated = 1;
> +	wake_up_interruptible(&priv->host_sleep_q);
>  	lbs_deb_leave(LBS_DEB_FW);
>  	return 0;
>  }
> @@ -646,39 +643,65 @@ int lbs_suspend(struct lbs_private *priv)
>  
>  	lbs_deb_enter(LBS_DEB_FW);
>  
> -	if (priv->wol_criteria == 0xffffffff) {
> -		lbs_pr_info("Suspend attempt without configuring wake params!\n");
> -		return -EINVAL;
> +	if (priv->is_deep_sleep) {
> +		ret = lbs_set_deep_sleep(priv, 0);
> +		if (ret) {
> +			lbs_pr_err("deep sleep cancellation failed: %d\n", ret);
> +			return ret;
> +		}
> +		priv->deep_sleep_required = 1;
>  	}
>  
>  	memset(&cmd, 0, sizeof(cmd));
> +	ret = lbs_host_sleep_cfg(priv, priv->wol_criteria,
> +						(struct wol_config *)NULL);
> +	if (ret) {
> +		lbs_pr_info("Host sleep configuration failed: %d\n", ret);
> +		return ret;
> +	}
> +	if (priv->psstate == PS_STATE_FULL_POWER) {
> +		ret = __lbs_cmd(priv, CMD_802_11_HOST_SLEEP_ACTIVATE, &cmd,
> +				sizeof(cmd), lbs_ret_host_sleep_activate, 0);
> +		if (ret)
> +			lbs_pr_info("HOST_SLEEP_ACTIVATE failed: %d\n", ret);
> +	}
>  
> -	ret = __lbs_cmd(priv, CMD_802_11_HOST_SLEEP_ACTIVATE, &cmd,
> -			sizeof(cmd), lbs_suspend_callback, 0);
> -	if (ret)
> -		lbs_pr_info("HOST_SLEEP_ACTIVATE failed: %d\n", ret);
> +	if (!wait_event_interruptible_timeout(priv->host_sleep_q,
> +				priv->is_host_sleep_activated, (10 * HZ))) {
> +		lbs_pr_err("host_sleep_q: timer expired\n");
> +		ret = -1;
> +	}
> +	netif_device_detach(priv->dev);
> +	if (priv->mesh_dev)
> +		netif_device_detach(priv->mesh_dev);
>  
>  	lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);
>  	return ret;
>  }
>  EXPORT_SYMBOL_GPL(lbs_suspend);
>  
> -void lbs_resume(struct lbs_private *priv)
> +int lbs_resume(struct lbs_private *priv)
>  {
> -	lbs_deb_enter(LBS_DEB_FW);
> +	int ret;
> +	uint32_t criteria = EHS_REMOVE_WAKEUP;
>  
> -	priv->fw_ready = 1;
> +	lbs_deb_enter(LBS_DEB_FW);
>  
> -	/* Firmware doesn't seem to give us RX packets any more
> -	   until we send it some command. Might as well update */
> -	lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0,
> -				     0, 0, NULL);
> +	ret = lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL);
>  
>  	netif_device_attach(priv->dev);
>  	if (priv->mesh_dev)
>  		netif_device_attach(priv->mesh_dev);
>  
> -	lbs_deb_leave(LBS_DEB_FW);
> +	if (priv->deep_sleep_required) {
> +		priv->deep_sleep_required = 0;
> +		ret = lbs_set_deep_sleep(priv, 1);
> +		if (ret)
> +			lbs_pr_err("deep sleep activation failed: %d\n", ret);
> +	}
> +
> +	lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);
> +	return ret;
>  }
>  EXPORT_SYMBOL_GPL(lbs_resume);
>  
> @@ -834,10 +857,13 @@ static int lbs_init_adapter(struct lbs_private *priv)
>  	priv->psstate = PS_STATE_FULL_POWER;
>  	priv->is_deep_sleep = 0;
>  	priv->is_auto_deep_sleep_enabled = 0;
> +	priv->deep_sleep_required = 0;
>  	priv->wakeup_dev_required = 0;
>  	init_waitqueue_head(&priv->ds_awake_q);
>  	priv->authtype_auto = 1;
> -
> +	priv->is_host_sleep_configured = 0;
> +	priv->is_host_sleep_activated = 0;
> +	init_waitqueue_head(&priv->host_sleep_q);
>  	mutex_init(&priv->lock);
>  
>  	setup_timer(&priv->command_timer, lbs_cmd_timeout_handler,
> @@ -976,6 +1002,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
>  
>  	priv->wol_criteria = 0xffffffff;
>  	priv->wol_gpio = 0xff;
> +	priv->wol_gap = 20;
>  
>  	goto done;
>  
> @@ -1031,6 +1058,10 @@ void lbs_remove_card(struct lbs_private *priv)
>  		wake_up_interruptible(&priv->ds_awake_q);
>  	}
>  
> +	priv->is_host_sleep_configured = 0;
> +	priv->is_host_sleep_activated = 0;
> +	wake_up_interruptible(&priv->host_sleep_q);
> +
>  	/* Stop the thread servicing the interrupts */
>  	priv->surpriseremoved = 1;
>  	kthread_stop(priv->main_thread);



^ permalink raw reply

* RE: [RFC] Libertas: Added 11d support using cfg80211
From: Kiran Divekar @ 2010-05-18  5:01 UTC (permalink / raw)
  To: Dan Williams, holgerschurig@gmail.com
  Cc: linux-wireless@vger.kernel.org, libertas-dev@lists.infradead.org
In-Reply-To: <1274156806.14012.13.camel@localhost.localdomain>

> On Thu, 2010-05-13 at 04:00 -0700, Kiran Divekar wrote:
> > Added 11d support for libertas driver using cfg80211. This is based on
> Holger Shurig's initial work to add cfg80211 support libertas.
> > (https://patchwork.kernel.org/patch/64286/)
> >
> > Please let us know, if there are any improvements comments.
> >
> > Code is added to send 11d enable command to firmware while
> > initialisation and pass 11d specific information to firmware
> > when notifier handler is called by cfg80211.
> 
> Looks OK, though I'd prefer making 11D_DOMAIN_INFO a direct command
> instead.  But if you don't want to do that right now, that's fine, just
> send the final patch and I'll ack it.


Hi Dan, Holger,
  This patch is based on Holger's work to add cfg80211 support to libertas. We have tested original patch by rebasing to latest wireless-testing tree. We will send the re-based patch as well as this patch again.

Please let us know, if there are any other thoughts.

Thanks,
- Kiran



> Acked-by: Dan Williams <dcbw@redhat.com>
> 
> > Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> > Signed-off-by: Kiran Divekar <dkiran@marvell.com>
> > ---
> >  drivers/net/wireless/libertas/cfg.c     |  110
> +++++++++++++++++++++++++++++++
> >  drivers/net/wireless/libertas/cfg.h     |    5 ++
> >  drivers/net/wireless/libertas/cmd.c     |   65 ++++++++++++++++++
> >  drivers/net/wireless/libertas/cmdresp.c |   50 ++++++++++++++
> >  drivers/net/wireless/libertas/decl.h    |    5 ++
> >  drivers/net/wireless/libertas/dev.h     |    3 +
> >  drivers/net/wireless/libertas/host.h    |   28 ++++++++-
> >  drivers/net/wireless/libertas/main.c    |    3 +
> >  8 files changed, 268 insertions(+), 1 deletions(-)
> >

^ permalink raw reply

* RE: [RFC] Libertas: Added 11d support using cfg80211
From: Dan Williams @ 2010-05-18  5:14 UTC (permalink / raw)
  To: Kiran Divekar
  Cc: holgerschurig@gmail.com, linux-wireless@vger.kernel.org,
	libertas-dev@lists.infradead.org
In-Reply-To: <25B60CDC2F704E4E9D88FFD52780CB4C04D62738EA@SC-VEXCH1.marvell.com>

On Mon, 2010-05-17 at 22:01 -0700, Kiran Divekar wrote:
> > On Thu, 2010-05-13 at 04:00 -0700, Kiran Divekar wrote:
> > > Added 11d support for libertas driver using cfg80211. This is based on
> > Holger Shurig's initial work to add cfg80211 support libertas.
> > > (https://patchwork.kernel.org/patch/64286/)
> > >
> > > Please let us know, if there are any improvements comments.
> > >
> > > Code is added to send 11d enable command to firmware while
> > > initialisation and pass 11d specific information to firmware
> > > when notifier handler is called by cfg80211.
> > 
> > Looks OK, though I'd prefer making 11D_DOMAIN_INFO a direct command
> > instead.  But if you don't want to do that right now, that's fine, just
> > send the final patch and I'll ack it.
> 
> 
> Hi Dan, Holger,
>   This patch is based on Holger's work to add cfg80211 support to libertas. We have tested original patch by rebasing to latest wireless-testing tree. We will send the re-based patch as well as this patch again.

Sounds good.  Lets get the cfg80211 stuff in then I guess.

Dan

> Please let us know, if there are any other thoughts.
> 
> Thanks,
> - Kiran
> 
> 
> 
> > Acked-by: Dan Williams <dcbw@redhat.com>
> > 
> > > Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> > > Signed-off-by: Kiran Divekar <dkiran@marvell.com>
> > > ---
> > >  drivers/net/wireless/libertas/cfg.c     |  110
> > +++++++++++++++++++++++++++++++
> > >  drivers/net/wireless/libertas/cfg.h     |    5 ++
> > >  drivers/net/wireless/libertas/cmd.c     |   65 ++++++++++++++++++
> > >  drivers/net/wireless/libertas/cmdresp.c |   50 ++++++++++++++
> > >  drivers/net/wireless/libertas/decl.h    |    5 ++
> > >  drivers/net/wireless/libertas/dev.h     |    3 +
> > >  drivers/net/wireless/libertas/host.h    |   28 ++++++++-
> > >  drivers/net/wireless/libertas/main.c    |    3 +
> > >  8 files changed, 268 insertions(+), 1 deletions(-)
> > >



^ permalink raw reply

* Re: [PATCH] Select WIRELESS_EXT for the rndis_wlan driver to compile
From: Jussi Kivilinna @ 2010-05-18  6:38 UTC (permalink / raw)
  To: Rogério Brito; +Cc: linux-wireless, linux-kernel
In-Reply-To: <20100518031436.GA6006@ime.usp.br>

Hi,

Thanks for reporting. Correct way to fix this is to replace  
wireless_send_event() with cfg80211_disconnect(). I'll post patch soon.

-Jussi

Quoting "Rogério Brito" <rbrito@ime.usp.br>:

> The rndis_wlan.ko module needs the function wireless_send_event, which
> is not included if the option WIRELESS_EXT is not selected by the
> driver.  Otherwise, the user gets compilation problems like:
>
> ,----
> | (...)
> | Kernel: arch/x86/boot/bzImage is ready  (#3)
> |   Building modules, stage 2.
> |   MODPOST 427 modules
> | ERROR: "wireless_send_event" [drivers/net/wireless/rndis_wlan.ko]  
> undefined!
> | make[1]: *** [__modpost] Error 1
> | make: *** [modules] Error 2
> `----
> ---
>
> I don't know if this is a proper fix, but I would love to know a better
> solution to the problem.
>
>  drivers/net/wireless/Kconfig |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
> index 5889436..0d5fff4 100644
> --- a/drivers/net/wireless/Kconfig
> +++ b/drivers/net/wireless/Kconfig
> @@ -186,6 +186,7 @@ config USB_NET_RNDIS_WLAN
>  	tristate "Wireless RNDIS USB support"
>  	depends on USB && EXPERIMENTAL
>  	depends on CFG80211
> +	select WIRELESS_EXT
>  	select USB_USBNET
>  	select USB_NET_CDCETHER
>  	select USB_NET_RNDIS_HOST
> --
> 1.7.1
>
>
>



^ permalink raw reply

* [patch -next 1/2] ath9k_htc: dereferencing before check in hif_usb_tx_cb()
From: Sujith @ 2010-05-18  6:54 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Luis Rodriguez, Jouni Malinen, Vasanth Thiagarajan,
	Senthilkumar Balasubramanian, John W. Linville, Ming Lei,
	linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org
In-Reply-To: <20100514145056.GE17487@bicker>

Dan Carpenter wrote:
> After c11d8f89d3b7: "ath9k_htc: Simplify TX URB management" we no longer
> assume that tx_buf is a non-null pointer.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Thanks.

Acked-by: Sujith <Sujith.Manoharan@atheros.com>

> diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
> index 46dc41a..ac82911 100644
> --- a/drivers/net/wireless/ath/ath9k/hif_usb.c
> +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
> @@ -107,12 +107,14 @@ static inline void ath9k_skb_queue_purge(struct hif_device_usb *hif_dev,
>  static void hif_usb_tx_cb(struct urb *urb)
>  {
>  	struct tx_buf *tx_buf = (struct tx_buf *) urb->context;
> -	struct hif_device_usb *hif_dev = tx_buf->hif_dev;
> +	struct hif_device_usb *hif_dev;
>  	struct sk_buff *skb;
>  
> -	if (!hif_dev || !tx_buf)
> +	if (!tx_buf || !tx_buf->hif_dev)
>  		return;
>  
> +	hif_dev = tx_buf->hif_dev;
> +
>  	switch (urb->status) {
>  	case 0:
>  		break;

^ permalink raw reply

* [patch -next 2/2] ath9k_htc: rare leak in ath9k_hif_usb_alloc_tx_urbs()
From: Sujith @ 2010-05-18  6:56 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Luis Rodriguez, Jouni Malinen, Vasanth Thiagarajan,
	Senthilkumar Balasubramanian, John W. Linville, Ming Lei,
	linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org
In-Reply-To: <20100514145237.GF17487@bicker>

Dan Carpenter wrote:
> This is obviously a small picky thing.  The original error handling code
> doesn't free the most recent allocations which haven't been added to the
> hif_dev->tx.tx_buf list yet.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Thanks.

Acked-by: Sujith <Sujith.Manoharan@atheros.com>

> diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
> index 46dc41a..77b3591 100644
> --- a/drivers/net/wireless/ath/ath9k/hif_usb.c
> +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
> @@ -607,6 +609,10 @@ static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev)
>  
>  	return 0;
>  err:
> +	if (tx_buf) {
> +		kfree(tx_buf->buf);
> +		kfree(tx_buf);
> +	}
>  	ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
>  	return -ENOMEM;
>  }

^ permalink raw reply

* Re: [patch -next 1/2 v2] ath9k/debug: improve the snprintf() handling
From: Dan Carpenter @ 2010-05-18  7:47 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Jouni Malinen, Sujith Manoharan, Vasanthakumar Thiagarajan,
	Senthil Balasubramanian, John W. Linville, Felix Fietkau,
	Jeff Hansen, linux-wireless, ath9k-devel
In-Reply-To: <20100515133441.GB5381@bicker>

On Sat, May 15, 2010 at 03:34:41PM +0200, Dan Carpenter wrote:
> The snprintf() function returns the number of bytes that *would* have
> been written (not counting the NULL terminator).  We want to pass NULL
> terminated strings to the user so we need to add one to the snprintf 
> return value.

Actually this is a filesystem so we don't want to pass null terminated
strings do we?  Probably the first version of this patch was the better
one.

(What I love about open source is the discussions.  But normally it's
not just one discussing and sending out patches to his ownself. :P).

regards,
dan carpenter

^ permalink raw reply

* [PATCH] rndis_wlan: replace wireless_send_event with cfg80211_disconnected in rndis_wlan_do_link_down_work
From: Jussi Kivilinna @ 2010-05-18  8:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Rogério Brito, linux-wireless

Remove (hopefully) last use of WEXT in rndis_wlan. Replace wireless_send_event
with missing cfg80211_disconnected in rndis_wlan_do_link_down_work.

Reported-by: "Rogério Brito" <rbrito@ime.usp.br>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
 drivers/net/wireless/rndis_wlan.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 393f600..b280ad1 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2572,14 +2572,18 @@ static void rndis_wlan_do_link_up_work(struct usbnet *usbdev)
 
 static void rndis_wlan_do_link_down_work(struct usbnet *usbdev)
 {
-	union iwreq_data evt;
+	struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
 
-	netif_carrier_off(usbdev->net);
+	if (priv->connected) {
+		priv->connected = false;
+		memset(priv->bssid, 0, ETH_ALEN);
+
+		deauthenticate(usbdev);
 
-	evt.data.flags = 0;
-	evt.data.length = 0;
-	memset(evt.ap_addr.sa_data, 0, ETH_ALEN);
-	wireless_send_event(usbdev->net, SIOCGIWAP, &evt, NULL);
+		cfg80211_disconnected(usbdev->net, 0, NULL, 0, GFP_KERNEL);
+	}
+
+	netif_carrier_off(usbdev->net);
 }
 
 static void rndis_wlan_worker(struct work_struct *work)


^ permalink raw reply related

* [PATCH] rndis_wlan: increase assocbuf size and validate association info offsets from driver
From: Jussi Kivilinna @ 2010-05-18  8:27 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

Buffer size for get_association_info was limited to WEXT event size. Since association
info no longer is sent through WEXT, this limit is not needed. Code also did not
check if data get truncated, memory outside buffer might be addressed. Fix all these.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
 drivers/net/wireless/rndis_wlan.c |   36 +++++++++++++++++++++++++++++-------
 1 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index b280ad1..939e66e 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2495,8 +2495,7 @@ static int rndis_flush_pmksa(struct wiphy *wiphy, struct net_device *netdev)
 static void rndis_wlan_do_link_up_work(struct usbnet *usbdev)
 {
 	struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
-	struct ndis_80211_assoc_info *info;
-	u8 assoc_buf[sizeof(*info) + IW_CUSTOM_MAX + 32];
+	struct ndis_80211_assoc_info *info = NULL;
 	u8 bssid[ETH_ALEN];
 	int resp_ie_len, req_ie_len;
 	u8 *req_ie, *resp_ie;
@@ -2515,23 +2514,43 @@ static void rndis_wlan_do_link_up_work(struct usbnet *usbdev)
 	resp_ie = NULL;
 
 	if (priv->infra_mode == NDIS_80211_INFRA_INFRA) {
-		memset(assoc_buf, 0, sizeof(assoc_buf));
-		info = (void *)assoc_buf;
+		info = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL);
+		if (!info) {
+			/* No memory? Try resume work later */
+			set_bit(WORK_LINK_UP, &priv->work_pending);
+			queue_work(priv->workqueue, &priv->work);
+			return;
+		}
 
-		/* Get association info IEs from device and send them back to
-		 * userspace. */
-		ret = get_association_info(usbdev, info, sizeof(assoc_buf));
+		/* Get association info IEs from device. */
+		ret = get_association_info(usbdev, info, CONTROL_BUFFER_SIZE);
 		if (!ret) {
 			req_ie_len = le32_to_cpu(info->req_ie_length);
 			if (req_ie_len > 0) {
 				offset = le32_to_cpu(info->offset_req_ies);
+
+				if (offset > CONTROL_BUFFER_SIZE)
+					offset = CONTROL_BUFFER_SIZE;
+
 				req_ie = (u8 *)info + offset;
+
+				if (offset + req_ie_len > CONTROL_BUFFER_SIZE)
+					req_ie_len =
+						CONTROL_BUFFER_SIZE - offset;
 			}
 
 			resp_ie_len = le32_to_cpu(info->resp_ie_length);
 			if (resp_ie_len > 0) {
 				offset = le32_to_cpu(info->offset_resp_ies);
+
+				if (offset > CONTROL_BUFFER_SIZE)
+					offset = CONTROL_BUFFER_SIZE;
+
 				resp_ie = (u8 *)info + offset;
+
+				if (offset + resp_ie_len > CONTROL_BUFFER_SIZE)
+					resp_ie_len =
+						CONTROL_BUFFER_SIZE - offset;
 			}
 		}
 	} else if (WARN_ON(priv->infra_mode != NDIS_80211_INFRA_ADHOC))
@@ -2563,6 +2582,9 @@ static void rndis_wlan_do_link_up_work(struct usbnet *usbdev)
 	} else if (priv->infra_mode == NDIS_80211_INFRA_ADHOC)
 		cfg80211_ibss_joined(usbdev->net, bssid, GFP_KERNEL);
 
+	if (info != NULL)
+		kfree(info);
+
 	priv->connected = true;
 	memcpy(priv->bssid, bssid, ETH_ALEN);
 


^ permalink raw reply related

* Re: [PATCH] rndis_wlan: replace wireless_send_event with cfg80211_disconnected in rndis_wlan_do_link_down_work
From: Rogério Brito @ 2010-05-18  8:55 UTC (permalink / raw)
  To: Jussi Kivilinna; +Cc: John W. Linville, linux-wireless
In-Reply-To: <20100518082051.18988.85196.stgit@fate.lan>

Hi, Jussi.

On May 18 2010, Jussi Kivilinna wrote:
> Remove (hopefully) last use of WEXT in rndis_wlan. Replace wireless_send_event
> with missing cfg80211_disconnected in rndis_wlan_do_link_down_work.

Thanks. Should this be sent to stable?


Regards,

-- 
Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 1024D/7C2CAEB8
http://rb.doesntexist.org : Packages for LaTeX : algorithms.berlios.de
DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

^ permalink raw reply

* [PATCH] ath9k_htc: Use proper station add/remove callbacks
From: Sujith @ 2010-05-18  9:56 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

sta_add/sta_remove are the callbacks that can sleep.
Use them instead of sta_notify.

Sigh. What a dumb fsckup.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
---
 drivers/net/wireless/ath/ath9k/htc_drv_main.c |   39 ++++++++++++++-----------
 1 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 6d46423..340d281 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1438,30 +1438,34 @@ static void ath9k_htc_configure_filter(struct ieee80211_hw *hw,
 	mutex_unlock(&priv->mutex);
 }
 
-static void ath9k_htc_sta_notify(struct ieee80211_hw *hw,
-				 struct ieee80211_vif *vif,
-				 enum sta_notify_cmd cmd,
-				 struct ieee80211_sta *sta)
+static int ath9k_htc_sta_add(struct ieee80211_hw *hw,
+			     struct ieee80211_vif *vif,
+			     struct ieee80211_sta *sta)
 {
 	struct ath9k_htc_priv *priv = hw->priv;
 	int ret;
 
 	mutex_lock(&priv->mutex);
+	ret = ath9k_htc_add_station(priv, vif, sta);
+	if (!ret)
+		ath9k_htc_init_rate(priv, sta);
+	mutex_unlock(&priv->mutex);
 
-	switch (cmd) {
-	case STA_NOTIFY_ADD:
-		ret = ath9k_htc_add_station(priv, vif, sta);
-		if (!ret)
-			ath9k_htc_init_rate(priv, sta);
-		break;
-	case STA_NOTIFY_REMOVE:
-		ath9k_htc_remove_station(priv, vif, sta);
-		break;
-	default:
-		break;
-	}
+	return ret;
+}
 
+static int ath9k_htc_sta_remove(struct ieee80211_hw *hw,
+				struct ieee80211_vif *vif,
+				struct ieee80211_sta *sta)
+{
+	struct ath9k_htc_priv *priv = hw->priv;
+	int ret;
+
+	mutex_lock(&priv->mutex);
+	ret = ath9k_htc_remove_station(priv, vif, sta);
 	mutex_unlock(&priv->mutex);
+
+	return ret;
 }
 
 static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, u16 queue,
@@ -1756,7 +1760,8 @@ struct ieee80211_ops ath9k_htc_ops = {
 	.remove_interface   = ath9k_htc_remove_interface,
 	.config             = ath9k_htc_config,
 	.configure_filter   = ath9k_htc_configure_filter,
-	.sta_notify         = ath9k_htc_sta_notify,
+	.sta_add            = ath9k_htc_sta_add,
+	.sta_remove         = ath9k_htc_sta_remove,
 	.conf_tx            = ath9k_htc_conf_tx,
 	.bss_info_changed   = ath9k_htc_bss_info_changed,
 	.set_key            = ath9k_htc_set_key,
-- 
1.7.1


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox