[PATCH v3] staging: rtl8188eu: Fix private WEXT IOCTL calls

kbuild test robot lkp at intel.com
Mon Dec 4 15:20:05 UTC 2017


Hi Ishraq,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.15-rc2 next-20171204]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/ishraq-i-ashraf-gmail-com/staging-rtl8188eu-Fix-private-WEXT-IOCTL-calls/20171128-130403
config: x86_64-randconfig-u0-12042048 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_hostapd_sta_flush_pvt':
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3088:9: error: implicit declaration of function 'rtw_sta_flush' [-Werror=implicit-function-declaration]
     return rtw_sta_flush(padapter);
            ^
   In file included from include/linux/kernel.h:14:0,
                    from include/linux/skbuff.h:17,
                    from include/linux/if_ether.h:23,
                    from include/linux/ieee80211.h:21,
                    from drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:17:
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_add_sta_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3113:11: error: 'union <anonymous>' has no member named 'add_sta'
      param->u.add_sta.aid,
              ^
   include/linux/printk.h:308:34: note: in definition of macro 'pr_info'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                     ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3112:2: note: in expansion of macro 'DBG_88E'
     DBG_88E("rtw_add_sta(aid =%d) =%pM\n",
     ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3134:18: error: 'union <anonymous>' has no member named 'add_sta'
     flags = param->u.add_sta.flags;
                     ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3135:22: error: 'union <anonymous>' has no member named 'add_sta'
     psta->aid = param->u.add_sta.aid; /* aid = 1~2007. */
                         ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3137:35: error: 'union <anonymous>' has no member named 'add_sta'
     memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16);
                                      ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3140:6: error: 'WLAN_STA_WME' undeclared (first use in this function)
     if (WLAN_STA_WME&flags)
         ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3140:6: note: each undeclared identifier is reported only once for each function it appears in
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3149:6: error: 'WLAN_STA_HT' undeclared (first use in this function)
     if (WLAN_STA_HT&flags) {
         ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3153:19: error: 'union <anonymous>' has no member named 'add_sta'
             &param->u.add_sta.ht_cap,
                      ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3162:2: error: implicit declaration of function 'update_sta_info_apmode' [-Werror=implicit-function-declaration]
     update_sta_info_apmode(padapter, psta);
     ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_del_sta_pvt':
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3225:11: error: 'struct sta_priv' has no member named 'asoc_list_cnt'
      pstapriv->asoc_list_cnt--;
              ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3226:13: error: implicit declaration of function 'ap_free_sta' [-Werror=implicit-function-declaration]
      updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
                ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3230:2: error: implicit declaration of function 'associated_clients_update' [-Werror=implicit-function-declaration]
     associated_clients_update(padapter, updated);
     ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_beacon_pvt':
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3267:17: error: 'union <anonymous>' has no member named 'bcn_ie'
     pbuf = param->u.bcn_ie.buf;
                    ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3276:18: error: 'struct sta_priv' has no member named 'max_num_sta'
     memcpy(&pstapriv->max_num_sta, param->u.bcn_ie.reserved, 2);
                     ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3276:41: error: 'union <anonymous>' has no member named 'bcn_ie'
     memcpy(&pstapriv->max_num_sta, param->u.bcn_ie.reserved, 2);
                                            ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3278:15: error: 'struct sta_priv' has no member named 'max_num_sta'
     if ((pstapriv->max_num_sta > NUM_STA) || (pstapriv->max_num_sta <= 0))
                  ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3278:52: error: 'struct sta_priv' has no member named 'max_num_sta'
     if ((pstapriv->max_num_sta > NUM_STA) || (pstapriv->max_num_sta <= 0))
                                                       ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3279:11: error: 'struct sta_priv' has no member named 'max_num_sta'
      pstapriv->max_num_sta = NUM_STA;
              ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3281:6: error: implicit declaration of function 'rtw_check_beacon_data' [-Werror=implicit-function-declaration]
     if (rtw_check_beacon_data(padapter, pbuf,  (len-12-2)) != _SUCCESS) { /*  12 = Param header, 2 = Not packed. */
         ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_encryption_pvt':
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3411:4: error: implicit declaration of function 'set_wep_key' [-Werror=implicit-function-declaration]
       set_wep_key(padapter, pwep->KeyMaterial, pwep->KeyLength, wep_key_idx);
       ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3477:4: error: implicit declaration of function 'set_group_key' [-Werror=implicit-function-declaration]
       set_group_key(padapter, param->u.crypt.key, psecuritypriv->dot118021XGrpPrivacy, param->u.crypt.idx);
       ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3521:5: error: implicit declaration of function 'set_pairwise_key' [-Werror=implicit-function-declaration]
        set_pairwise_key(padapter, psta);
        ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_get_sta_wpaie_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3624:10: error: 'struct sta_info' has no member named 'wpa_ie'
     if (psta->wpa_ie[0] == WLAN_EID_RSN ||
             ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3625:10: error: 'struct sta_info' has no member named 'wpa_ie'
         psta->wpa_ie[0] == WLAN_EID_VENDOR_SPECIFIC) {
             ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3629:20: error: 'struct sta_info' has no member named 'wpa_ie'
      wpa_ie_len = psta->wpa_ie[1];
                       ^
   In file included from include/linux/skbuff.h:17:0,
                    from include/linux/if_ether.h:23,
                    from include/linux/ieee80211.h:21,
                    from drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:17:
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3630:52: error: 'struct sta_info' has no member named 'wpa_ie'
      copy_len = min_t(int, wpa_ie_len + 2, sizeof(psta->wpa_ie));
                                                       ^
   include/linux/kernel.h:791:13: note: in definition of macro '__min'
     t2 min2 = (y);     \
                ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3630:14: note: in expansion of macro 'min_t'
      copy_len = min_t(int, wpa_ie_len + 2, sizeof(psta->wpa_ie));
                 ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3632:40: error: 'struct sta_info' has no member named 'wpa_ie'
      memcpy(param->u.wpa_ie.reserved, psta->wpa_ie, copy_len);
                                           ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_wps_beacon_pvt':
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3681:17: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
     kfree(pmlmepriv->wps_beacon_ie);
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3682:11: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
     pmlmepriv->wps_beacon_ie = NULL;
              ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3686:12: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
      pmlmepriv->wps_beacon_ie = kmalloc(ie_len, GFP_KERNEL);
               ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3687:17: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
      if (!pmlmepriv->wps_beacon_ie) {
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3693:12: error: 'struct mlme_priv' has no member named 'wps_beacon_ie_len'
      pmlmepriv->wps_beacon_ie_len = ie_len;
               ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3694:19: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
      memcpy(pmlmepriv->wps_beacon_ie, param->u.bcn_ie.buf, ie_len);
                      ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3694:44: error: 'union <anonymous>' has no member named 'bcn_ie'
      memcpy(pmlmepriv->wps_beacon_ie, param->u.bcn_ie.buf, ie_len);
                                               ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3695:3: error: implicit declaration of function 'update_beacon' [-Werror=implicit-function-declaration]
      update_beacon(padapter, _VENDOR_SPECIFIC_IE_, wps_oui, true);
      ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3696:11: error: 'struct mlme_ext_priv' has no member named 'bstart_bss'
      pmlmeext->bstart_bss = true;
              ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3704:17: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
     kfree(pmlmepriv->wps_beacon_ie);
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3709:17: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
     kfree(pmlmepriv->wps_beacon_ie);
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_wps_probe_resp_pvt':
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3745:17: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
     kfree(pmlmepriv->wps_probe_resp_ie);
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3746:11: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
     pmlmepriv->wps_probe_resp_ie = NULL;
              ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3750:12: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
      pmlmepriv->wps_probe_resp_ie = kmalloc(ie_len, GFP_KERNEL);
               ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3751:17: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
      if (!pmlmepriv->wps_probe_resp_ie) {
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3757:12: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie_len'
      pmlmepriv->wps_probe_resp_ie_len = ie_len;
               ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3758:19: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
      memcpy(pmlmepriv->wps_probe_resp_ie, param->u.bcn_ie.buf, ie_len);
                      ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3758:48: error: 'union <anonymous>' has no member named 'bcn_ie'
      memcpy(pmlmepriv->wps_probe_resp_ie, param->u.bcn_ie.buf, ie_len);
                                                   ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3766:17: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
     kfree(pmlmepriv->wps_probe_resp_ie);
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3771:17: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
     kfree(pmlmepriv->wps_probe_resp_ie);
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_wps_assoc_resp_pvt':
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3807:17: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
     kfree(pmlmepriv->wps_assoc_resp_ie);
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3808:11: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
     pmlmepriv->wps_assoc_resp_ie = NULL;
              ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3812:12: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
      pmlmepriv->wps_assoc_resp_ie = kmalloc(ie_len, GFP_KERNEL);
               ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3813:17: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
      if (!pmlmepriv->wps_assoc_resp_ie) {
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3819:12: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie_len'
      pmlmepriv->wps_assoc_resp_ie_len = ie_len;
               ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3820:19: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
      memcpy(pmlmepriv->wps_assoc_resp_ie, param->u.bcn_ie.buf, ie_len);
                      ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3820:48: error: 'union <anonymous>' has no member named 'bcn_ie'
      memcpy(pmlmepriv->wps_assoc_resp_ie, param->u.bcn_ie.buf, ie_len);
                                                   ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3828:17: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
     kfree(pmlmepriv->wps_assoc_resp_ie);
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3833:17: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
     kfree(pmlmepriv->wps_assoc_resp_ie);
                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_ioctl_get_sta_data_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3913:41: error: dereferencing pointer to incomplete type 'struct ieee_param_ex'
     psta_data = (struct sta_data *)param_ex->data;
                                            ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3935:11: error: dereferencing pointer to incomplete type 'struct sta_data'
     psta_data->aid = (u16)psta->aid;
              ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3936:30: error: 'struct sta_info' has no member named 'capability'
     psta_data->capability = psta->capability;
                                 ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3937:25: error: 'struct sta_info' has no member named 'flags'
     psta_data->flags = psta->flags;
                            ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3949:9: error: 'struct sta_info' has no member named 'nonerp_set'
      ((psta->nonerp_set) |
            ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3950:8: error: 'struct sta_info' has no member named 'no_short_slot_time_set'
      (psta->no_short_slot_time_set << 1) |
           ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3951:8: error: 'struct sta_info' has no member named 'no_short_preamble_set'
      (psta->no_short_preamble_set << 2) |
           ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3952:8: error: 'struct sta_info' has no member named 'no_ht_gf_set'
      (psta->no_ht_gf_set << 3) |
           ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3953:8: error: 'struct sta_info' has no member named 'no_ht_set'
      (psta->no_ht_set << 4) |
           ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3954:8: error: 'struct sta_info' has no member named 'ht_20mhz_set'
      (psta->ht_20mhz_set << 5));
           ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_ioctl_set_macaddr_acl_pvt':
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:4003:2: error: implicit declaration of function 'rtw_set_macaddr_acl' [-Werror=implicit-function-declaration]
     rtw_set_macaddr_acl(padapter, param->u.mlme.command);
     ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_ioctl_acl_add_sta_pvt':
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:4048:8: error: implicit declaration of function 'rtw_acl_add_sta' [-Werror=implicit-function-declaration]
     ret = rtw_acl_add_sta(padapter, param->sta_addr);
           ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_ioctl_acl_remove_sta_pvt':
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:4095:8: error: implicit declaration of function 'rtw_acl_remove_sta' [-Werror=implicit-function-declaration]
     ret = rtw_acl_remove_sta(padapter, param->sta_addr);
           ^
   cc1: some warnings being treated as errors

vim +3113 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c

  3080	
  3081	static int rtw_hostapd_sta_flush_pvt(struct net_device *dev,
  3082					     struct iw_request_info *info,
  3083					     union iwreq_data *wrqu,
  3084					     char *extra)
  3085	{
  3086		struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
  3087		flush_all_cam_entry(padapter); /* Clear CAM. */
> 3088		return rtw_sta_flush(padapter);
  3089	}
  3090	
  3091	static int rtw_add_sta_pvt(struct net_device *dev,
  3092				   struct iw_request_info *info,
  3093				   union iwreq_data *wrqu,
  3094				   char *extra)
  3095	{
  3096		int ret;
  3097		int flags;
  3098		struct sta_info *psta;
  3099		struct ieee_param *param;
  3100		struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
  3101		struct sta_priv *pstapriv = &padapter->stapriv;
  3102		struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
  3103	
  3104		param = (struct ieee_param *)kmalloc(wrqu->data.length, GFP_KERNEL);
  3105		if (!param)
  3106			return -ENOMEM;
  3107	
  3108		ret = get_private_handler_ieee_param(padapter, wrqu, param);
  3109		if (ret)
  3110			goto err_free_param;
  3111	
  3112		DBG_88E("rtw_add_sta(aid =%d) =%pM\n",
> 3113			param->u.add_sta.aid,
  3114			(param->sta_addr));
  3115	
  3116		if (!check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE))) {
  3117			ret = -EINVAL;
  3118			goto err_free_param;
  3119		}
  3120	
  3121		if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
  3122		    param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
  3123		    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
  3124			ret = -EINVAL;
  3125			goto err_free_param;
  3126		}
  3127	
  3128		psta = rtw_get_stainfo(pstapriv, param->sta_addr);
  3129		if (!psta) {
  3130			ret = -ENOMEM;
  3131			goto err_free_param;
  3132		}
  3133	
  3134		flags = param->u.add_sta.flags;
  3135		psta->aid = param->u.add_sta.aid; /* aid = 1~2007. */
  3136	
  3137		memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16);
  3138	
  3139		/* Check WMM cap. */
  3140		if (WLAN_STA_WME&flags)
  3141			psta->qos_option = 1;
  3142		else
  3143			psta->qos_option = 0;
  3144	
  3145		if (pmlmepriv->qospriv.qos_option == 0)
  3146			psta->qos_option = 0;
  3147	
  3148		/* Check 802.11n HT cap. */
  3149		if (WLAN_STA_HT&flags) {
  3150			psta->htpriv.ht_option = true;
  3151			psta->qos_option = 1;
  3152			memcpy(&psta->htpriv.ht_cap,
  3153			       &param->u.add_sta.ht_cap,
  3154			       sizeof(struct ieee80211_ht_cap));
  3155		} else {
  3156			psta->htpriv.ht_option = false;
  3157		}
  3158	
  3159		if (pmlmepriv->htpriv.ht_option == false)
  3160			psta->htpriv.ht_option = false;
  3161	
  3162		update_sta_info_apmode(padapter, psta);
  3163	
  3164		if (copy_to_user(wrqu->data.pointer, param, wrqu->data.length)) {
  3165			ret = -EFAULT;
  3166			goto err_free_param;
  3167		}
  3168	
  3169		kfree(param);
  3170		return 0;
  3171	
  3172	err_free_param:
  3173		kfree(param);
  3174		return ret;
  3175	}
  3176	
  3177	static int rtw_del_sta_pvt(struct net_device *dev,
  3178				   struct iw_request_info *info,
  3179				   union iwreq_data *wrqu,
  3180				   char *extra)
  3181	{
  3182		int ret;
  3183		int updated;
  3184		struct sta_info *psta;
  3185		struct ieee_param *param;
  3186		struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
  3187		struct sta_priv *pstapriv = &padapter->stapriv;
  3188		struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
  3189	
  3190		param = (struct ieee_param *)kmalloc(wrqu->data.length, GFP_KERNEL);
  3191		if (!param)
  3192			return -ENOMEM;
  3193	
  3194		ret = get_private_handler_ieee_param(padapter, wrqu, param);
  3195		if (ret)
  3196			goto err_free_param;
  3197	
  3198		DBG_88E("rtw_del_sta =%pM\n", (param->sta_addr));
  3199	
  3200		if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) {
  3201			ret = -EINVAL;
  3202			goto err_free_param;
  3203		}
  3204	
  3205		if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
  3206		    param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
  3207		    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
  3208			ret = -EINVAL;
  3209			goto err_free_param;
  3210		}
  3211	
  3212		psta = rtw_get_stainfo(pstapriv, param->sta_addr);
  3213		if (!psta) {
  3214			DBG_88E("rtw_del_sta(), sta has already been removed or never been added\n");
  3215			ret = -ENOMEM;
  3216			goto err_free_param;
  3217		}
  3218	
  3219		spin_lock_bh(&pstapriv->asoc_list_lock);
  3220	
  3221		updated = 0;
  3222	
  3223		if (!list_empty(&psta->asoc_list)) {
  3224			list_del_init(&psta->asoc_list);
> 3225			pstapriv->asoc_list_cnt--;
  3226			updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
  3227		}
  3228	
  3229		spin_unlock_bh(&pstapriv->asoc_list_lock);
> 3230		associated_clients_update(padapter, updated);
  3231	
  3232		if (copy_to_user(wrqu->data.pointer, param, wrqu->data.length)) {
  3233			ret = -EFAULT;
  3234			goto err_free_param;
  3235		}
  3236	
  3237		kfree(param);
  3238		return 0;
  3239	
  3240	err_free_param:
  3241		kfree(param);
  3242		return ret;
  3243	}
  3244	
  3245	static int rtw_set_beacon_pvt(struct net_device *dev,
  3246				      struct iw_request_info *info,
  3247				      union iwreq_data *wrqu,
  3248				      char *extra)
  3249	{
  3250		int ret;
  3251		int len;
  3252		unsigned char *pbuf;
  3253		struct ieee_param *param;
  3254		struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
  3255		struct sta_priv *pstapriv = &padapter->stapriv;
  3256		struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
  3257	
  3258		param = (struct ieee_param *)kmalloc(wrqu->data.length, GFP_KERNEL);
  3259		if (!param)
  3260			return -ENOMEM;
  3261	
  3262		ret = get_private_handler_ieee_param(padapter, wrqu, param);
  3263		if (ret)
  3264			goto err_free_param;
  3265	
  3266		len = wrqu->data.length;
  3267		pbuf = param->u.bcn_ie.buf;
  3268	
  3269		DBG_88E("%s, len =%d\n", __func__, len);
  3270	
  3271		if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) {
  3272			ret = -EINVAL;
  3273			goto err_free_param;
  3274		}
  3275	
> 3276		memcpy(&pstapriv->max_num_sta, param->u.bcn_ie.reserved, 2);
  3277	
  3278		if ((pstapriv->max_num_sta > NUM_STA) || (pstapriv->max_num_sta <= 0))
  3279			pstapriv->max_num_sta = NUM_STA;
  3280	
  3281		if (rtw_check_beacon_data(padapter, pbuf,  (len-12-2)) != _SUCCESS) { /*  12 = Param header, 2 = Not packed. */
  3282			ret = -EINVAL;
  3283			goto err_free_param;
  3284		}
  3285	
  3286		if (copy_to_user(wrqu->data.pointer, param, wrqu->data.length)) {
  3287			ret = -EFAULT;
  3288			goto err_free_param;
  3289		}
  3290	
  3291		kfree(param);
  3292		return 0;
  3293	
  3294	err_free_param:
  3295		kfree(param);
  3296		return ret;
  3297	}
  3298	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 31164 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20171204/27e281d1/attachment-0001.bin>


More information about the devel mailing list