aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-02-25 17:15:05 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-28 09:13:09 -0500
commit61667d8d5bf3c3ee09474069eaf4b93a4755ff8b (patch)
tree3b5b0cd136e351c293aa8f099c59f1dc3a8960eb /drivers/net
parentb290d433618aa7122f6e6c4a62ddc79412a48d4d (diff)
rt2x00: Add link tuner safe RX toggle states
This adds 2 new states which both are used to toggle the RX. These new states are required for usage inside the link tuner thread, because the normal RX toggling will stop the link tuner thread. While it is possible that the link tuner thread itself is the caller of the RX toggle (when using software antenna diversity). Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00reg.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c6
7 files changed, 29 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index d6cba138c7ab..c69f85ed7669 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -960,8 +960,12 @@ static int rt2400pci_set_device_state(struct rt2x00_dev *rt2x00dev,
960 rt2400pci_disable_radio(rt2x00dev); 960 rt2400pci_disable_radio(rt2x00dev);
961 break; 961 break;
962 case STATE_RADIO_RX_ON: 962 case STATE_RADIO_RX_ON:
963 case STATE_RADIO_RX_ON_LINK:
964 rt2400pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
965 break;
963 case STATE_RADIO_RX_OFF: 966 case STATE_RADIO_RX_OFF:
964 rt2400pci_toggle_rx(rt2x00dev, state); 967 case STATE_RADIO_RX_OFF_LINK:
968 rt2400pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
965 break; 969 break;
966 case STATE_DEEP_SLEEP: 970 case STATE_DEEP_SLEEP:
967 case STATE_SLEEP: 971 case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index e874fdcae204..91e87b53374f 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1112,8 +1112,12 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev,
1112 rt2500pci_disable_radio(rt2x00dev); 1112 rt2500pci_disable_radio(rt2x00dev);
1113 break; 1113 break;
1114 case STATE_RADIO_RX_ON: 1114 case STATE_RADIO_RX_ON:
1115 case STATE_RADIO_RX_ON_LINK:
1116 rt2500pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
1117 break;
1115 case STATE_RADIO_RX_OFF: 1118 case STATE_RADIO_RX_OFF:
1116 rt2500pci_toggle_rx(rt2x00dev, state); 1119 case STATE_RADIO_RX_OFF_LINK:
1120 rt2500pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
1117 break; 1121 break;
1118 case STATE_DEEP_SLEEP: 1122 case STATE_DEEP_SLEEP:
1119 case STATE_SLEEP: 1123 case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 4ca9730e5e92..638c3d243108 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1001,8 +1001,12 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev,
1001 rt2500usb_disable_radio(rt2x00dev); 1001 rt2500usb_disable_radio(rt2x00dev);
1002 break; 1002 break;
1003 case STATE_RADIO_RX_ON: 1003 case STATE_RADIO_RX_ON:
1004 case STATE_RADIO_RX_ON_LINK:
1005 rt2500usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
1006 break;
1004 case STATE_RADIO_RX_OFF: 1007 case STATE_RADIO_RX_OFF:
1005 rt2500usb_toggle_rx(rt2x00dev, state); 1008 case STATE_RADIO_RX_OFF_LINK:
1009 rt2500usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
1006 break; 1010 break;
1007 case STATE_DEEP_SLEEP: 1011 case STATE_DEEP_SLEEP:
1008 case STATE_SLEEP: 1012 case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 72cfe00c1ed7..0d57d7f67837 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -102,7 +102,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
102 * else the changes will be ignored by the device. 102 * else the changes will be ignored by the device.
103 */ 103 */
104 if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags)) 104 if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
105 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF); 105 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF_LINK);
106 106
107 /* 107 /*
108 * Write new antenna setup to device and reset the link tuner. 108 * Write new antenna setup to device and reset the link tuner.
@@ -116,7 +116,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
116 rt2x00dev->link.ant.active.tx = libconf.ant.tx; 116 rt2x00dev->link.ant.active.tx = libconf.ant.tx;
117 117
118 if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags)) 118 if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
119 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON); 119 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK);
120} 120}
121 121
122void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, 122void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
diff --git a/drivers/net/wireless/rt2x00/rt2x00reg.h b/drivers/net/wireless/rt2x00/rt2x00reg.h
index 838421216da0..b1915dc7dda1 100644
--- a/drivers/net/wireless/rt2x00/rt2x00reg.h
+++ b/drivers/net/wireless/rt2x00/rt2x00reg.h
@@ -85,6 +85,8 @@ enum dev_state {
85 STATE_RADIO_OFF, 85 STATE_RADIO_OFF,
86 STATE_RADIO_RX_ON, 86 STATE_RADIO_RX_ON,
87 STATE_RADIO_RX_OFF, 87 STATE_RADIO_RX_OFF,
88 STATE_RADIO_RX_ON_LINK,
89 STATE_RADIO_RX_OFF_LINK,
88 STATE_RADIO_IRQ_ON, 90 STATE_RADIO_IRQ_ON,
89 STATE_RADIO_IRQ_OFF, 91 STATE_RADIO_IRQ_OFF,
90}; 92};
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index b31f0c26c32b..e808db98f2f5 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1482,8 +1482,12 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev,
1482 rt61pci_disable_radio(rt2x00dev); 1482 rt61pci_disable_radio(rt2x00dev);
1483 break; 1483 break;
1484 case STATE_RADIO_RX_ON: 1484 case STATE_RADIO_RX_ON:
1485 case STATE_RADIO_RX_ON_LINK:
1486 rt61pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
1487 break;
1485 case STATE_RADIO_RX_OFF: 1488 case STATE_RADIO_RX_OFF:
1486 rt61pci_toggle_rx(rt2x00dev, state); 1489 case STATE_RADIO_RX_OFF_LINK:
1490 rt61pci_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
1487 break; 1491 break;
1488 case STATE_DEEP_SLEEP: 1492 case STATE_DEEP_SLEEP:
1489 case STATE_SLEEP: 1493 case STATE_SLEEP:
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4d576ab3e7f9..4fac2d414d84 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1208,8 +1208,12 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev,
1208 rt73usb_disable_radio(rt2x00dev); 1208 rt73usb_disable_radio(rt2x00dev);
1209 break; 1209 break;
1210 case STATE_RADIO_RX_ON: 1210 case STATE_RADIO_RX_ON:
1211 case STATE_RADIO_RX_ON_LINK:
1212 rt73usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
1213 break;
1211 case STATE_RADIO_RX_OFF: 1214 case STATE_RADIO_RX_OFF:
1212 rt73usb_toggle_rx(rt2x00dev, state); 1215 case STATE_RADIO_RX_OFF_LINK:
1216 rt73usb_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
1213 break; 1217 break;
1214 case STATE_DEEP_SLEEP: 1218 case STATE_DEEP_SLEEP:
1215 case STATE_SLEEP: 1219 case STATE_SLEEP: