iwlwifi: map A-MPDU HW queue to mac80211 A-MPDU SW queue
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl4965-base.c
index c532584b11e61d0523cb01319ebfb5cc10b22b8a..54534270d46f8ee91cbcc99d87d7ad487a4b226b 100644 (file)
@@ -46,7 +46,7 @@
 #include <asm/div64.h>
 
 #include "iwl-eeprom.h"
-#include "iwl-4965.h"
+#include "iwl-dev.h"
 #include "iwl-core.h"
 #include "iwl-io.h"
 #include "iwl-helpers.h"
@@ -882,7 +882,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
 void iwl4965_update_chain_flags(struct iwl_priv *priv)
 {
 
-       iwl4965_set_rxon_chain(priv);
+       iwl_set_rxon_chain(priv);
        iwl4965_commit_rxon(priv);
 }
 
@@ -1073,17 +1073,29 @@ unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv,
        return priv->ibss_beacon->len;
 }
 
-static u8 iwl4965_rate_get_lowest_plcp(int rate_mask)
+static u8 iwl4965_rate_get_lowest_plcp(struct iwl_priv *priv)
 {
-       u8 i;
+       int i;
+       int rate_mask;
+
+       /* Set rate mask*/
+       if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)
+               rate_mask = priv->active_rate_basic & 0xF;
+       else
+               rate_mask = priv->active_rate_basic & 0xFF0;
 
+       /* Find lowest valid rate */
        for (i = IWL_RATE_1M_INDEX; i != IWL_RATE_INVALID;
-            i = iwl4965_rates[i].next_ieee) {
+                                       i = iwl4965_rates[i].next_ieee) {
                if (rate_mask & (1 << i))
                        return iwl4965_rates[i].plcp;
        }
 
-       return IWL_RATE_INVALID;
+       /* No valid rate was found. Assign the lowest one */
+       if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)
+               return IWL_RATE_1M_PLCP;
+       else
+               return IWL_RATE_6M_PLCP;
 }
 
 static int iwl4965_send_beacon_cmd(struct iwl_priv *priv)
@@ -1101,16 +1113,7 @@ static int iwl4965_send_beacon_cmd(struct iwl_priv *priv)
                return -ENOMEM;
        }
 
-       if (!(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)) {
-               rate = iwl4965_rate_get_lowest_plcp(priv->active_rate_basic &
-                                               0xFF0);
-               if (rate == IWL_INVALID_RATE)
-                       rate = IWL_RATE_6M_PLCP;
-       } else {
-               rate = iwl4965_rate_get_lowest_plcp(priv->active_rate_basic & 0xF);
-               if (rate == IWL_INVALID_RATE)
-                       rate = IWL_RATE_1M_PLCP;
-       }
+       rate = iwl4965_rate_get_lowest_plcp(priv);
 
        frame_size = iwl4965_hw_get_beacon_cmd(priv, frame, rate);
 
@@ -1128,15 +1131,6 @@ static int iwl4965_send_beacon_cmd(struct iwl_priv *priv)
  *
  ******************************************************************************/
 
-static void iwl4965_unset_hw_params(struct iwl_priv *priv)
-{
-       if (priv->shared_virt)
-               pci_free_consistent(priv->pci_dev,
-                                   sizeof(struct iwl4965_shared),
-                                   priv->shared_virt,
-                                   priv->shared_phys);
-}
-
 /**
  * iwl4965_supported_rate_to_ie - fill in the supported rate in IE field
  *
@@ -1741,7 +1735,7 @@ static void iwl4965_connection_init_rx_config(struct iwl_priv *priv)
        memcpy(priv->staging_rxon.wlap_bssid_addr, priv->mac_addr, ETH_ALEN);
        priv->staging_rxon.ofdm_ht_single_stream_basic_rates = 0xff;
        priv->staging_rxon.ofdm_ht_dual_stream_basic_rates = 0xff;
-       iwl4965_set_rxon_chain(priv);
+       iwl_set_rxon_chain(priv);
 }
 
 static int iwl4965_set_mode(struct iwl_priv *priv, int mode)
@@ -2053,7 +2047,7 @@ static int iwl4965_tx_skb(struct iwl_priv *priv,
                goto drop;
        }
 
-       IWL_DEBUG_RATE("station Id %d\n", sta_id);
+       IWL_DEBUG_TX("station Id %d\n", sta_id);
 
        qc = ieee80211_get_qos_ctrl(hdr);
        if (qc) {
@@ -2528,8 +2522,6 @@ static void iwl4965_txstatus_to_ieee(struct iwl_priv *priv,
 
        tx_sta->status.ack_signal = 0;
        tx_sta->status.excessive_retries = 0;
-       tx_sta->status.queue_length = 0;
-       tx_sta->status.queue_number = 0;
 
        if (in_interrupt())
                ieee80211_tx_status_irqsafe(priv->hw,
@@ -2576,12 +2568,6 @@ int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
                nfreed++;
        }
 
-/*     if (iwl4965_queue_space(q) > q->low_mark && (txq_id >= 0) &&
-                       (txq_id != IWL_CMD_QUEUE_NUM) &&
-                       priv->mac80211_registered)
-               ieee80211_wake_queue(priv->hw, txq_id); */
-
-
        return nfreed;
 }
 
@@ -2665,8 +2651,6 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
 
                tx_status = &(priv->txq[txq_id].txb[idx].status);
                tx_status->retry_count = tx_resp->failure_frame;
-               tx_status->queue_number = status & 0xff;
-               tx_status->queue_length = tx_resp->failure_rts;
                tx_status->control.flags &= ~IEEE80211_TXCTL_AMPDU;
                tx_status->flags = iwl4965_is_tx_success(status)?
                        IEEE80211_TX_STATUS_ACK : 0;
@@ -2807,7 +2791,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
                }
 
                if (txq->q.read_ptr != (scd_ssn & 0xff)) {
-                       int freed;
+                       int freed, ampdu_q;
                        index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
                        IWL_DEBUG_TX_REPLY("Retry scheduler reclaim scd_ssn "
                                           "%d index %d\n", scd_ssn , index);
@@ -2816,9 +2800,15 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 
                        if (iwl4965_queue_space(&txq->q) > txq->q.low_mark &&
                            txq_id >= 0 && priv->mac80211_registered &&
-                           agg->state != IWL_EMPTYING_HW_QUEUE_DELBA)
-                               ieee80211_wake_queue(priv->hw, txq_id);
-
+                           agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) {
+                               /* calculate mac80211 ampdu sw queue to wake */
+                               ampdu_q = txq_id - IWL_BACK_QUEUE_FIRST_ID +
+                                         priv->hw->queues;
+                               if (agg->state == IWL_AGG_OFF)
+                                       ieee80211_wake_queue(priv->hw, txq_id);
+                               else
+                                       ieee80211_wake_queue(priv->hw, ampdu_q);
+                       }
                        iwl4965_check_empty_hw_queue(priv, sta_id, tid, txq_id);
                }
        } else {
@@ -2826,9 +2816,6 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
        tx_status = &(txq->txb[txq->q.read_ptr].status);
 
        tx_status->retry_count = tx_resp->failure_frame;
-       tx_status->queue_number = status;
-       tx_status->queue_length = tx_resp->bt_kill_count;
-       tx_status->queue_length |= tx_resp->failure_rts;
        tx_status->flags =
            iwl4965_is_tx_success(status) ? IEEE80211_TX_STATUS_ACK : 0;
        iwl4965_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags),
@@ -2846,8 +2833,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
                if (tid != MAX_TID_COUNT)
                        priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
                if (iwl4965_queue_space(&txq->q) > txq->q.low_mark &&
-                       (txq_id >= 0) &&
-                       priv->mac80211_registered)
+                       (txq_id >= 0) && priv->mac80211_registered)
                        ieee80211_wake_queue(priv->hw, txq_id);
                if (tid != MAX_TID_COUNT)
                        iwl4965_check_empty_hw_queue(priv, sta_id, tid, txq_id);
@@ -3243,7 +3229,7 @@ static void iwl4965_setup_rx_handlers(struct iwl_priv *priv)
        priv->rx_handlers[REPLY_TX] = iwl4965_rx_reply_tx;
 
        /* Set up hardware specific Rx handlers */
-       iwl4965_hw_rx_handler_setup(priv);
+       priv->cfg->ops->lib->rx_handler_setup(priv);
 }
 
 /**
@@ -4502,163 +4488,6 @@ static int iwl4965_get_channels_for_scan(struct iwl_priv *priv,
        return added;
 }
 
-static void iwl4965_init_hw_rates(struct iwl_priv *priv,
-                             struct ieee80211_rate *rates)
-{
-       int i;
-
-       for (i = 0; i < IWL_RATE_COUNT; i++) {
-               rates[i].bitrate = iwl4965_rates[i].ieee * 5;
-               rates[i].hw_value = i; /* Rate scaling will work on indexes */
-               rates[i].hw_value_short = i;
-               rates[i].flags = 0;
-               if ((i > IWL_LAST_OFDM_RATE) || (i < IWL_FIRST_OFDM_RATE)) {
-                       /*
-                        * If CCK != 1M then set short preamble rate flag.
-                        */
-                       rates[i].flags |=
-                               (iwl4965_rates[i].plcp == IWL_RATE_1M_PLCP) ?
-                                       0 : IEEE80211_RATE_SHORT_PREAMBLE;
-               }
-       }
-}
-
-/**
- * iwl4965_init_geos - Initialize mac80211's geo/channel info based from eeprom
- */
-int iwl4965_init_geos(struct iwl_priv *priv)
-{
-       struct iwl_channel_info *ch;
-       struct ieee80211_supported_band *sband;
-       struct ieee80211_channel *channels;
-       struct ieee80211_channel *geo_ch;
-       struct ieee80211_rate *rates;
-       int i = 0;
-
-       if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||
-           priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {
-               IWL_DEBUG_INFO("Geography modes already initialized.\n");
-               set_bit(STATUS_GEO_CONFIGURED, &priv->status);
-               return 0;
-       }
-
-       channels = kzalloc(sizeof(struct ieee80211_channel) *
-                          priv->channel_count, GFP_KERNEL);
-       if (!channels)
-               return -ENOMEM;
-
-       rates = kzalloc((sizeof(struct ieee80211_rate) * (IWL_RATE_COUNT + 1)),
-                       GFP_KERNEL);
-       if (!rates) {
-               kfree(channels);
-               return -ENOMEM;
-       }
-
-       /* 5.2GHz channels start after the 2.4GHz channels */
-       sband = &priv->bands[IEEE80211_BAND_5GHZ];
-       sband->channels = &channels[ARRAY_SIZE(iwl_eeprom_band_1)];
-       /* just OFDM */
-       sband->bitrates = &rates[IWL_FIRST_OFDM_RATE];
-       sband->n_bitrates = IWL_RATE_COUNT - IWL_FIRST_OFDM_RATE;
-
-       iwl4965_init_ht_hw_capab(priv, &sband->ht_info, IEEE80211_BAND_5GHZ);
-
-       sband = &priv->bands[IEEE80211_BAND_2GHZ];
-       sband->channels = channels;
-       /* OFDM & CCK */
-       sband->bitrates = rates;
-       sband->n_bitrates = IWL_RATE_COUNT;
-
-       iwl4965_init_ht_hw_capab(priv, &sband->ht_info, IEEE80211_BAND_2GHZ);
-
-       priv->ieee_channels = channels;
-       priv->ieee_rates = rates;
-
-       iwl4965_init_hw_rates(priv, rates);
-
-       for (i = 0;  i < priv->channel_count; i++) {
-               ch = &priv->channel_info[i];
-
-               /* FIXME: might be removed if scan is OK */
-               if (!is_channel_valid(ch))
-                       continue;
-
-               if (is_channel_a_band(ch))
-                       sband =  &priv->bands[IEEE80211_BAND_5GHZ];
-               else
-                       sband =  &priv->bands[IEEE80211_BAND_2GHZ];
-
-               geo_ch = &sband->channels[sband->n_channels++];
-
-               geo_ch->center_freq = ieee80211_channel_to_frequency(ch->channel);
-               geo_ch->max_power = ch->max_power_avg;
-               geo_ch->max_antenna_gain = 0xff;
-               geo_ch->hw_value = ch->channel;
-
-               if (is_channel_valid(ch)) {
-                       if (!(ch->flags & EEPROM_CHANNEL_IBSS))
-                               geo_ch->flags |= IEEE80211_CHAN_NO_IBSS;
-
-                       if (!(ch->flags & EEPROM_CHANNEL_ACTIVE))
-                               geo_ch->flags |= IEEE80211_CHAN_PASSIVE_SCAN;
-
-                       if (ch->flags & EEPROM_CHANNEL_RADAR)
-                               geo_ch->flags |= IEEE80211_CHAN_RADAR;
-
-                       if (ch->max_power_avg > priv->max_channel_txpower_limit)
-                               priv->max_channel_txpower_limit =
-                                   ch->max_power_avg;
-               } else {
-                       geo_ch->flags |= IEEE80211_CHAN_DISABLED;
-               }
-
-               /* Save flags for reg domain usage */
-               geo_ch->orig_flags = geo_ch->flags;
-
-               IWL_DEBUG_INFO("Channel %d Freq=%d[%sGHz] %s flag=0%X\n",
-                               ch->channel, geo_ch->center_freq,
-                               is_channel_a_band(ch) ?  "5.2" : "2.4",
-                               geo_ch->flags & IEEE80211_CHAN_DISABLED ?
-                               "restricted" : "valid",
-                                geo_ch->flags);
-       }
-
-       if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
-            priv->cfg->sku & IWL_SKU_A) {
-               printk(KERN_INFO DRV_NAME
-                      ": Incorrectly detected BG card as ABG.  Please send "
-                      "your PCI ID 0x%04X:0x%04X to maintainer.\n",
-                      priv->pci_dev->device, priv->pci_dev->subsystem_device);
-               priv->cfg->sku &= ~IWL_SKU_A;
-       }
-
-       printk(KERN_INFO DRV_NAME
-              ": Tunable channels: %d 802.11bg, %d 802.11a channels\n",
-              priv->bands[IEEE80211_BAND_2GHZ].n_channels,
-              priv->bands[IEEE80211_BAND_5GHZ].n_channels);
-
-       if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
-               priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
-                       &priv->bands[IEEE80211_BAND_2GHZ];
-       if (priv->bands[IEEE80211_BAND_5GHZ].n_channels)
-               priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
-                       &priv->bands[IEEE80211_BAND_5GHZ];
-
-       set_bit(STATUS_GEO_CONFIGURED, &priv->status);
-
-       return 0;
-}
-
-/*
- * iwl4965_free_geos - undo allocations in iwl4965_init_geos
- */
-void iwl4965_free_geos(struct iwl_priv *priv)
-{
-       kfree(priv->ieee_channels);
-       kfree(priv->ieee_rates);
-       clear_bit(STATUS_GEO_CONFIGURED, &priv->status);
-}
-
 /******************************************************************************
  *
  * uCode download functions
@@ -4675,146 +4504,6 @@ static void iwl4965_dealloc_ucode_pci(struct iwl_priv *priv)
        iwl_free_fw_desc(priv->pci_dev, &priv->ucode_boot);
 }
 
-/**
- * iwl4965_verify_inst_full - verify runtime uCode image in card vs. host,
- *     looking at all data.
- */
-static int iwl4965_verify_inst_full(struct iwl_priv *priv, __le32 *image,
-                                u32 len)
-{
-       u32 val;
-       u32 save_len = len;
-       int rc = 0;
-       u32 errcnt;
-
-       IWL_DEBUG_INFO("ucode inst image size is %u\n", len);
-
-       rc = iwl_grab_nic_access(priv);
-       if (rc)
-               return rc;
-
-       iwl_write_direct32(priv, HBUS_TARG_MEM_RADDR, RTC_INST_LOWER_BOUND);
-
-       errcnt = 0;
-       for (; len > 0; len -= sizeof(u32), image++) {
-               /* read data comes through single port, auto-incr addr */
-               /* NOTE: Use the debugless read so we don't flood kernel log
-                * if IWL_DL_IO is set */
-               val = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
-               if (val != le32_to_cpu(*image)) {
-                       IWL_ERROR("uCode INST section is invalid at "
-                                 "offset 0x%x, is 0x%x, s/b 0x%x\n",
-                                 save_len - len, val, le32_to_cpu(*image));
-                       rc = -EIO;
-                       errcnt++;
-                       if (errcnt >= 20)
-                               break;
-               }
-       }
-
-       iwl_release_nic_access(priv);
-
-       if (!errcnt)
-               IWL_DEBUG_INFO
-                   ("ucode image in INSTRUCTION memory is good\n");
-
-       return rc;
-}
-
-
-/**
- * iwl4965_verify_inst_sparse - verify runtime uCode image in card vs. host,
- *   using sample data 100 bytes apart.  If these sample points are good,
- *   it's a pretty good bet that everything between them is good, too.
- */
-static int iwl4965_verify_inst_sparse(struct iwl_priv *priv, __le32 *image, u32 len)
-{
-       u32 val;
-       int rc = 0;
-       u32 errcnt = 0;
-       u32 i;
-
-       IWL_DEBUG_INFO("ucode inst image size is %u\n", len);
-
-       rc = iwl_grab_nic_access(priv);
-       if (rc)
-               return rc;
-
-       for (i = 0; i < len; i += 100, image += 100/sizeof(u32)) {
-               /* read data comes through single port, auto-incr addr */
-               /* NOTE: Use the debugless read so we don't flood kernel log
-                * if IWL_DL_IO is set */
-               iwl_write_direct32(priv, HBUS_TARG_MEM_RADDR,
-                       i + RTC_INST_LOWER_BOUND);
-               val = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
-               if (val != le32_to_cpu(*image)) {
-#if 0 /* Enable this if you want to see details */
-                       IWL_ERROR("uCode INST section is invalid at "
-                                 "offset 0x%x, is 0x%x, s/b 0x%x\n",
-                                 i, val, *image);
-#endif
-                       rc = -EIO;
-                       errcnt++;
-                       if (errcnt >= 3)
-                               break;
-               }
-       }
-
-       iwl_release_nic_access(priv);
-
-       return rc;
-}
-
-
-/**
- * iwl4965_verify_ucode - determine which instruction image is in SRAM,
- *    and verify its contents
- */
-static int iwl4965_verify_ucode(struct iwl_priv *priv)
-{
-       __le32 *image;
-       u32 len;
-       int rc = 0;
-
-       /* Try bootstrap */
-       image = (__le32 *)priv->ucode_boot.v_addr;
-       len = priv->ucode_boot.len;
-       rc = iwl4965_verify_inst_sparse(priv, image, len);
-       if (rc == 0) {
-               IWL_DEBUG_INFO("Bootstrap uCode is good in inst SRAM\n");
-               return 0;
-       }
-
-       /* Try initialize */
-       image = (__le32 *)priv->ucode_init.v_addr;
-       len = priv->ucode_init.len;
-       rc = iwl4965_verify_inst_sparse(priv, image, len);
-       if (rc == 0) {
-               IWL_DEBUG_INFO("Initialize uCode is good in inst SRAM\n");
-               return 0;
-       }
-
-       /* Try runtime/protocol */
-       image = (__le32 *)priv->ucode_code.v_addr;
-       len = priv->ucode_code.len;
-       rc = iwl4965_verify_inst_sparse(priv, image, len);
-       if (rc == 0) {
-               IWL_DEBUG_INFO("Runtime uCode is good in inst SRAM\n");
-               return 0;
-       }
-
-       IWL_ERROR("NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n");
-
-       /* Since nothing seems to match, show first several data entries in
-        * instruction SRAM, so maybe visual inspection will give a clue.
-        * Selection of bootstrap image (vs. other images) is arbitrary. */
-       image = (__le32 *)priv->ucode_boot.v_addr;
-       len = priv->ucode_boot.len;
-       rc = iwl4965_verify_inst_full(priv, image, len);
-
-       return rc;
-}
-
 static void iwl4965_nic_start(struct iwl_priv *priv)
 {
        /* Remove all resets to allow NIC to operate */
@@ -5090,7 +4779,7 @@ static void iwl4965_init_alive_start(struct iwl_priv *priv)
        /* Bootstrap uCode has loaded initialize uCode ... verify inst image.
         * This is a paranoid check, because we would not have gotten the
         * "initialize" alive if code weren't properly loaded.  */
-       if (iwl4965_verify_ucode(priv)) {
+       if (iwl_verify_ucode(priv)) {
                /* Runtime instruction load was bad;
                 * take it all the way back down so we can try again */
                IWL_DEBUG_INFO("Bad \"initialize\" uCode load.\n");
@@ -5138,7 +4827,7 @@ static void iwl4965_alive_start(struct iwl_priv *priv)
        /* Initialize uCode has loaded Runtime uCode ... verify inst image.
         * This is a paranoid check, because we would not have gotten the
         * "runtime" alive if code weren't properly loaded.  */
-       if (iwl4965_verify_ucode(priv)) {
+       if (iwl_verify_ucode(priv)) {
                /* Runtime instruction load was bad;
                 * take it all the way back down so we can try again */
                IWL_DEBUG_INFO("Bad runtime uCode load.\n");
@@ -5298,6 +4987,7 @@ static void __iwl4965_down(struct iwl_priv *priv)
        iwl4965_hw_nic_stop_master(priv);
        iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
        iwl4965_hw_nic_reset(priv);
+       priv->cfg->ops->lib->free_shared_mem(priv);
 
  exit:
        memset(&priv->card_alive, 0, sizeof(struct iwl4965_alive_resp));
@@ -5359,6 +5049,12 @@ static int __iwl4965_up(struct iwl_priv *priv)
        iwl_rfkill_set_hw_state(priv);
        iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
 
+       ret = priv->cfg->ops->lib->alloc_shared_mem(priv);
+       if (ret) {
+               IWL_ERROR("Unable to allocate shared memory\n");
+               return ret;
+       }
+
        ret = priv->cfg->ops->lib->hw_nic_init(priv);
        if (ret) {
                IWL_ERROR("Unable to init nic\n");
@@ -5806,7 +5502,7 @@ static void iwl4965_post_associate(struct iwl_priv *priv)
        if (priv->current_ht_config.is_ht)
                iwl4965_set_rxon_ht(priv, &priv->current_ht_config);
 #endif /* CONFIG_IWL4965_HT*/
-       iwl4965_set_rxon_chain(priv);
+       iwl_set_rxon_chain(priv);
        priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
 
        IWL_DEBUG_ASSOC("assoc id %d beacon interval %d\n",
@@ -6152,7 +5848,7 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
                priv->staging_rxon.flags = 0;
 #endif /* CONFIG_IWL4965_HT */
 
-       iwlcore_set_rxon_channel(priv, conf->channel->band,
+       iwl_set_rxon_channel(priv, conf->channel->band,
                ieee80211_frequency_to_channel(conf->channel->center_freq));
 
        iwl4965_set_flags_for_phymode(priv, conf->channel->band);
@@ -6224,7 +5920,7 @@ static void iwl4965_config_ap(struct iwl_priv *priv)
                        IWL_WARNING("REPLY_RXON_TIMING failed - "
                                        "Attempting to continue.\n");
 
-               iwl4965_set_rxon_chain(priv);
+               iwl_set_rxon_chain(priv);
 
                /* FIXME: what should be the assoc_id for AP? */
                priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
@@ -6436,7 +6132,7 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
        if (changes & BSS_CHANGED_HT) {
                IWL_DEBUG_MAC80211("HT %d\n", bss_conf->assoc_ht);
                iwl4965_ht_conf(priv, bss_conf);
-               iwl4965_set_rxon_chain(priv);
+               iwl_set_rxon_chain(priv);
        }
 
        if (changes & BSS_CHANGED_ASSOC) {
@@ -6642,7 +6338,7 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        return ret;
 }
 
-static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, int queue,
+static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
                           const struct ieee80211_tx_queue_params *params)
 {
        struct iwl_priv *priv = hw->priv;
@@ -6716,9 +6412,9 @@ static int iwl4965_mac_get_tx_stats(struct ieee80211_hw *hw,
                q = &txq->q;
                avail = iwl4965_queue_space(q);
 
-               stats->data[i].len = q->n_window - avail;
-               stats->data[i].limit = q->n_window - q->high_mark;
-               stats->data[i].count = q->n_window;
+               stats[i].len = q->n_window - avail;
+               stats[i].limit = q->n_window - q->high_mark;
+               stats[i].count = q->n_window;
 
        }
        spin_unlock_irqrestore(&priv->lock, flags);
@@ -6760,7 +6456,7 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
        spin_unlock_irqrestore(&priv->lock, flags);
 #endif /* CONFIG_IWL4965_HT */
 
-       iwlcore_reset_qos(priv);
+       iwl_reset_qos(priv);
 
        cancel_delayed_work(&priv->post_associate);
 
@@ -6847,7 +6543,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
        IWL_DEBUG_MAC80211("leave\n");
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       iwlcore_reset_qos(priv);
+       iwl_reset_qos(priv);
 
        queue_work(priv->workqueue, &priv->post_associate.work);
 
@@ -7503,7 +7199,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
 
        err = iwl_setup(priv);
        if (err)
-               goto out_unset_hw_params;
+               goto out_free_eeprom;
        /* At this point both hw and priv are initialized. */
 
        /**********************************
@@ -7529,7 +7225,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
        err = sysfs_create_group(&pdev->dev.kobj, &iwl4965_attribute_group);
        if (err) {
                IWL_ERROR("failed to create sysfs device attributes\n");
-               goto out_unset_hw_params;
+               goto out_free_eeprom;
        }
 
        err = iwl_dbgfs_register(priv, DRV_NAME);
@@ -7553,8 +7249,6 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
 
  out_remove_sysfs:
        sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group);
- out_unset_hw_params:
-       iwl4965_unset_hw_params(priv);
  out_free_eeprom:
        iwl_eeprom_free(priv);
  out_iounmap:
@@ -7618,7 +7312,6 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev)
                iwl4965_rx_queue_free(priv, &priv->rxq);
        iwl4965_hw_txq_ctx_free(priv);
 
-       iwl4965_unset_hw_params(priv);
        iwlcore_clear_stations_table(priv);
        iwl_eeprom_free(priv);
 
@@ -7638,7 +7331,7 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev)
        pci_set_drvdata(pdev, NULL);
 
        iwl_free_channel_map(priv);
-       iwl4965_free_geos(priv);
+       iwlcore_free_geos(priv);
 
        if (priv->ibss_beacon)
                dev_kfree_skb(priv->ibss_beacon);
@@ -7688,6 +7381,11 @@ static int iwl4965_pci_resume(struct pci_dev *pdev)
 static struct pci_device_id iwl_hw_card_ids[] = {
        {IWL_PCI_DEVICE(0x4229, PCI_ANY_ID, iwl4965_agn_cfg)},
        {IWL_PCI_DEVICE(0x4230, PCI_ANY_ID, iwl4965_agn_cfg)},
+#ifdef CONFIG_IWL5000
+       {IWL_PCI_DEVICE(0x4235, PCI_ANY_ID, iwl5300_agn_cfg)},
+       {IWL_PCI_DEVICE(0x4232, PCI_ANY_ID, iwl5100_agn_cfg)},
+       {IWL_PCI_DEVICE(0x423A, PCI_ANY_ID, iwl5350_agn_cfg)},
+#endif /* CONFIG_IWL5000 */
        {0}
 };
 MODULE_DEVICE_TABLE(pci, iwl_hw_card_ids);
This page took 0.04448 seconds and 5 git commands to generate.