mac80211/drivers: rewrite the rate control API
[pandora-kernel.git] / drivers / net / wireless / iwlwifi / iwl-4965.c
index 23fed32..222c2ba 100644 (file)
@@ -399,7 +399,7 @@ static void iwl4965_nic_config(struct iwl_priv *priv)
        unsigned long flags;
        u32 val;
        u16 radio_cfg;
-       u8 val_link;
+       u16 link;
 
        spin_lock_irqsave(&priv->lock, flags);
 
@@ -410,10 +410,10 @@ static void iwl4965_nic_config(struct iwl_priv *priv)
                                       val & ~(1 << 11));
        }
 
-       pci_read_config_byte(priv->pci_dev, PCI_LINK_CTRL, &val_link);
+       pci_read_config_word(priv->pci_dev, PCI_CFG_LINK_CTRL, &link);
 
        /* L1 is enabled by BIOS */
-       if ((val_link & PCI_LINK_VAL_L1_EN) == PCI_LINK_VAL_L1_EN)
+       if ((link & PCI_CFG_LINK_CTRL_VAL_L1_EN) == PCI_CFG_LINK_CTRL_VAL_L1_EN)
                /* diable L0S disabled L1A enabled */
                iwl_set_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED);
        else
@@ -619,10 +619,10 @@ static void iwl4965_gain_computation(struct iwl_priv *priv,
 static void iwl4965_rts_tx_cmd_flag(struct ieee80211_tx_info *info,
                        __le32 *tx_flags)
 {
-       if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) {
+       if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) {
                *tx_flags |= TX_CMD_FLG_RTS_MSK;
                *tx_flags &= ~TX_CMD_FLG_CTS_MSK;
-       } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) {
+       } else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
                *tx_flags &= ~TX_CMD_FLG_RTS_MSK;
                *tx_flags |= TX_CMD_FLG_CTS_MSK;
        }
@@ -1607,8 +1607,8 @@ static int iwl4965_send_rxon_assoc(struct iwl_priv *priv)
        return ret;
 }
 
-
-int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel)
+#ifdef IEEE80211_CONF_CHANNEL_SWITCH
+static int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel)
 {
        int rc;
        u8 band = 0;
@@ -1648,6 +1648,7 @@ int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel)
        rc = iwl_send_cmd_pdu(priv, REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd);
        return rc;
 }
+#endif
 
 static int iwl4965_shared_mem_rx_idx(struct iwl_priv *priv)
 {
@@ -2069,7 +2070,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
                                   agg->frame_count, agg->start_idx, idx);
 
                info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
-               info->status.retry_count = tx_resp->failure_frame;
+               info->status.rates[0].count = tx_resp->failure_frame + 1;
                info->flags &= ~IEEE80211_TX_CTL_AMPDU;
                info->flags |= iwl_is_tx_success(status)?
                        IEEE80211_TX_STAT_ACK : 0;
@@ -2226,7 +2227,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
                        iwl_txq_check_empty(priv, sta_id, tid, txq_id);
                }
        } else {
-               info->status.retry_count = tx_resp->failure_frame;
+               info->status.rates[0].count = tx_resp->failure_frame + 1;
                info->flags |=
                        iwl_is_tx_success(status) ? IEEE80211_TX_STAT_ACK : 0;
                iwl_hwrate_to_tx_control(priv,