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 | |
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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-led.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.h | 61 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 54 |
5 files changed, 44 insertions, 99 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-led.c b/drivers/net/wireless/iwlwifi/iwl-3945-led.c index 958e705ec336..10e68d64e6c7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-led.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-led.c | |||
@@ -68,7 +68,7 @@ static const struct { | |||
68 | #define IWL_SOLID_BLINK_IDX (ARRAY_SIZE(blink_tbl) - 1) | 68 | #define IWL_SOLID_BLINK_IDX (ARRAY_SIZE(blink_tbl) - 1) |
69 | 69 | ||
70 | static int iwl3945_led_cmd_callback(struct iwl_priv *priv, | 70 | static int iwl3945_led_cmd_callback(struct iwl_priv *priv, |
71 | struct iwl3945_cmd *cmd, | 71 | struct iwl_cmd *cmd, |
72 | struct sk_buff *skb) | 72 | struct sk_buff *skb) |
73 | { | 73 | { |
74 | return 1; | 74 | return 1; |
@@ -83,7 +83,7 @@ static inline int iwl3945_brightness_to_idx(enum led_brightness brightness) | |||
83 | static int iwl_send_led_cmd(struct iwl_priv *priv, | 83 | static int iwl_send_led_cmd(struct iwl_priv *priv, |
84 | struct iwl_led_cmd *led_cmd) | 84 | struct iwl_led_cmd *led_cmd) |
85 | { | 85 | { |
86 | struct iwl3945_host_cmd cmd = { | 86 | struct iwl_host_cmd cmd = { |
87 | .id = REPLY_LEDS_CMD, | 87 | .id = REPLY_LEDS_CMD, |
88 | .len = sizeof(struct iwl_led_cmd), | 88 | .len = sizeof(struct iwl_led_cmd), |
89 | .data = led_cmd, | 89 | .data = led_cmd, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 8cf40bcd6a05..422de88f128e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -826,8 +826,7 @@ u8 iwl3945_hw_find_station(struct iwl_priv *priv, const u8 *addr) | |||
826 | * iwl3945_hw_build_tx_cmd_rate - Add rate portion to TX_CMD: | 826 | * iwl3945_hw_build_tx_cmd_rate - Add rate portion to TX_CMD: |
827 | * | 827 | * |
828 | */ | 828 | */ |
829 | void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, | 829 | void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct iwl_cmd *cmd, |
830 | struct iwl3945_cmd *cmd, | ||
831 | struct ieee80211_tx_info *info, | 830 | struct ieee80211_tx_info *info, |
832 | struct ieee80211_hdr *hdr, int sta_id, int tx_id) | 831 | struct ieee80211_hdr *hdr, int sta_id, int tx_id) |
833 | { | 832 | { |
@@ -839,9 +838,10 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, | |||
839 | u8 data_retry_limit; | 838 | u8 data_retry_limit; |
840 | __le32 tx_flags; | 839 | __le32 tx_flags; |
841 | __le16 fc = hdr->frame_control; | 840 | __le16 fc = hdr->frame_control; |
841 | struct iwl3945_tx_cmd *tx = (struct iwl3945_tx_cmd *)cmd->cmd.payload; | ||
842 | 842 | ||
843 | rate = iwl3945_rates[rate_index].plcp; | 843 | rate = iwl3945_rates[rate_index].plcp; |
844 | tx_flags = cmd->cmd.tx.tx_flags; | 844 | tx_flags = tx->tx_flags; |
845 | 845 | ||
846 | /* We need to figure out how to get the sta->supp_rates while | 846 | /* We need to figure out how to get the sta->supp_rates while |
847 | * in this running context */ | 847 | * in this running context */ |
@@ -878,22 +878,22 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, | |||
878 | } | 878 | } |
879 | } | 879 | } |
880 | 880 | ||
881 | cmd->cmd.tx.rts_retry_limit = rts_retry_limit; | 881 | tx->rts_retry_limit = rts_retry_limit; |
882 | cmd->cmd.tx.data_retry_limit = data_retry_limit; | 882 | tx->data_retry_limit = data_retry_limit; |
883 | cmd->cmd.tx.rate = rate; | 883 | tx->rate = rate; |
884 | cmd->cmd.tx.tx_flags = tx_flags; | 884 | tx->tx_flags = tx_flags; |
885 | 885 | ||
886 | /* OFDM */ | 886 | /* OFDM */ |
887 | cmd->cmd.tx.supp_rates[0] = | 887 | tx->supp_rates[0] = |
888 | ((rate_mask & IWL_OFDM_RATES_MASK) >> IWL_FIRST_OFDM_RATE) & 0xFF; | 888 | ((rate_mask & IWL_OFDM_RATES_MASK) >> IWL_FIRST_OFDM_RATE) & 0xFF; |
889 | 889 | ||
890 | /* CCK */ | 890 | /* CCK */ |
891 | cmd->cmd.tx.supp_rates[1] = (rate_mask & 0xF); | 891 | tx->supp_rates[1] = (rate_mask & 0xF); |
892 | 892 | ||
893 | IWL_DEBUG_RATE("Tx sta id: %d, rate: %d (plcp), flags: 0x%4X " | 893 | IWL_DEBUG_RATE("Tx sta id: %d, rate: %d (plcp), flags: 0x%4X " |
894 | "cck/ofdm mask: 0x%x/0x%x\n", sta_id, | 894 | "cck/ofdm mask: 0x%x/0x%x\n", sta_id, |
895 | cmd->cmd.tx.rate, le32_to_cpu(cmd->cmd.tx.tx_flags), | 895 | tx->rate, le32_to_cpu(tx->tx_flags), |
896 | cmd->cmd.tx.supp_rates[1], cmd->cmd.tx.supp_rates[0]); | 896 | tx->supp_rates[1], tx->supp_rates[0]); |
897 | } | 897 | } |
898 | 898 | ||
899 | u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags) | 899 | u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index 63bf832ef762..18424a308d12 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h | |||
@@ -147,62 +147,6 @@ struct iwl3945_frame { | |||
147 | #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) | 147 | #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) |
148 | #define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) | 148 | #define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) |
149 | 149 | ||
150 | struct iwl3945_cmd; | ||
151 | struct iwl_priv; | ||
152 | |||
153 | struct iwl3945_cmd_meta { | ||
154 | struct iwl3945_cmd_meta *source; | ||
155 | union { | ||
156 | struct sk_buff *skb; | ||
157 | int (*callback)(struct iwl_priv *priv, | ||
158 | struct iwl3945_cmd *cmd, struct sk_buff *skb); | ||
159 | } __attribute__ ((packed)) u; | ||
160 | |||
161 | /* The CMD_SIZE_HUGE flag bit indicates that the command | ||
162 | * structure is stored at the end of the shared queue memory. */ | ||
163 | u32 flags; | ||
164 | |||
165 | } __attribute__ ((packed)); | ||
166 | |||
167 | /** | ||
168 | * struct iwl3945_cmd | ||
169 | * | ||
170 | * For allocation of the command and tx queues, this establishes the overall | ||
171 | * size of the largest command we send to uCode, except for a scan command | ||
172 | * (which is relatively huge; space is allocated separately). | ||
173 | */ | ||
174 | struct iwl3945_cmd { | ||
175 | struct iwl3945_cmd_meta meta; | ||
176 | struct iwl_cmd_header hdr; | ||
177 | union { | ||
178 | struct iwl3945_addsta_cmd addsta; | ||
179 | struct iwl_led_cmd led; | ||
180 | u32 flags; | ||
181 | u8 val8; | ||
182 | u16 val16; | ||
183 | u32 val32; | ||
184 | struct iwl_bt_cmd bt; | ||
185 | struct iwl_rxon_time_cmd rxon_time; | ||
186 | struct iwl_powertable_cmd powertable; | ||
187 | struct iwl_qosparam_cmd qosparam; | ||
188 | struct iwl3945_tx_cmd tx; | ||
189 | struct iwl3945_tx_beacon_cmd tx_beacon; | ||
190 | struct iwl3945_rxon_assoc_cmd rxon_assoc; | ||
191 | u8 *indirect; | ||
192 | u8 payload[360]; | ||
193 | } __attribute__ ((packed)) cmd; | ||
194 | } __attribute__ ((packed)); | ||
195 | |||
196 | struct iwl3945_host_cmd { | ||
197 | u8 id; | ||
198 | u16 len; | ||
199 | struct iwl3945_cmd_meta meta; | ||
200 | const void *data; | ||
201 | }; | ||
202 | |||
203 | #define TFD39_MAX_PAYLOAD_SIZE (sizeof(struct iwl3945_cmd) - \ | ||
204 | sizeof(struct iwl3945_cmd_meta)) | ||
205 | |||
206 | /* | 150 | /* |
207 | * RX related structures and functions | 151 | * RX related structures and functions |
208 | */ | 152 | */ |
@@ -288,7 +232,7 @@ extern void iwl3945_tx_queue_free(struct iwl_priv *priv, struct iwl3945_tx_queue | |||
288 | extern int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, | 232 | extern int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, |
289 | const void *data); | 233 | const void *data); |
290 | extern int __must_check iwl3945_send_cmd(struct iwl_priv *priv, | 234 | extern int __must_check iwl3945_send_cmd(struct iwl_priv *priv, |
291 | struct iwl3945_host_cmd *cmd); | 235 | struct iwl_host_cmd *cmd); |
292 | extern unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv, | 236 | extern unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv, |
293 | struct ieee80211_hdr *hdr,int left); | 237 | struct ieee80211_hdr *hdr,int left); |
294 | extern int iwl3945_rx_queue_update_write_ptr(struct iwl_priv *priv, | 238 | extern int iwl3945_rx_queue_update_write_ptr(struct iwl_priv *priv, |
@@ -340,8 +284,7 @@ extern int iwl3945_hw_tx_queue_init(struct iwl_priv *priv, | |||
340 | extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl_priv *priv, | 284 | extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl_priv *priv, |
341 | struct iwl3945_frame *frame, u8 rate); | 285 | struct iwl3945_frame *frame, u8 rate); |
342 | extern int iwl3945_hw_get_rx_read(struct iwl_priv *priv); | 286 | extern int iwl3945_hw_get_rx_read(struct iwl_priv *priv); |
343 | extern void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, | 287 | void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct iwl_cmd *cmd, |
344 | struct iwl3945_cmd *cmd, | ||
345 | struct ieee80211_tx_info *info, | 288 | struct ieee80211_tx_info *info, |
346 | struct ieee80211_hdr *hdr, | 289 | struct ieee80211_hdr *hdr, |
347 | int sta_id, int tx_id); | 290 | int sta_id, int tx_id); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 5cc6c5e1865c..6a07a686f85c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -240,7 +240,7 @@ struct iwl_channel_info { | |||
240 | struct iwl3945_tx_queue { | 240 | struct iwl3945_tx_queue { |
241 | struct iwl_queue q; | 241 | struct iwl_queue q; |
242 | struct iwl3945_tfd_frame *bd; | 242 | struct iwl3945_tfd_frame *bd; |
243 | struct iwl3945_cmd *cmd; | 243 | struct iwl_cmd *cmd; |
244 | dma_addr_t dma_addr_cmd; | 244 | dma_addr_t dma_addr_cmd; |
245 | struct iwl3945_tx_info *txb; | 245 | struct iwl3945_tx_info *txb; |
246 | int need_update; | 246 | int need_update; |
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, |