diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-12-02 16:50:33 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-05 09:35:56 -0500 |
commit | 74415edb042ef9f3b1291f978763687f35aadbb3 (patch) | |
tree | 395b690a7f5f0fdf0af97f5b6f922f8064770ab8 | |
parent | 011a03300bdd60782f465b97c3aefd58bfaae316 (diff) |
rt2x00: Add RXDONE_CRYPTO_IV/ICV flags
Drivers should notify rt2x00lib when they provide
the IV/ICV data. This adds some flexibility to drivers
which can't provide all information.
* rt2500usb provides ICV inside the frame
* rt2800pci doesn't provide IV/ICV
* rt2800usb doesn't provide IV/ICV
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 3 |
5 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 90bf0b96caa3..30028e2422fc 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1330,6 +1330,8 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry, | |||
1330 | if (rxdesc->cipher != CIPHER_NONE) { | 1330 | if (rxdesc->cipher != CIPHER_NONE) { |
1331 | _rt2x00_desc_read(rxd, 2, &rxdesc->iv[0]); | 1331 | _rt2x00_desc_read(rxd, 2, &rxdesc->iv[0]); |
1332 | _rt2x00_desc_read(rxd, 3, &rxdesc->iv[1]); | 1332 | _rt2x00_desc_read(rxd, 3, &rxdesc->iv[1]); |
1333 | rxdesc->dev_flags |= RXDONE_CRYPTO_IV; | ||
1334 | |||
1333 | /* ICV is located at the end of frame */ | 1335 | /* ICV is located at the end of frame */ |
1334 | 1336 | ||
1335 | /* | 1337 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 7fc1d766062b..6d92542fcf0d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -636,7 +636,8 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev, | |||
636 | * provided seperately (through hardware descriptor) | 636 | * provided seperately (through hardware descriptor) |
637 | * in which case we should reinsert the data into the frame. | 637 | * in which case we should reinsert the data into the frame. |
638 | */ | 638 | */ |
639 | if ((rxdesc.flags & RX_FLAG_IV_STRIPPED)) { | 639 | if ((rxdesc.dev_flags & RXDONE_CRYPTO_IV) && |
640 | (rxdesc.flags & RX_FLAG_IV_STRIPPED)) { | ||
640 | rt2x00crypto_rx_insert_iv(entry->skb, align, | 641 | rt2x00crypto_rx_insert_iv(entry->skb, align, |
641 | header_length, &rxdesc); | 642 | header_length, &rxdesc); |
642 | } else if (align) { | 643 | } else if (align) { |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index 7889f914b0ef..282937153408 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h | |||
@@ -146,11 +146,15 @@ static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb) | |||
146 | * @RXDONE_SIGNAL_PLCP: Signal field contains the plcp value. | 146 | * @RXDONE_SIGNAL_PLCP: Signal field contains the plcp value. |
147 | * @RXDONE_SIGNAL_BITRATE: Signal field contains the bitrate value. | 147 | * @RXDONE_SIGNAL_BITRATE: Signal field contains the bitrate value. |
148 | * @RXDONE_MY_BSS: Does this frame originate from device's BSS. | 148 | * @RXDONE_MY_BSS: Does this frame originate from device's BSS. |
149 | * @RXDONE_CRYPTO_IV: Driver provided IV/EIV data. | ||
150 | * @RXDONE_CRYPTO_ICV: Driver provided ICV data. | ||
149 | */ | 151 | */ |
150 | enum rxdone_entry_desc_flags { | 152 | enum rxdone_entry_desc_flags { |
151 | RXDONE_SIGNAL_PLCP = 1 << 0, | 153 | RXDONE_SIGNAL_PLCP = 1 << 0, |
152 | RXDONE_SIGNAL_BITRATE = 1 << 1, | 154 | RXDONE_SIGNAL_BITRATE = 1 << 1, |
153 | RXDONE_MY_BSS = 1 << 2, | 155 | RXDONE_MY_BSS = 1 << 2, |
156 | RXDONE_CRYPTO_IV = 1 << 3, | ||
157 | RXDONE_CRYPTO_ICV = 1 << 4, | ||
154 | }; | 158 | }; |
155 | 159 | ||
156 | /** | 160 | /** |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index c1ebb658b6c4..987e89009f74 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -1951,7 +1951,10 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry, | |||
1951 | if (rxdesc->cipher != CIPHER_NONE) { | 1951 | if (rxdesc->cipher != CIPHER_NONE) { |
1952 | _rt2x00_desc_read(entry_priv->desc, 2, &rxdesc->iv[0]); | 1952 | _rt2x00_desc_read(entry_priv->desc, 2, &rxdesc->iv[0]); |
1953 | _rt2x00_desc_read(entry_priv->desc, 3, &rxdesc->iv[1]); | 1953 | _rt2x00_desc_read(entry_priv->desc, 3, &rxdesc->iv[1]); |
1954 | rxdesc->dev_flags |= RXDONE_CRYPTO_IV; | ||
1955 | |||
1954 | _rt2x00_desc_read(entry_priv->desc, 4, &rxdesc->icv); | 1956 | _rt2x00_desc_read(entry_priv->desc, 4, &rxdesc->icv); |
1957 | rxdesc->dev_flags |= RXDONE_CRYPTO_ICV; | ||
1955 | 1958 | ||
1956 | /* | 1959 | /* |
1957 | * Hardware has stripped IV/EIV data from 802.11 frame during | 1960 | * Hardware has stripped IV/EIV data from 802.11 frame during |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 3c8b235bbdfb..d638a8a59370 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1620,7 +1620,10 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry, | |||
1620 | if (rxdesc->cipher != CIPHER_NONE) { | 1620 | if (rxdesc->cipher != CIPHER_NONE) { |
1621 | _rt2x00_desc_read(rxd, 2, &rxdesc->iv[0]); | 1621 | _rt2x00_desc_read(rxd, 2, &rxdesc->iv[0]); |
1622 | _rt2x00_desc_read(rxd, 3, &rxdesc->iv[1]); | 1622 | _rt2x00_desc_read(rxd, 3, &rxdesc->iv[1]); |
1623 | rxdesc->dev_flags |= RXDONE_CRYPTO_IV; | ||
1624 | |||
1623 | _rt2x00_desc_read(rxd, 4, &rxdesc->icv); | 1625 | _rt2x00_desc_read(rxd, 4, &rxdesc->icv); |
1626 | rxdesc->dev_flags |= RXDONE_CRYPTO_ICV; | ||
1624 | 1627 | ||
1625 | /* | 1628 | /* |
1626 | * Hardware has stripped IV/EIV data from 802.11 frame during | 1629 | * Hardware has stripped IV/EIV data from 802.11 frame during |