hostapd: adjust patches to work with git am
[openwrt/staging/xback.git] / package / network / services / hostapd / patches / 320-optional_rfkill.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Thu, 8 Jul 2010 18:36:22 +0000
3 Subject: [PATCH] hostapd: make rfkill support optional
4
5 --- a/src/drivers/drivers.mak
6 +++ b/src/drivers/drivers.mak
7 @@ -54,7 +54,6 @@ NEED_SME=y
8 NEED_AP_MLME=y
9 NEED_NETLINK=y
10 NEED_LINUX_IOCTL=y
11 -NEED_RFKILL=y
12 NEED_RADIOTAP=y
13 NEED_LIBNL=y
14 endif
15 @@ -111,7 +110,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
16 CONFIG_WIRELESS_EXTENSION=y
17 NEED_NETLINK=y
18 NEED_LINUX_IOCTL=y
19 -NEED_RFKILL=y
20 endif
21
22 ifdef CONFIG_DRIVER_NDIS
23 @@ -137,7 +135,6 @@ endif
24 ifdef CONFIG_WIRELESS_EXTENSION
25 DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
26 DRV_WPA_OBJS += ../src/drivers/driver_wext.o
27 -NEED_RFKILL=y
28 endif
29
30 ifdef NEED_NETLINK
31 @@ -146,6 +143,7 @@ endif
32
33 ifdef NEED_RFKILL
34 DRV_OBJS += ../src/drivers/rfkill.o
35 +DRV_WPA_CFLAGS += -DCONFIG_RFKILL
36 endif
37
38 ifdef NEED_RADIOTAP
39 --- a/src/drivers/rfkill.h
40 +++ b/src/drivers/rfkill.h
41 @@ -18,8 +18,24 @@ struct rfkill_config {
42 void (*unblocked_cb)(void *ctx);
43 };
44
45 +#ifdef CONFIG_RFKILL
46 struct rfkill_data * rfkill_init(struct rfkill_config *cfg);
47 void rfkill_deinit(struct rfkill_data *rfkill);
48 int rfkill_is_blocked(struct rfkill_data *rfkill);
49 +#else
50 +static inline struct rfkill_data * rfkill_init(struct rfkill_config *cfg)
51 +{
52 + return (void *) 1;
53 +}
54 +
55 +static inline void rfkill_deinit(struct rfkill_data *rfkill)
56 +{
57 +}
58 +
59 +static inline int rfkill_is_blocked(struct rfkill_data *rfkill)
60 +{
61 + return 0;
62 +}
63 +#endif
64
65 #endif /* RFKILL_H */