aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/rndis_wlan.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 3954897d0678..aaeeec803974 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -310,8 +310,9 @@ enum wpa_key_mgmt { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE,
310#define CAP_MODE_MASK 7 310#define CAP_MODE_MASK 7
311#define CAP_SUPPORT_TXPOWER 8 311#define CAP_SUPPORT_TXPOWER 8
312 312
313#define WORK_CONNECTION_EVENT (1<<0) 313#define WORK_LINK_UP (1<<0)
314#define WORK_SET_MULTICAST_LIST (1<<1) 314#define WORK_LINK_DOWN (1<<1)
315#define WORK_SET_MULTICAST_LIST (1<<2)
315 316
316/* RNDIS device private data */ 317/* RNDIS device private data */
317struct rndis_wext_private { 318struct rndis_wext_private {
@@ -2213,7 +2214,7 @@ static void rndis_wext_worker(struct work_struct *work)
2213 int assoc_size = sizeof(*info) + IW_CUSTOM_MAX + 32; 2214 int assoc_size = sizeof(*info) + IW_CUSTOM_MAX + 32;
2214 int ret, offset; 2215 int ret, offset;
2215 2216
2216 if (test_and_clear_bit(WORK_CONNECTION_EVENT, &priv->work_pending)) { 2217 if (test_and_clear_bit(WORK_LINK_UP, &priv->work_pending)) {
2217 info = kzalloc(assoc_size, GFP_KERNEL); 2218 info = kzalloc(assoc_size, GFP_KERNEL);
2218 if (!info) 2219 if (!info)
2219 goto get_bssid; 2220 goto get_bssid;
@@ -2251,6 +2252,13 @@ get_bssid:
2251 } 2252 }
2252 } 2253 }
2253 2254
2255 if (test_and_clear_bit(WORK_LINK_DOWN, &priv->work_pending)) {
2256 evt.data.flags = 0;
2257 evt.data.length = 0;
2258 memset(evt.ap_addr.sa_data, 0, ETH_ALEN);
2259 wireless_send_event(usbdev->net, SIOCGIWAP, &evt, NULL);
2260 }
2261
2254 if (test_and_clear_bit(WORK_SET_MULTICAST_LIST, &priv->work_pending)) 2262 if (test_and_clear_bit(WORK_SET_MULTICAST_LIST, &priv->work_pending))
2255 set_multicast_list(usbdev); 2263 set_multicast_list(usbdev);
2256} 2264}
@@ -2267,18 +2275,10 @@ static void rndis_wext_set_multicast_list(struct net_device *dev)
2267static void rndis_wext_link_change(struct usbnet *dev, int state) 2275static void rndis_wext_link_change(struct usbnet *dev, int state)
2268{ 2276{
2269 struct rndis_wext_private *priv = get_rndis_wext_priv(dev); 2277 struct rndis_wext_private *priv = get_rndis_wext_priv(dev);
2270 union iwreq_data evt;
2271 2278
2272 if (state) { 2279 /* queue work to avoid recursive calls into rndis_command */
2273 /* queue work to avoid recursive calls into rndis_command */ 2280 set_bit(state ? WORK_LINK_UP : WORK_LINK_DOWN, &priv->work_pending);
2274 set_bit(WORK_CONNECTION_EVENT, &priv->work_pending); 2281 queue_work(priv->workqueue, &priv->work);
2275 queue_work(priv->workqueue, &priv->work);
2276 } else {
2277 evt.data.flags = 0;
2278 evt.data.length = 0;
2279 memset(evt.ap_addr.sa_data, 0, ETH_ALEN);
2280 wireless_send_event(dev->net, SIOCGIWAP, &evt, NULL);
2281 }
2282} 2282}
2283 2283
2284 2284