From 648b68a82a8eea284436273b48b3c2477fc2a7a3 Mon Sep 17 00:00:00 2001 From: "arron.wang" Date: Fri, 8 Jun 2012 08:35:42 +0800 Subject: [PATCH] Rebase the patches and maintain through git --- ...eate-a-libeap-library-with-header-files-a.patch | 395 --------------------- ...tom-event-for-broadcom-proprietary-driver.patch | 69 ---- .../0002-nl80211-Add-a-get_country-hook.patch | 120 ------- .../0003-dbus-Add-a-Country-global-property.patch | 121 ------- packaging/wpa_s-alldrivers.patch | 63 ---- packaging/wpa_supplicant.changes | 3 + packaging/wpa_supplicant.spec | 20 +- .../fi.epitest.hostap.WPASupplicant.service.in | 2 +- .../dbus/fi.w1.wpa_supplicant1.service.in | 2 +- 9 files changed, 9 insertions(+), 786 deletions(-) delete mode 100644 packaging/0001-eap_peer-create-a-libeap-library-with-header-files-a.patch delete mode 100644 packaging/0001-events-Custom-event-for-broadcom-proprietary-driver.patch delete mode 100644 packaging/0002-nl80211-Add-a-get_country-hook.patch delete mode 100644 packaging/0003-dbus-Add-a-Country-global-property.patch delete mode 100644 packaging/wpa_s-alldrivers.patch diff --git a/packaging/0001-eap_peer-create-a-libeap-library-with-header-files-a.patch b/packaging/0001-eap_peer-create-a-libeap-library-with-header-files-a.patch deleted file mode 100644 index c4bff18..0000000 --- a/packaging/0001-eap_peer-create-a-libeap-library-with-header-files-a.patch +++ /dev/null @@ -1,395 +0,0 @@ -From 3de5e59b291b6f58317bb16736f8c0271754378e Mon Sep 17 00:00:00 2001 -From: Inaky Perez-Gonzalez -Date: Sat, 2 Oct 2010 00:11:51 -0700 -Subject: [PATCH] eap_peer: create a libeap library, with header files and pkg-config [v2] - -This adds infrastructe in src/eap_peer to make libeap.so and install -the needed header files and pkg-config files. - -Now, this is quite dirty and probably not what we want in the long -term, but serves as an starting point: - - - we don't build from the wpa_supplicant directory because the - objects the .so have to be built with -fPIC. So if you need to - build both the binary and the library: - - make -C wpa_supplicant - make -C src/eap_peer clean - make -C src/eap_peer - - As I said, it's dirty -- we'd need either wpa_supplicant linking - against the library properly (but that seems not to be desirable) - or a multiple object build approach ala automake. - - - need to use 'override CFLAGS' in src/eap_peer/Makefile, otherwise - any CFLAGS setting will kill the build infrastructure. I miss - AM_CFLAGS. - - - adds 'eap_register_methods()' that will register every compiled in - method. - -Signed-off-by: Inaky Perez-Gonzalez ---- - build_release | 12 +++ - src/eap_peer/Makefile | 191 ++++++++++++++++++++++++++++++++++++++++++-- - src/eap_peer/eap_methods.c | 114 ++++++++++++++++++++++++++ - src/eap_peer/eap_methods.h | 1 + - src/eap_peer/libeap0.pc | 10 +++ - 5 files changed, 320 insertions(+), 8 deletions(-) - create mode 100644 src/eap_peer/libeap0.pc - -diff --git a/src/eap_peer/Makefile b/src/eap_peer/Makefile -index 3651056..58c067a 100644 ---- a/src/eap_peer/Makefile -+++ b/src/eap_peer/Makefile -@@ -1,11 +1,186 @@ --all: -- @echo Nothing to be made. -+LIBEAP_NAME = libeap -+LIBEAP_CURRENT = 0 -+LIBEAP_REVISION = 0 -+LIBEAP_AGE = 0 -+ -+LIBEAP = $(LIBEAP_NAME).so.$(LIBEAP_CURRENT).$(LIBEAP_REVISION).$(LIBEAP_AGE) -+LIBEAP_SO = $(LIBEAP_NAME).so.$(LIBEAP_CURRENT) -+ -+.PHONY: all clean install uninstall -+ -+all: $(LIBEAP) -+ -+ifndef CC -+CC=gcc -+endif -+ -+ifndef CFLAGS -+CFLAGS = -MMD -O0 -Wall -g -+endif -+ -+CONFIG_TLS=openssl -+ -+INCLUDE_INSTALL_DIR=/usr/include/eap_peer -+ -+# Got to use override all across the board, otherwise a 'make -+# CFLAGS=XX' will kill us because the command line's CFLAGS will -+# overwrite Make's and we'll loose all the infrastructure it sets. -+override CFLAGS += -I. -I.. -I../crypto -I../utils -I../common -+ -+# at least for now, need to include config_ssid.h and config_blob.h from -+# wpa_supplicant directory -+override CFLAGS += -I ../../wpa_supplicant -+ -+OBJS_both += ../utils/common.o -+OBJS_both += ../utils/os_unix.o -+OBJS_both += ../utils/wpa_debug.o -+OBJS_both += ../utils/base64.o -+OBJS_both += ../utils/wpabuf.o -+OBJS_both += ../crypto/md5.o -+OBJS_both += ../crypto/sha1.o -+OBJS_both += ../crypto/sha1-tlsprf.o -+OBJS_both += ../crypto/aes-encblock.o -+OBJS_both += ../crypto/aes-wrap.o -+OBJS_both += ../crypto/aes-ctr.o -+OBJS_both += ../crypto/aes-eax.o -+OBJS_both += ../crypto/aes-omac1.o -+OBJS_both += ../crypto/ms_funcs.o -+OBJS_both += ../crypto/sha256.o -+ -+ -+OBJS_both += ../eap_common/eap_peap_common.o -+OBJS_both += ../eap_common/eap_psk_common.o -+OBJS_both += ../eap_common/eap_pax_common.o -+OBJS_both += ../eap_common/eap_sake_common.o -+OBJS_both += ../eap_common/eap_gpsk_common.o -+OBJS_both += ../eap_common/chap.o -+ -+OBJS_peer += ../eap_peer/eap_tls.o -+OBJS_peer += ../eap_peer/eap_peap.o -+OBJS_peer += ../eap_peer/eap_ttls.o -+OBJS_peer += ../eap_peer/eap_md5.o -+OBJS_peer += ../eap_peer/eap_mschapv2.o -+OBJS_peer += ../eap_peer/mschapv2.o -+OBJS_peer += ../eap_peer/eap_otp.o -+OBJS_peer += ../eap_peer/eap_gtc.o -+OBJS_peer += ../eap_peer/eap_leap.o -+OBJS_peer += ../eap_peer/eap_psk.o -+OBJS_peer += ../eap_peer/eap_pax.o -+OBJS_peer += ../eap_peer/eap_sake.o -+OBJS_peer += ../eap_peer/eap_gpsk.o -+OBJS_peer += ../eap_peer/eap.o -+OBJS_peer += ../eap_common/eap_common.o -+OBJS_peer += ../eap_peer/eap_methods.o -+OBJS_peer += ../eap_peer/eap_tls_common.o -+ -+override CFLAGS += -DEAP_TLS -+override CFLAGS += -DEAP_PEAP -+override CFLAGS += -DEAP_TTLS -+override CFLAGS += -DEAP_MD5 -+override CFLAGS += -DEAP_MSCHAPv2 -+override CFLAGS += -DEAP_GTC -+override CFLAGS += -DEAP_OTP -+override CFLAGS += -DEAP_LEAP -+override CFLAGS += -DEAP_PSK -+override CFLAGS += -DEAP_PAX -+override CFLAGS += -DEAP_SAKE -+override CFLAGS += -DEAP_GPSK -DEAP_GPSK_SHA256 -+override CFLAGS += -DEAP_TLS_FUNCS -+ -+override CFLAGS += -DIEEE8021X_EAPOL -+ -+ifeq ($(CONFIG_TLS), openssl) -+override CFLAGS += -DEAP_TLS_OPENSSL -+OBJS_both += ../crypto/tls_openssl.o -+OBJS_both += ../crypto/crypto_openssl.o -+LIBS += -lssl -lcrypto -+override CFLAGS += -DINTERNAL_SHA256 -+endif -+ -+ifeq ($(CONFIG_TLS), internal) -+OBJS_both += ../crypto/tls_internal.o -+OBJS_both += ../tls/tlsv1_common.o ../../tls/tlsv1_record.o -+OBJS_both += ../tls/tlsv1_cred.o -+OBJS_both += ../tls/asn1.o ../../tls/x509v3.o -+OBJS_both += ../crypto/crypto_internal.o ../../tls/rsa.o ../../tls/bignum.o -+ -+OBJS_peer += ../tls/tlsv1_client.o -+OBJS_peer += ../tls/tlsv1_client_write.o ../../tls/tlsv1_client_read.o -+override CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT -+ -+OBJS_server += ../tls/tlsv1_server.o -+OBJS_server += ../tls/tlsv1_server_write.o ../../tls/tlsv1_server_read.o -+override CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER -+ -+override CFLAGS += -DCONFIG_TLS_INTERNAL -+override CFLAGS += -DCONFIG_CRYPTO_INTERNAL -+override CFLAGS += -DCONFIG_INTERNAL_X509 -+override CFLAGS += -DINTERNAL_AES -+override CFLAGS += -DINTERNAL_SHA1 -+override CFLAGS += -DINTERNAL_SHA256 -+override CFLAGS += -DINTERNAL_MD5 -+override CFLAGS += -DINTERNAL_MD4 -+override CFLAGS += -DINTERNAL_DES -+ifdef CONFIG_INTERNAL_LIBTOMMATH -+override CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH -+else -+LIBS += -ltommath -+endif -+endif -+ -+ifndef LDO -+LDO=$(CC) -+endif -+ -+ -+OBJS_lib=$(OBJS_both) $(OBJS_peer) -+ -+ #$(OBJS_server) -+ -+override CFLAGS += -fPIC -DPIC -+LDFLAGS += -shared -+ -+$(LIBEAP): $(OBJS_lib) -+ $(LDO) $(LDFLAGS) $(OBJS_lib) -Wl,-soname -Wl,$(LIBEAP_SO) -o $(LIBEAP) $(LIBS) -+ -+ -+UTIL_HEADERS = ../utils/includes.h ../utils/common.h \ -+ ../utils/wpabuf.h ../utils/build_config.h \ -+ ../utils/os.h ../utils/wpa_debug.h -+COMMON_HEADERS = ../common/defs.h -+EAP_COMMON_HEADERS = ../eap_common/eap_defs.h -+MAIN_HEADERS = eap.h eap_methods.h eap_config.h -+CRYPTO_HEADERS = ../crypto/tls.h -+ -+install: -+ -+ mkdir -p $(DESTDIR)/usr/lib -+# copy the lib file to std lib location -+ cp $(LIBEAP) $(DESTDIR)/usr/lib -+ ln -fs $(LIBEAP_SO) $(DESTDIR)/usr/lib/$(LIBEAP_NAME).so -+ -+# copy the headers reqd by apps using eap peer library in its own subfolder under /usr/include -+ mkdir -p \ -+ $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common \ -+ $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/common \ -+ $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/util \ -+ $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/crypto -+ install -m 0644 $(EAP_COMMON_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common -+ install -m 0644 $(COMMON_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/common -+ install -m 0644 $(CRYPTO_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/crypto -+ install -m 0644 $(UTIL_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/util -+ install -m 0644 $(MAIN_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/ -+ -+ mkdir -p $(DESTDIR)/usr/lib/pkgconfig -+ cp libeap0.pc $(DESTDIR)/usr/lib/pkgconfig -+ -+uninstall: -+ -+ rm $(DESTDIR)/usr/lib/$(LIBEAP) -+ rm -fr $(DESTDIR)/$(INCLUDE_INSTALL_DIR) -+ rm -f $(DESTDIR)/usr/lib/pkgconfig/libeap0.pc - - clean: -- rm -f *~ *.o *.so *.d -+ rm -f *~ *.o *.so *.d libeap.a $(LIBEAP) $(OBJS_lib) - --install: -- if ls *.so >/dev/null 2>&1; then \ -- install -d $(DESTDIR)$(LIBDIR)/wpa_supplicant && \ -- cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \ -- ; fi -+-include $(OBJS:%.o=%.d) -diff --git a/src/eap_peer/eap_methods.c b/src/eap_peer/eap_methods.c -index 3b0af05..092f266 100644 ---- a/src/eap_peer/eap_methods.c -+++ b/src/eap_peer/eap_methods.c -@@ -340,6 +340,120 @@ int eap_peer_method_register(struct eap_method *method) - - - /** -+ * eap_peer_register_methods - Register all known EAP peer methods -+ * -+ * This function is called at program start to register all compiled -+ * in EAP peer methods. -+ */ -+int eap_peer_register_methods(void) -+{ -+ int ret = 0; -+ -+#ifdef EAP_MD5 -+ if (ret == 0) -+ ret = eap_peer_md5_register(); -+#endif /* EAP_MD5 */ -+ -+#ifdef EAP_TLS -+ if (ret == 0) -+ ret = eap_peer_tls_register(); -+#endif /* EAP_TLS */ -+ -+#ifdef EAP_MSCHAPv2 -+ if (ret == 0) -+ ret = eap_peer_mschapv2_register(); -+#endif /* EAP_MSCHAPv2 */ -+ -+#ifdef EAP_PEAP -+ if (ret == 0) -+ ret = eap_peer_peap_register(); -+#endif /* EAP_PEAP */ -+ -+#ifdef EAP_TTLS -+ if (ret == 0) -+ ret = eap_peer_ttls_register(); -+#endif /* EAP_TTLS */ -+ -+#ifdef EAP_GTC -+ if (ret == 0) -+ ret = eap_peer_gtc_register(); -+#endif /* EAP_GTC */ -+ -+#ifdef EAP_OTP -+ if (ret == 0) -+ ret = eap_peer_otp_register(); -+#endif /* EAP_OTP */ -+ -+#ifdef EAP_SIM -+ if (ret == 0) -+ ret = eap_peer_sim_register(); -+#endif /* EAP_SIM */ -+ -+#ifdef EAP_LEAP -+ if (ret == 0) -+ ret = eap_peer_leap_register(); -+#endif /* EAP_LEAP */ -+ -+#ifdef EAP_PSK -+ if (ret == 0) -+ ret = eap_peer_psk_register(); -+#endif /* EAP_PSK */ -+ -+#ifdef EAP_AKA -+ if (ret == 0) -+ ret = eap_peer_aka_register(); -+#endif /* EAP_AKA */ -+ -+#ifdef EAP_AKA_PRIME -+ if (ret == 0) -+ ret = eap_peer_aka_prime_register(); -+#endif /* EAP_AKA_PRIME */ -+ -+#ifdef EAP_FAST -+ if (ret == 0) -+ ret = eap_peer_fast_register(); -+#endif /* EAP_FAST */ -+ -+#ifdef EAP_PAX -+ if (ret == 0) -+ ret = eap_peer_pax_register(); -+#endif /* EAP_PAX */ -+ -+#ifdef EAP_SAKE -+ if (ret == 0) -+ ret = eap_peer_sake_register(); -+#endif /* EAP_SAKE */ -+ -+#ifdef EAP_GPSK -+ if (ret == 0) -+ ret = eap_peer_gpsk_register(); -+#endif /* EAP_GPSK */ -+ -+#ifdef EAP_WSC -+ if (ret == 0) -+ ret = eap_peer_wsc_register(); -+#endif /* EAP_WSC */ -+ -+#ifdef EAP_IKEV2 -+ if (ret == 0) -+ ret = eap_peer_ikev2_register(); -+#endif /* EAP_IKEV2 */ -+ -+#ifdef EAP_VENDOR_TEST -+ if (ret == 0) -+ ret = eap_peer_vendor_test_register(); -+#endif /* EAP_VENDOR_TEST */ -+ -+#ifdef EAP_TNC -+ if (ret == 0) -+ ret = eap_peer_tnc_register(); -+#endif /* EAP_TNC */ -+ -+ return ret; -+} -+ -+ -+/** - * eap_peer_unregister_methods - Unregister EAP peer methods - * - * This function is called at program termination to unregister all EAP peer -diff --git a/src/eap_peer/eap_methods.h b/src/eap_peer/eap_methods.h -index 384c61b..b83a46f 100644 ---- a/src/eap_peer/eap_methods.h -+++ b/src/eap_peer/eap_methods.h -@@ -32,6 +32,7 @@ EapType eap_peer_get_type(const char *name, int *vendor); - const char * eap_get_name(int vendor, EapType type); - size_t eap_get_names(char *buf, size_t buflen); - char ** eap_get_names_as_string_array(size_t *num); -+int eap_peer_register_methods(void); - void eap_peer_unregister_methods(void); - - #else /* IEEE8021X_EAPOL */ -diff --git a/src/eap_peer/libeap0.pc b/src/eap_peer/libeap0.pc -new file mode 100644 -index 0000000..2f8463a ---- /dev/null -+++ b/src/eap_peer/libeap0.pc -@@ -0,0 +1,10 @@ -+prefix=/usr -+exec_prefix=/usr -+libdir=${exec_prefix}/lib -+includedir=${prefix}/include -+ -+Name: libeap0 -+Description: EAP Peer Library API -+Version: 0.7.2 -+Libs: -L${libdir} -leap -+Cflags: -I${includedir} --- -1.6.6.1 - diff --git a/packaging/0001-events-Custom-event-for-broadcom-proprietary-driver.patch b/packaging/0001-events-Custom-event-for-broadcom-proprietary-driver.patch deleted file mode 100644 index 3e05d84..0000000 --- a/packaging/0001-events-Custom-event-for-broadcom-proprietary-driver.patch +++ /dev/null @@ -1,69 +0,0 @@ -From bf47542f9db46e7bd9a79f66e8d919c583991c5b Mon Sep 17 00:00:00 2001 -From: Samuel Ortiz -Date: Wed, 15 Dec 2010 20:36:04 +0100 -Subject: [PATCH 1/3] events: Custom event for broadcom proprietary driver - ---- - src/drivers/driver.h | 10 +++++++++- - src/drivers/driver_wext.c | 3 +++ - wpa_supplicant/events.c | 9 +++++++++ - 3 files changed, 21 insertions(+), 1 deletions(-) - -diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index fa49da4..511f613 100644 ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -2046,7 +2046,15 @@ enum wpa_event_type { - * observed in frames received from the current AP if signal strength - * monitoring has been enabled with signal_monitor(). - */ -- EVENT_SIGNAL_CHANGE -+ EVENT_SIGNAL_CHANGE, -+ -+ /** -+ * EVENT_BROADCOM_CUSTOM - Broadcom custom event -+ * -+ * This event is sent when failing to associate while running the -+ * initial scan. -+ */ -+ EVENT_BROADCOM_CUSTOM - }; - - -diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c -index 2614f23..04094ee 100644 ---- a/src/drivers/driver_wext.c -+++ b/src/drivers/driver_wext.c -@@ -299,6 +299,9 @@ wpa_driver_wext_event_wireless_custom(void *ctx, char *custom) - } - wpa_supplicant_event(ctx, EVENT_STKSTART, &data); - #endif /* CONFIG_PEERKEY */ -+ } else if (os_strncmp(custom, "Conn NoNetworks", 15) == 0) { -+ wpa_printf(MSG_DEBUG, "WEXT: Broadcom custom event"); -+ wpa_supplicant_event(ctx, EVENT_BROADCOM_CUSTOM, &data); - } - } - -diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c -index 85dcfb2..e925447 100644 ---- a/wpa_supplicant/events.c -+++ b/wpa_supplicant/events.c -@@ -1722,6 +1722,15 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, - bgscan_notify_signal_change( - wpa_s, data->signal_change.above_threshold); - break; -+ case EVENT_BROADCOM_CUSTOM: -+ wpa_printf(MSG_DEBUG, "Broadcom event in state %d", -+ wpa_s->wpa_state); -+ if (wpa_s->wpa_state == WPA_SCANNING) { -+ /* Force scanning */ -+ wpa_s->scan_req = 1; -+ wpa_supplicant_req_scan(wpa_s, 0, 0); -+ } -+ break; - default: - wpa_printf(MSG_INFO, "Unknown event %d", event); - break; --- -1.7.2.3 - diff --git a/packaging/0002-nl80211-Add-a-get_country-hook.patch b/packaging/0002-nl80211-Add-a-get_country-hook.patch deleted file mode 100644 index 2499777..0000000 --- a/packaging/0002-nl80211-Add-a-get_country-hook.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 0c62f3723c3c4782d67266b467ce7296eae99b7b Mon Sep 17 00:00:00 2001 -From: Samuel Ortiz -Date: Wed, 15 Dec 2010 20:36:41 +0100 -Subject: [PATCH 2/3] nl80211: Add a get_country hook - -Get the current regulatory domain through nl80211. ---- - src/drivers/driver.h | 8 ++++++ - src/drivers/driver_nl80211.c | 50 ++++++++++++++++++++++++++++++++++++++++++ - wpa_supplicant/driver_i.h | 7 ++++++ - 3 files changed, 65 insertions(+), 0 deletions(-) - -diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index 511f613..31dcbb4 100644 ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -1081,6 +1081,14 @@ struct wpa_driver_ops { - struct wpa_scan_results * (*get_scan_results2)(void *priv); - - /** -+ * get_country - get country -+ * @priv: Private driver interface data -+ * Returns: Allocated alpha2 null terminated string (caller is -+ * responsible for freeing the data structure), NULL on failure. -+ */ -+ char * (*get_country)(void *priv); -+ -+ /** - * set_country - Set country - * @priv: Private driver interface data - * @alpha2: country to which to switch to -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 364158c..1a3c4ac 100644 ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -1097,6 +1097,55 @@ static void wpa_driver_nl80211_event_receive(int sock, void *eloop_ctx, - } - - -+static int nl80211_get_country(struct nl_msg *msg, void *arg) -+{ -+ char **alpha2 = arg; -+ struct nlattr *tb_msg[NL80211_ATTR_MAX + 1]; -+ struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); -+ -+ nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), -+ genlmsg_attrlen(gnlh, 0), NULL); -+ if (!tb_msg[NL80211_ATTR_REG_ALPHA2] || -+ !tb_msg[NL80211_ATTR_REG_RULES]) { -+ wpa_printf(MSG_DEBUG, "nl80211: No regulatory information " -+ "available"); -+ return NL_SKIP; -+ } -+ -+ *alpha2 = os_strdup((char *) nla_data(tb_msg[NL80211_ATTR_REG_ALPHA2])); -+ -+ return NL_SKIP; -+} -+ -+/** -+ * wpa_driver_nl80211_get_country - ask nl80211 to get the regulatory domain -+ * @priv: driver_nl80211 private data. -+ * Returns: An allocated alpha2 null terminated string, NULL on failure. -+ * -+ * This asks nl80211 to get the regulatory domain. -+ */ -+static char *wpa_driver_nl80211_get_country(void *priv) -+{ -+ struct i802_bss *bss = priv; -+ struct wpa_driver_nl80211_data *drv = bss->drv; -+ char *alpha2 = NULL; -+ struct nl_msg *msg; -+ -+ msg = nlmsg_alloc(); -+ if (!msg) -+ return NULL; -+ -+ genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0, -+ 0, NL80211_CMD_GET_REG, 0); -+ -+ if (send_and_recv_msgs(drv, msg, nl80211_get_country, &alpha2)) -+ return NULL; -+ -+ wpa_printf(MSG_DEBUG, "nl80211: Country=%s", alpha2); -+ -+ return alpha2; -+} -+ - /** - * wpa_driver_nl80211_set_country - ask nl80211 to set the regulatory domain - * @priv: driver_nl80211 private data -@@ -5345,6 +5394,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { - .get_capa = wpa_driver_nl80211_get_capa, - .set_operstate = wpa_driver_nl80211_set_operstate, - .set_supp_port = wpa_driver_nl80211_set_supp_port, -+ .get_country = wpa_driver_nl80211_get_country, - .set_country = wpa_driver_nl80211_set_country, - .set_beacon = wpa_driver_nl80211_set_beacon, - .if_add = wpa_driver_nl80211_if_add, -diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h -index a70aa6a..3058afa 100644 ---- a/wpa_supplicant/driver_i.h -+++ b/wpa_supplicant/driver_i.h -@@ -265,6 +265,13 @@ static inline int wpa_drv_set_bssid(struct wpa_supplicant *wpa_s, - return -1; - } - -+static inline char *wpa_drv_get_country(struct wpa_supplicant *wpa_s) -+{ -+ if (wpa_s->driver->get_country) -+ return wpa_s->driver->get_country(wpa_s->drv_priv); -+ return NULL; -+} -+ - static inline int wpa_drv_set_country(struct wpa_supplicant *wpa_s, - const char *alpha2) - { --- -1.7.2.3 - diff --git a/packaging/0003-dbus-Add-a-Country-global-property.patch b/packaging/0003-dbus-Add-a-Country-global-property.patch deleted file mode 100644 index ccc7354..0000000 --- a/packaging/0003-dbus-Add-a-Country-global-property.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 079bd8b4cbe03d0beb2f7e17e0df4b851b2e6318 Mon Sep 17 00:00:00 2001 -From: Samuel Ortiz -Date: Wed, 15 Dec 2010 20:37:16 +0100 -Subject: [PATCH 3/3] dbus: Add a Country global property - -This read-write property allows to pass an ISO 3166-1 alpha2 string to the -cfg80211 layer, through D-Bus. ---- - wpa_supplicant/dbus/dbus_new.c | 5 +++ - wpa_supplicant/dbus/dbus_new_handlers.c | 61 +++++++++++++++++++++++++++++++ - wpa_supplicant/dbus/dbus_new_handlers.h | 6 +++ - 3 files changed, 72 insertions(+), 0 deletions(-) - -diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c -index bdfbbac..64e2887 100644 ---- a/wpa_supplicant/dbus/dbus_new.c -+++ b/wpa_supplicant/dbus/dbus_new.c -@@ -879,6 +879,11 @@ static const struct wpa_dbus_property_desc wpas_dbus_global_properties[] = { - NULL, - R - }, -+ { "Country", WPAS_DBUS_NEW_INTERFACE, "s", -+ (WPADBusPropertyAccessor) wpas_dbus_getter_country, -+ (WPADBusPropertyAccessor) wpas_dbus_setter_country, -+ RW -+ }, - { NULL, NULL, NULL, NULL, NULL, 0 } - }; - -diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c -index e2b5e50..6a0fe10 100644 ---- a/wpa_supplicant/dbus/dbus_new_handlers.c -+++ b/wpa_supplicant/dbus/dbus_new_handlers.c -@@ -923,6 +923,67 @@ DBusMessage * wpas_dbus_getter_eap_methods(DBusMessage *message, void *nothing) - return reply; - } - -+/** -+ * wpas_dbus_getter_country - Get the ISO/IEC alpha2 country code -+ * @message: Pointer to incoming dbus message -+ * @global: %wpa_supplicant global data structure -+ * Returns: DBus message with the alpha2 string -+ * -+ * Getter for "Country" property. -+ */ -+DBusMessage * wpas_dbus_getter_country(DBusMessage *message, -+ struct wpa_global *global) -+{ -+ DBusMessage *reply; -+ struct wpa_supplicant *wpa_s; -+ char *country; -+ -+ wpa_s = global->ifaces; -+ -+ if (wpa_s == NULL) -+ return NULL; -+ -+ country = wpa_drv_get_country(wpa_s); -+ -+ reply = wpas_dbus_simple_property_getter(message, DBUS_TYPE_STRING, -+ &country); -+ -+ os_free(country); -+ -+ return reply; -+} -+ -+ -+/** -+ * wpas_dbus_setter_country - Set the ISO/IEC alpha2 country code -+ * @message: Pointer to incoming dbus message -+ * @global: %wpa_supplicant global data structure -+ * Returns: %NULL or DBus error message -+ * -+ * Setter function for the "Country" property. -+ */ -+DBusMessage * wpas_dbus_setter_country(DBusMessage *message, -+ struct wpa_global *global) -+{ -+ struct wpa_supplicant *wpa_s; -+ DBusMessage *reply = NULL; -+ char *country; -+ -+ wpa_s = global->ifaces; -+ -+ if (wpa_s == NULL) -+ return NULL; -+ -+ reply = wpas_dbus_simple_property_setter(message, DBUS_TYPE_STRING, -+ &country); -+ if (reply) -+ return reply; -+ -+ if (wpa_drv_set_country(wpa_s, country)) -+ return wpas_dbus_error_invalid_args(message, "Invalid country"); -+ -+ return NULL; -+} - - static int wpas_dbus_get_scan_type(DBusMessage *message, DBusMessageIter *var, - char **type, DBusMessage **reply) -diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h b/wpa_supplicant/dbus/dbus_new_handlers.h -index 3cdf9cb..3d0b9d6 100644 ---- a/wpa_supplicant/dbus/dbus_new_handlers.h -+++ b/wpa_supplicant/dbus/dbus_new_handlers.h -@@ -71,6 +71,12 @@ DBusMessage * wpas_dbus_getter_interfaces(DBusMessage *message, - DBusMessage * wpas_dbus_getter_eap_methods(DBusMessage *message, - void *nothing); - -+DBusMessage * wpas_dbus_getter_country(DBusMessage *message, -+ struct wpa_global *global); -+ -+DBusMessage * wpas_dbus_setter_country(DBusMessage *message, -+ struct wpa_global *global); -+ - DBusMessage * wpas_dbus_handler_scan(DBusMessage *message, - struct wpa_supplicant *wpa_s); - --- -1.7.2.3 - diff --git a/packaging/wpa_s-alldrivers.patch b/packaging/wpa_s-alldrivers.patch deleted file mode 100644 index 0a6d7db..0000000 --- a/packaging/wpa_s-alldrivers.patch +++ /dev/null @@ -1,63 +0,0 @@ -commit 74b1c84a0b1218a33ce7089e11172e7f39273158 -Author: Samuel Ortiz -Date: Tue Nov 9 16:45:27 2010 +0200 - - wpa_supplicant: Test all compiled drivers before failing - - wpa_supplicant_set_driver() is returning an error if the first driver - in the driver list is not built in. It should continue through the - driver list until it finds one that's built in. - -diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index ff1cfd3..0a603af 100644 ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -1702,7 +1702,7 @@ static int wpa_supplicant_set_driver(struct wpa_supplicant *wpa_s, - { - int i; - size_t len; -- const char *pos; -+ const char *pos, *driver = name; - - if (wpa_s == NULL) - return -1; -@@ -1720,20 +1720,26 @@ static int wpa_supplicant_set_driver(struct wpa_supplicant *wpa_s, - return 0; - } - -- pos = os_strchr(name, ','); -- if (pos) -- len = pos - name; -- else -- len = os_strlen(name); -- for (i = 0; wpa_drivers[i]; i++) { -- if (os_strlen(wpa_drivers[i]->name) == len && -- os_strncmp(name, wpa_drivers[i]->name, len) == -- 0) { -- wpa_s->driver = wpa_drivers[i]; -- wpa_s->global_drv_priv = wpa_s->global->drv_priv[i]; -- return 0; -+ do { -+ pos = os_strchr(driver, ','); -+ if (pos) -+ len = pos - driver; -+ else -+ len = os_strlen(driver); -+ -+ for (i = 0; wpa_drivers[i]; i++) { -+ if (os_strlen(wpa_drivers[i]->name) == len && -+ os_strncmp(driver, wpa_drivers[i]->name, len) == -+ 0) { -+ wpa_s->driver = wpa_drivers[i]; -+ wpa_s->global_drv_priv = -+ wpa_s->global->drv_priv[i]; -+ return 0; -+ } - } -- } -+ -+ driver = pos + 1; -+ } while (pos); - - wpa_printf(MSG_ERROR, "Unsupported driver '%s'.", name); - return -1; diff --git a/packaging/wpa_supplicant.changes b/packaging/wpa_supplicant.changes index 443ac6d..0433569 100644 --- a/packaging/wpa_supplicant.changes +++ b/packaging/wpa_supplicant.changes @@ -1,4 +1,7 @@ * Fri Jun 8 2012 Arron - 1.0 +- Rebased the patches against 1.0 code and maintain through git + +* Fri Jun 8 2012 Arron - 1.0 - Merge with wpa_supplicant 1.0 stable release * Wed May 30 2012 Junfeng Dong diff --git a/packaging/wpa_supplicant.spec b/packaging/wpa_supplicant.spec index 697d225..779c83b 100644 --- a/packaging/wpa_supplicant.spec +++ b/packaging/wpa_supplicant.spec @@ -7,11 +7,6 @@ License: BSD URL: http://w1.fi/wpa_supplicant/ Source0: %{name}-%{version}.tar.gz Source1: %{name}.config -Patch0: 0001-eap_peer-create-a-libeap-library-with-header-files-a.patch -Patch1: 0001-events-Custom-event-for-broadcom-proprietary-driver.patch -Patch2: 0002-nl80211-Add-a-get_country-hook.patch -Patch3: 0003-dbus-Add-a-Country-global-property.patch -Patch4: wpa_s-alldrivers.patch BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(libnl-1) BuildRequires: pkgconfig(dbus-1) @@ -53,22 +48,12 @@ Development support for for EAP-Peer authentication library %prep %setup -q -n %{name}-%{version} -# 0001-eap_peer-create-a-libeap-library-with-header-files-a.patch -%patch0 -p1 -# 0001-events-Custom-event-for-broadcom-proprietary-driver.patch -%patch1 -p1 -# 0002-nl80211-Add-a-get_country-hook.patch -%patch2 -p1 -# 0003-dbus-Add-a-Country-global-property.patch -%patch3 -p1 -# wpa_s-alldrivers.patch -%patch4 -p1 - %build pushd wpa_supplicant cp %{SOURCE1} ./.config CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; +export BINDIR=/sbin @@ -93,6 +78,8 @@ install -m 0755 %{name}/wpa_cli %{buildroot}/sbin install -m 0755 %{name}/wpa_supplicant %{buildroot}/sbin install -d %{buildroot}/%{_sysconfdir}/dbus-1/system.d/ install -m 0644 %{name}/dbus/dbus-wpa_supplicant.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/wpa_supplicant.conf +install -d 0755 %{buildroot}/lib/systemd +install -m 0644 %{name}/systemd/wpa_supplicant.service %{buildroot}/lib/systemd/wpa_supplicant.service install -d %{buildroot}/%{_datadir}/dbus-1/system-services/ install -m 0644 %{name}/dbus/fi.epitest.hostap.WPASupplicant.service %{buildroot}/%{_datadir}/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service install -m 0644 %{name}/dbus/fi.w1.wpa_supplicant1.service %{buildroot}/%{_datadir}/dbus-1/system-services/fi.w1.wpa_supplicant1.service @@ -116,6 +103,7 @@ rm -rf %{name}/doc/docbook %{_sysconfdir}/dbus-1/system.d/%{name}.conf %{_datadir}/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service %{_datadir}/dbus-1/system-services/fi.w1.wpa_supplicant1.service +/lib/systemd/wpa_supplicant.service /sbin/wpa_passphrase /sbin/wpa_supplicant /sbin/wpa_cli diff --git a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in index a75918f..d627b00 100644 --- a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in +++ b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in @@ -2,4 +2,4 @@ Name=fi.epitest.hostap.WPASupplicant Exec=@BINDIR@/wpa_supplicant -u User=root -SystemdService=wpa_supplicant.service +#SystemdService=wpa_supplicant.service diff --git a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in index d97ff39..a4aa7b2 100644 --- a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in +++ b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in @@ -2,4 +2,4 @@ Name=fi.w1.wpa_supplicant1 Exec=@BINDIR@/wpa_supplicant -u User=root -SystemdService=wpa_supplicant.service +#SystemdService=wpa_supplicant.service -- 2.7.4