diff options
author | David S. Miller <davem@davemloft.net> | 2012-05-14 18:00:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-14 18:00:48 -0400 |
commit | c597f6653d5734c11b1e3217c7619a37e96e5a1f (patch) | |
tree | 2c24b46bbe265f3284dcec0a001f7af498794964 /drivers/net/wireless/ipw2x00 | |
parent | 669d67bf777def468970f2dcba1537edf3b2d329 (diff) | |
parent | 341352d13dae752610342923c53ebe461624ee2c (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
Diffstat (limited to 'drivers/net/wireless/ipw2x00')
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2100.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 44 |
2 files changed, 31 insertions, 37 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index c72136c0777..9cfae0c0870 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -1963,10 +1963,8 @@ static int ipw2100_wdev_init(struct net_device *dev) | |||
1963 | wdev->wiphy->n_cipher_suites = ARRAY_SIZE(ipw_cipher_suites); | 1963 | wdev->wiphy->n_cipher_suites = ARRAY_SIZE(ipw_cipher_suites); |
1964 | 1964 | ||
1965 | set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev); | 1965 | set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev); |
1966 | if (wiphy_register(wdev->wiphy)) { | 1966 | if (wiphy_register(wdev->wiphy)) |
1967 | ipw2100_down(priv); | ||
1968 | return -EIO; | 1967 | return -EIO; |
1969 | } | ||
1970 | return 0; | 1968 | return 0; |
1971 | } | 1969 | } |
1972 | 1970 | ||
@@ -6331,6 +6329,11 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
6331 | printk(KERN_INFO DRV_NAME | 6329 | printk(KERN_INFO DRV_NAME |
6332 | ": Detected Intel PRO/Wireless 2100 Network Connection\n"); | 6330 | ": Detected Intel PRO/Wireless 2100 Network Connection\n"); |
6333 | 6331 | ||
6332 | err = ipw2100_wdev_init(dev); | ||
6333 | if (err) | ||
6334 | goto fail; | ||
6335 | registered = 1; | ||
6336 | |||
6334 | /* Bring up the interface. Pre 0.46, after we registered the | 6337 | /* Bring up the interface. Pre 0.46, after we registered the |
6335 | * network device we would call ipw2100_up. This introduced a race | 6338 | * network device we would call ipw2100_up. This introduced a race |
6336 | * condition with newer hotplug configurations (network was coming | 6339 | * condition with newer hotplug configurations (network was coming |
@@ -6347,11 +6350,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
6347 | "Error calling register_netdev.\n"); | 6350 | "Error calling register_netdev.\n"); |
6348 | goto fail; | 6351 | goto fail; |
6349 | } | 6352 | } |
6350 | registered = 1; | 6353 | registered = 2; |
6351 | |||
6352 | err = ipw2100_wdev_init(dev); | ||
6353 | if (err) | ||
6354 | goto fail; | ||
6355 | 6354 | ||
6356 | mutex_lock(&priv->action_mutex); | 6355 | mutex_lock(&priv->action_mutex); |
6357 | 6356 | ||
@@ -6390,13 +6389,16 @@ out: | |||
6390 | 6389 | ||
6391 | fail_unlock: | 6390 | fail_unlock: |
6392 | mutex_unlock(&priv->action_mutex); | 6391 | mutex_unlock(&priv->action_mutex); |
6393 | wiphy_unregister(priv->ieee->wdev.wiphy); | ||
6394 | kfree(priv->ieee->bg_band.channels); | ||
6395 | fail: | 6392 | fail: |
6396 | if (dev) { | 6393 | if (dev) { |
6397 | if (registered) | 6394 | if (registered >= 2) |
6398 | unregister_netdev(dev); | 6395 | unregister_netdev(dev); |
6399 | 6396 | ||
6397 | if (registered) { | ||
6398 | wiphy_unregister(priv->ieee->wdev.wiphy); | ||
6399 | kfree(priv->ieee->bg_band.channels); | ||
6400 | } | ||
6401 | |||
6400 | ipw2100_hw_stop_adapter(priv); | 6402 | ipw2100_hw_stop_adapter(priv); |
6401 | 6403 | ||
6402 | ipw2100_disable_interrupts(priv); | 6404 | ipw2100_disable_interrupts(priv); |
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index b3707dadad1..0036737fe8e 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -11443,20 +11443,6 @@ static void ipw_bg_down(struct work_struct *work) | |||
11443 | mutex_unlock(&priv->mutex); | 11443 | mutex_unlock(&priv->mutex); |
11444 | } | 11444 | } |
11445 | 11445 | ||
11446 | /* Called by register_netdev() */ | ||
11447 | static int ipw_net_init(struct net_device *dev) | ||
11448 | { | ||
11449 | int rc = 0; | ||
11450 | struct ipw_priv *priv = libipw_priv(dev); | ||
11451 | |||
11452 | mutex_lock(&priv->mutex); | ||
11453 | if (ipw_up(priv)) | ||
11454 | rc = -EIO; | ||
11455 | mutex_unlock(&priv->mutex); | ||
11456 | |||
11457 | return rc; | ||
11458 | } | ||
11459 | |||
11460 | static int ipw_wdev_init(struct net_device *dev) | 11446 | static int ipw_wdev_init(struct net_device *dev) |
11461 | { | 11447 | { |
11462 | int i, rc = 0; | 11448 | int i, rc = 0; |
@@ -11725,7 +11711,6 @@ static void ipw_prom_free(struct ipw_priv *priv) | |||
11725 | #endif | 11711 | #endif |
11726 | 11712 | ||
11727 | static const struct net_device_ops ipw_netdev_ops = { | 11713 | static const struct net_device_ops ipw_netdev_ops = { |
11728 | .ndo_init = ipw_net_init, | ||
11729 | .ndo_open = ipw_net_open, | 11714 | .ndo_open = ipw_net_open, |
11730 | .ndo_stop = ipw_net_stop, | 11715 | .ndo_stop = ipw_net_stop, |
11731 | .ndo_set_rx_mode = ipw_net_set_multicast_list, | 11716 | .ndo_set_rx_mode = ipw_net_set_multicast_list, |
@@ -11848,17 +11833,24 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11848 | goto out_release_irq; | 11833 | goto out_release_irq; |
11849 | } | 11834 | } |
11850 | 11835 | ||
11851 | mutex_unlock(&priv->mutex); | 11836 | if (ipw_up(priv)) { |
11852 | err = register_netdev(net_dev); | 11837 | mutex_unlock(&priv->mutex); |
11853 | if (err) { | 11838 | err = -EIO; |
11854 | IPW_ERROR("failed to register network device\n"); | ||
11855 | goto out_remove_sysfs; | 11839 | goto out_remove_sysfs; |
11856 | } | 11840 | } |
11857 | 11841 | ||
11842 | mutex_unlock(&priv->mutex); | ||
11843 | |||
11858 | err = ipw_wdev_init(net_dev); | 11844 | err = ipw_wdev_init(net_dev); |
11859 | if (err) { | 11845 | if (err) { |
11860 | IPW_ERROR("failed to register wireless device\n"); | 11846 | IPW_ERROR("failed to register wireless device\n"); |
11861 | goto out_unregister_netdev; | 11847 | goto out_remove_sysfs; |
11848 | } | ||
11849 | |||
11850 | err = register_netdev(net_dev); | ||
11851 | if (err) { | ||
11852 | IPW_ERROR("failed to register network device\n"); | ||
11853 | goto out_unregister_wiphy; | ||
11862 | } | 11854 | } |
11863 | 11855 | ||
11864 | #ifdef CONFIG_IPW2200_PROMISCUOUS | 11856 | #ifdef CONFIG_IPW2200_PROMISCUOUS |
@@ -11867,10 +11859,8 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11867 | if (err) { | 11859 | if (err) { |
11868 | IPW_ERROR("Failed to register promiscuous network " | 11860 | IPW_ERROR("Failed to register promiscuous network " |
11869 | "device (error %d).\n", err); | 11861 | "device (error %d).\n", err); |
11870 | wiphy_unregister(priv->ieee->wdev.wiphy); | 11862 | unregister_netdev(priv->net_dev); |
11871 | kfree(priv->ieee->a_band.channels); | 11863 | goto out_unregister_wiphy; |
11872 | kfree(priv->ieee->bg_band.channels); | ||
11873 | goto out_unregister_netdev; | ||
11874 | } | 11864 | } |
11875 | } | 11865 | } |
11876 | #endif | 11866 | #endif |
@@ -11882,8 +11872,10 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11882 | 11872 | ||
11883 | return 0; | 11873 | return 0; |
11884 | 11874 | ||
11885 | out_unregister_netdev: | 11875 | out_unregister_wiphy: |
11886 | unregister_netdev(priv->net_dev); | 11876 | wiphy_unregister(priv->ieee->wdev.wiphy); |
11877 | kfree(priv->ieee->a_band.channels); | ||
11878 | kfree(priv->ieee->bg_band.channels); | ||
11887 | out_remove_sysfs: | 11879 | out_remove_sysfs: |
11888 | sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); | 11880 | sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); |
11889 | out_release_irq: | 11881 | out_release_irq: |