Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 20/23] iwlwifi: queue user-initiated scan when doing internal scan
From: Reinette Chatre @ 2010-06-06  6:56 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1275807398-18184-1-git-send-email-reinette.chatre@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

The internal scanning created a problem where
when userspace tries to scan, the scan gets
rejected. Instead of doing that, queue up the
user-initiated scan when doing an internal
scan.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-core.c |    5 ++++
 drivers/net/wireless/iwlwifi/iwl-dev.h  |    1 +
 drivers/net/wireless/iwlwifi/iwl-scan.c |   36 +++++++++++++++++++++---------
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 00b2cdd..6cd8d20 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1960,6 +1960,11 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
 	}
 	if (priv->vif == vif) {
 		priv->vif = NULL;
+		if (priv->scan_vif == vif) {
+			ieee80211_scan_completed(priv->hw, true);
+			priv->scan_vif = NULL;
+			priv->scan_request = NULL;
+		}
 		memset(priv->bssid, 0, ETH_ALEN);
 	}
 	mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index de326a6..45ceb27 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1130,6 +1130,7 @@ struct iwl_priv {
 	void *scan_cmd;
 	enum ieee80211_band scan_band;
 	struct cfg80211_scan_request *scan_request;
+	struct ieee80211_vif *scan_vif;
 	bool is_internal_short_scan;
 	u8 scan_tx_ant[IEEE80211_NUM_BANDS];
 	u8 mgmt_tx_ant;
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 0f9cbc2..b8bcd48 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -333,7 +333,8 @@ int iwl_mac_hw_scan(struct ieee80211_hw *hw,
 		goto out_unlock;
 	}
 
-	if (test_bit(STATUS_SCANNING, &priv->status)) {
+	if (test_bit(STATUS_SCANNING, &priv->status) &&
+	    !priv->is_internal_short_scan) {
 		IWL_DEBUG_SCAN(priv, "Scan already in progress.\n");
 		ret = -EAGAIN;
 		goto out_unlock;
@@ -348,8 +349,16 @@ int iwl_mac_hw_scan(struct ieee80211_hw *hw,
 	/* mac80211 will only ask for one band at a time */
 	priv->scan_band = req->channels[0]->band;
 	priv->scan_request = req;
+	priv->scan_vif = vif;
 
-	ret = iwl_scan_initiate(priv, vif);
+	/*
+	 * If an internal scan is in progress, just set
+	 * up the scan_request as per above.
+	 */
+	if (priv->is_internal_short_scan)
+		ret = 0;
+	else
+		ret = iwl_scan_initiate(priv, vif);
 
 	IWL_DEBUG_MAC80211(priv, "leave\n");
 
@@ -513,7 +522,21 @@ void iwl_bg_scan_completed(struct work_struct *work)
 		priv->is_internal_short_scan = false;
 		IWL_DEBUG_SCAN(priv, "internal short scan completed\n");
 		internal = true;
+	} else {
+		priv->scan_request = NULL;
+		priv->scan_vif = NULL;
 	}
+
+	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+		goto out;
+
+	if (internal && priv->scan_request)
+		iwl_scan_initiate(priv, priv->scan_vif);
+
+	/* Since setting the TXPOWER may have been deferred while
+	 * performing the scan, fire one off */
+	iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
+ out:
 	mutex_unlock(&priv->mutex);
 
 	/*
@@ -523,15 +546,6 @@ void iwl_bg_scan_completed(struct work_struct *work)
 	 */
 	if (!internal)
 		ieee80211_scan_completed(priv->hw, false);
-
-	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
-		return;
-
-	/* Since setting the TXPOWER may have been deferred while
-	 * performing the scan, fire one off */
-	mutex_lock(&priv->mutex);
-	iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
-	mutex_unlock(&priv->mutex);
 }
 EXPORT_SYMBOL(iwl_bg_scan_completed);
 
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 18/23] iwlwifi: do not use huge command buffer for channel switch
From: Reinette Chatre @ 2010-06-06  6:56 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre
In-Reply-To: <1275807398-18184-1-git-send-email-reinette.chatre@intel.com>

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

Channel switch host command do not need to allocate huge command buffer
since its size is already included in the iwl_device_cmd structure.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-5000.c |    2 +-
 drivers/net/wireless/iwlwifi/iwl-6000.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 19bb5b8..32710a8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -285,7 +285,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
 	struct iwl_host_cmd hcmd = {
 		.id = REPLY_CHANNEL_SWITCH,
 		.len = sizeof(cmd),
-		.flags = CMD_SIZE_HUGE,
+		.flags = CMD_SYNC,
 		.data = &cmd,
 	};
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 0775145..afdeec5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -253,7 +253,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
 	struct iwl_host_cmd hcmd = {
 		.id = REPLY_CHANNEL_SWITCH,
 		.len = sizeof(cmd),
-		.flags = CMD_SIZE_HUGE,
+		.flags = CMD_SYNC,
 		.data = &cmd,
 	};
 
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 21/23] iwlwifi: remove unused parameter
From: Reinette Chatre @ 2010-06-06  6:56 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre
In-Reply-To: <1275807398-18184-1-git-send-email-reinette.chatre@intel.com>

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

framecnt_to_us is not used, remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-dev.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 45ceb27..55bd2fa 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1361,7 +1361,6 @@ struct iwl_priv {
 	/* debugging info */
 	u32 debug_level; /* per device debugging will override global
 			    iwl_debug_level if set */
-	u32 framecnt_to_us;
 #endif /* CONFIG_IWLWIFI_DEBUG */
 #ifdef CONFIG_IWLWIFI_DEBUGFS
 	/* debugfs */
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 17/23] iwlwifi: reduce memory allocation
From: Reinette Chatre @ 2010-06-06  6:56 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1275807398-18184-1-git-send-email-reinette.chatre@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

Currently, the driver allocates up to 19 skb pointers
for each TFD, of which we have 256 per queue. This
means that for each TX queue, we allocate 19k/38k
(an order 4 or 5 allocation on 32/64 bit respectively)
just for each queue's "txb" array, which contains only
the SKB pointers.

However, due to the way we use these pointers only the
first one can ever be assigned. When the driver was
initially written, the idea was that it could be
passed multiple SKBs for each TFD and attach all
those to implement gather DMA. However, due to
constraints in the userspace API and lack of TCP/IP
level checksumming in the device, this is in fact not
possible. And even if it were, the SKBs would be
chained, and we wouldn't need to keep pointers to
each anyway.

Change this to only keep track of one SKB per TFD,
and thereby reduce memory consumption to just one
pointer per TFD, which is an order 0 allocation per
transmit queue.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-3945.c     |   25 +++++++++++++------------
 drivers/net/wireless/iwlwifi/iwl-4965.c     |    4 ++--
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c  |    4 ++--
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c   |   10 +++++-----
 drivers/net/wireless/iwlwifi/iwl-agn.c      |   18 +++++++++---------
 drivers/net/wireless/iwlwifi/iwl-dev.h      |    6 +++---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    2 +-
 7 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index fec05b5..658c614 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -279,8 +279,8 @@ static void iwl3945_tx_queue_reclaim(struct iwl_priv *priv,
 		q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
 
 		tx_info = &txq->txb[txq->q.read_ptr];
-		ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb[0]);
-		tx_info->skb[0] = NULL;
+		ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb);
+		tx_info->skb = NULL;
 		priv->cfg->ops->lib->txq_free_tfd(priv, txq);
 	}
 
@@ -315,7 +315,7 @@ static void iwl3945_rx_reply_tx(struct iwl_priv *priv,
 		return;
 	}
 
-	info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]);
+	info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb);
 	ieee80211_tx_info_clear_status(info);
 
 	/* Fill the MRR chain with some info about on-chip retransmissions */
@@ -702,19 +702,20 @@ void iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
 
 	/* unmap chunks if any */
 
-	for (i = 1; i < counter; i++) {
+	for (i = 1; i < counter; i++)
 		pci_unmap_single(dev, le32_to_cpu(tfd->tbs[i].addr),
 			 le32_to_cpu(tfd->tbs[i].len), PCI_DMA_TODEVICE);
-		if (txq->txb) {
-			struct sk_buff *skb;
 
-			skb = txq->txb[txq->q.read_ptr].skb[i - 1];
+	/* free SKB */
+	if (txq->txb) {
+		struct sk_buff *skb;
 
-			/* can be called from irqs-disabled context */
-			if (skb) {
-				dev_kfree_skb_any(skb);
-				txq->txb[txq->q.read_ptr].skb[i - 1] = NULL;
-			}
+		skb = txq->txb[txq->q.read_ptr].skb;
+
+		/* can be called from irqs-disabled context */
+		if (skb) {
+			dev_kfree_skb_any(skb);
+			txq->txb[txq->q.read_ptr].skb = NULL;
 		}
 	}
 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 1e4f1bc..a51c4b8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -1908,7 +1908,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
 		IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, StartIdx=%d idx=%d\n",
 				   agg->frame_count, agg->start_idx, idx);
 
-		info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
+		info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb);
 		info->status.rates[0].count = tx_resp->failure_frame + 1;
 		info->flags &= ~IEEE80211_TX_CTL_AMPDU;
 		info->flags |= iwl_tx_status_to_mac80211(status);
@@ -2074,7 +2074,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 		return;
 	}
 
-	info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]);
+	info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb);
 	memset(&info->status, 0, sizeof(info->status));
 
 	hdr = iwl_tx_queue_get_hdr(priv, txq_id, index);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 848cb3b..5bec72a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -77,7 +77,7 @@ static int iwlagn_tx_status_reply_tx(struct iwl_priv *priv,
 		IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, StartIdx=%d idx=%d\n",
 				   agg->frame_count, agg->start_idx, idx);
 
-		info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
+		info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb);
 		info->status.rates[0].count = tx_resp->failure_frame + 1;
 		info->flags &= ~IEEE80211_TX_CTL_AMPDU;
 		info->flags |= iwl_tx_status_to_mac80211(status);
@@ -194,7 +194,7 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv,
 		return;
 	}
 
-	info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]);
+	info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb);
 	memset(&info->status, 0, sizeof(info->status));
 
 	tid = (tx_resp->ra_tid & IWL50_TX_RES_TID_MSK) >> IWL50_TX_RES_TID_POS;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index eb0a6da..0037a52 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -638,7 +638,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
 
 	/* Set up driver data for this TFD */
 	memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info));
-	txq->txb[q->write_ptr].skb[0] = skb;
+	txq->txb[q->write_ptr].skb = skb;
 
 	/* Set up first empty entry in queue's array of Tx/cmd buffers */
 	out_cmd = txq->cmd[q->write_ptr];
@@ -1178,12 +1178,12 @@ int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
 	     q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
 
 		tx_info = &txq->txb[txq->q.read_ptr];
-		iwlagn_tx_status(priv, tx_info->skb[0]);
+		iwlagn_tx_status(priv, tx_info->skb);
 
-		hdr = (struct ieee80211_hdr *)tx_info->skb[0]->data;
+		hdr = (struct ieee80211_hdr *)tx_info->skb->data;
 		if (hdr && ieee80211_is_data_qos(hdr->frame_control))
 			nfreed++;
-		tx_info->skb[0] = NULL;
+		tx_info->skb = NULL;
 
 		if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl)
 			priv->cfg->ops->lib->txq_inval_byte_cnt_tbl(priv, txq);
@@ -1247,7 +1247,7 @@ static int iwlagn_tx_status_reply_compressed_ba(struct iwl_priv *priv,
 			agg->start_idx + i);
 	}
 
-	info = IEEE80211_SKB_CB(priv->txq[scd_flow].txb[agg->start_idx].skb[0]);
+	info = IEEE80211_SKB_CB(priv->txq[scd_flow].txb[agg->start_idx].skb);
 	memset(&info->status, 0, sizeof(info->status));
 	info->flags |= IEEE80211_TX_STAT_ACK;
 	info->flags |= IEEE80211_TX_STAT_AMPDU;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index a61d567..a0e995e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -479,20 +479,20 @@ void iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
 				PCI_DMA_BIDIRECTIONAL);
 
 	/* Unmap chunks, if any. */
-	for (i = 1; i < num_tbs; i++) {
+	for (i = 1; i < num_tbs; i++)
 		pci_unmap_single(dev, iwl_tfd_tb_get_addr(tfd, i),
 				iwl_tfd_tb_get_len(tfd, i), PCI_DMA_TODEVICE);
 
-		if (txq->txb) {
-			struct sk_buff *skb;
+	/* free SKB */
+	if (txq->txb) {
+		struct sk_buff *skb;
 
-			skb = txq->txb[txq->q.read_ptr].skb[i - 1];
+		skb = txq->txb[txq->q.read_ptr].skb;
 
-			/* can be called from irqs-disabled context */
-			if (skb) {
-				dev_kfree_skb_any(skb);
-				txq->txb[txq->q.read_ptr].skb[i - 1] = NULL;
-			}
+		/* can be called from irqs-disabled context */
+		if (skb) {
+			dev_kfree_skb_any(skb);
+			txq->txb[txq->q.read_ptr].skb = NULL;
 		}
 	}
 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 4abc24e..de326a6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -142,7 +142,7 @@ struct iwl_queue {
 
 /* One for each TFD */
 struct iwl_tx_info {
-	struct sk_buff *skb[IWL_NUM_OF_TBS - 1];
+	struct sk_buff *skb;
 };
 
 /**
@@ -1425,9 +1425,9 @@ static inline u32 iwl_get_debug_level(struct iwl_priv *priv)
 static inline struct ieee80211_hdr *iwl_tx_queue_get_hdr(struct iwl_priv *priv,
 							 int txq_id, int idx)
 {
-	if (priv->txq[txq_id].txb[idx].skb[0])
+	if (priv->txq[txq_id].txb[idx].skb)
 		return (struct ieee80211_hdr *)priv->txq[txq_id].
-				txb[idx].skb[0]->data;
+				txb[idx].skb->data;
 	return NULL;
 }
 
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index eeeb6e8..c3e9d63 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -538,7 +538,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
 
 	/* Set up driver data for this TFD */
 	memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info));
-	txq->txb[q->write_ptr].skb[0] = skb;
+	txq->txb[q->write_ptr].skb = skb;
 
 	/* Init first empty entry in queue's array of Tx/cmd buffers */
 	out_cmd = txq->cmd[idx];
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 19/23] iwlwifi: generic scan TX antenna forcing
From: Reinette Chatre @ 2010-06-06  6:56 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1275807398-18184-1-git-send-email-reinette.chatre@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

In "iwlwifi: make scan antenna forcing more generic"
I introduced generic scan RX antenna forcing, which
here I rename to make it more evident. Also add scan
TX antenna forcing, since I will need that as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965.c    |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c |   12 ++++++++----
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c  |    3 ++-
 drivers/net/wireless/iwlwifi/iwl-agn.c     |    3 ++-
 drivers/net/wireless/iwlwifi/iwl-core.c    |    5 +++--
 drivers/net/wireless/iwlwifi/iwl-core.h    |    5 +++--
 6 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index a51c4b8..83e6a42 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2326,7 +2326,7 @@ struct iwl_cfg iwl4965_agn_cfg = {
 	 * Force use of chains B and C for scan RX on 5 GHz band
 	 * because the device has off-channel reception on chain A.
 	 */
-	.scan_antennas[IEEE80211_BAND_5GHZ] = ANT_BC,
+	.scan_rx_antennas[IEEE80211_BAND_5GHZ] = ANT_BC,
 };
 
 /* Module firmware */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 5bec72a..d339881 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1150,6 +1150,7 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
 	bool is_active = false;
 	int  chan_mod;
 	u8 active_chains;
+	u8 scan_tx_antennas = priv->hw_params.valid_tx_ant;
 
 	conf = ieee80211_get_hw_conf(priv->hw);
 
@@ -1301,11 +1302,14 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
 
 	band = priv->scan_band;
 
-	if (priv->cfg->scan_antennas[band])
-		rx_ant = priv->cfg->scan_antennas[band];
+	if (priv->cfg->scan_rx_antennas[band])
+		rx_ant = priv->cfg->scan_rx_antennas[band];
 
-	priv->scan_tx_ant[band] =
-			iwl_toggle_tx_ant(priv, priv->scan_tx_ant[band]);
+	if (priv->cfg->scan_tx_antennas[band])
+		scan_tx_antennas = priv->cfg->scan_tx_antennas[band];
+
+	priv->scan_tx_ant[band] = iwl_toggle_tx_ant(priv, priv->scan_tx_ant[band],
+						    scan_tx_antennas);
 	rate_flags |= iwl_ant_idx_to_flags(priv->scan_tx_ant[band]);
 	scan->tx_cmd.rate_n_flags = iwl_hw_set_rate_n_flags(rate, rate_flags);
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index 0037a52..0d3e13b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -469,7 +469,8 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
 	}
 
 	/* Set up antennas */
-	priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant);
+	priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
+					      priv->hw_params.valid_tx_ant);
 	rate_flags |= iwl_ant_idx_to_flags(priv->mgmt_tx_ant);
 
 	/* Set the rate in the TX cmd */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index a0e995e..ac5fade 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -367,7 +367,8 @@ static unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv,
 
 	/* Set up packet rate and flags */
 	rate = iwl_rate_get_lowest_plcp(priv);
-	priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant);
+	priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
+					      priv->hw_params.valid_tx_ant);
 	rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant);
 	if ((rate >= IWL_FIRST_CCK_RATE) && (rate <= IWL_LAST_CCK_RATE))
 		rate_flags |= RATE_MCS_CCK_MSK;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index ec0f39c..00b2cdd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -141,13 +141,14 @@ int iwl_hwrate_to_plcp_idx(u32 rate_n_flags)
 }
 EXPORT_SYMBOL(iwl_hwrate_to_plcp_idx);
 
-u8 iwl_toggle_tx_ant(struct iwl_priv *priv, u8 ant)
+u8 iwl_toggle_tx_ant(struct iwl_priv *priv, u8 ant, u8 valid)
 {
 	int i;
 	u8 ind = ant;
+
 	for (i = 0; i < RATE_ANT_NUM - 1; i++) {
 		ind = (ind + 1) < RATE_ANT_NUM ?  ind + 1 : 0;
-		if (priv->hw_params.valid_tx_ant & BIT(ind))
+		if (valid & BIT(ind))
 			return ind;
 	}
 	return ant;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 9fe08ec..87dd573 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -328,7 +328,8 @@ struct iwl_cfg {
 	const bool ucode_tracing;
 	const bool sensitivity_calib_by_driver;
 	const bool chain_noise_calib_by_driver;
-	u8 scan_antennas[IEEE80211_NUM_BANDS];
+	u8 scan_rx_antennas[IEEE80211_NUM_BANDS];
+	u8 scan_tx_antennas[IEEE80211_NUM_BANDS];
 };
 
 /***************************
@@ -499,7 +500,7 @@ int iwl_hwrate_to_plcp_idx(u32 rate_n_flags);
 
 u8 iwl_rate_get_lowest_plcp(struct iwl_priv *priv);
 
-u8 iwl_toggle_tx_ant(struct iwl_priv *priv, u8 ant_idx);
+u8 iwl_toggle_tx_ant(struct iwl_priv *priv, u8 ant_idx, u8 valid);
 
 static inline u32 iwl_ant_idx_to_flags(u8 ant_idx)
 {
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 22/23] iwlwifi: parse block ack responses correctly
From: Reinette Chatre @ 2010-06-06  6:56 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Daniel Halperin, Reinette Chatre
In-Reply-To: <1275807398-18184-1-git-send-email-reinette.chatre@intel.com>

From: Daniel Halperin <dhalperi@cs.washington.edu>

Compressed BlockAck frames store the ACKs/NACKs in a 64-bit bitmap that starts
at the sequence number of the first frame sent in the aggregated batch. Note
that this is a selective ACKnowledgement following selective retransmission;
e.g., if frames 1,4-5 in a batch are ACKed then the next transmission will
include frames 2-3,6-10 (7 frames). In this latter case, the Compressed
BlockAck will not have all meaningful information in the low order bits -- the
semantically meaningful bits of the BA will be 0x1f3 (where the low-order frame
is seq 2).

The driver code originally just looked at the lower (in this case, 7) bits of
the BlockAck. In this case, the lower 7 bits of 0x1f3 => only 5 packets,
maximum, could ever be ACKed. In reality it should be looking at all of the
bits, filtered by those corresponding to packets that were actually sent. This
flaw meant that the number of correctly ACked packets could be significantly
underreported and might result in asynchronous state between TX and RX sides as
well as driver and uCode.

Fix this and also add a shortcut that doesn't require the code to loop through
all 64 bits of the bitmap but rather stops when no higher packets are ACKed.

In my experiments this fix greatly reduces throughput swing, making throughput
stable and high. It is also likely related to some of the stalls observed in
aggregation mode and maybe some of the buffer underruns observed, e.g.,

http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=1968
http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2098
http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2018

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index 0d3e13b..10a0acd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -1208,7 +1208,7 @@ static int iwlagn_tx_status_reply_compressed_ba(struct iwl_priv *priv,
 	int i, sh, ack;
 	u16 seq_ctl = le16_to_cpu(ba_resp->seq_ctl);
 	u16 scd_flow = le16_to_cpu(ba_resp->scd_flow);
-	u64 bitmap;
+	u64 bitmap, sent_bitmap;
 	int successes = 0;
 	struct ieee80211_tx_info *info;
 
@@ -1236,16 +1236,19 @@ static int iwlagn_tx_status_reply_compressed_ba(struct iwl_priv *priv,
 
 	/* check for success or failure according to the
 	 * transmitted bitmap and block-ack bitmap */
-	bitmap &= agg->bitmap;
+	sent_bitmap = bitmap & agg->bitmap;
 
 	/* For each frame attempted in aggregation,
 	 * update driver's record of tx frame's status. */
-	for (i = 0; i < agg->frame_count ; i++) {
-		ack = bitmap & (1ULL << i);
-		successes += !!ack;
+	i = 0;
+	while (sent_bitmap) {
+		ack = sent_bitmap & 1ULL;
+		successes += ack;
 		IWL_DEBUG_TX_REPLY(priv, "%s ON i=%d idx=%d raw=%d\n",
 			ack ? "ACK" : "NACK", i, (agg->start_idx + i) & 0xff,
 			agg->start_idx + i);
+		sent_bitmap >>= 1;
+		++i;
 	}
 
 	info = IEEE80211_SKB_CB(priv->txq[scd_flow].txb[agg->start_idx].skb);
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 23/23] iwlwifi: fix wrapping when handling aggregated batches
From: Reinette Chatre @ 2010-06-06  6:56 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Daniel Halperin, Reinette Chatre
In-Reply-To: <1275807398-18184-1-git-send-email-reinette.chatre@intel.com>

From: Daniel Halperin <dhalperi@cs.washington.edu>

Fairly complex code in iwlagn_tx_status_reply_tx handle the status reports for
aggregated packet batches sent by the NIC. This code aims to handle the case
where the NIC retransmits failed packets from a previous batch; the status
information for these packets can sometimes be inserted in the middle of a
batch and are actually not in order by sequence number! (I verified this can
happen with printk's in the function.)

The code in question adaptively identifies the "first" frame of the batch,
taking into account that it may not be the one corresponding to the first agg
status report, and also handles the case when the set of sent packets wraps the
256-character entry buffer. It generates the agg->bitmap field of sent packets
which is later compared to the BlockAck response from the receiver to see which
frames of those sent in this batch were ACKed. A small logic error (wrapping by
0xff==255 instead of 0x100==256) was causing the agg->bitmap to be set
incorrectly.

Fix this wrapping code, and add extensive comments to clarify what is going on.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c |   51 ++++++++++++++++++++++++---
 1 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index d339881..3577c1e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -93,6 +93,12 @@ static int iwlagn_tx_status_reply_tx(struct iwl_priv *priv,
 	} else {
 		/* Two or more frames were attempted; expect block-ack */
 		u64 bitmap = 0;
+
+		/*
+		 * Start is the lowest frame sent. It may not be the first
+		 * frame in the batch; we figure this out dynamically during
+		 * the following loop.
+		 */
 		int start = agg->start_idx;
 
 		/* Construct bit-map of pending frames within Tx window */
@@ -131,25 +137,58 @@ static int iwlagn_tx_status_reply_tx(struct iwl_priv *priv,
 			IWL_DEBUG_TX_REPLY(priv, "AGG Frame i=%d idx %d seq=%d\n",
 					   i, idx, SEQ_TO_SN(sc));
 
+			/*
+			 * sh -> how many frames ahead of the starting frame is
+			 * the current one?
+			 *
+			 * Note that all frames sent in the batch must be in a
+			 * 64-frame window, so this number should be in [0,63].
+			 * If outside of this window, then we've found a new
+			 * "first" frame in the batch and need to change start.
+			 */
 			sh = idx - start;
-			if (sh > 64) {
-				sh = (start - idx) + 0xff;
+
+			/*
+			 * If >= 64, out of window. start must be at the front
+			 * of the circular buffer, idx must be near the end of
+			 * the buffer, and idx is the new "first" frame. Shift
+			 * the indices around.
+			 */
+			if (sh >= 64) {
+				/* Shift bitmap by start - idx, wrapped */
+				sh = 0x100 - idx + start;
 				bitmap = bitmap << sh;
+				/* Now idx is the new start so sh = 0 */
 				sh = 0;
 				start = idx;
-			} else if (sh < -64)
-				sh  = 0xff - (start - idx);
-			else if (sh < 0) {
+			/*
+			 * If <= -64 then wraps the 256-pkt circular buffer
+			 * (e.g., start = 255 and idx = 0, sh should be 1)
+			 */
+			} else if (sh <= -64) {
+				sh  = 0x100 - start + idx;
+			/*
+			 * If < 0 but > -64, out of window. idx is before start
+			 * but not wrapped. Shift the indices around.
+			 */
+			} else if (sh < 0) {
+				/* Shift by how far start is ahead of idx */
 				sh = start - idx;
-				start = idx;
 				bitmap = bitmap << sh;
+				/* Now idx is the new start so sh = 0 */
+				start = idx;
 				sh = 0;
 			}
+			/* Sequence number start + sh was sent in this batch */
 			bitmap |= 1ULL << sh;
 			IWL_DEBUG_TX_REPLY(priv, "start=%d bitmap=0x%llx\n",
 					   start, (unsigned long long)bitmap);
 		}
 
+		/*
+		 * Store the bitmap and possibly the new start, if we wrapped
+		 * the buffer above
+		 */
 		agg->bitmap = bitmap;
 		agg->start_idx = start;
 		IWL_DEBUG_TX_REPLY(priv, "Frames %d start_idx=%d bitmap=0x%llx\n",
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 2/3] compat-wireless: deactivate atl1c for kernel < 2.6.27
From: Hauke Mehrtens @ 2010-06-06  9:11 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
In-Reply-To: <1275815518-30281-1-git-send-email-hauke@hauke-m.de>

atl1c uses pci_prepare_to_sleep that is not backported.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 config.mk |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/config.mk b/config.mk
index ae56849..b0bb35b 100644
--- a/config.mk
+++ b/config.mk
@@ -289,7 +289,11 @@ CONFIG_MWL8K=m
 CONFIG_ATL1=m
 CONFIG_ATL2=m
 CONFIG_ATL1E=m
+ifdef CONFIG_COMPAT_KERNEL_27
+CONFIG_ATL1C=n
+else
 CONFIG_ATL1C=m
+endif
 
 CONFIG_HERMES=m
 CONFIG_HERMES_CACHE_FW_ON_INIT=y
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 3/3] compat-wireless: activate CONFIG_MAC80211_RC_MINSTREL_HT
From: Hauke Mehrtens @ 2010-06-06  9:11 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
In-Reply-To: <1275815518-30281-1-git-send-email-hauke@hauke-m.de>


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 config.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/config.mk b/config.mk
index b0bb35b..0001a7d 100644
--- a/config.mk
+++ b/config.mk
@@ -130,6 +130,7 @@ CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
 CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstrel
 CONFIG_MAC80211_RC_PID=y
 CONFIG_MAC80211_RC_MINSTREL=y
+CONFIG_MAC80211_RC_MINSTREL_HT=y
 CONFIG_MAC80211_LEDS=y
 
 # enable mesh networking too
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 1/3] compat-wireless: deactivate libertas sdio suspend for < 2.6.34
From: Hauke Mehrtens @ 2010-06-06  9:11 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

libertas sdio suspend and resume depends on some new features of the
sdio framework in kernel 2.6.34.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/29-libertas_sdio_no_suspend.patch |   34 +++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 patches/29-libertas_sdio_no_suspend.patch

diff --git a/patches/29-libertas_sdio_no_suspend.patch b/patches/29-libertas_sdio_no_suspend.patch
new file mode 100644
index 0000000..f5dc993
--- /dev/null
+++ b/patches/29-libertas_sdio_no_suspend.patch
@@ -0,0 +1,34 @@
+Starting with commit 66fceb69b72ff7e9cd8da2ca70033982d5376e0e
+"libertas: Added callback functions to support SDIO suspend/resume."
+libertas uses new functions from the in kernel sdio framework for
+suspend and resume that are not backported.
+
+--- a/drivers/net/wireless/libertas/if_sdio.c
++++ b/drivers/net/wireless/libertas/if_sdio.c
+@@ -1212,6 +1212,7 @@ static void if_sdio_remove(struct sdio_f
+ 	lbs_deb_leave(LBS_DEB_SDIO);
+ }
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ static int if_sdio_suspend(struct device *dev)
+ {
+ 	struct sdio_func *func = dev_to_sdio_func(dev);
+@@ -1266,15 +1267,18 @@ static const struct dev_pm_ops if_sdio_p
+ 	.suspend	= if_sdio_suspend,
+ 	.resume		= if_sdio_resume,
+ };
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
+ 
+ static struct sdio_driver if_sdio_driver = {
+ 	.name		= "libertas_sdio",
+ 	.id_table	= if_sdio_ids,
+ 	.probe		= if_sdio_probe,
+ 	.remove		= if_sdio_remove,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+ 	.drv = {
+ 		.pm = &if_sdio_pm_ops,
+ 	},
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) */
+ };
+ 
+ /*******************************************************************/
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 1/4] compat: update bitops.h and wireless.h
From: Hauke Mehrtens @ 2010-06-06  9:12 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

copy files from linux-next next-20100604

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/bitops.h        |   33 +++++----------------------------
 include/linux/compat-2.6.35.h |    3 ---
 include/linux/wireless.h      |    4 +++-
 3 files changed, 8 insertions(+), 32 deletions(-)

diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index b62de8c..679369b 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -12,6 +12,11 @@
 #endif
 #endif
 
+extern unsigned int __sw_hweight8(unsigned int w);
+extern unsigned int __sw_hweight16(unsigned int w);
+extern unsigned int __sw_hweight32(unsigned int w);
+extern unsigned long __sw_hweight64(__u64 w);
+
 /*
  * Include this here because some architectures need generic_ffs/fls in
  * scope
@@ -23,9 +28,6 @@
 	     (bit) < (size); \
 	     (bit) = find_next_bit((addr), (size), (bit) + 1))
 
-/* Temporary */
-#define for_each_bit(bit, addr, size) for_each_set_bit(bit, addr, size)
-
 static __inline__ int get_bitmask_order(unsigned int count)
 {
 	int order;
@@ -49,31 +51,6 @@ static inline unsigned long hweight_long(unsigned long w)
 	return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
 }
 
-/*
- * Clearly slow versions of the hweightN() functions, their benefit is
- * of course compile time evaluation of constant arguments.
- */
-#define HWEIGHT8(w)					\
-      (	BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) +	\
-	(!!((w) & (1ULL << 0))) +			\
-	(!!((w) & (1ULL << 1))) +			\
-	(!!((w) & (1ULL << 2))) +			\
-	(!!((w) & (1ULL << 3))) +			\
-	(!!((w) & (1ULL << 4))) +			\
-	(!!((w) & (1ULL << 5))) +			\
-	(!!((w) & (1ULL << 6))) +			\
-	(!!((w) & (1ULL << 7)))	)
-
-#define HWEIGHT16(w) (HWEIGHT8(w)  + HWEIGHT8((w) >> 8))
-#define HWEIGHT32(w) (HWEIGHT16(w) + HWEIGHT16((w) >> 16))
-#define HWEIGHT64(w) (HWEIGHT32(w) + HWEIGHT32((w) >> 32))
-
-/*
- * Type invariant version that simply casts things to the
- * largest type.
- */
-#define HWEIGHT(w)   HWEIGHT64((u64)(w))
-
 /**
  * rol32 - rotate a 32-bit value left
  * @word: value to rotate
diff --git a/include/linux/compat-2.6.35.h b/include/linux/compat-2.6.35.h
index 7091f7c..b38d6de 100644
--- a/include/linux/compat-2.6.35.h
+++ b/include/linux/compat-2.6.35.h
@@ -13,9 +13,6 @@
 #define SHRT_MAX       ((s16)(USHRT_MAX>>1))
 #define SHRT_MIN       ((s16)(-SHRT_MAX - 1))
 
-#define IW_HANDLER(id, func)			\
-	[IW_IOCTL_IDX(id)] = func
-
 #define  SDIO_BUS_ECSI		0x20	/* Enable continuous SPI interrupt */
 #define  SDIO_BUS_SCSI		0x40	/* Support continuous SPI interrupt */
 
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index 5b4c6c7..e6827ee 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -346,6 +346,8 @@
 #define SIOCIWFIRST	0x8B00
 #define SIOCIWLAST	SIOCIWLASTPRIV		/* 0x8BFF */
 #define IW_IOCTL_IDX(cmd)	((cmd) - SIOCIWFIRST)
+#define IW_HANDLER(id, func)			\
+	[IW_IOCTL_IDX(id)] = func
 
 /* Odd : get (world access), even : set (root access) */
 #define IW_IS_SET(cmd)	(!((cmd) & 0x1))
@@ -648,7 +650,7 @@
  * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
 #define IW_EVENT_CAPA_BASE(cmd)		((cmd >= SIOCIWFIRSTPRIV) ? \
 					 (cmd - SIOCIWFIRSTPRIV + 0x60) : \
-					 (cmd - SIOCSIWCOMMIT))
+					 (cmd - SIOCIWFIRST))
 #define IW_EVENT_CAPA_INDEX(cmd)	(IW_EVENT_CAPA_BASE(cmd) >> 5)
 #define IW_EVENT_CAPA_MASK(cmd)		(1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F))
 /* Event capability constants - event autogenerated by the kernel
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 2/4] compat: move kparam_{block,unblock}_sysfs_write
From: Hauke Mehrtens @ 2010-06-06  9:12 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
In-Reply-To: <1275815547-30313-1-git-send-email-hauke@hauke-m.de>

kparam_block_sysfs_write and kparam_unblock_sysfs_write are not in
kernel 2.6.35, move them to backport from kernel 2.6.36.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-2.6.35.h |    3 ---
 include/linux/compat-2.6.36.h |   13 +++++++++++++
 include/linux/compat-2.6.h    |    1 +
 3 files changed, 14 insertions(+), 3 deletions(-)
 create mode 100644 include/linux/compat-2.6.36.h

diff --git a/include/linux/compat-2.6.35.h b/include/linux/compat-2.6.35.h
index b38d6de..886815d 100644
--- a/include/linux/compat-2.6.35.h
+++ b/include/linux/compat-2.6.35.h
@@ -23,9 +23,6 @@ static inline wait_queue_head_t *sk_sleep(struct sock *sk)
 	return sk->sk_sleep;
 }
 
-#define kparam_block_sysfs_write(a)
-#define kparam_unblock_sysfs_write(a)
-
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */
 
 #endif /* LINUX_26_35_COMPAT_H */
diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
new file mode 100644
index 0000000..0307108
--- /dev/null
+++ b/include/linux/compat-2.6.36.h
@@ -0,0 +1,13 @@
+#ifndef LINUX_26_36_COMPAT_H
+#define LINUX_26_36_COMPAT_H
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
+
+#define kparam_block_sysfs_write(a)
+#define kparam_unblock_sysfs_write(a)
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
+
+#endif /* LINUX_26_36_COMPAT_H */
diff --git a/include/linux/compat-2.6.h b/include/linux/compat-2.6.h
index 6171cd9..ef51195 100644
--- a/include/linux/compat-2.6.h
+++ b/include/linux/compat-2.6.h
@@ -28,5 +28,6 @@
 #include <linux/compat-2.6.33.h>
 #include <linux/compat-2.6.34.h>
 #include <linux/compat-2.6.35.h>
+#include <linux/compat-2.6.36.h>
 
 #endif /* LINUX_26_COMPAT_H */
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 3/4] compat: backport small functions and defines
From: Hauke Mehrtens @ 2010-06-06  9:12 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
In-Reply-To: <1275815547-30313-1-git-send-email-hauke@hauke-m.de>

Backport of some functions and defines needed by compat-wireless.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-2.6.29.h |   25 +++++++++++++++++++++++++
 include/linux/compat-2.6.32.h |    2 ++
 include/linux/compat-2.6.34.h |   16 ++++++++++++++++
 3 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-2.6.29.h b/include/linux/compat-2.6.29.h
index f063e24..a1a989c 100644
--- a/include/linux/compat-2.6.29.h
+++ b/include/linux/compat-2.6.29.h
@@ -249,6 +249,31 @@ extern int eth_mac_addr(struct net_device *dev, void *p);
 extern int eth_change_mtu(struct net_device *dev, int new_mtu);
 extern int eth_validate_addr(struct net_device *dev);
 
+#ifdef CONFIG_NET_NS
+
+static inline void write_pnet(struct net **pnet, struct net *net)
+{
+	*pnet = net;
+}
+
+static inline struct net *read_pnet(struct net * const *pnet)
+{
+	return *pnet;
+}
+
+#else
+
+#define write_pnet(pnet, net)	do { (void)(net);} while (0)
+#define read_pnet(pnet)		(&init_net)
+
+/*
+ * swap - swap value of @a and @b
+ */
+#define swap(a, b) \
+	do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
+
+#endif
+
 #else
 
 static inline void netdev_attach_ops(struct net_device *dev,
diff --git a/include/linux/compat-2.6.32.h b/include/linux/compat-2.6.32.h
index 2f5013f..3a41bd6 100644
--- a/include/linux/compat-2.6.32.h
+++ b/include/linux/compat-2.6.32.h
@@ -92,6 +92,8 @@ struct dev_pm_ops name = { \
 /* The export symbol in changed in compat/patches/15-symbol-export-conflicts.patch */
 #define ieee80211_rx(hw, skb) mac80211_ieee80211_rx(hw, skb)
 
+#define dev_to_sdio_func(d)	container_of(d, struct sdio_func, dev)
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) */
 
 #endif /* LINUX_26_32_COMPAT_H */
diff --git a/include/linux/compat-2.6.34.h b/include/linux/compat-2.6.34.h
index 2870a3b..b1c15a7 100644
--- a/include/linux/compat-2.6.34.h
+++ b/include/linux/compat-2.6.34.h
@@ -200,6 +200,22 @@ do {							\
 #define usb_alloc_coherent(dev, size, mem_flags, dma) usb_buffer_alloc(dev, size, mem_flags, dma)
 #define usb_free_coherent(dev, size, addr, dma) usb_buffer_free(dev, size, addr, dma)
 
+#ifdef CONFIG_NEED_DMA_MAP_STATE
+#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)        dma_addr_t ADDR_NAME
+#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)          __u32 LEN_NAME
+#define dma_unmap_addr(PTR, ADDR_NAME)           ((PTR)->ADDR_NAME)
+#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL)  (((PTR)->ADDR_NAME) = (VAL))
+#define dma_unmap_len(PTR, LEN_NAME)             ((PTR)->LEN_NAME)
+#define dma_unmap_len_set(PTR, LEN_NAME, VAL)    (((PTR)->LEN_NAME) = (VAL))
+#else
+#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)
+#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)
+#define dma_unmap_addr(PTR, ADDR_NAME)           (0)
+#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL)  do { } while (0)
+#define dma_unmap_len(PTR, LEN_NAME)             (0)
+#define dma_unmap_len_set(PTR, LEN_NAME, VAL)    do { } while (0)
+#endif
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)) */
 
 #endif /* LINUX_26_34_COMPAT_H */
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 4/4] compat: use kernel pm_qos_params.h
From: Hauke Mehrtens @ 2010-06-06  9:12 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
In-Reply-To: <1275815547-30313-1-git-send-email-hauke@hauke-m.de>

Do not use pm_qos_params.h from compat-wireless if the kernel also
ships this file. In kernel 2.6.35 pm_qos_params.h changed and the in
kernel header file is needed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/pm_qos_params.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h
index 091c13c..e1f083c 100644
--- a/include/linux/pm_qos_params.h
+++ b/include/linux/pm_qos_params.h
@@ -1,3 +1,8 @@
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
+#include_next <linux/pm_qos_params.h>
+#else
 /* interface for the pm_qos_power infrastructure of the linux kernel.
  *
  * Mark Gross <mgross@linux.intel.com>
@@ -23,4 +28,5 @@ int pm_qos_requirement(int qos);
 
 int pm_qos_add_notifier(int qos, struct notifier_block *notifier);
 int pm_qos_remove_notifier(int qos, struct notifier_block *notifier);
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) */
 
-- 
1.7.0.4


^ permalink raw reply related

* Re: Locking in new ARP query filtering patch
From: Johannes Berg @ 2010-06-06  9:17 UTC (permalink / raw)
  To: reinette chatre; +Cc: juuso.oikarinen, linux-wireless
In-Reply-To: <1275802426.1835.4408.camel@rchatre-DESK>

On Sat, 2010-06-05 at 22:33 -0700, reinette chatre wrote:

> [   92.026800] =======================================================
> [   92.030507] [ INFO: possible circular locking dependency detected ]
> [   92.030507] 2.6.34-04781-g2b2c009 #85
> [   92.030507] -------------------------------------------------------
> [   92.030507] modprobe/5225 is trying to acquire lock:
> [   92.030507]  ((wiphy_name(local->hw.wiphy))){+.+.+.}, at: [<ffffffff8105b5c0>] flush_workq
> ueue+0x0/0xb0
> [   92.030507]
> [   92.030507] but task is already holding lock:
> [   92.030507]  (rtnl_mutex){+.+.+.}, at: [<ffffffff812b9ce2>] rtnl_lock+0x12/0x20
> [   92.030507]
> [   92.030507] which lock already depends on the new lock.

> [   92.030507] 1 lock held by modprobe/5225:
> [   92.030507]  #0:  (rtnl_mutex){+.+.+.}, at: [<ffffffff812b9ce2>] rtnl_lock+0x12/0x20

Suck, I should've caught that. Yes, because we need to flush the
mac80211 workqueue under RTNL we cannot acquire the RTNL while working
from it, so the ARP filter upload after associating needs to be further
deferred to a schedule_work(), which then needs to do a bunch of sanity
checking and I think might even need to iterate the iface list because
it might not be possible to make it depend on it.

> Here is the BUG:
> 
> [  132.460013] kernel BUG at /home/wifi/iwlwifi-2.6/net/mac80211/main.c:380!
> [  132.460013] invalid opcode: 0000 [#1] SMP

> [  132.460013] RIP: 0010:[<ffffffffa022fac2>]  [<ffffffffa022fac2>] ieee80211_alloc_hw+0x502/
> 0x520 [mac80211]

> [  132.460013]  [<ffffffffa02af53e>] iwl_alloc_all+0x1e/0x50 [iwlcore]

> The code in which the above appears is:
> (gdb) l *(ieee80211_alloc_hw+0x502)
> 0xaf2 is in ieee80211_alloc_hw (/home/wifi/iwlwifi-2.6/net/mac80211/main.c:380).
> 375	
> 376		ifmgd = &sdata->u.mgd;
> 377		mutex_lock(&ifmgd->mtx);
> 378		if (ifmgd->associated)
> 379			ieee80211_set_arp_filter(sdata);
> 380		mutex_unlock(&ifmgd->mtx);
> 381	
> 382		return NOTIFY_DONE;
> 383	}
> 384	#endif

Not sure why this appears as part of init? But anyway, the reason for
this is obvious -- we're not checking netif_running() in
ieee80211_ifa_changed, which we must since we only init the mutex as
part of open(). The fix would be to abort ieee80211_ifa_changed() if not
netif_running() -- before locking the mutex.

johannes


^ permalink raw reply

* Re: [PATCH 4/4] compat: use kernel pm_qos_params.h
From: Luis R. Rodriguez @ 2010-06-06  9:20 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linux-wireless, mcgrof
In-Reply-To: <1275815547-30313-4-git-send-email-hauke@hauke-m.de>

On Sun, Jun 6, 2010 at 2:12 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> Do not use pm_qos_params.h from compat-wireless if the kernel also
> ships this file. In kernel 2.6.35 pm_qos_params.h changed and the in
> kernel header file is needed.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Dude you rock, thanks a lot for this, applied all compat-wireless and
compat patches and pushed them out. Also propagated the compat ones to
the 2.6.35.y branch FWIW.

  Luis

^ permalink raw reply

* Re: WARNING: at drivers/base/core.c:130 device_release+0x82/0x90()
From: Luis R. Rodriguez @ 2010-06-06  9:28 UTC (permalink / raw)
  To: Fabio Rossi; +Cc: linux-wireless
In-Reply-To: <201006041025.08348.rossi.f@inwind.it>

On Fri, Jun 4, 2010 at 1:25 AM, Fabio Rossi <rossi.f@inwind.it> wrote:
> On Wednesday 02 June 2010 23:42:14 Luis R. Rodriguez wrote:
>
>> On Wed, Jun 2, 2010 at 2:29 AM, Fabio Rossi <rossi.f@inwind.it> wrote:
>> > Compiling the kernel without ACPI (CONFIG_ACPI=n) gives the following
>> > warning:
>> >
>> > cfg80211: Calling CRDA to update world regulatory domain
>> > cfg80211: World regulatory domain updated:
>> >    (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
>> >    (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
>> > ath5k 0000:08:01.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
>> > ath5k 0000:08:01.0: registered as 'phy0'
>> > ath5k phy0: request_irq failed
>> > ------------[ cut here ]------------
>>
>> Since traces are printed reversed you will have to read my logic from
>> bottom to top:
>>
>> Seems we need to implement the dev_release() op for the class of our
>> devices.
>
> Shall I open a bug in kernel bugzilla to keep trace of this?

Nah something else is up...

struct class ieee80211_class = {
        .name = "ieee80211",
        .owner = THIS_MODULE,
        .dev_release = wiphy_dev_release,
        .dev_attrs = ieee80211_dev_attrs,
#ifdef CONFIG_HOTPLUG
        .dev_uevent = wiphy_uevent,
#endif
        .suspend = wiphy_suspend,
        .resume = wiphy_resume,
};

^ permalink raw reply

* Re: WARNING: at drivers/base/core.c:130 device_release+0x82/0x90()
From: Luis R. Rodriguez @ 2010-06-06  9:29 UTC (permalink / raw)
  To: Fabio Rossi; +Cc: linux-wireless
In-Reply-To: <AANLkTim6tx9plm0tqqms64iUboSRxo9KnTGbHmwKrhQK@mail.gmail.com>

On Sun, Jun 6, 2010 at 2:28 AM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> On Fri, Jun 4, 2010 at 1:25 AM, Fabio Rossi <rossi.f@inwind.it> wrote:
>> On Wednesday 02 June 2010 23:42:14 Luis R. Rodriguez wrote:
>>
>>> On Wed, Jun 2, 2010 at 2:29 AM, Fabio Rossi <rossi.f@inwind.it> wrote:
>>> > Compiling the kernel without ACPI (CONFIG_ACPI=n) gives the following
>>> > warning:
>>> >
>>> > cfg80211: Calling CRDA to update world regulatory domain
>>> > cfg80211: World regulatory domain updated:
>>> >    (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
>>> >    (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
>>> > ath5k 0000:08:01.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
>>> > ath5k 0000:08:01.0: registered as 'phy0'
>>> > ath5k phy0: request_irq failed
>>> > ------------[ cut here ]------------
>>>
>>> Since traces are printed reversed you will have to read my logic from
>>> bottom to top:
>>>
>>> Seems we need to implement the dev_release() op for the class of our
>>> devices.
>>
>> Shall I open a bug in kernel bugzilla to keep trace of this?
>
> Nah something else is up...
>
> struct class ieee80211_class = {
>        .name = "ieee80211",
>        .owner = THIS_MODULE,
>        .dev_release = wiphy_dev_release,
>        .dev_attrs = ieee80211_dev_attrs,
> #ifdef CONFIG_HOTPLUG
>        .dev_uevent = wiphy_uevent,
> #endif
>        .suspend = wiphy_suspend,
>        .resume = wiphy_resume,
> };
>

This is wireless-testing, not compat-wireless right?

  Luis

^ permalink raw reply

* Re: [PATCH] mac80211: Add interface for driver to temporarily disable dynamic ps
From: Johannes Berg @ 2010-06-06  9:44 UTC (permalink / raw)
  To: Juuso Oikarinen; +Cc: linville, linux-wireless
In-Reply-To: <1275561873-21500-1-git-send-email-juuso.oikarinen@nokia.com>

Hi,

Apologies for the delay in reviewing this.

On Thu, 2010-06-03 at 13:44 +0300, Juuso Oikarinen wrote:

> @@ -699,6 +704,8 @@ enum ieee80211_smps_mode {
>  struct ieee80211_conf {
>  	u32 flags;
>  	int power_level, dynamic_ps_timeout, dynamic_ps_forced_timeout;
> +	int dynamic_ps_user_timeout;
> +	bool disable_dynamic_ps;
>  	int max_sleep_period;

Please don't keep these variables in driver-visible structures, they
don't belong there as they are implementation details, they should be in
the ieee80211_local structure somewhere and the driver should see _only_
dynamic_ps_timeout.

The same actually applies to dynamic_ps_forced_timeout as well, so
please also make a separate patch moving that.

johannes


^ permalink raw reply

* Re: WARNING: at drivers/base/core.c:130 device_release+0x82/0x90()
From: Fabio Rossi @ 2010-06-06  9:43 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless
In-Reply-To: <AANLkTimTGPFL_1qAn4YEtYPogOkbZIr_C1YHOtKoHzxw@mail.gmail.com>

On Sunday 06 June 2010 11:29:54 Luis R. Rodriguez wrote:

> On Sun, Jun 6, 2010 at 2:28 AM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> > On Fri, Jun 4, 2010 at 1:25 AM, Fabio Rossi <rossi.f@inwind.it> wrote:
> >> On Wednesday 02 June 2010 23:42:14 Luis R. Rodriguez wrote:
> >>> On Wed, Jun 2, 2010 at 2:29 AM, Fabio Rossi <rossi.f@inwind.it> wrote:
> >>> > Compiling the kernel without ACPI (CONFIG_ACPI=n) gives the following
> >>> > warning:
> >>> > 
> >>> > cfg80211: Calling CRDA to update world regulatory domain
> >>> > cfg80211: World regulatory domain updated:
> >>> >    (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
> >>> >    (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
> >>> > ath5k 0000:08:01.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
> >>> > ath5k 0000:08:01.0: registered as 'phy0'
> >>> > ath5k phy0: request_irq failed
> >>> > ------------[ cut here ]------------
> >>> 
> >>> Since traces are printed reversed you will have to read my logic from
> >>> bottom to top:
> >>> 
> >>> Seems we need to implement the dev_release() op for the class of our
> >>> devices.
> >> 
> >> Shall I open a bug in kernel bugzilla to keep trace of this?
> > 
> > Nah something else is up...
> > 
> > struct class ieee80211_class = {
> >        .name = "ieee80211",
> >        .owner = THIS_MODULE,
> >        .dev_release = wiphy_dev_release,
> >        .dev_attrs = ieee80211_dev_attrs,
> > #ifdef CONFIG_HOTPLUG
> >        .dev_uevent = wiphy_uevent,
> > #endif
> >        .suspend = wiphy_suspend,
> >        .resume = wiphy_resume,
> > };
> 
> This is wireless-testing, not compat-wireless right?

Yes, I'm using the latest wireless-testing.git

Fabio


^ permalink raw reply

* Re: WARNING: at drivers/base/core.c:130 device_release+0x82/0x90()
From: Luis R. Rodriguez @ 2010-06-06  9:45 UTC (permalink / raw)
  To: Fabio Rossi; +Cc: linux-wireless
In-Reply-To: <201006061143.56259.rossi.f@inwind.it>

On Sun, Jun 6, 2010 at 2:43 AM, Fabio Rossi <rossi.f@inwind.it> wrote:
> On Sunday 06 June 2010 11:29:54 Luis R. Rodriguez wrote:
>
>> On Sun, Jun 6, 2010 at 2:28 AM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
>> > On Fri, Jun 4, 2010 at 1:25 AM, Fabio Rossi <rossi.f@inwind.it> wrote:
>> >> On Wednesday 02 June 2010 23:42:14 Luis R. Rodriguez wrote:
>> >>> On Wed, Jun 2, 2010 at 2:29 AM, Fabio Rossi <rossi.f@inwind.it> wrote:
>> >>> > Compiling the kernel without ACPI (CONFIG_ACPI=n) gives the following
>> >>> > warning:
>> >>> >
>> >>> > cfg80211: Calling CRDA to update world regulatory domain
>> >>> > cfg80211: World regulatory domain updated:
>> >>> >    (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
>> >>> >    (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
>> >>> > ath5k 0000:08:01.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
>> >>> > ath5k 0000:08:01.0: registered as 'phy0'
>> >>> > ath5k phy0: request_irq failed
>> >>> > ------------[ cut here ]------------
>> >>>
>> >>> Since traces are printed reversed you will have to read my logic from
>> >>> bottom to top:
>> >>>
>> >>> Seems we need to implement the dev_release() op for the class of our
>> >>> devices.
>> >>
>> >> Shall I open a bug in kernel bugzilla to keep trace of this?
>> >
>> > Nah something else is up...
>> >
>> > struct class ieee80211_class = {
>> >        .name = "ieee80211",
>> >        .owner = THIS_MODULE,
>> >        .dev_release = wiphy_dev_release,
>> >        .dev_attrs = ieee80211_dev_attrs,
>> > #ifdef CONFIG_HOTPLUG
>> >        .dev_uevent = wiphy_uevent,
>> > #endif
>> >        .suspend = wiphy_suspend,
>> >        .resume = wiphy_resume,
>> > };
>>
>> This is wireless-testing, not compat-wireless right?
>
> Yes, I'm using the latest wireless-testing.git

Then I don't know WTF is going on, some sort of class corruption...
anyone else have another idea?

  Luis

^ permalink raw reply

* compat-wireless 2.6.35_rc2 build errors
From: Richard Farina @ 2010-06-06 17:47 UTC (permalink / raw)
  To: linux-wireless, Ivo van Doorn, gwingerde, Luis R. Rodriguez

I realize we are still pretty early in the rc process but there are some 
seemingly significant problems building compat-wireless 2.6.35_rc2 
(which should be very close if not identical to the linus tree). I have 
copied the rt2x00 team because of the first error and Luiz for the second.

First and foremost this won't build at all:

/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/rt2x00/rt2800pci.c: 
In function 'rt2800pci_read_eeprom_soc':
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/rt2x00/rt2800pci.c:91: 
error: implicit declaration of function 'KSEG1ADDR'
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/rt2x00/rt2800pci.c:91: 
warning: cast to pointer from integer of different size
make[4]: *** 
[/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/rt2x00/rt2800pci.o] 
Error 1


Additionally but likely less important this driver seems to be defining 
variables overriding kernel headers, I can't imagine that is good.  Not 
sure if this is something that the driver needs to fix or needs to be 
fixed in compat-wireless but here it is:

/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/libertas_tf/main.c:10:1: 
warning: "pr_fmt" redefined
In file included from include/linux/skbuff.h:17,
                 from include/linux/if_ether.h:124,
                 from include/linux/netdevice.h:29,
                 from 
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.29.h:5,
                 from 
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.h:24,
                 from <command-line>:0:
include/linux/kernel.h:376:1: warning: this is the location of the 
previous definition
  CC [M]  
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/orinoco/main.o
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/libertas_tf/main.c:10:1: 
warning: "pr_fmt" redefined
In file included from include/linux/skbuff.h:17,
                 from include/linux/if_ether.h:124,
                 from include/linux/netdevice.h:29,
                 from 
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.29.h:5,
                 from 
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.h:24,
                 from <command-line>:0:
include/linux/kernel.h:376:1: warning: this is the location of the 
previous definition
  CC [M]  
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/libertas_tf/cmd.o
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/libertas_tf/cmd.c:10:1: 
warning: "pr_fmt" redefined
In file included from include/linux/skbuff.h:17,
                 from include/linux/if_ether.h:124,
                 from include/linux/netdevice.h:29,
                 from 
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.29.h:5,
                 from 
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.h:24,
                 from <command-line>:0:
include/linux/kernel.h:376:1: warning: this is the location of the 
previous definition
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/libertas_tf/cmd.c:10:1: 
warning: "pr_fmt" redefined
In file included from include/linux/skbuff.h:17,
                 from include/linux/if_ether.h:124,
                 from include/linux/netdevice.h:29,
                 from 
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.29.h:5,
                 from 
/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.h:24,
                 from <command-line>:0:

I'll try to build the rc2 kernel and see if these errors are the same.

Thanks,
Rick Farina

^ permalink raw reply

* compat-wireless: Enabled rt2800pci support for new rt30xx and rt35xx chips
From: Richard Farina @ 2010-06-06 18:05 UTC (permalink / raw)
  To: linux-wireless, Luis R. Rodriguez

commit d9d9c3caaa370cca3594f7ebe530cdca9e35abc5
Author: Rick Farina <sidhayn@gmail.com>
Date:   Sun Jun 6 14:00:18 2010 -0400

    compat-wireless: Enabled rt2800pci support for new rt30xx and rt35xx 
chips
    
    The rt2800pci driver now supports the rt30xx and rt35xx series of 
chips from ralink, this change
    cause that support to be built into the driver.  This change has 
been compile tested but I do not
    own any of these devices.
    
    Note: I am purposely leaving the SoC support disabled as it doesn't 
build right now. Hopefully
    this will be fixed in a later rc and I'll submit the change then.
    
    Signed-off-by: Rick Farina

diff --git a/config.mk b/config.mk
index 0001a7d..169a99c 100644
--- a/config.mk
+++ b/config.mk
@@ -270,8 +270,8 @@ CONFIG_RT2500PCI=m
 ifneq ($(CONFIG_CRC_CCITT),)
 CONFIG_RT2800PCI=m
 CONFIG_RT2800PCI_PCI=y
-# CONFIG_RT2800PCI_RT30XX=y
-# CONFIG_RT2800PCI_RT35XX=y
+CONFIG_RT2800PCI_RT30XX=y
+CONFIG_RT2800PCI_RT35XX=y
 # CONFIG_RT2800PCI_SOC=y
 endif
 NEED_RT2X00=y


^ permalink raw reply related

* Re: compat-wireless 2.6.35_rc2 build errors
From: Richard Farina @ 2010-06-06 18:41 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, Ivo van Doorn, gwingerde
In-Reply-To: <4C0BDF2F.2020001@gmail.com>

Richard Farina wrote:
> I realize we are still pretty early in the rc process but there are 
> some seemingly significant problems building compat-wireless 
> 2.6.35_rc2 (which should be very close if not identical to the linus 
> tree). I have copied the rt2x00 team because of the first error and 
> Luiz for the second.
>
> First and foremost this won't build at all:
>
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/rt2x00/rt2800pci.c: 
> In function 'rt2800pci_read_eeprom_soc':
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/rt2x00/rt2800pci.c:91: 
> error: implicit declaration of function 'KSEG1ADDR'
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/rt2x00/rt2800pci.c:91: 
> warning: cast to pointer from integer of different size
> make[4]: *** 
> [/var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/rt2x00/rt2800pci.o] 
> Error 1
>
>
After talking to Hauke2 on irc it seems that this outcome is very 
expected when you try to build a mips driver for x86_64.  I shouldn't be 
trying to build this at all.  Compat-wireless has a bunch of ifneq 
statements which seem to be how this type of stupidity is prevented, 
however, I can't exactly grok how to make this work.  I know this driver 
should dep RALINK_RT288X || RALINK_RT305X but I can't figure out how to 
modify the section of config.mk to do that properly:

ifneq ($(CONFIG_CRC_CCITT),)
CONFIG_RT2800PCI=m
CONFIG_RT2800PCI_PCI=y
CONFIG_RT2800PCI_RT30XX=y
CONFIG_RT2800PCI_RT35XX=y
# CONFIG_RT2800PCI_SOC=y
endif
NEED_RT2X00=y

Currently it is just commented out which allows me to build but really 
it should be uncommented and have a proper check to see if it should be 
built or not. Luiz can you do this? Or someone hint me on how in the 
world I would do it? I'd spend more time trying to figure this out but 
the grass isn't going to cut itself.

Thanks,
Rick Farina

> Additionally but likely less important this driver seems to be 
> defining variables overriding kernel headers, I can't imagine that is 
> good.  Not sure if this is something that the driver needs to fix or 
> needs to be fixed in compat-wireless but here it is:
>
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/libertas_tf/main.c:10:1: 
> warning: "pr_fmt" redefined
> In file included from include/linux/skbuff.h:17,
>                 from include/linux/if_ether.h:124,
>                 from include/linux/netdevice.h:29,
>                 from 
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.29.h:5, 
>
>                 from 
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.h:24, 
>
>                 from <command-line>:0:
> include/linux/kernel.h:376:1: warning: this is the location of the 
> previous definition
>  CC [M]  
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/orinoco/main.o 
>
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/libertas_tf/main.c:10:1: 
> warning: "pr_fmt" redefined
> In file included from include/linux/skbuff.h:17,
>                 from include/linux/if_ether.h:124,
>                 from include/linux/netdevice.h:29,
>                 from 
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.29.h:5, 
>
>                 from 
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.h:24, 
>
>                 from <command-line>:0:
> include/linux/kernel.h:376:1: warning: this is the location of the 
> previous definition
>  CC [M]  
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/libertas_tf/cmd.o 
>
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/libertas_tf/cmd.c:10:1: 
> warning: "pr_fmt" redefined
> In file included from include/linux/skbuff.h:17,
>                 from include/linux/if_ether.h:124,
>                 from include/linux/netdevice.h:29,
>                 from 
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.29.h:5, 
>
>                 from 
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.h:24, 
>
>                 from <command-line>:0:
> include/linux/kernel.h:376:1: warning: this is the location of the 
> previous definition
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/drivers/net/wireless/libertas_tf/cmd.c:10:1: 
> warning: "pr_fmt" redefined
> In file included from include/linux/skbuff.h:17,
>                 from include/linux/if_ether.h:124,
>                 from include/linux/netdevice.h:29,
>                 from 
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.29.h:5, 
>
>                 from 
> /var/tmp/portage/net-wireless/compat-wireless-2.6.35_rc2/work/compat-wireless-2.6.35-rc2/include/linux/compat-2.6.h:24, 
>
>                 from <command-line>:0:
>
> I'll try to build the rc2 kernel and see if these errors are the same.
>
> Thanks,
> Rick Farina
>


^ permalink raw reply

* Re: [ath5k-devel] [PATCH v2 13/20] cfg80211: Add nl80211 antenna configuration
From: Bruno Randolf @ 2010-06-07  3:45 UTC (permalink / raw)
  To: Luis R. Rodriguez, John W. Linville
  Cc: ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org
In-Reply-To: <20100604212145.GB4069@tux>

On Saturday 05 June 2010 06:21:45 you wrote:
> I don't think the API is defined clean enough yet and can yield
> inconsistant interpretations. I'd like to see this clarified on
> the documentation for both legacy and 802.11n. If the plan is
> to support only legacy right now then I think the API can be
> simpler and clearer with only three options passed, Fixed_A
> Fixed_B and diversity.

luis, i thought we had this resolved during the last thread... i gave you  
examples why fixed_a, fixed_b and diversity is not enough. 

anyhow, there are a few places where i have to make the definition clearer in 
order to avoid inconsistent interpretations, that's right. i will resend this 
so we can continue any discussions based on that. 

john, i will resend the rest of the series, the ath5k part and the antenna 
configuration as separate series. sorry for mixing that up before...

bruno

^ permalink raw reply


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