All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 19/26] rt2x00: Fix channel_change_time calculation
Date: Sun, 3 Dec 2006 19:18:58 +0100	[thread overview]
Message-ID: <200612031918.59151.IvDoorn@gmail.com> (raw)

Correctly initialize the channel_change_time.
Make sure that channel is reset afterwards,
otherwise the channel is not correctly initialized
and rx/tx will fail.

Signed-off-by Ivo van Doorn <IvDoorn@gmail.com>

---

diff -rU3 wireless-dev-mac/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-channel/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-mac/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-12-03 14:45:46.000000000 +0100
+++ wireless-dev-channel/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-12-03 14:52:04.000000000 +0100
@@ -1124,6 +1124,19 @@
 	unsigned long jiffies_end;
 
 	/*
+	 * Only initialize the channel_change_time
+	 * if it has not been set previously.
+	 */
+	if (rt2x00dev->hw->channel_change_time)
+		return 0;
+
+	/*
+	 * Invalidate the rx_params.channel value to make sure
+	 * the config channel will be correctly executed.
+	 */
+	rt2x00dev->rx_params.channel = 0;
+
+	/*
 	 * Determine channel_change_time
 	 * by measuring the time it takes
 	 * to switch the channel.
@@ -1171,10 +1184,11 @@
 	}
 
 	/*
-	 * Determine channel change time.
+	 * Reset the channel_change_time value
+	 * to make sure it will be correctly initialized
+	 * after the radio has been enabled.
 	 */
-	if (rt2400pci_init_channel_time(rt2x00dev))
-		goto exit_fail;
+	rt2x00dev->hw->channel_change_time = 0;
 
 	/*
 	 * Register interrupt handler.
diff -rU3 wireless-dev-mac/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-channel/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-mac/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-12-03 14:46:09.000000000 +0100
+++ wireless-dev-channel/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-12-03 14:52:32.000000000 +0100
@@ -1248,6 +1248,19 @@
 	unsigned long jiffies_end;
 
 	/*
+	 * Only initialize the channel_change_time
+	 * if it has not been set previously.
+	 */
+	if (rt2x00dev->hw->channel_change_time)
+		return 0;
+
+	/*
+	 * Invalidate the rx_params.channel value to make sure
+	 * the config channel will be correctly executed.
+	 */
+	rt2x00dev->rx_params.channel = 0;
+
+	/*
 	 * Determine channel_change_time
 	 * by measuring the time it takes
 	 * to switch the channel.
@@ -1296,10 +1309,11 @@
 	}
 
 	/*
-	 * Determine channel change time.
+	 * Reset the channel_change_time value
+	 * to make sure it will be correctly initialized
+	 * after the radio has been enabled.
 	 */
-	if (rt2500pci_init_channel_time(rt2x00dev))
-		goto exit_fail;
+	rt2x00dev->hw->channel_change_time = 0;
 
 	/*
 	 * Register interrupt handler.
diff -rU3 wireless-dev-mac/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-channel/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-mac/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-12-03 14:46:19.000000000 +0100
+++ wireless-dev-channel/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-12-03 14:52:36.000000000 +0100
@@ -1214,6 +1214,19 @@
 	unsigned long jiffies_end;
 
 	/*
+	 * Only initialize the channel_change_time
+	 * if it has not been set previously.
+	 */
+	if (rt2x00dev->hw->channel_change_time)
+		return 0;
+
+	/*
+	 * Invalidate the rx_params.channel value to make sure
+	 * the config channel will be correctly executed.
+	 */
+	rt2x00dev->rx_params.channel = 0;
+
+	/*
 	 * Determine channel_change_time
 	 * by measuring the time it takes
 	 * to switch the channel.
@@ -1262,10 +1275,11 @@
 	}
 
 	/*
-	 * Determine channel change time.
+	 * Reset the channel_change_time value
+	 * to make sure it will be correctly initialized
+	 * after the radio has been enabled.
 	 */
-	if (rt2500usb_init_channel_time(rt2x00dev))
-		goto exit_fail;
+	rt2x00dev->hw->channel_change_time = 0;
 
 	SET_FLAG(rt2x00dev, DEVICE_INITIALIZED);
 
diff -rU3 wireless-dev-mac/drivers/net/wireless/d80211/rt2x00/rt61pci.c wireless-dev-channel/drivers/net/wireless/d80211/rt2x00/rt61pci.c
--- wireless-dev-mac/drivers/net/wireless/d80211/rt2x00/rt61pci.c	2006-12-03 14:46:31.000000000 +0100
+++ wireless-dev-channel/drivers/net/wireless/d80211/rt2x00/rt61pci.c	2006-12-03 14:52:40.000000000 +0100
@@ -1681,6 +1681,19 @@
 	unsigned long jiffies_end;
 
 	/*
+	 * Only initialize the channel_change_time
+	 * if it has not been set previously.
+	 */
+	if (rt2x00dev->hw->channel_change_time)
+		return 0;
+
+	/*
+	 * Invalidate the rx_params.channel value to make sure
+	 * the config channel will be correctly executed.
+	 */
+	rt2x00dev->rx_params.channel = 0;
+
+	/*
 	 * Determine channel_change_time
 	 * by measuring the time it takes
 	 * to switch the channel.
@@ -1736,10 +1749,11 @@
 	}
 
 	/*
-	 * Determine channel change time.
+	 * Reset the channel_change_time value
+	 * to make sure it will be correctly initialized
+	 * after the radio has been enabled.
 	 */
-	if (rt61pci_init_channel_time(rt2x00dev))
-		goto exit_fail;
+	rt2x00dev->hw->channel_change_time = 0;
 
 	/*
 	 * Register interrupt handler.
diff -rU3 wireless-dev-mac/drivers/net/wireless/d80211/rt2x00/rt73usb.c wireless-dev-channel/drivers/net/wireless/d80211/rt2x00/rt73usb.c
--- wireless-dev-mac/drivers/net/wireless/d80211/rt2x00/rt73usb.c	2006-12-03 14:46:42.000000000 +0100
+++ wireless-dev-channel/drivers/net/wireless/d80211/rt2x00/rt73usb.c	2006-12-03 14:52:44.000000000 +0100
@@ -1463,6 +1463,19 @@
 	unsigned long jiffies_end;
 
 	/*
+	 * Only initialize the channel_change_time
+	 * if it has not been set previously.
+	 */
+	if (rt2x00dev->hw->channel_change_time)
+		return 0;
+
+	/*
+	 * Invalidate the rx_params.channel value to make sure
+	 * the config channel will be correctly executed.
+	 */
+	rt2x00dev->rx_params.channel = 0;
+
+	/*
 	 * Determine channel_change_time
 	 * by measuring the time it takes
 	 * to switch the channel.
@@ -1518,10 +1531,11 @@
 	}
 
 	/*
-	 * Determine channel change time.
+	 * Reset the channel_change_time value
+	 * to make sure it will be correctly initialized
+	 * after the radio has been enabled.
 	 */
-	if (rt73usb_init_channel_time(rt2x00dev))
-		goto exit_fail;
+	rt2x00dev->hw->channel_change_time = 0;
 
 	SET_FLAG(rt2x00dev, DEVICE_INITIALIZED);
 

                 reply	other threads:[~2006-12-03 18:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200612031918.59151.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.