diff options
Diffstat (limited to 'net/mac80211/debugfs_key.c')
-rw-r--r-- | net/mac80211/debugfs_key.c | 55 |
1 files changed, 22 insertions, 33 deletions
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c index 7cd8dd9fc240..4aa47d074a79 100644 --- a/net/mac80211/debugfs_key.c +++ b/net/mac80211/debugfs_key.c | |||
@@ -66,26 +66,13 @@ static ssize_t key_algorithm_read(struct file *file, | |||
66 | char __user *userbuf, | 66 | char __user *userbuf, |
67 | size_t count, loff_t *ppos) | 67 | size_t count, loff_t *ppos) |
68 | { | 68 | { |
69 | char *alg; | 69 | char buf[15]; |
70 | struct ieee80211_key *key = file->private_data; | 70 | struct ieee80211_key *key = file->private_data; |
71 | u32 c = key->conf.cipher; | ||
71 | 72 | ||
72 | switch (key->conf.alg) { | 73 | sprintf(buf, "%.2x-%.2x-%.2x:%d\n", |
73 | case ALG_WEP: | 74 | c >> 24, (c >> 16) & 0xff, (c >> 8) & 0xff, c & 0xff); |
74 | alg = "WEP\n"; | 75 | return simple_read_from_buffer(userbuf, count, ppos, buf, strlen(buf)); |
75 | break; | ||
76 | case ALG_TKIP: | ||
77 | alg = "TKIP\n"; | ||
78 | break; | ||
79 | case ALG_CCMP: | ||
80 | alg = "CCMP\n"; | ||
81 | break; | ||
82 | case ALG_AES_CMAC: | ||
83 | alg = "AES-128-CMAC\n"; | ||
84 | break; | ||
85 | default: | ||
86 | return 0; | ||
87 | } | ||
88 | return simple_read_from_buffer(userbuf, count, ppos, alg, strlen(alg)); | ||
89 | } | 76 | } |
90 | KEY_OPS(algorithm); | 77 | KEY_OPS(algorithm); |
91 | 78 | ||
@@ -97,21 +84,22 @@ static ssize_t key_tx_spec_read(struct file *file, char __user *userbuf, | |||
97 | int len; | 84 | int len; |
98 | struct ieee80211_key *key = file->private_data; | 85 | struct ieee80211_key *key = file->private_data; |
99 | 86 | ||
100 | switch (key->conf.alg) { | 87 | switch (key->conf.cipher) { |
101 | case ALG_WEP: | 88 | case WLAN_CIPHER_SUITE_WEP40: |
89 | case WLAN_CIPHER_SUITE_WEP104: | ||
102 | len = scnprintf(buf, sizeof(buf), "\n"); | 90 | len = scnprintf(buf, sizeof(buf), "\n"); |
103 | break; | 91 | break; |
104 | case ALG_TKIP: | 92 | case WLAN_CIPHER_SUITE_TKIP: |
105 | len = scnprintf(buf, sizeof(buf), "%08x %04x\n", | 93 | len = scnprintf(buf, sizeof(buf), "%08x %04x\n", |
106 | key->u.tkip.tx.iv32, | 94 | key->u.tkip.tx.iv32, |
107 | key->u.tkip.tx.iv16); | 95 | key->u.tkip.tx.iv16); |
108 | break; | 96 | break; |
109 | case ALG_CCMP: | 97 | case WLAN_CIPHER_SUITE_CCMP: |
110 | tpn = key->u.ccmp.tx_pn; | 98 | tpn = key->u.ccmp.tx_pn; |
111 | len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", | 99 | len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", |
112 | tpn[0], tpn[1], tpn[2], tpn[3], tpn[4], tpn[5]); | 100 | tpn[0], tpn[1], tpn[2], tpn[3], tpn[4], tpn[5]); |
113 | break; | 101 | break; |
114 | case ALG_AES_CMAC: | 102 | case WLAN_CIPHER_SUITE_AES_CMAC: |
115 | tpn = key->u.aes_cmac.tx_pn; | 103 | tpn = key->u.aes_cmac.tx_pn; |
116 | len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", | 104 | len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", |
117 | tpn[0], tpn[1], tpn[2], tpn[3], tpn[4], | 105 | tpn[0], tpn[1], tpn[2], tpn[3], tpn[4], |
@@ -132,11 +120,12 @@ static ssize_t key_rx_spec_read(struct file *file, char __user *userbuf, | |||
132 | int i, len; | 120 | int i, len; |
133 | const u8 *rpn; | 121 | const u8 *rpn; |
134 | 122 | ||
135 | switch (key->conf.alg) { | 123 | switch (key->conf.cipher) { |
136 | case ALG_WEP: | 124 | case WLAN_CIPHER_SUITE_WEP40: |
125 | case WLAN_CIPHER_SUITE_WEP104: | ||
137 | len = scnprintf(buf, sizeof(buf), "\n"); | 126 | len = scnprintf(buf, sizeof(buf), "\n"); |
138 | break; | 127 | break; |
139 | case ALG_TKIP: | 128 | case WLAN_CIPHER_SUITE_TKIP: |
140 | for (i = 0; i < NUM_RX_DATA_QUEUES; i++) | 129 | for (i = 0; i < NUM_RX_DATA_QUEUES; i++) |
141 | p += scnprintf(p, sizeof(buf)+buf-p, | 130 | p += scnprintf(p, sizeof(buf)+buf-p, |
142 | "%08x %04x\n", | 131 | "%08x %04x\n", |
@@ -144,7 +133,7 @@ static ssize_t key_rx_spec_read(struct file *file, char __user *userbuf, | |||
144 | key->u.tkip.rx[i].iv16); | 133 | key->u.tkip.rx[i].iv16); |
145 | len = p - buf; | 134 | len = p - buf; |
146 | break; | 135 | break; |
147 | case ALG_CCMP: | 136 | case WLAN_CIPHER_SUITE_CCMP: |
148 | for (i = 0; i < NUM_RX_DATA_QUEUES + 1; i++) { | 137 | for (i = 0; i < NUM_RX_DATA_QUEUES + 1; i++) { |
149 | rpn = key->u.ccmp.rx_pn[i]; | 138 | rpn = key->u.ccmp.rx_pn[i]; |
150 | p += scnprintf(p, sizeof(buf)+buf-p, | 139 | p += scnprintf(p, sizeof(buf)+buf-p, |
@@ -154,7 +143,7 @@ static ssize_t key_rx_spec_read(struct file *file, char __user *userbuf, | |||
154 | } | 143 | } |
155 | len = p - buf; | 144 | len = p - buf; |
156 | break; | 145 | break; |
157 | case ALG_AES_CMAC: | 146 | case WLAN_CIPHER_SUITE_AES_CMAC: |
158 | rpn = key->u.aes_cmac.rx_pn; | 147 | rpn = key->u.aes_cmac.rx_pn; |
159 | p += scnprintf(p, sizeof(buf)+buf-p, | 148 | p += scnprintf(p, sizeof(buf)+buf-p, |
160 | "%02x%02x%02x%02x%02x%02x\n", | 149 | "%02x%02x%02x%02x%02x%02x\n", |
@@ -176,11 +165,11 @@ static ssize_t key_replays_read(struct file *file, char __user *userbuf, | |||
176 | char buf[20]; | 165 | char buf[20]; |
177 | int len; | 166 | int len; |
178 | 167 | ||
179 | switch (key->conf.alg) { | 168 | switch (key->conf.cipher) { |
180 | case ALG_CCMP: | 169 | case WLAN_CIPHER_SUITE_CCMP: |
181 | len = scnprintf(buf, sizeof(buf), "%u\n", key->u.ccmp.replays); | 170 | len = scnprintf(buf, sizeof(buf), "%u\n", key->u.ccmp.replays); |
182 | break; | 171 | break; |
183 | case ALG_AES_CMAC: | 172 | case WLAN_CIPHER_SUITE_AES_CMAC: |
184 | len = scnprintf(buf, sizeof(buf), "%u\n", | 173 | len = scnprintf(buf, sizeof(buf), "%u\n", |
185 | key->u.aes_cmac.replays); | 174 | key->u.aes_cmac.replays); |
186 | break; | 175 | break; |
@@ -198,8 +187,8 @@ static ssize_t key_icverrors_read(struct file *file, char __user *userbuf, | |||
198 | char buf[20]; | 187 | char buf[20]; |
199 | int len; | 188 | int len; |
200 | 189 | ||
201 | switch (key->conf.alg) { | 190 | switch (key->conf.cipher) { |
202 | case ALG_AES_CMAC: | 191 | case WLAN_CIPHER_SUITE_AES_CMAC: |
203 | len = scnprintf(buf, sizeof(buf), "%u\n", | 192 | len = scnprintf(buf, sizeof(buf), "%u\n", |
204 | key->u.aes_cmac.icverrors); | 193 | key->u.aes_cmac.icverrors); |
205 | break; | 194 | break; |