/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2002-2009 Sam Leffler, Errno Consulting4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer,11* without modification.12* 2. Redistributions in binary form must reproduce at minimum a disclaimer13* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any14* redistribution must be conditioned upon including a substantially15* similar Disclaimer requirement for further binary redistribution.16*17* NO WARRANTY18* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY21* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL22* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,23* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF24* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS25* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER26* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)27* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF28* THE POSSIBILITY OF SUCH DAMAGES.29*/30#ifndef __IF_ATH_TDMA_H__31#define __IF_ATH_TDMA_H__3233#define TDMA_EP_MULTIPLIER (1<<10) /* pow2 to optimize out * and / */34#define TDMA_LPF_LEN 635#define TDMA_DUMMY_MARKER 0x12736#define TDMA_EP_MUL(x, mul) ((x) * (mul))37#define TDMA_IN(x) (TDMA_EP_MUL((x), TDMA_EP_MULTIPLIER))38#define TDMA_LPF(x, y, len) \39((x != TDMA_DUMMY_MARKER) ? (((x) * ((len)-1) + (y)) / (len)) : (y))40#define TDMA_SAMPLE(x, y) do { \41x = TDMA_LPF((x), TDMA_IN(y), TDMA_LPF_LEN); \42} while (0)43#define TDMA_EP_RND(x,mul) \44((((x)%(mul)) >= ((mul)/2)) ? \45((x) + ((mul) - 1)) / (mul) : (x)/(mul))46#define TDMA_AVG(x) TDMA_EP_RND(x, TDMA_EP_MULTIPLIER)4748extern void ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap);49extern void ath_tdma_update(struct ieee80211_node *ni,50const struct ieee80211_tdma_param *tdma, int changed);51extern void ath_tdma_beacon_send(struct ath_softc *sc,52struct ieee80211vap *vap);5354#endif555657