Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 33/47] iwlwifi: fix iwl_sta_init_lq station ID
From: Reinette Chatre @ 2010-05-10 22:28 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1273530498-11876-1-git-send-email-reinette.chatre@intel.com>

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

The "is_ap" argument to iwl_sta_init_lq is never true,
so it and the corresponding code can be removed. However,
it needs to have the station ID because it is also used
for the IBSS BSSID station, and that doesn't have the
broadcast ID.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-sta.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 0db742c..dd1c639 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -408,7 +408,7 @@ int iwl_add_station_common(struct iwl_priv *priv, const u8 *addr,
 EXPORT_SYMBOL(iwl_add_station_common);
 
 static struct iwl_link_quality_cmd *iwl_sta_init_lq(struct iwl_priv *priv,
-						    const u8 *addr, bool is_ap)
+						    u8 sta_id)
 {
 	int i, r;
 	struct iwl_link_quality_cmd *link_cmd;
@@ -422,9 +422,7 @@ static struct iwl_link_quality_cmd *iwl_sta_init_lq(struct iwl_priv *priv,
 	}
 	/* Set up the rate scaling to start at selected rate, fall back
 	 * all the way down to 1M in IEEE order, and then spin on 1M */
-	if (is_ap)
-		r = IWL_RATE_54M_INDEX;
-	else if (priv->band == IEEE80211_BAND_5GHZ)
+	if (priv->band == IEEE80211_BAND_5GHZ)
 		r = IWL_RATE_6M_INDEX;
 	else
 		r = IWL_RATE_1M_INDEX;
@@ -459,8 +457,7 @@ static struct iwl_link_quality_cmd *iwl_sta_init_lq(struct iwl_priv *priv,
 	link_cmd->agg_params.agg_time_limit =
 		cpu_to_le16(LINK_QUAL_AGG_TIME_LIMIT_DEF);
 
-	/* Update the rate scaling for control frame Tx to AP */
-	link_cmd->sta_id = is_ap ? IWL_AP_ID : priv->hw_params.bcast_sta_id;
+	link_cmd->sta_id = sta_id;
 
 	ret = iwl_send_lq_cmd(priv, link_cmd, CMD_SYNC, true);
 	if (ret)
@@ -496,7 +493,7 @@ int iwl_add_local_station(struct iwl_priv *priv, const u8 *addr, bool init_rs)
 
 	if (init_rs) {
 		/* Set up default rate scaling table in device's station table */
-		link_cmd = iwl_sta_init_lq(priv, addr, false);
+		link_cmd = iwl_sta_init_lq(priv, sta_id);
 		if (!link_cmd) {
 			IWL_ERR(priv, "Unable to initialize rate scaling for station %pM.\n",
 				addr);
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH 47/47] iwlwifi: clear driver stations when going down
From: Reinette Chatre @ 2010-05-10 22:28 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1273530498-11876-1-git-send-email-reinette.chatre@intel.com>

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

During a hw restart, mac80211 will attempt to
reconfigure all stations. Currently, that fails
and leads to warnings because we still have the
stations marked active. Therefore, clear all
stations when doing down.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c      |    1 +
 drivers/net/wireless/iwlwifi/iwl-sta.h      |   19 +++++++++++++++++++
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    1 +
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index dd26965..47563cf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2405,6 +2405,7 @@ static void __iwl_down(struct iwl_priv *priv)
 
 	iwl_clear_ucode_stations(priv);
 	iwl_dealloc_bcast_station(priv);
+	iwl_clear_driver_stations(priv);
 
 	/* Unblock any waiting calls */
 	wake_up_interruptible_all(&priv->wait_command_queue);
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h
index 6427148..c2a453a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.h
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.h
@@ -81,6 +81,25 @@ int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta,
 void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id);
 void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt);
 
+/**
+ * iwl_clear_driver_stations - clear knowledge of all stations from driver
+ * @priv: iwl priv struct
+ *
+ * This is called during iwl_down() to make sure that in the case
+ * we're coming there from a hardware restart mac80211 will be
+ * able to reconfigure stations -- if we're getting there in the
+ * normal down flow then the stations will already be cleared.
+ */
+static inline void iwl_clear_driver_stations(struct iwl_priv *priv)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&priv->sta_lock, flags);
+	memset(priv->stations, 0, sizeof(priv->stations));
+	priv->num_stations = 0;
+	spin_unlock_irqrestore(&priv->sta_lock, flags);
+}
+
 static inline int iwl_sta_id(struct ieee80211_sta *sta)
 {
 	if (WARN_ON(!sta))
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 4916f23..4c78783 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2585,6 +2585,7 @@ static void __iwl3945_down(struct iwl_priv *priv)
 	/* Station information will now be cleared in device */
 	iwl_clear_ucode_stations(priv);
 	iwl_dealloc_bcast_station(priv);
+	iwl_clear_driver_stations(priv);
 
 	/* Unblock any waiting calls */
 	wake_up_interruptible_all(&priv->wait_command_queue);
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH 38/47] iwlwifi: provide more comments for cfg structure
From: Reinette Chatre @ 2010-05-10 22:28 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre
In-Reply-To: <1273530498-11876-1-git-send-email-reinette.chatre@intel.com>

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

Provide comments for newly added cfg parameters

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-core.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index d80aa6c..7e5a5ba 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -247,6 +247,18 @@ struct iwl_mod_params {
  * @support_wimax_coexist: support wimax/wifi co-exist
  * @plcp_delta_threshold: plcp error rate threshold used to trigger
  *	radio tuning when there is a high receiving plcp error rate
+ * @chain_noise_scale: default chain noise scale used for gain computation
+ * @monitor_recover_period: default timer used to check stuck queues
+ * @temperature_kelvin: temperature report by uCode in kelvin
+ * @max_event_log_size: size of event log buffer size for ucode event logging
+ * @tx_power_by_driver: tx power calibration performed by driver
+ *	instead of uCode
+ * @ucode_tracing: support ucode continuous tracing
+ * @sensitivity_calib_by_driver: driver has the capability to perform
+ *	sensitivity calibration operation
+ * @chain_noise_calib_by_driver: driver has the capability to perform
+ *	chain noise calibration operation
+ * @scan_antennas: available antenna for scan operation
  *
  * We enable the driver to be backward compatible wrt API version. The
  * driver specifies which APIs it supports (with @ucode_api_max being the
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH 45/47] iwlwifi: rename iwl_add_local_station
From: Reinette Chatre @ 2010-05-10 22:28 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1273530498-11876-1-git-send-email-reinette.chatre@intel.com>

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

This function is now only used for the special
IBSS BSSID station, so rename it to indicate
this. The new name is iwl_add_bssid_station.

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    |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c |    2 +-
 drivers/net/wireless/iwlwifi/iwl-sta.c     |    9 +++------
 drivers/net/wireless/iwlwifi/iwl-sta.h     |    2 +-
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 306e23a..0eb0faa 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2465,7 +2465,7 @@ static int iwl3945_manage_ibss_station(struct iwl_priv *priv,
 	int ret;
 
 	if (add) {
-		ret = iwl_add_local_station(priv, vif->bss_conf.bssid, false,
+		ret = iwl_add_bssid_station(priv, vif->bss_conf.bssid, false,
 					    &vif_priv->ibss_bssid_sta_id);
 		if (ret)
 			return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 81de88e..637d7b6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1523,7 +1523,7 @@ int iwlagn_manage_ibss_station(struct iwl_priv *priv,
 	struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv;
 
 	if (add)
-		return iwl_add_local_station(priv, vif->bss_conf.bssid, true,
+		return iwl_add_bssid_station(priv, vif->bss_conf.bssid, true,
 					     &vif_priv->ibss_bssid_sta_id);
 	return iwl_remove_station(priv, vif_priv->ibss_bssid_sta_id,
 				  vif->bss_conf.bssid);
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index ba36df5..c15098e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -417,14 +417,11 @@ static struct iwl_link_quality_cmd *iwl_sta_alloc_lq(struct iwl_priv *priv,
 }
 
 /*
- * iwl_add_local_station - Add stations not requested by mac80211
- *
- * This will be either the broadcast station or the bssid station needed by
- * ad-hoc.
+ * iwl_add_bssid_station - Add the special IBSS BSSID station
  *
  * Function sleeps.
  */
-int iwl_add_local_station(struct iwl_priv *priv, const u8 *addr, bool init_rs,
+int iwl_add_bssid_station(struct iwl_priv *priv, const u8 *addr, bool init_rs,
 			  u8 *sta_id_r)
 {
 	int ret;
@@ -468,7 +465,7 @@ int iwl_add_local_station(struct iwl_priv *priv, const u8 *addr, bool init_rs,
 
 	return 0;
 }
-EXPORT_SYMBOL(iwl_add_local_station);
+EXPORT_SYMBOL(iwl_add_bssid_station);
 
 /**
  * iwl_sta_ucode_deactivate - deactivate ucode status for a station
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h
index 6872bcf..6427148 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.h
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.h
@@ -63,7 +63,7 @@ void iwl_dealloc_bcast_station(struct iwl_priv *priv);
 int iwl_get_free_ucode_key_index(struct iwl_priv *priv);
 int iwl_send_add_sta(struct iwl_priv *priv,
 		     struct iwl_addsta_cmd *sta, u8 flags);
-int iwl_add_local_station(struct iwl_priv *priv, const u8 *addr, bool init_rs,
+int iwl_add_bssid_station(struct iwl_priv *priv, const u8 *addr, bool init_rs,
 			  u8 *sta_id_r);
 int iwl_add_station_common(struct iwl_priv *priv, const u8 *addr,
 				  bool is_ap,
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH 46/47] iwlwifi: remove pointless HT check
From: Reinette Chatre @ 2010-05-10 22:28 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1273530498-11876-1-git-send-email-reinette.chatre@intel.com>

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

Remove the check before invoking iwl_set_ht_add_station(),
since neither of the conditions in this check makes sense,
as either we pass in a NULL ht_info (first branch) or in
the IBSS case an ht_info with ht_enabled=false.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-sta.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index c15098e..85ed235 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -284,10 +284,12 @@ static u8 iwl_prep_station(struct iwl_priv *priv, const u8 *addr,
 	station->sta.sta.sta_id = sta_id;
 	station->sta.station_flags = 0;
 
-	/* BCAST station and IBSS stations do not work in HT mode */
-	if (sta_id != priv->hw_params.bcast_sta_id &&
-	    priv->iw_mode != NL80211_IFTYPE_ADHOC)
-		iwl_set_ht_add_station(priv, sta_id, ht_info);
+	/*
+	 * OK to call unconditionally, since local stations (IBSS BSSID
+	 * STA and broadcast STA) pass in a NULL ht_info, and mac80211
+	 * doesn't allow HT IBSS.
+	 */
+	iwl_set_ht_add_station(priv, sta_id, ht_info);
 
 	/* 3945 only */
 	rate = (priv->band == IEEE80211_BAND_5GHZ) ?
-- 
1.6.3.3


^ permalink raw reply related

* Re: [PATCH 01/47] iwlwifi: rename 6000 series Gen2 devices to Gen2a
From: Gábor Stefanik @ 2010-05-10 22:46 UTC (permalink / raw)
  To: Reinette Chatre
  Cc: linville, linux-wireless, ipw3945-devel, Shanyu Zhao,
	Jay Sternberg
In-Reply-To: <1273530498-11876-2-git-send-email-reinette.chatre@intel.com>

What is the reason behind this change? Is Gen2b planned?

On Tue, May 11, 2010 at 12:27 AM, Reinette Chatre
<reinette.chatre@intel.com> wrote:
> From: Shanyu Zhao <shanyu.zhao@intel.com>
>
> Rename the current 6000 series Gen2 devices to Gen2a.
> Rename the ucode name prefix to iwlwifi-6000g2a.
> Also corrected the device IDs for Gen2a series devices.
>
> Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
> Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-6000.c |   24 +++++++++++++-----------
>  drivers/net/wireless/iwlwifi/iwl-agn.c  |    9 ++++-----
>  drivers/net/wireless/iwlwifi/iwl-dev.h  |    2 +-
>  3 files changed, 18 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
> index 7acef70..f057087 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-6000.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
> @@ -67,9 +67,10 @@
>  #define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
>  #define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api)
>
> -#define IWL6000G2_FW_PRE "iwlwifi-6005-"
> -#define _IWL6000G2_MODULE_FIRMWARE(api) IWL6000G2_FW_PRE #api ".ucode"
> -#define IWL6000G2_MODULE_FIRMWARE(api) _IWL6000G2_MODULE_FIRMWARE(api)
> +#define IWL6000G2A_FW_PRE "iwlwifi-6000g2a-"
> +#define _IWL6000G2A_MODULE_FIRMWARE(api) IWL6000G2A_FW_PRE #api ".ucode"
> +#define IWL6000G2A_MODULE_FIRMWARE(api) _IWL6000G2A_MODULE_FIRMWARE(api)
> +
>
>  static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
>  {
> @@ -408,12 +409,10 @@ static const struct iwl_ops iwl6050_ops = {
>        .led = &iwlagn_led_ops,
>  };
>
> -/*
> - * "i": Internal configuration, use internal Power Amplifier
> - */
> -struct iwl_cfg iwl6000g2_2agn_cfg = {
> -       .name = "6000 Series 2x2 AGN Gen2",
> -       .fw_name_pre = IWL6000G2_FW_PRE,
> +
> +struct iwl_cfg iwl6000g2a_2agn_cfg = {
> +       .name = "6000 Series 2x2 AGN Gen2a",
> +       .fw_name_pre = IWL6000G2A_FW_PRE,
>        .ucode_api_max = IWL6000G2_UCODE_API_MAX,
>        .ucode_api_min = IWL6000G2_UCODE_API_MIN,
>        .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
> @@ -442,9 +441,12 @@ struct iwl_cfg iwl6000g2_2agn_cfg = {
>        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
>        .chain_noise_scale = 1000,
>        .monitor_recover_period = IWL_MONITORING_PERIOD,
> -       .max_event_log_size = 1024,
> +       .max_event_log_size = 512,
>  };
>
> +/*
> + * "i": Internal configuration, use internal Power Amplifier
> + */
>  struct iwl_cfg iwl6000i_2agn_cfg = {
>        .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
>        .fw_name_pre = IWL6000_FW_PRE,
> @@ -645,4 +647,4 @@ struct iwl_cfg iwl6000_3agn_cfg = {
>
>  MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
>  MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
> -MODULE_FIRMWARE(IWL6000G2_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
> +MODULE_FIRMWARE(IWL6000G2A_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
> diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
> index dc28376..5cf3822 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-agn.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
> @@ -3789,11 +3789,10 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
>        {IWL_PCI_DEVICE(0x4239, 0x1311, iwl6000i_2agn_cfg)},
>        {IWL_PCI_DEVICE(0x4239, 0x1316, iwl6000i_2abg_cfg)},
>
> -/* 6x00 Series Gen2 */
> -       {IWL_PCI_DEVICE(0x0082, 0x1201, iwl6000g2_2agn_cfg)},
> -       {IWL_PCI_DEVICE(0x0082, 0x1301, iwl6000g2_2agn_cfg)},
> -       {IWL_PCI_DEVICE(0x0082, 0x1321, iwl6000g2_2agn_cfg)},
> -       {IWL_PCI_DEVICE(0x0085, 0x1311, iwl6000g2_2agn_cfg)},
> +/* 6x00 Series Gen2a */
> +       {IWL_PCI_DEVICE(0x0082, 0x1201, iwl6000g2a_2agn_cfg)},
> +       {IWL_PCI_DEVICE(0x0085, 0x1211, iwl6000g2a_2agn_cfg)},
> +       {IWL_PCI_DEVICE(0x0082, 0x1221, iwl6000g2a_2agn_cfg)},
>
>  /* 6x50 WiFi/WiMax Series */
>        {IWL_PCI_DEVICE(0x0087, 0x1301, iwl6050_2agn_cfg)},
> diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
> index cd3b932..e485465 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-dev.h
> +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
> @@ -57,8 +57,8 @@ extern struct iwl_cfg iwl5100_bgn_cfg;
>  extern struct iwl_cfg iwl5100_abg_cfg;
>  extern struct iwl_cfg iwl5150_agn_cfg;
>  extern struct iwl_cfg iwl5150_abg_cfg;
> +extern struct iwl_cfg iwl6000g2a_2agn_cfg;
>  extern struct iwl_cfg iwl6000i_2agn_cfg;
> -extern struct iwl_cfg iwl6000g2_2agn_cfg;
>  extern struct iwl_cfg iwl6000i_2abg_cfg;
>  extern struct iwl_cfg iwl6000i_2bg_cfg;
>  extern struct iwl_cfg iwl6000_3agn_cfg;
> --
> 1.6.3.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



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

^ permalink raw reply

* RE: [PATCH 01/47] iwlwifi: rename 6000 series Gen2 devices to Gen2a
From: Zhao, Shanyu @ 2010-05-10 22:52 UTC (permalink / raw)
  To: Gábor Stefanik, Chatre, Reinette
  Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net, Sternberg, Jay E
In-Reply-To: <z2l69e28c911005101546zeb388411pc3f8bb7f4325de78@mail.gmail.com>

Yes, there's another patch coming shortly to enable Gen2b devices.

Thanks,
Shanyu

>-----Original Message-----
>From: Gábor Stefanik [mailto:netrolller.3d@gmail.com]
>Sent: Monday, May 10, 2010 3:47 PM
>To: Chatre, Reinette
>Cc: linville@tuxdriver.com; linux-wireless@vger.kernel.org; ipw3945-
>devel@lists.sourceforge.net; Zhao, Shanyu; Sternberg, Jay E
>Subject: Re: [PATCH 01/47] iwlwifi: rename 6000 series Gen2 devices to Gen2a
>
>What is the reason behind this change? Is Gen2b planned?
>
>On Tue, May 11, 2010 at 12:27 AM, Reinette Chatre
><reinette.chatre@intel.com> wrote:
>> From: Shanyu Zhao <shanyu.zhao@intel.com>
>>
>> Rename the current 6000 series Gen2 devices to Gen2a.
>> Rename the ucode name prefix to iwlwifi-6000g2a.
>> Also corrected the device IDs for Gen2a series devices.
>>
>> Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
>> Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
>> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
>> ---
>>  drivers/net/wireless/iwlwifi/iwl-6000.c |   24 +++++++++++++-----------
>>  drivers/net/wireless/iwlwifi/iwl-agn.c  |    9 ++++-----
>>  drivers/net/wireless/iwlwifi/iwl-dev.h  |    2 +-
>>  3 files changed, 18 insertions(+), 17 deletions(-)
>>
>> diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c
>b/drivers/net/wireless/iwlwifi/iwl-6000.c
>> index 7acef70..f057087 100644
>> --- a/drivers/net/wireless/iwlwifi/iwl-6000.c
>> +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
>> @@ -67,9 +67,10 @@
>>  #define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
>>  #define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api)
>>
>> -#define IWL6000G2_FW_PRE "iwlwifi-6005-"
>> -#define _IWL6000G2_MODULE_FIRMWARE(api) IWL6000G2_FW_PRE #api ".ucode"
>> -#define IWL6000G2_MODULE_FIRMWARE(api) _IWL6000G2_MODULE_FIRMWARE(api)
>> +#define IWL6000G2A_FW_PRE "iwlwifi-6000g2a-"
>> +#define _IWL6000G2A_MODULE_FIRMWARE(api) IWL6000G2A_FW_PRE #api ".ucode"
>> +#define IWL6000G2A_MODULE_FIRMWARE(api) _IWL6000G2A_MODULE_FIRMWARE(api)
>> +
>>
>>  static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
>>  {
>> @@ -408,12 +409,10 @@ static const struct iwl_ops iwl6050_ops = {
>>        .led = &iwlagn_led_ops,
>>  };
>>
>> -/*
>> - * "i": Internal configuration, use internal Power Amplifier
>> - */
>> -struct iwl_cfg iwl6000g2_2agn_cfg = {
>> -       .name = "6000 Series 2x2 AGN Gen2",
>> -       .fw_name_pre = IWL6000G2_FW_PRE,
>> +
>> +struct iwl_cfg iwl6000g2a_2agn_cfg = {
>> +       .name = "6000 Series 2x2 AGN Gen2a",
>> +       .fw_name_pre = IWL6000G2A_FW_PRE,
>>        .ucode_api_max = IWL6000G2_UCODE_API_MAX,
>>        .ucode_api_min = IWL6000G2_UCODE_API_MIN,
>>        .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
>> @@ -442,9 +441,12 @@ struct iwl_cfg iwl6000g2_2agn_cfg = {
>>        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
>>        .chain_noise_scale = 1000,
>>        .monitor_recover_period = IWL_MONITORING_PERIOD,
>> -       .max_event_log_size = 1024,
>> +       .max_event_log_size = 512,
>>  };
>>
>> +/*
>> + * "i": Internal configuration, use internal Power Amplifier
>> + */
>>  struct iwl_cfg iwl6000i_2agn_cfg = {
>>        .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
>>        .fw_name_pre = IWL6000_FW_PRE,
>> @@ -645,4 +647,4 @@ struct iwl_cfg iwl6000_3agn_cfg = {
>>
>>  MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
>>  MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
>> -MODULE_FIRMWARE(IWL6000G2_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
>> +MODULE_FIRMWARE(IWL6000G2A_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
>> diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c
>b/drivers/net/wireless/iwlwifi/iwl-agn.c
>> index dc28376..5cf3822 100644
>> --- a/drivers/net/wireless/iwlwifi/iwl-agn.c
>> +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
>> @@ -3789,11 +3789,10 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
>>        {IWL_PCI_DEVICE(0x4239, 0x1311, iwl6000i_2agn_cfg)},
>>        {IWL_PCI_DEVICE(0x4239, 0x1316, iwl6000i_2abg_cfg)},
>>
>> -/* 6x00 Series Gen2 */
>> -       {IWL_PCI_DEVICE(0x0082, 0x1201, iwl6000g2_2agn_cfg)},
>> -       {IWL_PCI_DEVICE(0x0082, 0x1301, iwl6000g2_2agn_cfg)},
>> -       {IWL_PCI_DEVICE(0x0082, 0x1321, iwl6000g2_2agn_cfg)},
>> -       {IWL_PCI_DEVICE(0x0085, 0x1311, iwl6000g2_2agn_cfg)},
>> +/* 6x00 Series Gen2a */
>> +       {IWL_PCI_DEVICE(0x0082, 0x1201, iwl6000g2a_2agn_cfg)},
>> +       {IWL_PCI_DEVICE(0x0085, 0x1211, iwl6000g2a_2agn_cfg)},
>> +       {IWL_PCI_DEVICE(0x0082, 0x1221, iwl6000g2a_2agn_cfg)},
>>
>>  /* 6x50 WiFi/WiMax Series */
>>        {IWL_PCI_DEVICE(0x0087, 0x1301, iwl6050_2agn_cfg)},
>> diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h
>b/drivers/net/wireless/iwlwifi/iwl-dev.h
>> index cd3b932..e485465 100644
>> --- a/drivers/net/wireless/iwlwifi/iwl-dev.h
>> +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
>> @@ -57,8 +57,8 @@ extern struct iwl_cfg iwl5100_bgn_cfg;
>>  extern struct iwl_cfg iwl5100_abg_cfg;
>>  extern struct iwl_cfg iwl5150_agn_cfg;
>>  extern struct iwl_cfg iwl5150_abg_cfg;
>> +extern struct iwl_cfg iwl6000g2a_2agn_cfg;
>>  extern struct iwl_cfg iwl6000i_2agn_cfg;
>> -extern struct iwl_cfg iwl6000g2_2agn_cfg;
>>  extern struct iwl_cfg iwl6000i_2abg_cfg;
>>  extern struct iwl_cfg iwl6000i_2bg_cfg;
>>  extern struct iwl_cfg iwl6000_3agn_cfg;
>> --
>> 1.6.3.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless"
>in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
>
>
>--
>Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

^ permalink raw reply

* Re: kernel BUG in iwl-agn-rs.c:2076, WAS: iwlagn + some accesspoint == hardlock
From: reinette chatre @ 2010-05-10 23:32 UTC (permalink / raw)
  To: Nils Radtke
  Cc: linville@tuxdriver.com, linux-kernel@vger.kernel.org,
	linux-wireless@vger.kernel.org
In-Reply-To: <20100510183639.GA17523@localhost>

On Mon, 2010-05-10 at 11:36 -0700, Nils Radtke wrote:
>   Today weather was fine again, finally. So testing with .33.3 w/ the patch applied: 
> 
>   http://marc.info/?l=linux-wireless&m=127290931304496&w=2
> 
> The kernel kernel .32 was still running before it crashed immediately on wireless activation.
> The crash log showed again at least two messages, the last was as already described in my first
> message, bug from 2010-04-30: I think even the 0x2030 was the same:
> 
> EIP rs_tx_status +x8f/x2030 

You report an issue on 2.6.32 ...

> 
> W/ .33.3 and the above patch applied:

... but then test the patch with 2.6.33.

Which kernel are you focused on?


> Linux mypole 2.6.33.3 #18 SMP PREEMPT Thu May 6 21:51:37 CEST 2010 i686 GNU/Linux
> 
> May 10 19:14:11 [   80.586637] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
> May 10 19:23:17 [  626.476078] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
> May 10 19:23:30 [  638.913740] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
> May 10 19:23:32 [  641.232425] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
> May 10 19:23:54 [  663.392697] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
> May 10 19:23:58 [  666.980247] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
> May 10 19:24:02 [  671.121826] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now

Can you see any impact on your connection speed that can be connected to
these messages?

> Additionally these were logged, could you tell why they're there and what to do? (also .33.3 w/ patch)
> 
> May 10 19:24:16 [  685.079617] iwlagn 0000:03:00.0: iwl_tx_agg_start on ra = 00:1a:70:12:23:25 tid = 0
> May 10 19:24:22 [  691.026737] iwlagn 0000:03:00.0: iwl_tx_agg_start on ra = 00:1a:70:12:23:25 tid = 0
> May 10 19:28:02 [  911.406162] iwlagn 0000:03:00.0: iwl_tx_agg_start on ra = 00:1a:70:12:23:25 tid = 0
> May 10 19:35:38 [ 1367.251240] iwlagn 0000:03:00.0: iwl_tx_agg_start on ra = 00:1a:70:12:23:25 tid = 0
> 
> The above "iwl_tx_agg_start" lines happen when connecting - again to a Cisco AP - and the connection gets
> dropped the exact moment when a download is started. It even often drops when dhcp is still negotiating, has
> got it's IP but the nego isn't finished yet. Conn drops, same procedure again and again. This happens only
> with this Cisco AP (which is BTW another one from the "expected_tpt should have been calculated by now" 
> problem).

It could be that some of the queues get stuck. Can you try with the
patches in
http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2037#c113 ? They
are based on 2.6.33.

Reinette




^ permalink raw reply

* Re: [patch 1/9] iwlwifi: remove stray mutex_unlock()
From: Zhu Yi @ 2010-05-11  1:12 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Chatre, Reinette, Intel Linux Wireless, John W. Linville,
	Guy, Wey-Yi W, Berg, Johannes, Kolekar, Abhijeet,
	linux-wireless@vger.kernel.org
In-Reply-To: <20100508162101.GM27064@bicker>

On Sun, 2010-05-09 at 00:21 +0800, Dan Carpenter wrote:
> This mutex_unlock() has been here from the initial commit, but as nearly
> as I can tell, there isn't a reason for it.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
> index 9dad867..3faa78c 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-3945.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
> @@ -2482,7 +2482,6 @@ int iwl3945_hw_set_hw_params(struct iwl_priv *priv)
>  				   &priv->_3945.shared_phys, GFP_KERNEL);
>  	if (!priv->_3945.shared_virt) {
>  		IWL_ERR(priv, "failed to allocate pci memory\n");
> -		mutex_unlock(&priv->mutex);
>  		return -ENOMEM;
>  	}

Yeah, a mistake, definitely.

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

Thanks,
-yi


^ permalink raw reply

* [PATCH] ath9k_hw: new initialization values for AR9003
From: Luis R. Rodriguez @ 2010-05-11  1:42 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Luis R. Rodriguez, Don Breslin

These changes include:

  * For PAPRD, the TXRF3.capdiv5G, TXRF3.rdiv5G and TXRF3.rdiv2G
    are set to 0x0, the TXRF6.capdiv2G is set to 0x2 for all
    three chains.
  * The d2cas5G/d3cas5G/d4cas5G was updated to 4/4/4 in lowest_ob_db
    Tx gain table.
  * To improve DPPM, three parameters were updated (Released from Madhan):
	1. RANGE_OSDAC is set to 0x1 for 2G, 0x0 for 5G
	2. offsetC1 is set to 0xc
	3. inv_clk320_adc is set to 0x1
  * To reduce PHY error(from spur), cycpwr_thr1 and cycpwr_thr1_ext
    are increased to 0x8 at 2G.
  * The 2G Rx gain tables are updated with mixer gain setting 3,1,0.

The new checksums yield:

initvals -f ar9003
0x00000000c2bfa7d5        ar9300_2p0_radio_postamble
0x00000000ada2b114        ar9300Modes_lowest_ob_db_tx_gain_table_2p0
0x00000000e0bc2c84        ar9300Modes_fast_clock_2p0
0x00000000056eaf74        ar9300_2p0_radio_core
0x0000000000000000        ar9300Common_rx_gain_table_merlin_2p0
0x0000000078658fb5        ar9300_2p0_mac_postamble
0x0000000023235333        ar9300_2p0_soc_postamble
0x0000000054d41904        ar9200_merlin_2p0_radio_core
0x00000000748572cf        ar9300_2p0_baseband_postamble
0x000000009aa5a0a4        ar9300_2p0_baseband_core
0x000000003df9a326        ar9300Modes_high_power_tx_gain_table_2p0
0x000000001cfba124        ar9300Modes_high_ob_db_tx_gain_table_2p0
0x0000000011302700        ar9300Common_rx_gain_table_2p0
0x00000000e3eab114        ar9300Modes_low_ob_db_tx_gain_table_2p0
0x00000000c9d66d40        ar9300_2p0_mac_core
0x000000001e1d0800        ar9300Common_wo_xlna_rx_gain_table_2p0
0x00000000a0c54980        ar9300_2p0_soc_preamble
0x00000000292e2544        ar9300PciePhy_pll_on_clkreq_disable_L1_2p0
0x000000002d3e2544        ar9300PciePhy_clkreq_enable_L1_2p0
0x00000000293e2544        ar9300PciePhy_clkreq_disable_L1_2p0

Cc: Don Breslin <don.breslin@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_initvals.h |  268 +++++++++++-----------
 1 files changed, 134 insertions(+), 134 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_initvals.h b/drivers/net/wireless/ath/ath9k/ar9003_initvals.h
index ef6116e..db019dd 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_initvals.h
@@ -25,8 +25,11 @@ static const u32 ar9300_2p0_radio_postamble[][5] = {
 	{0x000160ac, 0xa4653c00, 0xa4653c00, 0x24652800, 0x24652800},
 	{0x000160b0, 0x03284f3e, 0x03284f3e, 0x05d08f20, 0x05d08f20},
 	{0x0001610c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
+	{0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
 	{0x0001650c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
+	{0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
 	{0x0001690c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
+	{0x00016940, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
 };
 
 static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p0[][5] = {
@@ -97,13 +100,13 @@ static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p0[][5] = {
 	{0x0000a5f8, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec},
 	{0x0000a5fc, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec},
 	{0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016048, 0x60001a61, 0x60001a61, 0x60001a61, 0x60001a61},
+	{0x00016048, 0x62480001, 0x62480001, 0x62480001, 0x62480001},
 	{0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016448, 0x60001a61, 0x60001a61, 0x60001a61, 0x60001a61},
+	{0x00016448, 0x62480001, 0x62480001, 0x62480001, 0x62480001},
 	{0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016848, 0x60001a61, 0x60001a61, 0x60001a61, 0x60001a61},
+	{0x00016848, 0x62480001, 0x62480001, 0x62480001, 0x62480001},
 	{0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 };
 
@@ -129,7 +132,7 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016040, 0x7f80fff8},
 	{0x0001604c, 0x76d005b5},
 	{0x00016050, 0x556cf031},
-	{0x00016054, 0x43449440},
+	{0x00016054, 0x13449440},
 	{0x00016058, 0x0c51c92c},
 	{0x0001605c, 0x3db7fffc},
 	{0x00016060, 0xfffffffc},
@@ -152,12 +155,11 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016100, 0x3fffbe01},
 	{0x00016104, 0xfff80000},
 	{0x00016108, 0x00080010},
-	{0x00016140, 0x10804008},
 	{0x00016144, 0x02084080},
 	{0x00016148, 0x00000000},
 	{0x00016280, 0x058a0001},
 	{0x00016284, 0x3d840208},
-	{0x00016288, 0x01a20408},
+	{0x00016288, 0x05a20408},
 	{0x0001628c, 0x00038c07},
 	{0x00016290, 0x40000004},
 	{0x00016294, 0x458aa14f},
@@ -190,7 +192,7 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016440, 0x7f80fff8},
 	{0x0001644c, 0x76d005b5},
 	{0x00016450, 0x556cf031},
-	{0x00016454, 0x43449440},
+	{0x00016454, 0x13449440},
 	{0x00016458, 0x0c51c92c},
 	{0x0001645c, 0x3db7fffc},
 	{0x00016460, 0xfffffffc},
@@ -199,7 +201,6 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016500, 0x3fffbe01},
 	{0x00016504, 0xfff80000},
 	{0x00016508, 0x00080010},
-	{0x00016540, 0x10804008},
 	{0x00016544, 0x02084080},
 	{0x00016548, 0x00000000},
 	{0x00016780, 0x00000000},
@@ -231,7 +232,7 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016840, 0x7f80fff8},
 	{0x0001684c, 0x76d005b5},
 	{0x00016850, 0x556cf031},
-	{0x00016854, 0x43449440},
+	{0x00016854, 0x13449440},
 	{0x00016858, 0x0c51c92c},
 	{0x0001685c, 0x3db7fffc},
 	{0x00016860, 0xfffffffc},
@@ -240,7 +241,6 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016900, 0x3fffbe01},
 	{0x00016904, 0xfff80000},
 	{0x00016908, 0x00080010},
-	{0x00016940, 0x10804008},
 	{0x00016944, 0x02084080},
 	{0x00016948, 0x00000000},
 	{0x00016b80, 0x00000000},
@@ -588,12 +588,12 @@ static const u32 ar9200_merlin_2p0_radio_core[][2] = {
 
 static const u32 ar9300_2p0_baseband_postamble[][5] = {
 	/* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-	{0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a800b},
+	{0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
 	{0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e},
 	{0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
 	{0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
 	{0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
-	{0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x00000b9c},
+	{0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c},
 	{0x00009c00, 0x00000044, 0x000000c4, 0x000000c4, 0x00000044},
 	{0x00009e00, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0},
 	{0x00009e04, 0x00802020, 0x00802020, 0x00802020, 0x00802020},
@@ -604,8 +604,8 @@ static const u32 ar9300_2p0_baseband_postamble[][5] = {
 	{0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
 	{0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
 	{0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
-	{0x00009e44, 0x02321e27, 0x02321e27, 0x02282324, 0x02282324},
-	{0x00009e48, 0x5030201a, 0x5030201a, 0x50302010, 0x50302010},
+	{0x00009e44, 0x02321e27, 0x02321e27, 0x02291e27, 0x02291e27},
+	{0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
 	{0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
 	{0x0000a204, 0x000037c0, 0x000037c4, 0x000037c4, 0x000037c0},
 	{0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
@@ -674,7 +674,7 @@ static const u32 ar9300_2p0_baseband_core[][2] = {
 	{0x00009d10, 0x01834061},
 	{0x00009d14, 0x00c0040b},
 	{0x00009d18, 0x00000000},
-	{0x00009e08, 0x0038233c},
+	{0x00009e08, 0x0038230c},
 	{0x00009e24, 0x990bb515},
 	{0x00009e28, 0x0c6f0000},
 	{0x00009e30, 0x06336f77},
@@ -901,13 +901,13 @@ static const u32 ar9300Modes_high_power_tx_gain_table_2p0[][5] = {
 	{0x0000a5f8, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec},
 	{0x0000a5fc, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec},
 	{0x00016044, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6},
-	{0x00016048, 0xae481a61, 0xae481a61, 0xae481a61, 0xae481a61},
+	{0x00016048, 0xae480001, 0xae480001, 0xae480001, 0xae480001},
 	{0x00016068, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c},
 	{0x00016444, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6},
-	{0x00016448, 0xae481a61, 0xae481a61, 0xae481a61, 0xae481a61},
+	{0x00016448, 0xae480001, 0xae480001, 0xae480001, 0xae480001},
 	{0x00016468, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c},
 	{0x00016844, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6},
-	{0x00016848, 0xae481a61, 0xae481a61, 0xae481a61, 0xae481a61},
+	{0x00016848, 0xae480001, 0xae480001, 0xae480001, 0xae480001},
 	{0x00016868, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c},
 };
 
@@ -979,13 +979,13 @@ static const u32 ar9300Modes_high_ob_db_tx_gain_table_2p0[][5] = {
 	{0x0000a5f8, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec},
 	{0x0000a5fc, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec},
 	{0x00016044, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4},
-	{0x00016048, 0x8e481a61, 0x8e481a61, 0x8e481a61, 0x8e481a61},
+	{0x00016048, 0x8e480001, 0x8e480001, 0x8e480001, 0x8e480001},
 	{0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016444, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4},
-	{0x00016448, 0x8e481a61, 0x8e481a61, 0x8e481a61, 0x8e481a61},
+	{0x00016448, 0x8e480001, 0x8e480001, 0x8e480001, 0x8e480001},
 	{0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016844, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4},
-	{0x00016848, 0x8e481a61, 0x8e481a61, 0x8e481a61, 0x8e481a61},
+	{0x00016848, 0x8e480001, 0x8e480001, 0x8e480001, 0x8e480001},
 	{0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 };
 
@@ -995,22 +995,22 @@ static const u32 ar9300Common_rx_gain_table_2p0[][2] = {
 	{0x0000a004, 0x00030002},
 	{0x0000a008, 0x00050004},
 	{0x0000a00c, 0x00810080},
-	{0x0000a010, 0x01800082},
-	{0x0000a014, 0x01820181},
-	{0x0000a018, 0x01840183},
-	{0x0000a01c, 0x01880185},
-	{0x0000a020, 0x018a0189},
-	{0x0000a024, 0x02850284},
-	{0x0000a028, 0x02890288},
-	{0x0000a02c, 0x028b028a},
-	{0x0000a030, 0x028d028c},
-	{0x0000a034, 0x02910290},
-	{0x0000a038, 0x02930292},
-	{0x0000a03c, 0x03910390},
-	{0x0000a040, 0x03930392},
-	{0x0000a044, 0x03950394},
-	{0x0000a048, 0x00000396},
-	{0x0000a04c, 0x00000000},
+	{0x0000a010, 0x00830082},
+	{0x0000a014, 0x01810180},
+	{0x0000a018, 0x01830182},
+	{0x0000a01c, 0x01850184},
+	{0x0000a020, 0x01890188},
+	{0x0000a024, 0x018b018a},
+	{0x0000a028, 0x018d018c},
+	{0x0000a02c, 0x01910190},
+	{0x0000a030, 0x01930192},
+	{0x0000a034, 0x01950194},
+	{0x0000a038, 0x038a0196},
+	{0x0000a03c, 0x038c038b},
+	{0x0000a040, 0x0390038d},
+	{0x0000a044, 0x03920391},
+	{0x0000a048, 0x03940393},
+	{0x0000a04c, 0x03960395},
 	{0x0000a050, 0x00000000},
 	{0x0000a054, 0x00000000},
 	{0x0000a058, 0x00000000},
@@ -1023,14 +1023,14 @@ static const u32 ar9300Common_rx_gain_table_2p0[][2] = {
 	{0x0000a074, 0x00000000},
 	{0x0000a078, 0x00000000},
 	{0x0000a07c, 0x00000000},
-	{0x0000a080, 0x28282828},
-	{0x0000a084, 0x21212128},
-	{0x0000a088, 0x21212121},
-	{0x0000a08c, 0x1c1c1c21},
-	{0x0000a090, 0x1c1c1c1c},
-	{0x0000a094, 0x17171c1c},
-	{0x0000a098, 0x02020212},
-	{0x0000a09c, 0x02020202},
+	{0x0000a080, 0x22222229},
+	{0x0000a084, 0x1d1d1d1d},
+	{0x0000a088, 0x1d1d1d1d},
+	{0x0000a08c, 0x1d1d1d1d},
+	{0x0000a090, 0x171d1d1d},
+	{0x0000a094, 0x11111717},
+	{0x0000a098, 0x00030311},
+	{0x0000a09c, 0x00000000},
 	{0x0000a0a0, 0x00000000},
 	{0x0000a0a4, 0x00000000},
 	{0x0000a0a8, 0x00000000},
@@ -1040,26 +1040,26 @@ static const u32 ar9300Common_rx_gain_table_2p0[][2] = {
 	{0x0000a0b8, 0x00000000},
 	{0x0000a0bc, 0x00000000},
 	{0x0000a0c0, 0x001f0000},
-	{0x0000a0c4, 0x011f0100},
-	{0x0000a0c8, 0x011d011e},
-	{0x0000a0cc, 0x011b011c},
+	{0x0000a0c4, 0x01000101},
+	{0x0000a0c8, 0x011e011f},
+	{0x0000a0cc, 0x011c011d},
 	{0x0000a0d0, 0x02030204},
 	{0x0000a0d4, 0x02010202},
 	{0x0000a0d8, 0x021f0200},
-	{0x0000a0dc, 0x021d021e},
-	{0x0000a0e0, 0x03010302},
-	{0x0000a0e4, 0x031f0300},
-	{0x0000a0e8, 0x0402031e},
+	{0x0000a0dc, 0x0302021e},
+	{0x0000a0e0, 0x03000301},
+	{0x0000a0e4, 0x031e031f},
+	{0x0000a0e8, 0x0402031d},
 	{0x0000a0ec, 0x04000401},
 	{0x0000a0f0, 0x041e041f},
-	{0x0000a0f4, 0x05010502},
-	{0x0000a0f8, 0x051f0500},
-	{0x0000a0fc, 0x0602051e},
-	{0x0000a100, 0x06000601},
-	{0x0000a104, 0x061e061f},
-	{0x0000a108, 0x0703061d},
-	{0x0000a10c, 0x07010702},
-	{0x0000a110, 0x00000700},
+	{0x0000a0f4, 0x0502041d},
+	{0x0000a0f8, 0x05000501},
+	{0x0000a0fc, 0x051e051f},
+	{0x0000a100, 0x06010602},
+	{0x0000a104, 0x061f0600},
+	{0x0000a108, 0x061d061e},
+	{0x0000a10c, 0x07020703},
+	{0x0000a110, 0x07000701},
 	{0x0000a114, 0x00000000},
 	{0x0000a118, 0x00000000},
 	{0x0000a11c, 0x00000000},
@@ -1072,26 +1072,26 @@ static const u32 ar9300Common_rx_gain_table_2p0[][2] = {
 	{0x0000a138, 0x00000000},
 	{0x0000a13c, 0x00000000},
 	{0x0000a140, 0x001f0000},
-	{0x0000a144, 0x011f0100},
-	{0x0000a148, 0x011d011e},
-	{0x0000a14c, 0x011b011c},
+	{0x0000a144, 0x01000101},
+	{0x0000a148, 0x011e011f},
+	{0x0000a14c, 0x011c011d},
 	{0x0000a150, 0x02030204},
 	{0x0000a154, 0x02010202},
 	{0x0000a158, 0x021f0200},
-	{0x0000a15c, 0x021d021e},
-	{0x0000a160, 0x03010302},
-	{0x0000a164, 0x031f0300},
-	{0x0000a168, 0x0402031e},
+	{0x0000a15c, 0x0302021e},
+	{0x0000a160, 0x03000301},
+	{0x0000a164, 0x031e031f},
+	{0x0000a168, 0x0402031d},
 	{0x0000a16c, 0x04000401},
 	{0x0000a170, 0x041e041f},
-	{0x0000a174, 0x05010502},
-	{0x0000a178, 0x051f0500},
-	{0x0000a17c, 0x0602051e},
-	{0x0000a180, 0x06000601},
-	{0x0000a184, 0x061e061f},
-	{0x0000a188, 0x0703061d},
-	{0x0000a18c, 0x07010702},
-	{0x0000a190, 0x00000700},
+	{0x0000a174, 0x0502041d},
+	{0x0000a178, 0x05000501},
+	{0x0000a17c, 0x051e051f},
+	{0x0000a180, 0x06010602},
+	{0x0000a184, 0x061f0600},
+	{0x0000a188, 0x061d061e},
+	{0x0000a18c, 0x07020703},
+	{0x0000a190, 0x07000701},
 	{0x0000a194, 0x00000000},
 	{0x0000a198, 0x00000000},
 	{0x0000a19c, 0x00000000},
@@ -1317,13 +1317,13 @@ static const u32 ar9300Modes_low_ob_db_tx_gain_table_2p0[][5] = {
 	{0x0000a5f8, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec},
 	{0x0000a5fc, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec},
 	{0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016048, 0x64001a61, 0x64001a61, 0x64001a61, 0x64001a61},
+	{0x00016048, 0x64000001, 0x64000001, 0x64000001, 0x64000001},
 	{0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016448, 0x64001a61, 0x64001a61, 0x64001a61, 0x64001a61},
+	{0x00016448, 0x64000001, 0x64000001, 0x64000001, 0x64000001},
 	{0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016848, 0x64001a61, 0x64001a61, 0x64001a61, 0x64001a61},
+	{0x00016848, 0x64000001, 0x64000001, 0x64000001, 0x64000001},
 	{0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 };
 
@@ -1497,22 +1497,22 @@ static const u32 ar9300Common_wo_xlna_rx_gain_table_2p0[][2] = {
 	{0x0000a004, 0x00030002},
 	{0x0000a008, 0x00050004},
 	{0x0000a00c, 0x00810080},
-	{0x0000a010, 0x01800082},
-	{0x0000a014, 0x01820181},
-	{0x0000a018, 0x01840183},
-	{0x0000a01c, 0x01880185},
-	{0x0000a020, 0x018a0189},
-	{0x0000a024, 0x02850284},
-	{0x0000a028, 0x02890288},
-	{0x0000a02c, 0x03850384},
-	{0x0000a030, 0x03890388},
-	{0x0000a034, 0x038b038a},
-	{0x0000a038, 0x038d038c},
-	{0x0000a03c, 0x03910390},
-	{0x0000a040, 0x03930392},
-	{0x0000a044, 0x03950394},
-	{0x0000a048, 0x00000396},
-	{0x0000a04c, 0x00000000},
+	{0x0000a010, 0x00830082},
+	{0x0000a014, 0x01810180},
+	{0x0000a018, 0x01830182},
+	{0x0000a01c, 0x01850184},
+	{0x0000a020, 0x01890188},
+	{0x0000a024, 0x018b018a},
+	{0x0000a028, 0x018d018c},
+	{0x0000a02c, 0x03820190},
+	{0x0000a030, 0x03840383},
+	{0x0000a034, 0x03880385},
+	{0x0000a038, 0x038a0389},
+	{0x0000a03c, 0x038c038b},
+	{0x0000a040, 0x0390038d},
+	{0x0000a044, 0x03920391},
+	{0x0000a048, 0x03940393},
+	{0x0000a04c, 0x03960395},
 	{0x0000a050, 0x00000000},
 	{0x0000a054, 0x00000000},
 	{0x0000a058, 0x00000000},
@@ -1525,15 +1525,15 @@ static const u32 ar9300Common_wo_xlna_rx_gain_table_2p0[][2] = {
 	{0x0000a074, 0x00000000},
 	{0x0000a078, 0x00000000},
 	{0x0000a07c, 0x00000000},
-	{0x0000a080, 0x28282828},
-	{0x0000a084, 0x28282828},
-	{0x0000a088, 0x28282828},
-	{0x0000a08c, 0x28282828},
-	{0x0000a090, 0x28282828},
-	{0x0000a094, 0x21212128},
-	{0x0000a098, 0x171c1c1c},
-	{0x0000a09c, 0x02020212},
-	{0x0000a0a0, 0x00000202},
+	{0x0000a080, 0x29292929},
+	{0x0000a084, 0x29292929},
+	{0x0000a088, 0x29292929},
+	{0x0000a08c, 0x29292929},
+	{0x0000a090, 0x22292929},
+	{0x0000a094, 0x1d1d2222},
+	{0x0000a098, 0x0c111117},
+	{0x0000a09c, 0x00030303},
+	{0x0000a0a0, 0x00000000},
 	{0x0000a0a4, 0x00000000},
 	{0x0000a0a8, 0x00000000},
 	{0x0000a0ac, 0x00000000},
@@ -1542,26 +1542,26 @@ static const u32 ar9300Common_wo_xlna_rx_gain_table_2p0[][2] = {
 	{0x0000a0b8, 0x00000000},
 	{0x0000a0bc, 0x00000000},
 	{0x0000a0c0, 0x001f0000},
-	{0x0000a0c4, 0x011f0100},
-	{0x0000a0c8, 0x011d011e},
-	{0x0000a0cc, 0x011b011c},
+	{0x0000a0c4, 0x01000101},
+	{0x0000a0c8, 0x011e011f},
+	{0x0000a0cc, 0x011c011d},
 	{0x0000a0d0, 0x02030204},
 	{0x0000a0d4, 0x02010202},
 	{0x0000a0d8, 0x021f0200},
-	{0x0000a0dc, 0x021d021e},
-	{0x0000a0e0, 0x03010302},
-	{0x0000a0e4, 0x031f0300},
-	{0x0000a0e8, 0x0402031e},
+	{0x0000a0dc, 0x0302021e},
+	{0x0000a0e0, 0x03000301},
+	{0x0000a0e4, 0x031e031f},
+	{0x0000a0e8, 0x0402031d},
 	{0x0000a0ec, 0x04000401},
 	{0x0000a0f0, 0x041e041f},
-	{0x0000a0f4, 0x05010502},
-	{0x0000a0f8, 0x051f0500},
-	{0x0000a0fc, 0x0602051e},
-	{0x0000a100, 0x06000601},
-	{0x0000a104, 0x061e061f},
-	{0x0000a108, 0x0703061d},
-	{0x0000a10c, 0x07010702},
-	{0x0000a110, 0x00000700},
+	{0x0000a0f4, 0x0502041d},
+	{0x0000a0f8, 0x05000501},
+	{0x0000a0fc, 0x051e051f},
+	{0x0000a100, 0x06010602},
+	{0x0000a104, 0x061f0600},
+	{0x0000a108, 0x061d061e},
+	{0x0000a10c, 0x07020703},
+	{0x0000a110, 0x07000701},
 	{0x0000a114, 0x00000000},
 	{0x0000a118, 0x00000000},
 	{0x0000a11c, 0x00000000},
@@ -1574,26 +1574,26 @@ static const u32 ar9300Common_wo_xlna_rx_gain_table_2p0[][2] = {
 	{0x0000a138, 0x00000000},
 	{0x0000a13c, 0x00000000},
 	{0x0000a140, 0x001f0000},
-	{0x0000a144, 0x011f0100},
-	{0x0000a148, 0x011d011e},
-	{0x0000a14c, 0x011b011c},
+	{0x0000a144, 0x01000101},
+	{0x0000a148, 0x011e011f},
+	{0x0000a14c, 0x011c011d},
 	{0x0000a150, 0x02030204},
 	{0x0000a154, 0x02010202},
 	{0x0000a158, 0x021f0200},
-	{0x0000a15c, 0x021d021e},
-	{0x0000a160, 0x03010302},
-	{0x0000a164, 0x031f0300},
-	{0x0000a168, 0x0402031e},
+	{0x0000a15c, 0x0302021e},
+	{0x0000a160, 0x03000301},
+	{0x0000a164, 0x031e031f},
+	{0x0000a168, 0x0402031d},
 	{0x0000a16c, 0x04000401},
 	{0x0000a170, 0x041e041f},
-	{0x0000a174, 0x05010502},
-	{0x0000a178, 0x051f0500},
-	{0x0000a17c, 0x0602051e},
-	{0x0000a180, 0x06000601},
-	{0x0000a184, 0x061e061f},
-	{0x0000a188, 0x0703061d},
-	{0x0000a18c, 0x07010702},
-	{0x0000a190, 0x00000700},
+	{0x0000a174, 0x0502041d},
+	{0x0000a178, 0x05000501},
+	{0x0000a17c, 0x051e051f},
+	{0x0000a180, 0x06010602},
+	{0x0000a184, 0x061f0600},
+	{0x0000a188, 0x061d061e},
+	{0x0000a18c, 0x07020703},
+	{0x0000a190, 0x07000701},
 	{0x0000a194, 0x00000000},
 	{0x0000a198, 0x00000000},
 	{0x0000a19c, 0x00000000},
@@ -1620,7 +1620,7 @@ static const u32 ar9300Common_wo_xlna_rx_gain_table_2p0[][2] = {
 	{0x0000a1f0, 0x00000396},
 	{0x0000a1f4, 0x00000396},
 	{0x0000a1f8, 0x00000396},
-	{0x0000a1fc, 0x00000296},
+	{0x0000a1fc, 0x00000196},
 	{0x0000b000, 0x00010000},
 	{0x0000b004, 0x00030002},
 	{0x0000b008, 0x00050004},
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH 1/2] ath9k: Fix bug in handling rx frames with invalid descriptor content
From: Vasanthakumar Thiagarajan @ 2010-05-11  2:41 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

Don't send them for further processing.

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

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index ac60c4e..da54ff5 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -718,6 +718,7 @@ static bool ath_edma_get_buffers(struct ath_softc *sc,
 		__skb_unlink(skb, &rx_edma->rx_fifo);
 		list_add_tail(&bf->list, &sc->rx.rxbuf);
 		ath_rx_edma_buf_link(sc, qtype);
+		return true;
 	}
 	skb_queue_tail(&rx_edma->rx_buffers, skb);
 
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 2/2] ath9k: Remove unused rx_edma in ath_rx_addbuffer_edma()
From: Vasanthakumar Thiagarajan @ 2010-05-11  2:41 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1273545695-2987-1-git-send-email-vasanth@atheros.com>

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

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index da54ff5..ba13913 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -150,11 +150,9 @@ static bool ath_rx_edma_buf_link(struct ath_softc *sc,
 static void ath_rx_addbuffer_edma(struct ath_softc *sc,
 				  enum ath9k_rx_qtype qtype, int size)
 {
-	struct ath_rx_edma *rx_edma;
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 	u32 nbuf = 0;
 
-	rx_edma = &sc->rx.rx_edma[qtype];
 	if (list_empty(&sc->rx.rxbuf)) {
 		ath_print(common, ATH_DBG_QUEUE, "No free rx buf available\n");
 		return;
-- 
1.7.0.4


^ permalink raw reply related

* Re: [patch 7/9] wl1271: add missing spin_lock()
From: Luciano Coelho @ 2010-05-11  4:27 UTC (permalink / raw)
  To: ext Dan Carpenter
  Cc: John W. Linville, Oikarinen Juuso (Nokia-D/Tampere),
	Paasikivi Teemu.3 (EXT-Ixonos/Tampere), Kalle Valo,
	linux-wireless@vger.kernel.org
In-Reply-To: <20100508162517.GS27064@bicker>

On Sat, 2010-05-08 at 18:25 +0200, ext Dan Carpenter wrote:
> We should start the loop consistently with the "wl_lock" lock held.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
> index 3e4b9fb..b61cd10 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_main.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_main.c
> @@ -466,6 +466,7 @@ static void wl1271_irq_work(struct work_struct *work)
>  		intr = le32_to_cpu(wl->fw_status->intr);
>  		if (!intr) {
>  			wl1271_debug(DEBUG_IRQ, "Zero interrupt received.");
> +			spin_lock_irqsave(&wl->wl_lock, flags);
>  			continue;
>  		}
>  

Good catch.  Thank you.

Acked-by: Luciano Coelho <luciano.coelho@nokia.com>


-- 
Cheers,
Luca.



^ permalink raw reply

* Re: [patch 8/9] wl1271: fix notifier interface supported test
From: Luciano Coelho @ 2010-05-11  4:27 UTC (permalink / raw)
  To: ext Dan Carpenter
  Cc: John W. Linville, Oikarinen Juuso (Nokia-D/Tampere),
	Paasikivi Teemu.3 (EXT-Ixonos/Tampere), Kalle Valo,
	linux-wireless@vger.kernel.org
In-Reply-To: <20100508162551.GT27064@bicker>

On Sat, 2010-05-08 at 18:25 +0200, ext Dan Carpenter wrote:
> The "(wl == NULL)" test doesn't work here because "wl" is always
> non-null.  The intent of the code is to return if the interface
> was not supported by the driver.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
> index b61cd10..55aa813 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_main.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_main.c
> @@ -852,7 +852,7 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
>  		if (wl == wl_temp)
>  			break;
>  	}
> -	if (wl == NULL)
> +	if (wl != wl_temp)
>  		return NOTIFY_DONE;
>  
>  	/* Get the interface IP address for the device. "ifa" will become

Thanks for the fix.

Acked-by: Luciano Coelho <luciano.coelho@nokia.com>


-- 
Cheers,
Luca.



^ permalink raw reply

* Re: [patch 9/9] wl1271: remove some unneeded code
From: Luciano Coelho @ 2010-05-11  4:28 UTC (permalink / raw)
  To: ext Dan Carpenter
  Cc: John W. Linville, Oikarinen Juuso (Nokia-D/Tampere),
	Paasikivi Teemu.3 (EXT-Ixonos/Tampere), Kalle Valo,
	linux-wireless@vger.kernel.org
In-Reply-To: <20100508162638.GU27064@bicker>

On Sat, 2010-05-08 at 18:26 +0200, ext Dan Carpenter wrote:
> The goto and the break are equivelent.  I removed the goto in memory of
> Edsger Dijkstra who famously hated gotos and who would have been eighty
> years old next Tuesday.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
> index 55aa813..da40cee 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_main.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_main.c
> @@ -1563,8 +1563,6 @@ static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
>  	default:
>  		wl1271_error("Unsupported key cmd 0x%x", cmd);
>  		ret = -EOPNOTSUPP;
> -		goto out_sleep;
> -
>  		break;
>  	}

We use goto out_* in error cases throughout our code (sorry Edsger!) and
in many cases they are not needed because they're the last check in the
function, but we still use them for consistency.

In this case, there are two "consistency" items conflicting with each
other (ie. the "break" in the last case entry is not needed, but it's
there for consistency).  Your change indeed makes the code look cleaner,
so I think the "keep-the-break-in-the-default-case" rule should win
here. ;)

Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
 


-- 
Cheers,
Luca.



^ permalink raw reply

* [patch 2/9] ath9k: range checking issues in htc_hst.c
From: Sujith.Manoharan @ 2010-05-11  5:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Luis Rodriguez, Jouni Malinen, Vasanth Thiagarajan,
	Senthilkumar Balasubramanian, John W. Linville, Ming Lei,
	linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org
In-Reply-To: <20100508162201.GN27064@bicker>

Dan Carpenter wrote:
> The original code had ENDPOINT_MAX and HST_ENDPOINT_MAX switched.
> 
> Also the first loop was off by one, it started past the end of the array
> and went down to 1 instead of going down to 0.  The test at the end of
> the loop to see if we exited via a break wasn't right because
> "tmp_endpoint" is always non-null here.

This is a very good catch and fixes a stack corruption issue.
Do you mind if I work upon this patch and send out an updated fix ?

Sujith

^ permalink raw reply

* Re: pull request: wireless-2.6 2010-05-10
From: David Miller @ 2010-05-11  5:54 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20100510174329.GC11681@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Mon, 10 May 2010 13:43:29 -0400

> Here are three more candidates for 2.6.34.  I hesitated to push them,
> but at least two of them are documented regressions and the other (i.e.
> "iwlwifi: work around passive scan issue") avoids some rather annoying
> firmware restarts at little or no risk.  I think it would be good to
> take these now rather than later.
> 
> Please let me know if there are problems!

Pulled, thanks John.

^ permalink raw reply

* [RFC PATCH 0/2] mac80211: antenna configuration
From: Bruno Randolf @ 2010-05-11  8:38 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig

hi!

this adds antenna configuration via nl80211. patches for iw will follow
shortly.

i have followed holger schurig's suggestion to use a bitmap for allowed
antennas. when multiple antennas are selected in the bitmap, the driver may use
diversity. i think that this allows for the most flexible, yet simple
configuration of antennas, and drivers can just reject configurations they
cannot support. i hope that this will also be generic enough for 802.11n with
multiple antennas - but for the moment i think the most important use case is
that we sometimes know that only one antenna is available and we want to
disable diversity and use only one fixed antenna. at least for ath5k this is
sometimes necessary to get good results with only one antenna.

please check it out and let me know what you think,
bruno

---

Bruno Randolf (2):
      mac80211: Add nl80211 antenna configuration
      ath5k: Add support for cfg80211 antenna setting


 drivers/net/wireless/ath/ath5k/base.c |   34 ++++++++++
 include/linux/nl80211.h               |   12 +++
 include/net/cfg80211.h                |    3 +
 include/net/mac80211.h                |    2 +
 net/mac80211/cfg.c                    |   16 +++++
 net/mac80211/driver-ops.h             |   21 ++++++
 net/wireless/nl80211.c                |  114 +++++++++++++++++++++++++++++++++
 7 files changed, 202 insertions(+), 0 deletions(-)

-- 
Signature

^ permalink raw reply

* [RFC PATCH 1/2] mac80211: Add nl80211 antenna configuration
From: Bruno Randolf @ 2010-05-11  8:39 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig
In-Reply-To: <20100511083121.28289.96180.stgit@tt-desk>

Allow setting TX and RX antenna configuration via nl80211/cfg80211.

The antenna configuration is defined as a bitmap of allowed antennas. This
bitmap is 8 bit at the moment, each bit representing one antenna. If multiple
antennas are selected, the driver may use diversity for receive and transmit.
This allows for a simple, yet flexible configuration interface for antennas,
while drivers may reject configurations they cannot support.

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 include/linux/nl80211.h   |   12 +++++
 include/net/cfg80211.h    |    3 +
 include/net/mac80211.h    |    2 +
 net/mac80211/cfg.c        |   16 ++++++
 net/mac80211/driver-ops.h |   21 ++++++++
 net/wireless/nl80211.c    |  114 +++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 168 insertions(+), 0 deletions(-)

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index b7c77f9..46a2c76 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -341,6 +341,9 @@
  *	of any other interfaces, and other interfaces will again take
  *	precedence when they are used.
  *
+ * @NL80211_CMD_SET_ANTENNA: Set a bitmap of antennas to use.
+ * @NL80211_CMD_GET_ANTENNA: Get antenna configuration from driver.
+ *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
  */
@@ -441,6 +444,9 @@ enum nl80211_commands {
 
 	NL80211_CMD_SET_CHANNEL,
 
+	NL80211_CMD_SET_ANTENNA,
+	NL80211_CMD_GET_ANTENNA,
+
 	/* add new commands above here */
 
 	/* used to define NL80211_CMD_MAX below */
@@ -725,6 +731,9 @@ enum nl80211_commands {
  * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
  *	connected to this BSS.
  *
+ * @NL80211_ATTR_ANTENNA_TX: Bitmap of antennas to use for transmitting.
+ * @NL80211_ATTR_ANTENNA_RX: Bitmap of antennas to use for receiving.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -882,6 +891,9 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_AP_ISOLATE,
 
+	NL80211_ATTR_ANTENNA_TX,
+	NL80211_ATTR_ANTENNA_RX,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b44a2e5..8861f40 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1176,6 +1176,9 @@ struct cfg80211_ops {
 	int	(*set_cqm_rssi_config)(struct wiphy *wiphy,
 				       struct net_device *dev,
 				       s32 rssi_thold, u32 rssi_hyst);
+
+	int	(*set_antenna)(struct wiphy *wiphy, u8 tx_ant, u8 rx_ant);
+	int	(*get_antenna)(struct wiphy *wiphy, u8 *tx_ant, u8 *rx_ant);
 };
 
 /*
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9448a5b..1a8f97a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1694,6 +1694,8 @@ struct ieee80211_ops {
 	int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
 #endif
 	void (*flush)(struct ieee80211_hw *hw, bool drop);
+	int (*set_antenna)(struct ieee80211_hw *hw, u8 tx_ant, u8 rx_ant);
+	int (*get_antenna)(struct ieee80211_hw *hw, u8 *tx_ant, u8 *rx_ant);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index c7000a6..efd04bc 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1560,6 +1560,20 @@ static int ieee80211_action(struct wiphy *wiphy, struct net_device *dev,
 				    channel_type, buf, len, cookie);
 }
 
+static int ieee80211_set_antenna(struct wiphy *wiphy, u8 tx_ant, u8 rx_ant)
+{
+	struct ieee80211_local *local = wiphy_priv(wiphy);
+
+	return drv_set_antenna(local, tx_ant, rx_ant);
+}
+
+static int ieee80211_get_antenna(struct wiphy *wiphy, u8 *tx_ant, u8 *rx_ant)
+{
+	struct ieee80211_local *local = wiphy_priv(wiphy);
+
+	return drv_get_antenna(local, tx_ant, rx_ant);
+}
+
 struct cfg80211_ops mac80211_config_ops = {
 	.add_virtual_intf = ieee80211_add_iface,
 	.del_virtual_intf = ieee80211_del_iface,
@@ -1611,4 +1625,6 @@ struct cfg80211_ops mac80211_config_ops = {
 	.cancel_remain_on_channel = ieee80211_cancel_remain_on_channel,
 	.action = ieee80211_action,
 	.set_cqm_rssi_config = ieee80211_set_cqm_rssi_config,
+	.set_antenna = ieee80211_set_antenna,
+	.get_antenna = ieee80211_get_antenna,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 997008e..d6fe1b7 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -373,4 +373,25 @@ static inline void drv_flush(struct ieee80211_local *local, bool drop)
 	if (local->ops->flush)
 		local->ops->flush(&local->hw, drop);
 }
+
+static inline int drv_set_antenna(struct ieee80211_local *local,
+				  u8 tx_ant, u8 rx_ant)
+{
+	int ret = -EOPNOTSUPP;
+	might_sleep();
+	if (local->ops->set_antenna)
+		ret = local->ops->set_antenna(&local->hw, tx_ant, rx_ant);
+	return ret;
+}
+
+static inline int drv_get_antenna(struct ieee80211_local *local,
+				  u8 *tx_ant, u8 *rx_ant)
+{
+	int ret = -EOPNOTSUPP;
+	might_sleep();
+	if (local->ops->get_antenna)
+		ret = local->ops->get_antenna(&local->hw, tx_ant, rx_ant);
+	return ret;
+}
+
 #endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index aaa1aad..dbfc126 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -153,6 +153,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
 	[NL80211_ATTR_CQM] = { .type = NLA_NESTED, },
 	[NL80211_ATTR_LOCAL_STATE_CHANGE] = { .type = NLA_FLAG },
 	[NL80211_ATTR_AP_ISOLATE] = { .type = NLA_U8 },
+	[NL80211_ATTR_ANTENNA_TX] = { .type = NLA_U8 },
+	[NL80211_ATTR_ANTENNA_RX] = { .type = NLA_U8 },
 };
 
 /* policy for the attributes */
@@ -4963,6 +4965,106 @@ out:
 	return err;
 }
 
+static int nl80211_set_antenna(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev;
+	int res;
+	u8 rx_ant = 0, tx_ant = 0;
+
+	if (!info->attrs[NL80211_ATTR_WIPHY] ||
+	    !info->attrs[NL80211_ATTR_ANTENNA_TX] ||
+	    !info->attrs[NL80211_ATTR_ANTENNA_RX]) {
+		return -EINVAL;
+	}
+
+	tx_ant = nla_get_u8(info->attrs[NL80211_ATTR_ANTENNA_TX]);
+	rx_ant = nla_get_u8(info->attrs[NL80211_ATTR_ANTENNA_RX]);
+
+	rtnl_lock();
+
+	rdev = cfg80211_get_dev_from_info(info);
+	if (IS_ERR(rdev)) {
+		res = -ENODEV;
+		goto unlock_rtnl;
+	}
+
+	if (!rdev->ops->set_antenna) {
+		res = -EOPNOTSUPP;
+		goto unlock_rdev;
+	}
+
+	res = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
+
+ unlock_rdev:
+	cfg80211_unlock_rdev(rdev);
+
+ unlock_rtnl:
+	rtnl_unlock();
+	return res;
+}
+
+static int nl80211_get_antenna(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev;
+	struct sk_buff *msg;
+	void *hdr;
+	int res;
+	u8 tx_ant, rx_ant;
+
+	if (!info->attrs[NL80211_ATTR_WIPHY])
+		return -EINVAL;
+
+	rtnl_lock();
+
+	rdev = cfg80211_get_dev_from_info(info);
+	if (IS_ERR(rdev)) {
+		res = -ENODEV;
+		goto unlock_rtnl;
+	}
+
+	if (!rdev->ops->get_antenna) {
+		res = -EOPNOTSUPP;
+		goto unlock_rdev;
+	}
+
+	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+	if (!msg) {
+		res = -ENOMEM;
+		goto unlock_rdev;
+	}
+
+	hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0,
+			     NL80211_CMD_GET_ANTENNA);
+	if (!hdr) {
+		res = -ENOMEM;
+		goto free_msg;
+	}
+
+	res = rdev->ops->get_antenna(&rdev->wiphy, &tx_ant, &rx_ant);
+	if (res)
+		goto free_msg;
+
+	NLA_PUT_U32(msg, NL80211_ATTR_ANTENNA_TX, tx_ant);
+	NLA_PUT_U32(msg, NL80211_ATTR_ANTENNA_RX, rx_ant);
+
+	genlmsg_end(msg, hdr);
+	res = genlmsg_reply(msg, info);
+	goto unlock_rdev;
+
+ nla_put_failure:
+	res = -ENOBUFS;
+
+ free_msg:
+	nlmsg_free(msg);
+
+ unlock_rdev:
+	cfg80211_unlock_rdev(rdev);
+
+ unlock_rtnl:
+	rtnl_unlock();
+	return res;
+}
+
 static struct genl_ops nl80211_ops[] = {
 	{
 		.cmd = NL80211_CMD_GET_WIPHY,
@@ -5279,6 +5381,18 @@ static struct genl_ops nl80211_ops[] = {
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
 	},
+	{
+		.cmd = NL80211_CMD_SET_ANTENNA,
+		.doit = nl80211_set_antenna,
+		.policy = nl80211_policy,
+		.flags = GENL_ADMIN_PERM,
+	},
+	{
+		.cmd = NL80211_CMD_GET_ANTENNA,
+		.doit = nl80211_get_antenna,
+		.policy = nl80211_policy,
+		/* can be retrieved by unprivileged users */
+	},
 };
 
 static struct genl_multicast_group nl80211_mlme_mcgrp = {


^ permalink raw reply related

* [RFC PATCH 2/2] ath5k: Add support for cfg80211 antenna setting
From: Bruno Randolf @ 2010-05-11  8:39 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig
In-Reply-To: <20100511083121.28289.96180.stgit@tt-desk>

Support setting the antenna configuration via cfg80211. At the moment only
allow the simple pre-defined configurations we already have (fixed antenna A/B
or diversity), but more advanced settings should be possible later.

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 drivers/net/wireless/ath/ath5k/base.c |   34 +++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index a99f310..fbf3d45 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -256,6 +256,8 @@ static void ath5k_sw_scan_start(struct ieee80211_hw *hw);
 static void ath5k_sw_scan_complete(struct ieee80211_hw *hw);
 static void ath5k_set_coverage_class(struct ieee80211_hw *hw,
 		u8 coverage_class);
+static int ath5k_set_antenna(struct ieee80211_hw *hw, u8 tx_ant, u8 rx_ant);
+static int ath5k_get_antenna(struct ieee80211_hw *hw, u8 *tx_ant, u8 *rx_ant);
 
 static const struct ieee80211_ops ath5k_hw_ops = {
 	.tx 		= ath5k_tx,
@@ -277,6 +279,8 @@ static const struct ieee80211_ops ath5k_hw_ops = {
 	.sw_scan_start	= ath5k_sw_scan_start,
 	.sw_scan_complete = ath5k_sw_scan_complete,
 	.set_coverage_class = ath5k_set_coverage_class,
+	.set_antenna	= ath5k_set_antenna,
+	.get_antenna	= ath5k_get_antenna,
 };
 
 /*
@@ -3482,3 +3486,33 @@ static void ath5k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
 	ath5k_hw_set_coverage_class(sc->ah, coverage_class);
 	mutex_unlock(&sc->lock);
 }
+
+static int ath5k_set_antenna(struct ieee80211_hw *hw, u8 tx_ant, u8 rx_ant)
+{
+	struct ath5k_softc *sc = hw->priv;
+
+	if (tx_ant == 1 && rx_ant == 1)
+		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_FIXED_A);
+	else if (tx_ant == 2 && rx_ant == 2)
+		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_FIXED_B);
+	else if (tx_ant == 3 && rx_ant == 3)
+		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_DEFAULT);
+	else
+		return -EOPNOTSUPP;
+	return 0;
+}
+
+static int ath5k_get_antenna(struct ieee80211_hw *hw, u8 *tx_ant, u8 *rx_ant)
+{
+	struct ath5k_softc *sc = hw->priv;
+
+	switch (sc->ah->ah_ant_mode) {
+	case AR5K_ANTMODE_FIXED_A:
+		*tx_ant = 1; *rx_ant = 1; break;
+	case AR5K_ANTMODE_FIXED_B:
+		*tx_ant = 2; *rx_ant = 2; break;
+	case AR5K_ANTMODE_DEFAULT:
+		*tx_ant = 3; *rx_ant = 3; break;
+	}
+	return 0;
+}


^ permalink raw reply related

* [RFC PATCH 1/3] iw: fix makefile for cqm
From: Bruno Randolf @ 2010-05-11  8:39 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index e21900a..d303f45 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
 OBJS = iw.o genl.o event.o info.o phy.o \
 	interface.o ibss.o station.o survey.o util.o \
 	mesh.o mpath.o scan.o reg.o version.o \
-	reason.o status.o connect.o link.o offch.o ps.o cqm.c
+	reason.o status.o connect.o link.o offch.o ps.o cqm.o
 OBJS += sections.o
 ALL = iw
 


^ permalink raw reply related

* [RFC PATCH 2/3] iw: sync nl80211.h with wireless-testing
From: Bruno Randolf @ 2010-05-11  8:39 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig
In-Reply-To: <20100511083933.28347.37155.stgit@tt-desk>

adding AP isolate, set channel and antenna settings

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 nl80211.h |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/nl80211.h b/nl80211.h
index daf6a34..46a2c76 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -52,6 +52,8 @@
  *	%NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT,
  *	%NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
  *	and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
+ *	However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
+ *	instead, the support here is for backward compatibility only.
  * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
  *	or rename notification. Has attributes %NL80211_ATTR_WIPHY and
  *	%NL80211_ATTR_WIPHY_NAME.
@@ -329,6 +331,18 @@
  * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This
  *	command is used as an event to indicate the that a trigger level was
  *	reached.
+ * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
+ *	and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed
+ *	by %NL80211_ATTR_IFINDEX) shall operate on.
+ *	In case multiple channels are supported by the device, the mechanism
+ *	with which it switches channels is implementation-defined.
+ *	When a monitor interface is given, it can only switch channel while
+ *	no other interfaces are operating to avoid disturbing the operation
+ *	of any other interfaces, and other interfaces will again take
+ *	precedence when they are used.
+ *
+ * @NL80211_CMD_SET_ANTENNA: Set a bitmap of antennas to use.
+ * @NL80211_CMD_GET_ANTENNA: Get antenna configuration from driver.
  *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
@@ -428,6 +442,11 @@ enum nl80211_commands {
 	NL80211_CMD_SET_CQM,
 	NL80211_CMD_NOTIFY_CQM,
 
+	NL80211_CMD_SET_CHANNEL,
+
+	NL80211_CMD_SET_ANTENNA,
+	NL80211_CMD_GET_ANTENNA,
+
 	/* add new commands above here */
 
 	/* used to define NL80211_CMD_MAX below */
@@ -703,6 +722,18 @@ enum nl80211_commands {
  * @NL80211_ATTR_CQM: connection quality monitor configuration in a
  *	nested attribute with %NL80211_ATTR_CQM_* sub-attributes.
  *
+ * @NL80211_ATTR_LOCAL_STATE_CHANGE: Flag attribute to indicate that a command
+ *	is requesting a local authentication/association state change without
+ *	invoking actual management frame exchange. This can be used with
+ *	NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE,
+ *	NL80211_CMD_DISASSOCIATE.
+ *
+ * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
+ *	connected to this BSS.
+ *
+ * @NL80211_ATTR_ANTENNA_TX: Bitmap of antennas to use for transmitting.
+ * @NL80211_ATTR_ANTENNA_RX: Bitmap of antennas to use for receiving.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -856,6 +887,13 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_CQM,
 
+	NL80211_ATTR_LOCAL_STATE_CHANGE,
+
+	NL80211_ATTR_AP_ISOLATE,
+
+	NL80211_ATTR_ANTENNA_TX,
+	NL80211_ATTR_ANTENNA_RX,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,


^ permalink raw reply related

* [RFC PATCH 3/3] iw: Add antenna set/get
From: Bruno Randolf @ 2010-05-11  8:39 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig
In-Reply-To: <20100511083933.28347.37155.stgit@tt-desk>

Add commands to set and get the antenna configuration. The antenna
configuration is defined as a bitmap of 8 antennas. When multiple antennas are
selected the driver may use diversity. Also the driver may reject antenna
configurations it cannot support.

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 Makefile  |    2 +
 antenna.c |   92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+), 1 deletions(-)
 create mode 100644 antenna.c

diff --git a/Makefile b/Makefile
index d303f45..e526cda 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
 OBJS = iw.o genl.o event.o info.o phy.o \
 	interface.o ibss.o station.o survey.o util.o \
 	mesh.o mpath.o scan.o reg.o version.o \
-	reason.o status.o connect.o link.o offch.o ps.o cqm.o
+	reason.o status.o connect.o link.o offch.o ps.o cqm.o antenna.o
 OBJS += sections.o
 ALL = iw
 
diff --git a/antenna.c b/antenna.c
new file mode 100644
index 0000000..dd59c76
--- /dev/null
+++ b/antenna.c
@@ -0,0 +1,92 @@
+#include <net/if.h>
+#include <errno.h>
+#include <string.h>
+
+#include <netlink/genl/genl.h>
+#include <netlink/genl/family.h>
+#include <netlink/genl/ctrl.h>
+#include <netlink/msg.h>
+#include <netlink/attr.h>
+
+#include "nl80211.h"
+#include "iw.h"
+
+SECTION(antenna);
+
+static int set_antenna(struct nl80211_state *state,
+			struct nl_cb *cb,
+			struct nl_msg *msg,
+			int argc, char **argv)
+{
+	char *end;
+	uint8_t tx_ant, rx_ant;
+
+	if (argc != 4)
+		return 1;
+
+	if (strcmp(*argv, "tx") == 0) {
+		argv++;
+		argc--;
+
+		tx_ant = strtoul(argv[0], &end, 10);
+		argv++;
+		argc--;
+	}
+
+	if (strcmp(*argv, "rx") == 0) {
+		argv++;
+		argc--;
+
+		rx_ant = strtoul(argv[0], &end, 10);
+		argv++;
+		argc--;
+	}
+
+	if (*end)
+		return 1;
+
+	NLA_PUT_U8(msg, NL80211_ATTR_ANTENNA_TX, tx_ant);
+	NLA_PUT_U8(msg, NL80211_ATTR_ANTENNA_RX, rx_ant);
+	return 0;
+
+ nla_put_failure:
+	return -ENOBUFS;
+}
+
+COMMAND(antenna, set, "tx <bitmap> rx <bitmap>",
+	NL80211_CMD_SET_ANTENNA, 0, CIB_PHY, set_antenna,
+	"Set a bitmap of allowed antennas to use for TX and RX.\n"
+	"The driver may reject antenna configurations it cannot support.");
+
+
+static int print_antenna_handler(struct nl_msg *msg, void *arg)
+{
+	struct nlattr *attrs[NL80211_ATTR_MAX + 1];
+	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+	uint8_t tx_ant, rx_ant;
+
+	nla_parse(attrs, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+		  genlmsg_attrlen(gnlh, 0), NULL);
+
+	if (!attrs[NL80211_ATTR_ANTENNA_TX] || !attrs[NL80211_ATTR_ANTENNA_RX])
+		return NL_SKIP;
+
+	tx_ant = nla_get_u8(attrs[NL80211_ATTR_ANTENNA_TX]);
+	rx_ant = nla_get_u8(attrs[NL80211_ATTR_ANTENNA_RX]);
+
+	printf("Antenna configuration: tx %d rx %d\n", tx_ant, rx_ant);
+
+	return NL_SKIP;
+}
+
+static int get_antenna(struct nl80211_state *state,
+			struct nl_cb *cb,
+			struct nl_msg *msg,
+			int argc, char **argv)
+{
+	nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_antenna_handler, NULL);
+	return 0;
+}
+
+COMMAND(antenna, get, NULL, NL80211_CMD_GET_ANTENNA, 0, CIB_PHY, get_antenna,
+	"Retrieve antenna configuration.");


^ permalink raw reply related

* Re: [RFC PATCH 1/2] mac80211: Add nl80211 antenna configuration
From: Johannes Berg @ 2010-05-11  8:50 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless, holgerschurig
In-Reply-To: <20100511083900.28289.43864.stgit@tt-desk>

On Tue, 2010-05-11 at 17:39 +0900, Bruno Randolf wrote:

> +	[NL80211_ATTR_ANTENNA_TX] = { .type = NLA_U8 },
> +	[NL80211_ATTR_ANTENNA_RX] = { .type = NLA_U8 },
>  };

> +	tx_ant = nla_get_u8(info->attrs[NL80211_ATTR_ANTENNA_TX]);
> +	rx_ant = nla_get_u8(info->attrs[NL80211_ATTR_ANTENNA_RX]);

> +	NLA_PUT_U32(msg, NL80211_ATTR_ANTENNA_TX, tx_ant);
> +	NLA_PUT_U32(msg, NL80211_ATTR_ANTENNA_RX, rx_ant);

That isn't right.

johannes


^ permalink raw reply

* Re: [RFC PATCH 2/2] ath5k: Add support for cfg80211 antenna setting
From: Johannes Berg @ 2010-05-11  8:50 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless, holgerschurig
In-Reply-To: <20100511083910.28289.71188.stgit@tt-desk>

On Tue, 2010-05-11 at 17:39 +0900, Bruno Randolf wrote:

> +	if (tx_ant == 1 && rx_ant == 1)
> +		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_FIXED_A);
> +	else if (tx_ant == 2 && rx_ant == 2)
> +		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_FIXED_B);
> +	else if (tx_ant == 3 && rx_ant == 3)
> +		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_DEFAULT);
> +	else
> +		return -EOPNOTSUPP;

That should be -EINVAL, I think.

johannes


^ 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