diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-04-15 19:01:38 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-16 16:00:00 -0400 |
commit | 5425e490471d521bae2fce16d22995803b41d90f (patch) | |
tree | 96d827e8c17d3d5469ec0da05208e2c5730f085d /drivers | |
parent | 49ea85961cf8b60b5387cc1c1bc06fe4b6a31ee4 (diff) |
iwlwifi: hw_setting cleanup
1. This patch renames hw_setting to hw_params
2. Align names of the structure and variables
3. set_hw_params is called from libs_ops
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 49 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 54 |
6 files changed, 61 insertions, 58 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 3df70f89f11b..a1e91dbb92bb 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, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index c8e73a5212af..c127c91010b4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h | |||
@@ -567,7 +567,7 @@ struct iwl4965_ibss_seq { | |||
567 | }; | 567 | }; |
568 | 568 | ||
569 | /** | 569 | /** |
570 | * struct iwl4965_driver_hw_info | 570 | * struct iwl_hw_params |
571 | * @max_txq_num: Max # Tx queues supported | 571 | * @max_txq_num: Max # Tx queues supported |
572 | * @tx_cmd_len: Size of Tx command (but not including frame itself) | 572 | * @tx_cmd_len: Size of Tx command (but not including frame itself) |
573 | * @tx_ant_num: Number of TX antennas | 573 | * @tx_ant_num: Number of TX antennas |
@@ -577,7 +577,7 @@ struct iwl4965_ibss_seq { | |||
577 | * @max_stations: | 577 | * @max_stations: |
578 | * @bcast_sta_id: | 578 | * @bcast_sta_id: |
579 | */ | 579 | */ |
580 | struct iwl4965_driver_hw_info { | 580 | struct iwl_hw_params { |
581 | u16 max_txq_num; | 581 | u16 max_txq_num; |
582 | u16 tx_cmd_len; | 582 | u16 tx_cmd_len; |
583 | u16 tx_ant_num; | 583 | u16 tx_ant_num; |
@@ -675,7 +675,7 @@ extern void iwl4965_hw_rx_handler_setup(struct iwl_priv *priv); | |||
675 | extern void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv); | 675 | extern void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv); |
676 | extern void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv); | 676 | extern void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv); |
677 | extern int iwl4965_hw_rxq_stop(struct iwl_priv *priv); | 677 | extern int iwl4965_hw_rxq_stop(struct iwl_priv *priv); |
678 | extern int iwl4965_hw_set_hw_setting(struct iwl_priv *priv); | 678 | extern int iwl4965_hw_set_hw_params(struct iwl_priv *priv); |
679 | extern int iwl4965_hw_nic_init(struct iwl_priv *priv); | 679 | extern int iwl4965_hw_nic_init(struct iwl_priv *priv); |
680 | extern int iwl4965_hw_nic_stop_master(struct iwl_priv *priv); | 680 | extern int iwl4965_hw_nic_stop_master(struct iwl_priv *priv); |
681 | extern void iwl4965_hw_txq_ctx_free(struct iwl_priv *priv); | 681 | extern void iwl4965_hw_txq_ctx_free(struct iwl_priv *priv); |
@@ -1144,7 +1144,7 @@ struct iwl_priv { | |||
1144 | u16 beacon_int; | 1144 | u16 beacon_int; |
1145 | struct ieee80211_vif *vif; | 1145 | struct ieee80211_vif *vif; |
1146 | 1146 | ||
1147 | struct iwl4965_driver_hw_info hw_setting; | 1147 | struct iwl_hw_params hw_params; |
1148 | /* driver/uCode shared Tx Byte Counts and Rx status */ | 1148 | /* driver/uCode shared Tx Byte Counts and Rx status */ |
1149 | void *shared_virt; | 1149 | void *shared_virt; |
1150 | /* Physical Pointer to Tx Byte Counts and Rx status */ | 1150 | /* Physical Pointer to Tx Byte Counts and Rx status */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index aef1b48ea50c..7791d2bd9645 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -89,6 +89,8 @@ struct iwl_hcmd_utils_ops { | |||
89 | struct iwl_lib_ops { | 89 | struct iwl_lib_ops { |
90 | /* iwlwifi driver (priv) init */ | 90 | /* iwlwifi driver (priv) init */ |
91 | int (*init_drv)(struct iwl_priv *priv); | 91 | int (*init_drv)(struct iwl_priv *priv); |
92 | /* set hw dependant perameters */ | ||
93 | int (*set_hw_params)(struct iwl_priv *priv); | ||
92 | 94 | ||
93 | void (*txq_update_byte_cnt_tbl)(struct iwl_priv *priv, | 95 | void (*txq_update_byte_cnt_tbl)(struct iwl_priv *priv, |
94 | struct iwl4965_tx_queue *txq, | 96 | struct iwl4965_tx_queue *txq, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index cbea477eb078..0f16f2606f29 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -207,7 +207,7 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf, | |||
207 | { | 207 | { |
208 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 208 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; |
209 | struct iwl4965_station_entry *station; | 209 | struct iwl4965_station_entry *station; |
210 | int max_sta = priv->hw_setting.max_stations; | 210 | int max_sta = priv->hw_params.max_stations; |
211 | char *buf; | 211 | char *buf; |
212 | int i, j, pos = 0; | 212 | int i, j, pos = 0; |
213 | ssize_t ret; | 213 | ssize_t ret; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 8765358c1a11..bc2e603efd28 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -157,7 +157,7 @@ static int iwl_set_wep_dynamic_key_info(struct iwl_priv *priv, | |||
157 | if (keyconf->keylen == WEP_KEY_LEN_128) | 157 | if (keyconf->keylen == WEP_KEY_LEN_128) |
158 | key_flags |= STA_KEY_FLG_KEY_SIZE_MSK; | 158 | key_flags |= STA_KEY_FLG_KEY_SIZE_MSK; |
159 | 159 | ||
160 | if (sta_id == priv->hw_setting.bcast_sta_id) | 160 | if (sta_id == priv->hw_params.bcast_sta_id) |
161 | key_flags |= STA_KEY_MULTICAST_MSK; | 161 | key_flags |= STA_KEY_MULTICAST_MSK; |
162 | 162 | ||
163 | spin_lock_irqsave(&priv->sta_lock, flags); | 163 | spin_lock_irqsave(&priv->sta_lock, flags); |
@@ -198,7 +198,7 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv, | |||
198 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | 198 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); |
199 | key_flags &= ~STA_KEY_FLG_INVALID; | 199 | key_flags &= ~STA_KEY_FLG_INVALID; |
200 | 200 | ||
201 | if (sta_id == priv->hw_setting.bcast_sta_id) | 201 | if (sta_id == priv->hw_params.bcast_sta_id) |
202 | key_flags |= STA_KEY_MULTICAST_MSK; | 202 | key_flags |= STA_KEY_MULTICAST_MSK; |
203 | 203 | ||
204 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; | 204 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 42e519be0206..c71910df62aa 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -398,9 +398,9 @@ static u8 iwl4965_remove_station(struct iwl_priv *priv, const u8 *addr, int is_a | |||
398 | if (is_ap) | 398 | if (is_ap) |
399 | index = IWL_AP_ID; | 399 | index = IWL_AP_ID; |
400 | else if (is_broadcast_ether_addr(addr)) | 400 | else if (is_broadcast_ether_addr(addr)) |
401 | index = priv->hw_setting.bcast_sta_id; | 401 | index = priv->hw_params.bcast_sta_id; |
402 | else | 402 | else |
403 | for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++) | 403 | for (i = IWL_STA_ID; i < priv->hw_params.max_stations; i++) |
404 | if (priv->stations[i].used && | 404 | if (priv->stations[i].used && |
405 | !compare_ether_addr(priv->stations[i].sta.sta.addr, | 405 | !compare_ether_addr(priv->stations[i].sta.sta.addr, |
406 | addr)) { | 406 | addr)) { |
@@ -440,9 +440,9 @@ u8 iwl4965_add_station_flags(struct iwl_priv *priv, const u8 *addr, | |||
440 | if (is_ap) | 440 | if (is_ap) |
441 | index = IWL_AP_ID; | 441 | index = IWL_AP_ID; |
442 | else if (is_broadcast_ether_addr(addr)) | 442 | else if (is_broadcast_ether_addr(addr)) |
443 | index = priv->hw_setting.bcast_sta_id; | 443 | index = priv->hw_params.bcast_sta_id; |
444 | else | 444 | else |
445 | for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++) { | 445 | for (i = IWL_STA_ID; i < priv->hw_params.max_stations; i++) { |
446 | if (!compare_ether_addr(priv->stations[i].sta.sta.addr, | 446 | if (!compare_ether_addr(priv->stations[i].sta.sta.addr, |
447 | addr)) { | 447 | addr)) { |
448 | index = i; | 448 | index = i; |
@@ -483,7 +483,7 @@ u8 iwl4965_add_station_flags(struct iwl_priv *priv, const u8 *addr, | |||
483 | 483 | ||
484 | #ifdef CONFIG_IWL4965_HT | 484 | #ifdef CONFIG_IWL4965_HT |
485 | /* BCAST station and IBSS stations do not work in HT mode */ | 485 | /* BCAST station and IBSS stations do not work in HT mode */ |
486 | if (index != priv->hw_setting.bcast_sta_id && | 486 | if (index != priv->hw_params.bcast_sta_id && |
487 | priv->iw_mode != IEEE80211_IF_TYPE_IBSS) | 487 | priv->iw_mode != IEEE80211_IF_TYPE_IBSS) |
488 | iwl4965_set_ht_add_station(priv, index, | 488 | iwl4965_set_ht_add_station(priv, index, |
489 | (struct ieee80211_ht_info *) ht_data); | 489 | (struct ieee80211_ht_info *) ht_data); |
@@ -1210,7 +1210,7 @@ static int iwl4965_send_beacon_cmd(struct iwl_priv *priv) | |||
1210 | * | 1210 | * |
1211 | ******************************************************************************/ | 1211 | ******************************************************************************/ |
1212 | 1212 | ||
1213 | static void iwl4965_unset_hw_setting(struct iwl_priv *priv) | 1213 | static void iwl4965_unset_hw_params(struct iwl_priv *priv) |
1214 | { | 1214 | { |
1215 | if (priv->shared_virt) | 1215 | if (priv->shared_virt) |
1216 | pci_free_consistent(priv->pci_dev, | 1216 | pci_free_consistent(priv->pci_dev, |
@@ -2114,7 +2114,7 @@ static int iwl4965_get_sta_id(struct iwl_priv *priv, | |||
2114 | /* If this frame is broadcast or management, use broadcast station id */ | 2114 | /* If this frame is broadcast or management, use broadcast station id */ |
2115 | if (((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) || | 2115 | if (((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) || |
2116 | is_multicast_ether_addr(hdr->addr1)) | 2116 | is_multicast_ether_addr(hdr->addr1)) |
2117 | return priv->hw_setting.bcast_sta_id; | 2117 | return priv->hw_params.bcast_sta_id; |
2118 | 2118 | ||
2119 | switch (priv->iw_mode) { | 2119 | switch (priv->iw_mode) { |
2120 | 2120 | ||
@@ -2128,7 +2128,7 @@ static int iwl4965_get_sta_id(struct iwl_priv *priv, | |||
2128 | sta_id = iwl4965_hw_find_station(priv, hdr->addr1); | 2128 | sta_id = iwl4965_hw_find_station(priv, hdr->addr1); |
2129 | if (sta_id != IWL_INVALID_STATION) | 2129 | if (sta_id != IWL_INVALID_STATION) |
2130 | return sta_id; | 2130 | return sta_id; |
2131 | return priv->hw_setting.bcast_sta_id; | 2131 | return priv->hw_params.bcast_sta_id; |
2132 | 2132 | ||
2133 | /* If this frame is going out to an IBSS network, find the station, | 2133 | /* If this frame is going out to an IBSS network, find the station, |
2134 | * or create a new station table entry */ | 2134 | * or create a new station table entry */ |
@@ -2148,11 +2148,11 @@ static int iwl4965_get_sta_id(struct iwl_priv *priv, | |||
2148 | "Defaulting to broadcast...\n", | 2148 | "Defaulting to broadcast...\n", |
2149 | print_mac(mac, hdr->addr1)); | 2149 | print_mac(mac, hdr->addr1)); |
2150 | iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); | 2150 | iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); |
2151 | return priv->hw_setting.bcast_sta_id; | 2151 | return priv->hw_params.bcast_sta_id; |
2152 | 2152 | ||
2153 | default: | 2153 | default: |
2154 | IWL_WARNING("Unknown mode of operation: %d", priv->iw_mode); | 2154 | IWL_WARNING("Unknown mode of operation: %d", priv->iw_mode); |
2155 | return priv->hw_setting.bcast_sta_id; | 2155 | return priv->hw_params.bcast_sta_id; |
2156 | } | 2156 | } |
2157 | } | 2157 | } |
2158 | 2158 | ||
@@ -2299,7 +2299,7 @@ static int iwl4965_tx_skb(struct iwl_priv *priv, | |||
2299 | * of the MAC header (device reads on dword boundaries). | 2299 | * of the MAC header (device reads on dword boundaries). |
2300 | * We'll tell device about this padding later. | 2300 | * We'll tell device about this padding later. |
2301 | */ | 2301 | */ |
2302 | len = priv->hw_setting.tx_cmd_len + | 2302 | len = priv->hw_params.tx_cmd_len + |
2303 | sizeof(struct iwl_cmd_header) + hdr_len; | 2303 | sizeof(struct iwl_cmd_header) + hdr_len; |
2304 | 2304 | ||
2305 | len_org = len; | 2305 | len_org = len; |
@@ -3726,7 +3726,7 @@ static void iwl4965_rx_allocate(struct iwl_priv *priv) | |||
3726 | 3726 | ||
3727 | /* Alloc a new receive buffer */ | 3727 | /* Alloc a new receive buffer */ |
3728 | rxb->skb = | 3728 | rxb->skb = |
3729 | alloc_skb(priv->hw_setting.rx_buf_size, | 3729 | alloc_skb(priv->hw_params.rx_buf_size, |
3730 | __GFP_NOWARN | GFP_ATOMIC); | 3730 | __GFP_NOWARN | GFP_ATOMIC); |
3731 | if (!rxb->skb) { | 3731 | if (!rxb->skb) { |
3732 | if (net_ratelimit()) | 3732 | if (net_ratelimit()) |
@@ -3743,7 +3743,7 @@ static void iwl4965_rx_allocate(struct iwl_priv *priv) | |||
3743 | /* Get physical address of RB/SKB */ | 3743 | /* Get physical address of RB/SKB */ |
3744 | rxb->dma_addr = | 3744 | rxb->dma_addr = |
3745 | pci_map_single(priv->pci_dev, rxb->skb->data, | 3745 | pci_map_single(priv->pci_dev, rxb->skb->data, |
3746 | priv->hw_setting.rx_buf_size, PCI_DMA_FROMDEVICE); | 3746 | priv->hw_params.rx_buf_size, PCI_DMA_FROMDEVICE); |
3747 | list_add_tail(&rxb->list, &rxq->rx_free); | 3747 | list_add_tail(&rxb->list, &rxq->rx_free); |
3748 | rxq->free_count++; | 3748 | rxq->free_count++; |
3749 | } | 3749 | } |
@@ -3786,7 +3786,7 @@ static void iwl4965_rx_queue_free(struct iwl_priv *priv, struct iwl4965_rx_queue | |||
3786 | if (rxq->pool[i].skb != NULL) { | 3786 | if (rxq->pool[i].skb != NULL) { |
3787 | pci_unmap_single(priv->pci_dev, | 3787 | pci_unmap_single(priv->pci_dev, |
3788 | rxq->pool[i].dma_addr, | 3788 | rxq->pool[i].dma_addr, |
3789 | priv->hw_setting.rx_buf_size, | 3789 | priv->hw_params.rx_buf_size, |
3790 | PCI_DMA_FROMDEVICE); | 3790 | PCI_DMA_FROMDEVICE); |
3791 | dev_kfree_skb(rxq->pool[i].skb); | 3791 | dev_kfree_skb(rxq->pool[i].skb); |
3792 | } | 3792 | } |
@@ -3838,7 +3838,7 @@ void iwl4965_rx_queue_reset(struct iwl_priv *priv, struct iwl4965_rx_queue *rxq) | |||
3838 | if (rxq->pool[i].skb != NULL) { | 3838 | if (rxq->pool[i].skb != NULL) { |
3839 | pci_unmap_single(priv->pci_dev, | 3839 | pci_unmap_single(priv->pci_dev, |
3840 | rxq->pool[i].dma_addr, | 3840 | rxq->pool[i].dma_addr, |
3841 | priv->hw_setting.rx_buf_size, | 3841 | priv->hw_params.rx_buf_size, |
3842 | PCI_DMA_FROMDEVICE); | 3842 | PCI_DMA_FROMDEVICE); |
3843 | priv->alloc_rxb_skb--; | 3843 | priv->alloc_rxb_skb--; |
3844 | dev_kfree_skb(rxq->pool[i].skb); | 3844 | dev_kfree_skb(rxq->pool[i].skb); |
@@ -3973,7 +3973,7 @@ static void iwl4965_rx_handle(struct iwl_priv *priv) | |||
3973 | rxq->queue[i] = NULL; | 3973 | rxq->queue[i] = NULL; |
3974 | 3974 | ||
3975 | pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->dma_addr, | 3975 | pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->dma_addr, |
3976 | priv->hw_setting.rx_buf_size, | 3976 | priv->hw_params.rx_buf_size, |
3977 | PCI_DMA_FROMDEVICE); | 3977 | PCI_DMA_FROMDEVICE); |
3978 | pkt = (struct iwl4965_rx_packet *)rxb->skb->data; | 3978 | pkt = (struct iwl4965_rx_packet *)rxb->skb->data; |
3979 | 3979 | ||
@@ -4026,7 +4026,7 @@ static void iwl4965_rx_handle(struct iwl_priv *priv) | |||
4026 | } | 4026 | } |
4027 | 4027 | ||
4028 | pci_unmap_single(priv->pci_dev, rxb->dma_addr, | 4028 | pci_unmap_single(priv->pci_dev, rxb->dma_addr, |
4029 | priv->hw_setting.rx_buf_size, | 4029 | priv->hw_params.rx_buf_size, |
4030 | PCI_DMA_FROMDEVICE); | 4030 | PCI_DMA_FROMDEVICE); |
4031 | spin_lock_irqsave(&rxq->lock, flags); | 4031 | spin_lock_irqsave(&rxq->lock, flags); |
4032 | list_add_tail(&rxb->list, &priv->rxq.rx_used); | 4032 | list_add_tail(&rxb->list, &priv->rxq.rx_used); |
@@ -5871,7 +5871,7 @@ static void iwl4965_bg_request_scan(struct work_struct *data) | |||
5871 | } | 5871 | } |
5872 | 5872 | ||
5873 | scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; | 5873 | scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; |
5874 | scan->tx_cmd.sta_id = priv->hw_setting.bcast_sta_id; | 5874 | scan->tx_cmd.sta_id = priv->hw_params.bcast_sta_id; |
5875 | scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; | 5875 | scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; |
5876 | 5876 | ||
5877 | 5877 | ||
@@ -6844,7 +6844,7 @@ static void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw, | |||
6844 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | 6844 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); |
6845 | key_flags &= ~STA_KEY_FLG_INVALID; | 6845 | key_flags &= ~STA_KEY_FLG_INVALID; |
6846 | 6846 | ||
6847 | if (sta_id == priv->hw_setting.bcast_sta_id) | 6847 | if (sta_id == priv->hw_params.bcast_sta_id) |
6848 | key_flags |= STA_KEY_MULTICAST_MSK; | 6848 | key_flags |= STA_KEY_MULTICAST_MSK; |
6849 | 6849 | ||
6850 | spin_lock_irqsave(&priv->sta_lock, flags); | 6850 | spin_lock_irqsave(&priv->sta_lock, flags); |
@@ -6905,7 +6905,7 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
6905 | * so far, we are in legacy wep mode (group key only), otherwise we are | 6905 | * so far, we are in legacy wep mode (group key only), otherwise we are |
6906 | * in 1X mode. | 6906 | * in 1X mode. |
6907 | * In legacy wep mode, we use another host command to the uCode */ | 6907 | * In legacy wep mode, we use another host command to the uCode */ |
6908 | if (key->alg == ALG_WEP && sta_id == priv->hw_setting.bcast_sta_id && | 6908 | if (key->alg == ALG_WEP && sta_id == priv->hw_params.bcast_sta_id && |
6909 | priv->iw_mode != IEEE80211_IF_TYPE_AP) { | 6909 | priv->iw_mode != IEEE80211_IF_TYPE_AP) { |
6910 | if (cmd == SET_KEY) | 6910 | if (cmd == SET_KEY) |
6911 | is_default_wep_key = !priv->key_mapping_key; | 6911 | is_default_wep_key = !priv->key_mapping_key; |
@@ -7831,8 +7831,8 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7831 | * 5. Setup HW constants | 7831 | * 5. Setup HW constants |
7832 | ************************/ | 7832 | ************************/ |
7833 | /* Device-specific setup */ | 7833 | /* Device-specific setup */ |
7834 | if (iwl4965_hw_set_hw_setting(priv)) { | 7834 | if (priv->cfg->ops->lib->set_hw_params(priv)) { |
7835 | IWL_ERROR("failed to set hw settings\n"); | 7835 | IWL_ERROR("failed to set hw parameters\n"); |
7836 | goto out_iounmap; | 7836 | goto out_iounmap; |
7837 | } | 7837 | } |
7838 | 7838 | ||
@@ -7842,7 +7842,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7842 | 7842 | ||
7843 | err = iwl_setup(priv); | 7843 | err = iwl_setup(priv); |
7844 | if (err) | 7844 | if (err) |
7845 | goto out_unset_hw_settings; | 7845 | goto out_unset_hw_params; |
7846 | /* At this point both hw and priv are initialized. */ | 7846 | /* At this point both hw and priv are initialized. */ |
7847 | 7847 | ||
7848 | /********************************** | 7848 | /********************************** |
@@ -7868,7 +7868,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7868 | err = sysfs_create_group(&pdev->dev.kobj, &iwl4965_attribute_group); | 7868 | err = sysfs_create_group(&pdev->dev.kobj, &iwl4965_attribute_group); |
7869 | if (err) { | 7869 | if (err) { |
7870 | IWL_ERROR("failed to create sysfs device attributes\n"); | 7870 | IWL_ERROR("failed to create sysfs device attributes\n"); |
7871 | goto out_unset_hw_settings; | 7871 | goto out_unset_hw_params; |
7872 | } | 7872 | } |
7873 | 7873 | ||
7874 | err = iwl_dbgfs_register(priv, DRV_NAME); | 7874 | err = iwl_dbgfs_register(priv, DRV_NAME); |
@@ -7892,8 +7892,8 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
7892 | 7892 | ||
7893 | out_remove_sysfs: | 7893 | out_remove_sysfs: |
7894 | sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group); | 7894 | sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group); |
7895 | out_unset_hw_settings: | 7895 | out_unset_hw_params: |
7896 | iwl4965_unset_hw_setting(priv); | 7896 | iwl4965_unset_hw_params(priv); |
7897 | out_iounmap: | 7897 | out_iounmap: |
7898 | pci_iounmap(pdev, priv->hw_base); | 7898 | pci_iounmap(pdev, priv->hw_base); |
7899 | out_pci_release_regions: | 7899 | out_pci_release_regions: |
@@ -7955,7 +7955,7 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev) | |||
7955 | iwl4965_rx_queue_free(priv, &priv->rxq); | 7955 | iwl4965_rx_queue_free(priv, &priv->rxq); |
7956 | iwl4965_hw_txq_ctx_free(priv); | 7956 | iwl4965_hw_txq_ctx_free(priv); |
7957 | 7957 | ||
7958 | iwl4965_unset_hw_setting(priv); | 7958 | iwl4965_unset_hw_params(priv); |
7959 | iwlcore_clear_stations_table(priv); | 7959 | iwlcore_clear_stations_table(priv); |
7960 | 7960 | ||
7961 | 7961 | ||