From patchwork Sat Jul 27 16:14:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: michael-dev X-Patchwork-Id: 262475 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 7FEA62C00C0 for ; Sun, 28 Jul 2013 02:15:17 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 9D43217C0EE; Sat, 27 Jul 2013 12:15:15 -0400 (EDT) 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 ZxnmBw7bf6n6; Sat, 27 Jul 2013 12:15:15 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 239CB17C0E5; Sat, 27 Jul 2013 12:14:40 -0400 (EDT) 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 1231317C0E5 for ; Sat, 27 Jul 2013 12:14:39 -0400 (EDT) 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 n1c6qRsXbk7F for ; Sat, 27 Jul 2013 12:14:34 -0400 (EDT) Received: from mail.fem.tu-ilmenau.de (mail.fem.tu-ilmenau.de [141.24.101.79]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 6325E9D3B4 for ; Sat, 27 Jul 2013 12:14:20 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.fem.tu-ilmenau.de (Postfix) with ESMTP id EE4D3655D for ; Sat, 27 Jul 2013 18:14:19 +0200 (CEST) X-Virus-Scanned: amavisd-new at fem.tu-ilmenau.de Received: from mail.fem.tu-ilmenau.de ([127.0.0.1]) by localhost (mail.fem.tu-ilmenau.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wd7-wXb1kgWO; Sat, 27 Jul 2013 18:14:18 +0200 (CEST) Received: from a234.fem.tu-ilmenau.de (unknown [10.42.51.234]) by mail.fem.tu-ilmenau.de (Postfix) with ESMTP; Sat, 27 Jul 2013 18:14:18 +0200 (CEST) Received: from [10.42.51.234] (localhost [127.0.0.1]) by a234.fem.tu-ilmenau.de (Postfix) with ESMTP id AC974BD0; Sat, 27 Jul 2013 18:14:18 +0200 (CEST) Subject: [PATCH v3 14/25] VLAN: Use new VLAN data type in src_drivers To: hostap@lists.shmoo.com From: Michael Braun Date: Sat, 27 Jul 2013 18:14:18 +0200 Message-ID: <20130727161415.1152.54857.stgit@ray-controller> In-Reply-To: <20130727160024.1152.46147.stgit@ray-controller> References: <20130727160024.1152.46147.stgit@ray-controller> User-Agent: StGit/0.16 MIME-Version: 1.0 Cc: projekt-wlan@fem.tu-ilmenau.de X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 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 Signed-hostap: Michael Braun --- src/drivers/driver.h | 3 ++- src/drivers/driver_nl80211.c | 10 +++++----- src/drivers/driver_test.c | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index d78bdd0..47db745 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -20,6 +20,7 @@ #define WPA_SUPPLICANT_DRIVER_VERSION 4 #include "common/defs.h" +#include "common/vlan.h" #define HOSTAPD_CHAN_DISABLED 0x00000001 #define HOSTAPD_CHAN_PASSIVE_SCAN 0x00000002 @@ -1960,7 +1961,7 @@ struct wpa_driver_ops { * domains to be used with a single BSS. */ int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname, - int vlan_id); + vlan_t vlan_id); /** * commit - Optional commit changes handler (AP only) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 83d4a23..aa4310b 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -8514,7 +8514,7 @@ static int i802_set_tx_queue_params(void *priv, int queue, int aifs, static int i802_set_sta_vlan(struct i802_bss *bss, const u8 *addr, - const char *ifname, int vlan_id) + const char *ifname, vlan_t vlan_id) { struct wpa_driver_nl80211_data *drv = bss->drv; struct nl_msg *msg; @@ -8537,7 +8537,7 @@ static int i802_set_sta_vlan(struct i802_bss *bss, const u8 *addr, if (ret < 0) { wpa_printf(MSG_ERROR, "nl80211: NL80211_ATTR_STA_VLAN (addr=" MACSTR " ifname=%s vlan_id=%d) failed: %d (%s)", - MAC2STR(addr), ifname, vlan_id, ret, + MAC2STR(addr), ifname, vlan_untagged(&vlan_id), ret, strerror(-ret)); } nla_put_failure: @@ -8710,13 +8710,13 @@ static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val, wpa_printf(MSG_ERROR, "nl80211: Failed to set WDS STA " "interface %s up", name); } - return i802_set_sta_vlan(priv, addr, name, 0); + return i802_set_sta_vlan(priv, addr, name, VLAN_NULL); } else { if (bridge_ifname) linux_br_del_if(drv->global->ioctl_sock, bridge_ifname, name); - i802_set_sta_vlan(priv, addr, bss->ifname, 0); + i802_set_sta_vlan(priv, addr, bss->ifname, VLAN_NULL); return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN, name); } @@ -10395,7 +10395,7 @@ static int driver_nl80211_sta_remove(void *priv, const u8 *addr) #if defined(HOSTAPD) || defined(CONFIG_AP) static int driver_nl80211_set_sta_vlan(void *priv, const u8 *addr, - const char *ifname, int vlan_id) + const char *ifname, vlan_t vlan_id) { struct i802_bss *bss = priv; return i802_set_sta_vlan(bss, addr, ifname, vlan_id); diff --git a/src/drivers/driver_test.c b/src/drivers/driver_test.c index 541ebcc..e19845f 100644 --- a/src/drivers/driver_test.c +++ b/src/drivers/driver_test.c @@ -1127,10 +1127,10 @@ static int test_driver_set_privacy(void *priv, int enabled) static int test_driver_set_sta_vlan(void *priv, const u8 *addr, - const char *ifname, int vlan_id) + const char *ifname, vlan_t vlan_id) { wpa_printf(MSG_DEBUG, "%s(addr=" MACSTR " ifname=%s vlan_id=%d)", - __func__, MAC2STR(addr), ifname, vlan_id); + __func__, MAC2STR(addr), ifname, vlan_untagged(&vlan_id)); return 0; }