Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142739554
D52712.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D52712.diff
View Options
diff --git a/sys/dev/rtwn/if_rtwn_cam.c b/sys/dev/rtwn/if_rtwn_cam.c
--- a/sys/dev/rtwn/if_rtwn_cam.c
+++ b/sys/dev/rtwn/if_rtwn_cam.c
@@ -182,6 +182,7 @@
static int
rtwn_key_set_cb0(struct rtwn_softc *sc, const struct ieee80211_key *k)
{
+ const char *key_data;
uint8_t algo, keyid;
int i, error;
@@ -194,7 +195,7 @@
/* Map net80211 cipher to HW crypto algorithm. */
switch (k->wk_cipher->ic_cipher) {
case IEEE80211_CIPHER_WEP:
- if (k->wk_keylen < 8)
+ if (ieee80211_crypto_get_key_len(k) < 8)
algo = R92C_CAM_ALGO_WEP40;
else
algo = R92C_CAM_ALGO_WEP104;
@@ -211,11 +212,18 @@
return (EINVAL);
}
+ /* Get key data. */
+ key_data = ieee80211_crypto_get_key_data(k);
+ if (key_data == NULL) {
+ error = ENXIO;
+ goto fail;
+ }
+
RTWN_DPRINTF(sc, RTWN_DEBUG_KEY,
"%s: keyix %u, keyid %u, algo %u/%u, flags %04X, len %u, "
"macaddr %s\n", __func__, k->wk_keyix, keyid,
- k->wk_cipher->ic_cipher, algo, k->wk_flags, k->wk_keylen,
- ether_sprintf(k->wk_macaddr));
+ k->wk_cipher->ic_cipher, algo, k->wk_flags,
+ ieee80211_crypto_get_key_len(k), ether_sprintf(k->wk_macaddr));
/* Clear high bits. */
rtwn_cam_write(sc, R92C_CAM_CTL6(k->wk_keyix), 0);
@@ -224,7 +232,7 @@
/* Write key. */
for (i = 0; i < 4; i++) {
error = rtwn_cam_write(sc, R92C_CAM_KEY(k->wk_keyix, i),
- le32dec(&k->wk_key[i * 4]));
+ le32dec(&key_data[i * 4]));
if (error != 0)
goto fail;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 23, 10:57 PM (11 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
22897138
Default Alt Text
D52712.diff (1 KB)
Attached To
Mode
D52712: rtwn: migrate to new ieee80211 key data accessors
Attached
Detach File
Event Timeline
Log In to Comment