b0ea38f205a24e141627cf3462762ff508681de5
[openwrt.git] / package / network / services / hostapd / patches / 320-optional_rfkill.patch
1 --- a/src/drivers/drivers.mak
2 +++ b/src/drivers/drivers.mak
3 @@ -25,7 +25,6 @@ NEED_SME=y
4  NEED_AP_MLME=y
5  NEED_NETLINK=y
6  NEED_LINUX_IOCTL=y
7 -NEED_RFKILL=y
8  
9  ifdef CONFIG_LIBNL32
10    DRV_LIBS += -lnl-3
11 @@ -109,7 +108,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
12  CONFIG_WIRELESS_EXTENSION=y
13  NEED_NETLINK=y
14  NEED_LINUX_IOCTL=y
15 -NEED_RFKILL=y
16  endif
17  
18  ifdef CONFIG_DRIVER_NDIS
19 @@ -135,7 +133,6 @@ endif
20  ifdef CONFIG_WIRELESS_EXTENSION
21  DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
22  DRV_WPA_OBJS += ../src/drivers/driver_wext.o
23 -NEED_RFKILL=y
24  endif
25  
26  ifdef NEED_NETLINK
27 @@ -148,6 +145,7 @@ endif
28  
29  ifdef NEED_RFKILL
30  DRV_OBJS += ../src/drivers/rfkill.o
31 +DRV_WPA_CFLAGS += -DCONFIG_RFKILL
32  endif
33  
34  ifdef CONFIG_VLAN_NETLINK
35 --- a/src/drivers/rfkill.h
36 +++ b/src/drivers/rfkill.h
37 @@ -18,8 +18,24 @@ struct rfkill_config {
38         void (*unblocked_cb)(void *ctx);
39  };
40  
41 +#ifdef CONFIG_RFKILL
42  struct rfkill_data * rfkill_init(struct rfkill_config *cfg);
43  void rfkill_deinit(struct rfkill_data *rfkill);
44  int rfkill_is_blocked(struct rfkill_data *rfkill);
45 +#else
46 +static inline struct rfkill_data * rfkill_init(struct rfkill_config *cfg)
47 +{
48 +       return (void *) 1;
49 +}
50 +
51 +static inline void rfkill_deinit(struct rfkill_data *rfkill)
52 +{
53 +}
54 +
55 +static inline int rfkill_is_blocked(struct rfkill_data *rfkill)
56 +{
57 +       return 0;
58 +}
59 +#endif
60  
61  #endif /* RFKILL_H */