summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/ar5211.c11
-rw-r--r--sys/dev/ic/ar5212.c11
2 files changed, 14 insertions, 8 deletions
diff --git a/sys/dev/ic/ar5211.c b/sys/dev/ic/ar5211.c
index a4840457557..8a1e9429386 100644
--- a/sys/dev/ic/ar5211.c
+++ b/sys/dev/ic/ar5211.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5211.c,v 1.3 2005/03/10 08:30:56 reyk Exp $ */
+/* $OpenBSD: ar5211.c,v 1.4 2005/03/13 18:32:21 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -2028,10 +2028,13 @@ ar5k_ar5211_setKeyCacheEntryMac(hal, entry, mac)
AR5K_ASSERT_ENTRY(entry, AR5K_AR5211_KEYTABLE_SIZE);
offset = AR5K_AR5211_KEYCACHE_SIZE - 2;
+ low_id = high_id = 0;
- /* XXX big endian problems? */
- bcopy(mac, &low_id, 4);
- bcopy(mac + 4, &high_id, 2);
+ /* MAC may be NULL if it's a broadcast key */
+ if (mac != NULL) {
+ bcopy(mac, &low_id, 4);
+ bcopy(mac + 4, &high_id, 2);
+ }
high_id = 0x0000ffff & htole32(high_id);
diff --git a/sys/dev/ic/ar5212.c b/sys/dev/ic/ar5212.c
index 57136196f1e..a8a0e9da7d5 100644
--- a/sys/dev/ic/ar5212.c
+++ b/sys/dev/ic/ar5212.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5212.c,v 1.5 2005/03/10 08:30:56 reyk Exp $ */
+/* $OpenBSD: ar5212.c,v 1.6 2005/03/13 18:32:21 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -2228,10 +2228,13 @@ ar5k_ar5212_setKeyCacheEntryMac(hal, entry, mac)
AR5K_ASSERT_ENTRY(entry, AR5K_AR5212_KEYTABLE_SIZE);
offset = AR5K_AR5212_KEYCACHE_SIZE - 2;
+ low_id = high_id = 0;
- /* XXX big endian problems? */
- bcopy(mac, &low_id, 4);
- bcopy(mac + 4, &high_id, 2);
+ /* MAC may be NULL if it's a broadcast key */
+ if (mac != NULL) {
+ bcopy(mac, &low_id, 4);
+ bcopy(mac + 4, &high_id, 2);
+ }
high_id = 0x0000ffff & htole32(high_id);