320-optional_rfkill.patch 1.4 KB

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