Thread (8 messages) 8 messages, 2 authors, 2005-02-24
STALE7772d

[patch 2.6.11-rc4-netdev1 3/4] ieee80211: C99 initialization for eap_types

From: Francois Romieu <romieu@fr.zoreil.com>
Date: 2005-02-13 23:27:29

C99 initialization for eap_types.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>

diff -puN include/net/ieee80211.h~80211-020 include/net/ieee80211.h
--- a/include/net/ieee80211.h~80211-020	2005-02-14 00:10:49.003115207 +0100
+++ b/include/net/ieee80211.h	2005-02-14 00:10:49.007114556 +0100
@@ -64,16 +64,25 @@ struct ieee80211_hdr_3addr {
 	u16 seq_ctl;
 } __attribute__ ((packed));
 
+enum eap_type {
+	EAP_PACKET = 0,
+	EAPOL_START,
+	EAPOL_LOGOFF,
+	EAPOL_KEY,
+	EAPOL_ENCAP_ASF_ALERT
+};
+
 static const char *eap_types[] = {
-	"EAP-Packet", "EAPOL-Start", "EAPOL-Logoff", "EAPOL-Key",
-	"EAPOL-Encap-ASF-Alert", "Unknown"
+	[EAP_PACKET]		= "EAP-Packet",
+	[EAPOL_START]		= "EAPOL-Start",
+	[EAPOL_LOGOFF]		= "EAPOL-Logoff",
+	[EAPOL_KEY]		= "EAPOL-Key",
+	[EAPOL_ENCAP_ASF_ALERT]	= "EAPOL-Encap-ASF-Alert"
 };
 
 static inline const char *eap_get_type(int type)
 {
-	if (type > ARRAY_SIZE(eap_types))
-		type = ARRAY_SIZE(eap_types) - 1;
-	return eap_types[type];
+	return (type >= ARRAY_SIZE(eap_types)) ? "Unknown" : eap_types[type];
 }
 
 struct eapol {
_
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help