1 --- a/src/drivers/driver_nl80211.c
2 +++ b/src/drivers/driver_nl80211.c
3 @@ -198,7 +198,9 @@ struct wpa_driver_nl80211_data {
6 int ignore_if_down_event;
8 struct rfkill_data *rfkill;
10 struct wpa_driver_capa capa;
13 @@ -2203,7 +2205,7 @@ err3:
19 static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
21 wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
22 @@ -2226,6 +2228,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 @@ -2283,7 +2286,9 @@ static void * wpa_driver_nl80211_init(vo
33 struct wpa_driver_nl80211_data *drv;
35 struct rfkill_config *rcfg;
39 drv = os_zalloc(sizeof(*drv));
40 @@ -2311,6 +2316,7 @@ static void * wpa_driver_nl80211_init(vo
42 nl80211_get_phy_name(drv);
45 rcfg = os_zalloc(sizeof(*rcfg));
48 @@ -2323,6 +2329,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 @@ -2445,10 +2452,12 @@ static int nl80211_register_action_frame
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 */
69 @@ -2475,13 +2484,16 @@ wpa_driver_nl80211_finish_drv_init(struc
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 @@ -2510,8 +2522,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 @@ -2596,7 +2610,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 @@ -702,7 +702,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 @@ -724,7 +724,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 @@ -770,7 +770,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 @@ -805,6 +807,7 @@ void * wpa_driver_wext_init(void *ctx, c
142 +#ifdef CONFIG_RFKILL
143 rcfg = os_zalloc(sizeof(*rcfg));
146 @@ -817,6 +820,7 @@ void * wpa_driver_wext_init(void *ctx, c
147 wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
150 +#endif /* CONFIG_RFKILL */
154 @@ -828,7 +832,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 @@ -838,10 +844,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 @@ -849,13 +857,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 @@ -903,8 +914,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 @@ -934,7 +947,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 @@ -43,7 +43,6 @@ NEED_SME=y
223 ifdef CONFIG_LIBNL_TINY
224 DRV_LIBS += -lnl-tiny
226 @@ -94,7 +93,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
227 CONFIG_WIRELESS_EXTENSION=y
233 ifdef CONFIG_DRIVER_RALINK
234 @@ -146,7 +144,6 @@ endif
235 ifdef CONFIG_WIRELESS_EXTENSION
236 DRV_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
237 DRV_OBJS += ../src/drivers/driver_wext.o
242 @@ -159,6 +156,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 @@ -28,7 +28,9 @@ struct wpa_driver_wext_data {
256 +#ifdef CONFIG_RFKILL
257 struct rfkill_data *rfkill;
260 size_t assoc_req_ies_len;