1 --- a/src/drivers/driver_nl80211.c
2 +++ b/src/drivers/driver_nl80211.c
3 @@ -211,7 +211,9 @@ struct wpa_driver_nl80211_data {
6 int ignore_if_down_event;
8 struct rfkill_data *rfkill;
10 struct wpa_driver_capa capa;
13 @@ -2755,7 +2757,7 @@ static int wpa_driver_nl80211_init_nl(st
19 static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
21 wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
22 @@ -2778,6 +2780,7 @@ static void wpa_driver_nl80211_rfkill_un
24 /* rtnetlink ifup handler will report interface as enabled */
26 +#endif /* CONFIG_RFKILL */
29 static void nl80211_get_phy_name(struct wpa_driver_nl80211_data *drv)
30 @@ -2909,7 +2912,9 @@ static void * wpa_driver_nl80211_init(vo
33 struct wpa_driver_nl80211_data *drv;
35 struct rfkill_config *rcfg;
39 if (global_priv == NULL)
40 @@ -2943,6 +2948,7 @@ static void * wpa_driver_nl80211_init(vo
42 nl80211_get_phy_name(drv);
45 rcfg = os_zalloc(sizeof(*rcfg));
48 @@ -2955,6 +2961,7 @@ static void * wpa_driver_nl80211_init(vo
49 wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available");
52 +#endif /* CONFIG_RFKILL */
54 if (wpa_driver_nl80211_finish_drv_init(drv))
56 @@ -3241,10 +3248,12 @@ static void nl80211_mgmt_unsubscribe(str
61 static void wpa_driver_nl80211_send_rfkill(void *eloop_ctx, void *timeout_ctx)
63 wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
65 +#endif /* CONFIG_RFKILL */
68 wpa_driver_nl80211_finish_drv_init_sta(struct wpa_driver_nl80211_data *drv,
69 @@ -3265,13 +3274,16 @@ wpa_driver_nl80211_finish_drv_init_sta(s
72 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
74 if (rfkill_is_blocked(drv->rfkill)) {
75 wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
76 "interface '%s' due to rfkill",
79 *send_rfkill_event = 1;
84 wpa_printf(MSG_ERROR, "nl80211: Could not set "
85 "interface '%s' UP", bss->ifname);
87 @@ -3302,8 +3314,10 @@ wpa_driver_nl80211_finish_drv_init(struc
90 if (send_rfkill_event) {
92 eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill,
98 @@ -3389,7 +3403,9 @@ static void wpa_driver_nl80211_deinit(vo
100 netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, 0,
102 +#ifdef CONFIG_RFKILL
103 rfkill_deinit(drv->rfkill);
106 eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx);
108 --- a/src/drivers/driver_wext.c
109 +++ b/src/drivers/driver_wext.c
110 @@ -742,7 +742,7 @@ static void wpa_driver_wext_event_rtm_de
115 +#ifdef CONFIG_RFKILL
116 static void wpa_driver_wext_rfkill_blocked(void *ctx)
118 wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked");
119 @@ -764,7 +764,7 @@ static void wpa_driver_wext_rfkill_unblo
121 /* rtnetlink ifup handler will report interface as enabled */
124 +#endif /* CONFIG_RFKILL */
126 static void wext_get_phy_name(struct wpa_driver_wext_data *drv)
128 @@ -810,7 +810,9 @@ void * wpa_driver_wext_init(void *ctx, c
130 struct wpa_driver_wext_data *drv;
131 struct netlink_config *cfg;
132 +#ifdef CONFIG_RFKILL
133 struct rfkill_config *rcfg;
138 @@ -845,6 +847,7 @@ void * wpa_driver_wext_init(void *ctx, c
142 +#ifdef CONFIG_RFKILL
143 rcfg = os_zalloc(sizeof(*rcfg));
146 @@ -857,6 +860,7 @@ void * wpa_driver_wext_init(void *ctx, c
147 wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
150 +#endif /* CONFIG_RFKILL */
154 @@ -874,7 +878,9 @@ void * wpa_driver_wext_init(void *ctx, c
158 +#ifdef CONFIG_RFKILL
159 rfkill_deinit(drv->rfkill);
161 netlink_deinit(drv->netlink);
163 close(drv->ioctl_sock);
164 @@ -884,10 +890,12 @@ err1:
168 +#ifdef CONFIG_RFKILL
169 static void wpa_driver_wext_send_rfkill(void *eloop_ctx, void *timeout_ctx)
171 wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
173 +#endif /* CONFIG_RFKILL */
176 static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
177 @@ -895,13 +903,16 @@ static int wpa_driver_wext_finish_drv_in
178 int send_rfkill_event = 0;
180 if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) {
181 +#ifdef CONFIG_RFKILL
182 if (rfkill_is_blocked(drv->rfkill)) {
183 wpa_printf(MSG_DEBUG, "WEXT: Could not yet enable "
184 "interface '%s' due to rfkill",
186 drv->if_disabled = 1;
187 send_rfkill_event = 1;
192 wpa_printf(MSG_ERROR, "WEXT: Could not set "
193 "interface '%s' UP", drv->ifname);
195 @@ -949,8 +960,10 @@ static int wpa_driver_wext_finish_drv_in
198 if (send_rfkill_event) {
199 +#ifdef CONFIG_RFKILL
200 eloop_register_timeout(0, 0, wpa_driver_wext_send_rfkill,
206 @@ -980,7 +993,9 @@ void wpa_driver_wext_deinit(void *priv)
208 netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
209 netlink_deinit(drv->netlink);
210 +#ifdef CONFIG_RFKILL
211 rfkill_deinit(drv->rfkill);
214 if (drv->mlme_sock >= 0)
215 eloop_unregister_read_sock(drv->mlme_sock);
216 --- a/src/drivers/drivers.mak
217 +++ b/src/drivers/drivers.mak
218 @@ -25,7 +25,6 @@ NEED_SME=y
226 @@ -101,7 +100,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
227 CONFIG_WIRELESS_EXTENSION=y
233 ifdef CONFIG_DRIVER_NDIS
234 @@ -127,7 +125,6 @@ endif
235 ifdef CONFIG_WIRELESS_EXTENSION
236 DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
237 DRV_WPA_OBJS += ../src/drivers/driver_wext.o
242 @@ -140,6 +137,7 @@ endif
245 DRV_OBJS += ../src/drivers/rfkill.o
246 +DRV_WPA_CFLAGS += -DCONFIG_RFKILL
250 --- a/src/drivers/driver_wext.h
251 +++ b/src/drivers/driver_wext.h
252 @@ -22,7 +22,9 @@ struct wpa_driver_wext_data {
256 +#ifdef CONFIG_RFKILL
257 struct rfkill_data *rfkill;
260 size_t assoc_req_ies_len;