linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 06/26] at76_usb: Fix turning radio off
Date: Sun, 30 Sep 2007 14:39:17 -0400	[thread overview]
Message-ID: <20070930183917.23921.84956.stgit@tt.roinet.com> (raw)
In-Reply-To: <20070930183409.23921.97762.stgit@tt.roinet.com>

The Atmel's driver uses command 7 to turn radio off.  Also,
CMD_GETOPMODE is bogus, remove it.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 drivers/net/wireless/at76_usb.c |   13 ++++++++-----
 drivers/net/wireless/at76_usb.h |    4 ++--
 2 files changed, 10 insertions(+), 7 deletions(-)


diff --git a/drivers/net/wireless/at76_usb.c b/drivers/net/wireless/at76_usb.c
index ca8157a..62ddae7 100644
--- a/drivers/net/wireless/at76_usb.c
+++ b/drivers/net/wireless/at76_usb.c
@@ -823,21 +823,24 @@ static int at76_set_mib(struct at76_priv *priv, struct set_mib_buffer *buf)
 }
 
 /* Return < 0 on error, == 0 if no command sent, == 1 if cmd sent */
-static int at76_set_radio(struct at76_priv *priv, int on_off)
+static int at76_set_radio(struct at76_priv *priv, int enable)
 {
 	int ret;
+	int cmd;
 
-	if (priv->radio_on == on_off)
+	if (priv->radio_on == enable)
 		return 0;
 
-	ret = at76_set_card_command(priv->udev, CMD_RADIO, NULL, 0);
+	cmd = enable ? CMD_RADIO_ON : CMD_RADIO_OFF;
+
+	ret = at76_set_card_command(priv->udev, cmd, NULL, 0);
 	if (ret < 0)
 		err("%s: at76_set_card_command(CMD_RADIO) failed: %d",
 		    priv->netdev->name, ret);
 	else
 		ret = 1;
 
-	priv->radio_on = on_off;
+	priv->radio_on = enable;
 	return ret;
 }
 
@@ -3950,7 +3953,7 @@ static int at76_startup_device(struct at76_priv *priv)
 	memset(priv->bssid, 0, ETH_ALEN);
 
 	if (at76_set_radio(priv, 1) == 1)
-		at76_wait_completion(priv, CMD_RADIO);
+		at76_wait_completion(priv, CMD_RADIO_ON);
 
 	ret = at76_set_preamble(priv, priv->preamble_type);
 	if (ret < 0)
diff --git a/drivers/net/wireless/at76_usb.h b/drivers/net/wireless/at76_usb.h
index 4fef446..413d12e 100644
--- a/drivers/net/wireless/at76_usb.h
+++ b/drivers/net/wireless/at76_usb.h
@@ -78,9 +78,9 @@ enum board_type {
 #define CMD_SCAN		0x03
 #define CMD_JOIN		0x04
 #define CMD_START_IBSS		0x05
-#define CMD_RADIO		0x06
+#define CMD_RADIO_ON		0x06
+#define CMD_RADIO_OFF		0x07
 #define CMD_STARTUP		0x0B
-#define CMD_GETOPMODE		0x33
 
 #define MIB_LOCAL		0x01
 #define MIB_MAC_ADDR		0x02

  parent reply	other threads:[~2007-09-30 18:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-30 18:38 [PATCH 00/26] at76_usb: bring up to date Pavel Roskin
2007-09-30 18:38 ` [PATCH 01/26] at76_usb: Use USB_DEVICE_DATA to improve readability of the device table Pavel Roskin
2007-09-30 18:38 ` [PATCH 02/26] at76_usb: Fix some device names in " Pavel Roskin
2007-09-30 18:38 ` [PATCH 03/26] at76_usb: Avoid dubious use of '\0' Pavel Roskin
2007-09-30 18:39 ` [PATCH 04/26] at76_usb: Don't clean priv->mib_buf, just clean data explicitly if needed Pavel Roskin
2007-09-30 18:39 ` [PATCH 05/26] at76_usb: No need to reserve 72 bytes in set_mib_buffer - we only need 6 Pavel Roskin
2007-09-30 18:39 ` Pavel Roskin [this message]
2007-09-30 18:39 ` [PATCH 07/26] at76_usb: Integrate at76_set_monitor_mode() into at76_dwork_restart() Pavel Roskin
2007-09-30 18:39 ` [PATCH 08/26] at76_usb: Eliminate err(), it's USB specific Pavel Roskin
2007-09-30 18:39 ` [PATCH 09/26] at76_usb: Remove commented out code for multicast support Pavel Roskin
2007-09-30 18:39 ` [PATCH 10/26] at76_usb: Rename tlv to ie for readability Pavel Roskin
2007-09-30 18:39 ` [PATCH 11/26] at76_usb: Stop worrying about line termination in ethtool info Pavel Roskin
2007-09-30 18:39 ` [PATCH 12/26] at76_usb: Use string precision to avoid line termination Pavel Roskin
2007-09-30 18:40 ` [PATCH 13/26] at76_usb: Eliminate variables used only in at76_dbg() Pavel Roskin
2007-09-30 18:40 ` [PATCH 14/26] at76_usb: Make it clear that management frames are sent at 1Mbps Pavel Roskin
2007-09-30 18:40 ` [PATCH 15/26] at76_usb: Clean reserved tx area for mgmt frames like it's done for data Pavel Roskin
2007-09-30 18:40 ` [PATCH 16/26] at76_usb: Remove unneeded memset() calls Pavel Roskin
2007-09-30 18:40 ` [PATCH 17/26] at76_usb: Move some parts from at76_usb.h to at76_usb.c Pavel Roskin
2007-09-30 18:40 ` [PATCH 18/26] at76_usb: Avoid dealing with milliseconds when possible, use jiffies Pavel Roskin
2007-09-30 18:40 ` [PATCH 19/26] at76_usb: Add ID for Corega Wireless LAN USB-11 mini and mini2 Pavel Roskin
2007-09-30 18:40 ` [PATCH 20/26] at76_usb: Revert to network device names starting with "wlan" Pavel Roskin
2007-09-30 18:40 ` [PATCH 21/26] at76_usb: Remove incorrect firmware version check Pavel Roskin
2007-09-30 18:40 ` [PATCH 22/26] at76_usb: Use dev_printk() where possible Pavel Roskin
2007-09-30 18:41 ` [PATCH 23/26] at76_usb: Be more verbose on startup Pavel Roskin
2007-09-30 18:41 ` [PATCH 24/26] at76_usb: Use ETH_P_802_2 in monitor mode Pavel Roskin
2007-09-30 18:41 ` [PATCH 25/26] at76_usb: Bump version to 0.17 Pavel Roskin
2007-09-30 18:41 ` [PATCH 26/26] at76_usb: Add ID for at76c503a based CNETUSB611 Pavel Roskin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070930183917.23921.84956.stgit@tt.roinet.com \
    --to=proski@gnu.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).