diff options
author | Winkler, Tomas <tomas.winkler@intel.com> | 2008-12-18 21:37:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:18 -0500 |
commit | c2d79b488a33a77d337092c967ce50614edc5d25 (patch) | |
tree | 8cc6017c2cc01fb1cfda6d9f9de5bfcf23ed30bd /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 15b1687cb4f45b87ddbe4dfc7759ff5bb69497d2 (diff) |
iwlwifi: use iwl_cmd instead of iwl3945_cmd
This patch makes use of iwl_cmd instead of iwl3945_cmd and related
structures which were just the same.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 52c9075b1889..0af710b8fb78 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -232,7 +232,7 @@ int iwl3945_tx_queue_init(struct iwl_priv *priv, | |||
232 | * For data Tx queues (all other queues), no super-size command | 232 | * For data Tx queues (all other queues), no super-size command |
233 | * space is needed. | 233 | * space is needed. |
234 | */ | 234 | */ |
235 | len = sizeof(struct iwl3945_cmd) * slots_num; | 235 | len = sizeof(struct iwl_cmd) * slots_num; |
236 | if (txq_id == IWL_CMD_QUEUE_NUM) | 236 | if (txq_id == IWL_CMD_QUEUE_NUM) |
237 | len += IWL_MAX_SCAN_SIZE; | 237 | len += IWL_MAX_SCAN_SIZE; |
238 | txq->cmd = pci_alloc_consistent(dev, len, &txq->dma_addr_cmd); | 238 | txq->cmd = pci_alloc_consistent(dev, len, &txq->dma_addr_cmd); |
@@ -283,7 +283,7 @@ void iwl3945_tx_queue_free(struct iwl_priv *priv, struct iwl3945_tx_queue *txq) | |||
283 | q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) | 283 | q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) |
284 | iwl3945_hw_txq_free_tfd(priv, txq); | 284 | iwl3945_hw_txq_free_tfd(priv, txq); |
285 | 285 | ||
286 | len = sizeof(struct iwl3945_cmd) * q->n_window; | 286 | len = sizeof(struct iwl_cmd) * q->n_window; |
287 | if (q->id == IWL_CMD_QUEUE_NUM) | 287 | if (q->id == IWL_CMD_QUEUE_NUM) |
288 | len += IWL_MAX_SCAN_SIZE; | 288 | len += IWL_MAX_SCAN_SIZE; |
289 | 289 | ||
@@ -500,13 +500,13 @@ static inline int iwl3945_is_ready_rf(struct iwl_priv *priv) | |||
500 | * failed. On success, it turns the index (> 0) of command in the | 500 | * failed. On success, it turns the index (> 0) of command in the |
501 | * command queue. | 501 | * command queue. |
502 | */ | 502 | */ |
503 | static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd) | 503 | static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) |
504 | { | 504 | { |
505 | struct iwl3945_tx_queue *txq = &priv->txq39[IWL_CMD_QUEUE_NUM]; | 505 | struct iwl3945_tx_queue *txq = &priv->txq39[IWL_CMD_QUEUE_NUM]; |
506 | struct iwl_queue *q = &txq->q; | 506 | struct iwl_queue *q = &txq->q; |
507 | struct iwl3945_tfd_frame *tfd; | 507 | struct iwl3945_tfd_frame *tfd; |
508 | u32 *control_flags; | 508 | u32 *control_flags; |
509 | struct iwl3945_cmd *out_cmd; | 509 | struct iwl_cmd *out_cmd; |
510 | u32 idx; | 510 | u32 idx; |
511 | u16 fix_size = (u16)(cmd->len + sizeof(out_cmd->hdr)); | 511 | u16 fix_size = (u16)(cmd->len + sizeof(out_cmd->hdr)); |
512 | dma_addr_t phys_addr; | 512 | dma_addr_t phys_addr; |
@@ -518,7 +518,7 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd * | |||
518 | /* If any of the command structures end up being larger than | 518 | /* If any of the command structures end up being larger than |
519 | * the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then | 519 | * the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then |
520 | * we will need to increase the size of the TFD entries */ | 520 | * we will need to increase the size of the TFD entries */ |
521 | BUG_ON((fix_size > TFD39_MAX_PAYLOAD_SIZE) && | 521 | BUG_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) && |
522 | !(cmd->meta.flags & CMD_SIZE_HUGE)); | 522 | !(cmd->meta.flags & CMD_SIZE_HUGE)); |
523 | 523 | ||
524 | 524 | ||
@@ -556,7 +556,7 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd * | |||
556 | out_cmd->hdr.sequence |= SEQ_HUGE_FRAME; | 556 | out_cmd->hdr.sequence |= SEQ_HUGE_FRAME; |
557 | 557 | ||
558 | phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx + | 558 | phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx + |
559 | offsetof(struct iwl3945_cmd, hdr); | 559 | offsetof(struct iwl_cmd, hdr); |
560 | iwl3945_hw_txq_attach_buf_to_tfd(priv, tfd, phys_addr, fix_size); | 560 | iwl3945_hw_txq_attach_buf_to_tfd(priv, tfd, phys_addr, fix_size); |
561 | 561 | ||
562 | pad = U32_PAD(cmd->len); | 562 | pad = U32_PAD(cmd->len); |
@@ -579,7 +579,8 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd * | |||
579 | return ret ? ret : idx; | 579 | return ret ? ret : idx; |
580 | } | 580 | } |
581 | 581 | ||
582 | static int iwl3945_send_cmd_async(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd) | 582 | static int iwl3945_send_cmd_async(struct iwl_priv *priv, |
583 | struct iwl_host_cmd *cmd) | ||
583 | { | 584 | { |
584 | int ret; | 585 | int ret; |
585 | 586 | ||
@@ -604,7 +605,8 @@ static int iwl3945_send_cmd_async(struct iwl_priv *priv, struct iwl3945_host_cmd | |||
604 | return 0; | 605 | return 0; |
605 | } | 606 | } |
606 | 607 | ||
607 | static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd) | 608 | static int iwl3945_send_cmd_sync(struct iwl_priv *priv, |
609 | struct iwl_host_cmd *cmd) | ||
608 | { | 610 | { |
609 | int cmd_idx; | 611 | int cmd_idx; |
610 | int ret; | 612 | int ret; |
@@ -675,7 +677,7 @@ static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd | |||
675 | 677 | ||
676 | cancel: | 678 | cancel: |
677 | if (cmd->meta.flags & CMD_WANT_SKB) { | 679 | if (cmd->meta.flags & CMD_WANT_SKB) { |
678 | struct iwl3945_cmd *qcmd; | 680 | struct iwl_cmd *qcmd; |
679 | 681 | ||
680 | /* Cancel the CMD_WANT_SKB flag for the cmd in the | 682 | /* Cancel the CMD_WANT_SKB flag for the cmd in the |
681 | * TX cmd queue. Otherwise in case the cmd comes | 683 | * TX cmd queue. Otherwise in case the cmd comes |
@@ -694,7 +696,7 @@ out: | |||
694 | return ret; | 696 | return ret; |
695 | } | 697 | } |
696 | 698 | ||
697 | int iwl3945_send_cmd(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd) | 699 | int iwl3945_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) |
698 | { | 700 | { |
699 | if (cmd->meta.flags & CMD_ASYNC) | 701 | if (cmd->meta.flags & CMD_ASYNC) |
700 | return iwl3945_send_cmd_async(priv, cmd); | 702 | return iwl3945_send_cmd_async(priv, cmd); |
@@ -704,7 +706,7 @@ int iwl3945_send_cmd(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd) | |||
704 | 706 | ||
705 | int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data) | 707 | int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data) |
706 | { | 708 | { |
707 | struct iwl3945_host_cmd cmd = { | 709 | struct iwl_host_cmd cmd = { |
708 | .id = id, | 710 | .id = id, |
709 | .len = len, | 711 | .len = len, |
710 | .data = data, | 712 | .data = data, |
@@ -715,7 +717,7 @@ int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data | |||
715 | 717 | ||
716 | static int __must_check iwl3945_send_cmd_u32(struct iwl_priv *priv, u8 id, u32 val) | 718 | static int __must_check iwl3945_send_cmd_u32(struct iwl_priv *priv, u8 id, u32 val) |
717 | { | 719 | { |
718 | struct iwl3945_host_cmd cmd = { | 720 | struct iwl_host_cmd cmd = { |
719 | .id = id, | 721 | .id = id, |
720 | .len = sizeof(val), | 722 | .len = sizeof(val), |
721 | .data = &val, | 723 | .data = &val, |
@@ -894,7 +896,7 @@ static int iwl3945_send_rxon_assoc(struct iwl_priv *priv) | |||
894 | int rc = 0; | 896 | int rc = 0; |
895 | struct iwl_rx_packet *res = NULL; | 897 | struct iwl_rx_packet *res = NULL; |
896 | struct iwl3945_rxon_assoc_cmd rxon_assoc; | 898 | struct iwl3945_rxon_assoc_cmd rxon_assoc; |
897 | struct iwl3945_host_cmd cmd = { | 899 | struct iwl_host_cmd cmd = { |
898 | .id = REPLY_RXON_ASSOC, | 900 | .id = REPLY_RXON_ASSOC, |
899 | .len = sizeof(rxon_assoc), | 901 | .len = sizeof(rxon_assoc), |
900 | .meta.flags = CMD_WANT_SKB, | 902 | .meta.flags = CMD_WANT_SKB, |
@@ -1077,7 +1079,7 @@ static int iwl3945_send_scan_abort(struct iwl_priv *priv) | |||
1077 | { | 1079 | { |
1078 | int rc = 0; | 1080 | int rc = 0; |
1079 | struct iwl_rx_packet *res; | 1081 | struct iwl_rx_packet *res; |
1080 | struct iwl3945_host_cmd cmd = { | 1082 | struct iwl_host_cmd cmd = { |
1081 | .id = REPLY_SCAN_ABORT_CMD, | 1083 | .id = REPLY_SCAN_ABORT_CMD, |
1082 | .meta.flags = CMD_WANT_SKB, | 1084 | .meta.flags = CMD_WANT_SKB, |
1083 | }; | 1085 | }; |
@@ -1115,7 +1117,7 @@ static int iwl3945_send_scan_abort(struct iwl_priv *priv) | |||
1115 | } | 1117 | } |
1116 | 1118 | ||
1117 | static int iwl3945_card_state_sync_callback(struct iwl_priv *priv, | 1119 | static int iwl3945_card_state_sync_callback(struct iwl_priv *priv, |
1118 | struct iwl3945_cmd *cmd, | 1120 | struct iwl_cmd *cmd, |
1119 | struct sk_buff *skb) | 1121 | struct sk_buff *skb) |
1120 | { | 1122 | { |
1121 | return 1; | 1123 | return 1; |
@@ -1133,7 +1135,7 @@ static int iwl3945_card_state_sync_callback(struct iwl_priv *priv, | |||
1133 | */ | 1135 | */ |
1134 | static int iwl3945_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_flag) | 1136 | static int iwl3945_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_flag) |
1135 | { | 1137 | { |
1136 | struct iwl3945_host_cmd cmd = { | 1138 | struct iwl_host_cmd cmd = { |
1137 | .id = REPLY_CARD_STATE_CMD, | 1139 | .id = REPLY_CARD_STATE_CMD, |
1138 | .len = sizeof(u32), | 1140 | .len = sizeof(u32), |
1139 | .data = &flags, | 1141 | .data = &flags, |
@@ -1147,7 +1149,7 @@ static int iwl3945_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_fla | |||
1147 | } | 1149 | } |
1148 | 1150 | ||
1149 | static int iwl3945_add_sta_sync_callback(struct iwl_priv *priv, | 1151 | static int iwl3945_add_sta_sync_callback(struct iwl_priv *priv, |
1150 | struct iwl3945_cmd *cmd, struct sk_buff *skb) | 1152 | struct iwl_cmd *cmd, struct sk_buff *skb) |
1151 | { | 1153 | { |
1152 | struct iwl_rx_packet *res = NULL; | 1154 | struct iwl_rx_packet *res = NULL; |
1153 | 1155 | ||
@@ -1179,7 +1181,7 @@ int iwl3945_send_add_station(struct iwl_priv *priv, | |||
1179 | { | 1181 | { |
1180 | struct iwl_rx_packet *res = NULL; | 1182 | struct iwl_rx_packet *res = NULL; |
1181 | int rc = 0; | 1183 | int rc = 0; |
1182 | struct iwl3945_host_cmd cmd = { | 1184 | struct iwl_host_cmd cmd = { |
1183 | .id = REPLY_ADD_STA, | 1185 | .id = REPLY_ADD_STA, |
1184 | .len = sizeof(struct iwl3945_addsta_cmd), | 1186 | .len = sizeof(struct iwl3945_addsta_cmd), |
1185 | .meta.flags = flags, | 1187 | .meta.flags = flags, |
@@ -2202,7 +2204,7 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode) | |||
2202 | 2204 | ||
2203 | static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv, | 2205 | static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv, |
2204 | struct ieee80211_tx_info *info, | 2206 | struct ieee80211_tx_info *info, |
2205 | struct iwl3945_cmd *cmd, | 2207 | struct iwl_cmd *cmd, |
2206 | struct sk_buff *skb_frag, | 2208 | struct sk_buff *skb_frag, |
2207 | int last_frag) | 2209 | int last_frag) |
2208 | { | 2210 | { |
@@ -2251,7 +2253,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv, | |||
2251 | * handle build REPLY_TX command notification. | 2253 | * handle build REPLY_TX command notification. |
2252 | */ | 2254 | */ |
2253 | static void iwl3945_build_tx_cmd_basic(struct iwl_priv *priv, | 2255 | static void iwl3945_build_tx_cmd_basic(struct iwl_priv *priv, |
2254 | struct iwl3945_cmd *cmd, | 2256 | struct iwl_cmd *cmd, |
2255 | struct ieee80211_tx_info *info, | 2257 | struct ieee80211_tx_info *info, |
2256 | struct ieee80211_hdr *hdr, | 2258 | struct ieee80211_hdr *hdr, |
2257 | int is_unicast, u8 std_id) | 2259 | int is_unicast, u8 std_id) |
@@ -2386,7 +2388,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
2386 | struct iwl_queue *q = NULL; | 2388 | struct iwl_queue *q = NULL; |
2387 | dma_addr_t phys_addr; | 2389 | dma_addr_t phys_addr; |
2388 | dma_addr_t txcmd_phys; | 2390 | dma_addr_t txcmd_phys; |
2389 | struct iwl3945_cmd *out_cmd = NULL; | 2391 | struct iwl_cmd *out_cmd = NULL; |
2390 | u16 len, idx, len_org, hdr_len; | 2392 | u16 len, idx, len_org, hdr_len; |
2391 | u8 id; | 2393 | u8 id; |
2392 | u8 unicast; | 2394 | u8 unicast; |
@@ -2514,8 +2516,8 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
2514 | 2516 | ||
2515 | /* Physical address of this Tx command's header (not MAC header!), | 2517 | /* Physical address of this Tx command's header (not MAC header!), |
2516 | * within command buffer array. */ | 2518 | * within command buffer array. */ |
2517 | txcmd_phys = txq->dma_addr_cmd + sizeof(struct iwl3945_cmd) * idx + | 2519 | txcmd_phys = txq->dma_addr_cmd + sizeof(struct iwl_cmd) * idx + |
2518 | offsetof(struct iwl3945_cmd, hdr); | 2520 | offsetof(struct iwl_cmd, hdr); |
2519 | 2521 | ||
2520 | /* Add buffer containing Tx command and MAC(!) header to TFD's | 2522 | /* Add buffer containing Tx command and MAC(!) header to TFD's |
2521 | * first entry */ | 2523 | * first entry */ |
@@ -2793,7 +2795,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv, | |||
2793 | { | 2795 | { |
2794 | struct iwl_spectrum_cmd spectrum; | 2796 | struct iwl_spectrum_cmd spectrum; |
2795 | struct iwl_rx_packet *res; | 2797 | struct iwl_rx_packet *res; |
2796 | struct iwl3945_host_cmd cmd = { | 2798 | struct iwl_host_cmd cmd = { |
2797 | .id = REPLY_SPECTRUM_MEASUREMENT_CMD, | 2799 | .id = REPLY_SPECTRUM_MEASUREMENT_CMD, |
2798 | .data = (void *)&spectrum, | 2800 | .data = (void *)&spectrum, |
2799 | .meta.flags = CMD_WANT_SKB, | 2801 | .meta.flags = CMD_WANT_SKB, |
@@ -3271,7 +3273,7 @@ static void iwl3945_tx_cmd_complete(struct iwl_priv *priv, | |||
3271 | int index = SEQ_TO_INDEX(sequence); | 3273 | int index = SEQ_TO_INDEX(sequence); |
3272 | int huge = !!(pkt->hdr.sequence & SEQ_HUGE_FRAME); | 3274 | int huge = !!(pkt->hdr.sequence & SEQ_HUGE_FRAME); |
3273 | int cmd_index; | 3275 | int cmd_index; |
3274 | struct iwl3945_cmd *cmd; | 3276 | struct iwl_cmd *cmd; |
3275 | 3277 | ||
3276 | BUG_ON(txq_id != IWL_CMD_QUEUE_NUM); | 3278 | BUG_ON(txq_id != IWL_CMD_QUEUE_NUM); |
3277 | 3279 | ||
@@ -5974,7 +5976,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
5974 | { | 5976 | { |
5975 | struct iwl_priv *priv = | 5977 | struct iwl_priv *priv = |
5976 | container_of(data, struct iwl_priv, request_scan); | 5978 | container_of(data, struct iwl_priv, request_scan); |
5977 | struct iwl3945_host_cmd cmd = { | 5979 | struct iwl_host_cmd cmd = { |
5978 | .id = REPLY_SCAN_CMD, | 5980 | .id = REPLY_SCAN_CMD, |
5979 | .len = sizeof(struct iwl3945_scan_cmd), | 5981 | .len = sizeof(struct iwl3945_scan_cmd), |
5980 | .meta.flags = CMD_SIZE_HUGE, | 5982 | .meta.flags = CMD_SIZE_HUGE, |