blob: d30960e1755c64d32bbd651b195265c1aacca0d5 [file] [log] [blame]
Johannes Berg704232c2007-04-23 12:20:05 -07001#ifndef __NET_CFG80211_H
2#define __NET_CFG80211_H
3
4#include <linux/netlink.h>
5#include <linux/skbuff.h>
Johannes Berg55682962007-09-20 13:09:35 -04006#include <linux/nl80211.h>
Johannes Berg704232c2007-04-23 12:20:05 -07007#include <net/genetlink.h>
8
9/*
10 * 802.11 configuration in-kernel interface
11 *
Johannes Berg55682962007-09-20 13:09:35 -040012 * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
Johannes Berg704232c2007-04-23 12:20:05 -070013 */
14
Andy Green179f8312007-07-10 19:29:38 +020015/* Radiotap header iteration
16 * implemented in net/wireless/radiotap.c
17 * docs in Documentation/networking/radiotap-headers.txt
18 */
19/**
20 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
21 * @rtheader: pointer to the radiotap header we are walking through
22 * @max_length: length of radiotap header in cpu byte ordering
23 * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg
24 * @this_arg: pointer to current radiotap arg
25 * @arg_index: internal next argument index
26 * @arg: internal next argument pointer
27 * @next_bitmap: internal pointer to next present u32
28 * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
29 */
30
31struct ieee80211_radiotap_iterator {
32 struct ieee80211_radiotap_header *rtheader;
33 int max_length;
34 int this_arg_index;
35 u8 *this_arg;
36
37 int arg_index;
38 u8 *arg;
39 __le32 *next_bitmap;
40 u32 bitmap_shifter;
41};
42
43extern int ieee80211_radiotap_iterator_init(
44 struct ieee80211_radiotap_iterator *iterator,
45 struct ieee80211_radiotap_header *radiotap_header,
46 int max_length);
47
48extern int ieee80211_radiotap_iterator_next(
49 struct ieee80211_radiotap_iterator *iterator);
50
51
Johannes Berg704232c2007-04-23 12:20:05 -070052/* from net/wireless.h */
53struct wiphy;
54
55/**
56 * struct cfg80211_ops - backend description for wireless configuration
57 *
58 * This struct is registered by fullmac card drivers and/or wireless stacks
59 * in order to handle configuration requests on their interfaces.
60 *
61 * All callbacks except where otherwise noted should return 0
62 * on success or a negative error code.
63 *
Johannes Berg43fb45cb2007-04-24 14:07:27 -070064 * All operations are currently invoked under rtnl for consistency with the
65 * wireless extensions but this is subject to reevaluation as soon as this
66 * code is used more widely and we have a first user without wext.
67 *
Johannes Berg704232c2007-04-23 12:20:05 -070068 * @add_virtual_intf: create a new virtual interface with the given name
69 *
70 * @del_virtual_intf: remove the virtual interface determined by ifindex.
Johannes Berg55682962007-09-20 13:09:35 -040071 *
72 * @change_virtual_intf: change type of virtual interface
73 *
Johannes Berg704232c2007-04-23 12:20:05 -070074 */
75struct cfg80211_ops {
76 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
Johannes Berg55682962007-09-20 13:09:35 -040077 enum nl80211_iftype type);
Johannes Berg704232c2007-04-23 12:20:05 -070078 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex);
Johannes Berg55682962007-09-20 13:09:35 -040079 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex,
80 enum nl80211_iftype type);
Johannes Berg704232c2007-04-23 12:20:05 -070081};
82
83#endif /* __NET_CFG80211_H */