iPXE
ath_key.c File Reference
#include "ath.h"
#include "reg.h"

Go to the source code of this file.

Macros

#define REG_READ   (common->ops->read)
#define REG_WRITE(_ah, _reg, _val)
#define ENABLE_REGWRITE_BUFFER(_ah)
#define REGWRITE_BUFFER_FLUSH(_ah)
#define IEEE80211_WEP_NKID   4 /* number of key ids */

Functions

 FILE_SECBOOT (FORBIDDEN)
int ath_hw_keyreset (struct ath_common *common, u16 entry)

Macro Definition Documentation

◆ REG_READ

#define REG_READ   (common->ops->read)

Definition at line 26 of file ath_key.c.

Referenced by ath_hw_keyreset().

◆ REG_WRITE

#define REG_WRITE ( _ah,
_reg,
_val )
Value:
(common->ops->write)(_ah, _val, _reg)
struct ib_cm_common common
Definition ib_mad.h:0

Definition at line 27 of file ath_key.c.

Referenced by ath_hw_keyreset().

◆ ENABLE_REGWRITE_BUFFER

#define ENABLE_REGWRITE_BUFFER ( _ah)
Value:
if (common->ops->enable_write_buffer) \
common->ops->enable_write_buffer((_ah));

Definition at line 28 of file ath_key.c.

28#define ENABLE_REGWRITE_BUFFER(_ah) \
29 if (common->ops->enable_write_buffer) \
30 common->ops->enable_write_buffer((_ah));

Referenced by ath_hw_keyreset().

◆ REGWRITE_BUFFER_FLUSH

#define REGWRITE_BUFFER_FLUSH ( _ah)
Value:
if (common->ops->write_flush) \
common->ops->write_flush((_ah));

Definition at line 32 of file ath_key.c.

32#define REGWRITE_BUFFER_FLUSH(_ah) \
33 if (common->ops->write_flush) \
34 common->ops->write_flush((_ah));

Referenced by ath_hw_keyreset().

◆ IEEE80211_WEP_NKID

#define IEEE80211_WEP_NKID   4 /* number of key ids */

Definition at line 37 of file ath_key.c.

Function Documentation

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN )

◆ ath_hw_keyreset()

int ath_hw_keyreset ( struct ath_common * common,
u16 entry )

Definition at line 43 of file ath_key.c.

44{
45 u32 keyType;
46 void *ah = common->ah;
47
48 if (entry >= common->keymax) {
49 DBG("ath: keycache entry %d out of range\n", entry);
50 return 0;
51 }
52
53 keyType = REG_READ(ah, AR_KEYTABLE_TYPE(entry));
54
56
57 REG_WRITE(ah, AR_KEYTABLE_KEY0(entry), 0);
58 REG_WRITE(ah, AR_KEYTABLE_KEY1(entry), 0);
59 REG_WRITE(ah, AR_KEYTABLE_KEY2(entry), 0);
60 REG_WRITE(ah, AR_KEYTABLE_KEY3(entry), 0);
61 REG_WRITE(ah, AR_KEYTABLE_KEY4(entry), 0);
63 REG_WRITE(ah, AR_KEYTABLE_MAC0(entry), 0);
64 REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), 0);
65
66 if (keyType == AR_KEYTABLE_TYPE_TKIP) {
67 u16 micentry = entry + 64;
68
69 REG_WRITE(ah, AR_KEYTABLE_KEY0(micentry), 0);
70 REG_WRITE(ah, AR_KEYTABLE_KEY1(micentry), 0);
71 REG_WRITE(ah, AR_KEYTABLE_KEY2(micentry), 0);
72 REG_WRITE(ah, AR_KEYTABLE_KEY3(micentry), 0);
73 if (common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) {
74 REG_WRITE(ah, AR_KEYTABLE_KEY4(micentry), 0);
75 REG_WRITE(ah, AR_KEYTABLE_TYPE(micentry),
77 }
78
79 }
80
82
83 return 1;
84}
#define AR_KEYTABLE_TYPE(_n)
Definition reg.h:1887
#define AR_KEYTABLE_MAC1(_n)
Definition reg.h:1889
#define AR_KEYTABLE_KEY1(_n)
Definition reg.h:1883
#define AR_KEYTABLE_KEY2(_n)
Definition reg.h:1884
#define AR_KEYTABLE_KEY0(_n)
Definition reg.h:1882
#define AR_KEYTABLE_MAC0(_n)
Definition reg.h:1888
#define AR_KEYTABLE_KEY3(_n)
Definition reg.h:1885
#define AR_KEYTABLE_TYPE_TKIP
Definition reg.h:1876
#define AR_KEYTABLE_KEY4(_n)
Definition reg.h:1886
#define AR_KEYTABLE_TYPE_CLR
Definition reg.h:1879
@ ATH_CRYPT_CAP_MIC_COMBINED
Definition ath.h:151
#define REGWRITE_BUFFER_FLUSH(_ah)
Definition ath_key.c:32
#define REG_WRITE(_ah, _reg, _val)
Definition ath_key.c:27
#define REG_READ
Definition ath_key.c:26
#define ENABLE_REGWRITE_BUFFER(_ah)
Definition ath_key.c:28
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
uint8_t ah
Definition registers.h:1
#define u16
Definition vga.h:20
#define u32
Definition vga.h:21

References ah, AR_KEYTABLE_KEY0, AR_KEYTABLE_KEY1, AR_KEYTABLE_KEY2, AR_KEYTABLE_KEY3, AR_KEYTABLE_KEY4, AR_KEYTABLE_MAC0, AR_KEYTABLE_MAC1, AR_KEYTABLE_TYPE, AR_KEYTABLE_TYPE_CLR, AR_KEYTABLE_TYPE_TKIP, ATH_CRYPT_CAP_MIC_COMBINED, common, DBG, ENABLE_REGWRITE_BUFFER, REG_READ, REG_WRITE, REGWRITE_BUFFER_FLUSH, u16, and u32.

Referenced by ath9k_init_crypto().