From patchwork Sat Jul 2 17:09:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 940452 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p62H9F3T032067 for ; Sat, 2 Jul 2011 17:09:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753070Ab1GBRJN (ORCPT ); Sat, 2 Jul 2011 13:09:13 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:35135 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752794Ab1GBRJM (ORCPT ); Sat, 2 Jul 2011 13:09:12 -0400 Received: by iyb12 with SMTP id 12so3537576iyb.19 for ; Sat, 02 Jul 2011 10:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=X4WHW52QqxU66g3xFji4bJahRBNzJvqGUC+xPzsDfLw=; b=iYQrSnG6ilbvH34IElq2ZHceh+QTUTG5U4+14alQzk8pdCy084oCvKyUZllT1+HB45 DUYzJDKptf9O0yap4VvNbK9ClnzPnxbCdZbaPTX2MFeyWqNQMIoFVzl7iS3K0GQZiTa7 AMKwk1GldZyLA2vr7IN/ppF37Q5Do9GcqmoSI= Received: by 10.42.197.199 with SMTP id el7mr4598828icb.237.1309626552154; Sat, 02 Jul 2011 10:09:12 -0700 (PDT) Received: from larrylap.lan ([65.28.92.85]) by mx.google.com with ESMTPS id d6sm4590226icx.1.2011.07.02.10.09.09 (version=SSLv3 cipher=OTHER); Sat, 02 Jul 2011 10:09:10 -0700 (PDT) Message-ID: <4E0F50B4.3080805@lwfinger.net> Date: Sat, 02 Jul 2011 12:09:08 -0500 From: Larry Finger User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11 MIME-Version: 1.0 To: ali@internetdog.org CC: linux-wireless@vger.kernel.org Subject: Re: r8712u driver for the rtl8192su chip. References: <4DC0669E.4040100@lwfinger.net> <4DC06BF3.6070208@lwfinger.net> <20110621124954.GA8462@internetdog.org> <4E011644.3070906@lwfinger.net> <20110622010057.GA12123@internetdog.org> <4E0154B7.2000204@lwfinger.net> <20110622025623.GC12547@internetdog.org> <4E015CE8.3000304@lwfinger.net> <20110627072351.GA4251@internetdog.org> In-Reply-To: <20110627072351.GA4251@internetdog.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 02 Jul 2011 17:09:16 +0000 (UTC) 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))