#include <usb_ops.h>
#include <linux/ieee80211.h>
-u8 rtw_do_join23a(struct rtw_adapter *padapter)
+int rtw_do_join23a(struct rtw_adapter *padapter)
{
struct list_head *plist, *phead;
u8* pibss = NULL;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct rtw_queue *queue = &pmlmepriv->scanned_queue;
- u8 ret = _SUCCESS;
+ int ret = _SUCCESS;
spin_lock_bh(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue);
return ret;
}
-u8 rtw_set_802_11_ssid23a(struct rtw_adapter* padapter, struct cfg80211_ssid *ssid)
+int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter,
+ struct cfg80211_ssid *ssid)
{
- u8 status = _SUCCESS;
+ int status = _SUCCESS;
u32 cur_time = 0;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
return status;
}
-u8 rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter* padapter,
+int rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter* padapter,
enum ndis_802_11_net_infra networktype)
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
spin_unlock_bh(&pmlmepriv->lock);
}
- return true;
+ return _SUCCESS;
}
-u8 rtw_set_802_11_bssid23a_list_scan(struct rtw_adapter *padapter,
- struct cfg80211_ssid *pssid, int ssid_max_num)
+int rtw_set_802_11_bssid23a_list_scan(struct rtw_adapter *padapter,
+ struct cfg80211_ssid *pssid,
+ int ssid_max_num)
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
- u8 res = true;
+ int res = _SUCCESS;
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
("+rtw_set_802_11_bssid23a_list_scan(), fw_state =%x\n",
get_fwstate(pmlmepriv)));
if (!padapter) {
- res = false;
+ res = _FAIL;
goto exit;
}
if (padapter->hw_init_completed == false) {
- res = false;
+ res = _FAIL;
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
("\n === rtw_set_802_11_bssid23a_list_scan:"
"hw_init_completed == false ===\n"));
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
("rtw_set_802_11_bssid23a_list_scan fail since fw_state "
"= %x\n", get_fwstate(pmlmepriv)));
- res = true;
if (check_fwstate(pmlmepriv,
(_FW_UNDER_SURVEY|_FW_UNDER_LINKING))) {
return res;
}
-u8 rtw_set_802_11_authentication_mode23a(struct rtw_adapter* padapter,
- enum ndis_802_11_auth_mode authmode)
+int rtw_set_802_11_authentication_mode23a(struct rtw_adapter* padapter,
+ enum ndis_802_11_auth_mode authmode)
{
struct security_priv *psecuritypriv = &padapter->securitypriv;
int res;
- u8 ret;
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
("set_802_11_auth.mode(): mode =%x\n", authmode));
res = rtw_set_auth23a(padapter, psecuritypriv);
- if (res == _SUCCESS)
- ret = true;
- else
- ret = false;
-
- return ret;
+ return res;
}
-u8 rtw_set_802_11_add_wep23a(struct rtw_adapter* padapter,
+int rtw_set_802_11_add_wep23a(struct rtw_adapter* padapter,
struct ndis_802_11_wep *wep)
{
u8 bdefaultkey;
u8 btransmitkey;
int keyid, res;
struct security_priv *psecuritypriv = &padapter->securitypriv;
- u8 ret = _SUCCESS;
bdefaultkey = (wep->KeyIndex & 0x40000000) > 0 ? false : true;
btransmitkey = (wep->KeyIndex & 0x80000000) > 0 ? true : false;
if (keyid >= 4) {
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
("MgntActrtw_set_802_11_add_wep23a:keyid>4 =>fail\n"));
- ret = false;
+ res = _FAIL;
goto exit;
}
res = rtw_set_key23a(padapter, psecuritypriv, keyid, 1);
- if (res == _FAIL)
- ret = false;
exit:
- return ret;
+ return res;
}
/*
#include <drv_types.h>
-u8 rtw_set_802_11_authentication_mode23a(struct rtw_adapter *pdapter,
- enum ndis_802_11_auth_mode authmode);
-u8 rtw_set_802_11_add_wep23a(struct rtw_adapter * padapter,
- struct ndis_802_11_wep *wep);
-u8 rtw_set_802_11_bssid23a_list_scan(struct rtw_adapter *padapter,
- struct cfg80211_ssid *pssid, int ssid_max_num);
-u8 rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter *padapter,
- enum ndis_802_11_net_infra networktype);
-u8 rtw_set_802_11_ssid23a(struct rtw_adapter * padapter, struct cfg80211_ssid * ssid);
+int rtw_set_802_11_authentication_mode23a(struct rtw_adapter *pdapter,
+ enum ndis_802_11_auth_mode authmode);
+int rtw_set_802_11_add_wep23a(struct rtw_adapter * padapter,
+ struct ndis_802_11_wep *wep);
+int rtw_set_802_11_bssid23a_list_scan(struct rtw_adapter *padapter,
+ struct cfg80211_ssid *pssid,
+ int ssid_max_num);
+int rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter *padapter,
+ enum ndis_802_11_net_infra networktype);
+int rtw_set_802_11_ssid23a(struct rtw_adapter * padapter,
+ struct cfg80211_ssid * ssid);
u16 rtw_get_cur_max_rate23a(struct rtw_adapter *adapter);
s32 FillH2CCmd(struct rtw_adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
-u8 rtw_do_join23a(struct rtw_adapter *padapter);
+int rtw_do_join23a(struct rtw_adapter *padapter);
#endif
rtw_wdev->iftype = type;
- if (rtw_set_802_11_infrastructure_mode23a(padapter, networkType) == false) {
+ if (rtw_set_802_11_infrastructure_mode23a
+ (padapter, networkType) != _SUCCESS) {
rtw_wdev->iftype = old_type;
ret = -EPERM;
goto exit;
}
if (rtw_set_802_11_infrastructure_mode23a
- (padapter, pnetwork->network.InfrastructureMode) == false) {
+ (padapter, pnetwork->network.InfrastructureMode) != _SUCCESS) {
ret = -EPERM;
goto exit;
}
memcpy(pwep->KeyMaterial, (void *)sme->key, pwep->KeyLength);
- if (rtw_set_802_11_add_wep23a(padapter, pwep) == (u8) _FAIL) {
+ if (rtw_set_802_11_add_wep23a(padapter, pwep) != _SUCCESS)
ret = -EOPNOTSUPP;
- }
kfree(pwep);