summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_atureg.h
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2005-05-23 20:09:32 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2005-05-23 20:09:32 +0000
commita82036c201b4206a70fe7b9753d66e78e0423fe8 (patch)
treef6a94a93b5f29918354135642160fc88a37cae06 /sys/dev/usb/if_atureg.h
parent4288617b8956c4d3682de202b8ea9910aa6562e4 (diff)
Initial radiotap support. ok dlg@
Diffstat (limited to 'sys/dev/usb/if_atureg.h')
-rw-r--r--sys/dev/usb/if_atureg.h52
1 files changed, 51 insertions, 1 deletions
diff --git a/sys/dev/usb/if_atureg.h b/sys/dev/usb/if_atureg.h
index 4046a663609..a0eafb3fa07 100644
--- a/sys/dev/usb/if_atureg.h
+++ b/sys/dev/usb/if_atureg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atureg.h,v 1.23 2005/03/08 12:15:12 dlg Exp $ */
+/* $OpenBSD: if_atureg.h,v 1.24 2005/05/23 20:09:31 jsg Exp $ */
/*
* Copyright (c) 2003
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
@@ -116,6 +116,42 @@ struct atu_chain {
SLIST_ENTRY(atu_chain) atu_list;
};
+/* Radio capture format */
+
+#define ATU_RX_RADIOTAP_PRESENT \
+ ((1 << IEEE80211_RADIOTAP_TSFT) | \
+ (1 << IEEE80211_RADIOTAP_FLAGS) | \
+ (1 << IEEE80211_RADIOTAP_RATE) | \
+ (1 << IEEE80211_RADIOTAP_CHANNEL) | \
+ (1 << IEEE80211_RADIOTAP_LOCK_QUALITY) | \
+ (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \
+ 0)
+
+struct atu_rx_radiotap_header {
+ struct ieee80211_radiotap_header rr_ihdr;
+ u_int64_t rr_tsft;
+ u_int8_t rr_flags;
+ u_int8_t rr_rate;
+ u_int16_t rr_chan_freq;
+ u_int16_t rr_chan_flags;
+ u_int16_t rr_barker_lock;
+ u_int8_t rr_antsignal;
+} __attribute__((__packed__));
+
+#define ATU_TX_RADIOTAP_PRESENT \
+ ((1 << IEEE80211_RADIOTAP_FLAGS) | \
+ (1 << IEEE80211_RADIOTAP_RATE) | \
+ (1 << IEEE80211_RADIOTAP_CHANNEL) | \
+ 0)
+
+struct atu_tx_radiotap_header {
+ struct ieee80211_radiotap_header rt_ihdr;
+ u_int8_t rt_flags;
+ u_int8_t rt_rate;
+ u_int16_t rt_chan_freq;
+ u_int16_t rt_chan_flags;
+} __attribute__((__packed__));
+
struct atu_cdata {
struct atu_chain atu_tx_chain[ATU_TX_LIST_CNT];
struct atu_chain atu_rx_chain[ATU_RX_LIST_CNT];
@@ -172,8 +208,22 @@ struct atu_softc {
#define INFRASTRUCTURE_MODE 2
u_int8_t atu_radio_on;
+ caddr_t sc_radiobpf;
+
+ union {
+ struct atu_rx_radiotap_header tap;
+ u_int8_t pad[64];
+ } sc_rxtapu;
+ union {
+ struct atu_tx_radiotap_header tap;
+ u_int8_t pad[64];
+ } sc_txtapu;
+
};
+#define sc_rxtap sc_rxtapu.tap
+#define sc_txtap sc_txtapu.tap
+
/* Commands for uploading the firmware (standard DFU interface) */
#define DFU_DNLOAD UT_WRITE_CLASS_INTERFACE, 0x01
#define DFU_GETSTATUS UT_READ_CLASS_INTERFACE, 0x03