[PATCH] libertas: wlan_cmd.c - use standard key length defines

Dan Williams dcbw at redhat.com
Tue Oct 3 16:18:32 EDT 2006


Use standard key length defines rather than private ones.

Signed-off-by: Dan Williams <dcbw at redhat.com>

diff --git a/drivers/net/wireless/libertas/wlan_cmd.c b/drivers/net/wireless/libertas/wlan_cmd.c
index 152c057..db7a5af 100644
--- a/drivers/net/wireless/libertas/wlan_cmd.c
+++ b/drivers/net/wireless/libertas/wlan_cmd.c
@@ -243,9 +243,6 @@ static int wlan_cmd_802_11_sleep_params(
 	return WLAN_STATUS_SUCCESS;
 }
 
-#define WEP_40_BIT_LEN	5
-#define WEP_104_BIT_LEN	13
-
 /** 
  *  @brief This function prepares command of set_wep.
  *  
@@ -277,12 +274,12 @@ static int wlan_cmd_802_11_set_wep(wlan_
 		PRINTM(INFO, "Tx Key Index: %u\n", wep->KeyIndex);
 
 		switch (Adapter->WepKey[0].KeyLength) {
-		case WEP_40_BIT_LEN:
+		case KEY_LEN_WEP_40:
 			wep->WEPTypeForKey1 = HostCmd_TYPE_WEP_40_BIT;
 			memmove(wep->WEP1, Adapter->WepKey[0].KeyMaterial,
 				Adapter->WepKey[0].KeyLength);
 			break;
-		case WEP_104_BIT_LEN:
+		case KEY_LEN_WEP_104:
 			wep->WEPTypeForKey1 = HostCmd_TYPE_WEP_104_BIT;
 			memmove(wep->WEP1, Adapter->WepKey[0].KeyMaterial,
 				Adapter->WepKey[0].KeyLength);
@@ -297,12 +294,12 @@ static int wlan_cmd_802_11_set_wep(wlan_
 		}
 
 		switch (Adapter->WepKey[1].KeyLength) {
-		case WEP_40_BIT_LEN:
+		case KEY_LEN_WEP_40:
 			wep->WEPTypeForKey2 = HostCmd_TYPE_WEP_40_BIT;
 			memmove(wep->WEP2, Adapter->WepKey[1].KeyMaterial,
 				Adapter->WepKey[1].KeyLength);
 			break;
-		case WEP_104_BIT_LEN:
+		case KEY_LEN_WEP_104:
 			wep->WEPTypeForKey2 = HostCmd_TYPE_WEP_104_BIT;
 			memmove(wep->WEP2, Adapter->WepKey[1].KeyMaterial,
 				Adapter->WepKey[1].KeyLength);
@@ -317,12 +314,12 @@ static int wlan_cmd_802_11_set_wep(wlan_
 		}
 
 		switch (Adapter->WepKey[2].KeyLength) {
-		case WEP_40_BIT_LEN:
+		case KEY_LEN_WEP_40:
 			wep->WEPTypeForKey3 = HostCmd_TYPE_WEP_40_BIT;
 			memmove(wep->WEP3, Adapter->WepKey[2].KeyMaterial,
 				Adapter->WepKey[2].KeyLength);
 			break;
-		case WEP_104_BIT_LEN:
+		case KEY_LEN_WEP_104:
 			wep->WEPTypeForKey3 = HostCmd_TYPE_WEP_104_BIT;
 			memmove(wep->WEP3, Adapter->WepKey[2].KeyMaterial,
 				Adapter->WepKey[2].KeyLength);
@@ -337,12 +334,12 @@ static int wlan_cmd_802_11_set_wep(wlan_
 		}
 
 		switch (Adapter->WepKey[3].KeyLength) {
-		case WEP_40_BIT_LEN:
+		case KEY_LEN_WEP_40:
 			wep->WEPTypeForKey4 = HostCmd_TYPE_WEP_40_BIT;
 			memmove(wep->WEP4, Adapter->WepKey[3].KeyMaterial,
 				Adapter->WepKey[3].KeyLength);
 			break;
-		case WEP_104_BIT_LEN:
+		case KEY_LEN_WEP_104:
 			wep->WEPTypeForKey4 = HostCmd_TYPE_WEP_104_BIT;
 			memmove(wep->WEP4, Adapter->WepKey[3].KeyMaterial,
 				Adapter->WepKey[3].KeyLength);





More information about the libertas-dev mailing list