[PATCH v4 14/25] VLAN: Use new VLAN data type in src_drivers

Michael Braun michael-dev
Sat Jul 27 12:55:36 PDT 2013


Signed-hostap: Michael Braun <michael-dev at fami-braun.de>
---
 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;
 }
 




More information about the Hostap mailing list