2010-07-08 18:36:22 +00:00
|
|
|
--- a/src/drivers/driver_nl80211.c
|
|
|
|
+++ b/src/drivers/driver_nl80211.c
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -216,7 +216,9 @@ struct wpa_driver_nl80211_data {
|
2010-07-08 18:36:22 +00:00
|
|
|
int if_removed;
|
|
|
|
int if_disabled;
|
2011-11-04 01:05:26 +00:00
|
|
|
int ignore_if_down_event;
|
2010-07-08 18:36:22 +00:00
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
struct rfkill_data *rfkill;
|
|
|
|
+#endif
|
|
|
|
struct wpa_driver_capa capa;
|
2013-04-22 13:24:48 +00:00
|
|
|
u8 *extended_capa, *extended_capa_mask;
|
|
|
|
unsigned int extended_capa_len;
|
2013-08-08 16:04:19 +00:00
|
|
|
@@ -3482,7 +3484,7 @@ static int wpa_driver_nl80211_init_nl(st
|
2012-03-27 10:42:47 +00:00
|
|
|
return 0;
|
2010-07-08 18:36:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
|
|
|
|
{
|
|
|
|
wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
|
2013-08-08 16:04:19 +00:00
|
|
|
@@ -3505,6 +3507,7 @@ static void wpa_driver_nl80211_rfkill_un
|
2010-07-08 18:36:22 +00:00
|
|
|
}
|
|
|
|
/* rtnetlink ifup handler will report interface as enabled */
|
|
|
|
}
|
|
|
|
+#endif /* CONFIG_RFKILL */
|
|
|
|
|
|
|
|
|
2013-06-30 20:27:38 +00:00
|
|
|
static void wpa_driver_nl80211_handle_eapol_tx_status(int sock,
|
2013-08-08 16:04:19 +00:00
|
|
|
@@ -3600,7 +3603,9 @@ static void * wpa_driver_nl80211_init(vo
|
2011-11-04 01:05:26 +00:00
|
|
|
void *global_priv)
|
2010-07-08 18:36:22 +00:00
|
|
|
{
|
|
|
|
struct wpa_driver_nl80211_data *drv;
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
struct rfkill_config *rcfg;
|
|
|
|
+#endif
|
|
|
|
struct i802_bss *bss;
|
|
|
|
|
2012-03-27 10:42:47 +00:00
|
|
|
if (global_priv == NULL)
|
2013-08-08 16:04:19 +00:00
|
|
|
@@ -3634,6 +3639,7 @@ static void * wpa_driver_nl80211_init(vo
|
2013-06-30 20:27:38 +00:00
|
|
|
if (nl80211_init_bss(bss))
|
|
|
|
goto failed;
|
2010-07-08 18:36:22 +00:00
|
|
|
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
rcfg = os_zalloc(sizeof(*rcfg));
|
|
|
|
if (rcfg == NULL)
|
|
|
|
goto failed;
|
2013-08-08 16:04:19 +00:00
|
|
|
@@ -3646,6 +3652,7 @@ static void * wpa_driver_nl80211_init(vo
|
2010-07-08 18:36:22 +00:00
|
|
|
wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available");
|
|
|
|
os_free(rcfg);
|
|
|
|
}
|
|
|
|
+#endif /* CONFIG_RFKILL */
|
|
|
|
|
|
|
|
if (wpa_driver_nl80211_finish_drv_init(drv))
|
|
|
|
goto failed;
|
2013-08-08 16:04:19 +00:00
|
|
|
@@ -3937,10 +3944,12 @@ static void nl80211_mgmt_unsubscribe(str
|
2010-07-08 18:36:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
static void wpa_driver_nl80211_send_rfkill(void *eloop_ctx, void *timeout_ctx)
|
|
|
|
{
|
|
|
|
wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
|
|
|
|
}
|
|
|
|
+#endif /* CONFIG_RFKILL */
|
|
|
|
|
2013-06-30 20:27:38 +00:00
|
|
|
|
|
|
|
static void nl80211_del_p2pdev(struct i802_bss *bss)
|
2013-08-08 16:04:19 +00:00
|
|
|
@@ -4048,13 +4057,16 @@ wpa_driver_nl80211_finish_drv_init_sta(s
|
2012-03-27 10:42:47 +00:00
|
|
|
}
|
2010-07-08 18:36:22 +00:00
|
|
|
|
2012-03-27 10:42:47 +00:00
|
|
|
if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
|
2010-07-08 18:36:22 +00:00
|
|
|
+#ifdef CONFIG_RFKILL
|
2012-03-27 10:42:47 +00:00
|
|
|
if (rfkill_is_blocked(drv->rfkill)) {
|
|
|
|
wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
|
|
|
|
"interface '%s' due to rfkill",
|
|
|
|
bss->ifname);
|
|
|
|
drv->if_disabled = 1;
|
|
|
|
*send_rfkill_event = 1;
|
|
|
|
- } else {
|
|
|
|
+ } else
|
2010-07-08 18:36:22 +00:00
|
|
|
+#endif
|
2012-03-27 10:42:47 +00:00
|
|
|
+ {
|
|
|
|
wpa_printf(MSG_ERROR, "nl80211: Could not set "
|
|
|
|
"interface '%s' UP", bss->ifname);
|
|
|
|
return -1;
|
2013-08-08 16:04:19 +00:00
|
|
|
@@ -4093,8 +4105,10 @@ wpa_driver_nl80211_finish_drv_init(struc
|
2012-03-27 10:42:47 +00:00
|
|
|
return -1;
|
2010-07-08 18:36:22 +00:00
|
|
|
|
|
|
|
if (send_rfkill_event) {
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill,
|
|
|
|
drv, drv->ctx);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2013-08-08 16:04:19 +00:00
|
|
|
@@ -4180,7 +4194,9 @@ static void wpa_driver_nl80211_deinit(st
|
2010-07-08 18:36:22 +00:00
|
|
|
|
2011-11-04 01:05:26 +00:00
|
|
|
netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, 0,
|
|
|
|
IF_OPER_UP);
|
2010-07-08 18:36:22 +00:00
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
rfkill_deinit(drv->rfkill);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx);
|
|
|
|
|
|
|
|
--- a/src/drivers/driver_wext.c
|
|
|
|
+++ b/src/drivers/driver_wext.c
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -740,7 +740,7 @@ static void wpa_driver_wext_event_rtm_de
|
2010-07-08 18:36:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
static void wpa_driver_wext_rfkill_blocked(void *ctx)
|
|
|
|
{
|
|
|
|
wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked");
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -762,7 +762,7 @@ static void wpa_driver_wext_rfkill_unblo
|
2010-07-08 18:36:22 +00:00
|
|
|
}
|
|
|
|
/* rtnetlink ifup handler will report interface as enabled */
|
|
|
|
}
|
|
|
|
-
|
|
|
|
+#endif /* CONFIG_RFKILL */
|
|
|
|
|
2011-01-24 18:54:20 +00:00
|
|
|
static void wext_get_phy_name(struct wpa_driver_wext_data *drv)
|
|
|
|
{
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -808,7 +808,9 @@ void * wpa_driver_wext_init(void *ctx, c
|
2010-07-08 18:36:22 +00:00
|
|
|
{
|
|
|
|
struct wpa_driver_wext_data *drv;
|
|
|
|
struct netlink_config *cfg;
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
struct rfkill_config *rcfg;
|
|
|
|
+#endif
|
|
|
|
char path[128];
|
|
|
|
struct stat buf;
|
|
|
|
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -843,6 +845,7 @@ void * wpa_driver_wext_init(void *ctx, c
|
2010-07-08 18:36:22 +00:00
|
|
|
goto err2;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
rcfg = os_zalloc(sizeof(*rcfg));
|
|
|
|
if (rcfg == NULL)
|
|
|
|
goto err3;
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -855,6 +858,7 @@ void * wpa_driver_wext_init(void *ctx, c
|
2010-07-08 18:36:22 +00:00
|
|
|
wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
|
|
|
|
os_free(rcfg);
|
|
|
|
}
|
|
|
|
+#endif /* CONFIG_RFKILL */
|
|
|
|
|
|
|
|
drv->mlme_sock = -1;
|
|
|
|
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -872,7 +876,9 @@ void * wpa_driver_wext_init(void *ctx, c
|
2010-07-08 18:36:22 +00:00
|
|
|
return drv;
|
|
|
|
|
|
|
|
err3:
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
rfkill_deinit(drv->rfkill);
|
|
|
|
+#endif
|
|
|
|
netlink_deinit(drv->netlink);
|
|
|
|
err2:
|
|
|
|
close(drv->ioctl_sock);
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -882,10 +888,12 @@ err1:
|
2010-07-08 18:36:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
static void wpa_driver_wext_send_rfkill(void *eloop_ctx, void *timeout_ctx)
|
|
|
|
{
|
|
|
|
wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
|
|
|
|
}
|
|
|
|
+#endif /* CONFIG_RFKILL */
|
|
|
|
|
|
|
|
|
|
|
|
static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -893,13 +901,16 @@ static int wpa_driver_wext_finish_drv_in
|
2010-07-08 18:36:22 +00:00
|
|
|
int send_rfkill_event = 0;
|
|
|
|
|
|
|
|
if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) {
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
if (rfkill_is_blocked(drv->rfkill)) {
|
|
|
|
wpa_printf(MSG_DEBUG, "WEXT: Could not yet enable "
|
|
|
|
"interface '%s' due to rfkill",
|
|
|
|
drv->ifname);
|
|
|
|
drv->if_disabled = 1;
|
|
|
|
send_rfkill_event = 1;
|
|
|
|
- } else {
|
|
|
|
+ } else
|
|
|
|
+#endif
|
|
|
|
+ {
|
|
|
|
wpa_printf(MSG_ERROR, "WEXT: Could not set "
|
|
|
|
"interface '%s' UP", drv->ifname);
|
|
|
|
return -1;
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -947,8 +958,10 @@ static int wpa_driver_wext_finish_drv_in
|
2010-07-08 18:36:22 +00:00
|
|
|
1, IF_OPER_DORMANT);
|
|
|
|
|
|
|
|
if (send_rfkill_event) {
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
eloop_register_timeout(0, 0, wpa_driver_wext_send_rfkill,
|
|
|
|
drv, drv->ctx);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2013-06-30 20:27:38 +00:00
|
|
|
@@ -978,7 +991,9 @@ void wpa_driver_wext_deinit(void *priv)
|
2010-07-08 18:36:22 +00:00
|
|
|
|
|
|
|
netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
|
|
|
|
netlink_deinit(drv->netlink);
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
rfkill_deinit(drv->rfkill);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (drv->mlme_sock >= 0)
|
|
|
|
eloop_unregister_read_sock(drv->mlme_sock);
|
|
|
|
--- a/src/drivers/drivers.mak
|
|
|
|
+++ b/src/drivers/drivers.mak
|
2012-03-27 10:42:47 +00:00
|
|
|
@@ -25,7 +25,6 @@ NEED_SME=y
|
2010-07-08 18:36:22 +00:00
|
|
|
NEED_AP_MLME=y
|
|
|
|
NEED_NETLINK=y
|
|
|
|
NEED_LINUX_IOCTL=y
|
|
|
|
-NEED_RFKILL=y
|
2012-03-27 10:42:47 +00:00
|
|
|
|
|
|
|
ifdef CONFIG_LIBNL32
|
|
|
|
DRV_LIBS += -lnl-3
|
2013-03-04 17:16:38 +00:00
|
|
|
@@ -109,7 +108,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
|
2010-07-08 18:36:22 +00:00
|
|
|
CONFIG_WIRELESS_EXTENSION=y
|
|
|
|
NEED_NETLINK=y
|
|
|
|
NEED_LINUX_IOCTL=y
|
|
|
|
-NEED_RFKILL=y
|
|
|
|
endif
|
|
|
|
|
2012-03-27 10:42:47 +00:00
|
|
|
ifdef CONFIG_DRIVER_NDIS
|
2013-03-04 17:16:38 +00:00
|
|
|
@@ -135,7 +133,6 @@ endif
|
2010-11-11 22:39:19 +00:00
|
|
|
ifdef CONFIG_WIRELESS_EXTENSION
|
2012-03-27 10:42:47 +00:00
|
|
|
DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
|
|
|
|
DRV_WPA_OBJS += ../src/drivers/driver_wext.o
|
2010-11-11 22:39:19 +00:00
|
|
|
-NEED_RFKILL=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef NEED_NETLINK
|
2013-03-04 17:16:38 +00:00
|
|
|
@@ -148,6 +145,7 @@ endif
|
2010-07-08 18:36:22 +00:00
|
|
|
|
|
|
|
ifdef NEED_RFKILL
|
|
|
|
DRV_OBJS += ../src/drivers/rfkill.o
|
|
|
|
+DRV_WPA_CFLAGS += -DCONFIG_RFKILL
|
|
|
|
endif
|
|
|
|
|
2012-09-13 12:38:51 +00:00
|
|
|
ifdef CONFIG_VLAN_NETLINK
|
2010-07-08 18:36:22 +00:00
|
|
|
--- a/src/drivers/driver_wext.h
|
|
|
|
+++ b/src/drivers/driver_wext.h
|
2012-03-27 10:42:47 +00:00
|
|
|
@@ -22,7 +22,9 @@ struct wpa_driver_wext_data {
|
2010-07-08 18:36:22 +00:00
|
|
|
int ifindex2;
|
|
|
|
int if_removed;
|
|
|
|
int if_disabled;
|
|
|
|
+#ifdef CONFIG_RFKILL
|
|
|
|
struct rfkill_data *rfkill;
|
|
|
|
+#endif
|
|
|
|
u8 *assoc_req_ies;
|
|
|
|
size_t assoc_req_ies_len;
|
|
|
|
u8 *assoc_resp_ies;
|