aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.c
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/rt73usb.c
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/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 37a782dc8080..3c8b235bbdfb 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1428,8 +1428,8 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1428 rt2x00_desc_write(txd, 2, word); 1428 rt2x00_desc_write(txd, 2, word);
1429 1429
1430 if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags)) { 1430 if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags)) {
1431 _rt2x00_desc_write(txd, 3, skbdesc->iv); 1431 _rt2x00_desc_write(txd, 3, skbdesc->iv[0]);
1432 _rt2x00_desc_write(txd, 4, skbdesc->eiv); 1432 _rt2x00_desc_write(txd, 4, skbdesc->iv[1]);
1433 } 1433 }
1434 1434
1435 rt2x00_desc_read(txd, 5, &word); 1435 rt2x00_desc_read(txd, 5, &word);
@@ -1618,8 +1618,8 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,
1618 } 1618 }
1619 1619
1620 if (rxdesc->cipher != CIPHER_NONE) { 1620 if (rxdesc->cipher != CIPHER_NONE) {
1621 _rt2x00_desc_read(rxd, 2, &rxdesc->iv); 1621 _rt2x00_desc_read(rxd, 2, &rxdesc->iv[0]);
1622 _rt2x00_desc_read(rxd, 3, &rxdesc->eiv); 1622 _rt2x00_desc_read(rxd, 3, &rxdesc->iv[1]);
1623 _rt2x00_desc_read(rxd, 4, &rxdesc->icv); 1623 _rt2x00_desc_read(rxd, 4, &rxdesc->icv);
1624 1624
1625 /* 1625 /*