1 /*
2  * Copyright (c) 2006 The DragonFly Project.  All rights reserved.
3  *
4  * This code is derived from software contributed to The DragonFly Project
5  * by Sepherosa Ziehau <sepherosa@gmail.com>
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
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
16  *    distribution.
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.
20  *
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
32  * SUCH DAMAGE.
33  *
34  * $DragonFly: src/sys/netproto/802_11/wlan/ieee80211_ratectl_none.c,v 1.3 2008/01/15 09:01:13 sephe Exp $
35  */
36 
37 #include <sys/param.h>
38 #include <sys/kernel.h>
39 
40 #include <net/if.h>
41 #include <net/if_media.h>
42 #include <net/if_arp.h>
43 
44 #include <netproto/802_11/ieee80211_var.h>
45 
46 static void	*none_ratectl_attach(struct ieee80211vap *);
47 static void	none_ratectl_detach(void *);
48 static void none_ratectl_init(struct ieee80211vap *);
49 static void none_ratectl_deinit(struct ieee80211vap *);
50 static void none_ratectl_node_init(struct ieee80211_node *);
51 static void none_ratectl_node_deinit(struct ieee80211_node *);
52 static void none_ratectl_rate(struct ieee80211vap *, void *, uint32_t);
53 static void	none_ratectl_tx_complete(const struct ieee80211vap *,
54 			struct ieee80211_node *, int, void *, void *);
55 static void none_ratectl_tx_update(const struct ieee80211vap *,
56 			const struct ieee80211_node *, void *, void *, void *);
57 static void none_ratectl_setinterval(const struct ieee80211vap *, int);
58 
59 const struct ieee80211_ratectl ieee80211_ratectl_none = {
60 	.rc_name	= "none",
61 	.rc_attach	= none_ratectl_attach,
62 	.rc_detach	= none_ratectl_detach,
63 	.rc_init	= none_ratectl_init,
64 	.rc_deinit	= none_ratectl_deinit,
65 	.rc_node_init	= none_ratectl_node_init,
66 	.rc_node_deinit	= none_ratectl_node_deinit,
67 	.rc_rate = none_ratectl_rate,
68 	.rc_tx_complete	= none_ratectl_tx_complete,
69 	.rc_tx_update = none_ratectl_tx_update,
70 	.rc_setinterval = none_ratectl_setinterval,
71 };
72 
73 IEEE80211_RATECTL_MODULE(ieee80211_ratectl_none, 1);
74 IEEE80211_RATECTL_ALG(ieee80211_ratectl_none, IEEE80211_RATECTL_NONE,
75 	ieee80211_ratectl_none);
76 
77 static void
78 none_ratectl_setinterval(const struct ieee80211vap *vap __unused,
79 	int msecs __unused)
80 {
81 }
82 
83 static void *
84 none_ratectl_attach(struct ieee80211vap *vap)
85 {
86 	struct ieee80211_ratectl_state *rc_st = &vap->iv_ratectl;
87 
88 	rc_st->rc_st_attach(vap, IEEE80211_RATECTL_NONE);
89 	return NULL;
90 }
91 
92 static void
93 none_ratectl_detach(void *arg __unused)
94 {
95 }
96 
97 static void
98 none_ratectl_init(struct ieee80211vap *vap __unused)
99 {
100 }
101 
102 static void
103 none_ratectl_deinit(struct ieee80211vap *vap __unused)
104 {
105 }
106 
107 static void
108 none_ratectl_node_init(struct ieee80211_node *ni __unused)
109 {
110 }
111 
112 static void
113 none_ratectl_node_deinit(struct ieee80211_node *ni __unused)
114 {
115 }
116 
117 static void
118 none_ratectl_tx_complete(const struct ieee80211vap *vap __unused,
119 			 struct ieee80211_node *ni __unused, int ok __unused,
120 			 void *arg1 __unused, void *arg2 __unused)
121 {
122 }
123 
124 static void
125 none_ratectl_tx_update(const struct ieee80211vap *vap __unused,
126 			 const struct ieee80211_node *ni __unused,
127 			 void *arg1 __unused, void *arg2 __unused, void *arg3 __unused)
128 {
129 }
130