2 * Copyright (c) 2006 The DragonFly Project. All rights reserved.
4 * This code is derived from software contributed to The DragonFly Project
5 * by Sepherosa Ziehau <sepherosa@gmail.com>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * 3. Neither the name of The DragonFly Project nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific, prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * $DragonFly: src/sys/netproto/802_11/wlan/ieee80211_ratectl_none.c,v 1.1 2006/09/01 15:12:11 sephe Exp $
37 #include <sys/param.h>
38 #include <sys/kernel.h>
41 #include <net/if_media.h>
42 #include <net/if_arp.h>
44 #include <netproto/802_11/ieee80211_var.h>
46 static void *none_ratectl_attach(struct ieee80211com *);
47 static void none_ratectl_detach(void *);
48 static void none_ratectl_data_alloc(struct ieee80211_node *);
49 static void none_ratectl_data_free(struct ieee80211_node *);
50 static void none_ratectl_data_dup(const struct ieee80211_node *,
51 struct ieee80211_node *);
52 static void none_ratectl_newstate(void *, enum ieee80211_state);
53 static void none_ratectl_tx_complete(void *, struct ieee80211_node *,
54 int, const struct ieee80211_ratectl_res[],
56 static void none_ratectl_newassoc(void *, struct ieee80211_node *, int);
57 static int none_ratectl_findrate(void *, struct ieee80211_node *, int,
60 const struct ieee80211_ratectl ieee80211_ratectl_none = {
62 .rc_ratectl = IEEE80211_RATECTL_NONE,
63 .rc_attach = none_ratectl_attach,
64 .rc_detach = none_ratectl_detach,
65 .rc_data_alloc = none_ratectl_data_alloc,
66 .rc_data_free = none_ratectl_data_free,
67 .rc_data_dup = none_ratectl_data_dup,
68 .rc_newstate = none_ratectl_newstate,
69 .rc_tx_complete = none_ratectl_tx_complete,
70 .rc_newassoc = none_ratectl_newassoc,
71 .rc_findrate = none_ratectl_findrate
75 none_ratectl_attach(struct ieee80211com *ic __unused)
81 none_ratectl_detach(void *arg __unused)
86 none_ratectl_data_alloc(struct ieee80211_node *ni __unused)
91 none_ratectl_data_free(struct ieee80211_node *ni __unused)
96 none_ratectl_data_dup(const struct ieee80211_node *oni __unused,
97 struct ieee80211_node *nni __unused)
102 none_ratectl_newstate(void *arg __unused, enum ieee80211_state state __unused)
107 none_ratectl_tx_complete(void *arg __unused, struct ieee80211_node *ni __unused,
108 int frame_len __unused,
109 const struct ieee80211_ratectl_res res[] __unused,
110 int res_len __unused,
111 int short_retries __unused, int long_retries __unused,
112 int is_fail __unused)
117 none_ratectl_newassoc(void *arg __unused, struct ieee80211_node *ni __unused,
123 none_ratectl_findrate(void * arg __unused, struct ieee80211_node *ni,
124 int frame_len __unused, int rateidx[], int rateidx_len)
128 for (i = 0; i < rateidx_len; ++i)
129 rateidx[i] = ni->ni_txrate;