]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/iwlwifi/iwl4965-base.c
iwlwifi: fix various spelling and typos
[linux-2.6] / drivers / net / wireless / iwlwifi / iwl4965-base.c
index 8f85564ec6fa4b7e0eac18476d661b5d74534e71..1fe05402080c60ddb3ad9800caec353cdcc7359a 100644 (file)
@@ -286,7 +286,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;
                }
@@ -322,7 +322,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;
@@ -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)
                }
 
 
-       /* 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);
@@ -970,7 +970,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
@@ -1073,7 +1073,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.
@@ -2224,7 +2224,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:
@@ -2516,7 +2516,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)
 {
@@ -2787,7 +2787,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;
        }
 }
@@ -4210,7 +4210,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)
@@ -4368,12 +4368,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)
 {
@@ -5059,8 +5059,10 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
                 *   when we loaded driver, and is now set to "enable".
                 * After we're Alive, RF_KILL gets handled by
                 *   iwl_rx_card_state_notif() */
-               if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status))
+               if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status)) {
+                       clear_bit(STATUS_RF_KILL_HW, &priv->status);
                        queue_work(priv->workqueue, &priv->restart);
+               }
 
                handled |= CSR_INT_BIT_RF_KILL;
        }
@@ -6413,7 +6415,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.
  *
@@ -6527,6 +6529,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
                mutex_lock(&priv->mutex);
 
                if (rc) {
+                       iwl_rate_control_unregister(priv->hw);
                        IWL_ERROR("Failed to register network "
                                  "device (error %d)\n", rc);
                        return;
@@ -6598,8 +6601,6 @@ static void __iwl_down(struct iwl_priv *priv)
        /* Unblock any waiting calls */
        wake_up_interruptible_all(&priv->wait_command_queue);
 
-       iwl_cancel_deferred_work(priv);
-
        /* Wipe out the EXIT_PENDING status bit if we are not actually
         * exiting the module */
        if (!exit_pending)
@@ -6674,6 +6675,8 @@ static void iwl_down(struct iwl_priv *priv)
        mutex_lock(&priv->mutex);
        __iwl_down(priv);
        mutex_unlock(&priv->mutex);
+
+       iwl_cancel_deferred_work(priv);
 }
 
 #define MAX_HW_RESTARTS 5
@@ -6695,6 +6698,11 @@ static int __iwl_up(struct iwl_priv *priv)
                return 0;
        }
 
+       if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
+               IWL_ERROR("ucode not available for device bringup\n");
+               return -EIO;
+       }
+
        iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
 
        rc = iwl_hw_nic_init(priv);
@@ -7060,7 +7068,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);
 }
@@ -7378,7 +7386,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");
@@ -7662,6 +7670,29 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
        IWL_DEBUG_MAC80211("leave\n");
 
 }
+static void iwl_mac_erp_ie_changed(struct ieee80211_hw *hw,
+               u8 changes, int cts_protection, int preamble)
+{
+
+       struct iwl_priv *priv = hw->priv;
+
+       if (changes & IEEE80211_ERP_CHANGE_PREAMBLE) {
+               if (preamble == WLAN_ERP_PREAMBLE_SHORT)
+                       priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
+               else
+                       priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
+       }
+
+       if (changes & IEEE80211_ERP_CHANGE_PROTECTION) {
+               if (cts_protection)
+                       priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK;
+               else
+                       priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
+       }
+
+       if (iwl_is_associated(priv))
+               iwl_send_rxon_assoc(priv);
+}
 
 #define IWL_DELAY_NEXT_SCAN (HZ*2)
 static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
@@ -8921,6 +8952,7 @@ static struct ieee80211_ops iwl_hw_ops = {
        .get_tsf = iwl_mac_get_tsf,
        .reset_tsf = iwl_mac_reset_tsf,
        .beacon_update = iwl_mac_beacon_update,
+       .erp_ie_changed = iwl_mac_erp_ie_changed,
 #ifdef CONFIG_IWLWIFI_HT
        .conf_ht = iwl_mac_conf_ht,
        .get_ht_capab = iwl_mac_get_ht_capab,
@@ -9127,7 +9159,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);
 
@@ -9171,10 +9203,9 @@ static void iwl_pci_remove(struct pci_dev *pdev)
 
        IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n");
 
-       mutex_lock(&priv->mutex);
        set_bit(STATUS_EXIT_PENDING, &priv->status);
-       __iwl_down(priv);
-       mutex_unlock(&priv->mutex);
+
+       iwl_down(priv);
 
        /* Free MAC hash list for ADHOC */
        for (i = 0; i < IWL_IBSS_MAC_HASH_SIZE; i++) {
@@ -9233,12 +9264,10 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct iwl_priv *priv = pci_get_drvdata(pdev);
 
-       mutex_lock(&priv->mutex);
-
        set_bit(STATUS_IN_SUSPEND, &priv->status);
 
        /* Take down the device; powers it off, etc. */
-       __iwl_down(priv);
+       iwl_down(priv);
 
        if (priv->mac80211_registered)
                ieee80211_stop_queues(priv->hw);
@@ -9247,8 +9276,6 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
        pci_disable_device(pdev);
        pci_set_power_state(pdev, PCI_D3hot);
 
-       mutex_unlock(&priv->mutex);
-
        return 0;
 }
 
@@ -9306,8 +9333,6 @@ static int iwl_pci_resume(struct pci_dev *pdev)
 
        printk(KERN_INFO "Coming out of suspend...\n");
 
-       mutex_lock(&priv->mutex);
-
        pci_set_power_state(pdev, PCI_D0);
        err = pci_enable_device(pdev);
        pci_restore_state(pdev);
@@ -9321,7 +9346,6 @@ static int iwl_pci_resume(struct pci_dev *pdev)
        pci_write_config_byte(pdev, 0x41, 0x00);
 
        iwl_resume(priv);
-       mutex_unlock(&priv->mutex);
 
        return 0;
 }