From patchwork Mon Feb 11 11:15:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 219574 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 053962C007C for ; Mon, 11 Feb 2013 22:16:24 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 304649C332; Mon, 11 Feb 2013 06:16:21 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XyIWb3ibLVsY; Mon, 11 Feb 2013 06:16:20 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A9E5C9C1DE; Mon, 11 Feb 2013 06:16:08 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4608E9C1ED for ; Mon, 11 Feb 2013 06:16:07 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VTPJH+G5qHEg for ; Mon, 11 Feb 2013 06:16:02 -0500 (EST) Received: from mms3.broadcom.com (mms3.broadcom.com [216.31.210.19]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4BD3C9C1D4 for ; Mon, 11 Feb 2013 06:16:02 -0500 (EST) Received: from [10.9.208.57] by mms3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Mon, 11 Feb 2013 03:10:14 -0800 X-Server-Uuid: B86B6450-0931-4310-942E-F00ED04CA7AF Received: from IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Mon, 11 Feb 2013 03:15:53 -0800 Received: from mail-sj1-12.sj.broadcom.com (10.10.10.20) by IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) with Microsoft SMTP Server id 14.1.438.0; Mon, 11 Feb 2013 03:15:53 -0800 Received: from linux-e6410-1 (unknown [10.176.68.31]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 2EB75207D2; Mon, 11 Feb 2013 03:15:52 -0800 (PST) Received: from arend by linux-e6410-1 with local (Exim 4.80) ( envelope-from ) id 1U4rMV-0006yt-76; Mon, 11 Feb 2013 12:15:51 +0100 From: "Arend van Spriel" To: hostap@lists.shmoo.com Subject: [RFC 06/10] nl80211_driver: add support for P2P device in adding and removing interface Date: Mon, 11 Feb 2013 12:15:43 +0100 Message-ID: <1360581347-26766-7-git-send-email-arend@broadcom.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360581347-26766-1-git-send-email-arend@broadcom.com> References: <1360581347-26766-1-git-send-email-arend@broadcom.com> MIME-Version: 1.0 X-WSS-ID: 7D060E1C3OG1999399-01-01 Cc: Jouni Malinen , Johannes Berg X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: David Spinadel Don't try to assign ifindex for P2P device interface and check that the ifindex is valid before trying to remove it. Don't try to set TX rates for P2P device interface since it's not a network device. Signed-hostap: David Spinadel --- src/drivers/driver_nl80211.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index f0306f1..183761a 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -6051,6 +6051,13 @@ static int nl80211_create_iface_once(struct wpa_driver_nl80211_data *drv, return ret; } + if (iftype == NL80211_IFTYPE_P2P_DEVICE) { + wpa_printf(MSG_DEBUG, + "nl80211 New P2P device interface %s created", + ifname); + return 0; + } + ifidx = if_nametoindex(ifname); wpa_printf(MSG_DEBUG, "nl80211: New interface %s created: ifindex=%d", ifname, ifidx); @@ -6094,7 +6101,8 @@ static int nl80211_create_iface(struct wpa_driver_nl80211_data *drv, wds, handler, arg); } - if (ret >= 0 && is_p2p_interface(iftype)) + if (ret >= 0 && is_p2p_interface(iftype) && + iftype != NL80211_IFTYPE_P2P_DEVICE) nl80211_disable_11b_rates(drv, ret, 1); return ret; @@ -7345,7 +7353,7 @@ done: return ret; } - if (is_p2p_interface(nlmode)) + if (is_p2p_interface(nlmode) && nlmode != NL80211_IFTYPE_P2P_DEVICE) nl80211_disable_11b_rates(drv, drv->ifindex, 1); else if (drv->disabled_11b_rates) nl80211_disable_11b_rates(drv, drv->ifindex, 0);