Initial import of Atheros Hardware Access Layer (HAL) version 0.9.16.16
[dragonfly.git] / sys / contrib / dev / ath / dragonfly / ah_if.m
1 #
2 # Copyright (c) 2002-2006 Sam Leffler, Errno Consulting, Atheros
3 # Communications, Inc.  All rights reserved.
4 #
5 # Redistribution and use in source and binary forms are permitted
6 # provided that the following conditions are met:
7 # 1. The materials contained herein are unmodified and are used
8 #    unmodified.
9 # 2. Redistributions of source code must retain the above copyright
10 #    notice, this list of conditions and the following NO
11 #    ''WARRANTY'' disclaimer below (''Disclaimer''), without
12 #    modification.
13 # 3. Redistributions in binary form must reproduce at minimum a
14 #    disclaimer similar to the Disclaimer below and any redistribution
15 #    must be conditioned upon including a substantially similar
16 #    Disclaimer requirement for further binary redistribution.
17 # 4. Neither the names of the above-listed copyright holders nor the
18 #    names of any contributors may be used to endorse or promote
19 #    product derived from this software without specific prior written
20 #    permission.
21 #
22 # NO WARRANTY
23 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 # ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 # LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT,
26 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 # IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
28 # FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30 # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
33 # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 # SUCH DAMAGES.
35 #
36 # $Id: //depot/sw/linuxsrc/src/802_11/madwifi/hal/main/freebsd/ah_if.m#6 $
37 #
38
39 INTERFACE ath_hal;
40
41 METHOD  const char* ath_hal_probe {
42         u_int16_t       vendorID;
43         u_int16_        deviceID;
44 };
45
46 METHOD  struct ath_hal* ath_hal_attach {
47         u_int16_t       deviceID;
48         HAL_SOFTC       sc;
49         HAL_BUS_TAG     st;
50         HAL_BUS_HANDLE  sh;
51         HAL_STATUS*     error;
52 };
53
54 METHOD u_int ath_hal_init_channels {
55         struct ath_hal* ah;
56         HAL_CHANNEL*    chans;
57         u_int           maxchans;
58         u_int*          nchans;
59         HAL_CTRY_CODE   cc;
60         u_int16_t       modeSelect;
61         int             enableOutdoor;
62 };
63
64 METHOD u_int ath_hal_getwirelessmodes {
65         struct ath_hal* ah;
66         HAL_CTRY_CODE   cc;
67 };
68
69 METHOD const HAL_RATE_TABLE* ath_hal_getratetable {
70         struct ath_hal* ah;
71         u_int           mode;
72 };
73
74 METHOD u_int16_t ath_hal_computetxtime {
75         struct ath_hal* ah;
76         const HAL_RATE_TABLE* rates;
77         u_int32_t       frameLength;
78         u_int16_t       rateIndex;
79         HAL_BOOL        shortPreamble;
80 };
81
82 METHOD u_int ath_hal_mhz2ieee {
83         u_int           mhz;
84         u_int           flags;
85 };
86
87 METHOD u_int ath_hal_ieee2mhz {
88         u_int           ieee;
89         u_int           flags;
90 };