From 52409fae3e4b8d16b68b61902fc09075cd97b75d Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Sun, 2 Jul 2017 16:41:37 +0200 Subject: Backports generated from 4.11 kernel Initial commit. Signed-off-by: Dominik Sliwa --- backport-include/net/iw_handler.h | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 backport-include/net/iw_handler.h (limited to 'backport-include/net/iw_handler.h') diff --git a/backport-include/net/iw_handler.h b/backport-include/net/iw_handler.h new file mode 100644 index 0000000..84d63b3 --- /dev/null +++ b/backport-include/net/iw_handler.h @@ -0,0 +1,40 @@ +#ifndef __BACKPORT_IW_HANDLER_H +#define __BACKPORT_IW_HANDLER_H +#include_next + +#if LINUX_VERSION_IS_LESS(4,1,0) +static inline char * +iwe_stream_add_event_check(struct iw_request_info *info, char *stream, + char *ends, struct iw_event *iwe, int event_len) +{ + char *res = iwe_stream_add_event(info, stream, ends, iwe, event_len); + + if (res == stream) + return ERR_PTR(-E2BIG); + return res; +} + +static inline char * +iwe_stream_add_point_check(struct iw_request_info *info, char *stream, + char *ends, struct iw_event *iwe, char *extra) +{ + char *res = iwe_stream_add_point(info, stream, ends, iwe, extra); + + if (res == stream) + return ERR_PTR(-E2BIG); + return res; +} +#endif /* LINUX_VERSION_IS_LESS(4,1,0) */ + +/* this was added in v3.2.79, v3.18.30, v4.1.21, v4.4.6 and 4.5 */ +#if !(LINUX_VERSION_IS_GEQ(4,4,6) || \ + (LINUX_VERSION_IS_GEQ(4,1,21) && \ + LINUX_VERSION_IS_LESS(4,2,0)) || \ + (LINUX_VERSION_IS_GEQ(3,18,30) && \ + LINUX_VERSION_IS_LESS(3,19,0)) || \ + (LINUX_VERSION_IS_GEQ(3,2,79) && \ + LINUX_VERSION_IS_LESS(3,3,0))) +#define wireless_nlevent_flush LINUX_BACKPORT(wireless_nlevent_flush) +static inline void wireless_nlevent_flush(void) {} +#endif +#endif /* __BACKPORT_IW_HANDLER_H */ -- cgit v1.2.3