Commit bb7b2284 authored by David S. Miller's avatar David S. Miller
parents 539054a8 66f84d65
...@@ -6325,10 +6325,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, ...@@ -6325,10 +6325,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
fail: fail:
if (dev) { if (dev) {
if (registered) { if (registered)
unregister_ieee80211(priv->ieee);
unregister_netdev(dev); unregister_netdev(dev);
}
ipw2100_hw_stop_adapter(priv); ipw2100_hw_stop_adapter(priv);
...@@ -6385,7 +6383,6 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev) ...@@ -6385,7 +6383,6 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
/* Unregister the device first - this results in close() /* Unregister the device first - this results in close()
* being called if the device is open. If we free storage * being called if the device is open. If we free storage
* first, then close() will crash. */ * first, then close() will crash. */
unregister_ieee80211(priv->ieee);
unregister_netdev(dev); unregister_netdev(dev);
/* ipw2100_down will ensure that there is no more pending work /* ipw2100_down will ensure that there is no more pending work
......
...@@ -11821,7 +11821,6 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, ...@@ -11821,7 +11821,6 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
if (err) { if (err) {
IPW_ERROR("Failed to register promiscuous network " IPW_ERROR("Failed to register promiscuous network "
"device (error %d).\n", err); "device (error %d).\n", err);
unregister_ieee80211(priv->ieee);
unregister_netdev(priv->net_dev); unregister_netdev(priv->net_dev);
goto out_remove_sysfs; goto out_remove_sysfs;
} }
...@@ -11872,7 +11871,6 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev) ...@@ -11872,7 +11871,6 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev)
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
unregister_ieee80211(priv->ieee);
unregister_netdev(priv->net_dev); unregister_netdev(priv->net_dev);
if (priv->rxq) { if (priv->rxq) {
......
...@@ -1020,7 +1020,6 @@ static inline int libipw_is_cck_rate(u8 rate) ...@@ -1020,7 +1020,6 @@ static inline int libipw_is_cck_rate(u8 rate)
/* ieee80211.c */ /* ieee80211.c */
extern void free_ieee80211(struct net_device *dev, int monitor); extern void free_ieee80211(struct net_device *dev, int monitor);
extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor); extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor);
extern void unregister_ieee80211(struct libipw_device *ieee);
extern int libipw_change_mtu(struct net_device *dev, int new_mtu); extern int libipw_change_mtu(struct net_device *dev, int new_mtu);
extern void libipw_networks_age(struct libipw_device *ieee, extern void libipw_networks_age(struct libipw_device *ieee,
......
...@@ -235,17 +235,14 @@ void free_ieee80211(struct net_device *dev, int monitor) ...@@ -235,17 +235,14 @@ void free_ieee80211(struct net_device *dev, int monitor)
libipw_networks_free(ieee); libipw_networks_free(ieee);
/* free cfg80211 resources */ /* free cfg80211 resources */
if (!monitor) if (!monitor) {
wiphy_free(ieee->wdev.wiphy);
free_netdev(dev);
}
void unregister_ieee80211(struct libipw_device *ieee)
{
wiphy_unregister(ieee->wdev.wiphy); wiphy_unregister(ieee->wdev.wiphy);
kfree(ieee->a_band.channels); kfree(ieee->a_band.channels);
kfree(ieee->bg_band.channels); kfree(ieee->bg_band.channels);
wiphy_free(ieee->wdev.wiphy);
}
free_netdev(dev);
} }
#ifdef CONFIG_LIBIPW_DEBUG #ifdef CONFIG_LIBIPW_DEBUG
...@@ -333,4 +330,3 @@ module_init(libipw_init); ...@@ -333,4 +330,3 @@ module_init(libipw_init);
EXPORT_SYMBOL(alloc_ieee80211); EXPORT_SYMBOL(alloc_ieee80211);
EXPORT_SYMBOL(free_ieee80211); EXPORT_SYMBOL(free_ieee80211);
EXPORT_SYMBOL(unregister_ieee80211);
...@@ -815,6 +815,8 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) ...@@ -815,6 +815,8 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
mutex_init(&rt2x00dev->csr_mutex); mutex_init(&rt2x00dev->csr_mutex);
set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
/* /*
* Make room for rt2x00_intf inside the per-interface * Make room for rt2x00_intf inside the per-interface
* structure ieee80211_vif. * structure ieee80211_vif.
...@@ -871,8 +873,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) ...@@ -871,8 +873,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
rt2x00leds_register(rt2x00dev); rt2x00leds_register(rt2x00dev);
rt2x00debug_register(rt2x00dev); rt2x00debug_register(rt2x00dev);
set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
return 0; return 0;
exit: exit:
......
...@@ -362,6 +362,7 @@ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev) ...@@ -362,6 +362,7 @@ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev)
rt2x00link_reset_tuner(rt2x00dev, false); rt2x00link_reset_tuner(rt2x00dev, false);
if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
ieee80211_queue_delayed_work(rt2x00dev->hw, ieee80211_queue_delayed_work(rt2x00dev->hw,
&link->work, LINK_TUNE_INTERVAL); &link->work, LINK_TUNE_INTERVAL);
} }
...@@ -469,6 +470,8 @@ static void rt2x00link_tuner(struct work_struct *work) ...@@ -469,6 +470,8 @@ static void rt2x00link_tuner(struct work_struct *work)
* Increase tuner counter, and reschedule the next link tuner run. * Increase tuner counter, and reschedule the next link tuner run.
*/ */
link->count++; link->count++;
if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
ieee80211_queue_delayed_work(rt2x00dev->hw, ieee80211_queue_delayed_work(rt2x00dev->hw,
&link->work, LINK_TUNE_INTERVAL); &link->work, LINK_TUNE_INTERVAL);
} }
......
...@@ -47,6 +47,8 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev, ...@@ -47,6 +47,8 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev,
(requesttype == USB_VENDOR_REQUEST_IN) ? (requesttype == USB_VENDOR_REQUEST_IN) ?
usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0); usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0);
if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
return -ENODEV;
for (i = 0; i < REGISTER_BUSY_COUNT; i++) { for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
status = usb_control_msg(usb_dev, pipe, request, requesttype, status = usb_control_msg(usb_dev, pipe, request, requesttype,
...@@ -60,9 +62,11 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev, ...@@ -60,9 +62,11 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev,
* -ENODEV: Device has disappeared, no point continuing. * -ENODEV: Device has disappeared, no point continuing.
* All other errors: Try again. * All other errors: Try again.
*/ */
else if (status == -ENODEV) else if (status == -ENODEV) {
clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
break; break;
} }
}
ERROR(rt2x00dev, ERROR(rt2x00dev,
"Vendor Request 0x%02x failed for offset 0x%04x with error %d.\n", "Vendor Request 0x%02x failed for offset 0x%04x with error %d.\n",
...@@ -161,6 +165,9 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, ...@@ -161,6 +165,9 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev,
{ {
unsigned int i; unsigned int i;
if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
return -ENODEV;
for (i = 0; i < REGISTER_BUSY_COUNT; i++) { for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
rt2x00usb_register_read_lock(rt2x00dev, offset, reg); rt2x00usb_register_read_lock(rt2x00dev, offset, reg);
if (!rt2x00_get_field32(*reg, field)) if (!rt2x00_get_field32(*reg, field))
......
...@@ -210,10 +210,10 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev) ...@@ -210,10 +210,10 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev)
/* turn the LED off before exiting */ /* turn the LED off before exiting */
ieee80211_queue_delayed_work(dev, &priv->led_off, 0); ieee80211_queue_delayed_work(dev, &priv->led_off, 0);
cancel_delayed_work_sync(&priv->led_off);
cancel_delayed_work_sync(&priv->led_on);
rtl8187_unregister_led(&priv->led_rx); rtl8187_unregister_led(&priv->led_rx);
rtl8187_unregister_led(&priv->led_tx); rtl8187_unregister_led(&priv->led_tx);
cancel_delayed_work_sync(&priv->led_off);
cancel_delayed_work_sync(&priv->led_on);
} }
#endif /* def CONFIG_RTL8187_LED */ #endif /* def CONFIG_RTL8187_LED */
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