Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2] libertas: Use lbs_is_cmd_allowed() check in command handling routines.
From: Bing Zhao @ 2009-10-07  2:20 UTC (permalink / raw)
  To: libertas-dev; +Cc: linux-wireless, Bing Zhao, Amitkumar Karwar

From: Amitkumar Karwar <akarwar@marvell.com>

lbs_is_cmd_allowed() check is added in __lbs_cmd_async() and
lbs_prepare_and_send_command(). The check is removed from other places.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/libertas/cmd.c     |   34 ++++++++
 drivers/net/wireless/libertas/debugfs.c |   46 -----------
 drivers/net/wireless/libertas/decl.h    |    1 -
 drivers/net/wireless/libertas/scan.c    |   11 ---
 drivers/net/wireless/libertas/wext.c    |  133 -------------------------------
 5 files changed, 34 insertions(+), 191 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 3a3e894..0fb3125 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -75,6 +75,30 @@ static u8 is_command_allowed_in_ps(u16 cmd)
 }
 
 /**
+ *  @brief This function checks if the command is allowed.
+ *
+ *  @param priv         A pointer to lbs_private structure
+ *  @return             allowed or not allowed.
+ */
+
+static int lbs_is_cmd_allowed(struct lbs_private *priv)
+{
+	int ret = 1;
+
+	lbs_deb_enter(LBS_DEB_CMD);
+
+	if (!priv->is_auto_deep_sleep_enabled) {
+		if (priv->is_deep_sleep) {
+			lbs_deb_cmd("command not allowed in deep sleep\n");
+			ret = 0;
+		}
+	}
+
+	lbs_deb_leave(LBS_DEB_CMD);
+	return ret;
+}
+
+/**
  *  @brief Updates the hardware details like MAC address and regulatory region
  *
  *  @param priv    	A pointer to struct lbs_private structure
@@ -1452,6 +1476,11 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
 		goto done;
 	}
 
+	if (!lbs_is_cmd_allowed(priv)) {
+		ret = -EBUSY;
+		goto done;
+	}
+
 	cmdnode = lbs_get_cmd_ctrl_node(priv);
 
 	if (cmdnode == NULL) {
@@ -2104,6 +2133,11 @@ static struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv,
 		goto done;
 	}
 
+	if (!lbs_is_cmd_allowed(priv)) {
+		cmdnode = ERR_PTR(-EBUSY);
+		goto done;
+	}
+
 	cmdnode = lbs_get_cmd_ctrl_node(priv);
 	if (cmdnode == NULL) {
 		lbs_deb_host("PREP_CMD: cmdnode is NULL\n");
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 8a7e931..893a55c 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -117,11 +117,6 @@ static ssize_t lbs_sleepparams_write(struct file *file,
 	if (!buf)
 		return -ENOMEM;
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out_unlock;
-	}
-
 	buf_size = min(count, len - 1);
 	if (copy_from_user(buf, user_buf, buf_size)) {
 		ret = -EFAULT;
@@ -162,11 +157,6 @@ static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf,
 	if (!buf)
 		return -ENOMEM;
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out_unlock;
-	}
-
 	ret = lbs_cmd_802_11_sleep_params(priv, CMD_ACT_GET, &sp);
 	if (ret)
 		goto out_unlock;
@@ -233,9 +223,6 @@ static ssize_t lbs_threshold_read(uint16_t tlv_type, uint16_t event_mask,
 	u8 freq;
 	int events = 0;
 
-	if (!lbs_is_cmd_allowed(priv))
-		return -EBUSY;
-
 	buf = (char *)get_zeroed_page(GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;
@@ -288,9 +275,6 @@ static ssize_t lbs_threshold_write(uint16_t tlv_type, uint16_t event_mask,
 	char *buf;
 	int ret;
 
-	if (!lbs_is_cmd_allowed(priv))
-		return -EBUSY;
-
 	buf = (char *)get_zeroed_page(GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;
@@ -460,11 +444,6 @@ static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf,
 	if (!buf)
 		return -ENOMEM;
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		free_page(addr);
-		return -EBUSY;
-	}
-
 	offval.offset = priv->mac_offset;
 	offval.value = 0;
 
@@ -517,11 +496,6 @@ static ssize_t lbs_wrmac_write(struct file *file,
 	if (!buf)
 		return -ENOMEM;
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		res = -EBUSY;
-		goto out_unlock;
-	}
-
 	buf_size = min(count, len - 1);
 	if (copy_from_user(buf, userbuf, buf_size)) {
 		res = -EFAULT;
@@ -558,11 +532,6 @@ static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf,
 	if (!buf)
 		return -ENOMEM;
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		free_page(addr);
-		return -EBUSY;
-	}
-
 	offval.offset = priv->bbp_offset;
 	offval.value = 0;
 
@@ -616,11 +585,6 @@ static ssize_t lbs_wrbbp_write(struct file *file,
 	if (!buf)
 		return -ENOMEM;
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		res = -EBUSY;
-		goto out_unlock;
-	}
-
 	buf_size = min(count, len - 1);
 	if (copy_from_user(buf, userbuf, buf_size)) {
 		res = -EFAULT;
@@ -657,11 +621,6 @@ static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf,
 	if (!buf)
 		return -ENOMEM;
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		free_page(addr);
-		return -EBUSY;
-	}
-
 	offval.offset = priv->rf_offset;
 	offval.value = 0;
 
@@ -715,11 +674,6 @@ static ssize_t lbs_wrrf_write(struct file *file,
 	if (!buf)
 		return -ENOMEM;
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		res = -EBUSY;
-		goto out_unlock;
-	}
-
 	buf_size = min(count, len - 1);
 	if (copy_from_user(buf, userbuf, buf_size)) {
 		res = -EFAULT;
diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h
index 44f0b24..fb91c36 100644
--- a/drivers/net/wireless/libertas/decl.h
+++ b/drivers/net/wireless/libertas/decl.h
@@ -34,7 +34,6 @@ int lbs_process_event(struct lbs_private *priv, u32 event);
 void lbs_queue_event(struct lbs_private *priv, u32 event);
 void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx);
 int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep);
-int lbs_is_cmd_allowed(struct lbs_private *priv);
 int lbs_enter_auto_deep_sleep(struct lbs_private *priv);
 int lbs_exit_auto_deep_sleep(struct lbs_private *priv);
 
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index e468e15..6c95af3 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -950,11 +950,6 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out;
-	}
-
 	if (!priv->radio_on) {
 		ret = -EINVAL;
 		goto out;
@@ -1022,12 +1017,6 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		err = -EBUSY;
-		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", err);
-		return err;
-	}
-
 	/* iwlist should wait until the current scan is finished */
 	if (priv->scan_channel)
 		return -EAGAIN;
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 38a451e..69dd19b 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -46,32 +46,6 @@ static inline void lbs_cancel_association_work(struct lbs_private *priv)
 }
 
 /**
- *  @brief This function checks if the command is allowed.
- *
- *  @param priv         A pointer to lbs_private structure
- *  @return             allowed or not allowed.
- */
-
-int lbs_is_cmd_allowed(struct lbs_private *priv)
-{
-	int         ret = 1;
-
-	lbs_deb_enter(LBS_DEB_WEXT);
-
-	if (!priv->is_auto_deep_sleep_enabled) {
-		if (priv->is_deep_sleep) {
-			lbs_deb_wext("IOCTLS called when station"
-					"is in deep sleep\n");
-			ret = 0;
-		}
-	}
-
-	lbs_deb_leave(LBS_DEB_WEXT);
-	return ret;
-}
-
-
-/**
  *  @brief Find the channel frequency power info with specific channel
  *
  *  @param priv 	A pointer to struct lbs_private structure
@@ -193,11 +167,6 @@ static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		lbs_deb_leave(LBS_DEB_WEXT);
-		return -EBUSY;
-	}
-
 	cfp = lbs_find_cfp_by_band_and_channel(priv, 0,
 					   priv->curbssparams.channel);
 
@@ -308,12 +277,6 @@ static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
-		return ret;
-	}
-
 	if (vwrq->disabled)
 		val = MRVDRV_RTS_MAX_VALUE;
 
@@ -335,11 +298,6 @@ static int lbs_get_rts(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out;
-	}
-
 	ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_RTS_THRESHOLD, &val);
 	if (ret)
 		goto out;
@@ -362,12 +320,6 @@ static int lbs_set_frag(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
-		return ret;
-	}
-
 	if (vwrq->disabled)
 		val = MRVDRV_FRAG_MAX_VALUE;
 
@@ -389,11 +341,6 @@ static int lbs_get_frag(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out;
-	}
-
 	ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_FRAG_THRESHOLD, &val);
 	if (ret)
 		goto out;
@@ -443,11 +390,6 @@ static int lbs_get_txpow(struct net_device *dev,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out;
-	}
-
 	if (!priv->radio_on) {
 		lbs_deb_wext("tx power off\n");
 		vwrq->value = 0;
@@ -481,11 +423,6 @@ static int lbs_set_retry(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out;
-	}
-
         if ((vwrq->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
                 return -EOPNOTSUPP;
 
@@ -534,11 +471,6 @@ static int lbs_get_retry(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out;
-	}
-
 	vwrq->disabled = 0;
 
 	if (vwrq->flags & IW_RETRY_LONG) {
@@ -907,9 +839,6 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv))
-		return NULL;
-
 	priv->wstats.status = priv->mode;
 
 	/* If we're not associated, all quality values are meaningless */
@@ -1010,12 +939,6 @@ static int lbs_set_freq(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
-		return ret;
-	}
-
 	mutex_lock(&priv->lock);
 	assoc_req = lbs_get_association_request(priv);
 	if (!assoc_req) {
@@ -1125,11 +1048,6 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out;
-	}
-
 	lbs_deb_wext("vwrq->value %d\n", vwrq->value);
 	lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed);
 
@@ -1188,11 +1106,6 @@ static int lbs_get_rate(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		lbs_deb_leave(LBS_DEB_WEXT);
-		return -EBUSY;
-	}
-
 	if (priv->connect_status == LBS_CONNECTED) {
 		vwrq->value = priv->cur_rate * 500000;
 
@@ -1219,11 +1132,6 @@ static int lbs_set_mode(struct net_device *dev,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out;
-	}
-
 	if (   (*uwrq != IW_MODE_ADHOC)
 	    && (*uwrq != IW_MODE_INFRA)
 	    && (*uwrq != IW_MODE_AUTO)) {
@@ -1465,12 +1373,6 @@ static int lbs_set_encode(struct net_device *dev,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
-		return ret;
-	}
-
 	mutex_lock(&priv->lock);
 	assoc_req = lbs_get_association_request(priv);
 	if (!assoc_req) {
@@ -1654,12 +1556,6 @@ static int lbs_set_encodeext(struct net_device *dev,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
-		return ret;
-	}
-
 	mutex_lock(&priv->lock);
 	assoc_req = lbs_get_association_request(priv);
 	if (!assoc_req) {
@@ -1872,12 +1768,6 @@ static int lbs_set_auth(struct net_device *dev,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
-		return ret;
-	}
-
 	mutex_lock(&priv->lock);
 	assoc_req = lbs_get_association_request(priv);
 	if (!assoc_req) {
@@ -1980,12 +1870,6 @@ static int lbs_get_auth(struct net_device *dev,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
-		return ret;
-	}
-
 	switch (dwrq->flags & IW_AUTH_INDEX) {
 	case IW_AUTH_KEY_MGMT:
 		dwrq->value = priv->secinfo.key_mgmt;
@@ -2028,11 +1912,6 @@ static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		goto out;
-	}
-
 	if (vwrq->disabled) {
 		lbs_set_radio(priv, RADIO_PREAMBLE_AUTO, 0);
 		goto out;
@@ -2152,12 +2031,6 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
-		return ret;
-	}
-
 	if (!priv->radio_on) {
 		ret = -EINVAL;
 		goto out;
@@ -2285,12 +2158,6 @@ static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!lbs_is_cmd_allowed(priv)) {
-		ret = -EBUSY;
-		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
-		return ret;
-	}
-
 	if (!priv->radio_on)
 		return -EINVAL;
 
-- 
1.5.4.3


^ permalink raw reply related

* Re: Linux wifi development board
From: Ahmed A @ 2009-10-07  2:06 UTC (permalink / raw)
  To: David Acker; +Cc: linux-wireless
In-Reply-To: <4ACB42CB.7010403@roinet.com>

--- On Tue, 10/6/09, David Acker <dacker@roinet.com> wrote:

> From: David Acker <dacker@roinet.com>
> Subject: Re: Linux wifi development board
> To: "Ahmed A" <ahmedcali@yahoo.com>
> Cc: linux-wireless@vger.kernel.org
> Date: Tuesday, October 6, 2009, 6:14 AM
> Ahmed A wrote:
> > Hello,
> > 
> > I have been looking online for a Linux wifi
> development board.  I have come across a few from small
> companies (reasonably priced), but most of those companies
> seem to be out of business.  I would appreciate
> suggestions from anyone that may have used one recently, or
> suggest a link where I can more info some popular ones.
> > 
> > I am mostly interested in doing some software
> development, prototyping on the "application processor", not
> on the "baseband processor" (radio part).
> > 
> > If there is an alternate mailing list I can post my
> question, I would appreciate that also.
> 
> I have had good luck with boards from Gateworks, http://www.gateworks.com/ and radios from Ubiquiti, http://ubnt.com/
> . All of it is supported by OpenWRT, although I believe that
> the gw2348-4 (avila) has mainline support.
> -ack
> 

Hi David,

Thank you for your response.  I would like to explain what I am trying to setup, and would appreciate your feedback please.  My setup would comprise of two parts. One part would be the wifi router (base station), on which I load linux image bundled with my special app onto it.  The other part would be the wifi client (CPE), that would connect to the router.  I would also like to be able to load my own kernel image bundled with my special app.

I am guessing from your email, I would have to get a board from gateworks, hook up an antenna to it from ubnt, load image from OpenWRT, that would be my wifi router.  Is that right? Which product would you recommend, the Avilla platform? Which antenna from ubnt?  Would there be issues getting these to work?  How about the components on the client side, same deal?

I have done some work/programming on the IXP, but I do prefer a board with non-IXP CPU, like PowerPC or XScale.

Is there any solution out there, where the dev board and antenna come bundled, so I don't have to muck around getting them to work?

Any decent alternate board supplier, the prices of boards from gateworks are a bit pricey for me.

Thank you,
Ahmed A.



      

^ permalink raw reply

* Re: [ath5k-devel] Regarding changing channel widthlin
From: Aditya Bhave @ 2009-10-07  2:08 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Nick Kossifidis, ath5k-devel, linux-wireless
In-Reply-To: <43e72e890910061721o5f78f82cvfaa216a4d887e4f8@mail.gmail.com>

Is there any detailed documentation on the internals of ath5k code?

1. Description of the data structures
2. Flow-diagram of function calls
3. What register is used for what aspect of WiFi etc etc

Thanks
--Aditya



Luis R. Rodriguez wrote:
> On Tue, Oct 6, 2009 at 5:17 PM, Nick Kossifidis <mickflemm@gmail.com> wrote:
>   
>> Until we have a
>> clean way to set this through cfg80211/nl80211 (which is an ongoing
>> discussion) we wont support 5/10Mhz operation but you can try and let
>> us know.
>>     
>
> I believe the cfg80211/nl80211 changes is probably the bulk of the
> work that does need to get done. Someone motivated just needs to do
> it.
>
>    Luis
>
>   


^ permalink raw reply

* [PATCH] compat-2.6: adjusting 01-netdev.patch for libertas cfg80211 support
From: Hin-Tak Leung @ 2009-10-07  2:50 UTC (permalink / raw)
  To: linux-wireless, lrodriguez; +Cc: Hin-Tak Leung, Hin-Tak Leung

Adjusting the netdev patch slightly to cope with recent change
in libertas regarding cfg80211 support:

    commit 6c65edc7a3e9452509a898cc9bbc210b0121617f
    Author: Holger Schurig <hs4233@mail.mn-solutions.de>
    Date:   Tue Oct 6 16:31:54 2009 +0200

        libertas: first stab at cfg80211 support

Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
---
 compat/patches/01-netdev.patch |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compat/patches/01-netdev.patch b/compat/patches/01-netdev.patch
index 141f80b..f6bca3e 100644
--- a/compat/patches/01-netdev.patch
+++ b/compat/patches/01-netdev.patch
@@ -416,9 +416,9 @@ without creating a headache on maintenance of the pathes.
  /**
   * @brief This function adds the card. it will probe the
 @@ -1270,7 +1272,16 @@
- 	priv->infra_open = 0;
+ 	wdev->netdev = dev;
+ 	priv->dev = dev;
  
- 	/* Setup the OS Interface to our functions */
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
   	dev->netdev_ops = &lbs_netdev_ops;
 +#else
-- 
1.6.5.rc2


^ permalink raw reply related

* [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Hin-Tak Leung @ 2009-10-07  3:39 UTC (permalink / raw)
  To: linux-wireless, lrodriguez; +Cc: Hin-Tak Leung, Hin-Tak Leung

Between 2.6.30 and 2.6.31, linux/netdevice.h started
to include linux/ethtool.h (commit b1b67dd45a6b629eb41553856805aaa1614fbb83,
"net: factor out ethtool invocation of vlan/macvlan drivers"),
and commit 7508e486965b0af13984bc6d9da62a8d8f0dc5f9,
"cfg80211: add firmware and hardware version to wiphy", introduces
dependency of ETHTOOL_BUSINFO_LEN from linux/ethtool.h
to net/cfg80211.h .

Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
---
 compat/compat-2.6.31.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/compat/compat-2.6.31.h b/compat/compat-2.6.31.h
index 154209c..e46334a 100644
--- a/compat/compat-2.6.31.h
+++ b/compat/compat-2.6.31.h
@@ -12,6 +12,7 @@
 #include <linux/interrupt.h>
 #include <net/dst.h>
 #include <net/genetlink.h>
+#include <linux/ethtool.h>
 
 /*
  * These macros allow us to backport rfkill without any
-- 
1.6.5.rc2


^ permalink raw reply related

* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Hin-Tak Leung @ 2009-10-07  3:45 UTC (permalink / raw)
  To: linux-wireless, lrodriguez
In-Reply-To: <1254886762-17211-1-git-send-email-HinTak.Leung@gmail.com>

After 'compat-2.6: adjusting 01-netdev.patch for libertas cfg80211
support' (which fixes the patches), and 'compat-2.6: adding ethtool.h
to compat-2.6.31.h' (which fixes the cfg80211.h header), the next
error is ath5k_pm_ops type missing:

----------------
  CC [M]  /home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.o
/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.c:201:
warning: data definition has no type or storage class
/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.c:201:
warning: type defaults to ‘int’ in declaration of ‘SIMPLE_DEV_PM_OPS’
/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.c:201:
warning: parameter names (without types) in function declaration
/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.c:212:
error: ‘ath5k_pm_ops’ undeclared here (not in a function)
make[5]: *** [/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.o]
Error 1
make[4]: *** [/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k]
Error 2
make[3]: *** [/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath]
Error 2
make[2]: *** [/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless]
Error 2
make[1]: *** [_module_/home/Hin-Tak/tmp-git/compat-wireless-2.6] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.30.8-67.fc11.x86_64'
make: *** [modules] Error 2
---------------

Since this is slightly outside my interest (I am mostly just tracking
rtl818x and to a lesser extent zd1211rw), I'll let others carry on
fixing compat-wireless against current wireless-testing... apologies.

^ permalink raw reply

* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Luis R. Rodriguez @ 2009-10-07  5:40 UTC (permalink / raw)
  To: Hin-Tak Leung; +Cc: linux-wireless, Hin-Tak Leung
In-Reply-To: <1254886762-17211-1-git-send-email-HinTak.Leung@gmail.com>

On Tue, Oct 6, 2009 at 11:39 PM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:
> Between 2.6.30 and 2.6.31, linux/netdevice.h started
> to include linux/ethtool.h (commit b1b67dd45a6b629eb41553856805aaa1614fbb83,
> "net: factor out ethtool invocation of vlan/macvlan drivers"),
> and commit 7508e486965b0af13984bc6d9da62a8d8f0dc5f9,
> "cfg80211: add firmware and hardware version to wiphy", introduces
> dependency of ETHTOOL_BUSINFO_LEN from linux/ethtool.h
> to net/cfg80211.h .

John's patch titled "cfg80211: fix compile error from missing
ethtool.h" seems to address this upstream. I'll wait until he applies
that to the tree.

  Luis

^ permalink raw reply

* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Luis R. Rodriguez @ 2009-10-07  5:41 UTC (permalink / raw)
  To: Hin-Tak Leung; +Cc: linux-wireless
In-Reply-To: <3ace41890910062045s626777dew4b47fe18bc8d9aee@mail.gmail.com>

On Tue, Oct 6, 2009 at 11:45 PM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:

> warning: type defaults to ‘int’ in declaration of ‘SIMPLE_DEV_PM_OPS’

Yeah we need to backport this stuff, it seems all drivers are intended
to be moved to use these simple dev pm ops so we might as well.

  Luis

^ permalink raw reply

* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Luis R. Rodriguez @ 2009-10-07  6:30 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Hin-Tak Leung, linux-wireless, Rafael J. Wysocki
In-Reply-To: <43e72e890910062241k3c4660eaobbcee4456485be93@mail.gmail.com>

On Wed, Oct 07, 2009 at 01:41:08AM -0400, Luis R. Rodriguez wrote:
> On Tue, Oct 6, 2009 at 11:45 PM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:
> 
> > warning: type defaults to ‘int’ in declaration of ‘SIMPLE_DEV_PM_OPS’
> 
> Yeah we need to backport this stuff, it seems all drivers are intended
> to be moved to use these simple dev pm ops so we might as well.

OK I just committed this patch as a quick attempt to backport this. Testers
welcomed. You'll need the ethtool patch from Hin-Tak as John hasn't yet applied
his own on wireless-testing.

From: Luis R. Rodriguez <lrodriguez@atheros.com>
Subject: [PATCH] compat-2.6: backport dev_pm_ops stuff and SIMPLE_DEV_PM_OPS

The 2.6.29 kernel has new struct dev_pm_ops [1] which are used
on the pci device to distinguish power management hooks for suspend
to RAM and hibernation. Older kernels don't have these so we need
to resort back to the good ol' suspend/resume. Fortunately the calls
are not so different so it should be possible to resuse the same
calls on compat code with only slight modifications.

The SIMPLE_DEV_PM_OPS macro is used as a helper to make the regular
suspend/resume calls be linked to the equivalent hibernation calls
as that is the same behaviour in older kernels. We backport
SIMPLE_DEV_PM_OPS only for kernels 2.6.29..2.6.31 and for older
kernels this is a no-op.

[1] http://lxr.linux.no/#linux+v2.6.29/include/linux/pm.h#L170

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 compat/compat-2.6.32.h             |   26 ++++++++++++++++
 compat/patches/11-dev-pm-ops.patch |   57 ++++++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+), 0 deletions(-)
 create mode 100644 compat/patches/11-dev-pm-ops.patch

diff --git a/compat/compat-2.6.32.h b/compat/compat-2.6.32.h
index 418b521..9c2dba9 100644
--- a/compat/compat-2.6.32.h
+++ b/compat/compat-2.6.32.h
@@ -8,6 +8,7 @@
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32))
 
 #include <linux/netdevice.h>
+#include <linux/pm.h>
 
 #define SDIO_VENDOR_ID_INTEL			0x0089
 #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX	0x1402
@@ -43,6 +44,31 @@ enum netdev_tx {
 typedef enum netdev_tx netdev_tx_t;
 #endif /* __KERNEL__ */
 
+
+/*
+ * dev_pm_ops is only available on kernels >= 2.6.29, for
+ * older kernels we rely on reverting the work to old
+ * power management style stuff.
+ */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+/*
+ * Use this if you want to use the same suspend and resume callbacks for suspend
+ * to RAM and hibernation.
+ */
+#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
+struct dev_pm_ops name = { \
+	.suspend = suspend_fn, \
+	.resume = resume_fn, \
+	.freeze = suspend_fn, \
+	.thaw = resume_fn, \
+	.poweroff = suspend_fn, \
+	.restore = resume_fn, \
+}
+#else
+#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn)
+#endif /* >= 2.6.29 */
+
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) */
 
 #endif /* LINUX_26_32_COMPAT_H */
diff --git a/compat/patches/11-dev-pm-ops.patch b/compat/patches/11-dev-pm-ops.patch
new file mode 100644
index 0000000..e01eafc
--- /dev/null
+++ b/compat/patches/11-dev-pm-ops.patch
@@ -0,0 +1,57 @@
+The 2.6.29 kernel has new struct dev_pm_ops [1] which are used
+on the pci device to distinguish power management hooks for suspend
+to RAM and hibernation. Older kernels don't have these so we need
+to resort back to the good ol' suspend/resume. Fortunately the calls
+are not so different so it should be possible to resuse the same
+calls on compat code with only slight modifications.
+
+[1] http://lxr.linux.no/#linux+v2.6.29/include/linux/pm.h#L170
+
+--- a/drivers/net/wireless/ath/ath5k/base.c	2009-10-07 01:58:19.000000000 -0400
++++ b/drivers/net/wireless/ath/ath5k/base.c	2009-10-07 02:19:58.000000000 -0400
+@@ -197,6 +197,32 @@
+ #ifdef CONFIG_PM
+ static int		ath5k_pci_suspend(struct device *dev);
+ static int		ath5k_pci_resume(struct device *dev);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
++#endif
++static int ath5k_pci_suspend_compat(struct pci_dev *pdev, pm_message_t state)
++{
++	int r;
++
++	r = ath5k_pci_suspend(pdev->dev);
++	if (r)
++		return r;
++
++	pci_save_state(pdev);
++	pci_disable_device(pdev);
++	pci_set_power_state(pdev, PCI_D3hot);
++}
++
++static int ath5k_pci_resume_compat(struct pci_dev *pdev)
++{
++	int r;
++
++	pci_restore_state(pdev);
++	r = pci_enable_device(pdev);
++	if (r)
++		return r;
++
++	return ath5k_pci_resume(pdev->dev);
++}
+ 
+ SIMPLE_DEV_PM_OPS(ath5k_pm_ops, ath5k_pci_suspend, ath5k_pci_resume);
+ #define ATH5K_PM_OPS	(&ath5k_pm_ops)
+@@ -209,7 +235,12 @@
+ 	.id_table	= ath5k_pci_id_table,
+ 	.probe		= ath5k_pci_probe,
+ 	.remove		= __devexit_p(ath5k_pci_remove),
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+ 	.driver.pm	= ATH5K_PM_OPS,
++#else
++	.suspend        = ath5k_pci_suspend_compat,
++	.resume         = ath5k_pci_resume_compat,
++#endif
+ };
+ 
+ 
-- 
1.6.0.4


^ permalink raw reply related

* [PATCH] libertas: remove extraneous select FW_LOADER
From: Holger Schurig @ 2009-10-07  7:10 UTC (permalink / raw)
  To: John W Linville; +Cc: Dan Williams, linux-wireless

As kindly pointed out by Andrey Yurovsky, CONFIG_LIBERTAS already
selects FW_LOADER.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>

Index: linux-wl/drivers/net/wireless/libertas/Kconfig
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/Kconfig	
2009-10-07 08:00:25.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/Kconfig	2009-10-07 
08:00:30.000000000 +0200
@@ -17,7 +17,6 @@ config LIBERTAS_USB
 config LIBERTAS_CS
 	tristate "Marvell Libertas 8385 CompactFlash 802.11b/g cards"
 	depends on LIBERTAS && PCMCIA
-	select FW_LOADER
 	---help---
 	  A driver for Marvell Libertas 8385 CompactFlash devices.
 

-- 
http://www.holgerschurig.de

^ permalink raw reply

* Question regarding netif_stop/wake queue and libertas
From: Holger Schurig @ 2009-10-07  7:50 UTC (permalink / raw)
  To: linux-wireless

Hi !

In the libertas driver, we did the following before scanning:

	netif_stop_queue(priv->dev);
	netif_carrier_off(priv->dev);
	if (priv->mesh_dev) {
		netif_stop_queue(priv->mesh_dev);
		netif_carrier_off(priv->mesh_dev);
	}

and then, after scanning, we started the queues and carrier
again *IF* connected:

	if (priv->connect_status == LBS_CONNECTED) {
		netif_carrier_on(priv->dev);
		if (!priv->tx_pending_len)
			netif_wake_queue(priv->dev);
	}
	if (priv->mesh_dev && (priv->mesh_connect_status == LBS_CONNECTED)) {
		netif_carrier_on(priv->mesh_dev);
		if (!priv->tx_pending_len)
			netif_wake_queue(priv->mesh_dev);
	}

How should I do this in my CFG80211-based scanning? As I want
to move away from libertas' own association logic in assoc.c,
there will in future be no priv->connect_status.

I now plan to remember the running/carrier state of both the
"normal" and the "mesh" device:

	int running;
	int carrier;
	int mesh_running = false;
	int mesh_carrier = false;

	running = !netif_queue_stopped(priv->dev);
	carrier = netif_carrier_ok(priv->dev);
	if (running)
		netif_stop_queue(priv->dev);
	if (carrier)
		netif_carrier_off(priv->dev);
	if (priv->mesh_dev) {
		mesh_running = !netif_queue_stopped(priv->mesh_dev);
		mesh_carrier = netif_carrier_ok(priv->mesh_dev);
		if (mesh_running)
			netif_stop_queue(priv->mesh_dev);
		if (mesh_carrier)
			netif_carrier_off(priv->mesh_dev);
	}

And after scanning my four channels, I plan to turn them
on again (e.g. this can be 440 ms later when doing a passive
scan):

	if (carrier)
		netif_carrier_on(priv->dev);
	if (running && !priv->tx_pending_len)
		netif_wake_queue(priv->dev);
	if (mesh_carrier)
		netif_carrier_on(priv->mesh_dev);
	if (mesh_running %% !priv->tx_pending_len)
		netif_wake_queue(priv->mesh_dev)

Would I need some kind of locking ?

-- 
M&N Solutions GmbH          Ein Unternehmen der Datagroup AG
Holger Schurig
Raiffeisenstr. 10
61191 Rosbach
Tel: 06003/9141-15          Fax 06003/9141-49
http://www.mn-solutions.de/

Handelsregister Friedberg, HRB 5903
Geschäftsführer: P.Schrittenlocher

^ permalink raw reply

* Re: [WIP, RFC] libertas: allow scanning via "iw"
From: Holger Schurig @ 2009-10-07  9:34 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-wireless
In-Reply-To: <1254869377.8034.8.camel@localhost.localdomain>

> > * signal isn't reported in dBm or mBm. The scan response from
> >   the firmware tells me some "RSSI" value.
> 
> #define MRVDRV_NF_DEFAULT_SCAN_VALUE		(-96)
> #define SCAN_RSSI(RSSI)			(0x100 - ((u8)(RSSI)))
> 
> 	iwe.u.qual.level = SCAN_RSSI(bss->rssi);
> 
> 	rssi = iwe.u.qual.level - MRVDRV_NF_DEFAULT_SCAN_VALUE;
> 
> so it's more or less dBm.

I'm not that sure about that. I made a test and moved with my 
laptop away from an access-point. In the table below you find 
the signal from ipw2200/iwconfig. And in the second column the 
raw "u8 rssi" from libertas' scan response:


^ permalink raw reply

* Re: [WIP, RFC] libertas: allow scanning via "iw"
From: Gábor Stefanik @ 2009-10-07  9:37 UTC (permalink / raw)
  To: Holger Schurig; +Cc: Dan Williams, linux-wireless
In-Reply-To: <200910071134.49515.hs4233@mail.mn-solutions.de>

On Wed, Oct 7, 2009 at 11:34 AM, Holger Schurig
<hs4233@mail.mn-solutions.de> wrote:
>> > * signal isn't reported in dBm or mBm. The scan response from
>> >   the firmware tells me some "RSSI" value.
>>
>> #define MRVDRV_NF_DEFAULT_SCAN_VALUE          (-96)
>> #define SCAN_RSSI(RSSI)                       (0x100 - ((u8)(RSSI)))
>>
>>       iwe.u.qual.level = SCAN_RSSI(bss->rssi);
>>
>>       rssi = iwe.u.qual.level - MRVDRV_NF_DEFAULT_SCAN_VALUE;
>>
>> so it's more or less dBm.
>
> I'm not that sure about that. I made a test and moved with my
> laptop away from an access-point. In the table below you find
> the signal from ipw2200/iwconfig. And in the second column the
> raw "u8 rssi" from libertas' scan response:

What table? Your message ends here...

>
> --
> 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: [WIP, RFC] libertas: allow scanning via "iw"
From: Holger Schurig @ 2009-10-07  9:38 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-wireless
In-Reply-To: <1254869377.8034.8.camel@localhost.localdomain>

> > * signal isn't reported in dBm or mBm. The scan response from
> >   the firmware tells me some "RSSI" value.
> 
> #define MRVDRV_NF_DEFAULT_SCAN_VALUE          (-96)
> #define SCAN_RSSI(RSSI)                       (0x100 - ((u8)
(RSSI)))
> 
>       iwe.u.qual.level = SCAN_RSSI(bss->rssi);
> 
>       rssi = iwe.u.qual.level - MRVDRV_NF_DEFAULT_SCAN_VALUE;
> 
> so it's more or less dBm.

I'm not that sure about that. I made a test and moved with my 
laptop away from an access-point. In the table below you find 
the signal from ipw2200/iwconfig. And in the second column the 
raw "u8 rssi" from libertas' scan response:

ipw2200 libertas
signal  rssi
-28     38
-36     42
-42     44
-32     46
-38     47
-41     42
-49     47
-49     48
-49     49
-49     48
-47     59
-49     65
-52     54
-55     57
-43     73

So, it's everything but an RSSI, because an RSSI would be high in 
the vincinity of the AP and decrease when farther away. The name 
is bogus, don't put too much value in it :-)

SCAN_RSSI(rssi) = 0x100 - rssi = 218. That doesn't look like a 
dBm either.

-- 
http://www.holgerschurig.de

^ permalink raw reply

* Bug: AR928x not working on 2.6.31.x
From: berndl81 @ 2009-10-07 11:59 UTC (permalink / raw)
  To: linux-wireless

I am using Archlinux on my Acer Extensa 7630EZ and realize that my wireless-device which is an
 
Atheros Communications Inc. AR928X Wireless Network Adapter (PCI-Express) (rev 01)

according to lspci works very well using arch-stock kernel 2.6.30 and is not working any longer when using the 2.6.31.1 or 2.6.31.2 kernel from Arch's testing repository.

When using the 2.6.30 kernel (wlan is working very well), I get the following dmesg-output:
[bernhard@wallaby ~]$ dmesg |grep ath
ath9k 0000:05:00.0: enabling device (0000 -> 0002)
ath9k 0000:05:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
ath9k 0000:05:00.0: setting latency timer to 64
phy0: Selected rate control algorithm 'ath9k_rate_control'
Registered led device: ath9k-phy0::radio
Registered led device: ath9k-phy0::assoc
Registered led device: ath9k-phy0::tx
Registered led device: ath9k-phy0::rx

When upgrading to 2.6.31.x, i receive the following output:
[bernhard@wallaby ~]$ dmesg |grep ath
ath9k 0000:05:00.0: enabling device (0000 -> 0002)
ath9k 0000:05:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
ath9k 0000:05:00.0: setting latency timer to 64
ath9k 0000:05:00.0: PCI INT A disabled

As I see it, the device is recognized and instantly disabled again. The device cannot be brought up too using ifconfig.

I am quite clueless what do do aside from reporting the bug here as suggested in the original Arch-bugreport (http://bugs.archlinux.org/task/16413)

If any further information is helpful, I will of course happily try to provide it.

Bernhard
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

^ permalink raw reply

* Re: Linux wifi development board
From: David Acker @ 2009-10-07 12:31 UTC (permalink / raw)
  To: Ahmed A; +Cc: linux-wireless
In-Reply-To: <911923.95402.qm@web32505.mail.mud.yahoo.com>

Ahmed A wrote:
> Hi David,
> 
> Thank you for your response.  I would like to explain what I am trying to setup, and would appreciate your feedback please.  My setup would comprise of two parts. One part would be the wifi router (base station), on which I load linux image bundled with my special app onto it.  The other part would be the wifi client (CPE), that would connect to the router.  I would also like to be able to load my own kernel image bundled with my special app.
> 
> I am guessing from your email, I would have to get a board from gateworks, hook up an antenna to it from ubnt, load image from OpenWRT, that would be my wifi router.  Is that right? Which product would you recommend, the Avilla platform? Which antenna from ubnt?  Would there be issues getting these to work?  How about the components on the client side, same deal?
> 
> I have done some work/programming on the IXP, but I do prefer a board with non-IXP CPU, like PowerPC or XScale.
> 
> Is there any solution out there, where the dev board and antenna come bundled, so I don't have to muck around getting them to work?
> 
> Any decent alternate board supplier, the prices of boards from gateworks are a bit pricey for me.

As someone else noted, the RouterStation Pro from Ubiquiti 
http://ubnt.com/products/rspro.php is a pretty good deal.  $80 gets you 
quite the system.  You could add in any of Ubiquiti's atheros based 
miniPCI radios.  They have 802.11b/g, 802.11a, and 802.11N in both 2.4 
and 5 GHz.  They also have several other frequencies like 2.3, 2.6, 4, 
900 MHz, and 700 MHz.  All of their radios are supported by either 
madwifi/ath5k or ath9k.

For all in one less expensive systems, I would look for an off the shelf 
wifi router that is supported by OpenWRT.  They have a nice list of 
supported routers.

-ack

^ permalink raw reply

* [2.6.32-rc3] iwlagn lost connection after s2ram (with warnings)
From: Carlos R. Mafra @ 2009-10-07 14:20 UTC (permalink / raw)
  To: linux-wireless; +Cc: linux-kernel


I just got these warnings after resuming from a suspend to RAM, and
the wireless connection was not resumed (now I am connected via eth0).
This is the first time I had a failed wireless resume since 2.6.32-rc1.

The full dmesg is here: http://www.aei.mpg.de/~crmafra/dmesg-2.6.32-rc3-wifi.txt

[ 3427.570113] Restarting tasks ... 
[ 3427.585827] wlan0: deauthenticated from 00:0b:86:26:36:f1 (Reason: 6)
[ 3427.589451] done.
[ 3428.503203] input: PS/2 Mouse as /devices/platform/i8042/serio4/input/input15
[ 3428.521064] input: AlpsPS/2 ALPS GlidePoint as /devices/platform/i8042/serio4/input/input16
[ 3434.504175] wlan0: direct probe to AP 00:0b:86:26:36:f1 (try 1)
[ 3434.507058] wlan0: direct probe responded
[ 3434.507062] wlan0: authenticate with AP 00:0b:86:26:36:f1 (try 1)
[ 3434.509000] wlan0: authenticated
[ 3434.509022] wlan0: associate with AP 00:0b:86:26:36:f1 (try 1)
[ 3434.512778] wlan0: RX ReassocResp from 00:0b:86:26:36:f1 (capab=0x431 status=0 aid=2)
[ 3434.512782] wlan0: associated
[ 3434.563942] wlan0: deauthenticating from 00:0b:86:26:36:f1 by local choice (reason=3)
[ 3434.564023] ------------[ cut here ]------------
[ 3434.564039] WARNING: at net/wireless/mlme.c:96 cfg80211_send_rx_assoc+0x193/0x230()
[ 3434.564045] Hardware name: VGN-FZ240E
[ 3434.564049] Modules linked in: usbhid nvram dvb_usb_dib0700 dib7000p dib7000m dib0070 dvb_usb dib3000mc dib8000 dibx000_common snd_hda_codec_idt uvcvideo snd_hda_intel snd_hda_codec ehci_hcd sg uhci_hcd snd_hwdep sky2 iwlagn i2c_i801 sr_mod evdev ata_piix ahci libata sd_mod scsi_mod
[ 3434.564104] Pid: 2319, comm: phy0 Not tainted 2.6.32-rc3 #204
[ 3434.564109] Call Trace:
[ 3434.564119]  [<ffffffff81420dd3>] ? cfg80211_send_rx_assoc+0x193/0x230
[ 3434.564131]  [<ffffffff81047cb8>] warn_slowpath_common+0x78/0xd0
[ 3434.564139]  [<ffffffff81047d1f>] warn_slowpath_null+0xf/0x20
[ 3434.564147]  [<ffffffff81420dd3>] cfg80211_send_rx_assoc+0x193/0x230
[ 3434.564156]  [<ffffffff814316cb>] ieee80211_sta_work+0x2fb/0x1100
[ 3434.564166]  [<ffffffff81453b1f>] ? _spin_unlock_bh+0xf/0x20
[ 3434.564175]  [<ffffffff8142802a>] ? ieee80211_configure_filter+0x11a/0x170
[ 3434.564183]  [<ffffffff814313d0>] ? ieee80211_sta_work+0x0/0x1100
[ 3434.564193]  [<ffffffff8105e9e2>] worker_thread+0x182/0x260
[ 3434.564203]  [<ffffffff81063320>] ? autoremove_wake_function+0x0/0x40
[ 3434.564211]  [<ffffffff8105e860>] ? worker_thread+0x0/0x260
[ 3434.564219]  [<ffffffff81062f06>] kthread+0x96/0xb0
[ 3434.564229]  [<ffffffff8100cd1a>] child_rip+0xa/0x20
[ 3434.564237]  [<ffffffff81062e70>] ? kthread+0x0/0xb0
[ 3434.564245]  [<ffffffff8100cd10>] ? child_rip+0x0/0x20
[ 3434.564250] ---[ end trace 99d6122abfa316f7 ]---
[ 3434.564272] ------------[ cut here ]------------
[ 3434.564280] WARNING: at net/wireless/sme.c:417 __cfg80211_connect_result+0x343/0x380()
[ 3434.564285] Hardware name: VGN-FZ240E
[ 3434.564289] Modules linked in: usbhid nvram dvb_usb_dib0700 dib7000p dib7000m dib0070 dvb_usb dib3000mc dib8000 dibx000_common snd_hda_codec_idt uvcvideo snd_hda_intel snd_hda_codec ehci_hcd sg uhci_hcd snd_hwdep sky2 iwlagn i2c_i801 sr_mod evdev ata_piix ahci libata sd_mod scsi_mod
[ 3434.564335] Pid: 2319, comm: phy0 Tainted: G        W  2.6.32-rc3 #204
[ 3434.564340] Call Trace:
[ 3434.564347]  [<ffffffff81453b1f>] ? _spin_unlock_bh+0xf/0x20
[ 3434.564355]  [<ffffffff814236e3>] ? __cfg80211_connect_result+0x343/0x380
[ 3434.564364]  [<ffffffff81047cb8>] warn_slowpath_common+0x78/0xd0
[ 3434.564373]  [<ffffffff81047d1f>] warn_slowpath_null+0xf/0x20
[ 3434.564381]  [<ffffffff814236e3>] __cfg80211_connect_result+0x343/0x380
[ 3434.564389]  [<ffffffff814509a2>] ? dump_stack+0x72/0x7b
[ 3434.564397]  [<ffffffff81420e10>] cfg80211_send_rx_assoc+0x1d0/0x230
[ 3434.564405]  [<ffffffff814316cb>] ieee80211_sta_work+0x2fb/0x1100
[ 3434.564413]  [<ffffffff81453b1f>] ? _spin_unlock_bh+0xf/0x20
[ 3434.564421]  [<ffffffff8142802a>] ? ieee80211_configure_filter+0x11a/0x170
[ 3434.564429]  [<ffffffff814313d0>] ? ieee80211_sta_work+0x0/0x1100
[ 3434.564438]  [<ffffffff8105e9e2>] worker_thread+0x182/0x260
[ 3434.564447]  [<ffffffff81063320>] ? autoremove_wake_function+0x0/0x40
[ 3434.564455]  [<ffffffff8105e860>] ? worker_thread+0x0/0x260
[ 3434.564463]  [<ffffffff81062f06>] kthread+0x96/0xb0
[ 3434.564471]  [<ffffffff8100cd1a>] child_rip+0xa/0x20
[ 3434.564479]  [<ffffffff81062e70>] ? kthread+0x0/0xb0
[ 3434.564487]  [<ffffffff8100cd10>] ? child_rip+0x0/0x20
[ 3434.564492] ---[ end trace 99d6122abfa316f8 ]---
[ 3434.962611] Registered led device: iwl-phy0::radio
[ 3434.962629] Registered led device: iwl-phy0::assoc
[ 3434.962645] Registered led device: iwl-phy0::RX
[ 3434.962661] Registered led device: iwl-phy0::TX
[ 3435.000526] ADDRCONF(NETDEV_UP): wlan0: link is not ready

^ permalink raw reply

* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: John W. Linville @ 2009-10-07 14:45 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Hin-Tak Leung, linux-wireless, Hin-Tak Leung
In-Reply-To: <43e72e890910062240w7b4f0895t7f009b99da8fac40@mail.gmail.com>

On Wed, Oct 07, 2009 at 01:40:04AM -0400, Luis R. Rodriguez wrote:
> On Tue, Oct 6, 2009 at 11:39 PM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:
> > Between 2.6.30 and 2.6.31, linux/netdevice.h started
> > to include linux/ethtool.h (commit b1b67dd45a6b629eb41553856805aaa1614fbb83,
> > "net: factor out ethtool invocation of vlan/macvlan drivers"),
> > and commit 7508e486965b0af13984bc6d9da62a8d8f0dc5f9,
> > "cfg80211: add firmware and hardware version to wiphy", introduces
> > dependency of ETHTOOL_BUSINFO_LEN from linux/ethtool.h
> > to net/cfg80211.h .
> 
> John's patch titled "cfg80211: fix compile error from missing
> ethtool.h" seems to address this upstream. I'll wait until he applies
> that to the tree.

As Hin-Tak points-out, linux/netdevice.h is alreadying "doing the needful". :-)

I'll just drop my patch and let this get sorted in compat-wireless.

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

^ permalink raw reply

* [PATCH] net/wireless/ethtool.h: drop unnecessary include of linux/ethtool.h
From: John W. Linville @ 2009-10-07 14:52 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville

Everything including this header includes net/cfg80211.h, which
includes linux/netdevice.h, which includes linux/ethtool.h already.  Why
slow-down the build, even a little bit?

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 net/wireless/ethtool.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/net/wireless/ethtool.h b/net/wireless/ethtool.h
index 70cbee1..695ecad 100644
--- a/net/wireless/ethtool.h
+++ b/net/wireless/ethtool.h
@@ -1,8 +1,6 @@
 #ifndef __CFG80211_ETHTOOL__
 #define __CFG80211_ETHTOOL__
 
-#include <linux/ethtool.h>
-
 extern const struct ethtool_ops cfg80211_ethtool_ops;
 
 #endif /* __CFG80211_ETHTOOL__ */
-- 
1.6.2.5


^ permalink raw reply related

* [PATCH] b43: Fix locking problem when stopping rfkill polling
From: Larry Finger @ 2009-10-07 15:06 UTC (permalink / raw)
  To: John W Linville; +Cc: linux-wireless

In commit 26e5ab35b4c7b1d4cb487a11084520aed9a8d05e entitled "b43: Fix PPC
crash in rfkill polling on unload", the call to stop polling should not have
been placed inside the wl->mutex. The result was incorrect locking messages.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

John,

I had not intended for the previous patch to be applied as I was waiting for
the Bugzilla OP to test. He promised to do that today. In any case, that patch
introduced a locking problem that needs to be fixed.

Why do the one-liners cause so many problems?

Larry
---

Index: wireless-testing/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/main.c
+++ wireless-testing/drivers/net/wireless/b43/main.c
@@ -4501,8 +4501,8 @@ static void b43_op_stop(struct ieee80211
 
 	cancel_work_sync(&(wl->beacon_update_trigger));
 
-	mutex_lock(&wl->mutex);
 	wiphy_rfkill_stop_polling(hw->wiphy);
+	mutex_lock(&wl->mutex);
 	if (b43_status(dev) >= B43_STAT_STARTED) {
 		dev = b43_wireless_core_stop(dev);
 		if (!dev)

^ permalink raw reply

* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Luis R. Rodriguez @ 2009-10-07 15:22 UTC (permalink / raw)
  To: John W. Linville; +Cc: Hin-Tak Leung, linux-wireless, Hin-Tak Leung
In-Reply-To: <20091007144502.GA22394@tuxdriver.com>

On Wed, Oct 7, 2009 at 10:45 AM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Wed, Oct 07, 2009 at 01:40:04AM -0400, Luis R. Rodriguez wrote:
>> On Tue, Oct 6, 2009 at 11:39 PM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:
>> > Between 2.6.30 and 2.6.31, linux/netdevice.h started
>> > to include linux/ethtool.h (commit b1b67dd45a6b629eb41553856805aaa1614fbb83,
>> > "net: factor out ethtool invocation of vlan/macvlan drivers"),
>> > and commit 7508e486965b0af13984bc6d9da62a8d8f0dc5f9,
>> > "cfg80211: add firmware and hardware version to wiphy", introduces
>> > dependency of ETHTOOL_BUSINFO_LEN from linux/ethtool.h
>> > to net/cfg80211.h .
>>
>> John's patch titled "cfg80211: fix compile error from missing
>> ethtool.h" seems to address this upstream. I'll wait until he applies
>> that to the tree.
>
> As Hin-Tak points-out, linux/netdevice.h is alreadying "doing the needful". :-)
>
> I'll just drop my patch and let this get sorted in compat-wireless.

Heh ok applied, thanks.

  Luis

^ permalink raw reply

* Re: [PATCH v2] libertas: Use lbs_is_cmd_allowed() check in command handling routines.
From: Dan Williams @ 2009-10-07 15:58 UTC (permalink / raw)
  To: Bing Zhao; +Cc: libertas-dev, linux-wireless, Amitkumar Karwar
In-Reply-To: <1254882028-26154-1-git-send-email-bzhao@marvell.com>

On Tue, 2009-10-06 at 19:20 -0700, Bing Zhao wrote:
> From: Amitkumar Karwar <akarwar@marvell.com>
> 
> lbs_is_cmd_allowed() check is added in __lbs_cmd_async() and
> lbs_prepare_and_send_command(). The check is removed from other places.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Bing Zhao <bzhao@marvell.com>

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

> ---
>  drivers/net/wireless/libertas/cmd.c     |   34 ++++++++
>  drivers/net/wireless/libertas/debugfs.c |   46 -----------
>  drivers/net/wireless/libertas/decl.h    |    1 -
>  drivers/net/wireless/libertas/scan.c    |   11 ---
>  drivers/net/wireless/libertas/wext.c    |  133 -------------------------------
>  5 files changed, 34 insertions(+), 191 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
> index 3a3e894..0fb3125 100644
> --- a/drivers/net/wireless/libertas/cmd.c
> +++ b/drivers/net/wireless/libertas/cmd.c
> @@ -75,6 +75,30 @@ static u8 is_command_allowed_in_ps(u16 cmd)
>  }
>  
>  /**
> + *  @brief This function checks if the command is allowed.
> + *
> + *  @param priv         A pointer to lbs_private structure
> + *  @return             allowed or not allowed.
> + */
> +
> +static int lbs_is_cmd_allowed(struct lbs_private *priv)
> +{
> +	int ret = 1;
> +
> +	lbs_deb_enter(LBS_DEB_CMD);
> +
> +	if (!priv->is_auto_deep_sleep_enabled) {
> +		if (priv->is_deep_sleep) {
> +			lbs_deb_cmd("command not allowed in deep sleep\n");
> +			ret = 0;
> +		}
> +	}
> +
> +	lbs_deb_leave(LBS_DEB_CMD);
> +	return ret;
> +}
> +
> +/**
>   *  @brief Updates the hardware details like MAC address and regulatory region
>   *
>   *  @param priv    	A pointer to struct lbs_private structure
> @@ -1452,6 +1476,11 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
>  		goto done;
>  	}
>  
> +	if (!lbs_is_cmd_allowed(priv)) {
> +		ret = -EBUSY;
> +		goto done;
> +	}
> +
>  	cmdnode = lbs_get_cmd_ctrl_node(priv);
>  
>  	if (cmdnode == NULL) {
> @@ -2104,6 +2133,11 @@ static struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv,
>  		goto done;
>  	}
>  
> +	if (!lbs_is_cmd_allowed(priv)) {
> +		cmdnode = ERR_PTR(-EBUSY);
> +		goto done;
> +	}
> +
>  	cmdnode = lbs_get_cmd_ctrl_node(priv);
>  	if (cmdnode == NULL) {
>  		lbs_deb_host("PREP_CMD: cmdnode is NULL\n");
> diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
> index 8a7e931..893a55c 100644
> --- a/drivers/net/wireless/libertas/debugfs.c
> +++ b/drivers/net/wireless/libertas/debugfs.c
> @@ -117,11 +117,6 @@ static ssize_t lbs_sleepparams_write(struct file *file,
>  	if (!buf)
>  		return -ENOMEM;
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out_unlock;
> -	}
> -
>  	buf_size = min(count, len - 1);
>  	if (copy_from_user(buf, user_buf, buf_size)) {
>  		ret = -EFAULT;
> @@ -162,11 +157,6 @@ static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf,
>  	if (!buf)
>  		return -ENOMEM;
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out_unlock;
> -	}
> -
>  	ret = lbs_cmd_802_11_sleep_params(priv, CMD_ACT_GET, &sp);
>  	if (ret)
>  		goto out_unlock;
> @@ -233,9 +223,6 @@ static ssize_t lbs_threshold_read(uint16_t tlv_type, uint16_t event_mask,
>  	u8 freq;
>  	int events = 0;
>  
> -	if (!lbs_is_cmd_allowed(priv))
> -		return -EBUSY;
> -
>  	buf = (char *)get_zeroed_page(GFP_KERNEL);
>  	if (!buf)
>  		return -ENOMEM;
> @@ -288,9 +275,6 @@ static ssize_t lbs_threshold_write(uint16_t tlv_type, uint16_t event_mask,
>  	char *buf;
>  	int ret;
>  
> -	if (!lbs_is_cmd_allowed(priv))
> -		return -EBUSY;
> -
>  	buf = (char *)get_zeroed_page(GFP_KERNEL);
>  	if (!buf)
>  		return -ENOMEM;
> @@ -460,11 +444,6 @@ static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf,
>  	if (!buf)
>  		return -ENOMEM;
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		free_page(addr);
> -		return -EBUSY;
> -	}
> -
>  	offval.offset = priv->mac_offset;
>  	offval.value = 0;
>  
> @@ -517,11 +496,6 @@ static ssize_t lbs_wrmac_write(struct file *file,
>  	if (!buf)
>  		return -ENOMEM;
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		res = -EBUSY;
> -		goto out_unlock;
> -	}
> -
>  	buf_size = min(count, len - 1);
>  	if (copy_from_user(buf, userbuf, buf_size)) {
>  		res = -EFAULT;
> @@ -558,11 +532,6 @@ static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf,
>  	if (!buf)
>  		return -ENOMEM;
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		free_page(addr);
> -		return -EBUSY;
> -	}
> -
>  	offval.offset = priv->bbp_offset;
>  	offval.value = 0;
>  
> @@ -616,11 +585,6 @@ static ssize_t lbs_wrbbp_write(struct file *file,
>  	if (!buf)
>  		return -ENOMEM;
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		res = -EBUSY;
> -		goto out_unlock;
> -	}
> -
>  	buf_size = min(count, len - 1);
>  	if (copy_from_user(buf, userbuf, buf_size)) {
>  		res = -EFAULT;
> @@ -657,11 +621,6 @@ static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf,
>  	if (!buf)
>  		return -ENOMEM;
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		free_page(addr);
> -		return -EBUSY;
> -	}
> -
>  	offval.offset = priv->rf_offset;
>  	offval.value = 0;
>  
> @@ -715,11 +674,6 @@ static ssize_t lbs_wrrf_write(struct file *file,
>  	if (!buf)
>  		return -ENOMEM;
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		res = -EBUSY;
> -		goto out_unlock;
> -	}
> -
>  	buf_size = min(count, len - 1);
>  	if (copy_from_user(buf, userbuf, buf_size)) {
>  		res = -EFAULT;
> diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h
> index 44f0b24..fb91c36 100644
> --- a/drivers/net/wireless/libertas/decl.h
> +++ b/drivers/net/wireless/libertas/decl.h
> @@ -34,7 +34,6 @@ int lbs_process_event(struct lbs_private *priv, u32 event);
>  void lbs_queue_event(struct lbs_private *priv, u32 event);
>  void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx);
>  int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep);
> -int lbs_is_cmd_allowed(struct lbs_private *priv);
>  int lbs_enter_auto_deep_sleep(struct lbs_private *priv);
>  int lbs_exit_auto_deep_sleep(struct lbs_private *priv);
>  
> diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
> index e468e15..6c95af3 100644
> --- a/drivers/net/wireless/libertas/scan.c
> +++ b/drivers/net/wireless/libertas/scan.c
> @@ -950,11 +950,6 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out;
> -	}
> -
>  	if (!priv->radio_on) {
>  		ret = -EINVAL;
>  		goto out;
> @@ -1022,12 +1017,6 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		err = -EBUSY;
> -		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", err);
> -		return err;
> -	}
> -
>  	/* iwlist should wait until the current scan is finished */
>  	if (priv->scan_channel)
>  		return -EAGAIN;
> diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
> index 38a451e..69dd19b 100644
> --- a/drivers/net/wireless/libertas/wext.c
> +++ b/drivers/net/wireless/libertas/wext.c
> @@ -46,32 +46,6 @@ static inline void lbs_cancel_association_work(struct lbs_private *priv)
>  }
>  
>  /**
> - *  @brief This function checks if the command is allowed.
> - *
> - *  @param priv         A pointer to lbs_private structure
> - *  @return             allowed or not allowed.
> - */
> -
> -int lbs_is_cmd_allowed(struct lbs_private *priv)
> -{
> -	int         ret = 1;
> -
> -	lbs_deb_enter(LBS_DEB_WEXT);
> -
> -	if (!priv->is_auto_deep_sleep_enabled) {
> -		if (priv->is_deep_sleep) {
> -			lbs_deb_wext("IOCTLS called when station"
> -					"is in deep sleep\n");
> -			ret = 0;
> -		}
> -	}
> -
> -	lbs_deb_leave(LBS_DEB_WEXT);
> -	return ret;
> -}
> -
> -
> -/**
>   *  @brief Find the channel frequency power info with specific channel
>   *
>   *  @param priv 	A pointer to struct lbs_private structure
> @@ -193,11 +167,6 @@ static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		lbs_deb_leave(LBS_DEB_WEXT);
> -		return -EBUSY;
> -	}
> -
>  	cfp = lbs_find_cfp_by_band_and_channel(priv, 0,
>  					   priv->curbssparams.channel);
>  
> @@ -308,12 +277,6 @@ static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
> -		return ret;
> -	}
> -
>  	if (vwrq->disabled)
>  		val = MRVDRV_RTS_MAX_VALUE;
>  
> @@ -335,11 +298,6 @@ static int lbs_get_rts(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out;
> -	}
> -
>  	ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_RTS_THRESHOLD, &val);
>  	if (ret)
>  		goto out;
> @@ -362,12 +320,6 @@ static int lbs_set_frag(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
> -		return ret;
> -	}
> -
>  	if (vwrq->disabled)
>  		val = MRVDRV_FRAG_MAX_VALUE;
>  
> @@ -389,11 +341,6 @@ static int lbs_get_frag(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out;
> -	}
> -
>  	ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_FRAG_THRESHOLD, &val);
>  	if (ret)
>  		goto out;
> @@ -443,11 +390,6 @@ static int lbs_get_txpow(struct net_device *dev,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out;
> -	}
> -
>  	if (!priv->radio_on) {
>  		lbs_deb_wext("tx power off\n");
>  		vwrq->value = 0;
> @@ -481,11 +423,6 @@ static int lbs_set_retry(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out;
> -	}
> -
>          if ((vwrq->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
>                  return -EOPNOTSUPP;
>  
> @@ -534,11 +471,6 @@ static int lbs_get_retry(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out;
> -	}
> -
>  	vwrq->disabled = 0;
>  
>  	if (vwrq->flags & IW_RETRY_LONG) {
> @@ -907,9 +839,6 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv))
> -		return NULL;
> -
>  	priv->wstats.status = priv->mode;
>  
>  	/* If we're not associated, all quality values are meaningless */
> @@ -1010,12 +939,6 @@ static int lbs_set_freq(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
> -		return ret;
> -	}
> -
>  	mutex_lock(&priv->lock);
>  	assoc_req = lbs_get_association_request(priv);
>  	if (!assoc_req) {
> @@ -1125,11 +1048,6 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out;
> -	}
> -
>  	lbs_deb_wext("vwrq->value %d\n", vwrq->value);
>  	lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed);
>  
> @@ -1188,11 +1106,6 @@ static int lbs_get_rate(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		lbs_deb_leave(LBS_DEB_WEXT);
> -		return -EBUSY;
> -	}
> -
>  	if (priv->connect_status == LBS_CONNECTED) {
>  		vwrq->value = priv->cur_rate * 500000;
>  
> @@ -1219,11 +1132,6 @@ static int lbs_set_mode(struct net_device *dev,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out;
> -	}
> -
>  	if (   (*uwrq != IW_MODE_ADHOC)
>  	    && (*uwrq != IW_MODE_INFRA)
>  	    && (*uwrq != IW_MODE_AUTO)) {
> @@ -1465,12 +1373,6 @@ static int lbs_set_encode(struct net_device *dev,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
> -		return ret;
> -	}
> -
>  	mutex_lock(&priv->lock);
>  	assoc_req = lbs_get_association_request(priv);
>  	if (!assoc_req) {
> @@ -1654,12 +1556,6 @@ static int lbs_set_encodeext(struct net_device *dev,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
> -		return ret;
> -	}
> -
>  	mutex_lock(&priv->lock);
>  	assoc_req = lbs_get_association_request(priv);
>  	if (!assoc_req) {
> @@ -1872,12 +1768,6 @@ static int lbs_set_auth(struct net_device *dev,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
> -		return ret;
> -	}
> -
>  	mutex_lock(&priv->lock);
>  	assoc_req = lbs_get_association_request(priv);
>  	if (!assoc_req) {
> @@ -1980,12 +1870,6 @@ static int lbs_get_auth(struct net_device *dev,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
> -		return ret;
> -	}
> -
>  	switch (dwrq->flags & IW_AUTH_INDEX) {
>  	case IW_AUTH_KEY_MGMT:
>  		dwrq->value = priv->secinfo.key_mgmt;
> @@ -2028,11 +1912,6 @@ static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		goto out;
> -	}
> -
>  	if (vwrq->disabled) {
>  		lbs_set_radio(priv, RADIO_PREAMBLE_AUTO, 0);
>  		goto out;
> @@ -2152,12 +2031,6 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
> -		return ret;
> -	}
> -
>  	if (!priv->radio_on) {
>  		ret = -EINVAL;
>  		goto out;
> @@ -2285,12 +2158,6 @@ static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!lbs_is_cmd_allowed(priv)) {
> -		ret = -EBUSY;
> -		lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
> -		return ret;
> -	}
> -
>  	if (!priv->radio_on)
>  		return -EINVAL;
>  


^ permalink raw reply

* Re: [PATCH v2] b43: do not stack-allocate pio rx/tx header and tail buffers
From: Larry Finger @ 2009-10-07 16:43 UTC (permalink / raw)
  To: Albert Herranz; +Cc: bcm43xx-dev, mb, linux-wireless
In-Reply-To: <1254866864-18265-1-git-send-email-albert_herranz@yahoo.es>

Albert Herranz wrote:
> The DMA-API debugging facility complains about b43 mapping memory from
> stack for SDIO-based cards.
> 
> Indeed, b43 currently allocates the PIO RX/TX header and tail buffers
> from stack. The solution here is to use heap-allocated buffers instead.
> 
> Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
> ---
> v2
> - embed buffers into struct b43_wl, and make them depend on CONFIG_B43_PIO
> - take into account tail buffers for unaligned length transfers
> 
>  drivers/net/wireless/b43/b43.h  |  168 +++++++++++++++++++++------------------
>  drivers/net/wireless/b43/pio.c  |   78 +++++++++---------
>  drivers/net/wireless/b43/xmit.c |    2 +-
>  3 files changed, 132 insertions(+), 116 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
> index fa1549a..6607162 100644
> --- a/drivers/net/wireless/b43/b43.h
> +++ b/drivers/net/wireless/b43/b43.h
> @@ -607,82 +607,7 @@ struct b43_qos_params {
>  	struct ieee80211_tx_queue_params p;
>  };
>  
> -struct b43_wldev;
> -
> -/* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */
> -struct b43_wl {
> -	/* Pointer to the active wireless device on this chip */
> -	struct b43_wldev *current_dev;
> -	/* Pointer to the ieee80211 hardware data structure */
> -	struct ieee80211_hw *hw;

What is the reason for moving the definition of struct b43_wl?

Larry


^ permalink raw reply

* Re: [PATCH v2] b43: do not stack-allocate pio rx/tx header and tail buffers
From: Albert Herranz @ 2009-10-07 16:57 UTC (permalink / raw)
  To: Larry Finger; +Cc: bcm43xx-dev, mb, linux-wireless
In-Reply-To: <4ACCC516.7050002@lwfinger.net>

Larry Finger wrote:
> Albert Herranz wrote:
>> The DMA-API debugging facility complains about b43 mapping memory from
>> stack for SDIO-based cards.
>>
>> Indeed, b43 currently allocates the PIO RX/TX header and tail buffers
>> from stack. The solution here is to use heap-allocated buffers instead.
>>
>> Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
>> ---
>> v2
>> - embed buffers into struct b43_wl, and make them depend on CONFIG_B43_PIO
>> - take into account tail buffers for unaligned length transfers
>>
>>  drivers/net/wireless/b43/b43.h  |  168 +++++++++++++++++++++------------------
>>  drivers/net/wireless/b43/pio.c  |   78 +++++++++---------
>>  drivers/net/wireless/b43/xmit.c |    2 +-
>>  3 files changed, 132 insertions(+), 116 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
>> index fa1549a..6607162 100644
>> --- a/drivers/net/wireless/b43/b43.h
>> +++ b/drivers/net/wireless/b43/b43.h
>> @@ -607,82 +607,7 @@ struct b43_qos_params {
>>  	struct ieee80211_tx_queue_params p;
>>  };
>>  
>> -struct b43_wldev;
>> -
>> -/* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */
>> -struct b43_wl {
>> -	/* Pointer to the active wireless device on this chip */
>> -	struct b43_wldev *current_dev;
>> -	/* Pointer to the ieee80211 hardware data structure */
>> -	struct ieee80211_hw *hw;
> 
> What is the reason for moving the definition of struct b43_wl?
> 
> Larry
> 
> 

b43_new_kidx_api() (defined in xmit.h) needs struct b43_wldev defined because it dereferences it.
With this patch, struct b43_wl (defined in b43.h) needs struct b43_rxhdr_fw4 and struct b43_txhdr (defined in xmit.h).

So we have b43_wldev -> b43_rxhdr_fw4, b43_txhdr -> b43_wl (at least).

Moving the definition of struct b43_wl after the definition of struct b43_wldev and placing the inclusion of xmit.h between them gets rid of the generated dependencies.

The patch hints too to other possible solution.

>/*
> * Include goes here to avoid a dependency problem.
> * A better fix would be to integrate xmit.h into b43.h.
> */
>#include "xmit.h"

Do you have any other solutions in mind?

Thanks,
Albert


^ permalink raw reply

* Re: [.32-rc3] scheduler: iwlagn consistently high in "waiting for CPU"
From: Frans Pop @ 2009-10-07 17:10 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Linux Kernel Mailing List, Ingo Molnar, Peter Zijlstra,
	linux-wireless
In-Reply-To: <200910061749.02805.elendil@planet.nl>

On Tuesday 06 October 2009, Frans Pop wrote:
> I've checked for 2.6.31.1 now and iwlagn is listed high there too when
> the system is idle, but with normal values of 60-100 ms. And phy0 has
> normal values of below 10 ms.
> I've now rebooted with today's mainline git; phy0 now frequently shows
> with values of around 100 ms too (i.e. higher than last time).
>
> Both still go way down as soon as the system is given work to do.
>
> With a 5 second sleep I was unable to get any significant latencies (I
> started perf on a latencytop refresh and did a manual refresh as it
> finished to see what happened during the perf run). The perf run does
> seem to affect the latencies.
> I've uploaded a chart for a 10s sleep during which I got latencies of
> 101ms for iwlagn and 77ms for phy0:
> http://people.debian.org/~fjp/tmp/kernel/.

Mike privately sent me a script to try to capture the latencies with perf,
but the perf output does not show any high latencies at all. It looks as if
we may have found a bug in latencytop here instead.

Below a relevant quote from our private mails and the data I captured with
Mike's script.

Cheers,
FJP

On Wednesday 07 October 2009, Mike Galbraith wrote:
> On Wed, 2009-10-07 at 17:53 +0200, Frans Pop wrote:
> > I had latencytop running at the same time and that happily showed
> > values of 160 and 102 ms for iwlagn during the same period.
> > The highest values I see from your script for any process are ~12 ms.
> >
> > Does this mean there is a bug in latencytop somewhere? Or is there
> > something else going on?
>
> I suspect a bug in latencytop.. Arjan might suspect perf ;-)
>
> The only way you can get a 100+ ms latency hit on a mostly idle box is
> for there to be a problem with the clock, _and_ have multiple runnable
> heavy cpu using tasks on the runqueue so you can have a wide vruntime
> spread.  Peter's been all over the vruntime update logic, and if it or
> the clock were generally screwed, you'd see latency spikes all over
> creation.  It _could_ be some rare event though, why I hacked script
> together to chop off bite sized chunks for analysis.  Since nothing
> showed up there, and nothing's showing up here doing the same amarok+nfs
> thing, I'll place my bet on latencytop.. for now.
>
> > At the bottom a sample from your unmodified script. That one is fairly
> > typical, although it has does have about the highest value I've seen
> > for iwlagn.
>
> Yeah, looks perfectly normal.  Which leaves us at square one :-/



Typical output from perf (with fairly high phy0 and iwlagn):
 -----------------------------------------------------------------------------------------
  Task                  |   Runtime ms  | Switches | Average delay ms | Maximum delay ms |
 -----------------------------------------------------------------------------------------
  kondemand/0:282       |      2.085 ms |      123 | avg:    0.152 ms | max:    7.007 ms |
  amarokapp:5485        |    123.867 ms |      240 | avg:    0.120 ms | max:    5.260 ms |
  kondemand/1:283       |      1.977 ms |      119 | avg:    0.107 ms | max:    4.781 ms |
  phy0:2750             |      0.684 ms |       28 | avg:    0.181 ms | max:    3.921 ms |
  iwlagn:2749           |      0.668 ms |       28 | avg:    0.196 ms | max:    3.697 ms |
  Xorg:4147             |     40.570 ms |      224 | avg:    0.109 ms | max:    3.615 ms |
  kblockd/0:78          |      0.013 ms |        1 | avg:    3.121 ms | max:    3.121 ms |
  kcryptd:1520          |     64.962 ms |       11 | avg:    0.347 ms | max:    2.812 ms |
  perf:9451             |    322.937 ms |       40 | avg:    0.144 ms | max:    2.198 ms |
  :5662:5662            |     50.572 ms |      147 | avg:    0.087 ms | max:    2.141 ms |
  head:9452             |      2.589 ms |        4 | avg:    0.454 ms | max:    1.648 ms |
  :9439:9439            |      6.670 ms |      225 | avg:    0.127 ms | max:    1.574 ms |
  kicker:5451           |     24.650 ms |      102 | avg:    0.158 ms | max:    1.465 ms |
  ksysguardd:5454       |      6.614 ms |        7 | avg:    0.283 ms | max:    1.218 ms |
  :5661:5661            |      0.208 ms |        9 | avg:    0.130 ms | max:    1.024 ms |
  latencytop:7776       |      2.010 ms |        4 | avg:    0.256 ms | max:    0.980 ms |

Series of greps from that output for only iwlagn and phy0:
Oct 07 17:23:39   iwlagn:2749           |      0.721 ms |       35 | avg:    0.050 ms | max:    0.083 ms |
Oct 07 17:23:39   phy0:2750             |      0.779 ms |       35 | avg:    0.032 ms | max:    0.036 ms |
Oct 07 17:23:46   iwlagn:2749           |      0.617 ms |       32 | avg:    0.107 ms | max:    1.753 ms |
Oct 07 17:23:46   phy0:2750             |      0.783 ms |       32 | avg:    0.123 ms | max:    1.745 ms |
Oct 07 17:23:53   iwlagn:2749           |      0.629 ms |       31 | avg:    0.055 ms | max:    0.109 ms |
Oct 07 17:23:53   phy0:2750             |      0.774 ms |       31 | avg:    0.029 ms | max:    0.050 ms |
Oct 07 17:24:01   iwlagn:2749           |      0.908 ms |       35 | avg:    0.054 ms | max:    0.097 ms |
Oct 07 17:24:01   phy0:2750             |      0.839 ms |       35 | avg:    0.033 ms | max:    0.056 ms |
Oct 07 17:24:08   phy0:2750             |      0.742 ms |       32 | avg:    0.033 ms | max:    0.124 ms |
Oct 07 17:24:08   iwlagn:2749           |      0.734 ms |       32 | avg:    0.050 ms | max:    0.083 ms |
Oct 07 17:24:15   phy0:2750             |      0.963 ms |       41 | avg:    0.034 ms | max:    0.164 ms |
Oct 07 17:24:15   iwlagn:2749           |      0.721 ms |       41 | avg:    0.049 ms | max:    0.118 ms |
Oct 07 17:24:23   iwlagn:2749           |      6.434 ms |       73 | avg:    0.052 ms | max:    0.153 ms |
Oct 07 17:24:23   phy0:2750             |      0.620 ms |       22 | avg:    0.023 ms | max:    0.094 ms |
Oct 07 17:24:30   iwlagn:2749           |      0.934 ms |       38 | avg:    0.055 ms | max:    0.194 ms |
Oct 07 17:24:30   phy0:2750             |      0.941 ms |       37 | avg:    0.033 ms | max:    0.123 ms |
Oct 07 17:24:37   iwlagn:2749           |      5.324 ms |       74 | avg:    0.054 ms | max:    0.106 ms |
Oct 07 17:24:37   phy0:2750             |      0.993 ms |       36 | avg:    0.030 ms | max:    0.050 ms |
Oct 07 17:24:45   iwlagn:2749           |      0.844 ms |       36 | avg:    0.049 ms | max:    0.080 ms |
Oct 07 17:24:45   phy0:2750             |      0.770 ms |       34 | avg:    0.032 ms | max:    0.043 ms |
Oct 07 17:24:52   phy0:2750             |      0.832 ms |       36 | avg:    0.044 ms | max:    0.185 ms |
Oct 07 17:24:52   iwlagn:2749           |      0.923 ms |       36 | avg:    0.050 ms | max:    0.081 ms |
Oct 07 17:24:59   iwlagn:2749           |      0.778 ms |       35 | avg:    0.054 ms | max:    0.104 ms |
Oct 07 17:24:59   phy0:2750             |      0.778 ms |       34 | avg:    0.025 ms | max:    0.041 ms |
Oct 07 17:25:07   iwlagn:2749           |      0.854 ms |       34 | avg:    0.056 ms | max:    0.103 ms |
Oct 07 17:25:07   phy0:2750             |      0.780 ms |       34 | avg:    0.027 ms | max:    0.040 ms |
Oct 07 17:25:14   phy0:2750             |      0.762 ms |       33 | avg:    0.035 ms | max:    0.168 ms |
Oct 07 17:25:14   iwlagn:2749           |      0.853 ms |       33 | avg:    0.051 ms | max:    0.080 ms |
Oct 07 17:25:21   iwlagn:2749           |      0.892 ms |       34 | avg:    0.053 ms | max:    0.144 ms |
Oct 07 17:25:21   phy0:2750             |      0.780 ms |       34 | avg:    0.029 ms | max:    0.040 ms |
Oct 07 17:25:29   iwlagn:2749           |      0.972 ms |       39 | avg:    0.046 ms | max:    0.079 ms |
Oct 07 17:25:29   phy0:2750             |      0.843 ms |       38 | avg:    0.031 ms | max:    0.040 ms |
Oct 07 17:25:36   iwlagn:2749           |      0.896 ms |       39 | avg:    0.054 ms | max:    0.106 ms |
Oct 07 17:25:36   phy0:2750             |      0.873 ms |       37 | avg:    0.032 ms | max:    0.070 ms |
Oct 07 17:25:43   phy0:2750             |      0.919 ms |       39 | avg:    0.083 ms | max:    2.161 ms |
Oct 07 17:25:43   iwlagn:2749           |      0.950 ms |       40 | avg:    0.050 ms | max:    0.102 ms |

^ 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