On 06/27/2011 02:23 AM, Ali Bahar wrote:
Hi Larry, The cause is that the driver's handler for the Set expects that the interface is Up. In my case, it was not, and so it returns a -1. This pops back up the call-chain until it gets misinterpreted as an EPERM. I'll use this Set as an example, though the same pattern is seen elsewhere. Upon entry into r8711_wx_set_scan(), this check is done: 1090 if (padapter->bup == false) 1091 return -1; The adapter structure has no comments as to what bup is (nor for bDriverStopped). Current usage suggests that bup indicates that the interface is Up (and bDriverStopped indicates that the driver has been cleanly stopped)
The meaning of "bup" is that it is a boolean indicating whether the interface is up or not, just as you surmised.
The attached patch has been floating around for a while. Does it help? Larry
Index: linux-2.6/drivers/staging/rtl8712/rtl871x_ioctl_linux.c =================================================================== --- linux-2.6.orig/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ linux-2.6/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -990,8 +990,6 @@ static int r8711_wx_set_wap(struct net_d struct wlan_network *pnetwork = NULL; enum NDIS_802_11_AUTHENTICATION_MODE authmode; - if (padapter->bup == false) - return -1; if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) return -1; if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) @@ -1182,8 +1180,6 @@ static int r8711_wx_set_essid(struct net struct list_head *phead; u32 len; - if (padapter->bup == false) - return -1; if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) return -1; if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))