Annotation of sys/dev/usb/if_uathvar.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: if_uathvar.h,v 1.5 2007/06/06 19:25:49 mk Exp $ */
! 2:
! 3: /*-
! 4: * Copyright (c) 2006
! 5: * Damien Bergamini <damien.bergamini@free.fr>
! 6: *
! 7: * Permission to use, copy, modify, and distribute this software for any
! 8: * purpose with or without fee is hereby granted, provided that the above
! 9: * copyright notice and this permission notice appear in all copies.
! 10: *
! 11: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
! 12: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
! 13: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
! 14: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
! 15: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
! 16: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
! 17: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
! 18: */
! 19:
! 20: #define UATH_TX_DATA_LIST_COUNT 8 /* 16 */
! 21: #define UATH_TX_CMD_LIST_COUNT 8 /* 30 */
! 22:
! 23: /* XXX ehci will panic on abort_pipe if set to anything > 1 */
! 24: #define UATH_RX_DATA_LIST_COUNT 1 /* 128 */
! 25: #define UATH_RX_CMD_LIST_COUNT 1 /* 30 */
! 26:
! 27: #define UATH_RX_DATA_POOL_COUNT (UATH_RX_DATA_LIST_COUNT + 24)
! 28:
! 29: #define UATH_DATA_TIMEOUT 10000
! 30: #define UATH_CMD_TIMEOUT 1000
! 31:
! 32: struct uath_rx_radiotap_header {
! 33: struct ieee80211_radiotap_header wr_ihdr;
! 34: uint8_t wr_flags;
! 35: uint16_t wr_chan_freq;
! 36: uint16_t wr_chan_flags;
! 37: int8_t wr_dbm_antsignal;
! 38: } __packed;
! 39:
! 40: #define UATH_RX_RADIOTAP_PRESENT \
! 41: ((1 << IEEE80211_RADIOTAP_FLAGS) | \
! 42: (1 << IEEE80211_RADIOTAP_CHANNEL) | \
! 43: (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL))
! 44:
! 45: struct uath_tx_radiotap_header {
! 46: struct ieee80211_radiotap_header wt_ihdr;
! 47: uint8_t wt_flags;
! 48: uint16_t wt_chan_freq;
! 49: uint16_t wt_chan_flags;
! 50: } __packed;
! 51:
! 52: #define UATH_TX_RADIOTAP_PRESENT \
! 53: ((1 << IEEE80211_RADIOTAP_FLAGS) | \
! 54: (1 << IEEE80211_RADIOTAP_CHANNEL))
! 55:
! 56: struct uath_tx_data {
! 57: struct uath_softc *sc;
! 58: usbd_xfer_handle xfer;
! 59: uint8_t *buf;
! 60: struct ieee80211_node *ni;
! 61: };
! 62:
! 63: struct uath_rx_data {
! 64: struct uath_softc *sc;
! 65: usbd_xfer_handle xfer;
! 66: uint8_t *buf;
! 67: SLIST_ENTRY(uath_rx_data) next;
! 68: };
! 69:
! 70: struct uath_tx_cmd {
! 71: struct uath_softc *sc;
! 72: usbd_xfer_handle xfer;
! 73: uint8_t *buf;
! 74: void *odata;
! 75: };
! 76:
! 77: struct uath_rx_cmd {
! 78: struct uath_softc *sc;
! 79: usbd_xfer_handle xfer;
! 80: uint8_t *buf;
! 81: };
! 82:
! 83: struct uath_wme_settings {
! 84: uint8_t aifsn;
! 85: uint8_t logcwmin;
! 86: uint8_t logcwmax;
! 87: uint16_t txop;
! 88: #define UATH_TXOP_TO_US(txop) ((txop) << 5)
! 89:
! 90: uint8_t acm;
! 91: };
! 92:
! 93: /* condvars */
! 94: #define UATH_COND_INIT(sc) ((caddr_t)sc + 1)
! 95: #define UATH_COND_NOREF(sc) ((caddr_t)sc + 2)
! 96:
! 97: /* flags for sending firmware commands */
! 98: #define UATH_CMD_FLAG_ASYNC (1 << 0)
! 99: #define UATH_CMD_FLAG_READ (1 << 1)
! 100: #define UATH_CMD_FLAG_MAGIC (1 << 2)
! 101:
! 102: struct uath_softc {
! 103: struct device sc_dev;
! 104: struct ieee80211com sc_ic;
! 105: int (*sc_newstate)(struct ieee80211com *,
! 106: enum ieee80211_state, int);
! 107:
! 108: struct uath_tx_data tx_data[UATH_TX_DATA_LIST_COUNT];
! 109: struct uath_rx_data rx_data[UATH_RX_DATA_POOL_COUNT];
! 110:
! 111: struct uath_tx_cmd tx_cmd[UATH_TX_CMD_LIST_COUNT];
! 112: struct uath_rx_cmd rx_cmd[UATH_RX_CMD_LIST_COUNT];
! 113:
! 114: SLIST_HEAD(, uath_rx_data) rx_freelist;
! 115:
! 116: int sc_flags;
! 117: int sc_dying;
! 118: int sc_refcnt;
! 119:
! 120: int data_idx;
! 121: int cmd_idx;
! 122: int tx_queued;
! 123:
! 124: usbd_device_handle sc_udev;
! 125: usbd_device_handle sc_uhub;
! 126: int sc_port;
! 127:
! 128: usbd_interface_handle sc_iface;
! 129:
! 130: usbd_pipe_handle data_tx_pipe;
! 131: usbd_pipe_handle data_rx_pipe;
! 132: usbd_pipe_handle cmd_tx_pipe;
! 133: usbd_pipe_handle cmd_rx_pipe;
! 134:
! 135: enum ieee80211_state sc_state;
! 136: int sc_arg;
! 137: struct usb_task sc_task;
! 138:
! 139: struct timeout scan_to;
! 140: struct timeout stat_to;
! 141:
! 142: int sc_tx_timer;
! 143:
! 144: int rxbufsz;
! 145:
! 146: #if NBPFILTER > 0
! 147: caddr_t sc_drvbpf;
! 148:
! 149: union {
! 150: struct uath_rx_radiotap_header th;
! 151: uint8_t pad[64];
! 152: } sc_rxtapu;
! 153: #define sc_rxtap sc_rxtapu.th
! 154: int sc_rxtap_len;
! 155:
! 156: union {
! 157: struct uath_tx_radiotap_header th;
! 158: uint8_t pad[64];
! 159: } sc_txtapu;
! 160: #define sc_txtap sc_txtapu.th
! 161: int sc_txtap_len;
! 162: #endif
! 163: };
CVSweb