void *pdata_buf)
{
wlan_adapter *adapter = priv->adapter;
- struct cmd_ds_802_11_authenticate *pauthenticate =
- &cmd->params.auth;
+ struct cmd_ds_802_11_authenticate *pauthenticate = &cmd->params.auth;
+ int ret = -1;
u8 *bssid = pdata_buf;
cmd->command = cpu_to_le16(cmd_802_11_authenticate);
- cmd->size =
- cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate)
- + S_DS_GEN);
+ cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate)
+ + S_DS_GEN);
+
+ /* translate auth mode to 802.11 defined wire value */
+ switch (adapter->secinfo.auth_mode) {
+ case IW_AUTH_ALG_OPEN_SYSTEM:
+ pauthenticate->authtype = 0x00;
+ break;
+ case IW_AUTH_ALG_SHARED_KEY:
+ pauthenticate->authtype = 0x01;
+ break;
+ case IW_AUTH_ALG_LEAP:
+ pauthenticate->authtype = 0x80;
+ break;
+ default:
+ lbs_pr_debug(1, "AUTH_CMD: invalid auth alg 0x%X\n",
+ adapter->secinfo.auth_mode);
+ goto out;
+ }
- pauthenticate->authtype = adapter->secinfo.authmode;
memcpy(pauthenticate->macaddr, bssid, ETH_ALEN);
lbs_pr_debug(1, "AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n",
bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);
+ ret = 0;
- return 0;
+out:
+ return ret;
}
int libertas_cmd_80211_deauthenticate(wlan_private * priv,
dwrq->flags = 0;
/* Authentication method */
- switch (adapter->secinfo.authmode) {
- case wlan802_11authmodeopen:
+ switch (adapter->secinfo.auth_mode) {
+ case IW_AUTH_ALG_OPEN_SYSTEM:
dwrq->flags = IW_ENCODE_OPEN;
break;
- case wlan802_11authmodeshared:
- case wlan802_11authmodenetworkEAP:
+ case IW_AUTH_ALG_SHARED_KEY:
+ case IW_AUTH_ALG_LEAP:
dwrq->flags = IW_ENCODE_RESTRICTED;
break;
default:
int i;
/* Set Open System auth mode */
- assoc_req->secinfo.authmode = wlan802_11authmodeopen;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
/* Clear WEP keys and mark WEP as disabled */
assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled;
set_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags);
if (dwrq->flags & IW_ENCODE_RESTRICTED) {
- assoc_req->secinfo.authmode = wlan802_11authmodeshared;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
} else if (dwrq->flags & IW_ENCODE_OPEN) {
- assoc_req->secinfo.authmode = wlan802_11authmodeopen;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
}
out:
goto out;
if (dwrq->flags & IW_ENCODE_RESTRICTED) {
- assoc_req->secinfo.authmode =
- wlan802_11authmodeshared;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
} else if (dwrq->flags & IW_ENCODE_OPEN) {
- assoc_req->secinfo.authmode =
- wlan802_11authmodeopen;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
}
/* Mark the various WEP bits as modified */
if (dwrq->value & IW_AUTH_WPA_VERSION_WPA) {
assoc_req->secinfo.WPAenabled = 1;
assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled;
- assoc_req->secinfo.authmode =
- wlan802_11authmodeopen;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
}
if (dwrq->value & IW_AUTH_WPA_VERSION_WPA2) {
assoc_req->secinfo.WPA2enabled = 1;
assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled;
- assoc_req->secinfo.authmode =
- wlan802_11authmodeopen;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
}
updated = 1;
break;
case IW_AUTH_80211_AUTH_ALG:
if (dwrq->value & IW_AUTH_ALG_SHARED_KEY) {
- assoc_req->secinfo.authmode =
- wlan802_11authmodeshared;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
} else if (dwrq->value & IW_AUTH_ALG_OPEN_SYSTEM) {
- assoc_req->secinfo.authmode =
- wlan802_11authmodeopen;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
} else if (dwrq->value & IW_AUTH_ALG_LEAP) {
- assoc_req->secinfo.authmode =
- wlan802_11authmodenetworkEAP;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_LEAP;
} else {
ret = -EINVAL;
}
assoc_req->secinfo.WPAenabled = 1;
assoc_req->secinfo.WPA2enabled = 1;
assoc_req->secinfo.WEPstatus = wlan802_11WEPdisabled;
- assoc_req->secinfo.authmode =
- wlan802_11authmodeopen;
+ assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
}
} else {
assoc_req->secinfo.WPAenabled = 0;
break;
case IW_AUTH_80211_AUTH_ALG:
- switch (adapter->secinfo.authmode) {
- case wlan802_11authmodeshared:
- dwrq->value = IW_AUTH_ALG_SHARED_KEY;
- break;
- case wlan802_11authmodeopen:
- dwrq->value = IW_AUTH_ALG_OPEN_SYSTEM;
- break;
- case wlan802_11authmodenetworkEAP:
- dwrq->value = IW_AUTH_ALG_LEAP;
- break;
- default:
- break;
- }
+ dwrq->value = adapter->secinfo.auth_mode;
break;
case IW_AUTH_WPA_ENABLED: