aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-02-03 04:24:30 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-08 16:50:53 -0500
commit33e5a2f776e331dc8a4379b6efb660d38f182d96 (patch)
tree8d89bc3f70063bec4d85d76dc5887cea19da064d /include/net
parent690680360cd22b55235481ca3421a3450a96138a (diff)
wireless: update radiotap parser
Upstream radiotap has adopted the namespace proposal David Young made and I then took care of, for which I had adapted the radiotap parser as a library outside the kernel. This brings the in-kernel parser up to speed. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg80211.h83
-rw-r--r--include/net/ieee80211_radiotap.h4
2 files changed, 68 insertions, 19 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index a3f0a7ed31ac..5b3569b2a74c 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1561,37 +1561,82 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
1561 * Documentation in Documentation/networking/radiotap-headers.txt 1561 * Documentation in Documentation/networking/radiotap-headers.txt
1562 */ 1562 */
1563 1563
1564struct radiotap_align_size {
1565 uint8_t align:4, size:4;
1566};
1567
1568struct ieee80211_radiotap_namespace {
1569 const struct radiotap_align_size *align_size;
1570 int n_bits;
1571 uint32_t oui;
1572 uint8_t subns;
1573};
1574
1575struct ieee80211_radiotap_vendor_namespaces {
1576 const struct ieee80211_radiotap_namespace *ns;
1577 int n_ns;
1578};
1579
1564/** 1580/**
1565 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args 1581 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
1566 * @rtheader: pointer to the radiotap header we are walking through 1582 * @this_arg_index: index of current arg, valid after each successful call
1567 * @max_length: length of radiotap header in cpu byte ordering 1583 * to ieee80211_radiotap_iterator_next()
1568 * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg 1584 * @this_arg: pointer to current radiotap arg; it is valid after each
1569 * @this_arg: pointer to current radiotap arg 1585 * call to ieee80211_radiotap_iterator_next() but also after
1570 * @arg_index: internal next argument index 1586 * ieee80211_radiotap_iterator_init() where it will point to
1571 * @arg: internal next argument pointer 1587 * the beginning of the actual data portion
1572 * @next_bitmap: internal pointer to next present u32 1588 * @this_arg_size: length of the current arg, for convenience
1573 * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present 1589 * @current_namespace: pointer to the current namespace definition
1590 * (or internally %NULL if the current namespace is unknown)
1591 * @is_radiotap_ns: indicates whether the current namespace is the default
1592 * radiotap namespace or not
1593 *
1594 * @overrides: override standard radiotap fields
1595 * @n_overrides: number of overrides
1596 *
1597 * @_rtheader: pointer to the radiotap header we are walking through
1598 * @_max_length: length of radiotap header in cpu byte ordering
1599 * @_arg_index: next argument index
1600 * @_arg: next argument pointer
1601 * @_next_bitmap: internal pointer to next present u32
1602 * @_bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
1603 * @_vns: vendor namespace definitions
1604 * @_next_ns_data: beginning of the next namespace's data
1605 * @_reset_on_ext: internal; reset the arg index to 0 when going to the
1606 * next bitmap word
1607 *
1608 * Describes the radiotap parser state. Fields prefixed with an underscore
1609 * must not be used by users of the parser, only by the parser internally.
1574 */ 1610 */
1575 1611
1576struct ieee80211_radiotap_iterator { 1612struct ieee80211_radiotap_iterator {
1577 struct ieee80211_radiotap_header *rtheader; 1613 struct ieee80211_radiotap_header *_rtheader;
1578 int max_length; 1614 const struct ieee80211_radiotap_vendor_namespaces *_vns;
1615 const struct ieee80211_radiotap_namespace *current_namespace;
1616
1617 unsigned char *_arg, *_next_ns_data;
1618 uint32_t *_next_bitmap;
1619
1620 unsigned char *this_arg;
1579 int this_arg_index; 1621 int this_arg_index;
1580 u8 *this_arg; 1622 int this_arg_size;
1581 1623
1582 int arg_index; 1624 int is_radiotap_ns;
1583 u8 *arg; 1625
1584 __le32 *next_bitmap; 1626 int _max_length;
1585 u32 bitmap_shifter; 1627 int _arg_index;
1628 uint32_t _bitmap_shifter;
1629 int _reset_on_ext;
1586}; 1630};
1587 1631
1588extern int ieee80211_radiotap_iterator_init( 1632extern int ieee80211_radiotap_iterator_init(
1589 struct ieee80211_radiotap_iterator *iterator, 1633 struct ieee80211_radiotap_iterator *iterator,
1590 struct ieee80211_radiotap_header *radiotap_header, 1634 struct ieee80211_radiotap_header *radiotap_header,
1591 int max_length); 1635 int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns);
1592 1636
1593extern int ieee80211_radiotap_iterator_next( 1637extern int ieee80211_radiotap_iterator_next(
1594 struct ieee80211_radiotap_iterator *iterator); 1638 struct ieee80211_radiotap_iterator *iterator);
1639
1595 1640
1596extern const unsigned char rfc1042_header[6]; 1641extern const unsigned char rfc1042_header[6];
1597extern const unsigned char bridge_tunnel_header[6]; 1642extern const unsigned char bridge_tunnel_header[6];
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index 9d3d86aaccbb..af49f8ab7f81 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -198,6 +198,10 @@ enum ieee80211_radiotap_type {
198 IEEE80211_RADIOTAP_TX_FLAGS = 15, 198 IEEE80211_RADIOTAP_TX_FLAGS = 15,
199 IEEE80211_RADIOTAP_RTS_RETRIES = 16, 199 IEEE80211_RADIOTAP_RTS_RETRIES = 16,
200 IEEE80211_RADIOTAP_DATA_RETRIES = 17, 200 IEEE80211_RADIOTAP_DATA_RETRIES = 17,
201
202 /* valid in every it_present bitmap, even vendor namespaces */
203 IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
204 IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30,
201 IEEE80211_RADIOTAP_EXT = 31 205 IEEE80211_RADIOTAP_EXT = 31
202}; 206};
203 207