aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-04-08 14:26:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:43 -0400
commit4808368dad3263ac46e71f037c0dcd2dcf082525 (patch)
tree23ade76011df676aca0925fd025c313bfa5c4055 /drivers/net/wireless/iwlwifi/iwl3945-base.c
parentd8052319f2a7d1ee86248df00193110ad1946a33 (diff)
iwl3945: use iwl_mac_config from iwlwifi
3945 can now use iwl_mac_config from iwlwifi Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> 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/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c106
1 files changed, 1 insertions, 105 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index f82a9dc82eef..c5644a5e50c9 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3166,8 +3166,6 @@ static void iwl3945_bg_rx_replenish(struct work_struct *data)
3166 mutex_unlock(&priv->mutex); 3166 mutex_unlock(&priv->mutex);
3167} 3167}
3168 3168
3169static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed);
3170
3171#define IWL_DELAY_NEXT_SCAN (HZ*2) 3169#define IWL_DELAY_NEXT_SCAN (HZ*2)
3172 3170
3173void iwl3945_post_associate(struct iwl_priv *priv) 3171void iwl3945_post_associate(struct iwl_priv *priv)
@@ -3380,108 +3378,6 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
3380 return NETDEV_TX_OK; 3378 return NETDEV_TX_OK;
3381} 3379}
3382 3380
3383/**
3384 * iwl3945_mac_config - mac80211 config callback
3385 *
3386 * We ignore conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME since it seems to
3387 * be set inappropriately and the driver currently sets the hardware up to
3388 * use it whenever needed.
3389 */
3390static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
3391{
3392 struct iwl_priv *priv = hw->priv;
3393 const struct iwl_channel_info *ch_info;
3394 struct ieee80211_conf *conf = &hw->conf;
3395 unsigned long flags;
3396 int ret = 0;
3397
3398 mutex_lock(&priv->mutex);
3399 IWL_DEBUG_MAC80211(priv, "enter to channel %d\n",
3400 conf->channel->hw_value);
3401
3402 if (!iwl_is_ready(priv)) {
3403 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
3404 ret = -EIO;
3405 goto out;
3406 }
3407
3408 if (unlikely(!iwl3945_mod_params.disable_hw_scan &&
3409 test_bit(STATUS_SCANNING, &priv->status))) {
3410 IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
3411 set_bit(STATUS_CONF_PENDING, &priv->status);
3412 mutex_unlock(&priv->mutex);
3413 return 0;
3414 }
3415
3416 spin_lock_irqsave(&priv->lock, flags);
3417
3418 ch_info = iwl_get_channel_info(priv, conf->channel->band,
3419 conf->channel->hw_value);
3420 if (!is_channel_valid(ch_info)) {
3421 IWL_DEBUG_SCAN(priv,
3422 "Channel %d [%d] is INVALID for this band.\n",
3423 conf->channel->hw_value, conf->channel->band);
3424 IWL_DEBUG_MAC80211(priv, "leave - invalid channel\n");
3425 spin_unlock_irqrestore(&priv->lock, flags);
3426 ret = -EINVAL;
3427 goto out;
3428 }
3429
3430 iwl_set_rxon_channel(priv, conf->channel);
3431
3432 iwl_set_flags_for_band(priv, conf->channel->band);
3433
3434 /* The list of supported rates and rate mask can be different
3435 * for each phymode; since the phymode may have changed, reset
3436 * the rate mask to what mac80211 lists */
3437 iwl_set_rate(priv);
3438
3439 spin_unlock_irqrestore(&priv->lock, flags);
3440
3441#ifdef IEEE80211_CONF_CHANNEL_SWITCH
3442 if (conf->flags & IEEE80211_CONF_CHANNEL_SWITCH) {
3443 iwl3945_hw_channel_switch(priv, conf->channel);
3444 goto out;
3445 }
3446#endif
3447
3448 if (changed & IEEE80211_CONF_CHANGE_RADIO_ENABLED) {
3449 if (conf->radio_enabled &&
3450 iwl_radio_kill_sw_enable_radio(priv)) {
3451 IWL_DEBUG_MAC80211(priv, "leave - RF-KILL - "
3452 "waiting for uCode\n");
3453 goto out;
3454 }
3455
3456 if (!conf->radio_enabled) {
3457 iwl_radio_kill_sw_disable_radio(priv);
3458 IWL_DEBUG_MAC80211(priv, "leave - radio disabled\n");
3459 goto out;
3460 }
3461 }
3462
3463 if (iwl_is_rfkill(priv)) {
3464 IWL_DEBUG_MAC80211(priv, "leave - RF kill\n");
3465 ret = -EIO;
3466 goto out;
3467 }
3468
3469 iwl_set_rate(priv);
3470
3471 if (memcmp(&priv->active_rxon,
3472 &priv->staging_rxon, sizeof(priv->staging_rxon)))
3473 iwlcore_commit_rxon(priv);
3474 else
3475 IWL_DEBUG_INFO(priv, "Not re-sending same RXON configuration\n");
3476
3477 IWL_DEBUG_MAC80211(priv, "leave\n");
3478
3479out:
3480 clear_bit(STATUS_CONF_PENDING, &priv->status);
3481 mutex_unlock(&priv->mutex);
3482 return ret;
3483}
3484
3485static void iwl3945_config_ap(struct iwl_priv *priv) 3381static void iwl3945_config_ap(struct iwl_priv *priv)
3486{ 3382{
3487 int rc = 0; 3383 int rc = 0;
@@ -4316,7 +4212,7 @@ static struct ieee80211_ops iwl3945_hw_ops = {
4316 .stop = iwl3945_mac_stop, 4212 .stop = iwl3945_mac_stop,
4317 .add_interface = iwl_mac_add_interface, 4213 .add_interface = iwl_mac_add_interface,
4318 .remove_interface = iwl_mac_remove_interface, 4214 .remove_interface = iwl_mac_remove_interface,
4319 .config = iwl3945_mac_config, 4215 .config = iwl_mac_config,
4320 .config_interface = iwl3945_mac_config_interface, 4216 .config_interface = iwl3945_mac_config_interface,
4321 .configure_filter = iwl_configure_filter, 4217 .configure_filter = iwl_configure_filter,
4322 .set_key = iwl3945_mac_set_key, 4218 .set_key = iwl3945_mac_set_key,