Commit 5331b96c authored by Jussi Kivilinna's avatar Jussi Kivilinna Committed by John W. Linville

rndis_wlan: update carrier flag when link state changes

Driver wasn't updating netif_carrier on link state changes but assumed
link layer was always up.
Signed-off-by: default avatarJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6010ce07
...@@ -2215,6 +2215,8 @@ static void rndis_wext_worker(struct work_struct *work) ...@@ -2215,6 +2215,8 @@ static void rndis_wext_worker(struct work_struct *work)
int ret, offset; int ret, offset;
if (test_and_clear_bit(WORK_LINK_UP, &priv->work_pending)) { if (test_and_clear_bit(WORK_LINK_UP, &priv->work_pending)) {
netif_carrier_on(usbdev->net);
info = kzalloc(assoc_size, GFP_KERNEL); info = kzalloc(assoc_size, GFP_KERNEL);
if (!info) if (!info)
goto get_bssid; goto get_bssid;
...@@ -2253,6 +2255,8 @@ static void rndis_wext_worker(struct work_struct *work) ...@@ -2253,6 +2255,8 @@ static void rndis_wext_worker(struct work_struct *work)
} }
if (test_and_clear_bit(WORK_LINK_DOWN, &priv->work_pending)) { if (test_and_clear_bit(WORK_LINK_DOWN, &priv->work_pending)) {
netif_carrier_off(usbdev->net);
evt.data.flags = 0; evt.data.flags = 0;
evt.data.length = 0; evt.data.length = 0;
memset(evt.ap_addr.sa_data, 0, ETH_ALEN); memset(evt.ap_addr.sa_data, 0, ETH_ALEN);
...@@ -2574,6 +2578,7 @@ static int rndis_wext_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -2574,6 +2578,7 @@ static int rndis_wext_bind(struct usbnet *dev, struct usb_interface *intf)
/* turn radio on */ /* turn radio on */
priv->radio_on = 1; priv->radio_on = 1;
disassociate(dev, 1); disassociate(dev, 1);
netif_carrier_off(dev->net);
/* because rndis_command() sleeps we need to use workqueue */ /* because rndis_command() sleeps we need to use workqueue */
priv->workqueue = create_singlethread_workqueue("rndis_wlan"); priv->workqueue = create_singlethread_workqueue("rndis_wlan");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment