diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-09-20 18:37:24 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-21 16:19:43 -0400 |
commit | 132f98c2dc702940ed2bb58e7aa48432c2c62f7b (patch) | |
tree | 3e7809c7544639b75ad78a1a1ec6f61a6d0edc91 /drivers | |
parent | 247c61d625154e18a105d663281c52376a882762 (diff) |
iwlagn: simplify the iwl_device_cmd layout
This simplifies both the transport layer and the upper layer.
Kill the union in the device command, which avoids the funny syntax
we had: cmd->cmd.payload.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 10 |
5 files changed, 12 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c index 4aa414a63d6b..abb702da700d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |||
@@ -322,7 +322,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
322 | goto drop_unlock_sta; | 322 | goto drop_unlock_sta; |
323 | 323 | ||
324 | memset(dev_cmd, 0, sizeof(*dev_cmd)); | 324 | memset(dev_cmd, 0, sizeof(*dev_cmd)); |
325 | tx_cmd = &dev_cmd->cmd.tx; | 325 | tx_cmd = (struct iwl_tx_cmd *) dev_cmd->payload; |
326 | 326 | ||
327 | /* Copy MAC header from skb into command buffer */ | 327 | /* Copy MAC header from skb into command buffer */ |
328 | memcpy(tx_cmd->hdr, hdr, hdr_len); | 328 | memcpy(tx_cmd->hdr, hdr, hdr_len); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 7028f907e600..580a4d702ff3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -127,7 +127,7 @@ int iwl_add_sta_callback(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb, | |||
127 | { | 127 | { |
128 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | 128 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
129 | struct iwl_addsta_cmd *addsta = | 129 | struct iwl_addsta_cmd *addsta = |
130 | (struct iwl_addsta_cmd *)cmd->cmd.payload; | 130 | (struct iwl_addsta_cmd *) cmd->payload; |
131 | 131 | ||
132 | return iwl_process_add_sta_resp(priv, addsta, pkt); | 132 | return iwl_process_add_sta_resp(priv, addsta, pkt); |
133 | } | 133 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c index 48ef6c25d5bc..ee7059dcbbcb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | |||
@@ -59,13 +59,15 @@ void iwl_trans_txq_update_byte_cnt_tbl(struct iwl_trans *trans, | |||
59 | u8 sta_id = 0; | 59 | u8 sta_id = 0; |
60 | u16 len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE; | 60 | u16 len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE; |
61 | __le16 bc_ent; | 61 | __le16 bc_ent; |
62 | struct iwl_tx_cmd *tx_cmd = | ||
63 | (struct iwl_tx_cmd *) txq->cmd[txq->q.write_ptr]->payload; | ||
62 | 64 | ||
63 | scd_bc_tbl = trans_pcie->scd_bc_tbls.addr; | 65 | scd_bc_tbl = trans_pcie->scd_bc_tbls.addr; |
64 | 66 | ||
65 | WARN_ON(len > 0xFFF || write_ptr >= TFD_QUEUE_SIZE_MAX); | 67 | WARN_ON(len > 0xFFF || write_ptr >= TFD_QUEUE_SIZE_MAX); |
66 | 68 | ||
67 | sta_id = txq->cmd[txq->q.write_ptr]->cmd.tx.sta_id; | 69 | sta_id = tx_cmd->sta_id; |
68 | sec_ctl = txq->cmd[txq->q.write_ptr]->cmd.tx.sec_ctl; | 70 | sec_ctl = tx_cmd->sec_ctl; |
69 | 71 | ||
70 | switch (sec_ctl & TX_CMD_SEC_MSK) { | 72 | switch (sec_ctl & TX_CMD_SEC_MSK) { |
71 | case TX_CMD_SEC_CCM: | 73 | case TX_CMD_SEC_CCM: |
@@ -353,11 +355,13 @@ static void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_trans *trans, | |||
353 | int read_ptr = txq->q.read_ptr; | 355 | int read_ptr = txq->q.read_ptr; |
354 | u8 sta_id = 0; | 356 | u8 sta_id = 0; |
355 | __le16 bc_ent; | 357 | __le16 bc_ent; |
358 | struct iwl_tx_cmd *tx_cmd = | ||
359 | (struct iwl_tx_cmd *) txq->cmd[txq->q.read_ptr]->payload; | ||
356 | 360 | ||
357 | WARN_ON(read_ptr >= TFD_QUEUE_SIZE_MAX); | 361 | WARN_ON(read_ptr >= TFD_QUEUE_SIZE_MAX); |
358 | 362 | ||
359 | if (txq_id != trans->shrd->cmd_queue) | 363 | if (txq_id != trans->shrd->cmd_queue) |
360 | sta_id = txq->cmd[read_ptr]->cmd.tx.sta_id; | 364 | sta_id = tx_cmd->sta_id; |
361 | 365 | ||
362 | bc_ent = cpu_to_le16(1 | (sta_id << 12)); | 366 | bc_ent = cpu_to_le16(1 | (sta_id << 12)); |
363 | scd_bc_tbl[txq_id].tfd_offset[read_ptr] = bc_ent; | 367 | scd_bc_tbl[txq_id].tfd_offset[read_ptr] = bc_ent; |
@@ -773,7 +777,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | |||
773 | 777 | ||
774 | /* and copy the data that needs to be copied */ | 778 | /* and copy the data that needs to be copied */ |
775 | 779 | ||
776 | cmd_dest = &out_cmd->cmd.payload[0]; | 780 | cmd_dest = out_cmd->payload; |
777 | for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { | 781 | for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { |
778 | if (!cmd->len[i]) | 782 | if (!cmd->len[i]) |
779 | continue; | 783 | continue; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index ca13eebbdb4f..dbb7eb3715c4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |||
@@ -1043,7 +1043,7 @@ static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, | |||
1043 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 1043 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
1044 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1044 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1045 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 1045 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
1046 | struct iwl_tx_cmd *tx_cmd = &dev_cmd->cmd.tx; | 1046 | struct iwl_tx_cmd *tx_cmd = (struct iwl_tx_cmd *) dev_cmd->payload; |
1047 | struct iwl_cmd_meta *out_meta; | 1047 | struct iwl_cmd_meta *out_meta; |
1048 | struct iwl_tx_queue *txq; | 1048 | struct iwl_tx_queue *txq; |
1049 | struct iwl_queue *q; | 1049 | struct iwl_queue *q; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index ddb7741bed66..c5923125c3f9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -97,15 +97,7 @@ enum { | |||
97 | */ | 97 | */ |
98 | struct iwl_device_cmd { | 98 | struct iwl_device_cmd { |
99 | struct iwl_cmd_header hdr; /* uCode API */ | 99 | struct iwl_cmd_header hdr; /* uCode API */ |
100 | union { | 100 | u8 payload[DEF_CMD_PAYLOAD_SIZE]; |
101 | u32 flags; | ||
102 | u8 val8; | ||
103 | u16 val16; | ||
104 | u32 val32; | ||
105 | struct iwl_tx_cmd tx; | ||
106 | struct iwl6000_channel_switch_cmd chswitch; | ||
107 | u8 payload[DEF_CMD_PAYLOAD_SIZE]; | ||
108 | } __packed cmd; | ||
109 | } __packed; | 101 | } __packed; |
110 | 102 | ||
111 | #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_device_cmd)) | 103 | #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_device_cmd)) |