iwlwifi: remove cck_flag from iwl_driver_hw_info
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl3945-base.c
index 0b3ec7e4d93b30e4a78d7f5f674aafb4ba69a462..125d99e9476e23aa36c3928d41513f81b491bbbd 100644 (file)
@@ -209,9 +209,9 @@ static void iwl_print_hex_dump(int level, void *p, u32 len)
 
 static int iwl_queue_space(const struct iwl_queue *q)
 {
-       int s = q->last_used - q->first_empty;
+       int s = q->read_ptr - q->write_ptr;
 
-       if (q->last_used > q->first_empty)
+       if (q->read_ptr > q->write_ptr)
                s -= q->n_bd;
 
        if (s <= 0)
@@ -237,9 +237,9 @@ static inline int iwl_queue_dec_wrap(int index, int n_bd)
 
 static inline int x2_queue_used(const struct iwl_queue *q, int i)
 {
-       return q->first_empty > q->last_used ?
-               (i >= q->last_used && i < q->first_empty) :
-               !(i < q->last_used && i >= q->first_empty);
+       return q->write_ptr > q->read_ptr ?
+               (i >= q->read_ptr && i < q->write_ptr) :
+               !(i < q->read_ptr && i >= q->write_ptr);
 }
 
 static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge)
@@ -273,7 +273,7 @@ static int iwl_queue_init(struct iwl_priv *priv, struct iwl_queue *q,
        if (q->high_mark < 2)
                q->high_mark = 2;
 
-       q->first_empty = q->last_used = 0;
+       q->write_ptr = q->read_ptr = 0;
 
        return 0;
 }
@@ -287,7 +287,7 @@ static int iwl_tx_queue_alloc(struct iwl_priv *priv,
                txq->txb = kmalloc(sizeof(txq->txb[0]) *
                                   TFD_QUEUE_SIZE_MAX, GFP_KERNEL);
                if (!txq->txb) {
-                       IWL_ERROR("kmalloc for auxilary BD "
+                       IWL_ERROR("kmalloc for auxiliary BD "
                                  "structures failed\n");
                        goto error;
                }
@@ -323,7 +323,7 @@ int iwl_tx_queue_init(struct iwl_priv *priv,
        int len;
        int rc = 0;
 
-       /* alocate command space + one big command for scan since scan
+       /* allocate command space + one big command for scan since scan
         * command is very huge the system will not have two scan at the
         * same time */
        len = sizeof(struct iwl_cmd) * slots_num;
@@ -369,8 +369,8 @@ void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq)
                return;
 
        /* first, empty all BD's */
-       for (; q->first_empty != q->last_used;
-            q->last_used = iwl_queue_inc_wrap(q->last_used, q->n_bd))
+       for (; q->write_ptr != q->read_ptr;
+            q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd))
                iwl_hw_txq_free_tfd(priv, txq);
 
        len = sizeof(struct iwl_cmd) * q->n_window;
@@ -405,7 +405,7 @@ const u8 BROADCAST_ADDR[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
  */
 
 /**************************************************************/
-#if 0 /* temparary disable till we add real remove station */
+#if 0 /* temporary disable till we add real remove station */
 static u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
 {
        int index = IWL_INVALID_STATION;
@@ -482,7 +482,7 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
                                index = i;
                }
 
-       /* These twh conditions has the same outcome but keep them separate
+       /* These two conditions has the same outcome but keep them separate
          since they have different meaning */
        if (unlikely(index == IWL_INVALID_STATION)) {
                spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
@@ -506,8 +506,10 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
        station->sta.sta.sta_id = index;
        station->sta.station_flags = 0;
 
-       rate = (priv->phymode == MODE_IEEE80211A) ? IWL_RATE_6M_PLCP :
-                               IWL_RATE_1M_PLCP | priv->hw_setting.cck_flag;
+       if (priv->phymode == MODE_IEEE80211A)
+               rate = IWL_RATE_6M_PLCP;
+       else
+               rate =  IWL_RATE_1M_PLCP;
 
        /* Turn on both antennas for the station... */
        station->sta.rate_n_flags =
@@ -649,12 +651,12 @@ static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 
        spin_lock_irqsave(&priv->hcmd_lock, flags);
 
-       tfd = &txq->bd[q->first_empty];
+       tfd = &txq->bd[q->write_ptr];
        memset(tfd, 0, sizeof(*tfd));
 
        control_flags = (u32 *) tfd;
 
-       idx = get_cmd_index(q, q->first_empty, cmd->meta.flags & CMD_SIZE_HUGE);
+       idx = get_cmd_index(q, q->write_ptr, cmd->meta.flags & CMD_SIZE_HUGE);
        out_cmd = &txq->cmd[idx];
 
        out_cmd->hdr.cmd = cmd->id;
@@ -666,7 +668,7 @@ static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 
        out_cmd->hdr.flags = 0;
        out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(IWL_CMD_QUEUE_NUM) |
-                       INDEX_TO_SEQ(q->first_empty));
+                       INDEX_TO_SEQ(q->write_ptr));
        if (out_cmd->meta.flags & CMD_SIZE_HUGE)
                out_cmd->hdr.sequence |= cpu_to_le16(SEQ_HUGE_FRAME);
 
@@ -682,10 +684,10 @@ static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
                     "%d bytes at %d[%d]:%d\n",
                     get_cmd_string(out_cmd->hdr.cmd),
                     out_cmd->hdr.cmd, le16_to_cpu(out_cmd->hdr.sequence),
-                    fix_size, q->first_empty, idx, IWL_CMD_QUEUE_NUM);
+                    fix_size, q->write_ptr, idx, IWL_CMD_QUEUE_NUM);
 
        txq->need_update = 1;
-       q->first_empty = iwl_queue_inc_wrap(q->first_empty, q->n_bd);
+       q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd);
        ret = iwl_tx_queue_update_write_ptr(priv, txq);
 
        spin_unlock_irqrestore(&priv->hcmd_lock, flags);
@@ -959,7 +961,7 @@ static int iwl_check_rxon_cmd(struct iwl_rxon_cmd *rxon)
 
 /**
  * iwl_full_rxon_required - determine if RXON_ASSOC can be used in RXON commit
- * @priv: staging_rxon is comapred to active_rxon
+ * @priv: staging_rxon is compared to active_rxon
  *
  * If the RXON structure is changing sufficient to require a new
  * tune or to clear and reset the RXON_FILTER_ASSOC_MSK then return 1
@@ -1047,7 +1049,7 @@ static int iwl_send_rxon_assoc(struct iwl_priv *priv)
 /**
  * iwl_commit_rxon - commit staging_rxon to hardware
  *
- * The RXON command in staging_rxon is commited to the hardware and
+ * The RXON command in staging_rxon is committed to the hardware and
  * the active_rxon structure is updated with the new data.  This
  * function correctly transitions out of the RXON_ASSOC_MSK state if
  * a HW tune is required based on the RXON structure changes.
@@ -1553,9 +1555,9 @@ int iwl_eeprom_init(struct iwl_priv *priv)
                return -ENOENT;
        }
 
-       rc = iwl_eeprom_aqcuire_semaphore(priv);
+       rc = iwl_eeprom_acquire_semaphore(priv);
        if (rc < 0) {
-               IWL_ERROR("Failed to aqcuire EEPROM semaphore.\n");
+               IWL_ERROR("Failed to acquire EEPROM semaphore.\n");
                return -ENOENT;
        }
 
@@ -2150,7 +2152,7 @@ static int iwl_send_power_mode(struct iwl_priv *priv, u32 mode)
        struct iwl_powertable_cmd cmd;
 
        /* If on battery, set to 3,
-        * if plugged into AC power, set to CAM ("continuosly aware mode"),
+        * if plugged into AC power, set to CAM ("continuously aware mode"),
         * else user level */
        switch (mode) {
        case IWL_POWER_BATTERY:
@@ -2440,7 +2442,7 @@ static void iwl_set_flags_for_phymode(struct iwl_priv *priv, u8 phymode)
 }
 
 /*
- * initilize rxon structure with default values fromm eeprom
+ * initialize rxon structure with default values from eeprom
  */
 static void iwl_connection_init_rx_config(struct iwl_priv *priv)
 {
@@ -2704,7 +2706,7 @@ static int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
                return priv->hw_setting.bcast_sta_id;
        }
        default:
-               IWL_WARNING("Unkown mode of operation: %d", priv->iw_mode);
+               IWL_WARNING("Unknown mode of operation: %d", priv->iw_mode);
                return priv->hw_setting.bcast_sta_id;
        }
 }
@@ -2799,21 +2801,21 @@ static int iwl_tx_skb(struct iwl_priv *priv,
 
        spin_lock_irqsave(&priv->lock, flags);
 
-       tfd = &txq->bd[q->first_empty];
+       tfd = &txq->bd[q->write_ptr];
        memset(tfd, 0, sizeof(*tfd));
        control_flags = (u32 *) tfd;
-       idx = get_cmd_index(q, q->first_empty, 0);
+       idx = get_cmd_index(q, q->write_ptr, 0);
 
-       memset(&(txq->txb[q->first_empty]), 0, sizeof(struct iwl_tx_info));
-       txq->txb[q->first_empty].skb[0] = skb;
-       memcpy(&(txq->txb[q->first_empty].status.control),
+       memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info));
+       txq->txb[q->write_ptr].skb[0] = skb;
+       memcpy(&(txq->txb[q->write_ptr].status.control),
               ctl, sizeof(struct ieee80211_tx_control));
        out_cmd = &txq->cmd[idx];
        memset(&out_cmd->hdr, 0, sizeof(out_cmd->hdr));
        memset(&out_cmd->cmd.tx, 0, sizeof(out_cmd->cmd.tx));
        out_cmd->hdr.cmd = REPLY_TX;
        out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) |
-                               INDEX_TO_SEQ(q->first_empty)));
+                               INDEX_TO_SEQ(q->write_ptr)));
        /* copy frags header */
        memcpy(out_cmd->cmd.tx.hdr, hdr, hdr_len);
 
@@ -2881,7 +2883,7 @@ static int iwl_tx_skb(struct iwl_priv *priv,
        iwl_print_hex_dump(IWL_DL_TX, (u8 *)out_cmd->cmd.tx.hdr,
                           ieee80211_get_hdrlen(fc));
 
-       q->first_empty = iwl_queue_inc_wrap(q->first_empty, q->n_bd);
+       q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd);
        rc = iwl_tx_queue_update_write_ptr(priv, txq);
        spin_unlock_irqrestore(&priv->lock, flags);
 
@@ -3375,20 +3377,20 @@ int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
        if ((index >= q->n_bd) || (x2_queue_used(q, index) == 0)) {
                IWL_ERROR("Read index for DMA queue txq id (%d), index %d, "
                          "is out of range [0-%d] %d %d.\n", txq_id,
-                         index, q->n_bd, q->first_empty, q->last_used);
+                         index, q->n_bd, q->write_ptr, q->read_ptr);
                return 0;
        }
 
        for (index = iwl_queue_inc_wrap(index, q->n_bd);
-               q->last_used != index;
-               q->last_used = iwl_queue_inc_wrap(q->last_used, q->n_bd)) {
+               q->read_ptr != index;
+               q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
                if (txq_id != IWL_CMD_QUEUE_NUM) {
                        iwl_txstatus_to_ieee(priv,
-                                       &(txq->txb[txq->q.last_used]));
+                                       &(txq->txb[txq->q.read_ptr]));
                        iwl_hw_txq_free_tfd(priv, txq);
                } else if (nfreed > 1) {
                        IWL_ERROR("HCMD skipped: index (%d) %d %d\n", index,
-                                       q->first_empty, q->last_used);
+                                       q->write_ptr, q->read_ptr);
                        queue_work(priv->workqueue, &priv->restart);
                }
                nfreed++;
@@ -3428,12 +3430,12 @@ static void iwl_rx_reply_tx(struct iwl_priv *priv,
        if ((index >= txq->q.n_bd) || (x2_queue_used(&txq->q, index) == 0)) {
                IWL_ERROR("Read index for DMA queue txq_id (%d) index %d "
                          "is out of range [0-%d] %d %d\n", txq_id,
-                         index, txq->q.n_bd, txq->q.first_empty,
-                         txq->q.last_used);
+                         index, txq->q.n_bd, txq->q.write_ptr,
+                         txq->q.read_ptr);
                return;
        }
 
-       tx_status = &(txq->txb[txq->q.last_used].status);
+       tx_status = &(txq->txb[txq->q.read_ptr].status);
 
        tx_status->retry_count = tx_resp->failure_frame;
        tx_status->queue_number = status;
@@ -3890,7 +3892,7 @@ static void iwl_tx_cmd_complete(struct iwl_priv *priv,
  * The management in the driver is as follows:
  * + A list of pre-allocated SKBs is stored in iwl->rxq->rx_free.  When
  *   iwl->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled
- *   to replensish the iwl->rxq->rx_free.
+ *   to replenish the iwl->rxq->rx_free.
  * + In iwl_rx_replenish (scheduled) if 'processed' != 'read' then the
  *   iwl->rxq is replenished and the READ INDEX is updated (updating the
  *   'processed' and 'read' driver indexes as well)
@@ -4047,12 +4049,12 @@ int iwl_rx_queue_restock(struct iwl_priv *priv)
 }
 
 /**
- * iwl_rx_replensih - Move all used packet from rx_used to rx_free
+ * iwl_rx_replenish - Move all used packet from rx_used to rx_free
  *
  * When moving to rx_free an SKB is allocated for the slot.
  *
  * Also restock the Rx queue via iwl_rx_queue_restock.
- * This is called as a scheduled work item (except for during intialization)
+ * This is called as a scheduled work item (except for during initialization)
  */
 void iwl_rx_replenish(void *data)
 {
@@ -4368,14 +4370,14 @@ int iwl_tx_queue_update_write_ptr(struct iwl_priv *priv,
                if (rc)
                        return rc;
                iwl_write_restricted(priv, HBUS_TARG_WRPTR,
-                                    txq->q.first_empty | (txq_id << 8));
+                                    txq->q.write_ptr | (txq_id << 8));
                iwl_release_restricted_access(priv);
 
        /* else not in power-save mode, uCode will never sleep when we're
         * trying to tx (during RFKILL, we're not trying to tx). */
        } else
                iwl_write32(priv, HBUS_TARG_WRPTR,
-                           txq->q.first_empty | (txq_id << 8));
+                           txq->q.write_ptr | (txq_id << 8));
 
        txq->need_update = 0;
 
@@ -6042,7 +6044,7 @@ static int iwl_set_ucode_ptrs(struct iwl_priv *priv)
 }
 
 /**
- * iwl_init_alive_start - Called after REPLY_ALIVE notification receieved
+ * iwl_init_alive_start - Called after REPLY_ALIVE notification received
  *
  * Called after REPLY_ALIVE notification received from "initialize" uCode.
  *
@@ -6693,7 +6695,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
        return;
 
  done:
-       /* inform mac80211 sacn aborted */
+       /* inform mac80211 scan aborted */
        queue_work(priv->workqueue, &priv->scan_completed);
        mutex_unlock(&priv->mutex);
 }
@@ -6997,7 +6999,7 @@ static int iwl_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
        }
 
        /* TODO: Figure out how to get ieee80211_local->sta_scanning w/ only
-        * what is exposed through include/ declrations */
+        * what is exposed through include/ declarations */
        if (unlikely(!iwl_param_disable_hw_scan &&
                     test_bit(STATUS_SCANNING, &priv->status))) {
                IWL_DEBUG_MAC80211("leave - scanning\n");
@@ -8541,7 +8543,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        mutex_unlock(&priv->mutex);
 
-       IWL_DEBUG_INFO("Queing UP work.\n");
+       IWL_DEBUG_INFO("Queueing UP work.\n");
 
        queue_work(priv->workqueue, &priv->up);
 
This page took 0.031556 seconds and 5 git commands to generate.