* [PATCH 19/26] rt2x00: Fix channel_change_time calculation
@ 2006-12-03 18:18 Ivo van Doorn
0 siblings, 0 replies; only message in thread
From: Ivo van Doorn @ 2006-12-03 18:18 UTC (permalink / raw)
To: John W. Linville; +Cc: netdev
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-12-03 18:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-03 18:18 [PATCH 19/26] rt2x00: Fix channel_change_time calculation Ivo van Doorn
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.