ieee80211_tdma.h revision 189980
1186904Ssam/*-
2186904Ssam * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
3186904Ssam * Copyright (c) 2007-2009 Intel Corporation
4186904Ssam * All rights reserved.
5186904Ssam *
6186904Ssam * Redistribution and use in source and binary forms, with or without
7186904Ssam * modification, are permitted provided that the following conditions
8186904Ssam * are met:
9186904Ssam * 1. Redistributions of source code must retain the above copyright
10186904Ssam *    notice, this list of conditions and the following disclaimer.
11186904Ssam * 2. Redistributions in binary form must reproduce the above copyright
12186904Ssam *    notice, this list of conditions and the following disclaimer in the
13186904Ssam *    documentation and/or other materials provided with the distribution.
14186904Ssam *
15186904Ssam * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16186904Ssam * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17186904Ssam * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18186904Ssam * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19186904Ssam * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20186904Ssam * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21186904Ssam * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22186904Ssam * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23186904Ssam * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24186904Ssam * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25186904Ssam *
26186904Ssam * $FreeBSD: head/sys/net80211/ieee80211_tdma.h 189980 2009-03-18 19:28:17Z sam $
27186904Ssam */
28186904Ssam#ifndef _NET80211_IEEE80211_TDMA_H_
29186904Ssam#define _NET80211_IEEE80211_TDMA_H_
30186904Ssam
31186904Ssam/*
32186904Ssam * TDMA-mode implementation definitions.
33186904Ssam */
34186904Ssamstruct ieee80211_tdma_state {
35186904Ssam	u_int	tdma_slotlen;		/* bss slot length (us) */
36189980Ssam	uint8_t	tdma_version;		/* protocol version to use */
37186904Ssam	uint8_t	tdma_slotcnt;		/* bss slot count */
38186904Ssam	uint8_t	tdma_bintval;		/* beacon interval (slots) */
39186904Ssam	uint8_t	tdma_slot;		/* station slot # */
40186904Ssam	uint8_t	tdma_inuse[1];		/* mask of slots in use */
41186904Ssam	void	*tdma_peer;		/* peer station cookie */
42186904Ssam	uint8_t	tdma_active[1];		/* mask of active slots */
43186904Ssam	int	tdma_count;		/* active/inuse countdown */
44186904Ssam
45186904Ssam	/* parent method pointers */
46186904Ssam	int	(*tdma_newstate)(struct ieee80211vap *, enum ieee80211_state,
47186904Ssam		    int arg);
48186904Ssam	void	(*tdma_recv_mgmt)(struct ieee80211_node *,
49186904Ssam		    struct mbuf *, int, int, int, uint32_t);
50186904Ssam	void	(*tdma_opdetach)(struct ieee80211vap *);
51186904Ssam};
52189980Ssam
53189980Ssam#define	TDMA_UPDATE_SLOT	0x0001	/* tdma_slot changed */
54189980Ssam#define	TDMA_UPDATE_SLOTCNT	0x0002	/* tdma_slotcnt changed */
55189980Ssam#define	TDMA_UPDATE_SLOTLEN	0x0004	/* tdma_slotlen changed */
56189980Ssam#define	TDMA_UPDATE_BINTVAL	0x0008	/* tdma_bintval changed */
57186904Ssam
58186904Ssamvoid	ieee80211_tdma_vattach(struct ieee80211vap *);
59186904Ssam
60186904Ssamint	ieee80211_tdma_getslot(struct ieee80211vap *vap);
61186904Ssamvoid	ieee80211_parse_tdma(struct ieee80211_node *ni, const uint8_t *ie);
62186904Ssamuint8_t *ieee80211_add_tdma(uint8_t *frm, struct ieee80211vap *vap);
63186904Ssamstruct ieee80211_beacon_offsets;
64186904Ssamvoid	ieee80211_tdma_update_beacon(struct ieee80211vap *vap,
65186904Ssam	    struct ieee80211_beacon_offsets *bo);
66186904Ssamstruct ieee80211req;
67186904Ssamint	ieee80211_tdma_ioctl_get80211(struct ieee80211vap *vap,
68186904Ssam	    struct ieee80211req *ireq);
69186904Ssamint	ieee80211_tdma_ioctl_set80211(struct ieee80211vap *vap,
70186904Ssam	    struct ieee80211req *ireq);
71186904Ssam#endif /* !_NET80211_IEEE80211_TDMA_H_ */
72