ieee80211_ratectl_none.c revision 214069
1167706Sbms/*-
2167706Sbms * Copyright (c) 2010 Bernhard Schmidt <bschmidt@FreeBSD.org>
355163Sshin * All rights reserved.
4188645Sbms *
555163Sshin * Redistribution and use in source and binary forms, with or without
655163Sshin * modification, are permitted provided that the following conditions
762785Sume * are met:
855163Sshin * 1. Redistributions of source code must retain the above copyright
955163Sshin *    notice, this list of conditions and the following disclaimer.
1055163Sshin * 2. Redistributions in binary form must reproduce the above copyright
1155163Sshin *    notice, this list of conditions and the following disclaimer in the
1255163Sshin *    documentation and/or other materials provided with the distribution.
1355163Sshin *
1455163Sshin * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1555163Sshin * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1655163Sshin * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1755163Sshin * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1855163Sshin * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1962785Sume * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2055163Sshin * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2155163Sshin * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2255163Sshin * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2355163Sshin * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2455163Sshin */
2555163Sshin
2655163Sshin#include <sys/cdefs.h>
2755163Sshin__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ratectl_none.c 214069 2010-10-19 18:49:26Z bschmidt $");
2855163Sshin
2955163Sshin#include "opt_wlan.h"
3055163Sshin
3155163Sshin#include <sys/param.h>
3255163Sshin#include <sys/kernel.h>
33167706Sbms#include <sys/module.h>
34167706Sbms#include <sys/socket.h>
35167706Sbms#include <sys/sysctl.h>
3655163Sshin
37167706Sbms#include <net/if.h>
38189592Sbms#include <net/if_media.h>
3955163Sshin
4078064Sume#ifdef INET
41189592Sbms#include <netinet/in.h>
4278064Sume#include <netinet/if_ether.h>
4355163Sshin#endif
44167712Sbms
4555163Sshin#include <net80211/ieee80211_var.h>
4655163Sshin#include <net80211/ieee80211_ratectl.h>
47167706Sbms
48167712Sbmsstatic void
4955163Sshinnone_init(struct ieee80211vap *vap)
50167712Sbms{
51167706Sbms}
52167706Sbms
53167706Sbmsstatic void
54167712Sbmsnone_deinit(struct ieee80211vap *vap)
55167706Sbms{
56167712Sbms	free(vap->iv_rs, M_80211_RATECTL);
57167712Sbms}
58189592Sbms
59167712Sbmsstatic void
60189592Sbmsnone_node_init(struct ieee80211_node *ni)
61167712Sbms{
62167712Sbms}
63167712Sbms
64167706Sbmsstatic void
65167706Sbmsnone_node_deinit(struct ieee80211_node *ni)
66167712Sbms{
67167706Sbms}
68167712Sbms
69167712Sbmsstatic int
70168560Sbmsnone_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg __unused)
71168560Sbms{
72168560Sbms	int rix = 0;
73168560Sbms
74168560Sbms	ni->ni_txrate = ni->ni_rates.rs_rates[rix] & IEEE80211_RATE_VAL;
75168560Sbms	return rix;
76167712Sbms}
77167712Sbms
78168560Sbmsstatic void
79168560Sbmsnone_tx_complete(const struct ieee80211vap *vap,
80168560Sbms    const struct ieee80211_node *ni, int ok,
81168560Sbms    void *arg1, void *arg2 __unused)
82189592Sbms{
83167712Sbms}
84167712Sbms
85168560Sbmsstatic void
86168560Sbmsnone_tx_update(const struct ieee80211vap *vap, const struct ieee80211_node *ni,
87167712Sbms    void *arg1, void *arg2, void *arg3)
88168560Sbms{
89167712Sbms}
9062785Sume
91168560Sbmsstatic void
92168560Sbmsnone_setinterval(const struct ieee80211vap *vap, int msecs)
93168560Sbms{
94168560Sbms}
9555163Sshin
96189592Sbms/* number of references from net80211 layer */
97189592Sbmsstatic	int nrefs = 0;
98168560Sbms
99168560Sbmsstatic const struct ieee80211_ratectl none = {
100168560Sbms	.ir_name	= "none",
101168560Sbms	.ir_attach	= NULL,
102168560Sbms	.ir_detach	= NULL,
103168560Sbms	.ir_init	= none_init,
104168560Sbms	.ir_deinit	= none_deinit,
105168560Sbms	.ir_node_init	= none_node_init,
106168560Sbms	.ir_node_deinit	= none_node_deinit,
107168560Sbms	.ir_rate	= none_rate,
10855163Sshin	.ir_tx_complete	= none_tx_complete,
109168560Sbms	.ir_tx_update	= none_tx_update,
11055163Sshin	.ir_setinterval	= none_setinterval,
111168560Sbms};
112168560SbmsIEEE80211_RATECTL_MODULE(ratectl_none, 1);
113189592SbmsIEEE80211_RATECTL_ALG(none, IEEE80211_RATECTL_NONE, none);
114189592Sbms