iwlwifi: use station HT capabilities and BSS operating mode for Green-field
[pandora-kernel.git] / drivers / net / wireless / iwlwifi / iwl-3945.c
index 14a47c0..b5a4d2e 100644 (file)
@@ -509,7 +509,7 @@ static void iwl3945_dbg_report_frame(struct iwl_priv *priv,
                      struct iwl_rx_packet *pkt,
                      struct ieee80211_hdr *header, int group100)
 {
-       if (priv->debug_level & IWL_DL_RX)
+       if (iwl_get_debug_level(priv) & IWL_DL_RX)
                _iwl3945_dbg_report_frame(priv, pkt, header, group100);
 }
 
@@ -544,9 +544,7 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv,
                                   struct ieee80211_rx_status *stats)
 {
        struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
-#ifdef CONFIG_IWLWIFI_LEDS
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)IWL_RX_DATA(pkt);
-#endif
        struct iwl3945_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
        struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt);
        short len = le16_to_cpu(rx_hdr->len);
@@ -577,6 +575,8 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv,
        if (ieee80211_is_data(hdr->frame_control))
                priv->rxtxpackets += len;
 #endif
+       iwl_update_stats(priv, false, hdr->frame_control, len);
+
        memcpy(IEEE80211_SKB_RXCB(rxb->skb), stats, sizeof(*stats));
        ieee80211_rx_irqsafe(priv->hw, rxb->skb);
        rxb->skb = NULL;
@@ -679,6 +679,7 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
 
        /* Set "1" to report good data frames in groups of 100 */
        iwl3945_dbg_report_frame(priv, pkt, header, 1);
+       iwl_dbg_log_rx_data_frame(priv, le16_to_cpu(rx_hdr->len), header);
 
        if (network_packet) {
                priv->last_beacon_time = le32_to_cpu(rx_end->beacon_timestamp);
@@ -749,8 +750,8 @@ void iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
        /* Unmap tx_cmd */
        if (counter)
                pci_unmap_single(dev,
-                               pci_unmap_addr(&txq->cmd[index]->meta, mapping),
-                               pci_unmap_len(&txq->cmd[index]->meta, len),
+                               pci_unmap_addr(&txq->meta[index], mapping),
+                               pci_unmap_len(&txq->meta[index], len),
                                PCI_DMA_TODEVICE);
 
        /* unmap chunks if any */
@@ -774,9 +775,11 @@ void iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
  * iwl3945_hw_build_tx_cmd_rate - Add rate portion to TX_CMD:
  *
 */
-void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct iwl_cmd *cmd,
-                             struct ieee80211_tx_info *info,
-                             struct ieee80211_hdr *hdr, int sta_id, int tx_id)
+void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv,
+                                 struct iwl_device_cmd *cmd,
+                                 struct ieee80211_tx_info *info,
+                                 struct ieee80211_hdr *hdr,
+                                 int sta_id, int tx_id)
 {
        u16 hw_value = ieee80211_get_tx_rate(priv->hw, info)->hw_value;
        u16 rate_index = min(hw_value & 0xffff, IWL_RATE_COUNT - 1);
@@ -1858,7 +1861,7 @@ static int iwl3945_send_rxon_assoc(struct iwl_priv *priv)
        struct iwl_host_cmd cmd = {
                .id = REPLY_RXON_ASSOC,
                .len = sizeof(rxon_assoc),
-               .meta.flags = CMD_WANT_SKB,
+               .flags = CMD_WANT_SKB,
                .data = &rxon_assoc,
        };
        const struct iwl_rxon_cmd *rxon1 = &priv->staging_rxon;
@@ -1882,14 +1885,14 @@ static int iwl3945_send_rxon_assoc(struct iwl_priv *priv)
        if (rc)
                return rc;
 
-       res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
+       res = (struct iwl_rx_packet *)cmd.reply_skb->data;
        if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
                IWL_ERR(priv, "Bad return from REPLY_RXON_ASSOC command\n");
                rc = -EIO;
        }
 
        priv->alloc_rxb_skb--;
-       dev_kfree_skb_any(cmd.meta.u.skb);
+       dev_kfree_skb_any(cmd.reply_skb);
 
        return rc;
 }
@@ -2849,8 +2852,8 @@ static struct iwl_lib_ops iwl3945_lib = {
                        EEPROM_REGULATORY_BAND_3_CHANNELS,
                        EEPROM_REGULATORY_BAND_4_CHANNELS,
                        EEPROM_REGULATORY_BAND_5_CHANNELS,
-                       EEPROM_REGULATORY_BAND_NO_FAT,
-                       EEPROM_REGULATORY_BAND_NO_FAT,
+                       EEPROM_REGULATORY_BAND_NO_HT40,
+                       EEPROM_REGULATORY_BAND_NO_HT40,
                },
                .verify_signature  = iwlcore_eeprom_verify_signature,
                .acquire_semaphore = iwl3945_eeprom_acquire_semaphore,
@@ -2886,7 +2889,8 @@ static struct iwl_cfg iwl3945_bg_cfg = {
        .eeprom_ver = EEPROM_3945_EEPROM_VERSION,
        .ops = &iwl3945_ops,
        .mod_params = &iwl3945_mod_params,
-       .use_isr_legacy = true
+       .use_isr_legacy = true,
+       .ht_greenfield_support = false,
 };
 
 static struct iwl_cfg iwl3945_abg_cfg = {
@@ -2899,7 +2903,8 @@ static struct iwl_cfg iwl3945_abg_cfg = {
        .eeprom_ver = EEPROM_3945_EEPROM_VERSION,
        .ops = &iwl3945_ops,
        .mod_params = &iwl3945_mod_params,
-       .use_isr_legacy = true
+       .use_isr_legacy = true,
+       .ht_greenfield_support = false,
 };
 
 struct pci_device_id iwl3945_hw_card_ids[] = {