diff options
author | Wilfried Klaebe <w-lkml@lebenslange-mailadresse.de> | 2014-03-25 13:59:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-15 16:52:14 -0400 |
commit | ec03ab77cc2c39d115118fcd4fc11a5801cbb70e (patch) | |
tree | db5601641aa5d7236e50ea6fe7f0777fd7bb5a81 /drivers/staging | |
parent | 29d1e7209e1866a1b6b686107cce9f5a9b886a53 (diff) |
staging: rtl8188eu: remove spaces, correct counts to unbreak P2P ioctls
staging: rtl8188eu: remove spaces, correct counts to unbreak P2P ioctls
It looks like someone did a search-and-replace on that driver, putting
spaces before "=" characters, without checking this is OK everywhere.
Also, in some places, there's memcpm()s/strncmp()s checking for some
different length than the fixed string argument.
These things result in code not working as intended. Fix that.
Signed-off-by: Wilfried Klaebe <w-lkml@lebenslange-mailadresse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 2636e7f3dbb8..cf30a08912d1 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | |||
@@ -359,7 +359,7 @@ static char *translate_scan(struct adapter *padapter, | |||
359 | if (wpa_len > 0) { | 359 | if (wpa_len > 0) { |
360 | p = buf; | 360 | p = buf; |
361 | _rtw_memset(buf, 0, MAX_WPA_IE_LEN); | 361 | _rtw_memset(buf, 0, MAX_WPA_IE_LEN); |
362 | p += sprintf(p, "wpa_ie ="); | 362 | p += sprintf(p, "wpa_ie="); |
363 | for (i = 0; i < wpa_len; i++) | 363 | for (i = 0; i < wpa_len; i++) |
364 | p += sprintf(p, "%02x", wpa_ie[i]); | 364 | p += sprintf(p, "%02x", wpa_ie[i]); |
365 | 365 | ||
@@ -376,7 +376,7 @@ static char *translate_scan(struct adapter *padapter, | |||
376 | if (rsn_len > 0) { | 376 | if (rsn_len > 0) { |
377 | p = buf; | 377 | p = buf; |
378 | _rtw_memset(buf, 0, MAX_WPA_IE_LEN); | 378 | _rtw_memset(buf, 0, MAX_WPA_IE_LEN); |
379 | p += sprintf(p, "rsn_ie ="); | 379 | p += sprintf(p, "rsn_ie="); |
380 | for (i = 0; i < rsn_len; i++) | 380 | for (i = 0; i < rsn_len; i++) |
381 | p += sprintf(p, "%02x", rsn_ie[i]); | 381 | p += sprintf(p, "%02x", rsn_ie[i]); |
382 | _rtw_memset(&iwe, 0, sizeof(iwe)); | 382 | _rtw_memset(&iwe, 0, sizeof(iwe)); |
@@ -2899,7 +2899,7 @@ static int rtw_p2p_get_status(struct net_device *dev, | |||
2899 | /* Commented by Albert 2010/10/12 */ | 2899 | /* Commented by Albert 2010/10/12 */ |
2900 | /* Because of the output size limitation, I had removed the "Role" information. */ | 2900 | /* Because of the output size limitation, I had removed the "Role" information. */ |
2901 | /* About the "Role" information, we will use the new private IOCTL to get the "Role" information. */ | 2901 | /* About the "Role" information, we will use the new private IOCTL to get the "Role" information. */ |
2902 | sprintf(extra, "\n\nStatus =%.2d\n", rtw_p2p_state(pwdinfo)); | 2902 | sprintf(extra, "\n\nStatus=%.2d\n", rtw_p2p_state(pwdinfo)); |
2903 | wrqu->data.length = strlen(extra); | 2903 | wrqu->data.length = strlen(extra); |
2904 | 2904 | ||
2905 | return ret; | 2905 | return ret; |
@@ -2918,7 +2918,7 @@ static int rtw_p2p_get_req_cm(struct net_device *dev, | |||
2918 | struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); | 2918 | struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); |
2919 | struct wifidirect_info *pwdinfo = &(padapter->wdinfo); | 2919 | struct wifidirect_info *pwdinfo = &(padapter->wdinfo); |
2920 | 2920 | ||
2921 | sprintf(extra, "\n\nCM =%s\n", pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req); | 2921 | sprintf(extra, "\n\nCM=%s\n", pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req); |
2922 | wrqu->data.length = strlen(extra); | 2922 | wrqu->data.length = strlen(extra); |
2923 | return ret; | 2923 | return ret; |
2924 | } | 2924 | } |
@@ -2935,7 +2935,7 @@ static int rtw_p2p_get_role(struct net_device *dev, | |||
2935 | pwdinfo->p2p_peer_interface_addr[0], pwdinfo->p2p_peer_interface_addr[1], pwdinfo->p2p_peer_interface_addr[2], | 2935 | pwdinfo->p2p_peer_interface_addr[0], pwdinfo->p2p_peer_interface_addr[1], pwdinfo->p2p_peer_interface_addr[2], |
2936 | pwdinfo->p2p_peer_interface_addr[3], pwdinfo->p2p_peer_interface_addr[4], pwdinfo->p2p_peer_interface_addr[5]); | 2936 | pwdinfo->p2p_peer_interface_addr[3], pwdinfo->p2p_peer_interface_addr[4], pwdinfo->p2p_peer_interface_addr[5]); |
2937 | 2937 | ||
2938 | sprintf(extra, "\n\nRole =%.2d\n", rtw_p2p_role(pwdinfo)); | 2938 | sprintf(extra, "\n\nRole=%.2d\n", rtw_p2p_role(pwdinfo)); |
2939 | wrqu->data.length = strlen(extra); | 2939 | wrqu->data.length = strlen(extra); |
2940 | return ret; | 2940 | return ret; |
2941 | } | 2941 | } |
@@ -3022,7 +3022,7 @@ static int rtw_p2p_get_op_ch(struct net_device *dev, | |||
3022 | 3022 | ||
3023 | DBG_88E("[%s] Op_ch = %02x\n", __func__, pwdinfo->operating_channel); | 3023 | DBG_88E("[%s] Op_ch = %02x\n", __func__, pwdinfo->operating_channel); |
3024 | 3024 | ||
3025 | sprintf(extra, "\n\nOp_ch =%.2d\n", pwdinfo->operating_channel); | 3025 | sprintf(extra, "\n\nOp_ch=%.2d\n", pwdinfo->operating_channel); |
3026 | wrqu->data.length = strlen(extra); | 3026 | wrqu->data.length = strlen(extra); |
3027 | return ret; | 3027 | return ret; |
3028 | } | 3028 | } |
@@ -3043,7 +3043,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev, | |||
3043 | u8 blnMatch = 0; | 3043 | u8 blnMatch = 0; |
3044 | u16 attr_content = 0; | 3044 | u16 attr_content = 0; |
3045 | uint attr_contentlen = 0; | 3045 | uint attr_contentlen = 0; |
3046 | /* 6 is the string "wpsCM =", 17 is the MAC addr, we have to clear it at wrqu->data.pointer */ | 3046 | /* 6 is the string "wpsCM=", 17 is the MAC addr, we have to clear it at wrqu->data.pointer */ |
3047 | u8 attr_content_str[6 + 17] = {0x00}; | 3047 | u8 attr_content_str[6 + 17] = {0x00}; |
3048 | 3048 | ||
3049 | /* Commented by Albert 20110727 */ | 3049 | /* Commented by Albert 20110727 */ |
@@ -3079,7 +3079,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev, | |||
3079 | rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_CONF_METHOD, (u8 *) &be_tmp, &attr_contentlen); | 3079 | rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_CONF_METHOD, (u8 *) &be_tmp, &attr_contentlen); |
3080 | if (attr_contentlen) { | 3080 | if (attr_contentlen) { |
3081 | attr_content = be16_to_cpu(be_tmp); | 3081 | attr_content = be16_to_cpu(be_tmp); |
3082 | sprintf(attr_content_str, "\n\nM =%.4d", attr_content); | 3082 | sprintf(attr_content_str, "\n\nM=%.4d", attr_content); |
3083 | blnMatch = 1; | 3083 | blnMatch = 1; |
3084 | } | 3084 | } |
3085 | } | 3085 | } |
@@ -3091,7 +3091,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev, | |||
3091 | spin_unlock_bh(&pmlmepriv->scanned_queue.lock); | 3091 | spin_unlock_bh(&pmlmepriv->scanned_queue.lock); |
3092 | 3092 | ||
3093 | if (!blnMatch) | 3093 | if (!blnMatch) |
3094 | sprintf(attr_content_str, "\n\nM = 0000"); | 3094 | sprintf(attr_content_str, "\n\nM=0000"); |
3095 | 3095 | ||
3096 | if (copy_to_user(wrqu->data.pointer, attr_content_str, 6 + 17)) | 3096 | if (copy_to_user(wrqu->data.pointer, attr_content_str, 6 + 17)) |
3097 | return -EFAULT; | 3097 | return -EFAULT; |
@@ -3172,9 +3172,9 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev, | |||
3172 | spin_unlock_bh(&pmlmepriv->scanned_queue.lock); | 3172 | spin_unlock_bh(&pmlmepriv->scanned_queue.lock); |
3173 | 3173 | ||
3174 | if (!blnMatch) | 3174 | if (!blnMatch) |
3175 | snprintf(go_devadd_str, sizeof(go_devadd_str), "\n\ndev_add = NULL"); | 3175 | snprintf(go_devadd_str, sizeof(go_devadd_str), "\n\ndev_add=NULL"); |
3176 | else | 3176 | else |
3177 | snprintf(go_devadd_str, sizeof(go_devadd_str), "\n\ndev_add =%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", | 3177 | snprintf(go_devadd_str, sizeof(go_devadd_str), "\n\ndev_add=%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", |
3178 | attr_content[0], attr_content[1], attr_content[2], attr_content[3], attr_content[4], attr_content[5]); | 3178 | attr_content[0], attr_content[1], attr_content[2], attr_content[3], attr_content[4], attr_content[5]); |
3179 | 3179 | ||
3180 | if (copy_to_user(wrqu->data.pointer, go_devadd_str, sizeof(go_devadd_str))) | 3180 | if (copy_to_user(wrqu->data.pointer, go_devadd_str, sizeof(go_devadd_str))) |
@@ -3198,7 +3198,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev, | |||
3198 | u8 blnMatch = 0; | 3198 | u8 blnMatch = 0; |
3199 | u8 dev_type[8] = {0x00}; | 3199 | u8 dev_type[8] = {0x00}; |
3200 | uint dev_type_len = 0; | 3200 | uint dev_type_len = 0; |
3201 | u8 dev_type_str[17 + 9] = {0x00}; /* +9 is for the str "dev_type =", we have to clear it at wrqu->data.pointer */ | 3201 | u8 dev_type_str[17 + 9] = {0x00}; /* +9 is for the str "dev_type=", we have to clear it at wrqu->data.pointer */ |
3202 | 3202 | ||
3203 | /* Commented by Albert 20121209 */ | 3203 | /* Commented by Albert 20121209 */ |
3204 | /* The input data is the MAC address which the application wants to know its device type. */ | 3204 | /* The input data is the MAC address which the application wants to know its device type. */ |
@@ -3239,7 +3239,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev, | |||
3239 | 3239 | ||
3240 | memcpy(&be_tmp, dev_type, 2); | 3240 | memcpy(&be_tmp, dev_type, 2); |
3241 | type = be16_to_cpu(be_tmp); | 3241 | type = be16_to_cpu(be_tmp); |
3242 | sprintf(dev_type_str, "\n\nN =%.2d", type); | 3242 | sprintf(dev_type_str, "\n\nN=%.2d", type); |
3243 | blnMatch = 1; | 3243 | blnMatch = 1; |
3244 | } | 3244 | } |
3245 | } | 3245 | } |
@@ -3252,7 +3252,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev, | |||
3252 | spin_unlock_bh(&pmlmepriv->scanned_queue.lock); | 3252 | spin_unlock_bh(&pmlmepriv->scanned_queue.lock); |
3253 | 3253 | ||
3254 | if (!blnMatch) | 3254 | if (!blnMatch) |
3255 | sprintf(dev_type_str, "\n\nN = 00"); | 3255 | sprintf(dev_type_str, "\n\nN=00"); |
3256 | 3256 | ||
3257 | if (copy_to_user(wrqu->data.pointer, dev_type_str, 9 + 17)) { | 3257 | if (copy_to_user(wrqu->data.pointer, dev_type_str, 9 + 17)) { |
3258 | return -EFAULT; | 3258 | return -EFAULT; |
@@ -3277,7 +3277,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev, | |||
3277 | u8 blnMatch = 0; | 3277 | u8 blnMatch = 0; |
3278 | u8 dev_name[WPS_MAX_DEVICE_NAME_LEN] = {0x00}; | 3278 | u8 dev_name[WPS_MAX_DEVICE_NAME_LEN] = {0x00}; |
3279 | uint dev_len = 0; | 3279 | uint dev_len = 0; |
3280 | u8 dev_name_str[WPS_MAX_DEVICE_NAME_LEN + 5] = {0x00}; /* +5 is for the str "devN =", we have to clear it at wrqu->data.pointer */ | 3280 | u8 dev_name_str[WPS_MAX_DEVICE_NAME_LEN + 5] = {0x00}; /* +5 is for the str "devN=", we have to clear it at wrqu->data.pointer */ |
3281 | 3281 | ||
3282 | /* Commented by Albert 20121225 */ | 3282 | /* Commented by Albert 20121225 */ |
3283 | /* The input data is the MAC address which the application wants to know its device name. */ | 3283 | /* The input data is the MAC address which the application wants to know its device name. */ |
@@ -3310,7 +3310,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev, | |||
3310 | if (wpsie) { | 3310 | if (wpsie) { |
3311 | rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_DEVICE_NAME, dev_name, &dev_len); | 3311 | rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_DEVICE_NAME, dev_name, &dev_len); |
3312 | if (dev_len) { | 3312 | if (dev_len) { |
3313 | sprintf(dev_name_str, "\n\nN =%s", dev_name); | 3313 | sprintf(dev_name_str, "\n\nN=%s", dev_name); |
3314 | blnMatch = 1; | 3314 | blnMatch = 1; |
3315 | } | 3315 | } |
3316 | } | 3316 | } |
@@ -3323,7 +3323,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev, | |||
3323 | spin_unlock_bh(&pmlmepriv->scanned_queue.lock); | 3323 | spin_unlock_bh(&pmlmepriv->scanned_queue.lock); |
3324 | 3324 | ||
3325 | if (!blnMatch) | 3325 | if (!blnMatch) |
3326 | sprintf(dev_name_str, "\n\nN = 0000"); | 3326 | sprintf(dev_name_str, "\n\nN=0000"); |
3327 | 3327 | ||
3328 | if (copy_to_user(wrqu->data.pointer, dev_name_str, 5 + ((dev_len > 17) ? dev_len : 17))) | 3328 | if (copy_to_user(wrqu->data.pointer, dev_name_str, 5 + ((dev_len > 17) ? dev_len : 17))) |
3329 | return -EFAULT; | 3329 | return -EFAULT; |
@@ -3349,7 +3349,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev, | |||
3349 | u8 attr_content[2] = {0x00}; | 3349 | u8 attr_content[2] = {0x00}; |
3350 | 3350 | ||
3351 | u8 inv_proc_str[17 + 8] = {0x00}; | 3351 | u8 inv_proc_str[17 + 8] = {0x00}; |
3352 | /* +8 is for the str "InvProc =", we have to clear it at wrqu->data.pointer */ | 3352 | /* +8 is for the str "InvProc=", we have to clear it at wrqu->data.pointer */ |
3353 | 3353 | ||
3354 | /* Commented by Ouden 20121226 */ | 3354 | /* Commented by Ouden 20121226 */ |
3355 | /* The application wants to know P2P initiation procedure is supported or not. */ | 3355 | /* The application wants to know P2P initiation procedure is supported or not. */ |
@@ -3397,12 +3397,12 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev, | |||
3397 | spin_unlock_bh(&pmlmepriv->scanned_queue.lock); | 3397 | spin_unlock_bh(&pmlmepriv->scanned_queue.lock); |
3398 | 3398 | ||
3399 | if (!blnMatch) { | 3399 | if (!blnMatch) { |
3400 | sprintf(inv_proc_str, "\nIP =-1"); | 3400 | sprintf(inv_proc_str, "\nIP=-1"); |
3401 | } else { | 3401 | } else { |
3402 | if (attr_content[0] & 0x20) | 3402 | if (attr_content[0] & 0x20) |
3403 | sprintf(inv_proc_str, "\nIP = 1"); | 3403 | sprintf(inv_proc_str, "\nIP=1"); |
3404 | else | 3404 | else |
3405 | sprintf(inv_proc_str, "\nIP = 0"); | 3405 | sprintf(inv_proc_str, "\nIP=0"); |
3406 | } | 3406 | } |
3407 | if (copy_to_user(wrqu->data.pointer, inv_proc_str, 8 + 17)) | 3407 | if (copy_to_user(wrqu->data.pointer, inv_proc_str, 8 + 17)) |
3408 | return -EFAULT; | 3408 | return -EFAULT; |
@@ -3512,7 +3512,7 @@ static int rtw_p2p_invite_req(struct net_device *dev, | |||
3512 | /* The input data contains two informations. */ | 3512 | /* The input data contains two informations. */ |
3513 | /* 1. First information is the P2P device address which you want to send to. */ | 3513 | /* 1. First information is the P2P device address which you want to send to. */ |
3514 | /* 2. Second information is the group id which combines with GO's mac address, space and GO's ssid. */ | 3514 | /* 2. Second information is the group id which combines with GO's mac address, space and GO's ssid. */ |
3515 | /* Command line sample: iwpriv wlan0 p2p_set invite ="00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy" */ | 3515 | /* Command line sample: iwpriv wlan0 p2p_set invite="00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy" */ |
3516 | /* Format: 00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy */ | 3516 | /* Format: 00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy */ |
3517 | 3517 | ||
3518 | DBG_88E("[%s] data = %s\n", __func__, extra); | 3518 | DBG_88E("[%s] data = %s\n", __func__, extra); |
@@ -3805,48 +3805,48 @@ static int rtw_p2p_set(struct net_device *dev, | |||
3805 | 3805 | ||
3806 | #ifdef CONFIG_88EU_P2P | 3806 | #ifdef CONFIG_88EU_P2P |
3807 | DBG_88E("[%s] extra = %s\n", __func__, extra); | 3807 | DBG_88E("[%s] extra = %s\n", __func__, extra); |
3808 | if (!memcmp(extra, "enable =", 7)) { | 3808 | if (!memcmp(extra, "enable=", 7)) { |
3809 | rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]); | 3809 | rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]); |
3810 | } else if (!memcmp(extra, "setDN =", 6)) { | 3810 | } else if (!memcmp(extra, "setDN=", 6)) { |
3811 | wrqu->data.length -= 6; | 3811 | wrqu->data.length -= 6; |
3812 | rtw_p2p_setDN(dev, info, wrqu, &extra[6]); | 3812 | rtw_p2p_setDN(dev, info, wrqu, &extra[6]); |
3813 | } else if (!memcmp(extra, "profilefound =", 13)) { | 3813 | } else if (!memcmp(extra, "profilefound=", 13)) { |
3814 | wrqu->data.length -= 13; | 3814 | wrqu->data.length -= 13; |
3815 | rtw_p2p_profilefound(dev, info, wrqu, &extra[13]); | 3815 | rtw_p2p_profilefound(dev, info, wrqu, &extra[13]); |
3816 | } else if (!memcmp(extra, "prov_disc =", 10)) { | 3816 | } else if (!memcmp(extra, "prov_disc=", 10)) { |
3817 | wrqu->data.length -= 10; | 3817 | wrqu->data.length -= 10; |
3818 | rtw_p2p_prov_disc(dev, info, wrqu, &extra[10]); | 3818 | rtw_p2p_prov_disc(dev, info, wrqu, &extra[10]); |
3819 | } else if (!memcmp(extra, "nego =", 5)) { | 3819 | } else if (!memcmp(extra, "nego=", 5)) { |
3820 | wrqu->data.length -= 5; | 3820 | wrqu->data.length -= 5; |
3821 | rtw_p2p_connect(dev, info, wrqu, &extra[5]); | 3821 | rtw_p2p_connect(dev, info, wrqu, &extra[5]); |
3822 | } else if (!memcmp(extra, "intent =", 7)) { | 3822 | } else if (!memcmp(extra, "intent=", 7)) { |
3823 | /* Commented by Albert 2011/03/23 */ | 3823 | /* Commented by Albert 2011/03/23 */ |
3824 | /* The wrqu->data.length will include the null character */ | 3824 | /* The wrqu->data.length will include the null character */ |
3825 | /* So, we will decrease 7 + 1 */ | 3825 | /* So, we will decrease 7 + 1 */ |
3826 | wrqu->data.length -= 8; | 3826 | wrqu->data.length -= 8; |
3827 | rtw_p2p_set_intent(dev, info, wrqu, &extra[7]); | 3827 | rtw_p2p_set_intent(dev, info, wrqu, &extra[7]); |
3828 | } else if (!memcmp(extra, "ssid =", 5)) { | 3828 | } else if (!memcmp(extra, "ssid=", 5)) { |
3829 | wrqu->data.length -= 5; | 3829 | wrqu->data.length -= 5; |
3830 | rtw_p2p_set_go_nego_ssid(dev, info, wrqu, &extra[5]); | 3830 | rtw_p2p_set_go_nego_ssid(dev, info, wrqu, &extra[5]); |
3831 | } else if (!memcmp(extra, "got_wpsinfo =", 12)) { | 3831 | } else if (!memcmp(extra, "got_wpsinfo=", 12)) { |
3832 | wrqu->data.length -= 12; | 3832 | wrqu->data.length -= 12; |
3833 | rtw_p2p_got_wpsinfo(dev, info, wrqu, &extra[12]); | 3833 | rtw_p2p_got_wpsinfo(dev, info, wrqu, &extra[12]); |
3834 | } else if (!memcmp(extra, "listen_ch =", 10)) { | 3834 | } else if (!memcmp(extra, "listen_ch=", 10)) { |
3835 | /* Commented by Albert 2011/05/24 */ | 3835 | /* Commented by Albert 2011/05/24 */ |
3836 | /* The wrqu->data.length will include the null character */ | 3836 | /* The wrqu->data.length will include the null character */ |
3837 | /* So, we will decrease (10 + 1) */ | 3837 | /* So, we will decrease (10 + 1) */ |
3838 | wrqu->data.length -= 11; | 3838 | wrqu->data.length -= 11; |
3839 | rtw_p2p_set_listen_ch(dev, info, wrqu, &extra[10]); | 3839 | rtw_p2p_set_listen_ch(dev, info, wrqu, &extra[10]); |
3840 | } else if (!memcmp(extra, "op_ch =", 6)) { | 3840 | } else if (!memcmp(extra, "op_ch=", 6)) { |
3841 | /* Commented by Albert 2011/05/24 */ | 3841 | /* Commented by Albert 2011/05/24 */ |
3842 | /* The wrqu->data.length will include the null character */ | 3842 | /* The wrqu->data.length will include the null character */ |
3843 | /* So, we will decrease (6 + 1) */ | 3843 | /* So, we will decrease (6 + 1) */ |
3844 | wrqu->data.length -= 7; | 3844 | wrqu->data.length -= 7; |
3845 | rtw_p2p_set_op_ch(dev, info, wrqu, &extra[6]); | 3845 | rtw_p2p_set_op_ch(dev, info, wrqu, &extra[6]); |
3846 | } else if (!memcmp(extra, "invite =", 7)) { | 3846 | } else if (!memcmp(extra, "invite=", 7)) { |
3847 | wrqu->data.length -= 8; | 3847 | wrqu->data.length -= 8; |
3848 | rtw_p2p_invite_req(dev, info, wrqu, &extra[7]); | 3848 | rtw_p2p_invite_req(dev, info, wrqu, &extra[7]); |
3849 | } else if (!memcmp(extra, "persistent =", 11)) { | 3849 | } else if (!memcmp(extra, "persistent=", 11)) { |
3850 | wrqu->data.length -= 11; | 3850 | wrqu->data.length -= 11; |
3851 | rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]); | 3851 | rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]); |
3852 | } | 3852 | } |
@@ -3887,7 +3887,7 @@ static int rtw_p2p_get(struct net_device *dev, | |||
3887 | "group_id", 8)) { | 3887 | "group_id", 8)) { |
3888 | rtw_p2p_get_groupid(dev, info, wrqu, extra); | 3888 | rtw_p2p_get_groupid(dev, info, wrqu, extra); |
3889 | } else if (!memcmp((__force const char *)wrqu->data.pointer, | 3889 | } else if (!memcmp((__force const char *)wrqu->data.pointer, |
3890 | "peer_deva_inv", 9)) { | 3890 | "peer_deva_inv", 13)) { |
3891 | /* Get the P2P device address when receiving the P2P Invitation request frame. */ | 3891 | /* Get the P2P device address when receiving the P2P Invitation request frame. */ |
3892 | rtw_p2p_get_peer_devaddr_by_invitation(dev, info, wrqu, extra); | 3892 | rtw_p2p_get_peer_devaddr_by_invitation(dev, info, wrqu, extra); |
3893 | } else if (!memcmp((__force const char *)wrqu->data.pointer, | 3893 | } else if (!memcmp((__force const char *)wrqu->data.pointer, |
@@ -6920,7 +6920,7 @@ static int rtw_mp_ctx(struct net_device *dev, | |||
6920 | 6920 | ||
6921 | DBG_88E("%s: in =%s\n", __func__, extra); | 6921 | DBG_88E("%s: in =%s\n", __func__, extra); |
6922 | 6922 | ||
6923 | countPkTx = strncmp(extra, "count =", 5); /* strncmp true is 0 */ | 6923 | countPkTx = strncmp(extra, "count=", 6); /* strncmp true is 0 */ |
6924 | cotuTx = strncmp(extra, "background", 20); | 6924 | cotuTx = strncmp(extra, "background", 20); |
6925 | CarrSprTx = strncmp(extra, "background, cs", 20); | 6925 | CarrSprTx = strncmp(extra, "background, cs", 20); |
6926 | scTx = strncmp(extra, "background, sc", 20); | 6926 | scTx = strncmp(extra, "background, sc", 20); |
@@ -7044,7 +7044,7 @@ static int rtw_mp_arx(struct net_device *dev, | |||
7044 | DBG_88E("%s: %s\n", __func__, input); | 7044 | DBG_88E("%s: %s\n", __func__, input); |
7045 | 7045 | ||
7046 | bStartRx = (strncmp(input, "start", 5) == 0) ? 1 : 0; /* strncmp true is 0 */ | 7046 | bStartRx = (strncmp(input, "start", 5) == 0) ? 1 : 0; /* strncmp true is 0 */ |
7047 | bStopRx = (strncmp(input, "stop", 5) == 0) ? 1 : 0; /* strncmp true is 0 */ | 7047 | bStopRx = (strncmp(input, "stop", 4) == 0) ? 1 : 0; /* strncmp true is 0 */ |
7048 | bQueryPhy = (strncmp(input, "phy", 3) == 0) ? 1 : 0; /* strncmp true is 0 */ | 7048 | bQueryPhy = (strncmp(input, "phy", 3) == 0) ? 1 : 0; /* strncmp true is 0 */ |
7049 | 7049 | ||
7050 | if (bStartRx) { | 7050 | if (bStartRx) { |