diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 62 |
1 files changed, 21 insertions, 41 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index aee7014bcb94..84414da0bdeb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2819,7 +2819,6 @@ void iwl4965_rx_reply_rx(struct iwl_priv *priv, | |||
2819 | break; | 2819 | break; |
2820 | 2820 | ||
2821 | case IEEE80211_FTYPE_CTL: | 2821 | case IEEE80211_FTYPE_CTL: |
2822 | #ifdef CONFIG_IWL4965_HT | ||
2823 | switch (fc & IEEE80211_FCTL_STYPE) { | 2822 | switch (fc & IEEE80211_FCTL_STYPE) { |
2824 | case IEEE80211_STYPE_BACK_REQ: | 2823 | case IEEE80211_STYPE_BACK_REQ: |
2825 | IWL_DEBUG_HT("IEEE80211_STYPE_BACK_REQ arrived\n"); | 2824 | IWL_DEBUG_HT("IEEE80211_STYPE_BACK_REQ arrived\n"); |
@@ -2829,7 +2828,6 @@ void iwl4965_rx_reply_rx(struct iwl_priv *priv, | |||
2829 | default: | 2828 | default: |
2830 | break; | 2829 | break; |
2831 | } | 2830 | } |
2832 | #endif | ||
2833 | break; | 2831 | break; |
2834 | 2832 | ||
2835 | case IEEE80211_FTYPE_DATA: { | 2833 | case IEEE80211_FTYPE_DATA: { |
@@ -2863,8 +2861,6 @@ void iwl4965_rx_reply_rx(struct iwl_priv *priv, | |||
2863 | } | 2861 | } |
2864 | } | 2862 | } |
2865 | 2863 | ||
2866 | #ifdef CONFIG_IWL4965_HT | ||
2867 | |||
2868 | /** | 2864 | /** |
2869 | * iwl4965_tx_status_reply_compressed_ba - Update tx status from block-ack | 2865 | * iwl4965_tx_status_reply_compressed_ba - Update tx status from block-ack |
2870 | * | 2866 | * |
@@ -3154,10 +3150,6 @@ static int iwl4965_txq_agg_enable(struct iwl_priv *priv, int txq_id, | |||
3154 | return 0; | 3150 | return 0; |
3155 | } | 3151 | } |
3156 | 3152 | ||
3157 | #endif /* CONFIG_IWL4965_HT */ | ||
3158 | |||
3159 | |||
3160 | #ifdef CONFIG_IWL4965_HT | ||
3161 | static int iwl4965_rx_agg_start(struct iwl_priv *priv, | 3153 | static int iwl4965_rx_agg_start(struct iwl_priv *priv, |
3162 | const u8 *addr, int tid, u16 ssn) | 3154 | const u8 *addr, int tid, u16 ssn) |
3163 | { | 3155 | { |
@@ -3231,8 +3223,6 @@ int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, | |||
3231 | } | 3223 | } |
3232 | return 0; | 3224 | return 0; |
3233 | } | 3225 | } |
3234 | #endif /* CONFIG_IWL4965_HT */ | ||
3235 | |||
3236 | 3226 | ||
3237 | static u16 iwl4965_get_hcmd_size(u8 cmd_id, u16 len) | 3227 | static u16 iwl4965_get_hcmd_size(u8 cmd_id, u16 len) |
3238 | { | 3228 | { |
@@ -3262,7 +3252,6 @@ static u16 iwl4965_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data) | |||
3262 | return (u16)sizeof(struct iwl4965_addsta_cmd); | 3252 | return (u16)sizeof(struct iwl4965_addsta_cmd); |
3263 | } | 3253 | } |
3264 | 3254 | ||
3265 | #ifdef CONFIG_IWL4965_HT | ||
3266 | static inline u32 iwl4965_get_scd_ssn(struct iwl4965_tx_resp *tx_resp) | 3255 | static inline u32 iwl4965_get_scd_ssn(struct iwl4965_tx_resp *tx_resp) |
3267 | { | 3256 | { |
3268 | __le32 *scd_ssn = (__le32 *)((u32 *)&tx_resp->status + | 3257 | __le32 *scd_ssn = (__le32 *)((u32 *)&tx_resp->status + |
@@ -3388,7 +3377,6 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv, | |||
3388 | } | 3377 | } |
3389 | return 0; | 3378 | return 0; |
3390 | } | 3379 | } |
3391 | #endif | ||
3392 | 3380 | ||
3393 | /** | 3381 | /** |
3394 | * iwl4965_rx_reply_tx - Handle standard (non-aggregation) Tx response | 3382 | * iwl4965_rx_reply_tx - Handle standard (non-aggregation) Tx response |
@@ -3404,12 +3392,10 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
3404 | struct ieee80211_tx_info *info; | 3392 | struct ieee80211_tx_info *info; |
3405 | struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; | 3393 | struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; |
3406 | u32 status = le32_to_cpu(tx_resp->status); | 3394 | u32 status = le32_to_cpu(tx_resp->status); |
3407 | #ifdef CONFIG_IWL4965_HT | ||
3408 | int tid = MAX_TID_COUNT, sta_id = IWL_INVALID_STATION; | 3395 | int tid = MAX_TID_COUNT, sta_id = IWL_INVALID_STATION; |
3409 | u16 fc; | 3396 | u16 fc; |
3410 | struct ieee80211_hdr *hdr; | 3397 | struct ieee80211_hdr *hdr; |
3411 | u8 *qc = NULL; | 3398 | u8 *qc = NULL; |
3412 | #endif | ||
3413 | 3399 | ||
3414 | if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) { | 3400 | if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) { |
3415 | IWL_ERROR("Read index for DMA queue txq_id (%d) index %d " | 3401 | IWL_ERROR("Read index for DMA queue txq_id (%d) index %d " |
@@ -3422,7 +3408,6 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
3422 | info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]); | 3408 | info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]); |
3423 | memset(&info->status, 0, sizeof(info->status)); | 3409 | memset(&info->status, 0, sizeof(info->status)); |
3424 | 3410 | ||
3425 | #ifdef CONFIG_IWL4965_HT | ||
3426 | hdr = iwl_tx_queue_get_hdr(priv, txq_id, index); | 3411 | hdr = iwl_tx_queue_get_hdr(priv, txq_id, index); |
3427 | fc = le16_to_cpu(hdr->frame_control); | 3412 | fc = le16_to_cpu(hdr->frame_control); |
3428 | if (ieee80211_is_qos_data(fc)) { | 3413 | if (ieee80211_is_qos_data(fc)) { |
@@ -3474,32 +3459,31 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, | |||
3474 | iwl_txq_check_empty(priv, sta_id, tid, txq_id); | 3459 | iwl_txq_check_empty(priv, sta_id, tid, txq_id); |
3475 | } | 3460 | } |
3476 | } else { | 3461 | } else { |
3477 | #endif /* CONFIG_IWL4965_HT */ | 3462 | info->status.retry_count = tx_resp->failure_frame; |
3478 | 3463 | info->flags |= | |
3479 | info->status.retry_count = tx_resp->failure_frame; | 3464 | iwl_is_tx_success(status) ? IEEE80211_TX_STAT_ACK : 0; |
3480 | info->flags |= iwl_is_tx_success(status) ? IEEE80211_TX_STAT_ACK : 0; | 3465 | iwl4965_hwrate_to_tx_control(priv, |
3481 | iwl4965_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags), | 3466 | le32_to_cpu(tx_resp->rate_n_flags), |
3482 | info); | 3467 | info); |
3483 | 3468 | ||
3484 | IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) rate_n_flags 0x%x " | 3469 | IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) rate_n_flags " |
3485 | "retries %d\n", txq_id, iwl_get_tx_fail_reason(status), | 3470 | "0x%x retries %d\n", txq_id, |
3486 | status, le32_to_cpu(tx_resp->rate_n_flags), | 3471 | iwl_get_tx_fail_reason(status), |
3487 | tx_resp->failure_frame); | 3472 | status, le32_to_cpu(tx_resp->rate_n_flags), |
3488 | 3473 | tx_resp->failure_frame); | |
3489 | IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index); | 3474 | |
3490 | #ifdef CONFIG_IWL4965_HT | 3475 | IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index); |
3491 | if (index != -1) { | 3476 | if (index != -1) { |
3492 | int freed = iwl_tx_queue_reclaim(priv, txq_id, index); | 3477 | int freed = iwl_tx_queue_reclaim(priv, txq_id, index); |
3493 | if (tid != MAX_TID_COUNT) | 3478 | if (tid != MAX_TID_COUNT) |
3494 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; | 3479 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; |
3495 | if (iwl_queue_space(&txq->q) > txq->q.low_mark && | 3480 | if (iwl_queue_space(&txq->q) > txq->q.low_mark && |
3496 | (txq_id >= 0) && priv->mac80211_registered) | 3481 | (txq_id >= 0) && priv->mac80211_registered) |
3497 | ieee80211_wake_queue(priv->hw, txq_id); | 3482 | ieee80211_wake_queue(priv->hw, txq_id); |
3498 | if (tid != MAX_TID_COUNT) | 3483 | if (tid != MAX_TID_COUNT) |
3499 | iwl_txq_check_empty(priv, sta_id, tid, txq_id); | 3484 | iwl_txq_check_empty(priv, sta_id, tid, txq_id); |
3485 | } | ||
3500 | } | 3486 | } |
3501 | } | ||
3502 | #endif /* CONFIG_IWL4965_HT */ | ||
3503 | 3487 | ||
3504 | if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) | 3488 | if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) |
3505 | IWL_ERROR("TODO: Implement Tx ABORT REQUIRED!!!\n"); | 3489 | IWL_ERROR("TODO: Implement Tx ABORT REQUIRED!!!\n"); |
@@ -3513,10 +3497,8 @@ static void iwl4965_rx_handler_setup(struct iwl_priv *priv) | |||
3513 | priv->rx_handlers[REPLY_RX] = iwl4965_rx_reply_rx; | 3497 | priv->rx_handlers[REPLY_RX] = iwl4965_rx_reply_rx; |
3514 | /* Tx response */ | 3498 | /* Tx response */ |
3515 | priv->rx_handlers[REPLY_TX] = iwl4965_rx_reply_tx; | 3499 | priv->rx_handlers[REPLY_TX] = iwl4965_rx_reply_tx; |
3516 | 3500 | /* block ack */ | |
3517 | #ifdef CONFIG_IWL4965_HT | ||
3518 | priv->rx_handlers[REPLY_COMPRESSED_BA] = iwl4965_rx_reply_compressed_ba; | 3501 | priv->rx_handlers[REPLY_COMPRESSED_BA] = iwl4965_rx_reply_compressed_ba; |
3519 | #endif /* CONFIG_IWL4965_HT */ | ||
3520 | } | 3502 | } |
3521 | 3503 | ||
3522 | void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv) | 3504 | void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv) |
@@ -3558,10 +3540,8 @@ static struct iwl_lib_ops iwl4965_lib = { | |||
3558 | .shared_mem_rx_idx = iwl4965_shared_mem_rx_idx, | 3540 | .shared_mem_rx_idx = iwl4965_shared_mem_rx_idx, |
3559 | .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl, | 3541 | .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl, |
3560 | .txq_set_sched = iwl4965_txq_set_sched, | 3542 | .txq_set_sched = iwl4965_txq_set_sched, |
3561 | #ifdef CONFIG_IWL4965_HT | ||
3562 | .txq_agg_enable = iwl4965_txq_agg_enable, | 3543 | .txq_agg_enable = iwl4965_txq_agg_enable, |
3563 | .txq_agg_disable = iwl4965_txq_agg_disable, | 3544 | .txq_agg_disable = iwl4965_txq_agg_disable, |
3564 | #endif | ||
3565 | .rx_handler_setup = iwl4965_rx_handler_setup, | 3545 | .rx_handler_setup = iwl4965_rx_handler_setup, |
3566 | .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, | 3546 | .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, |
3567 | .alive_notify = iwl4965_alive_notify, | 3547 | .alive_notify = iwl4965_alive_notify, |