Commit 61e754f4 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville

rt2x00: Implement HW encryption (rt61pci)

rt61pci supports hardware encryption.
rt61pci supports up to 4 shared keys and up to 64 pairwise keys.
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2bb057d0
...@@ -107,6 +107,7 @@ config RT61PCI ...@@ -107,6 +107,7 @@ config RT61PCI
depends on PCI depends on PCI
select RT2X00_LIB_PCI select RT2X00_LIB_PCI
select RT2X00_LIB_FIRMWARE select RT2X00_LIB_FIRMWARE
select RT2X00_LIB_CRYPTO
select CRC_ITU_T select CRC_ITU_T
select EEPROM_93CX6 select EEPROM_93CX6
---help--- ---help---
......
This diff is collapsed.
...@@ -134,6 +134,16 @@ ...@@ -134,6 +134,16 @@
#define PAIRWISE_KEY_TABLE_BASE 0x1200 #define PAIRWISE_KEY_TABLE_BASE 0x1200
#define PAIRWISE_TA_TABLE_BASE 0x1a00 #define PAIRWISE_TA_TABLE_BASE 0x1a00
#define SHARED_KEY_ENTRY(__idx) \
( SHARED_KEY_TABLE_BASE + \
((__idx) * sizeof(struct hw_key_entry)) )
#define PAIRWISE_KEY_ENTRY(__idx) \
( PAIRWISE_KEY_TABLE_BASE + \
((__idx) * sizeof(struct hw_key_entry)) )
#define PAIRWISE_TA_ENTRY(__idx) \
( PAIRWISE_TA_TABLE_BASE + \
((__idx) * sizeof(struct hw_pairwise_ta_entry)) )
struct hw_key_entry { struct hw_key_entry {
u8 key[16]; u8 key[16];
u8 tx_mic[8]; u8 tx_mic[8];
...@@ -142,7 +152,8 @@ struct hw_key_entry { ...@@ -142,7 +152,8 @@ struct hw_key_entry {
struct hw_pairwise_ta_entry { struct hw_pairwise_ta_entry {
u8 address[6]; u8 address[6];
u8 reserved[2]; u8 cipher;
u8 reserved;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
...@@ -662,6 +673,10 @@ struct hw_pairwise_ta_entry { ...@@ -662,6 +673,10 @@ struct hw_pairwise_ta_entry {
* SEC_CSR4: Pairwise key table lookup control. * SEC_CSR4: Pairwise key table lookup control.
*/ */
#define SEC_CSR4 0x30b0 #define SEC_CSR4 0x30b0
#define SEC_CSR4_ENABLE_BSS0 FIELD32(0x00000001)
#define SEC_CSR4_ENABLE_BSS1 FIELD32(0x00000002)
#define SEC_CSR4_ENABLE_BSS2 FIELD32(0x00000004)
#define SEC_CSR4_ENABLE_BSS3 FIELD32(0x00000008)
/* /*
* SEC_CSR5: shared key table security mode register. * SEC_CSR5: shared key table security mode register.
...@@ -1428,8 +1443,10 @@ struct hw_pairwise_ta_entry { ...@@ -1428,8 +1443,10 @@ struct hw_pairwise_ta_entry {
/* /*
* Word4 * Word4
* ICV: Received ICV of originally encrypted.
* NOTE: This is a guess, the official definition is "reserved"
*/ */
#define RXD_W4_RESERVED FIELD32(0xffffffff) #define RXD_W4_ICV FIELD32(0xffffffff)
/* /*
* the above 20-byte is called RXINFO and will be DMAed to MAC RX block * the above 20-byte is called RXINFO and will be DMAed to MAC RX block
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment