[PATCH 09/13] drivers: move driver_wired_get_capa to a common file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sabrina Dubroca <sd@xxxxxxxxxxxxxxx>
---
 src/drivers/driver_macsec_qca.c   | 10 +---------
 src/drivers/driver_wired.c        | 10 +---------
 src/drivers/driver_wired_common.c |  7 +++++++
 src/drivers/driver_wired_common.h |  2 ++
 4 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/src/drivers/driver_macsec_qca.c b/src/drivers/driver_macsec_qca.c
index eccd1d9d6c4a..8d0c98e2821c 100644
--- a/src/drivers/driver_macsec_qca.c
+++ b/src/drivers/driver_macsec_qca.c
@@ -91,14 +91,6 @@ static int macsec_qca_get_bssid(void *priv, u8 *bssid)
 }
 
 
-static int macsec_qca_get_capa(void *priv, struct wpa_driver_capa *capa)
-{
-	os_memset(capa, 0, sizeof(*capa));
-	capa->flags = WPA_DRIVER_FLAGS_WIRED;
-	return 0;
-}
-
-
 static void __macsec_drv_init(struct macsec_qca_data *drv)
 {
 	int ret = 0;
@@ -758,7 +750,7 @@ const struct wpa_driver_ops wpa_driver_macsec_qca_ops = {
 	.desc = "QCA MACsec Ethernet driver",
 	.get_ssid = macsec_qca_get_ssid,
 	.get_bssid = macsec_qca_get_bssid,
-	.get_capa = macsec_qca_get_capa,
+	.get_capa = driver_wired_get_capa,
 	.init = macsec_qca_init,
 	.deinit = macsec_qca_deinit,
 
diff --git a/src/drivers/driver_wired.c b/src/drivers/driver_wired.c
index 86589a471ae4..8512c39b5106 100644
--- a/src/drivers/driver_wired.c
+++ b/src/drivers/driver_wired.c
@@ -380,14 +380,6 @@ static int wpa_driver_wired_get_bssid(void *priv, u8 *bssid)
 }
 
 
-static int wpa_driver_wired_get_capa(void *priv, struct wpa_driver_capa *capa)
-{
-	os_memset(capa, 0, sizeof(*capa));
-	capa->flags = WPA_DRIVER_FLAGS_WIRED;
-	return 0;
-}
-
-
 static void * wpa_driver_wired_init(void *ctx, const char *ifname)
 {
 	struct wpa_driver_wired_data *drv;
@@ -422,7 +414,7 @@ const struct wpa_driver_ops wpa_driver_wired_ops = {
 	.hapd_send_eapol = wired_send_eapol,
 	.get_ssid = wpa_driver_wired_get_ssid,
 	.get_bssid = wpa_driver_wired_get_bssid,
-	.get_capa = wpa_driver_wired_get_capa,
+	.get_capa = driver_wired_get_capa,
 	.init = wpa_driver_wired_init,
 	.deinit = wpa_driver_wired_deinit,
 };
diff --git a/src/drivers/driver_wired_common.c b/src/drivers/driver_wired_common.c
index 94f6bf6daf24..d483f1de7afb 100644
--- a/src/drivers/driver_wired_common.c
+++ b/src/drivers/driver_wired_common.c
@@ -158,6 +158,13 @@ int wired_multicast_membership(int sock, int ifindex, const u8 *addr, int add)
 #endif /* __linux__ */
 }
 
+int driver_wired_get_capa(void *priv, struct wpa_driver_capa *capa)
+{
+	os_memset(capa, 0, sizeof(*capa));
+	capa->flags = WPA_DRIVER_FLAGS_WIRED;
+	return 0;
+}
+
 #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
 int driver_wired_get_ifstatus(const char *ifname, int *status)
 {
diff --git a/src/drivers/driver_wired_common.h b/src/drivers/driver_wired_common.h
index 292cfffe0b29..7b0dd399ca83 100644
--- a/src/drivers/driver_wired_common.h
+++ b/src/drivers/driver_wired_common.h
@@ -26,6 +26,8 @@ int driver_wired_get_ifflags(const char *ifname, int *flags);
 int driver_wired_set_ifflags(const char *ifname, int flags);
 int driver_wired_multi(const char *ifname, const u8 *addr, int add);
 int wired_multicast_membership(int sock, int ifindex, const u8 *addr, int add);
+int driver_wired_get_capa(void *priv, struct wpa_driver_capa *capa);
+
 #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
 int driver_wired_get_ifstatus(const char *ifname, int *status);
 #endif /* defined(__FreeBSD__) || defined(__DragonFly__) || defined(FreeBSD_kernel__) */
-- 
2.10.2


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux