aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt61pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt61pci.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.h38
1 files changed, 24 insertions, 14 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.h b/drivers/net/wireless/rt2x00/rt61pci.h
index 1004d5b899e6..8ec1451308cc 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.h
+++ b/drivers/net/wireless/rt2x00/rt61pci.h
@@ -134,6 +134,16 @@
134#define PAIRWISE_KEY_TABLE_BASE 0x1200 134#define PAIRWISE_KEY_TABLE_BASE 0x1200
135#define PAIRWISE_TA_TABLE_BASE 0x1a00 135#define PAIRWISE_TA_TABLE_BASE 0x1a00
136 136
137#define SHARED_KEY_ENTRY(__idx) \
138 ( SHARED_KEY_TABLE_BASE + \
139 ((__idx) * sizeof(struct hw_key_entry)) )
140#define PAIRWISE_KEY_ENTRY(__idx) \
141 ( PAIRWISE_KEY_TABLE_BASE + \
142 ((__idx) * sizeof(struct hw_key_entry)) )
143#define PAIRWISE_TA_ENTRY(__idx) \
144 ( PAIRWISE_TA_TABLE_BASE + \
145 ((__idx) * sizeof(struct hw_pairwise_ta_entry)) )
146
137struct hw_key_entry { 147struct hw_key_entry {
138 u8 key[16]; 148 u8 key[16];
139 u8 tx_mic[8]; 149 u8 tx_mic[8];
@@ -142,7 +152,8 @@ struct hw_key_entry {
142 152
143struct hw_pairwise_ta_entry { 153struct hw_pairwise_ta_entry {
144 u8 address[6]; 154 u8 address[6];
145 u8 reserved[2]; 155 u8 cipher;
156 u8 reserved;
146} __attribute__ ((packed)); 157} __attribute__ ((packed));
147 158
148/* 159/*
@@ -662,6 +673,10 @@ struct hw_pairwise_ta_entry {
662 * SEC_CSR4: Pairwise key table lookup control. 673 * SEC_CSR4: Pairwise key table lookup control.
663 */ 674 */
664#define SEC_CSR4 0x30b0 675#define SEC_CSR4 0x30b0
676#define SEC_CSR4_ENABLE_BSS0 FIELD32(0x00000001)
677#define SEC_CSR4_ENABLE_BSS1 FIELD32(0x00000002)
678#define SEC_CSR4_ENABLE_BSS2 FIELD32(0x00000004)
679#define SEC_CSR4_ENABLE_BSS3 FIELD32(0x00000008)
665 680
666/* 681/*
667 * SEC_CSR5: shared key table security mode register. 682 * SEC_CSR5: shared key table security mode register.
@@ -1428,8 +1443,10 @@ struct hw_pairwise_ta_entry {
1428 1443
1429/* 1444/*
1430 * Word4 1445 * Word4
1446 * ICV: Received ICV of originally encrypted.
1447 * NOTE: This is a guess, the official definition is "reserved"
1431 */ 1448 */
1432#define RXD_W4_RESERVED FIELD32(0xffffffff) 1449#define RXD_W4_ICV FIELD32(0xffffffff)
1433 1450
1434/* 1451/*
1435 * the above 20-byte is called RXINFO and will be DMAed to MAC RX block 1452 * the above 20-byte is called RXINFO and will be DMAed to MAC RX block
@@ -1465,17 +1482,10 @@ struct hw_pairwise_ta_entry {
1465#define MAX_TXPOWER 31 1482#define MAX_TXPOWER 31
1466#define DEFAULT_TXPOWER 24 1483#define DEFAULT_TXPOWER 24
1467 1484
1468#define TXPOWER_FROM_DEV(__txpower) \ 1485#define TXPOWER_FROM_DEV(__txpower) \
1469({ \ 1486 (((u8)(__txpower)) > MAX_TXPOWER) ? DEFAULT_TXPOWER : (__txpower)
1470 ((__txpower) > MAX_TXPOWER) ? \ 1487
1471 DEFAULT_TXPOWER : (__txpower); \ 1488#define TXPOWER_TO_DEV(__txpower) \
1472}) 1489 clamp_t(char, __txpower, MIN_TXPOWER, MAX_TXPOWER)
1473
1474#define TXPOWER_TO_DEV(__txpower) \
1475({ \
1476 ((__txpower) <= MIN_TXPOWER) ? MIN_TXPOWER : \
1477 (((__txpower) >= MAX_TXPOWER) ? MAX_TXPOWER : \
1478 (__txpower)); \
1479})
1480 1490
1481#endif /* RT61PCI_H */ 1491#endif /* RT61PCI_H */