aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.h
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-12-02 12:19:48 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-05 09:35:50 -0500
commit1ce9cdac482f0dfbbd22ba4b3e5c016a05543a42 (patch)
tree90ffda49f6558137efc2760f4badac6de791c49a /drivers/net/wireless/rt2x00/rt2x00queue.h
parentaac9207e45b1ec1f36d67e57d94f59ac036d37ee (diff)
rt2x00: Optimize IV/EIV handling
IV and EIV belong to eachother and don't require 2 seperate fields. Instead they can logically be merged into a single array with size 2. With this approach we can simplify the code in rt2x00crypto.c by using a single memcpy() when copying the iv/eiv data. Additionally we can move some code out of if-statements because the if-statement would always be true. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
index 2e99ab53ec65..7889f914b0ef 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
@@ -109,8 +109,7 @@ enum skb_frame_desc_flags {
109 * @desc: Pointer to descriptor part of the frame. 109 * @desc: Pointer to descriptor part of the frame.
110 * Note that this pointer could point to something outside 110 * Note that this pointer could point to something outside
111 * of the scope of the skb->data pointer. 111 * of the scope of the skb->data pointer.
112 * @iv: IV data used during encryption/decryption. 112 * @iv: IV/EIV data used during encryption/decryption.
113 * @eiv: EIV data used during encryption/decryption.
114 * @skb_dma: (PCI-only) the DMA address associated with the sk buffer. 113 * @skb_dma: (PCI-only) the DMA address associated with the sk buffer.
115 * @entry: The entry to which this sk buffer belongs. 114 * @entry: The entry to which this sk buffer belongs.
116 */ 115 */
@@ -123,8 +122,7 @@ struct skb_frame_desc {
123 122
124 void *desc; 123 void *desc;
125 124
126 __le32 iv; 125 __le32 iv[2];
127 __le32 eiv;
128 126
129 dma_addr_t skb_dma; 127 dma_addr_t skb_dma;
130 128
@@ -168,8 +166,7 @@ enum rxdone_entry_desc_flags {
168 * @dev_flags: Ralink receive flags (See &enum rxdone_entry_desc_flags). 166 * @dev_flags: Ralink receive flags (See &enum rxdone_entry_desc_flags).
169 * @cipher: Cipher type used during decryption. 167 * @cipher: Cipher type used during decryption.
170 * @cipher_status: Decryption status. 168 * @cipher_status: Decryption status.
171 * @iv: IV data used during decryption. 169 * @iv: IV/EIV data used during decryption.
172 * @eiv: EIV data used during decryption.
173 * @icv: ICV data used during decryption. 170 * @icv: ICV data used during decryption.
174 */ 171 */
175struct rxdone_entry_desc { 172struct rxdone_entry_desc {
@@ -182,8 +179,7 @@ struct rxdone_entry_desc {
182 u8 cipher; 179 u8 cipher;
183 u8 cipher_status; 180 u8 cipher_status;
184 181
185 __le32 iv; 182 __le32 iv[2];
186 __le32 eiv;
187 __le32 icv; 183 __le32 icv;
188}; 184};
189 185