aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c74
1 files changed, 45 insertions, 29 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 2d47e9a8c329..da020c356898 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -5008,19 +5008,53 @@ static int iwl3945_init_drv(struct iwl_priv *priv)
5008 } 5008 }
5009 iwl3945_init_hw_rates(priv, priv->ieee_rates); 5009 iwl3945_init_hw_rates(priv, priv->ieee_rates);
5010 5010
5011 return 0;
5012
5013err_free_channel_map:
5014 iwl_free_channel_map(priv);
5015err:
5016 return ret;
5017}
5018
5019static int iwl3945_setup_mac(struct iwl_priv *priv)
5020{
5021 int ret;
5022 struct ieee80211_hw *hw = priv->hw;
5023
5024 hw->rate_control_algorithm = "iwl-3945-rs";
5025 hw->sta_data_size = sizeof(struct iwl3945_sta_priv);
5026
5027 /* Tell mac80211 our characteristics */
5028 hw->flags = IEEE80211_HW_SIGNAL_DBM |
5029 IEEE80211_HW_NOISE_DBM;
5030
5031 hw->wiphy->interface_modes =
5032 BIT(NL80211_IFTYPE_STATION) |
5033 BIT(NL80211_IFTYPE_ADHOC);
5034
5035 hw->wiphy->custom_regulatory = true;
5036
5037 /* Default value; 4 EDCA QOS priorities */
5038 hw->queues = 4;
5039
5040 hw->conf.beacon_int = 100;
5041
5011 if (priv->bands[IEEE80211_BAND_2GHZ].n_channels) 5042 if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
5012 priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = 5043 priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
5013 &priv->bands[IEEE80211_BAND_2GHZ]; 5044 &priv->bands[IEEE80211_BAND_2GHZ];
5045
5014 if (priv->bands[IEEE80211_BAND_5GHZ].n_channels) 5046 if (priv->bands[IEEE80211_BAND_5GHZ].n_channels)
5015 priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = 5047 priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
5016 &priv->bands[IEEE80211_BAND_5GHZ]; 5048 &priv->bands[IEEE80211_BAND_5GHZ];
5017 5049
5018 return 0; 5050 ret = ieee80211_register_hw(priv->hw);
5051 if (ret) {
5052 IWL_ERR(priv, "Failed to register hw (error %d)\n", ret);
5053 return ret;
5054 }
5055 priv->mac80211_registered = 1;
5019 5056
5020err_free_channel_map: 5057 return 0;
5021 iwl_free_channel_map(priv);
5022err:
5023 return ret;
5024} 5058}
5025 5059
5026static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 5060static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -5074,23 +5108,6 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5074 priv->debug_level = iwl3945_mod_params.debug; 5108 priv->debug_level = iwl3945_mod_params.debug;
5075 atomic_set(&priv->restrict_refcnt, 0); 5109 atomic_set(&priv->restrict_refcnt, 0);
5076#endif 5110#endif
5077 hw->rate_control_algorithm = "iwl-3945-rs";
5078 hw->sta_data_size = sizeof(struct iwl3945_sta_priv);
5079
5080 /* Tell mac80211 our characteristics */
5081 hw->flags = IEEE80211_HW_SIGNAL_DBM |
5082 IEEE80211_HW_NOISE_DBM;
5083
5084 hw->wiphy->interface_modes =
5085 BIT(NL80211_IFTYPE_STATION) |
5086 BIT(NL80211_IFTYPE_ADHOC);
5087
5088 hw->wiphy->custom_regulatory = true;
5089
5090 hw->wiphy->max_scan_ssids = 1;
5091
5092 /* 4 EDCA QOS priorities */
5093 hw->queues = 4;
5094 5111
5095 /*************************** 5112 /***************************
5096 * 2. Initializing PCI bus 5113 * 2. Initializing PCI bus
@@ -5221,19 +5238,18 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5221 * 9. Setup and Register mac80211 5238 * 9. Setup and Register mac80211
5222 * *******************************/ 5239 * *******************************/
5223 5240
5224 err = ieee80211_register_hw(priv->hw); 5241 iwl_enable_interrupts(priv);
5225 if (err) {
5226 IWL_ERR(priv, "Failed to register network device: %d\n", err);
5227 goto out_remove_sysfs;
5228 }
5229 5242
5230 priv->hw->conf.beacon_int = 100; 5243 err = iwl3945_setup_mac(priv);
5231 priv->mac80211_registered = 1; 5244 if (err)
5245 goto out_remove_sysfs;
5232 5246
5233 err = iwl_rfkill_init(priv); 5247 err = iwl_rfkill_init(priv);
5234 if (err) 5248 if (err)
5235 IWL_ERR(priv, "Unable to initialize RFKILL system. " 5249 IWL_ERR(priv, "Unable to initialize RFKILL system. "
5236 "Ignoring error: %d\n", err); 5250 "Ignoring error: %d\n", err);
5251 else
5252 iwl_rfkill_set_hw_state(priv);
5237 5253
5238 /* Start monitoring the killswitch */ 5254 /* Start monitoring the killswitch */
5239 queue_delayed_work(priv->workqueue, &priv->rfkill_poll, 5255 queue_delayed_work(priv->workqueue, &priv->rfkill_poll,