X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=package%2Fhostapd%2Fpatches%2F540-optional_rfkill.patch;h=028c160758251bac2af132061d376ffae6702591;hb=ec7be8a5b2db78dadc0d38ff3cfc51be89535fff;hp=796a7c58f0c5b2e57d5292353f18c9104f7a0010;hpb=706010dbe1c98d4737f142ac402a6d86f6709f4e;p=openwrt.git diff --git a/package/hostapd/patches/540-optional_rfkill.patch b/package/hostapd/patches/540-optional_rfkill.patch index 796a7c58f0..028c160758 100644 --- a/package/hostapd/patches/540-optional_rfkill.patch +++ b/package/hostapd/patches/540-optional_rfkill.patch @@ -1,16 +1,16 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -127,7 +127,9 @@ struct wpa_driver_nl80211_data { - int ifindex; +@@ -198,7 +198,9 @@ struct wpa_driver_nl80211_data { int if_removed; int if_disabled; + int ignore_if_down_event; +#ifdef CONFIG_RFKILL struct rfkill_data *rfkill; +#endif struct wpa_driver_capa capa; int has_capability; -@@ -1729,7 +1731,7 @@ err1: +@@ -2203,7 +2205,7 @@ err3: return -1; } @@ -19,7 +19,7 @@ static void wpa_driver_nl80211_rfkill_blocked(void *ctx) { wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked"); -@@ -1751,6 +1753,7 @@ static void wpa_driver_nl80211_rfkill_un +@@ -2226,6 +2228,7 @@ static void wpa_driver_nl80211_rfkill_un } /* rtnetlink ifup handler will report interface as enabled */ } @@ -27,25 +27,25 @@ static void nl80211_get_phy_name(struct wpa_driver_nl80211_data *drv) -@@ -1799,7 +1802,9 @@ static void * wpa_driver_nl80211_init(vo +@@ -2283,7 +2286,9 @@ static void * wpa_driver_nl80211_init(vo + void *global_priv) { struct wpa_driver_nl80211_data *drv; - struct netlink_config *cfg; +#ifdef CONFIG_RFKILL struct rfkill_config *rcfg; +#endif struct i802_bss *bss; drv = os_zalloc(sizeof(*drv)); -@@ -1842,6 +1847,7 @@ static void * wpa_driver_nl80211_init(vo - goto failed; - } +@@ -2311,6 +2316,7 @@ static void * wpa_driver_nl80211_init(vo + + nl80211_get_phy_name(drv); +#ifdef CONFIG_RFKILL rcfg = os_zalloc(sizeof(*rcfg)); if (rcfg == NULL) goto failed; -@@ -1854,6 +1860,7 @@ static void * wpa_driver_nl80211_init(vo +@@ -2323,6 +2329,7 @@ static void * wpa_driver_nl80211_init(vo wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available"); os_free(rcfg); } @@ -53,17 +53,7 @@ if (wpa_driver_nl80211_finish_drv_init(drv)) goto failed; -@@ -1861,7 +1868,9 @@ static void * wpa_driver_nl80211_init(vo - return bss; - - failed: -+#ifdef CONFIG_RFKILL - rfkill_deinit(drv->rfkill); -+#endif - netlink_deinit(drv->netlink); - if (drv->ioctl_sock >= 0) - close(drv->ioctl_sock); -@@ -1964,10 +1973,12 @@ static int nl80211_register_action_frame +@@ -2445,10 +2452,12 @@ static int nl80211_register_action_frame } @@ -76,10 +66,10 @@ static int -@@ -1986,13 +1997,16 @@ wpa_driver_nl80211_finish_drv_init(struc +@@ -2475,13 +2484,16 @@ wpa_driver_nl80211_finish_drv_init(struc } - if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) { + if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) { +#ifdef CONFIG_RFKILL if (rfkill_is_blocked(drv->rfkill)) { wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable " @@ -94,7 +84,7 @@ wpa_printf(MSG_ERROR, "nl80211: Could not set " "interface '%s' UP", bss->ifname); return -1; -@@ -2020,8 +2034,10 @@ wpa_driver_nl80211_finish_drv_init(struc +@@ -2510,8 +2522,10 @@ wpa_driver_nl80211_finish_drv_init(struc } if (send_rfkill_event) { @@ -105,26 +95,16 @@ } return 0; -@@ -2102,7 +2118,9 @@ static void wpa_driver_nl80211_deinit(vo +@@ -2596,7 +2610,9 @@ static void wpa_driver_nl80211_deinit(vo - netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP); - netlink_deinit(drv->netlink); + netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, 0, + IF_OPER_UP); +#ifdef CONFIG_RFKILL rfkill_deinit(drv->rfkill); +#endif eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx); -@@ -5631,7 +5649,9 @@ static void *i802_init(struct hostapd_da - - failed: - nl80211_remove_monitor_interface(drv); -+#ifdef CONFIG_RFKILL - rfkill_deinit(drv->rfkill); -+#endif - netlink_deinit(drv->netlink); - if (drv->ioctl_sock >= 0) - close(drv->ioctl_sock); --- a/src/drivers/driver_wext.c +++ b/src/drivers/driver_wext.c @@ -702,7 +702,7 @@ static void wpa_driver_wext_event_rtm_de @@ -250,8 +230,8 @@ -NEED_RFKILL=y endif - ifdef CONFIG_DRIVER_HERMES -@@ -170,7 +168,6 @@ endif + ifdef CONFIG_DRIVER_RALINK +@@ -146,7 +144,6 @@ endif ifdef CONFIG_WIRELESS_EXTENSION DRV_CFLAGS += -DCONFIG_WIRELESS_EXTENSION DRV_OBJS += ../src/drivers/driver_wext.o @@ -259,7 +239,7 @@ endif ifdef NEED_NETLINK -@@ -183,6 +180,7 @@ endif +@@ -159,6 +156,7 @@ endif ifdef NEED_RFKILL DRV_OBJS += ../src/drivers/rfkill.o