Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81821
b: refs/heads/master
c: 849e0dc
h: refs/heads/master
i:
  81819: b9a34fe
v: v3
  • Loading branch information
Reinette Chatre authored and David S. Miller committed Feb 1, 2008
1 parent fb5f388 commit 3bf9dc5
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 75849d287ce5d75f3c79f153eaf74759ae95511f
refs/heads/master: 849e0dcea6b28a900e4743c1ada6db752fced5a9
54 changes: 40 additions & 14 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -5146,6 +5146,15 @@ static int iwl3945_init_channel_map(struct iwl3945_priv *priv)
return 0;
}

/*
* iwl3945_free_channel_map - undo allocations in iwl3945_init_channel_map
*/
static void iwl3945_free_channel_map(struct iwl3945_priv *priv)
{
kfree(priv->channel_info);
priv->channel_count = 0;
}

/* For active scan, listen ACTIVE_DWELL_TIME (msec) on each channel after
* sending probe req. This should be set long enough to hear probe responses
* from more than one AP. */
Expand Down Expand Up @@ -5471,6 +5480,17 @@ static int iwl3945_init_geos(struct iwl3945_priv *priv)
return 0;
}

/*
* iwl3945_free_geos - undo allocations in iwl3945_init_geos
*/
static void iwl3945_free_geos(struct iwl3945_priv *priv)
{
kfree(priv->modes);
kfree(priv->ieee_channels);
kfree(priv->ieee_rates);
clear_bit(STATUS_GEO_CONFIGURED, &priv->status);
}

/******************************************************************************
*
* uCode download functions
Expand Down Expand Up @@ -6130,15 +6150,6 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
/* Clear out the uCode error bit if it is set */
clear_bit(STATUS_FW_ERROR, &priv->status);

rc = iwl3945_init_channel_map(priv);
if (rc) {
IWL_ERROR("initializing regulatory failed: %d\n", rc);
return;
}

iwl3945_init_geos(priv);
iwl3945_reset_channel_flag(priv);

if (iwl3945_is_rfkill(priv))
return;

Expand Down Expand Up @@ -8614,11 +8625,24 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
IWL_DEBUG_INFO("MAC address: %s\n", print_mac(mac, priv->mac_addr));
SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);

err = iwl3945_init_channel_map(priv);
if (err) {
IWL_ERROR("initializing regulatory failed: %d\n", err);
goto out_remove_sysfs;
}

err = iwl3945_init_geos(priv);
if (err) {
IWL_ERROR("initializing geos failed: %d\n", err);
goto out_free_channel_map;
}
iwl3945_reset_channel_flag(priv);

iwl3945_rate_control_register(priv->hw);
err = ieee80211_register_hw(priv->hw);
if (err) {
IWL_ERROR("Failed to register network device (error %d)\n", err);
goto out_remove_sysfs;
goto out_free_geos;
}

priv->hw->conf.beacon_int = 100;
Expand All @@ -8628,6 +8652,10 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e

return 0;

out_free_geos:
iwl3945_free_geos(priv);
out_free_channel_map:
iwl3945_free_channel_map(priv);
out_remove_sysfs:
sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group);

Expand Down Expand Up @@ -8702,10 +8730,8 @@ static void iwl3945_pci_remove(struct pci_dev *pdev)
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);

kfree(priv->channel_info);

kfree(priv->ieee_channels);
kfree(priv->ieee_rates);
iwl3945_free_channel_map(priv);
iwl3945_free_geos(priv);

if (priv->ibss_beacon)
dev_kfree_skb(priv->ibss_beacon);
Expand Down
54 changes: 40 additions & 14 deletions trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -5576,6 +5576,15 @@ static int iwl4965_init_channel_map(struct iwl4965_priv *priv)
return 0;
}

/*
* iwl4965_free_channel_map - undo allocations in iwl4965_init_channel_map
*/
static void iwl4965_free_channel_map(struct iwl4965_priv *priv)
{
kfree(priv->channel_info);
priv->channel_count = 0;
}

/* For active scan, listen ACTIVE_DWELL_TIME (msec) on each channel after
* sending probe req. This should be set long enough to hear probe responses
* from more than one AP. */
Expand Down Expand Up @@ -5909,6 +5918,17 @@ static int iwl4965_init_geos(struct iwl4965_priv *priv)
return 0;
}

/*
* iwl4965_free_geos - undo allocations in iwl4965_init_geos
*/
static void iwl4965_free_geos(struct iwl4965_priv *priv)
{
kfree(priv->modes);
kfree(priv->ieee_channels);
kfree(priv->ieee_rates);
clear_bit(STATUS_GEO_CONFIGURED, &priv->status);
}

/******************************************************************************
*
* uCode download functions
Expand Down Expand Up @@ -6560,15 +6580,6 @@ static void iwl4965_alive_start(struct iwl4965_priv *priv)
/* Clear out the uCode error bit if it is set */
clear_bit(STATUS_FW_ERROR, &priv->status);

rc = iwl4965_init_channel_map(priv);
if (rc) {
IWL_ERROR("initializing regulatory failed: %d\n", rc);
return;
}

iwl4965_init_geos(priv);
iwl4965_reset_channel_flag(priv);

if (iwl4965_is_rfkill(priv))
return;

Expand Down Expand Up @@ -9198,11 +9209,24 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
IWL_DEBUG_INFO("MAC address: %s\n", print_mac(mac, priv->mac_addr));
SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);

err = iwl4965_init_channel_map(priv);
if (err) {
IWL_ERROR("initializing regulatory failed: %d\n", err);
goto out_remove_sysfs;
}

err = iwl4965_init_geos(priv);
if (err) {
IWL_ERROR("initializing geos failed: %d\n", err);
goto out_free_channel_map;
}
iwl4965_reset_channel_flag(priv);

iwl4965_rate_control_register(priv->hw);
err = ieee80211_register_hw(priv->hw);
if (err) {
IWL_ERROR("Failed to register network device (error %d)\n", err);
goto out_remove_sysfs;
goto out_free_geos;
}

priv->hw->conf.beacon_int = 100;
Expand All @@ -9212,6 +9236,10 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e

return 0;

out_free_geos:
iwl4965_free_geos(priv);
out_free_channel_map:
iwl4965_free_channel_map(priv);
out_remove_sysfs:
sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group);

Expand Down Expand Up @@ -9286,10 +9314,8 @@ static void iwl4965_pci_remove(struct pci_dev *pdev)
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);

kfree(priv->channel_info);

kfree(priv->ieee_channels);
kfree(priv->ieee_rates);
iwl4965_free_channel_map(priv);
iwl4965_free_geos(priv);

if (priv->ibss_beacon)
dev_kfree_skb(priv->ibss_beacon);
Expand Down

0 comments on commit 3bf9dc5

Please sign in to comment.