aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2009-10-30 17:36:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-11-02 15:39:46 -0500
commit89f186a8b64a4c90a219cfd94c26de5cfea54b84 (patch)
tree9b049ec3d8fa8226d4a9ef779d0e7c5ce2fcbd7a /drivers/net/wireless/iwlwifi/iwl-agn.c
parentc33de6256a07869b48830e3a26fb6942ea8c4f79 (diff)
iwlwifi: move iwl_[un]init_drv to iwlagn
Since iwlagn is the only user of these functions, move it to this module. This results in a bit more code moving than just these functions since the functions only used by them are also moved and we need to export the symbols previously available to them directly. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 0cb95bfd15a5..2814565fa3b4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2972,6 +2972,96 @@ static void iwl_cancel_deferred_work(struct iwl_priv *priv)
2972 del_timer_sync(&priv->statistics_periodic); 2972 del_timer_sync(&priv->statistics_periodic);
2973} 2973}
2974 2974
2975static void iwl_init_hw_rates(struct iwl_priv *priv,
2976 struct ieee80211_rate *rates)
2977{
2978 int i;
2979
2980 for (i = 0; i < IWL_RATE_COUNT_LEGACY; i++) {
2981 rates[i].bitrate = iwl_rates[i].ieee * 5;
2982 rates[i].hw_value = i; /* Rate scaling will work on indexes */
2983 rates[i].hw_value_short = i;
2984 rates[i].flags = 0;
2985 if ((i >= IWL_FIRST_CCK_RATE) && (i <= IWL_LAST_CCK_RATE)) {
2986 /*
2987 * If CCK != 1M then set short preamble rate flag.
2988 */
2989 rates[i].flags |=
2990 (iwl_rates[i].plcp == IWL_RATE_1M_PLCP) ?
2991 0 : IEEE80211_RATE_SHORT_PREAMBLE;
2992 }
2993 }
2994}
2995
2996static int iwl_init_drv(struct iwl_priv *priv)
2997{
2998 int ret;
2999
3000 priv->ibss_beacon = NULL;
3001
3002 spin_lock_init(&priv->lock);
3003 spin_lock_init(&priv->sta_lock);
3004 spin_lock_init(&priv->hcmd_lock);
3005
3006 INIT_LIST_HEAD(&priv->free_frames);
3007
3008 mutex_init(&priv->mutex);
3009
3010 /* Clear the driver's (not device's) station table */
3011 iwl_clear_stations_table(priv);
3012
3013 priv->ieee_channels = NULL;
3014 priv->ieee_rates = NULL;
3015 priv->band = IEEE80211_BAND_2GHZ;
3016
3017 priv->iw_mode = NL80211_IFTYPE_STATION;
3018
3019 /* Choose which receivers/antennas to use */
3020 if (priv->cfg->ops->hcmd->set_rxon_chain)
3021 priv->cfg->ops->hcmd->set_rxon_chain(priv);
3022
3023 iwl_init_scan_params(priv);
3024
3025 iwl_reset_qos(priv);
3026
3027 priv->qos_data.qos_active = 0;
3028 priv->qos_data.qos_cap.val = 0;
3029
3030 priv->rates_mask = IWL_RATES_MASK;
3031 /* Set the tx_power_user_lmt to the lowest power level
3032 * this value will get overwritten by channel max power avg
3033 * from eeprom */
3034 priv->tx_power_user_lmt = IWL_TX_POWER_TARGET_POWER_MIN;
3035
3036 ret = iwl_init_channel_map(priv);
3037 if (ret) {
3038 IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);
3039 goto err;
3040 }
3041
3042 ret = iwlcore_init_geos(priv);
3043 if (ret) {
3044 IWL_ERR(priv, "initializing geos failed: %d\n", ret);
3045 goto err_free_channel_map;
3046 }
3047 iwl_init_hw_rates(priv, priv->ieee_rates);
3048
3049 return 0;
3050
3051err_free_channel_map:
3052 iwl_free_channel_map(priv);
3053err:
3054 return ret;
3055}
3056
3057static void iwl_uninit_drv(struct iwl_priv *priv)
3058{
3059 iwl_calib_free_results(priv);
3060 iwlcore_free_geos(priv);
3061 iwl_free_channel_map(priv);
3062 kfree(priv->scan);
3063}
3064
2975static struct attribute *iwl_sysfs_entries[] = { 3065static struct attribute *iwl_sysfs_entries[] = {
2976 &dev_attr_flags.attr, 3066 &dev_attr_flags.attr,
2977 &dev_attr_filter_flags.attr, 3067 &dev_attr_filter_flags.attr,