]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-agn.c
iwl3945: use iwl_set_mode in 3945
[karo-tx-linux.git] / drivers / net / wireless / iwlwifi / iwl-agn.c
index 3889158b359c964d5cdda212bdf0f35ca16af3f2..479fcf142707d5bfc839c9671c517204ebeb09bf 100644 (file)
@@ -102,7 +102,7 @@ MODULE_ALIAS("iwl4965");
  * function correctly transitions out of the RXON_ASSOC_MSK state if
  * a HW tune is required based on the RXON structure changes.
  */
-static int iwl_commit_rxon(struct iwl_priv *priv)
+int iwl_commit_rxon(struct iwl_priv *priv)
 {
        /* cast away the const for active_rxon in this function */
        struct iwl_rxon_cmd *active_rxon = (void *)&priv->active_rxon;
@@ -188,7 +188,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
                memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
        }
 
-       iwl_clear_stations_table(priv);
+       priv->cfg->ops->smgmt->clear_station_table(priv);
 
        if (!priv->error_recovering)
                priv->start_calib = 0;
@@ -246,8 +246,9 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
 void iwl_update_chain_flags(struct iwl_priv *priv)
 {
 
-       iwl_set_rxon_chain(priv);
-       iwl_commit_rxon(priv);
+       if (priv->cfg->ops->hcmd->set_rxon_chain)
+               priv->cfg->ops->hcmd->set_rxon_chain(priv);
+       iwlcore_commit_rxon(priv);
 }
 
 static void iwl_clear_free_frames(struct iwl_priv *priv)
@@ -531,76 +532,6 @@ int iwl_hw_tx_queue_init(struct iwl_priv *priv,
  *
  ******************************************************************************/
 
-static void iwl_ht_conf(struct iwl_priv *priv,
-                           struct ieee80211_bss_conf *bss_conf)
-{
-       struct ieee80211_sta_ht_cap *ht_conf;
-       struct iwl_ht_info *iwl_conf = &priv->current_ht_config;
-       struct ieee80211_sta *sta;
-
-       IWL_DEBUG_MAC80211(priv, "enter: \n");
-
-       if (!iwl_conf->is_ht)
-               return;
-
-
-       /*
-        * It is totally wrong to base global information on something
-        * that is valid only when associated, alas, this driver works
-        * that way and I don't know how to fix it.
-        */
-
-       rcu_read_lock();
-       sta = ieee80211_find_sta(priv->hw, priv->bssid);
-       if (!sta) {
-               rcu_read_unlock();
-               return;
-       }
-       ht_conf = &sta->ht_cap;
-
-       if (ht_conf->cap & IEEE80211_HT_CAP_SGI_20)
-               iwl_conf->sgf |= HT_SHORT_GI_20MHZ;
-       if (ht_conf->cap & IEEE80211_HT_CAP_SGI_40)
-               iwl_conf->sgf |= HT_SHORT_GI_40MHZ;
-
-       iwl_conf->is_green_field = !!(ht_conf->cap & IEEE80211_HT_CAP_GRN_FLD);
-       iwl_conf->max_amsdu_size =
-               !!(ht_conf->cap & IEEE80211_HT_CAP_MAX_AMSDU);
-
-       iwl_conf->supported_chan_width =
-               !!(ht_conf->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40);
-
-       /*
-        * XXX: The HT configuration needs to be moved into iwl_mac_config()
-        *      to be done there correctly.
-        */
-
-       iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
-       if (conf_is_ht40_minus(&priv->hw->conf))
-               iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
-       else if (conf_is_ht40_plus(&priv->hw->conf))
-               iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
-
-       /* If no above or below channel supplied disable FAT channel */
-       if (iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_ABOVE &&
-           iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_BELOW)
-               iwl_conf->supported_chan_width = 0;
-
-       iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2);
-
-       memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16);
-
-       iwl_conf->tx_chan_width = iwl_conf->supported_chan_width != 0;
-       iwl_conf->ht_protection =
-               bss_conf->ht.operation_mode & IEEE80211_HT_OP_MODE_PROTECTION;
-       iwl_conf->non_GF_STA_present =
-               !!(bss_conf->ht.operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
-
-       rcu_read_unlock();
-
-       IWL_DEBUG_MAC80211(priv, "leave\n");
-}
-
 #define MAX_UCODE_BEACON_INTERVAL      4096
 
 static u16 iwl_adjust_beacon_interval(u16 beacon_val)
@@ -657,30 +588,6 @@ static void iwl_setup_rxon_timing(struct iwl_priv *priv)
                        le16_to_cpu(priv->rxon_timing.atim_window));
 }
 
-static int iwl_set_mode(struct iwl_priv *priv, int mode)
-{
-       iwl_connection_init_rx_config(priv, mode);
-       iwl_set_rxon_chain(priv);
-       memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
-
-       iwl_clear_stations_table(priv);
-
-       /* dont commit rxon if rf-kill is on*/
-       if (!iwl_is_ready_rf(priv))
-               return -EAGAIN;
-
-       cancel_delayed_work(&priv->scan_check);
-       if (iwl_scan_cancel_timeout(priv, 100)) {
-               IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
-               IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
-               return -EAGAIN;
-       }
-
-       iwl_commit_rxon(priv);
-
-       return 0;
-}
-
 /******************************************************************************
  *
  * Generic RX handler implementations
@@ -1070,7 +977,7 @@ static void iwl_error_recovery(struct iwl_priv *priv)
        memcpy(&priv->staging_rxon, &priv->recovery_rxon,
               sizeof(priv->staging_rxon));
        priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
-       iwl_commit_rxon(priv);
+       iwlcore_commit_rxon(priv);
 
        iwl_rxon_add_station(priv, priv->bssid, 1);
 
@@ -1513,10 +1420,6 @@ static int iwl_read_ucode(struct iwl_priv *priv)
        return ret;
 }
 
-/* temporary */
-static int iwl_mac_beacon_update(struct ieee80211_hw *hw,
-                                struct sk_buff *skb);
-
 /**
  * iwl_alive_start - called after REPLY_ALIVE notification received
  *                   from protocol/runtime uCode (initialization uCode's
@@ -1545,7 +1448,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
                goto restart;
        }
 
-       iwl_clear_stations_table(priv);
+       priv->cfg->ops->smgmt->clear_station_table(priv);
        ret = priv->cfg->ops->lib->alive_notify(priv);
        if (ret) {
                IWL_WARN(priv,
@@ -1573,7 +1476,10 @@ static void iwl_alive_start(struct iwl_priv *priv)
        } else {
                /* Initialize our rx_config data */
                iwl_connection_init_rx_config(priv, priv->iw_mode);
-               iwl_set_rxon_chain(priv);
+
+               if (priv->cfg->ops->hcmd->set_rxon_chain)
+                       priv->cfg->ops->hcmd->set_rxon_chain(priv);
+
                memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
        }
 
@@ -1583,7 +1489,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
        iwl_reset_run_time_calib(priv);
 
        /* Configure the adapter for unassociated operation */
-       iwl_commit_rxon(priv);
+       iwlcore_commit_rxon(priv);
 
        /* At this point, the NIC is initialized and operational */
        iwl_rf_kill_ct_config(priv);
@@ -1631,7 +1537,7 @@ static void __iwl_down(struct iwl_priv *priv)
 
        iwl_leds_unregister(priv);
 
-       iwl_clear_stations_table(priv);
+       priv->cfg->ops->smgmt->clear_station_table(priv);
 
        /* Unblock any waiting calls */
        wake_up_interruptible_all(&priv->wait_command_queue);
@@ -1654,7 +1560,7 @@ static void __iwl_down(struct iwl_priv *priv)
                ieee80211_stop_queues(priv->hw);
 
        /* If we have not previously called iwl_init() then
-        * clear all bits but the RF Kill and SUSPEND bits and return */
+        * clear all bits but the RF Kill bits and return */
        if (!iwl_is_init(priv)) {
                priv->status = test_bit(STATUS_RF_KILL_HW, &priv->status) <<
                                        STATUS_RF_KILL_HW |
@@ -1662,23 +1568,19 @@ static void __iwl_down(struct iwl_priv *priv)
                                        STATUS_RF_KILL_SW |
                               test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
                                        STATUS_GEO_CONFIGURED |
-                              test_bit(STATUS_IN_SUSPEND, &priv->status) <<
-                                       STATUS_IN_SUSPEND |
                               test_bit(STATUS_EXIT_PENDING, &priv->status) <<
                                        STATUS_EXIT_PENDING;
                goto exit;
        }
 
-       /* ...otherwise clear out all the status bits but the RF Kill and
-        * SUSPEND bits and continue taking the NIC down. */
+       /* ...otherwise clear out all the status bits but the RF Kill
+        * bits and continue taking the NIC down. */
        priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) <<
                                STATUS_RF_KILL_HW |
                        test_bit(STATUS_RF_KILL_SW, &priv->status) <<
                                STATUS_RF_KILL_SW |
                        test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
                                STATUS_GEO_CONFIGURED |
-                       test_bit(STATUS_IN_SUSPEND, &priv->status) <<
-                               STATUS_IN_SUSPEND |
                        test_bit(STATUS_FW_ERROR, &priv->status) <<
                                STATUS_FW_ERROR |
                       test_bit(STATUS_EXIT_PENDING, &priv->status) <<
@@ -1703,7 +1605,7 @@ static void __iwl_down(struct iwl_priv *priv)
        udelay(5);
 
        /* FIXME: apm_ops.suspend(priv) */
-       if (exit_pending || test_bit(STATUS_IN_SUSPEND, &priv->status))
+       if (exit_pending)
                priv->cfg->ops->lib->apm_ops.stop(priv);
        else
                priv->cfg->ops->lib->apm_ops.reset(priv);
@@ -1786,7 +1688,7 @@ static int __iwl_up(struct iwl_priv *priv)
 
        for (i = 0; i < MAX_HW_RESTARTS; i++) {
 
-               iwl_clear_stations_table(priv);
+               priv->cfg->ops->smgmt->clear_station_table(priv);
 
                /* load bootstrap state machine,
                 * load bootstrap program into processor's memory,
@@ -1915,7 +1817,7 @@ static void iwl_bg_rx_replenish(struct work_struct *data)
 
 #define IWL_DELAY_NEXT_SCAN (HZ*2)
 
-static void iwl_post_associate(struct iwl_priv *priv)
+void iwl_post_associate(struct iwl_priv *priv)
 {
        struct ieee80211_conf *conf = NULL;
        int ret = 0;
@@ -1943,7 +1845,7 @@ static void iwl_post_associate(struct iwl_priv *priv)
        conf = ieee80211_get_hw_conf(priv->hw);
 
        priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
-       iwl_commit_rxon(priv);
+       iwlcore_commit_rxon(priv);
 
        iwl_setup_rxon_timing(priv);
        ret = iwl_send_cmd_pdu(priv, REPLY_RXON_TIMING,
@@ -1956,7 +1858,9 @@ static void iwl_post_associate(struct iwl_priv *priv)
 
        iwl_set_rxon_ht(priv, &priv->current_ht_config);
 
-       iwl_set_rxon_chain(priv);
+       if (priv->cfg->ops->hcmd->set_rxon_chain)
+               priv->cfg->ops->hcmd->set_rxon_chain(priv);
+
        priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
 
        IWL_DEBUG_ASSOC(priv, "assoc id %d beacon interval %d\n",
@@ -1978,7 +1882,7 @@ static void iwl_post_associate(struct iwl_priv *priv)
 
        }
 
-       iwl_commit_rxon(priv);
+       iwlcore_commit_rxon(priv);
 
        switch (priv->iw_mode) {
        case NL80211_IFTYPE_STATION:
@@ -2064,9 +1968,6 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
 
        IWL_DEBUG_INFO(priv, "Start UP work done.\n");
 
-       if (test_bit(STATUS_IN_SUSPEND, &priv->status))
-               return 0;
-
        /* Wait for START_ALIVE from Run Time ucode. Otherwise callbacks from
         * mac80211 will not be run successfully. */
        ret = wait_event_interruptible_timeout(priv->wait_command_queue,
@@ -2263,7 +2164,8 @@ static int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
        }
 
        /* call to ensure that 4965 rx_chain is set properly in monitor mode */
-       iwl_set_rxon_chain(priv);
+       if (priv->cfg->ops->hcmd->set_rxon_chain)
+               priv->cfg->ops->hcmd->set_rxon_chain(priv);
 
        if (changed & IEEE80211_CONF_CHANGE_RADIO_ENABLED) {
                if (conf->radio_enabled &&
@@ -2292,7 +2194,7 @@ static int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
 
        if (memcmp(&priv->active_rxon,
                   &priv->staging_rxon, sizeof(priv->staging_rxon)))
-               iwl_commit_rxon(priv);
+               iwlcore_commit_rxon(priv);
        else
                IWL_DEBUG_INFO(priv, "No re-sending same RXON configuration.\n");
 
@@ -2316,7 +2218,7 @@ static void iwl_config_ap(struct iwl_priv *priv)
 
                /* RXON - unassoc (to set timing command) */
                priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
-               iwl_commit_rxon(priv);
+               iwlcore_commit_rxon(priv);
 
                /* RXON Timing */
                iwl_setup_rxon_timing(priv);
@@ -2326,7 +2228,8 @@ static void iwl_config_ap(struct iwl_priv *priv)
                        IWL_WARN(priv, "REPLY_RXON_TIMING failed - "
                                        "Attempting to continue.\n");
 
-               iwl_set_rxon_chain(priv);
+               if (priv->cfg->ops->hcmd->set_rxon_chain)
+                       priv->cfg->ops->hcmd->set_rxon_chain(priv);
 
                /* FIXME: what should be the assoc_id for AP? */
                priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
@@ -2352,7 +2255,7 @@ static void iwl_config_ap(struct iwl_priv *priv)
                }
                /* restore RXON assoc */
                priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
-               iwl_commit_rxon(priv);
+               iwlcore_commit_rxon(priv);
                spin_lock_irqsave(&priv->lock, flags);
                iwl_activate_qos(priv, 1);
                spin_unlock_irqrestore(&priv->lock, flags);
@@ -2446,7 +2349,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw,
                if (priv->iw_mode == NL80211_IFTYPE_AP)
                        iwl_config_ap(priv);
                else {
-                       rc = iwl_commit_rxon(priv);
+                       rc = iwlcore_commit_rxon(priv);
                        if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc)
                                iwl_rxon_add_station(
                                        priv, priv->active_rxon.bssid_addr, 1);
@@ -2455,7 +2358,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw,
        } else {
                iwl_scan_cancel_timeout(priv, 100);
                priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
-               iwl_commit_rxon(priv);
+               iwlcore_commit_rxon(priv);
        }
 
  done:
@@ -2477,7 +2380,7 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
        if (iwl_is_ready_rf(priv)) {
                iwl_scan_cancel_timeout(priv, 100);
                priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
-               iwl_commit_rxon(priv);
+               iwlcore_commit_rxon(priv);
        }
        if (priv->vif == conf->vif) {
                priv->vif = NULL;
@@ -2489,70 +2392,6 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
 
 }
 
-#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
-static void iwl_bss_info_changed(struct ieee80211_hw *hw,
-                                    struct ieee80211_vif *vif,
-                                    struct ieee80211_bss_conf *bss_conf,
-                                    u32 changes)
-{
-       struct iwl_priv *priv = hw->priv;
-
-       IWL_DEBUG_MAC80211(priv, "changes = 0x%X\n", changes);
-
-       if (changes & BSS_CHANGED_ERP_PREAMBLE) {
-               IWL_DEBUG_MAC80211(priv, "ERP_PREAMBLE %d\n",
-                                  bss_conf->use_short_preamble);
-               if (bss_conf->use_short_preamble)
-                       priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
-               else
-                       priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
-       }
-
-       if (changes & BSS_CHANGED_ERP_CTS_PROT) {
-               IWL_DEBUG_MAC80211(priv, "ERP_CTS %d\n", bss_conf->use_cts_prot);
-               if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
-                       priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK;
-               else
-                       priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
-       }
-
-       if (changes & BSS_CHANGED_HT) {
-               iwl_ht_conf(priv, bss_conf);
-               iwl_set_rxon_chain(priv);
-       }
-
-       if (changes & BSS_CHANGED_ASSOC) {
-               IWL_DEBUG_MAC80211(priv, "ASSOC %d\n", bss_conf->assoc);
-               /* This should never happen as this function should
-                * never be called from interrupt context. */
-               if (WARN_ON_ONCE(in_interrupt()))
-                       return;
-               if (bss_conf->assoc) {
-                       priv->assoc_id = bss_conf->aid;
-                       priv->beacon_int = bss_conf->beacon_int;
-                       priv->power_data.dtim_period = bss_conf->dtim_period;
-                       priv->timestamp = bss_conf->timestamp;
-                       priv->assoc_capability = bss_conf->assoc_capability;
-
-                       /* we have just associated, don't start scan too early
-                        * leave time for EAPOL exchange to complete
-                        */
-                       priv->next_scan_jiffies = jiffies +
-                                       IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
-                       mutex_lock(&priv->mutex);
-                       iwl_post_associate(priv);
-                       mutex_unlock(&priv->mutex);
-               } else {
-                       priv->assoc_id = 0;
-                       IWL_DEBUG_MAC80211(priv, "DISASSOC %d\n", bss_conf->assoc);
-               }
-       } else if (changes && iwl_is_associated(priv) && priv->assoc_id) {
-                       IWL_DEBUG_MAC80211(priv, "Associated Changes %d\n", changes);
-                       iwl_send_rxon_assoc(priv);
-       }
-
-}
-
 static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw,
                        struct ieee80211_key_conf *keyconf, const u8 *addr,
                        u32 iv32, u16 *phase1key)
@@ -2584,7 +2423,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
                return -EOPNOTSUPP;
        }
        addr = sta ? sta->addr : iwl_bcast_addr;
-       sta_id = iwl_find_station(priv, addr);
+       sta_id = priv->cfg->ops->smgmt->find_station(priv, addr);
        if (sta_id == IWL_INVALID_STATION) {
                IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n",
                                   addr);
@@ -2635,49 +2474,6 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        return ret;
 }
 
-static int iwl_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
-                          const struct ieee80211_tx_queue_params *params)
-{
-       struct iwl_priv *priv = hw->priv;
-       unsigned long flags;
-       int q;
-
-       IWL_DEBUG_MAC80211(priv, "enter\n");
-
-       if (!iwl_is_ready_rf(priv)) {
-               IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
-               return -EIO;
-       }
-
-       if (queue >= AC_NUM) {
-               IWL_DEBUG_MAC80211(priv, "leave - queue >= AC_NUM %d\n", queue);
-               return 0;
-       }
-
-       q = AC_NUM - 1 - queue;
-
-       spin_lock_irqsave(&priv->lock, flags);
-
-       priv->qos_data.def_qos_parm.ac[q].cw_min = cpu_to_le16(params->cw_min);
-       priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max);
-       priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs;
-       priv->qos_data.def_qos_parm.ac[q].edca_txop =
-                       cpu_to_le16((params->txop * 32));
-
-       priv->qos_data.def_qos_parm.ac[q].reserved1 = 0;
-       priv->qos_data.qos_active = 1;
-
-       if (priv->iw_mode == NL80211_IFTYPE_AP)
-               iwl_activate_qos(priv, 1);
-       else if (priv->assoc_id && iwl_is_associated(priv))
-               iwl_activate_qos(priv, 0);
-
-       spin_unlock_irqrestore(&priv->lock, flags);
-
-       IWL_DEBUG_MAC80211(priv, "leave\n");
-       return 0;
-}
-
 static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
                             enum ieee80211_ampdu_mlme_action action,
                             struct ieee80211_sta *sta, u16 tid, u16 *ssn)
@@ -2811,7 +2607,7 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
        if (priv->iw_mode != NL80211_IFTYPE_AP) {
                iwl_scan_cancel_timeout(priv, 100);
                priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
-               iwl_commit_rxon(priv);
+               iwlcore_commit_rxon(priv);
        }
 
        iwl_power_update_mode(priv, 0);
@@ -2841,45 +2637,6 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
        IWL_DEBUG_MAC80211(priv, "leave\n");
 }
 
-static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
-{
-       struct iwl_priv *priv = hw->priv;
-       unsigned long flags;
-       __le64 timestamp;
-
-       IWL_DEBUG_MAC80211(priv, "enter\n");
-
-       if (!iwl_is_ready_rf(priv)) {
-               IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
-               return -EIO;
-       }
-
-       if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
-               IWL_DEBUG_MAC80211(priv, "leave - not IBSS\n");
-               return -EIO;
-       }
-
-       spin_lock_irqsave(&priv->lock, flags);
-
-       if (priv->ibss_beacon)
-               dev_kfree_skb(priv->ibss_beacon);
-
-       priv->ibss_beacon = skb;
-
-       priv->assoc_id = 0;
-       timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
-       priv->timestamp = le64_to_cpu(timestamp);
-
-       IWL_DEBUG_MAC80211(priv, "leave\n");
-       spin_unlock_irqrestore(&priv->lock, flags);
-
-       iwl_reset_qos(priv);
-
-       iwl_post_associate(priv);
-
-
-       return 0;
-}
 
 /*****************************************************************************
  *
@@ -3030,7 +2787,7 @@ static ssize_t store_flags(struct device *d,
                else {
                        IWL_DEBUG_INFO(priv, "Commit rxon.flags = 0x%04X\n", flags);
                        priv->staging_rxon.flags = cpu_to_le32(flags);
-                       iwl_commit_rxon(priv);
+                       iwlcore_commit_rxon(priv);
                }
        }
        mutex_unlock(&priv->mutex);
@@ -3071,7 +2828,7 @@ static ssize_t store_filter_flags(struct device *d,
                                       "0x%04X\n", filter_flags);
                        priv->staging_rxon.filter_flags =
                                cpu_to_le32(filter_flags);
-                       iwl_commit_rxon(priv);
+                       iwlcore_commit_rxon(priv);
                }
        }
        mutex_unlock(&priv->mutex);
@@ -3538,7 +3295,7 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
                iwl_rx_queue_free(priv, &priv->rxq);
        iwl_hw_txq_ctx_free(priv);
 
-       iwl_clear_stations_table(priv);
+       priv->cfg->ops->smgmt->clear_station_table(priv);
        iwl_eeprom_free(priv);
 
 
@@ -3566,45 +3323,6 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
        ieee80211_free_hw(priv->hw);
 }
 
-#ifdef CONFIG_PM
-
-static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
-{
-       struct iwl_priv *priv = pci_get_drvdata(pdev);
-
-       if (priv->is_open) {
-               set_bit(STATUS_IN_SUSPEND, &priv->status);
-               iwl_mac_stop(priv->hw);
-               priv->is_open = 1;
-       }
-
-       pci_save_state(pdev);
-       pci_disable_device(pdev);
-       pci_set_power_state(pdev, PCI_D3hot);
-
-       return 0;
-}
-
-static int iwl_pci_resume(struct pci_dev *pdev)
-{
-       struct iwl_priv *priv = pci_get_drvdata(pdev);
-       int ret;
-
-       pci_set_power_state(pdev, PCI_D0);
-       ret = pci_enable_device(pdev);
-       if (ret)
-               return ret;
-       pci_restore_state(pdev);
-       iwl_enable_interrupts(priv);
-
-       if (priv->is_open)
-               iwl_mac_start(priv->hw);
-
-       clear_bit(STATUS_IN_SUSPEND, &priv->status);
-       return 0;
-}
-
-#endif /* CONFIG_PM */
 
 /*****************************************************************************
  *