mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 08:34:20 +00:00
rtl8188eu: Fix most sparse warnings other than endedness problems
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
925510ff1a
commit
327817d32a
47 changed files with 667 additions and 1771 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <rtw_ioctl.h>
|
||||
#include <rtw_ioctl_set.h>
|
||||
#include <rtw_ioctl_query.h>
|
||||
#include <rtw_mp_ioctl.h>
|
||||
|
||||
//#ifdef CONFIG_MP_INCLUDED
|
||||
#include <rtw_mp_ioctl.h>
|
||||
|
@ -74,10 +75,6 @@
|
|||
#define MAX_CUSTOM_LEN 64
|
||||
#define RATE_COUNT 4
|
||||
|
||||
#ifdef CONFIG_GLOBAL_UI_PID
|
||||
extern int ui_pid[3];
|
||||
#endif
|
||||
|
||||
// combo scan
|
||||
#define WEXT_CSCAN_AMOUNT 9
|
||||
#define WEXT_CSCAN_BUF_LEN 360
|
||||
|
@ -91,10 +88,10 @@ extern int ui_pid[3];
|
|||
#define WEXT_CSCAN_HOME_DWELL_SECTION 'H'
|
||||
#define WEXT_CSCAN_TYPE_SECTION 'T'
|
||||
|
||||
|
||||
extern u8 key_2char2num(u8 hch, u8 lch);
|
||||
extern u8 str_2char2num(u8 hch, u8 lch);
|
||||
extern u8 convert_ip_addr(u8 hch, u8 mch, u8 lch);
|
||||
static u8 convert_ip_addr(u8 hch, u8 mch, u8 lch)
|
||||
{
|
||||
return ((key_char2num(hch) * 100) + (key_char2num(mch) * 10 ) + key_char2num(lch));
|
||||
}
|
||||
|
||||
static u32 rtw_rates[] = {1000000,2000000,5500000,11000000,
|
||||
6000000,9000000,12000000,18000000,24000000,36000000,48000000,54000000};
|
||||
|
@ -336,7 +333,7 @@ static char *translate_scan(_adapter *padapter,
|
|||
// If not, the driver should ignore this AP and go to the next AP.
|
||||
|
||||
// Verifying the SSID
|
||||
if (_rtw_memcmp(pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN))
|
||||
if (!memcmp(pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN))
|
||||
{
|
||||
u32 p2pielen = 0;
|
||||
|
||||
|
@ -981,7 +978,7 @@ _func_enter_;
|
|||
if (param->u.crypt.set_tx == 1)
|
||||
{
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if (_rtw_memcmp(pWapiSta->PeerMacAddr,param->sta_addr,6))
|
||||
if (!memcmp(pWapiSta->PeerMacAddr,param->sta_addr,6))
|
||||
{
|
||||
_rtw_memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16);
|
||||
|
||||
|
@ -1010,7 +1007,7 @@ _func_enter_;
|
|||
else
|
||||
{
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if (_rtw_memcmp(pWapiSta->PeerMacAddr,get_bssid(pmlmepriv),6))
|
||||
if (!memcmp(pWapiSta->PeerMacAddr,get_bssid(pmlmepriv),6))
|
||||
{
|
||||
pWapiSta->wapiMsk.bSet = true;
|
||||
_rtw_memcpy(pWapiSta->wapiMsk.dataKey,param->u.crypt.key,16);
|
||||
|
@ -1160,7 +1157,7 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen)
|
|||
{
|
||||
eid = buf[cnt];
|
||||
|
||||
if ((eid==_VENDOR_SPECIFIC_IE_)&&(_rtw_memcmp(&buf[cnt+2], wps_oui, 4)==true))
|
||||
if ((eid==_VENDOR_SPECIFIC_IE_)&&(!memcmp(&buf[cnt+2], wps_oui, 4)==true))
|
||||
{
|
||||
DBG_88E("SET WPS_IE\n");
|
||||
|
||||
|
@ -1446,7 +1443,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
|
|||
if (pPMK->cmd == IW_PMKSA_ADD)
|
||||
{
|
||||
DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n");
|
||||
if (_rtw_memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN) == true)
|
||||
if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN) == true)
|
||||
{
|
||||
return(intReturn);
|
||||
}
|
||||
|
@ -1459,7 +1456,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
|
|||
//overwrite PMKID
|
||||
for (j=0 ; j<NUM_PMKID_CACHE; j++)
|
||||
{
|
||||
if (_rtw_memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true)
|
||||
if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true)
|
||||
{ // BSSID is matched, the same AP => rewrite with new PMKID.
|
||||
|
||||
DBG_88E("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n");
|
||||
|
@ -1495,7 +1492,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
|
|||
intReturn = true;
|
||||
for (j=0 ; j<NUM_PMKID_CACHE; j++)
|
||||
{
|
||||
if (_rtw_memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true)
|
||||
if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true)
|
||||
{ // BSSID is matched, the same AP => Remove this PMKID information and reset it.
|
||||
_rtw_memset(psecuritypriv->PMKIDList[ j ].Bssid, 0x00, ETH_ALEN);
|
||||
psecuritypriv->PMKIDList[ j ].bUsed = false;
|
||||
|
@ -1753,7 +1750,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
|
|||
|
||||
src_bssid = temp->sa_data;
|
||||
|
||||
if ((_rtw_memcmp(dst_bssid, src_bssid, ETH_ALEN)) == true)
|
||||
if ((!memcmp(dst_bssid, src_bssid, ETH_ALEN)) == true)
|
||||
{
|
||||
if (!rtw_set_802_11_infrastructure_mode(padapter, pnetwork->network.InfrastructureMode))
|
||||
{
|
||||
|
@ -2035,7 +2032,7 @@ if (padapter->registrypriv.mp_mode == 1)
|
|||
#endif
|
||||
|
||||
if ( wrqu->data.length >= WEXT_CSCAN_HEADER_SIZE
|
||||
&& _rtw_memcmp(extra, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE) == true
|
||||
&& !memcmp(extra, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE) == true
|
||||
)
|
||||
{
|
||||
int len = wrqu->data.length -WEXT_CSCAN_HEADER_SIZE;
|
||||
|
@ -2407,7 +2404,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
|
|||
("rtw_wx_set_essid: dst_ssid=%s\n",
|
||||
pnetwork->network.Ssid.Ssid));
|
||||
|
||||
if ((_rtw_memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength) == true) &&
|
||||
if ((!memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength) == true) &&
|
||||
(pnetwork->network.Ssid.SsidLength==ndis_ssid.SsidLength))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
|
||||
|
@ -3406,7 +3403,6 @@ static int rtw_wx_set_channel_plan(struct net_device *dev,
|
|||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
extern int rtw_channel_plan;
|
||||
u8 channel_plan_req = (u8) (*((int *)wrqu));
|
||||
|
||||
if (_SUCCESS == rtw_set_chplan_cmd(padapter, channel_plan_req, 1)) {
|
||||
|
@ -3864,7 +3860,7 @@ static int rtw_get_ap_info(struct net_device *dev,
|
|||
}
|
||||
|
||||
|
||||
if (_rtw_memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN) == true)//BSSID match, then check if supporting wpa/wpa2
|
||||
if (!memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN) == true)//BSSID match, then check if supporting wpa/wpa2
|
||||
{
|
||||
DBG_88E("BSSID:%pM\n", (bssid));
|
||||
|
||||
|
@ -4530,7 +4526,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
|
|||
break;
|
||||
|
||||
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
|
||||
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
{
|
||||
u8 *wpsie;
|
||||
uint wpsie_len = 0;
|
||||
|
@ -4681,7 +4677,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
|
|||
break;
|
||||
|
||||
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
|
||||
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
{
|
||||
// Commented by Albert 2011/05/18
|
||||
// Match the device address located in the P2P IE
|
||||
|
@ -4787,18 +4783,18 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
|
|||
break;
|
||||
|
||||
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
|
||||
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
{
|
||||
u8 *wpsie;
|
||||
uint wpsie_len = 0;
|
||||
|
||||
// The mac address is matched.
|
||||
|
||||
if ((wpsie=rtw_get_wps_ie(&pnetwork->network.IEs[ 12 ], pnetwork->network.IELength - 12, NULL, &wpsie_len)))
|
||||
{
|
||||
if ((wpsie=rtw_get_wps_ie(&pnetwork->network.IEs[ 12 ],
|
||||
pnetwork->network.IELength - 12,
|
||||
NULL, &wpsie_len))) {
|
||||
rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_PRIMARY_DEV_TYPE, dev_type, &dev_type_len);
|
||||
if (dev_type_len)
|
||||
{
|
||||
if (dev_type_len) {
|
||||
u16 type = 0;
|
||||
|
||||
memcpy(&type, dev_type, 2);
|
||||
|
@ -4877,7 +4873,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
|
|||
break;
|
||||
|
||||
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
|
||||
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
{
|
||||
u8 *wpsie;
|
||||
uint wpsie_len = 0;
|
||||
|
@ -4965,7 +4961,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
|
|||
break;
|
||||
|
||||
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
|
||||
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
{
|
||||
// Commented by Albert 20121226
|
||||
// Match the device address located in the P2P IE
|
||||
|
@ -5076,7 +5072,7 @@ static int rtw_p2p_connect(struct net_device *dev,
|
|||
break;
|
||||
|
||||
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
|
||||
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
|
||||
{
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
|
@ -5241,7 +5237,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
|||
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen))
|
||||
{
|
||||
// Handle the P2P Device ID attribute of Beacon first
|
||||
if (_rtw_memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN))
|
||||
if (!memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN))
|
||||
{
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
|
@ -5250,7 +5246,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
|||
else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen))
|
||||
{
|
||||
// Handle the P2P Device Info attribute of probe response
|
||||
if (_rtw_memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN))
|
||||
if (!memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN))
|
||||
{
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
|
@ -5507,7 +5503,7 @@ static int rtw_p2p_set_pc(struct net_device *dev,
|
|||
{
|
||||
// Handle the P2P Device ID attribute of Beacon first
|
||||
printk("[%s] P2P_ATTR_DEVICE_ID\n", __func__);
|
||||
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN))
|
||||
if (!memcmp(attr_content, peerMAC, ETH_ALEN))
|
||||
{
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
|
@ -5517,7 +5513,7 @@ static int rtw_p2p_set_pc(struct net_device *dev,
|
|||
{
|
||||
// Handle the P2P Device Info attribute of probe response
|
||||
printk("[%s] P2P_ATTR_DEVICE_INFO\n", __func__);
|
||||
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN))
|
||||
if (!memcmp(attr_content, peerMAC, ETH_ALEN))
|
||||
{
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
|
@ -5754,19 +5750,19 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
|||
peerMAC[ jj ] = key_2char2num(extra[kk], extra[kk+ 1]);
|
||||
}
|
||||
|
||||
if (_rtw_memcmp(&extra[ 18 ], "display", 7))
|
||||
if (!memcmp(&extra[ 18 ], "display", 7))
|
||||
{
|
||||
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_DISPLYA;
|
||||
}
|
||||
else if (_rtw_memcmp(&extra[ 18 ], "keypad", 7))
|
||||
else if (!memcmp(&extra[ 18 ], "keypad", 7))
|
||||
{
|
||||
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_KEYPAD;
|
||||
}
|
||||
else if (_rtw_memcmp(&extra[ 18 ], "pbc", 3))
|
||||
else if (!memcmp(&extra[ 18 ], "pbc", 3))
|
||||
{
|
||||
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_PUSH_BUTTON;
|
||||
}
|
||||
else if (_rtw_memcmp(&extra[ 18 ], "label", 5))
|
||||
else if (!memcmp(&extra[ 18 ], "label", 5))
|
||||
{
|
||||
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_LABEL;
|
||||
}
|
||||
|
@ -5805,7 +5801,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
|||
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen))
|
||||
{
|
||||
// Handle the P2P Device ID attribute of Beacon first
|
||||
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN))
|
||||
if (!memcmp(attr_content, peerMAC, ETH_ALEN))
|
||||
{
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
|
@ -5814,7 +5810,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
|||
else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen))
|
||||
{
|
||||
// Handle the P2P Device Info attribute of probe response
|
||||
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN))
|
||||
if (!memcmp(attr_content, peerMAC, ETH_ALEN))
|
||||
{
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
|
@ -6004,31 +6000,31 @@ static int rtw_p2p_set(struct net_device *dev,
|
|||
|
||||
DBG_88E("[%s] extra = %s\n", __func__, extra);
|
||||
|
||||
if (_rtw_memcmp(extra, "enable=", 7))
|
||||
if (!memcmp(extra, "enable=", 7))
|
||||
{
|
||||
rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "setDN=", 6))
|
||||
else if (!memcmp(extra, "setDN=", 6))
|
||||
{
|
||||
wrqu->data.length -= 6;
|
||||
rtw_p2p_setDN(dev, info, wrqu, &extra[6]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "profilefound=", 13))
|
||||
else if (!memcmp(extra, "profilefound=", 13))
|
||||
{
|
||||
wrqu->data.length -= 13;
|
||||
rtw_p2p_profilefound(dev, info, wrqu, &extra[13]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "prov_disc=", 10))
|
||||
else if (!memcmp(extra, "prov_disc=", 10))
|
||||
{
|
||||
wrqu->data.length -= 10;
|
||||
rtw_p2p_prov_disc(dev, info, wrqu, &extra[10]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "nego=", 5))
|
||||
else if (!memcmp(extra, "nego=", 5))
|
||||
{
|
||||
wrqu->data.length -= 5;
|
||||
rtw_p2p_connect(dev, info, wrqu, &extra[5]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "intent=", 7))
|
||||
else if (!memcmp(extra, "intent=", 7))
|
||||
{
|
||||
// Commented by Albert 2011/03/23
|
||||
// The wrqu->data.length will include the null character
|
||||
|
@ -6036,17 +6032,17 @@ static int rtw_p2p_set(struct net_device *dev,
|
|||
wrqu->data.length -= 8;
|
||||
rtw_p2p_set_intent(dev, info, wrqu, &extra[7]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "ssid=", 5))
|
||||
else if (!memcmp(extra, "ssid=", 5))
|
||||
{
|
||||
wrqu->data.length -= 5;
|
||||
rtw_p2p_set_go_nego_ssid(dev, info, wrqu, &extra[5]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "got_wpsinfo=", 12))
|
||||
else if (!memcmp(extra, "got_wpsinfo=", 12))
|
||||
{
|
||||
wrqu->data.length -= 12;
|
||||
rtw_p2p_got_wpsinfo(dev, info, wrqu, &extra[12]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "listen_ch=", 10))
|
||||
else if (!memcmp(extra, "listen_ch=", 10))
|
||||
{
|
||||
// Commented by Albert 2011/05/24
|
||||
// The wrqu->data.length will include the null character
|
||||
|
@ -6054,7 +6050,7 @@ static int rtw_p2p_set(struct net_device *dev,
|
|||
wrqu->data.length -= 11;
|
||||
rtw_p2p_set_listen_ch(dev, info, wrqu, &extra[10]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "op_ch=", 6))
|
||||
else if (!memcmp(extra, "op_ch=", 6))
|
||||
{
|
||||
// Commented by Albert 2011/05/24
|
||||
// The wrqu->data.length will include the null character
|
||||
|
@ -6062,36 +6058,36 @@ static int rtw_p2p_set(struct net_device *dev,
|
|||
wrqu->data.length -= 7;
|
||||
rtw_p2p_set_op_ch(dev, info, wrqu, &extra[6]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "invite=", 7))
|
||||
else if (!memcmp(extra, "invite=", 7))
|
||||
{
|
||||
wrqu->data.length -= 8;
|
||||
rtw_p2p_invite_req(dev, info, wrqu, &extra[7]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "persistent=", 11))
|
||||
else if (!memcmp(extra, "persistent=", 11))
|
||||
{
|
||||
wrqu->data.length -= 11;
|
||||
rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]);
|
||||
}
|
||||
#ifdef CONFIG_WFD
|
||||
else if (_rtw_memcmp(extra, "sa=", 3))
|
||||
else if (!memcmp(extra, "sa=", 3))
|
||||
{
|
||||
// sa: WFD Session Available information
|
||||
wrqu->data.length -= 3;
|
||||
rtw_p2p_set_sa(dev, info, wrqu, &extra[3]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "pc=", 3))
|
||||
else if (!memcmp(extra, "pc=", 3))
|
||||
{
|
||||
// pc: WFD Preferred Connection
|
||||
wrqu->data.length -= 3;
|
||||
rtw_p2p_set_pc(dev, info, wrqu, &extra[3]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "wfd_type=", 9))
|
||||
else if (!memcmp(extra, "wfd_type=", 9))
|
||||
{
|
||||
// Specify this device is Mircast source or sink
|
||||
wrqu->data.length -= 9;
|
||||
rtw_p2p_set_wfd_device_type(dev, info, wrqu, &extra[9]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "scan_type=", 10))
|
||||
else if (!memcmp(extra, "scan_type=", 10))
|
||||
{
|
||||
wrqu->data.length -= 10;
|
||||
rtw_p2p_set_scan_result_type(dev, info, wrqu, &extra[10]);
|
||||
|
@ -6120,55 +6116,33 @@ static int rtw_p2p_get(struct net_device *dev,
|
|||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
|
||||
if (padapter->bShowGetP2PState)
|
||||
{
|
||||
DBG_88E("[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer);
|
||||
}
|
||||
|
||||
if (_rtw_memcmp(wrqu->data.pointer, "status", 6))
|
||||
{
|
||||
if (!memcmp(wrqu->data.pointer, "status", 6)) {
|
||||
rtw_p2p_get_status(dev, info, wrqu, extra);
|
||||
}
|
||||
else if (_rtw_memcmp(wrqu->data.pointer, "role", 4))
|
||||
{
|
||||
} else if (!memcmp(wrqu->data.pointer, "role", 4)) {
|
||||
rtw_p2p_get_role(dev, info, wrqu, extra);
|
||||
}
|
||||
else if (_rtw_memcmp(wrqu->data.pointer, "peer_ifa", 8))
|
||||
{
|
||||
} else if (!memcmp(wrqu->data.pointer, "peer_ifa", 8)) {
|
||||
rtw_p2p_get_peer_ifaddr(dev, info, wrqu, extra);
|
||||
}
|
||||
else if (_rtw_memcmp(wrqu->data.pointer, "req_cm", 6))
|
||||
{
|
||||
} else if (!memcmp(wrqu->data.pointer, "req_cm", 6)) {
|
||||
rtw_p2p_get_req_cm(dev, info, wrqu, extra);
|
||||
}
|
||||
else if (_rtw_memcmp(wrqu->data.pointer, "peer_deva", 9))
|
||||
{
|
||||
} else if (!memcmp(wrqu->data.pointer, "peer_deva", 9)) {
|
||||
// Get the P2P device address when receiving the provision discovery request frame.
|
||||
rtw_p2p_get_peer_devaddr(dev, info, wrqu, extra);
|
||||
}
|
||||
else if (_rtw_memcmp(wrqu->data.pointer, "group_id", 8))
|
||||
{
|
||||
} else if (!memcmp(wrqu->data.pointer, "group_id", 8)) {
|
||||
rtw_p2p_get_groupid(dev, info, wrqu, extra);
|
||||
}
|
||||
else if (_rtw_memcmp(wrqu->data.pointer, "peer_deva_inv", 9))
|
||||
{
|
||||
} else if (!memcmp(wrqu->data.pointer, "peer_deva_inv", 9)) {
|
||||
// Get the P2P device address when receiving the P2P Invitation request frame.
|
||||
rtw_p2p_get_peer_devaddr_by_invitation(dev, info, wrqu, extra);
|
||||
}
|
||||
else if (_rtw_memcmp(wrqu->data.pointer, "op_ch", 5))
|
||||
{
|
||||
} else if (!memcmp(wrqu->data.pointer, "op_ch", 5)) {
|
||||
rtw_p2p_get_op_ch(dev, info, wrqu, extra);
|
||||
}
|
||||
#ifdef CONFIG_WFD
|
||||
else if (_rtw_memcmp(wrqu->data.pointer, "peer_port", 9))
|
||||
{
|
||||
else if (!memcmp(wrqu->data.pointer, "peer_port", 9)) {
|
||||
rtw_p2p_get_peer_wfd_port(dev, info, wrqu, extra);
|
||||
}
|
||||
else if (_rtw_memcmp(wrqu->data.pointer, "wfd_sa", 6))
|
||||
{
|
||||
} else if (!memcmp(wrqu->data.pointer, "wfd_sa", 6)) {
|
||||
rtw_p2p_get_peer_wfd_session_available(dev, info, wrqu, extra);
|
||||
}
|
||||
else if (_rtw_memcmp(wrqu->data.pointer, "wfd_pc", 6))
|
||||
{
|
||||
} else if (!memcmp(wrqu->data.pointer, "wfd_pc", 6)) {
|
||||
rtw_p2p_get_peer_wfd_preferred_connection(dev, info, wrqu, extra);
|
||||
}
|
||||
#endif // CONFIG_WFD
|
||||
|
@ -6176,7 +6150,6 @@ static int rtw_p2p_get(struct net_device *dev,
|
|||
#endif //CONFIG_P2P
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int rtw_p2p_get2(struct net_device *dev,
|
||||
|
@ -6196,27 +6169,27 @@ static int rtw_p2p_get2(struct net_device *dev,
|
|||
|
||||
DBG_88E("[%s] extra = %s\n", __func__, (char *)wrqu->data.pointer);
|
||||
|
||||
if (_rtw_memcmp(extra, "wpsCM=", 6))
|
||||
if (!memcmp(extra, "wpsCM=", 6))
|
||||
{
|
||||
wrqu->data.length -= 6;
|
||||
rtw_p2p_get_wps_configmethod(dev, info, wrqu, &extra[6]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "devN=", 5))
|
||||
else if (!memcmp(extra, "devN=", 5))
|
||||
{
|
||||
wrqu->data.length -= 5;
|
||||
rtw_p2p_get_device_name(dev, info, wrqu, &extra[5]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "dev_type=", 9))
|
||||
else if (!memcmp(extra, "dev_type=", 9))
|
||||
{
|
||||
wrqu->data.length -= 9;
|
||||
rtw_p2p_get_device_type(dev, info, wrqu, &extra[9]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "go_devadd=", 10))
|
||||
else if (!memcmp(extra, "go_devadd=", 10))
|
||||
{
|
||||
wrqu->data.length -= 10;
|
||||
rtw_p2p_get_go_device_address(dev, info, wrqu, &extra[10]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "InvProc=", 8))
|
||||
else if (!memcmp(extra, "InvProc=", 8))
|
||||
{
|
||||
wrqu->data.length -= 8;
|
||||
rtw_p2p_get_invitation_procedure(dev, info, wrqu, &extra[8]);
|
||||
|
@ -6257,8 +6230,6 @@ static int rtw_cta_test_start(struct net_device *dev,
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
extern int rtw_change_ifname(_adapter *padapter, const char *ifname);
|
||||
static int rtw_rereg_nd_name(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
|
@ -6298,7 +6269,7 @@ static int rtw_rereg_nd_name(struct net_device *dev,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if (_rtw_memcmp(rereg_priv->old_ifname, "disable%d", 9) == true) {
|
||||
if (!memcmp(rereg_priv->old_ifname, "disable%d", 9) == true) {
|
||||
padapter->ledpriv.bRegUseLed= rereg_priv->old_bRegUseLed;
|
||||
rtw_hal_sw_led_init(padapter);
|
||||
rtw_ips_mode_req(&padapter->pwrctrlpriv, rereg_priv->old_ips_mode);
|
||||
|
@ -6307,7 +6278,7 @@ static int rtw_rereg_nd_name(struct net_device *dev,
|
|||
strncpy(rereg_priv->old_ifname, new_ifname, IFNAMSIZ);
|
||||
rereg_priv->old_ifname[IFNAMSIZ-1] = 0;
|
||||
|
||||
if (_rtw_memcmp(new_ifname, "disable%d", 9) == true) {
|
||||
if (!memcmp(new_ifname, "disable%d", 9) == true) {
|
||||
|
||||
DBG_88E("%s disable\n", __func__);
|
||||
// free network queue for Android's timming issue
|
||||
|
@ -8417,7 +8388,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
|
|||
u8 wps_oui[4]={0x0,0x50,0xf2,0x04};
|
||||
|
||||
if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) &&
|
||||
(_rtw_memcmp(&probereq_wpsie[2], wps_oui, 4) ==true))
|
||||
(!memcmp(&probereq_wpsie[2], wps_oui, 4) ==true))
|
||||
{
|
||||
cp_sz = probereq_wpsie_len>MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN:probereq_wpsie_len;
|
||||
|
||||
|
@ -8449,7 +8420,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
|
|||
}
|
||||
|
||||
if ( len >= WEXT_CSCAN_HEADER_SIZE
|
||||
&& _rtw_memcmp(ext, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE) == true
|
||||
&& !memcmp(ext, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE) == true
|
||||
){
|
||||
ret = rtw_wx_set_scan(dev, info, awrq, ext);
|
||||
goto FREE_EXT;
|
||||
|
@ -8553,12 +8524,12 @@ static int rtw_pm_set(struct net_device *dev,
|
|||
|
||||
DBG_88E("[%s] extra = %s\n", __func__, extra);
|
||||
|
||||
if (_rtw_memcmp(extra, "lps=", 4))
|
||||
if (!memcmp(extra, "lps=", 4))
|
||||
{
|
||||
sscanf(extra+4, "%u", &mode);
|
||||
ret = rtw_pm_set_lps(padapter,mode);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "ips=", 4))
|
||||
else if (!memcmp(extra, "ips=", 4))
|
||||
{
|
||||
sscanf(extra+4, "%u", &mode);
|
||||
ret = rtw_pm_set_ips(padapter,mode);
|
||||
|
@ -11124,7 +11095,7 @@ static int rtw_tdls_enable(struct net_device *dev,
|
|||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for (index=0; index< NUM_STA; index++) {
|
||||
if (!_rtw_memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN)) {
|
||||
if (!!memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN)) {
|
||||
pr_info("issue tear down to %pM\n", tdls_sta[index]);
|
||||
issue_tdls_teardown(padapter, tdls_sta[index]);
|
||||
}
|
||||
|
@ -11548,19 +11519,19 @@ static int rtw_tdls(struct net_device *dev,
|
|||
|
||||
DBG_88E("[%s] extra = %s\n", __func__, extra);
|
||||
// WFD Sigma will use the tdls enable command to let the driver know we want to test the tdls now!
|
||||
if (_rtw_memcmp(extra, "wfdenable=", 10))
|
||||
if (!memcmp(extra, "wfdenable=", 10))
|
||||
{
|
||||
wrqu->data.length -=10;
|
||||
rtw_wfd_tdls_enable(dev, info, wrqu, &extra[10]);
|
||||
return ret;
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "weaksec=", 8))
|
||||
else if (!memcmp(extra, "weaksec=", 8))
|
||||
{
|
||||
wrqu->data.length -=8;
|
||||
rtw_tdls_weaksec(dev, info, wrqu, &extra[8]);
|
||||
return ret;
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "tdlsenable=", 11))
|
||||
else if (!memcmp(extra, "tdlsenable=", 11))
|
||||
{
|
||||
wrqu->data.length -=11;
|
||||
rtw_tdls_enable(dev, info, wrqu, &extra[11]);
|
||||
|
@ -11573,48 +11544,48 @@ static int rtw_tdls(struct net_device *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (_rtw_memcmp(extra, "setup=", 6))
|
||||
if (!memcmp(extra, "setup=", 6))
|
||||
{
|
||||
wrqu->data.length -=6;
|
||||
rtw_tdls_setup(dev, info, wrqu, &extra[6]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "tear=", 5))
|
||||
else if (!memcmp(extra, "tear=", 5))
|
||||
{
|
||||
wrqu->data.length -= 5;
|
||||
rtw_tdls_teardown(dev, info, wrqu, &extra[5]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "dis=", 4))
|
||||
else if (!memcmp(extra, "dis=", 4))
|
||||
{
|
||||
wrqu->data.length -= 4;
|
||||
rtw_tdls_discovery(dev, info, wrqu, &extra[4]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "sw=", 3))
|
||||
else if (!memcmp(extra, "sw=", 3))
|
||||
{
|
||||
wrqu->data.length -= 3;
|
||||
rtw_tdls_ch_switch (dev, info, wrqu, &extra[3]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "swoff=", 6))
|
||||
else if (!memcmp(extra, "swoff=", 6))
|
||||
{
|
||||
wrqu->data.length -= 6;
|
||||
rtw_tdls_ch_switch_off(dev, info, wrqu, &extra[6]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "pson=", 5))
|
||||
else if (!memcmp(extra, "pson=", 5))
|
||||
{
|
||||
wrqu->data.length -= 5;
|
||||
rtw_tdls_pson(dev, info, wrqu, &extra[5]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "psoff=", 6))
|
||||
else if (!memcmp(extra, "psoff=", 6))
|
||||
{
|
||||
wrqu->data.length -= 6;
|
||||
rtw_tdls_psoff(dev, info, wrqu, &extra[6]);
|
||||
}
|
||||
#ifdef CONFIG_WFD
|
||||
else if (_rtw_memcmp(extra, "setip=", 6))
|
||||
else if (!memcmp(extra, "setip=", 6))
|
||||
{
|
||||
wrqu->data.length -= 6;
|
||||
rtw_tdls_setip(dev, info, wrqu, &extra[6]);
|
||||
}
|
||||
else if (_rtw_memcmp(extra, "tprobe=", 6))
|
||||
else if (!memcmp(extra, "tprobe=", 6))
|
||||
{
|
||||
issue_tunneled_probe_req((_adapter *)rtw_netdev_priv(dev));
|
||||
}
|
||||
|
@ -11636,20 +11607,20 @@ static int rtw_tdls_get(struct net_device *dev,
|
|||
|
||||
DBG_88E("[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer);
|
||||
|
||||
if (_rtw_memcmp(wrqu->data.pointer, "ip", 2))
|
||||
if (!memcmp(wrqu->data.pointer, "ip", 2))
|
||||
{
|
||||
rtw_tdls_getip(dev, info, wrqu, extra);
|
||||
}
|
||||
if (_rtw_memcmp(wrqu->data.pointer, "port", 4))
|
||||
if (!memcmp(wrqu->data.pointer, "port", 4))
|
||||
{
|
||||
rtw_tdls_getport(dev, info, wrqu, extra);
|
||||
}
|
||||
//WFDTDLS, for sigma test
|
||||
if (_rtw_memcmp(wrqu->data.pointer, "dis", 3))
|
||||
if (!memcmp(wrqu->data.pointer, "dis", 3))
|
||||
{
|
||||
rtw_tdls_dis_result(dev, info, wrqu, extra);
|
||||
}
|
||||
if (_rtw_memcmp(wrqu->data.pointer, "status", 6))
|
||||
if (!memcmp(wrqu->data.pointer, "status", 6))
|
||||
{
|
||||
rtw_wfd_tdls_status(dev, info, wrqu, extra);
|
||||
}
|
||||
|
@ -12043,8 +12014,8 @@ static u8 pktcmp(PADAPTER padapter, u8 *txbuf, u32 txsz, u8 *rxbuf, u32 rxsz)
|
|||
__func__, txsz - TXDESC_SIZE, rxpktsize - fcssize);
|
||||
ret = false;
|
||||
} else {
|
||||
ret = _rtw_memcmp(txbuf + TXDESC_SIZE,\
|
||||
rxbuf + RXDESC_SIZE + drvinfosize,\
|
||||
ret = !memcmp(txbuf + TXDESC_SIZE,
|
||||
rxbuf + RXDESC_SIZE + drvinfosize,
|
||||
txsz - TXDESC_SIZE);
|
||||
if (ret == false) {
|
||||
DBG_88E("%s: ERROR! pkt content mismatch!\n", __func__);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue