aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2x00
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ipw2x00')
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c21
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c39
2 files changed, 40 insertions, 20 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 3774dd034746..ef9ad79d1bfd 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1903,15 +1903,17 @@ static void ipw2100_down(struct ipw2100_priv *priv)
1903static int ipw2100_net_init(struct net_device *dev) 1903static int ipw2100_net_init(struct net_device *dev)
1904{ 1904{
1905 struct ipw2100_priv *priv = libipw_priv(dev); 1905 struct ipw2100_priv *priv = libipw_priv(dev);
1906
1907 return ipw2100_up(priv, 1);
1908}
1909
1910static int ipw2100_wdev_init(struct net_device *dev)
1911{
1912 struct ipw2100_priv *priv = libipw_priv(dev);
1906 const struct libipw_geo *geo = libipw_get_geo(priv->ieee); 1913 const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
1907 struct wireless_dev *wdev = &priv->ieee->wdev; 1914 struct wireless_dev *wdev = &priv->ieee->wdev;
1908 int ret;
1909 int i; 1915 int i;
1910 1916
1911 ret = ipw2100_up(priv, 1);
1912 if (ret)
1913 return ret;
1914
1915 memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN); 1917 memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN);
1916 1918
1917 /* fill-out priv->ieee->bg_band */ 1919 /* fill-out priv->ieee->bg_band */
@@ -6350,9 +6352,13 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6350 "Error calling register_netdev.\n"); 6352 "Error calling register_netdev.\n");
6351 goto fail; 6353 goto fail;
6352 } 6354 }
6355 registered = 1;
6356
6357 err = ipw2100_wdev_init(dev);
6358 if (err)
6359 goto fail;
6353 6360
6354 mutex_lock(&priv->action_mutex); 6361 mutex_lock(&priv->action_mutex);
6355 registered = 1;
6356 6362
6357 IPW_DEBUG_INFO("%s: Bound to %s\n", dev->name, pci_name(pci_dev)); 6363 IPW_DEBUG_INFO("%s: Bound to %s\n", dev->name, pci_name(pci_dev));
6358 6364
@@ -6389,7 +6395,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6389 6395
6390 fail_unlock: 6396 fail_unlock:
6391 mutex_unlock(&priv->action_mutex); 6397 mutex_unlock(&priv->action_mutex);
6392 6398 wiphy_unregister(priv->ieee->wdev.wiphy);
6399 kfree(priv->ieee->bg_band.channels);
6393 fail: 6400 fail:
6394 if (dev) { 6401 if (dev) {
6395 if (registered) 6402 if (registered)
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index f303df43ed3f..99a710dfe771 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -11426,16 +11426,23 @@ static void ipw_bg_down(struct work_struct *work)
11426/* Called by register_netdev() */ 11426/* Called by register_netdev() */
11427static int ipw_net_init(struct net_device *dev) 11427static int ipw_net_init(struct net_device *dev)
11428{ 11428{
11429 int rc = 0;
11430 struct ipw_priv *priv = libipw_priv(dev);
11431
11432 mutex_lock(&priv->mutex);
11433 if (ipw_up(priv))
11434 rc = -EIO;
11435 mutex_unlock(&priv->mutex);
11436
11437 return rc;
11438}
11439
11440static int ipw_wdev_init(struct net_device *dev)
11441{
11429 int i, rc = 0; 11442 int i, rc = 0;
11430 struct ipw_priv *priv = libipw_priv(dev); 11443 struct ipw_priv *priv = libipw_priv(dev);
11431 const struct libipw_geo *geo = libipw_get_geo(priv->ieee); 11444 const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
11432 struct wireless_dev *wdev = &priv->ieee->wdev; 11445 struct wireless_dev *wdev = &priv->ieee->wdev;
11433 mutex_lock(&priv->mutex);
11434
11435 if (ipw_up(priv)) {
11436 rc = -EIO;
11437 goto out;
11438 }
11439 11446
11440 memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN); 11447 memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN);
11441 11448
@@ -11520,13 +11527,9 @@ static int ipw_net_init(struct net_device *dev)
11520 set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev); 11527 set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
11521 11528
11522 /* With that information in place, we can now register the wiphy... */ 11529 /* With that information in place, we can now register the wiphy... */
11523 if (wiphy_register(wdev->wiphy)) { 11530 if (wiphy_register(wdev->wiphy))
11524 rc = -EIO; 11531 rc = -EIO;
11525 goto out;
11526 }
11527
11528out: 11532out:
11529 mutex_unlock(&priv->mutex);
11530 return rc; 11533 return rc;
11531} 11534}
11532 11535
@@ -11833,14 +11836,22 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
11833 goto out_remove_sysfs; 11836 goto out_remove_sysfs;
11834 } 11837 }
11835 11838
11839 err = ipw_wdev_init(net_dev);
11840 if (err) {
11841 IPW_ERROR("failed to register wireless device\n");
11842 goto out_unregister_netdev;
11843 }
11844
11836#ifdef CONFIG_IPW2200_PROMISCUOUS 11845#ifdef CONFIG_IPW2200_PROMISCUOUS
11837 if (rtap_iface) { 11846 if (rtap_iface) {
11838 err = ipw_prom_alloc(priv); 11847 err = ipw_prom_alloc(priv);
11839 if (err) { 11848 if (err) {
11840 IPW_ERROR("Failed to register promiscuous network " 11849 IPW_ERROR("Failed to register promiscuous network "
11841 "device (error %d).\n", err); 11850 "device (error %d).\n", err);
11842 unregister_netdev(priv->net_dev); 11851 wiphy_unregister(priv->ieee->wdev.wiphy);
11843 goto out_remove_sysfs; 11852 kfree(priv->ieee->a_band.channels);
11853 kfree(priv->ieee->bg_band.channels);
11854 goto out_unregister_netdev;
11844 } 11855 }
11845 } 11856 }
11846#endif 11857#endif
@@ -11852,6 +11863,8 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
11852 11863
11853 return 0; 11864 return 0;
11854 11865
11866 out_unregister_netdev:
11867 unregister_netdev(priv->net_dev);
11855 out_remove_sysfs: 11868 out_remove_sysfs:
11856 sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); 11869 sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group);
11857 out_release_irq: 11870 out_release_irq: