diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 3df70f89f11..a1e91dbb92b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -504,10 +504,10 @@ u8 iwl4965_hw_find_station(struct iwl_priv *priv, const u8 *addr) | |||
504 | start = IWL_STA_ID; | 504 | start = IWL_STA_ID; |
505 | 505 | ||
506 | if (is_broadcast_ether_addr(addr)) | 506 | if (is_broadcast_ether_addr(addr)) |
507 | return priv->hw_setting.bcast_sta_id; | 507 | return priv->hw_params.bcast_sta_id; |
508 | 508 | ||
509 | spin_lock_irqsave(&priv->sta_lock, flags); | 509 | spin_lock_irqsave(&priv->sta_lock, flags); |
510 | for (i = start; i < priv->hw_setting.max_stations; i++) | 510 | for (i = start; i < priv->hw_params.max_stations; i++) |
511 | if ((priv->stations[i].used) && | 511 | if ((priv->stations[i].used) && |
512 | (!compare_ether_addr | 512 | (!compare_ether_addr |
513 | (priv->stations[i].sta.sta.addr, addr))) { | 513 | (priv->stations[i].sta.sta.addr, addr))) { |
@@ -702,7 +702,7 @@ static int iwl4965_txq_ctx_reset(struct iwl_priv *priv) | |||
702 | 702 | ||
703 | /* Alloc and init all (default 16) Tx queues, | 703 | /* Alloc and init all (default 16) Tx queues, |
704 | * including the command queue (#4) */ | 704 | * including the command queue (#4) */ |
705 | for (txq_id = 0; txq_id < priv->hw_setting.max_txq_num; txq_id++) { | 705 | for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) { |
706 | slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ? | 706 | slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ? |
707 | TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; | 707 | TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; |
708 | rc = iwl4965_tx_queue_init(priv, &priv->txq[txq_id], slots_num, | 708 | rc = iwl4965_tx_queue_init(priv, &priv->txq[txq_id], slots_num, |
@@ -908,7 +908,7 @@ void iwl4965_hw_txq_ctx_stop(struct iwl_priv *priv) | |||
908 | unsigned long flags; | 908 | unsigned long flags; |
909 | 909 | ||
910 | /* Stop each Tx DMA channel, and wait for it to be idle */ | 910 | /* Stop each Tx DMA channel, and wait for it to be idle */ |
911 | for (txq_id = 0; txq_id < priv->hw_setting.max_txq_num; txq_id++) { | 911 | for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) { |
912 | spin_lock_irqsave(&priv->lock, flags); | 912 | spin_lock_irqsave(&priv->lock, flags); |
913 | if (iwl_grab_nic_access(priv)) { | 913 | if (iwl_grab_nic_access(priv)) { |
914 | spin_unlock_irqrestore(&priv->lock, flags); | 914 | spin_unlock_irqrestore(&priv->lock, flags); |
@@ -1954,7 +1954,7 @@ int iwl4965_alive_notify(struct iwl_priv *priv) | |||
1954 | iwl_write_targ_mem(priv, a, 0); | 1954 | iwl_write_targ_mem(priv, a, 0); |
1955 | for (; a < priv->scd_base_addr + SCD_TRANSLATE_TBL_OFFSET; a += 4) | 1955 | for (; a < priv->scd_base_addr + SCD_TRANSLATE_TBL_OFFSET; a += 4) |
1956 | iwl_write_targ_mem(priv, a, 0); | 1956 | iwl_write_targ_mem(priv, a, 0); |
1957 | for (; a < sizeof(u16) * priv->hw_setting.max_txq_num; a += 4) | 1957 | for (; a < sizeof(u16) * priv->hw_params.max_txq_num; a += 4) |
1958 | iwl_write_targ_mem(priv, a, 0); | 1958 | iwl_write_targ_mem(priv, a, 0); |
1959 | 1959 | ||
1960 | /* Tel 4965 where to find Tx byte count tables */ | 1960 | /* Tel 4965 where to find Tx byte count tables */ |
@@ -1966,7 +1966,7 @@ int iwl4965_alive_notify(struct iwl_priv *priv) | |||
1966 | iwl_write_prph(priv, IWL49_SCD_QUEUECHAIN_SEL, 0); | 1966 | iwl_write_prph(priv, IWL49_SCD_QUEUECHAIN_SEL, 0); |
1967 | 1967 | ||
1968 | /* Initialize each Tx queue (including the command queue) */ | 1968 | /* Initialize each Tx queue (including the command queue) */ |
1969 | for (i = 0; i < priv->hw_setting.max_txq_num; i++) { | 1969 | for (i = 0; i < priv->hw_params.max_txq_num; i++) { |
1970 | 1970 | ||
1971 | /* TFD circular buffer read/write indexes */ | 1971 | /* TFD circular buffer read/write indexes */ |
1972 | iwl_write_prph(priv, IWL49_SCD_QUEUE_RDPTR(i), 0); | 1972 | iwl_write_prph(priv, IWL49_SCD_QUEUE_RDPTR(i), 0); |
@@ -1989,7 +1989,7 @@ int iwl4965_alive_notify(struct iwl_priv *priv) | |||
1989 | 1989 | ||
1990 | } | 1990 | } |
1991 | iwl_write_prph(priv, IWL49_SCD_INTERRUPT_MASK, | 1991 | iwl_write_prph(priv, IWL49_SCD_INTERRUPT_MASK, |
1992 | (1 << priv->hw_setting.max_txq_num) - 1); | 1992 | (1 << priv->hw_params.max_txq_num) - 1); |
1993 | 1993 | ||
1994 | /* Activate all Tx DMA/FIFO channels */ | 1994 | /* Activate all Tx DMA/FIFO channels */ |
1995 | iwl_write_prph(priv, IWL49_SCD_TXFACT, | 1995 | iwl_write_prph(priv, IWL49_SCD_TXFACT, |
@@ -2014,11 +2014,11 @@ int iwl4965_alive_notify(struct iwl_priv *priv) | |||
2014 | } | 2014 | } |
2015 | 2015 | ||
2016 | /** | 2016 | /** |
2017 | * iwl4965_hw_set_hw_setting | 2017 | * iwl4965_hw_set_hw_params |
2018 | * | 2018 | * |
2019 | * Called when initializing driver | 2019 | * Called when initializing driver |
2020 | */ | 2020 | */ |
2021 | int iwl4965_hw_set_hw_setting(struct iwl_priv *priv) | 2021 | int iwl4965_hw_set_hw_params(struct iwl_priv *priv) |
2022 | { | 2022 | { |
2023 | 2023 | ||
2024 | if ((priv->cfg->mod_params->num_of_queues > IWL_MAX_NUM_QUEUES) || | 2024 | if ((priv->cfg->mod_params->num_of_queues > IWL_MAX_NUM_QUEUES) || |
@@ -2028,19 +2028,19 @@ int iwl4965_hw_set_hw_setting(struct iwl_priv *priv) | |||
2028 | return -EINVAL; | 2028 | return -EINVAL; |
2029 | } | 2029 | } |
2030 | 2030 | ||
2031 | priv->hw_setting.max_txq_num = priv->cfg->mod_params->num_of_queues; | 2031 | priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; |
2032 | priv->hw_setting.tx_cmd_len = sizeof(struct iwl4965_tx_cmd); | 2032 | priv->hw_params.tx_cmd_len = sizeof(struct iwl4965_tx_cmd); |
2033 | priv->hw_setting.max_rxq_size = RX_QUEUE_SIZE; | 2033 | priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; |
2034 | priv->hw_setting.max_rxq_log = RX_QUEUE_SIZE_LOG; | 2034 | priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; |
2035 | if (priv->cfg->mod_params->amsdu_size_8K) | 2035 | if (priv->cfg->mod_params->amsdu_size_8K) |
2036 | priv->hw_setting.rx_buf_size = IWL_RX_BUF_SIZE_8K; | 2036 | priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_8K; |
2037 | else | 2037 | else |
2038 | priv->hw_setting.rx_buf_size = IWL_RX_BUF_SIZE_4K; | 2038 | priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_4K; |
2039 | priv->hw_setting.max_pkt_size = priv->hw_setting.rx_buf_size - 256; | 2039 | priv->hw_params.max_pkt_size = priv->hw_params.rx_buf_size - 256; |
2040 | priv->hw_setting.max_stations = IWL4965_STATION_COUNT; | 2040 | priv->hw_params.max_stations = IWL4965_STATION_COUNT; |
2041 | priv->hw_setting.bcast_sta_id = IWL4965_BROADCAST_ID; | 2041 | priv->hw_params.bcast_sta_id = IWL4965_BROADCAST_ID; |
2042 | 2042 | ||
2043 | priv->hw_setting.tx_ant_num = 2; | 2043 | priv->hw_params.tx_ant_num = 2; |
2044 | 2044 | ||
2045 | return 0; | 2045 | return 0; |
2046 | } | 2046 | } |
@@ -2055,7 +2055,7 @@ void iwl4965_hw_txq_ctx_free(struct iwl_priv *priv) | |||
2055 | int txq_id; | 2055 | int txq_id; |
2056 | 2056 | ||
2057 | /* Tx queues */ | 2057 | /* Tx queues */ |
2058 | for (txq_id = 0; txq_id < priv->hw_setting.max_txq_num; txq_id++) | 2058 | for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) |
2059 | iwl4965_tx_queue_free(priv, &priv->txq[txq_id]); | 2059 | iwl4965_tx_queue_free(priv, &priv->txq[txq_id]); |
2060 | 2060 | ||
2061 | /* Keep-warm buffer */ | 2061 | /* Keep-warm buffer */ |
@@ -3012,7 +3012,7 @@ unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv, | |||
3012 | tx_beacon_cmd = &frame->u.beacon; | 3012 | tx_beacon_cmd = &frame->u.beacon; |
3013 | memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd)); | 3013 | memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd)); |
3014 | 3014 | ||
3015 | tx_beacon_cmd->tx.sta_id = priv->hw_setting.bcast_sta_id; | 3015 | tx_beacon_cmd->tx.sta_id = priv->hw_params.bcast_sta_id; |
3016 | tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; | 3016 | tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; |
3017 | 3017 | ||
3018 | frame_size = iwl4965_fill_beacon_frame(priv, | 3018 | frame_size = iwl4965_fill_beacon_frame(priv, |
@@ -3620,7 +3620,7 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data, | |||
3620 | rx_start->byte_count = amsdu->byte_count; | 3620 | rx_start->byte_count = amsdu->byte_count; |
3621 | rx_end = (__le32 *) (((u8 *) hdr) + len); | 3621 | rx_end = (__le32 *) (((u8 *) hdr) + len); |
3622 | } | 3622 | } |
3623 | if (len > priv->hw_setting.max_pkt_size || len < 16) { | 3623 | if (len > priv->hw_params.max_pkt_size || len < 16) { |
3624 | IWL_WARNING("byte count out of range [16,4K] : %d\n", len); | 3624 | IWL_WARNING("byte count out of range [16,4K] : %d\n", len); |
3625 | return; | 3625 | return; |
3626 | } | 3626 | } |
@@ -4515,7 +4515,7 @@ void iwl4965_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap) | |||
4515 | link_cmd.agg_params.agg_time_limit = cpu_to_le16(4000); | 4515 | link_cmd.agg_params.agg_time_limit = cpu_to_le16(4000); |
4516 | 4516 | ||
4517 | /* Update the rate scaling for control frame Tx to AP */ | 4517 | /* Update the rate scaling for control frame Tx to AP */ |
4518 | link_cmd.sta_id = is_ap ? IWL_AP_ID : priv->hw_setting.bcast_sta_id; | 4518 | link_cmd.sta_id = is_ap ? IWL_AP_ID : priv->hw_params.bcast_sta_id; |
4519 | 4519 | ||
4520 | iwl_send_cmd_pdu_async(priv, REPLY_TX_LINK_QUALITY_CMD, | 4520 | iwl_send_cmd_pdu_async(priv, REPLY_TX_LINK_QUALITY_CMD, |
4521 | sizeof(link_cmd), &link_cmd, NULL); | 4521 | sizeof(link_cmd), &link_cmd, NULL); |
@@ -4704,7 +4704,7 @@ static int iwl4965_txq_ctx_activate_free(struct iwl_priv *priv) | |||
4704 | { | 4704 | { |
4705 | int txq_id; | 4705 | int txq_id; |
4706 | 4706 | ||
4707 | for (txq_id = 0; txq_id < priv->hw_setting.max_txq_num; txq_id++) | 4707 | for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) |
4708 | if (!test_and_set_bit(txq_id, &priv->txq_ctx_active_msk)) | 4708 | if (!test_and_set_bit(txq_id, &priv->txq_ctx_active_msk)) |
4709 | return txq_id; | 4709 | return txq_id; |
4710 | return -1; | 4710 | return -1; |
@@ -4908,6 +4908,7 @@ static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = { | |||
4908 | 4908 | ||
4909 | static struct iwl_lib_ops iwl4965_lib = { | 4909 | static struct iwl_lib_ops iwl4965_lib = { |
4910 | .init_drv = iwl4965_init_drv, | 4910 | .init_drv = iwl4965_init_drv, |
4911 | .set_hw_params = iwl4965_hw_set_hw_params, | ||
4911 | .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl, | 4912 | .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl, |
4912 | .hw_nic_init = iwl4965_hw_nic_init, | 4913 | .hw_nic_init = iwl4965_hw_nic_init, |
4913 | .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, | 4914 | .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, |