1 --- a/src/drivers/driver_nl80211.c
2 +++ b/src/drivers/driver_nl80211.c
3 @@ -115,7 +115,9 @@ struct wpa_driver_nl80211_data {
8 struct rfkill_data *rfkill;
10 struct wpa_driver_capa capa;
13 @@ -1630,7 +1632,7 @@ err1:
19 static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
21 wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
22 @@ -1652,6 +1654,7 @@ static void wpa_driver_nl80211_rfkill_un
24 /* rtnetlink ifup handler will report interface as enabled */
26 +#endif /* CONFIG_RFKILL */
30 @@ -1665,7 +1668,9 @@ static void * wpa_driver_nl80211_init(vo
32 struct wpa_driver_nl80211_data *drv;
33 struct netlink_config *cfg;
35 struct rfkill_config *rcfg;
39 drv = os_zalloc(sizeof(*drv));
40 @@ -1703,6 +1708,7 @@ static void * wpa_driver_nl80211_init(vo
45 rcfg = os_zalloc(sizeof(*rcfg));
48 @@ -1715,6 +1721,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 @@ -1722,7 +1729,9 @@ static void * wpa_driver_nl80211_init(vo
61 rfkill_deinit(drv->rfkill);
63 netlink_deinit(drv->netlink);
64 if (drv->ioctl_sock >= 0)
65 close(drv->ioctl_sock);
66 @@ -1820,10 +1829,12 @@ static int nl80211_register_action_frame
71 static void wpa_driver_nl80211_send_rfkill(void *eloop_ctx, void *timeout_ctx)
73 wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
75 +#endif /* CONFIG_RFKILL */
79 @@ -1842,13 +1853,16 @@ wpa_driver_nl80211_finish_drv_init(struc
82 if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) {
84 if (rfkill_is_blocked(drv->rfkill)) {
85 wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
86 "interface '%s' due to rfkill",
89 send_rfkill_event = 1;
94 wpa_printf(MSG_ERROR, "nl80211: Could not set "
95 "interface '%s' UP", bss->ifname);
97 @@ -1873,8 +1887,10 @@ wpa_driver_nl80211_finish_drv_init(struc
100 if (send_rfkill_event) {
101 +#ifdef CONFIG_RFKILL
102 eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill,
108 @@ -1955,7 +1971,9 @@ static void wpa_driver_nl80211_deinit(vo
110 netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
111 netlink_deinit(drv->netlink);
112 +#ifdef CONFIG_RFKILL
113 rfkill_deinit(drv->rfkill);
116 eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx);
118 --- a/src/drivers/driver_wext.c
119 +++ b/src/drivers/driver_wext.c
120 @@ -700,7 +700,7 @@ static void wpa_driver_wext_event_rtm_de
125 +#ifdef CONFIG_RFKILL
126 static void wpa_driver_wext_rfkill_blocked(void *ctx)
128 wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked");
129 @@ -722,7 +722,7 @@ static void wpa_driver_wext_rfkill_unblo
131 /* rtnetlink ifup handler will report interface as enabled */
134 +#endif /* CONFIG_RFKILL */
137 * wpa_driver_wext_init - Initialize WE driver interface
138 @@ -735,7 +735,9 @@ void * wpa_driver_wext_init(void *ctx, c
140 struct wpa_driver_wext_data *drv;
141 struct netlink_config *cfg;
142 +#ifdef CONFIG_RFKILL
143 struct rfkill_config *rcfg;
148 @@ -769,6 +771,7 @@ void * wpa_driver_wext_init(void *ctx, c
152 +#ifdef CONFIG_RFKILL
153 rcfg = os_zalloc(sizeof(*rcfg));
156 @@ -781,6 +784,7 @@ void * wpa_driver_wext_init(void *ctx, c
157 wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
160 +#endif /* CONFIG_RFKILL */
164 @@ -792,7 +796,9 @@ void * wpa_driver_wext_init(void *ctx, c
168 +#ifdef CONFIG_RFKILL
169 rfkill_deinit(drv->rfkill);
171 netlink_deinit(drv->netlink);
173 close(drv->ioctl_sock);
174 @@ -802,10 +808,12 @@ err1:
178 +#ifdef CONFIG_RFKILL
179 static void wpa_driver_wext_send_rfkill(void *eloop_ctx, void *timeout_ctx)
181 wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
183 +#endif /* CONFIG_RFKILL */
186 static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
187 @@ -813,13 +821,16 @@ static int wpa_driver_wext_finish_drv_in
188 int send_rfkill_event = 0;
190 if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) {
191 +#ifdef CONFIG_RFKILL
192 if (rfkill_is_blocked(drv->rfkill)) {
193 wpa_printf(MSG_DEBUG, "WEXT: Could not yet enable "
194 "interface '%s' due to rfkill",
196 drv->if_disabled = 1;
197 send_rfkill_event = 1;
202 wpa_printf(MSG_ERROR, "WEXT: Could not set "
203 "interface '%s' UP", drv->ifname);
205 @@ -867,8 +878,10 @@ static int wpa_driver_wext_finish_drv_in
208 if (send_rfkill_event) {
209 +#ifdef CONFIG_RFKILL
210 eloop_register_timeout(0, 0, wpa_driver_wext_send_rfkill,
216 @@ -898,7 +911,9 @@ void wpa_driver_wext_deinit(void *priv)
218 netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
219 netlink_deinit(drv->netlink);
220 +#ifdef CONFIG_RFKILL
221 rfkill_deinit(drv->rfkill);
224 if (drv->mlme_sock >= 0)
225 eloop_unregister_read_sock(drv->mlme_sock);
226 --- a/src/drivers/drivers.mak
227 +++ b/src/drivers/drivers.mak
228 @@ -43,7 +43,6 @@ NEED_SME=y
233 ifdef CONFIG_LIBNL_TINY
234 DRV_LIBS += -lnl-tiny
236 @@ -94,7 +93,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
237 CONFIG_WIRELESS_EXTENSION=y
243 ifdef CONFIG_DRIVER_HERMES
244 @@ -170,7 +168,6 @@ endif
245 ifdef CONFIG_WIRELESS_EXTENSION
246 DRV_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
247 DRV_OBJS += ../src/drivers/driver_wext.o
252 @@ -183,6 +180,7 @@ endif
255 DRV_OBJS += ../src/drivers/rfkill.o
256 +DRV_WPA_CFLAGS += -DCONFIG_RFKILL
260 --- a/src/drivers/driver_wext.h
261 +++ b/src/drivers/driver_wext.h
262 @@ -27,7 +27,9 @@ struct wpa_driver_wext_data {
266 +#ifdef CONFIG_RFKILL
267 struct rfkill_data *rfkill;
270 size_t assoc_req_ies_len;