123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553 |
- #ifndef _IW_HANDLER_H
- #define _IW_HANDLER_H
- #include <linux/wireless.h>
- #include <linux/if_ether.h>
- #define IW_HANDLER_VERSION 8
- #define IW_WIRELESS_SPY
- #define IW_WIRELESS_THRSPY
- #define EIWCOMMIT EINPROGRESS
- #define IW_REQUEST_FLAG_COMPAT 0x0001
- #define IW_HEADER_TYPE_NULL 0
- #define IW_HEADER_TYPE_CHAR 2
- #define IW_HEADER_TYPE_UINT 4
- #define IW_HEADER_TYPE_FREQ 5
- #define IW_HEADER_TYPE_ADDR 6
- #define IW_HEADER_TYPE_POINT 8
- #define IW_HEADER_TYPE_PARAM 9
- #define IW_HEADER_TYPE_QUAL 10
- #define IW_DESCR_FLAG_NONE 0x0000
- #define IW_DESCR_FLAG_DUMP 0x0001
- #define IW_DESCR_FLAG_EVENT 0x0002
- #define IW_DESCR_FLAG_RESTRICT 0x0004
-
- #define IW_DESCR_FLAG_NOMAX 0x0008
- #define IW_DESCR_FLAG_WAIT 0x0100
- struct iw_request_info {
- __u16 cmd;
- __u16 flags;
- };
- struct net_device;
- typedef int (*iw_handler)(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra);
- struct iw_handler_def {
-
- const iw_handler * standard;
-
- __u16 num_standard;
- #ifdef CONFIG_WEXT_PRIV
- __u16 num_private;
-
- __u16 num_private_args;
-
- const iw_handler * private;
-
- const struct iw_priv_args * private_args;
- #endif
-
- struct iw_statistics* (*get_wireless_stats)(struct net_device *dev);
- };
- struct iw_ioctl_description {
- __u8 header_type;
- __u8 token_type;
- __u16 token_size;
- __u16 min_tokens;
- __u16 max_tokens;
- __u32 flags;
- };
- struct iw_spy_data {
-
- int spy_number;
- u_char spy_address[IW_MAX_SPY][ETH_ALEN];
- struct iw_quality spy_stat[IW_MAX_SPY];
-
- struct iw_quality spy_thr_low;
- struct iw_quality spy_thr_high;
- u_char spy_thr_under[IW_MAX_SPY];
- };
- struct libipw_device;
- struct iw_public_data {
-
- struct iw_spy_data * spy_data;
-
- struct libipw_device * libipw;
- };
- int dev_get_wireless_info(char *buffer, char **start, off_t offset, int length);
- void wireless_send_event(struct net_device *dev, unsigned int cmd,
- union iwreq_data *wrqu, const char *extra);
- #ifdef CONFIG_WEXT_CORE
- void wireless_nlevent_flush(void);
- #else
- static inline void wireless_nlevent_flush(void) {}
- #endif
- int iw_handler_set_spy(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra);
- int iw_handler_get_spy(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra);
- int iw_handler_set_thrspy(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra);
- int iw_handler_get_thrspy(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra);
- void wireless_spy_update(struct net_device *dev, unsigned char *address,
- struct iw_quality *wstats);
- static inline int iwe_stream_lcp_len(struct iw_request_info *info)
- {
- #ifdef CONFIG_COMPAT
- if (info->flags & IW_REQUEST_FLAG_COMPAT)
- return IW_EV_COMPAT_LCP_LEN;
- #endif
- return IW_EV_LCP_LEN;
- }
- static inline int iwe_stream_point_len(struct iw_request_info *info)
- {
- #ifdef CONFIG_COMPAT
- if (info->flags & IW_REQUEST_FLAG_COMPAT)
- return IW_EV_COMPAT_POINT_LEN;
- #endif
- return IW_EV_POINT_LEN;
- }
- static inline int iwe_stream_event_len_adjust(struct iw_request_info *info,
- int event_len)
- {
- #ifdef CONFIG_COMPAT
- if (info->flags & IW_REQUEST_FLAG_COMPAT) {
- event_len -= IW_EV_LCP_LEN;
- event_len += IW_EV_COMPAT_LCP_LEN;
- }
- #endif
- return event_len;
- }
- char *iwe_stream_add_event(struct iw_request_info *info, char *stream,
- char *ends, struct iw_event *iwe, int event_len);
- 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;
- }
- char *iwe_stream_add_point(struct iw_request_info *info, char *stream,
- char *ends, struct iw_event *iwe, char *extra);
- 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;
- }
- char *iwe_stream_add_value(struct iw_request_info *info, char *event,
- char *value, char *ends, struct iw_event *iwe,
- int event_len);
- #endif
|