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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.14 next-20171124]
[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/20171126-052554
config: x86_64-randconfig-n0-11270329 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (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:3101:9: error: implicit declaration of function 'rtw_sta_flush'; did you mean 'rtw_set_auth'? [-Werror=implicit-function-declaration]
     return rtw_sta_flush(padapter);
            ^~~~~~~~~~~~~
            rtw_set_auth
   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:3133:49: error: 'union <anonymous>' has no member named 'add_sta'
     DBG_88E("rtw_add_sta(aid =%d) =%pM\n", param->u.add_sta.aid, (param->sta_addr));
                                                    ^
   include/linux/printk.h:310:34: note: in definition of macro 'pr_info'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                     ^~~~~~~~~~~
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3133:2: note: in expansion of macro 'DBG_88E'
     DBG_88E("rtw_add_sta(aid =%d) =%pM\n", param->u.add_sta.aid, (param->sta_addr));
     ^~~~~~~
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3145:23: error: 'union <anonymous>' has no member named 'add_sta'
      int flags = param->u.add_sta.flags;
                          ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3146:23: 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:3148:36: 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:3151:7: error: 'WLAN_STA_WME' undeclared (first use in this function); did you mean 'SCAN_STATE'?
      if (WLAN_STA_WME&flags)
          ^~~~~~~~~~~~
          SCAN_STATE
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3151:7: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3160:7: error: 'WLAN_STA_HT' undeclared (first use in this function); did you mean 'WLAN_STA_WME'?
      if (WLAN_STA_HT&flags) {
          ^~~~~~~~~~~
          WLAN_STA_WME
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3164:20: error: 'union <anonymous>' has no member named 'add_sta'
              &param->u.add_sta.ht_cap,
                       ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3173:3: error: implicit declaration of function 'update_sta_info_apmode'; did you mean 'update_sta_info'? [-Werror=implicit-function-declaration]
      update_sta_info_apmode(padapter, psta);
      ^~~~~~~~~~~~~~~~~~~~~~
      update_sta_info
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_del_sta_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3229:14: error: 'struct sta_priv' has no member named 'asoc_list_cnt'; did you mean 'asoc_list_lock'?
       pstapriv->asoc_list_cnt--;
                 ^~~~~~~~~~~~~
                 asoc_list_lock
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3230:14: error: implicit declaration of function 'ap_free_sta'; did you mean '__kfree_skb'? [-Werror=implicit-function-declaration]
       updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
                 ^~~~~~~~~~~
                 __kfree_skb
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3233:3: 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:3276:18: error: 'union <anonymous>' has no member named 'bcn_ie'; did you mean 'wpa_ie'?
     pbuf = param->u.bcn_ie.buf;
                     ^~~~~~
                     wpa_ie
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3283: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:3283:42: error: 'union <anonymous>' has no member named 'bcn_ie'; did you mean 'wpa_ie'?
     memcpy(&pstapriv->max_num_sta, param->u.bcn_ie.reserved, 2);
                                             ^~~~~~
                                             wpa_ie
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3285: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:3285: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:3286: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:3288:6: error: implicit declaration of function 'rtw_check_beacon_data'; did you mean 'rtw_set_beacon_pvt'? [-Werror=implicit-function-declaration]
     if (rtw_check_beacon_data(padapter, pbuf,  (len-12-2)) == _SUCCESS) //  12 = Param header, 2 = Not packed.
         ^~~~~~~~~~~~~~~~~~~~~
         rtw_set_beacon_pvt
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_encryption_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3412:4: error: implicit declaration of function 'set_wep_key'; did you mean 'rtw_set_key'? [-Werror=implicit-function-declaration]
       set_wep_key(padapter, pwep->KeyMaterial, pwep->KeyLength, wep_key_idx);
       ^~~~~~~~~~~
       rtw_set_key
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3476:4: error: implicit declaration of function 'set_group_key'; did you mean 'set_groups'? [-Werror=implicit-function-declaration]
       set_group_key(padapter, param->u.crypt.key, psecuritypriv->dot118021XGrpPrivacy, param->u.crypt.idx);
       ^~~~~~~~~~~~~
       set_groups
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3517:5: error: implicit declaration of function 'set_pairwise_key'; did you mean 'set_dma_reserve'? [-Werror=implicit-function-declaration]
        set_pairwise_key(padapter, psta);
        ^~~~~~~~~~~~~~~~
        set_dma_reserve
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_get_sta_wpaie_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3621:11: 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:3622:11: 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:3626:26: 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:3627:58: 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:790:13: note: in definition of macro '__min'
     t2 min2 = (y);     \
                ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3627:20: 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:3629:46: 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:3682:19: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'; did you mean 'wps_probe_req_ie'?
     kfree(pmlmepriv->wps_beacon_ie);
                      ^~~~~~~~~~~~~
                      wps_probe_req_ie
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3683:13: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'; did you mean 'wps_probe_req_ie'?
     pmlmepriv->wps_beacon_ie = NULL;
                ^~~~~~~~~~~~~
                wps_probe_req_ie
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3686:14: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'; did you mean 'wps_probe_req_ie'?
      pmlmepriv->wps_beacon_ie = rtw_malloc(ie_len);
                 ^~~~~~~~~~~~~
                 wps_probe_req_ie
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3687:14: error: 'struct mlme_priv' has no member named 'wps_beacon_ie_len'; did you mean 'wps_probe_req_ie_len'?
      pmlmepriv->wps_beacon_ie_len = ie_len;
                 ^~~~~~~~~~~~~~~~~
                 wps_probe_req_ie_len
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3688:19: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'; did you mean 'wps_probe_req_ie'?
      if (!pmlmepriv->wps_beacon_ie) {
                      ^~~~~~~~~~~~~
                      wps_probe_req_ie
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3693:21: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'; did you mean 'wps_probe_req_ie'?
      memcpy(pmlmepriv->wps_beacon_ie, param->u.bcn_ie.buf, ie_len);
                        ^~~~~~~~~~~~~
                        wps_probe_req_ie
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3693:45: error: 'union <anonymous>' has no member named 'bcn_ie'; did you mean 'wpa_ie'?
      memcpy(pmlmepriv->wps_beacon_ie, param->u.bcn_ie.buf, ie_len);
                                                ^~~~~~
                                                wpa_ie
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3694:3: error: implicit declaration of function 'update_beacon'; did you mean 'update_beacon_info'? [-Werror=implicit-function-declaration]
      update_beacon(padapter, _VENDOR_SPECIFIC_IE_, wps_oui, true);
      ^~~~~~~~~~~~~
      update_beacon_info

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

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

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux