/* $NetBSD: ieee80211_amrr.c,v 1.2 2007/12/11 12:40:10 lukem Exp $ */
/* $OpenBSD: ieee80211_amrr.c,v 1.1 2006/06/17 19:07:19 damien Exp $ */
/*
* Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
*/
/*
* Copyright (c) 2006
* Damien Bergamini <damien.bergamini@free.fr>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/net80211.h>
#include <sys/net80211_amrr.h>
#include "net80211_impl.h"
void
struct ieee80211_amrr_node *amn)
{
amn->amn_success = 0;
amn->amn_recovery = 0;
}
/*
* Update ni->in_txrate.
*/
void
struct ieee80211_amrr_node *amn)
{
int need_change = 0;
amn->amn_success++;
!is_max_rate(ni)) {
amn->amn_success = 0;
"AMRR increasing rate %d (txcnt=%d retrycnt=%d)",
struct ieee80211_node *, ni,
need_change = 1;
} else {
amn->amn_recovery = 0;
}
} else if (is_failure(amn)) {
amn->amn_success = 0;
if (!is_min_rate(ni)) {
if (amn->amn_recovery) {
if (amn->amn_success_threshold >
} else {
}
"AMRR decreasing rate %d (txcnt=%d retrycnt=%d)",
struct ieee80211_node *, ni,
need_change = 1;
}
amn->amn_recovery = 0;
}
}