Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: iwlagn: possible regressions from 2.6.29 in 2.6.30
From: reinette chatre @ 2009-08-03 21:08 UTC (permalink / raw)
  To: Paul Collins; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <87tz1thrzk.fsf@bulky.wgtn.ondioline.org>

Paul,

Hi Paul,

On Fri, 2009-07-03 at 23:39 -0700, Paul Collins wrote:
> Paul Collins <paul@burly.ondioline.org> writes:
> 
> > reinette chatre <reinette.chatre@intel.com> writes:
> >>> When I say "packets > 250 bytes" I mean 250-byte packets as claimed by
> >>> "ping -s 222 mygateway":
> >>> 
> >>>         PING cornelius.lan (10.2.4.1) 222(250) bytes of data.
> >>> 
> >>> The above will work, but "ping -s 223 cornelius" yields no replies.
> >>
> >> Are you saying this works before suspend, but not after resume? What do
> >> you usually do to get this working again?
> >
> > Yes, normally it works great; I can ping with packet sizes up to the
> > MTU.  However, after suspend/resume and reassociation, "ping -s 223" or
> > greater does not work.  I get replies with "-s 222" or less,
> > i.e. packets of 250 bytes or less.
> >
> > To get it working again I do "ifdown wlan0" followed by "ifup wlan0",
> > which does the equivalent of "ip set link wlan0 down/up" and applying
> > the network configuration.
> >
> > I will give the patch a shot when I get home.
> 
> I thought at first that the patch had moved the problem from reliably
> reproducible to intermittently reproducible, but it looks like it was
> simply intermittently reproducible the whole time.  So, no change with
> the patch applied.

We have not yet been able to look into this issue - could you please
submit a bug at intellinuxwireless.org/bugzilla so that we can track it
there? 

Thank you

Reinette



^ permalink raw reply

* Re: pull request: wireless-2.6 2009-08-03
From: Luis R. Rodriguez @ 2009-08-03 21:06 UTC (permalink / raw)
  To: John W. Linville; +Cc: davem, linux-wireless, linux-kernel, netdev
In-Reply-To: <20090803205954.GE11441@tuxdriver.com>

On Mon, Aug 3, 2009 at 1:59 PM, John W. Linville<linville@tuxdriver.com> wrote:
> Dave,
>
> Here is another round of fixes intended for 2.6.31.  The one from
> Reinette fixes an rfkill-related bug described in bugzilla 13742.  The one
> from Luis has a lengthy changelog, but boils down to correcting some
> regulatory enforcement issues that would prevent some devices from
> working in some localities.  The rest are simple and obvious.
>
> Please let me know if there are problems!
>
> Thanks,
>
> John
>
> ---
>
> Individual patches are available here:
>
>        http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/

John, just noticed the patches in this link do not correspond.

  Luis

^ permalink raw reply

* pull request: wireless-2.6 2009-08-03
From: John W. Linville @ 2009-08-03 20:59 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, linux-kernel, netdev

Dave,

Here is another round of fixes intended for 2.6.31.  The one from
Reinette fixes an rfkill-related bug described in bugzilla 13742.  The one
from Luis has a lengthy changelog, but boils down to correcting some
regulatory enforcement issues that would prevent some devices from
working in some localities.  The rest are simple and obvious.

Please let me know if there are problems!

Thanks,

John

---

Individual patches are available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/

---

The following changes since commit eb4ad826419ab5b1260bc1625249114767d36bea:
  Yevgeny Petrilin (1):
        mlx4_en: Fix double pci unmapping.

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master

Johannes Berg (1):
      cfg80211: add two missing NULL pointer checks

Julia Lawall (2):
      drivers/net/wireless/iwlwifi: introduce missing kfree
      drivers/net/wireless: introduce missing kfree

Luis R. Rodriguez (1):
      cfg80211: fix regression on beacon world roaming feature

Patrick Simmons (1):
      zd1211rw: fix unaligned access in zd_mac_rx

Reinette Chatre (1):
      iwlagn: do not send key clear commands when rfkill enabled

Roel Kluin (1):
      libertas: Read buffer overflow

 drivers/net/wireless/iwlwifi/iwl-core.c      |    3 +++
 drivers/net/wireless/iwlwifi/iwl-debugfs.c   |   12 ++++++------
 drivers/net/wireless/iwlwifi/iwl-sta.c       |   12 ++++++++++++
 drivers/net/wireless/iwlwifi/iwl3945-base.c  |    3 +++
 drivers/net/wireless/iwmc3200wifi/commands.c |    1 +
 drivers/net/wireless/libertas/11d.c          |    2 +-
 drivers/net/wireless/zd1211rw/zd_mac.c       |    2 +-
 include/net/cfg80211.h                       |    5 +++++
 net/wireless/reg.c                           |    9 +++++----
 net/wireless/reg.h                           |    3 ++-
 net/wireless/scan.c                          |    4 +++-
 11 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 6ab0716..18b135f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1332,6 +1332,9 @@ int iwl_setup_mac(struct iwl_priv *priv)
 
 	hw->wiphy->custom_regulatory = true;
 
+	/* Firmware does not support this */
+	hw->wiphy->disable_beacon_hints = true;
+
 	hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX;
 	/* we create the 802.11 header and a zero-length SSID element */
 	hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2;
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 11e08c0..ca00cc8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -308,18 +308,18 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
 		return -ENODATA;
 	}
 
+	ptr = priv->eeprom;
+	if (!ptr) {
+		IWL_ERR(priv, "Invalid EEPROM/OTP memory\n");
+		return -ENOMEM;
+	}
+
 	/* 4 characters for byte 0xYY */
 	buf = kzalloc(buf_size, GFP_KERNEL);
 	if (!buf) {
 		IWL_ERR(priv, "Can not allocate Buffer\n");
 		return -ENOMEM;
 	}
-
-	ptr = priv->eeprom;
-	if (!ptr) {
-		IWL_ERR(priv, "Invalid EEPROM/OTP memory\n");
-		return -ENOMEM;
-	}
 	pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n",
 			(priv->nvm_device_type == NVM_DEVICE_TYPE_OTP)
 			? "OTP" : "EEPROM");
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 2addf73..ffd5c61 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -566,6 +566,8 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
 	unsigned long flags;
 
 	spin_lock_irqsave(&priv->sta_lock, flags);
+	IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n",
+		      keyconf->keyidx);
 
 	if (!test_and_clear_bit(keyconf->keyidx, &priv->ucode_key_table))
 		IWL_ERR(priv, "index %d not used in uCode key table.\n",
@@ -573,6 +575,11 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
 
 	priv->default_wep_key--;
 	memset(&priv->wep_keys[keyconf->keyidx], 0, sizeof(priv->wep_keys[0]));
+	if (iwl_is_rfkill(priv)) {
+		IWL_DEBUG_WEP(priv, "Not sending REPLY_WEPKEY command due to RFKILL.\n");
+		spin_unlock_irqrestore(&priv->sta_lock, flags);
+		return 0;
+	}
 	ret = iwl_send_static_wepkey_cmd(priv, 1);
 	IWL_DEBUG_WEP(priv, "Remove default WEP key: idx=%d ret=%d\n",
 		      keyconf->keyidx, ret);
@@ -853,6 +860,11 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
 	priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
 	priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
 
+	if (iwl_is_rfkill(priv)) {
+		IWL_DEBUG_WEP(priv, "Not sending REPLY_ADD_STA command because RFKILL enabled. \n");
+		spin_unlock_irqrestore(&priv->sta_lock, flags);
+		return 0;
+	}
 	ret =  iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
 	spin_unlock_irqrestore(&priv->sta_lock, flags);
 	return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 2f50ab6..5238433 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3968,6 +3968,9 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)
 
 	hw->wiphy->custom_regulatory = true;
 
+	/* Firmware does not support this */
+	hw->wiphy->disable_beacon_hints = true;
+
 	hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945;
 	/* we create the 802.11 header and a zero-length SSID element */
 	hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2;
diff --git a/drivers/net/wireless/iwmc3200wifi/commands.c b/drivers/net/wireless/iwmc3200wifi/commands.c
index 834a7f5..e2334d1 100644
--- a/drivers/net/wireless/iwmc3200wifi/commands.c
+++ b/drivers/net/wireless/iwmc3200wifi/commands.c
@@ -220,6 +220,7 @@ int iwm_store_rxiq_calib_result(struct iwm_priv *iwm)
 	eeprom_rxiq = iwm_eeprom_access(iwm, IWM_EEPROM_CALIB_RXIQ);
 	if (IS_ERR(eeprom_rxiq)) {
 		IWM_ERR(iwm, "Couldn't access EEPROM RX IQ entry\n");
+		kfree(rxiq);
 		return PTR_ERR(eeprom_rxiq);
 	}
 
diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c
index 9a5408e..5c69681 100644
--- a/drivers/net/wireless/libertas/11d.c
+++ b/drivers/net/wireless/libertas/11d.c
@@ -47,7 +47,7 @@ static u8 lbs_region_2_code(u8 *region)
 {
 	u8 i;
 
-	for (i = 0; region[i] && i < COUNTRY_CODE_LEN; i++)
+	for (i = 0; i < COUNTRY_CODE_LEN && region[i]; i++)
 		region[i] = toupper(region[i]);
 
 	for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) {
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 40b07b9..3bd3c77 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -698,7 +698,7 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)
 			&& !mac->pass_ctrl)
 		return 0;
 
-	fc = *(__le16 *)buffer;
+	fc = get_unaligned((__le16*)buffer);
 	need_padding = ieee80211_is_data_qos(fc) ^ ieee80211_has_a4(fc);
 
 	skb = dev_alloc_skb(length + (need_padding ? 2 : 0));
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 1a21895..d1892d6 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -979,6 +979,10 @@ struct cfg80211_ops {
  * 	channels at a later time. This can be used for devices which do not
  * 	have calibration information gauranteed for frequencies or settings
  * 	outside of its regulatory domain.
+ * @disable_beacon_hints: enable this if your driver needs to ensure that
+ *	passive scan flags and beaconing flags may not be lifted by cfg80211
+ *	due to regulatory beacon hints. For more information on beacon
+ *	hints read the documenation for regulatory_hint_found_beacon()
  * @reg_notifier: the driver's regulatory notification callback
  * @regd: the driver's regulatory domain, if one was requested via
  * 	the regulatory_hint() API. This can be used by the driver
@@ -1004,6 +1008,7 @@ struct wiphy {
 
 	bool custom_regulatory;
 	bool strict_regulatory;
+	bool disable_beacon_hints;
 
 	enum cfg80211_signal_type signal_type;
 
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 5e14371..75a406d 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1089,17 +1089,18 @@ static void handle_reg_beacon(struct wiphy *wiphy,
 
 	chan->beacon_found = true;
 
+	if (wiphy->disable_beacon_hints)
+		return;
+
 	chan_before.center_freq = chan->center_freq;
 	chan_before.flags = chan->flags;
 
-	if ((chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
-	    !(chan->orig_flags & IEEE80211_CHAN_PASSIVE_SCAN)) {
+	if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) {
 		chan->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
 		channel_changed = true;
 	}
 
-	if ((chan->flags & IEEE80211_CHAN_NO_IBSS) &&
-	    !(chan->orig_flags & IEEE80211_CHAN_NO_IBSS)) {
+	if (chan->flags & IEEE80211_CHAN_NO_IBSS) {
 		chan->flags &= ~IEEE80211_CHAN_NO_IBSS;
 		channel_changed = true;
 	}
diff --git a/net/wireless/reg.h b/net/wireless/reg.h
index e37829a..4e167a8 100644
--- a/net/wireless/reg.h
+++ b/net/wireless/reg.h
@@ -30,7 +30,8 @@ int set_regdom(const struct ieee80211_regdomain *rd);
  * non-radar 5 GHz channels.
  *
  * Drivers do not need to call this, cfg80211 will do it for after a scan
- * on a newly found BSS.
+ * on a newly found BSS. If you cannot make use of this feature you can
+ * set the wiphy->disable_beacon_hints to true.
  */
 int regulatory_hint_found_beacon(struct wiphy *wiphy,
 					struct ieee80211_channel *beacon_chan,
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 9271118..7e595ce 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -118,7 +118,7 @@ static int cmp_ies(u8 num, u8 *ies1, size_t len1, u8 *ies2, size_t len2)
 
 	if (!ie1 && !ie2)
 		return 0;
-	if (!ie1)
+	if (!ie1 || !ie2)
 		return -1;
 
 	r = memcmp(ie1 + 2, ie2 + 2, min(ie1[1], ie2[1]));
@@ -171,6 +171,8 @@ static bool is_mesh(struct cfg80211_bss *a,
 	ie = find_ie(WLAN_EID_MESH_CONFIG,
 		     a->information_elements,
 		     a->len_information_elements);
+	if (!ie)
+		return false;
 	if (ie[1] != IEEE80211_MESH_CONFIG_LEN)
 		return false;
 
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.
			¡Viva Honduras Libre!

^ permalink raw reply related

* Re: [PATCH RESEND] b43: implement baseband init for LP-PHY <= rev1
From: Larry Finger @ 2009-08-03 20:58 UTC (permalink / raw)
  To: Gábor Stefanik; +Cc: Michael Buesch, bcm43xx-dev, linux-wireless
In-Reply-To: <69e28c910908031341n439384b4ned41f2983ab1de29@mail.gmail.com>

Gábor Stefanik wrote:
> 2009/8/3 Michael Buesch <mb@bu3sch.de>:
>> On Monday 03 August 2009 15:55:29 Gábor Stefanik wrote:
>>> On Mon, Aug 3, 2009 at 11:15 AM, Michael Buesch<mb@bu3sch.de> wrote:
>>>> On Monday 03 August 2009 11:13:37 Michael Buesch wrote:
>>>>> On Monday 03 August 2009 00:18:22 Gábor Stefanik wrote:
>>>>>> Implement baseband init for rev.0 and rev.1 LP PHYs. Convert
>>>>>> boardflags_hi values to defines.
>>>>>> Implement b43_phy_copy for easier copying between registers, as needed
>>>>>> by LP-PHY init.
>>>>>> +   if (bus->sprom.boardflags_hi&  B43_BFH_FEM_BT)&&
>>>>>> +      (bus->chip_id == 0x5354)&&
>>>>>> +      (bus->chip_package == SSB_CHIPPACK_BCM4712S)) {
>>>>>> +           b43_phy_set(dev, B43_LPPHY_CRSGAIN_CTL, 0x0006);
>>>>>> +           b43_phy_write(dev, B43_LPPHY_GPIO_SELECT, 0x0005);
>>>>>> +           b43_phy_write(dev, B43_LPPHY_GPIO_OUTEN, 0xFFFF);
>>>>>> +           b43_hf_write(dev, b43_hf_read | 0x0800ULL<<  32);
>>>>>> +   }
>>>>> The HF write is wrong. Read the specification:
>>>>> http://bcm-v4.sipsolutions.net/802.11/Mhf
>>>>>
>>>>> Patch otherwise looks ok.
>>>> Sorry, I replied to the wrong mail. But this does also apply to V2 patch.
>>>>
>>>> --
>>>> Greetings, Michael.
>>>>
>>> In V2, this line is as follows (b43_hf_read corrected):
>>>
>>> b43_hf_write(dev, b43_hf_read(dev) | 0x0800ULL << 32)
>>>
>>> The command in the specs is this:
>>>
>>> mhf(2, 0x800, 0x800, 1)
>>>
>>> 2 means B43_SHM_SH_HOSTFHI, 0x800 is the bit to set, and 1 is
>>> allbands, which, per Larry, can be ignored in our current
>>> implementation (it is specific to the caching behavior of the mips
>>> driver).
>>>
>>> From what I read in b43_hf_write, writing to HOSTFHI can be achieved
>>> by left-shifting by 32 (16 for HOSTFMI).
>>>
>>> Is the problem that we write all 3 hostflags registers here?
>>>
>>> (BTW are there any other known host flags? If there are, maybe we
>>> should #define them.)
>>>
>> My point is that update_mhf does not write to actual hardware, as far
>> as I understand the code. Larry, can you please explain that part of the
>> specs?
>>
> 
>>From 802.11/Mhf:
> "If core->clk is not zero AND band->mhfs[idx] is not equal to tmp:
>    1. Write band->mhfs[idx] to Shared Memory Address addr[idx]"
> 
> This looks to me like it does indeed write to SHM, though the actual
> mhf() tries to avoid writing to SHM if possible, while b43_hf_write
> doesn't perform this optimization. (We don't have a band->mhfs, nor a
> bandstate[] array.)

Gábor states it the way the Broadcom routine is written. They have the
flags divided into 3 16-bit values - high, middle, and low. The values
are kept in arrays - one set is for the current band and the other is
for both bands. When the routine is entered, the appropriate quantity
is saved in a temporary, then the array value is maskset. Only when
the resulting value changes is the shared memory location updated. The
implication is that shared memory writes are expensive. Is that true?

Larry

^ permalink raw reply

* [PATCH] Remove _t postfix for ar9287_eeprom structure
From: Luis R. Rodriguez @ 2009-08-03 20:55 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez

We don't use typdefs on ath9k, remove that _t.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/eeprom.c |   24 ++++++++++++------------
 drivers/net/wireless/ath/ath9k/eeprom.h |    2 +-
 drivers/net/wireless/ath/ath9k/hw.h     |    2 +-
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c
index 4e4a300..c724c55 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
@@ -2794,7 +2794,7 @@ static int ath9k_hw_AR9287_get_eeprom_rev(struct ath_hw *ah)
 
 static bool ath9k_hw_AR9287_fill_eeprom(struct ath_hw *ah)
 {
-	struct ar9287_eeprom_t *eep = &ah->eeprom.map9287;
+	struct ar9287_eeprom *eep = &ah->eeprom.map9287;
 	u16 *eep_data;
 	int addr, eep_start_loc = AR9287_EEP_START_LOC;
 	eep_data = (u16 *)eep;
@@ -2803,7 +2803,7 @@ static bool ath9k_hw_AR9287_fill_eeprom(struct ath_hw *ah)
 				"Reading from EEPROM, not flash\n");
 	}
 
-	for (addr = 0; addr < sizeof(struct ar9287_eeprom_t) / sizeof(u16);
+	for (addr = 0; addr < sizeof(struct ar9287_eeprom) / sizeof(u16);
 			addr++)	{
 		if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data)) {
 			DPRINTF(ah->ah_sc, ATH_DBG_EEPROM,
@@ -2820,7 +2820,7 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
 	u16 temp, word, magic, magic2, *eepdata;
 	int i, addr;
 	bool need_swap = false;
-	struct ar9287_eeprom_t *eep = &ah->eeprom.map9287;
+	struct ar9287_eeprom *eep = &ah->eeprom.map9287;
 
 	if (!ath9k_hw_use_flash(ah)) {
 		if (!ath9k_hw_nvram_read
@@ -2842,7 +2842,7 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
 				eepdata = (u16 *)(&ah->eeprom);
 
 				for (addr = 0;
-				     addr < sizeof(struct ar9287_eeprom_t) / sizeof(u16);
+				     addr < sizeof(struct ar9287_eeprom) / sizeof(u16);
 				     addr++) {
 					temp = swab16(*eepdata);
 					*eepdata = temp;
@@ -2863,8 +2863,8 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
 	else
 		el = ah->eeprom.map9287.baseEepHeader.length;
 
-	if (el > sizeof(struct ar9287_eeprom_t))
-		el = sizeof(struct ar9287_eeprom_t) / sizeof(u16);
+	if (el > sizeof(struct ar9287_eeprom))
+		el = sizeof(struct ar9287_eeprom) / sizeof(u16);
 	else
 		el = el / sizeof(u16);
 
@@ -2925,7 +2925,7 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
 static u32 ath9k_hw_AR9287_get_eeprom(struct ath_hw *ah,
 		enum eeprom_param param)
 {
-	struct ar9287_eeprom_t *eep = &ah->eeprom.map9287;
+	struct ar9287_eeprom *eep = &ah->eeprom.map9287;
 	struct modal_eep_ar9287_header *pModal = &eep->modalHeader;
 	struct base_eep_ar9287_header *pBase = &eep->baseEepHeader;
 	u16 ver_minor;
@@ -3215,7 +3215,7 @@ static void ath9k_hw_set_AR9287_power_cal_table(struct ath_hw *ah,
 	u16 xpdGainValues[AR9287_NUM_PD_GAINS] = {0, 0, 0, 0};
 	u32 reg32, regOffset, regChainOffset;
 	int16_t   modalIdx, diff = 0;
-	struct ar9287_eeprom_t *pEepData = &ah->eeprom.map9287;
+	struct ar9287_eeprom *pEepData = &ah->eeprom.map9287;
 	modalIdx = IS_CHAN_2GHZ(chan) ? 1 : 0;
 	xpdMask = pEepData->modalHeader.xpdGain;
 	if ((pEepData->baseEepHeader.version & AR9287_EEP_VER_MINOR_MASK) >=
@@ -3385,7 +3385,7 @@ static void ath9k_hw_set_AR9287_power_per_rate_table(struct ath_hw *ah,
 	struct chan_centers centers;
 	int tx_chainmask;
 	u16 twiceMinEdgePower;
-	struct ar9287_eeprom_t *pEepData = &ah->eeprom.map9287;
+	struct ar9287_eeprom *pEepData = &ah->eeprom.map9287;
 	tx_chainmask = ah->txchainmask;
 
 	ath9k_hw_get_channel_centers(ah, chan, &centers);
@@ -3618,7 +3618,7 @@ static void ath9k_hw_AR9287_set_txpower(struct ath_hw *ah,
 {
 #define INCREASE_MAXPOW_BY_TWO_CHAIN     6
 #define INCREASE_MAXPOW_BY_THREE_CHAIN   10
-	struct ar9287_eeprom_t *pEepData = &ah->eeprom.map9287;
+	struct ar9287_eeprom *pEepData = &ah->eeprom.map9287;
 	struct modal_eep_ar9287_header *pModal = &pEepData->modalHeader;
 	int16_t ratesArray[Ar5416RateSize];
 	int16_t  txPowerIndexOffset = 0;
@@ -3781,7 +3781,7 @@ static void ath9k_hw_AR9287_set_addac(struct ath_hw *ah,
 static void ath9k_hw_AR9287_set_board_values(struct ath_hw *ah,
 					     struct ath9k_channel *chan)
 {
-	struct ar9287_eeprom_t *eep = &ah->eeprom.map9287;
+	struct ar9287_eeprom *eep = &ah->eeprom.map9287;
 	struct modal_eep_ar9287_header *pModal = &eep->modalHeader;
 
 	u16 antWrites[AR9287_ANT_16S];
@@ -3933,7 +3933,7 @@ static u8 ath9k_hw_AR9287_get_num_ant_config(struct ath_hw *ah,
 static u16 ath9k_hw_AR9287_get_eeprom_antenna_cfg(struct ath_hw *ah,
 		struct ath9k_channel *chan)
 {
-	struct ar9287_eeprom_t *eep = &ah->eeprom.map9287;
+	struct ar9287_eeprom *eep = &ah->eeprom.map9287;
 	struct modal_eep_ar9287_header *pModal = &eep->modalHeader;
 	return pModal->antCtrlCommon & 0xFFFF;
 }
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h
index 335098d..db77e90 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
@@ -600,7 +600,7 @@ struct ar5416_eeprom_4k {
 	u8 padding;
 } __packed;
 
-struct ar9287_eeprom_t {
+struct ar9287_eeprom {
 	struct base_eep_ar9287_header  baseEepHeader;
 	u8 custData[AR9287_DATA_SZ];
 	struct modal_eep_ar9287_header modalHeader;
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 4e717cc..9c23db1 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -403,7 +403,7 @@ struct ath_hw {
 	union {
 		struct ar5416_eeprom_def def;
 		struct ar5416_eeprom_4k map4k;
-		struct ar9287_eeprom_t map9287;
+		struct ar9287_eeprom map9287;
 	} eeprom;
 	const struct eeprom_ops *eep_ops;
 	enum ath9k_eep_map eep_map;
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH] ath9k: fix compile warning on ath9k_hw_AR9287_check_eeprom()
From: Luis R. Rodriguez @ 2009-08-03 20:51 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez, Vivek Natarajan

CC [M]  drivers/net/wireless/ath/ath9k/eeprom.o
drivers/net/wireless/ath/ath9k/eeprom.c: In function ‘ath9k_hw_AR9287_check_eeprom’:
drivers/net/wireless/ath/ath9k/eeprom.c:2866: warning: comparison of distinct pointer types lacks a cast

Cc: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/eeprom.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c
index e8ccec0..4e4a300 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
@@ -2816,7 +2816,6 @@ static bool ath9k_hw_AR9287_fill_eeprom(struct ath_hw *ah)
 }
 static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
 {
-#define SIZE_EEPROM_87 (sizeof(struct ar9287_eeprom_t) / sizeof(u16))
 	u32 sum = 0, el, integer;
 	u16 temp, word, magic, magic2, *eepdata;
 	int i, addr;
@@ -2842,7 +2841,9 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
 				need_swap = true;
 				eepdata = (u16 *)(&ah->eeprom);
 
-				for (addr = 0; addr < SIZE_EEPROM_87; addr++) {
+				for (addr = 0;
+				     addr < sizeof(struct ar9287_eeprom_t) / sizeof(u16);
+				     addr++) {
 					temp = swab16(*eepdata);
 					*eepdata = temp;
 					eepdata++;
@@ -2862,8 +2863,13 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
 	else
 		el = ah->eeprom.map9287.baseEepHeader.length;
 
+	if (el > sizeof(struct ar9287_eeprom_t))
+		el = sizeof(struct ar9287_eeprom_t) / sizeof(u16);
+	else
+		el = el / sizeof(u16);
+
 	eepdata = (u16 *)(&ah->eeprom);
-	for (i = 0; i < min(el, SIZE_EEPROM_87); i++)
+	for (i = 0; i < el; i++)
 		sum ^= *eepdata++;
 
 	if (need_swap) {
@@ -2914,7 +2920,6 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
 	}
 
 	return 0;
-#undef SIZE_EEPROM_87
 }
 
 static u32 ath9k_hw_AR9287_get_eeprom(struct ath_hw *ah,
-- 
1.6.3.3


^ permalink raw reply related

* Re: ar9170usb crashes during iwconfig for ad-hoc mode
From: Joerg Albert @ 2009-08-03 20:46 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: Johannes Berg, linux-wireless
In-Reply-To: <200908031509.55277.chunkeey@web.de>

Hi Christian,

On 08/03/2009 03:09 PM, Christian Lamparter wrote:
> On Monday 03 August 2009 14:36:42 Joerg Albert wrote:
>>> On Mon, 2009-08-03 at 10:44 +0200, Johannes Berg wrote:
>>>
>>>>>>     ifconfig wlan1 down
>>>>>>     iwconfig wlan1 mode managed essid huhu
>>>>>>     ifconfig wlan1 up
>>>>>>     ifconfig wlan1 down
>>>>>>     iwconfig wlan1 mode ad-hoc essid huhu_a channel 1
>>>> No, it's a bug in cfg80211 :)
>>> But it's not making sense to me. I'll have to try to reproduce it. In
>>> any case, we shouldn't be calling in to mac80211 from cfg80211 while the
>>> interface is down.
>> I guess this is caused by the call to __cfg80211_leave_ibss()
>> in  net/wireless/ibss.c::cfg80211_ibss_wext_siwfreq() trying to
>> disable the beacon via net/mac80211::ieee80211_ibss_leave().

> what about this? (only compiled so far, don't have the device here...)

 > diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
 > index 099ed3c..9c97ad7 100644
 > --- a/drivers/net/wireless/ath/ar9170/main.c
 > +++ b/drivers/net/wireless/ath/ar9170/main.c
 > @@ -2177,7 +2177,7 @@ static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw,
 >                         goto out;
 >         }
 >
 > -       if (changed & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_ENABLED)) {
 > +       if (changed & BSS_CHANGED_BEACON_ENABLED) {
 >                 err = ar9170_update_beacon(ar);
 >               if (err)
 >                         goto out;

Thanks for the patch,  but I think it won't help. ar9170_op_bss_info_changed() is called
with BSS_CHANGED_BEACON_ENABLED set in changed, while ar->vif is NULL as _op_remove_interface() was called before
(by "ifconfig down"). This triggers the crash.

I've got a patch ready here, which uses the vif parameter of ar9170_op_bss_info_changed() instead of ar->vif.
I'll try Johannes' patch first.

Regards,
Joerg.

^ permalink raw reply

* Re: [PATCH RESEND] b43: implement baseband init for LP-PHY <= rev1
From: Gábor Stefanik @ 2009-08-03 20:41 UTC (permalink / raw)
  To: Michael Buesch; +Cc: bcm43xx-dev, linux-wireless, Larry Finger
In-Reply-To: <200908032238.18030.mb@bu3sch.de>

2009/8/3 Michael Buesch <mb@bu3sch.de>:
> On Monday 03 August 2009 15:55:29 Gábor Stefanik wrote:
>> On Mon, Aug 3, 2009 at 11:15 AM, Michael Buesch<mb@bu3sch.de> wrote:
>> > On Monday 03 August 2009 11:13:37 Michael Buesch wrote:
>> >> On Monday 03 August 2009 00:18:22 Gábor Stefanik wrote:
>> >> > Implement baseband init for rev.0 and rev.1 LP PHYs. Convert
>> >> > boardflags_hi values to defines.
>> >> > Implement b43_phy_copy for easier copying between registers, as needed
>> >> > by LP-PHY init.
>> >>
>> >> > +   if (bus->sprom.boardflags_hi&  B43_BFH_FEM_BT)&&
>> >> > +      (bus->chip_id == 0x5354)&&
>> >> > +      (bus->chip_package == SSB_CHIPPACK_BCM4712S)) {
>> >> > +           b43_phy_set(dev, B43_LPPHY_CRSGAIN_CTL, 0x0006);
>> >> > +           b43_phy_write(dev, B43_LPPHY_GPIO_SELECT, 0x0005);
>> >> > +           b43_phy_write(dev, B43_LPPHY_GPIO_OUTEN, 0xFFFF);
>> >> > +           b43_hf_write(dev, b43_hf_read | 0x0800ULL<<  32);
>> >> > +   }
>> >>
>> >> The HF write is wrong. Read the specification:
>> >> http://bcm-v4.sipsolutions.net/802.11/Mhf
>> >>
>> >> Patch otherwise looks ok.
>> >
>> > Sorry, I replied to the wrong mail. But this does also apply to V2 patch.
>> >
>> > --
>> > Greetings, Michael.
>> >
>>
>> In V2, this line is as follows (b43_hf_read corrected):
>>
>> b43_hf_write(dev, b43_hf_read(dev) | 0x0800ULL << 32)
>>
>> The command in the specs is this:
>>
>> mhf(2, 0x800, 0x800, 1)
>>
>> 2 means B43_SHM_SH_HOSTFHI, 0x800 is the bit to set, and 1 is
>> allbands, which, per Larry, can be ignored in our current
>> implementation (it is specific to the caching behavior of the mips
>> driver).
>>
>> From what I read in b43_hf_write, writing to HOSTFHI can be achieved
>> by left-shifting by 32 (16 for HOSTFMI).
>>
>> Is the problem that we write all 3 hostflags registers here?
>>
>> (BTW are there any other known host flags? If there are, maybe we
>> should #define them.)
>>
>
> My point is that update_mhf does not write to actual hardware, as far
> as I understand the code. Larry, can you please explain that part of the
> specs?
>

>From 802.11/Mhf:
"If core->clk is not zero AND band->mhfs[idx] is not equal to tmp:
   1. Write band->mhfs[idx] to Shared Memory Address addr[idx]"

This looks to me like it does indeed write to SHM, though the actual
mhf() tries to avoid writing to SHM if possible, while b43_hf_write
doesn't perform this optimization. (We don't have a band->mhfs, nor a
bandstate[] array.)

-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

^ permalink raw reply

* Re: [PATCH RESEND] b43: implement baseband init for LP-PHY <= rev1
From: Michael Buesch @ 2009-08-03 20:38 UTC (permalink / raw)
  To: Gábor Stefanik; +Cc: bcm43xx-dev, linux-wireless, Larry Finger
In-Reply-To: <69e28c910908030655g4ea70567y30ca2e68a77b872b@mail.gmail.com>

On Monday 03 August 2009 15:55:29 Gábor Stefanik wrote:
> On Mon, Aug 3, 2009 at 11:15 AM, Michael Buesch<mb@bu3sch.de> wrote:
> > On Monday 03 August 2009 11:13:37 Michael Buesch wrote:
> >> On Monday 03 August 2009 00:18:22 Gábor Stefanik wrote:
> >> > Implement baseband init for rev.0 and rev.1 LP PHYs. Convert
> >> > boardflags_hi values to defines.
> >> > Implement b43_phy_copy for easier copying between registers, as needed
> >> > by LP-PHY init.
> >>
> >> > +   if (bus->sprom.boardflags_hi&  B43_BFH_FEM_BT)&&
> >> > +      (bus->chip_id == 0x5354)&&
> >> > +      (bus->chip_package == SSB_CHIPPACK_BCM4712S)) {
> >> > +           b43_phy_set(dev, B43_LPPHY_CRSGAIN_CTL, 0x0006);
> >> > +           b43_phy_write(dev, B43_LPPHY_GPIO_SELECT, 0x0005);
> >> > +           b43_phy_write(dev, B43_LPPHY_GPIO_OUTEN, 0xFFFF);
> >> > +           b43_hf_write(dev, b43_hf_read | 0x0800ULL<<  32);
> >> > +   }
> >>
> >> The HF write is wrong. Read the specification:
> >> http://bcm-v4.sipsolutions.net/802.11/Mhf
> >>
> >> Patch otherwise looks ok.
> >
> > Sorry, I replied to the wrong mail. But this does also apply to V2 patch.
> >
> > --
> > Greetings, Michael.
> >
> 
> In V2, this line is as follows (b43_hf_read corrected):
> 
> b43_hf_write(dev, b43_hf_read(dev) | 0x0800ULL << 32)
> 
> The command in the specs is this:
> 
> mhf(2, 0x800, 0x800, 1)
> 
> 2 means B43_SHM_SH_HOSTFHI, 0x800 is the bit to set, and 1 is
> allbands, which, per Larry, can be ignored in our current
> implementation (it is specific to the caching behavior of the mips
> driver).
> 
> From what I read in b43_hf_write, writing to HOSTFHI can be achieved
> by left-shifting by 32 (16 for HOSTFMI).
> 
> Is the problem that we write all 3 hostflags registers here?
> 
> (BTW are there any other known host flags? If there are, maybe we
> should #define them.)
> 

My point is that update_mhf does not write to actual hardware, as far
as I understand the code. Larry, can you please explain that part of the
specs?

-- 
Greetings, Michael.

^ permalink raw reply

* Re: [PATCH 0/5] various mwl8k bugfixes
From: Luis R. Rodriguez @ 2009-08-03 20:29 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: linville, linux-wireless, nico
In-Reply-To: <20090803195816.GG18639@mail.wantstofly.org>

On Mon, Aug 3, 2009 at 12:58 PM, Lennert
Buytenhek<buytenh@wantstofly.org> wrote:
> This patch series fixes a couple of potential crashes and hangs in
> mwl8k, and some other misbehaviour.  They are against current linus
> tree, which is 2.6.31-rc5 plus some.  Please consider applying.

BTW mind adding a MAINTAINERS entry for this driver?

  Luis

^ permalink raw reply

* Re: [ath9k-devel] [PATCH 08/24] ath9k: pass only one argument to hw attach
From: Luis R. Rodriguez @ 2009-08-03 20:28 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: ath9k-devel, linux-wireless
In-Reply-To: <1249329503.5652.9.camel@mj>

On Mon, Aug 3, 2009 at 12:58 PM, Pavel Roskin<proski@gnu.org> wrote:
> On Mon, 2009-08-03 at 12:33 -0700, Luis R. Rodriguez wrote:
>> The softc is cached and set within the ath_hw struct.
>
> That's not meant to criticize this particular patch, but what's the
> point in distinguishing sc from ah these days?  I believe "ah" used to
> refer to the closed part of the sc structure that was only touched by
> Atheros HAL, hence the name.
>
> Since there is no HAL anymore, ah should disappear.

I started looking to do this but stopped for a few reasons.

1) It seems softc still serves some good purpose to us:
   a) Rate control stuff
   b) Place holder for timers, spin_locks, etc
   c) Configuration knobs not yet available on upper layers (tx/rx
chainmask is one, for example)
2) ath9k virtual wiphy stuff

Rate control is one chapter in itself, but the general idea is to get
proper HT support added to mac80211 rate control API and to one rate
control algorithm, say minstrel. To really accomplish this we should
strive to allow users to select between the private driver rate
control algorithm or minstrel on ath9k.

I don't see a point to move timers/spinlocks to hw related structs, at
least yet.

We then should see what knobs we can make generic or not.

Virtual wiphy is very specific to ath9k so far, some serious work is
required to see if we can move some of this up later.

> As the first step, ah should be allocated as part of sc.  Then ah and sc
> should stop pointing to each other.  Instead, macros based on offsetof
> should be used.  Then ah should be dissolved and replaced with sc
> throughout the code.

That sounds reasonable.

> That's probably a good task for an aspiring kernel hacker, as it
> requires little specialized knowledge.

Patches welcomed.

  Luis

^ permalink raw reply

* Re: [Bug #13846] Possible regression in rt61pci driver
From: Ivo van Doorn @ 2009-08-03 20:17 UTC (permalink / raw)
  To: chris2553
  Cc: Rafael J. Wysocki, Linux Kernel Mailing List, Kernel Testers List,
	linux-wireless
In-Reply-To: <200908031931.27427.chris2553@googlemail.com>

Hi,

> On Sunday 02 August 2009, Rafael J. Wysocki wrote:
> > This message has been generated automatically as a part of a report
> > of recent regressions.
> >
> > The following bug entry is on the current list of known regressions
> > from 2.6.30.  Please verify if it still should be listed and let me know
> > (either way).
> >
> 
> The folks on the wireless project have concluded that the problem I reported is down to a hardware 
> problem when power saving is switched on on for my Belkin cardbus wireless adapter, so now I simply 
> turn power-saving off when wlan0 comes up. I did, however, ask whether anyone was going to fix the 
> fact that once power-saving turns the LEDs off, they never come back on again, but I haven't had an 
> answer. Is that a regression? I guess the answer is no, because power saving in the rt61pci driver 
> is feature that is new to 2.6.31. Should it be fixed? I think the answer is yes, but being unable 
> to do it myself, I probably don't have a vote :-)

Can't recall this issue was ever reported, but that might just be me having overlooked some emails
or have completely forgotten all about it. But here is a test patch to see if this helps in the issue,
it is not really correct for upstream, but if it works I can see if there is a better solution.

Thanks,

Ivo
---
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 3845316..6fe70b1 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -196,6 +196,12 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
 	 */
 	rt2x00dev->ops->lib->config(rt2x00dev, &libconf, ieee80211_flags);
 
+	if (ieee80211_flags & IEEE80211_CONF_CHANGE_PS) {
+		rt2x00led_led_activity(rt2x00dev, !(conf->flags & IEEE80211_CONF_PS));
+		rt2x00leds_led_assoc(rt2x00dev, !(conf->flags & IEEE80211_CONF_PS));
+		rt2x00leds_led_radio(rt2x00dev, !(conf->flags & IEEE80211_CONF_PS));
+	}
+
 	/*
 	 * Some configuration changes affect the link quality
 	 * which means we need to reset the link tuner.

^ permalink raw reply related

* Re: [PATCH 4/5] mwl8k: prevent crash in ->configure_filter() if no interface was added
From: Johannes Berg @ 2009-08-03 20:03 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: linville, linux-wireless, nico
In-Reply-To: <20090803195857.GK18639@mail.wantstofly.org>

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

On Mon, 2009-08-03 at 21:58 +0200, Lennert Buytenhek wrote:

>  	if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
>  		if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
>  			rc = mwl8k_cmd_set_pre_scan(hw);
>  		else {
> -			mv_vif = MWL8K_VIF(priv->vif);
> -			rc = mwl8k_cmd_set_post_scan(hw, mv_vif->bssid);

Btw, there are pre- and post-scan hooks now.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [PATCH] ipw2x00: Write outside array bounds
From: John W. Linville @ 2009-08-03 19:51 UTC (permalink / raw)
  To: Zhu Yi
  Cc: Roel Kluin, linux-wireless@vger.kernel.org,
	ipw2100-devel@lists.sourceforge.net, Andrew Morton
In-Reply-To: <1248660620.3747.102.camel@debian>

On Mon, Jul 27, 2009 at 10:10:20AM +0800, Zhu Yi wrote:
> On Sun, 2009-07-26 at 05:48 +0800, Roel Kluin wrote:
> > channel_index loops up to IPW_SCAN_CHANNELS, but is used after being
> > incremented. This might be able to access 1 past the end of the array
> > 
> > Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> 
> Thanks. Do you think below patch is better?

Didn't see an answer here...which patch do we want?

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

^ permalink raw reply

* [PATCH 5/5] mwl8k: prevent module unload hang
From: Lennert Buytenhek @ 2009-08-03 19:59 UTC (permalink / raw)
  To: linville, linux-wireless; +Cc: nico

We need to unregister our ieee80211_hw before resetting the chip, as
the former causes firmware commands to be issued which will time out
once the chip has been reset.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
---
 drivers/net/wireless/mwl8k.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 4890f8f..4fc1271 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -3743,6 +3743,8 @@ static void __devexit mwl8k_remove(struct pci_dev *pdev)
 
 	ieee80211_stop_queues(hw);
 
+	ieee80211_unregister_hw(hw);
+
 	/* Remove tx reclaim tasklet */
 	tasklet_kill(&priv->tx_reclaim_task);
 
@@ -3756,8 +3758,6 @@ static void __devexit mwl8k_remove(struct pci_dev *pdev)
 	for (i = 0; i < MWL8K_TX_QUEUES; i++)
 		mwl8k_txq_reclaim(hw, i, 1);
 
-	ieee80211_unregister_hw(hw);
-
 	for (i = 0; i < MWL8K_TX_QUEUES; i++)
 		mwl8k_txq_deinit(hw, i);
 
-- 
1.5.6.4

^ permalink raw reply related

* [PATCH 4/5] mwl8k: prevent crash in ->configure_filter() if no interface was added
From: Lennert Buytenhek @ 2009-08-03 19:58 UTC (permalink / raw)
  To: linville, linux-wireless; +Cc: nico

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
---
 drivers/net/wireless/mwl8k.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index a92752e..4890f8f 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -261,7 +261,7 @@ struct mwl8k_vif {
 	 */
 };
 
-#define MWL8K_VIF(_vif) (struct mwl8k_vif *)(&((_vif)->drv_priv))
+#define MWL8K_VIF(_vif) ((struct mwl8k_vif *)&((_vif)->drv_priv))
 
 static const struct ieee80211_channel mwl8k_channels[] = {
 	{ .center_freq = 2412, .hw_value = 1, },
@@ -3228,15 +3228,19 @@ static int mwl8k_configure_filter_wt(struct work_struct *wt)
 	struct dev_addr_list *mclist = worker->mclist;
 
 	struct mwl8k_priv *priv = hw->priv;
-	struct mwl8k_vif *mv_vif;
 	int rc = 0;
 
 	if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
 		if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
 			rc = mwl8k_cmd_set_pre_scan(hw);
 		else {
-			mv_vif = MWL8K_VIF(priv->vif);
-			rc = mwl8k_cmd_set_post_scan(hw, mv_vif->bssid);
+			u8 *bssid;
+
+			bssid = "\x00\x00\x00\x00\x00\x00";
+			if (priv->vif != NULL)
+				bssid = MWL8K_VIF(priv->vif)->bssid;
+
+			rc = mwl8k_cmd_set_post_scan(hw, bssid);
 		}
 	}
 
-- 
1.5.6.4

^ permalink raw reply related

* [PATCH 3/5] mwl8k: call pci_unmap_single() before accessing command structure again
From: Lennert Buytenhek @ 2009-08-03 19:58 UTC (permalink / raw)
  To: linville, linux-wireless; +Cc: nico

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
---
 drivers/net/wireless/mwl8k.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index c211495..a92752e 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1593,6 +1593,9 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
 	timeout = wait_for_completion_timeout(&cmd_wait,
 				msecs_to_jiffies(MWL8K_CMD_TIMEOUT_MS));
 
+	pci_unmap_single(priv->pdev, dma_addr, dma_size,
+					PCI_DMA_BIDIRECTIONAL);
+
 	result = &cmd->result;
 	if (!timeout) {
 		spin_lock_irq(&priv->fw_lock);
@@ -1612,8 +1615,6 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
 			       *result);
 	}
 
-	pci_unmap_single(priv->pdev, dma_addr, dma_size,
-					PCI_DMA_BIDIRECTIONAL);
 	return rc;
 }
 
-- 
1.5.6.4

^ permalink raw reply related

* [PATCH 2/5] mwl8k: add various missing GET_HW_SPEC endian conversions
From: Lennert Buytenhek @ 2009-08-03 19:58 UTC (permalink / raw)
  To: linville, linux-wireless; +Cc: nico

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
---
 drivers/net/wireless/mwl8k.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index f437fab..c211495 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1656,18 +1656,18 @@ static int mwl8k_cmd_get_hw_spec(struct ieee80211_hw *hw)
 	memset(cmd->perm_addr, 0xff, sizeof(cmd->perm_addr));
 	cmd->ps_cookie = cpu_to_le32(priv->cookie_dma);
 	cmd->rx_queue_ptr = cpu_to_le32(priv->rxq[0].rx_desc_dma);
-	cmd->num_tx_queues = MWL8K_TX_QUEUES;
+	cmd->num_tx_queues = cpu_to_le32(MWL8K_TX_QUEUES);
 	for (i = 0; i < MWL8K_TX_QUEUES; i++)
 		cmd->tx_queue_ptrs[i] = cpu_to_le32(priv->txq[i].tx_desc_dma);
-	cmd->num_tx_desc_per_queue = MWL8K_TX_DESCS;
-	cmd->total_rx_desc = MWL8K_RX_DESCS;
+	cmd->num_tx_desc_per_queue = cpu_to_le32(MWL8K_TX_DESCS);
+	cmd->total_rx_desc = cpu_to_le32(MWL8K_RX_DESCS);
 
 	rc = mwl8k_post_cmd(hw, &cmd->header);
 
 	if (!rc) {
 		SET_IEEE80211_PERM_ADDR(hw, cmd->perm_addr);
 		priv->num_mcaddrs = le16_to_cpu(cmd->num_mcaddrs);
-		priv->fw_rev = cmd->fw_rev;
+		priv->fw_rev = le32_to_cpu(cmd->fw_rev);
 		priv->hw_rev = cmd->hw_rev;
 		priv->region_code = le16_to_cpu(cmd->region_code);
 	}
-- 
1.5.6.4

^ permalink raw reply related

* [PATCH 1/5] mwl8k: fix NULL pointer dereference on receive out-of-memory
From: Lennert Buytenhek @ 2009-08-03 19:58 UTC (permalink / raw)
  To: linville, linux-wireless; +Cc: nico

When we go into out-of-memory and fail to allocate skbuffs to
refill the receive ring with, rxq_process can end up running into
a receive ring entry that is marked as host-owned but doesn't have
an associated skbuff.  If this happens, we must break out of the
rx processing loop instead of trying to process the descriptor.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
---
 drivers/net/wireless/mwl8k.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index a9a9704..f437fab 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1012,6 +1012,8 @@ static int rxq_process(struct ieee80211_hw *hw, int index, int limit)
 		rmb();
 
 		skb = rxq->rx_skb[rxq->rx_head];
+		if (skb == NULL)
+			break;
 		rxq->rx_skb[rxq->rx_head] = NULL;
 
 		rxq->rx_head = (rxq->rx_head + 1) % MWL8K_RX_DESCS;
-- 
1.5.6.4

^ permalink raw reply related

* Re: [ath9k-devel] [PATCH 08/24] ath9k: pass only one argument to hw attach
From: Pavel Roskin @ 2009-08-03 19:58 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: ath9k-devel, linux-wireless
In-Reply-To: <1249328027-24865-1-git-send-email-lrodriguez@atheros.com>

On Mon, 2009-08-03 at 12:33 -0700, Luis R. Rodriguez wrote:
> The softc is cached and set within the ath_hw struct.

That's not meant to criticize this particular patch, but what's the
point in distinguishing sc from ah these days?  I believe "ah" used to
refer to the closed part of the sc structure that was only touched by
Atheros HAL, hence the name.

Since there is no HAL anymore, ah should disappear.

As the first step, ah should be allocated as part of sc.  Then ah and sc
should stop pointing to each other.  Instead, macros based on offsetof
should be used.  Then ah should be dissolved and replaced with sc
throughout the code.

That's probably a good task for an aspiring kernel hacker, as it
requires little specialized knowledge.

-- 
Regards,
Pavel Roskin

^ permalink raw reply

* [PATCH 0/5] various mwl8k bugfixes
From: Lennert Buytenhek @ 2009-08-03 19:58 UTC (permalink / raw)
  To: linville, linux-wireless; +Cc: nico

This patch series fixes a couple of potential crashes and hangs in
mwl8k, and some other misbehaviour.  They are against current linus
tree, which is 2.6.31-rc5 plus some.  Please consider applying.

^ permalink raw reply

* [PATCH 10/24] ath9k: rename ath9k_hw_newstate() to ath9k_hw_init_defaults()
From: Luis R. Rodriguez @ 2009-08-03 19:48 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez

This reflects better what we are actually doing there.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---

Resend try #2

 drivers/net/wireless/ath/ath9k/hw.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 4f3d7bf..6aee570 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -437,7 +437,7 @@ static void ath9k_hw_set_defaults(struct ath_hw *ah)
 		ah->config.serialize_regmode = SER_REG_MODE_AUTO;
 }
 
-static void ath9k_hw_newstate(struct ath_hw *ah)
+static void ath9k_hw_init_defaults(struct ath_hw *ah)
 {
 	ah->hw_version.magic = AR5416_MAGIC;
 	ah->regulatory.country_code = CTRY_DEFAULT;
@@ -654,7 +654,7 @@ int ath9k_hw_attach(struct ath_hw *ah)
 		goto bad;
 	}
 
-	ath9k_hw_newstate(ah);
+	ath9k_hw_init_defaults(ah);
 	ath9k_hw_set_defaults(ah);
 
 	if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
-- 
1.6.3.3


^ permalink raw reply related

* Re: [PATCH] iwlwifi: avoid memory leak in iwl_dbgfs_nvm_read
From: John W. Linville @ 2009-08-03 19:40 UTC (permalink / raw)
  To: reinette chatre; +Cc: linux-wireless@vger.kernel.org, Martin Ettl
In-Reply-To: <1249326492.30019.4277.camel@rc-desk>

On Mon, Aug 03, 2009 at 12:08:12PM -0700, reinette chatre wrote:
> On Mon, 2009-08-03 at 11:49 -0700, John W. Linville wrote:
> > Reported-by: Martin Ettl <ettl.martin@gmx.de>
> > Signed-off-by: John W. Linville <linville@tuxdriver.com>
> > ---
> >  drivers/net/wireless/iwlwifi/iwl-debugfs.c |    5 ++++-
> >  1 files changed, 4 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
> > index 11e08c0..6525e41 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
> > @@ -318,7 +318,8 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
> >  	ptr = priv->eeprom;
> >  	if (!ptr) {
> >  		IWL_ERR(priv, "Invalid EEPROM/OTP memory\n");
> > -		return -ENOMEM;
> > +		ret = -ENOMEM;
> > +		goto out;
> >  	}
> >  	pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n",
> >  			(priv->nvm_device_type == NVM_DEVICE_TYPE_OTP)
> > @@ -333,6 +334,8 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
> >  	}
> >  
> >  	ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
> > +
> > +out:
> >  	kfree(buf);
> >  	return ret;
> >  }
> 
> There was another patch also that was acked by Zhu Yi. See
> http://thread.gmane.org/gmane.linux.kernel.wireless.general/37032

Yes, I see that now -- perhaps Martin will take-up Julia's habit of
posting patches himself... :-)

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

^ permalink raw reply

* [PATCH 08/24] ath9k: pass only one argument to hw attach
From: Luis R. Rodriguez @ 2009-08-03 19:33 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez

The softc is cached and set within the ath_hw struct.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---

Resending, johill informs me this one didn't make it out.

 drivers/net/wireless/ath/ath9k/hw.c   |   12 ++++++------
 drivers/net/wireless/ath/ath9k/hw.h   |    2 +-
 drivers/net/wireless/ath/ath9k/main.c |    2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index d8ae289..301ef04 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -627,7 +627,7 @@ static bool ath9k_hw_devid_supported(u16 devid)
 	return false;
 }
 
-int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc)
+int ath9k_hw_attach(struct ath_hw *ah)
 {
 	int r;
 	u32 i, j;
@@ -641,13 +641,13 @@ int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc)
 	ath9k_hw_set_defaults(ah);
 
 	if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
-		DPRINTF(sc, ATH_DBG_FATAL, "Couldn't reset chip\n");
+		DPRINTF(ah->ah_sc, ATH_DBG_FATAL, "Couldn't reset chip\n");
 		r = -EIO;
 		goto bad;
 	}
 
 	if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) {
-		DPRINTF(sc, ATH_DBG_FATAL, "Couldn't wakeup chip\n");
+		DPRINTF(ah->ah_sc, ATH_DBG_FATAL, "Couldn't wakeup chip\n");
 		r = -EIO;
 		goto bad;
 	}
@@ -663,7 +663,7 @@ int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc)
 		}
 	}
 
-	DPRINTF(sc, ATH_DBG_RESET, "serialize_regmode is %d\n",
+	DPRINTF(ah->ah_sc, ATH_DBG_RESET, "serialize_regmode is %d\n",
 		ah->config.serialize_regmode);
 
 	switch (ah->hw_version.macVersion) {
@@ -676,7 +676,7 @@ int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc)
 	case AR_SREV_VERSION_9287:
 		break;
 	default:
-		DPRINTF(sc, ATH_DBG_FATAL,
+		DPRINTF(ah->ah_sc, ATH_DBG_FATAL,
 			"Mac Chip Rev 0x%02x.%x is not supported by "
 			"this driver\n", ah->hw_version.macVersion,
 			ah->hw_version.macRev);
@@ -945,7 +945,7 @@ int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc)
 
 	r = ath9k_hw_init_macaddr(ah);
 	if (r) {
-		DPRINTF(sc, ATH_DBG_FATAL,
+		DPRINTF(ah->ah_sc, ATH_DBG_FATAL,
 			"Failed to initialize MAC address\n");
 		goto bad;
 	}
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index c769dd6..35cf9f8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -544,7 +544,7 @@ struct ath_hw {
 /* Attach, Detach, Reset */
 const char *ath9k_hw_probe(u16 vendorid, u16 devid);
 void ath9k_hw_detach(struct ath_hw *ah);
-int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc);
+int ath9k_hw_attach(struct ath_hw *ah);
 void ath9k_hw_rfdetach(struct ath_hw *ah);
 int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
 		   bool bChannelChange);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 605d328..6242950 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1334,7 +1334,7 @@ static int ath_init(u16 devid, struct ath_softc *sc)
 	ah->hw_version.devid = devid;
 	sc->sc_ah = ah;
 
-	r = ath9k_hw_attach(ah, sc);
+	r = ath9k_hw_attach(ah);
 	if (r) {
 		DPRINTF(sc, ATH_DBG_FATAL,
 			"Unable to attach hardware; "
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH 24/24] ath9k: remove spurious check for channel on keycache reset
From: Luis R. Rodriguez @ 2009-08-03 19:24 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez
In-Reply-To: <1249327496-24629-1-git-send-email-lrodriguez@atheros.com>

ath9k_hw_keyreset() has a spurious check for ah->curchan..
remove it.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/hw.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 0871529..0d60b35 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2496,9 +2496,6 @@ bool ath9k_hw_keyreset(struct ath_hw *ah, u16 entry)
 
 	}
 
-	if (ah->curchan == NULL)
-		return true;
-
 	return true;
 }
 
-- 
1.6.3.3


^ 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