Skip to contentSkip to conversation

pull request: wireless-2.6 2010-10-26

PATCH John W. Linville 2 participants 2 messages Oct 26, 2010

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

Dave,

Here are some fixes intended for 2.6.37. Highlights are some carl9170 fixes, a fix/cleanup for the earlier wl1251 move, various ath9k fixes, a mac80211 fix relating to IBSS station expiry and a cfg80211 fix related to processing country IEs. One of the ath9k patches looks big, but it is just changing a table of register initialization values in order to correct a number of issues. The associated changelogs are reasonably descriptive of the issues involved.

Also included is a patch from Tejun as part of his work to remove flush_scheduled_work(). I noticed you already included a similar patch from Tejun, so I figured this was acceptable as well.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit 43a951e9994fd218ab4e641f94a2fc53556c3675:

ipv4: add __rcu annotations to ip_ra_chain (2010-10-25 14:18:28 -0700)

are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master

Ben Greear (2):

      ath9k: Properly initialize ath_common->cc_lock.
      ath5k: Properly initialize ath_common->cc_lock.

Christian Lamparter (4):
carl9170: fix async command buffer leak
mac80211: don't sanitize invalid rates
carl9170: fix memory leak issue in async cmd macro wrappers
carl9170: fix scheduling while atomic

Don Fry (1):
iwlwifi: quiet a noisy printk

Felix Fietkau (3):
ath9k: fix crash in ath_update_survey_stats
ath9k: fix handling of rate control probe frames
ath9k: resume aggregation immediately after a hardware reset

Grazvydas Ignotas (1):
wl1251: fix module names

Luis R. Rodriguez (2):
cfg80211: fix regression on processing country IEs
ath9k_hw: Fix TX carrier leakage for IEEE compliance on AR9003 2.2

Rafał Miłecki (1):
b43: N-PHY: fix infinite-loop-typo

Rajkumar Manoharan (1):
mac80211: Fix ibss station got expired immediately

Senthil Balasubramanian (1):
ath9k_hw: Fix divide by zero cases in paprd.

Tejun Heo (1):
mac80211: cancel restart_work explicitly instead of depending on flush_scheduled_work()

 drivers/net/wireless/ath/ath5k/base.c              |    1 +
 .../net/wireless/ath/ath9k/ar9003_2p2_initvals.h   |  191 ++++++++++++++------
 drivers/net/wireless/ath/ath9k/ar9003_paprd.c      |   14 +-
 drivers/net/wireless/ath/ath9k/beacon.c            |    2 +-
 drivers/net/wireless/ath/ath9k/init.c              |    1 +
 drivers/net/wireless/ath/ath9k/main.c              |    7 +-
 drivers/net/wireless/ath/ath9k/xmit.c              |    8 +-
 drivers/net/wireless/ath/carl9170/cmd.h            |   51 +++---
 drivers/net/wireless/ath/carl9170/main.c           |    2 +-
 drivers/net/wireless/ath/carl9170/usb.c            |   25 ++-
 drivers/net/wireless/b43/phy_n.c                   |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c          |    3 +-
 drivers/net/wireless/wl1251/Makefile               |    8 +-
 net/mac80211/ibss.c                                |    1 +
 net/mac80211/main.c                                |    8 +-
 net/mac80211/rate.c                                |    3 +
 net/wireless/reg.c                                 |    2 +-
 17 files changed, 221 insertions(+), 108 deletions(-)
drivers/net/wireless/ath/ath5k/base.c +1 -0
index f1ae75d..8251946 100644
@@ -3580,6 +3580,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
 	common->ah = sc->ah;
 	common->hw = hw;
 	common->cachelsz = csz << 2; /* convert to bytes */
+	spin_lock_init(&common->cc_lock);
 
 	/* Initialize device */
 	ret = ath5k_hw_attach(sc);
drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h +135 -56

354 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/ar9003_paprd.c +9 -5
index 7c38229..716db41 100644
@@ -347,6 +347,10 @@ static bool create_pa_curve(u32 *data_L, u32 *data_U, u32 *pa_table, u16 *gain)
 	    (((Y[6] - Y[3]) * 1 << scale_factor) +
 	     (x_est[6] - x_est[3])) / (x_est[6] - x_est[3]);
 
+	/* prevent division by zero */
+	if (G_fxp == 0)
+		return false;
+
 	Y_intercept =
 	    (G_fxp * (x_est[0] - x_est[3]) +
 	     (1 << scale_factor)) / (1 << scale_factor) + Y[3];
@@ -356,14 +360,12 @@ static bool create_pa_curve(u32 *data_L, u32 *data_U, u32 *pa_table, u16 *gain)
 
 	for (i = 0; i <= 3; i++) {
 		y_est[i] = i * 32;
-
-		/* prevent division by zero */
-		if (G_fxp == 0)
-			return false;
-
 		x_est[i] = ((y_est[i] * 1 << scale_factor) + G_fxp) / G_fxp;
 	}
 
+	if (y_est[max_index] == 0)
+		return false;
+
 	x_est_fxp1_nonlin =
 	    x_est[max_index] - ((1 << scale_factor) * y_est[max_index] +
 				G_fxp) / G_fxp;
@@ -457,6 +459,8 @@ static bool create_pa_curve(u32 *data_L, u32 *data_U, u32 *pa_table, u16 *gain)
 
 	Q_scale_B = find_proper_scale(find_expn(abs(scale_B)), 10);
 	scale_B = scale_B / (1 << Q_scale_B);
+	if (scale_B == 0)
+		return false;
 	Q_beta = find_proper_scale(find_expn(abs(beta_raw)), 10);
 	Q_alpha = find_proper_scale(find_expn(abs(alpha_raw)), 10);
 	beta_raw = beta_raw / (1 << Q_beta);
drivers/net/wireless/ath/ath9k/beacon.c +1 -1
index 4ed010d..19891e7 100644
@@ -370,7 +370,7 @@ void ath_beacon_tasklet(unsigned long data)
 			ath_print(common, ATH_DBG_BSTUCK,
 				  "beacon is officially stuck\n");
 			sc->sc_flags |= SC_OP_TSF_RESET;
-			ath_reset(sc, false);
+			ath_reset(sc, true);
 		}
 
 		return;
drivers/net/wireless/ath/ath9k/init.c +1 -0
index bc6c4df..95b41db 100644
@@ -577,6 +577,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
 	common->hw = sc->hw;
 	common->priv = sc;
 	common->debug_mask = ath9k_debug;
+	spin_lock_init(&common->cc_lock);
 
 	spin_lock_init(&sc->wiphy_lock);
 	spin_lock_init(&sc->sc_resetlock);
drivers/net/wireless/ath/ath9k/main.c +5 -2
index 3ff0e47..c6ec800 100644
@@ -182,6 +182,9 @@ static void ath_update_survey_stats(struct ath_softc *sc)
 	struct ath_cycle_counters *cc = &common->cc_survey;
 	unsigned int div = common->clockrate * 1000;
 
+	if (!ah->curchan)
+		return;
+
 	if (ah->power_mode == ATH9K_PM_AWAKE)
 		ath_hw_cycle_counters_update(common);
 
@@ -577,7 +580,7 @@ void ath_hw_check(struct work_struct *work)
 
 		msleep(1);
 	}
-	ath_reset(sc, false);
+	ath_reset(sc, true);
 
 out:
 	ath9k_ps_restore(sc);
@@ -595,7 +598,7 @@ void ath9k_tasklet(unsigned long data)
 	ath9k_ps_wakeup(sc);
 
 	if (status & ATH9K_INT_FATAL) {
-		ath_reset(sc, false);
+		ath_reset(sc, true);
 		ath9k_ps_restore(sc);
 		return;
 	}
drivers/net/wireless/ath/ath9k/xmit.c +7 -1
index d077186..30ef2df 100644
@@ -673,6 +673,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
 	u16 aggr_limit = 0, al = 0, bpad = 0,
 		al_delta, h_baw = tid->baw_size / 2;
 	enum ATH_AGGR_STATUS status = ATH_AGGR_DONE;
+	struct ieee80211_tx_info *tx_info;
 
 	bf_first = list_first_entry(&tid->buf_q, struct ath_buf, list);
 
@@ -699,6 +700,11 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
 			break;
 		}
 
+		tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
+		if (nframes && ((tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) ||
+			!(tx_info->control.rates[0].flags & IEEE80211_TX_RC_MCS)))
+			break;
+
 		/* do not exceed subframe limit */
 		if (nframes >= min((int)h_baw, ATH_AMPDU_SUBFRAME_DEFAULT)) {
 			status = ATH_AGGR_LIMITED;
@@ -2157,7 +2163,7 @@ static void ath_tx_complete_poll_work(struct work_struct *work)
 		ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_RESET,
 			  "tx hung, resetting the chip\n");
 		ath9k_ps_wakeup(sc);
-		ath_reset(sc, false);
+		ath_reset(sc, true);
 		ath9k_ps_restore(sc);
 	}
 
drivers/net/wireless/ath/carl9170/cmd.h +28 -23

74 lines not on this page · raw message

drivers/net/wireless/ath/carl9170/main.c +1 -1
index 3cc99f3..980ae70 100644
@@ -639,8 +639,8 @@ init:
 		if (err)
 			goto unlock;
 	} else {
-		err = carl9170_mod_virtual_mac(ar, vif_id, vif->addr);
 		rcu_read_unlock();
+		err = carl9170_mod_virtual_mac(ar, vif_id, vif->addr);
 
 		if (err)
 			goto unlock;
drivers/net/wireless/ath/carl9170/usb.c +19 -6
index c7f6193..d8607f4 100644
@@ -591,16 +591,23 @@ int __carl9170_exec_cmd(struct ar9170 *ar, struct carl9170_cmd *cmd,
 			const bool free_buf)
 {
 	struct urb *urb;
+	int err = 0;
 
-	if (!IS_INITIALIZED(ar))
-		return -EPERM;
+	if (!IS_INITIALIZED(ar)) {
+		err = -EPERM;
+		goto err_free;
+	}
 
-	if (WARN_ON(cmd->hdr.len > CARL9170_MAX_CMD_LEN - 4))
-		return -EINVAL;
+	if (WARN_ON(cmd->hdr.len > CARL9170_MAX_CMD_LEN - 4)) {
+		err = -EINVAL;
+		goto err_free;
+	}
 
 	urb = usb_alloc_urb(0, GFP_ATOMIC);
-	if (!urb)
-		return -ENOMEM;
+	if (!urb) {
+		err = -ENOMEM;
+		goto err_free;
+	}
 
 	usb_fill_int_urb(urb, ar->udev, usb_sndintpipe(ar->udev,
 		AR9170_USB_EP_CMD), cmd, cmd->hdr.len + 4,
@@ -613,6 +620,12 @@ int __carl9170_exec_cmd(struct ar9170 *ar, struct carl9170_cmd *cmd,
 	usb_free_urb(urb);
 
 	return carl9170_usb_submit_cmd_urb(ar);
+
+err_free:
+	if (free_buf)
+		kfree(cmd);
+
+	return err;
 }
 
 int carl9170_exec_cmd(struct ar9170 *ar, const enum carl9170_cmd_oids cmd,
drivers/net/wireless/b43/phy_n.c +1 -1
index dfec549..e0f2d12 100644
@@ -2964,7 +2964,7 @@ static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,
 					(2 - i));
 		}
 
-		for (j = 0; i < 4; j++) {
+		for (j = 0; j < 4; j++) {
 			if (j < 3) {
 				cur_lna = lna[j];
 				cur_hpf1 = hpf1[j];
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +2 -1
index db57aea..2b078a9 100644
@@ -1227,7 +1227,8 @@ static int iwlagn_tx_status_reply_compressed_ba(struct iwl_priv *priv,
 	struct ieee80211_tx_info *info;
 
 	if (unlikely(!agg->wait_for_ba))  {
-		IWL_ERR(priv, "Received BA when not expected\n");
+		if (unlikely(ba_resp->bitmap))
+			IWL_ERR(priv, "Received BA when not expected\n");
 		return -EINVAL;
 	}
 
drivers/net/wireless/wl1251/Makefile +5 -3
index 4fe2468..58b4f93 100644
@@ -1,6 +1,8 @@
 wl1251-objs		= main.o event.o tx.o rx.o ps.o cmd.o \
 			  acx.o boot.o init.o debugfs.o io.o
+wl1251_spi-objs		+= spi.o
+wl1251_sdio-objs	+= sdio.o
 
-obj-$(CONFIG_WL1251)	+= wl1251.o
-obj-$(CONFIG_WL1251_SPI)	+= spi.o
-obj-$(CONFIG_WL1251_SDIO)	+= sdio.o
+obj-$(CONFIG_WL1251)		+= wl1251.o
+obj-$(CONFIG_WL1251_SPI)	+= wl1251_spi.o
+obj-$(CONFIG_WL1251_SDIO)	+= wl1251_sdio.o
net/mac80211/ibss.c +1 -0
index ff60c02..239c483 100644
@@ -456,6 +456,7 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
 	if (!sta)
 		return NULL;
 
+	sta->last_rx = jiffies;
 	set_sta_flags(sta, WLAN_STA_AUTHORIZED);
 
 	/* make sure mandatory rates are always added */
net/mac80211/main.c +1 -7
index 22bc42b..6b322fa 100644
@@ -748,7 +748,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 		hw->queues = IEEE80211_MAX_QUEUES;
 
 	local->workqueue =
-		create_singlethread_workqueue(wiphy_name(local->hw.wiphy));
+		alloc_ordered_workqueue(wiphy_name(local->hw.wiphy), 0);
 	if (!local->workqueue) {
 		result = -ENOMEM;
 		goto fail_workqueue;
@@ -962,12 +962,6 @@ static void __exit ieee80211_exit(void)
 	rc80211_minstrel_ht_exit();
 	rc80211_minstrel_exit();
 
-	/*
-	 * For key todo, it'll be empty by now but the work
-	 * might still be scheduled.
-	 */
-	flush_scheduled_work();
-
 	if (mesh_allocated)
 		ieee80211s_stop();
 
net/mac80211/rate.c +3 -0
index 809cf23..33f7699 100644
@@ -329,6 +329,9 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
 		 * if needed.
 		 */
 		for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
+			/* Skip invalid rates */
+			if (info->control.rates[i].idx < 0)
+				break;
 			/* Rate masking supports only legacy rates for now */
 			if (info->control.rates[i].flags & IEEE80211_TX_RC_MCS)
 				continue;
net/wireless/reg.c +1 -1
index d14bbf9..4b9f891 100644
@@ -1167,7 +1167,7 @@ static int ignore_request(struct wiphy *wiphy,
 				return 0;
 			return -EALREADY;
 		}
-		return REG_INTERSECT;
+		return 0;
 	case NL80211_REGDOM_SET_BY_DRIVER:
 		if (last_request->initiator == NL80211_REGDOM_SET_BY_CORE) {
 			if (regdom_changes(pending_request->alpha2))
Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
maintainer
#1 lore raw

From: "John W. Linville" <[email protected]>
Date: Tue, 26 Oct 2010 14:15:16 -0400

Quoted 11 lines

Here are some fixes intended for 2.6.37. Highlights are some carl9170 fixes, a fix/cleanup for the earlier wl1251 move, various ath9k fixes, a mac80211 fix relating to IBSS station expiry and a cfg80211 fix related to processing country IEs. One of the ath9k patches looks big, but it is just changing a table of register initialization values in order to correct a number of issues. The associated changelogs are reasonably descriptive of the issues involved.

Also included is a patch from Tejun as part of his work to remove flush_scheduled_work(). I noticed you already included a similar patch from Tejun, so I figured this was acceptable as well.

Pulled, thanks John.