aboutsummaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_proto.h
diff options
context:
space:
mode:
authorSam Leffler <sam@FreeBSD.org>2008-04-20 20:35:46 +0000
committerSam Leffler <sam@FreeBSD.org>2008-04-20 20:35:46 +0000
commitb032f27c365b992e9d8e42214183b39acfb8c6ac (patch)
treebc7985c57e7ecfa1ac03e48c406a25430dba634b /sys/net80211/ieee80211_proto.h
parentf44636071190e39b601efef820f32bf0fb0bb02f (diff)
downloadsrc-b032f27c365b992e9d8e42214183b39acfb8c6ac.tar.gz
src-b032f27c365b992e9d8e42214183b39acfb8c6ac.zip
Multi-bss (aka vap) support for 802.11 devices.
Note this includes changes to all drivers and moves some device firmware loading to use firmware(9) and a separate module (e.g. ral). Also there no longer are separate wlan_scan* modules; this functionality is now bundled into the wlan module. Supported by: Hobnob and Marvell Reviewed by: many Obtained from: Atheros (some bits)
Notes
Notes: svn path=/head/; revision=178354
Diffstat (limited to 'sys/net80211/ieee80211_proto.h')
-rw-r--r--sys/net80211/ieee80211_proto.h190
1 files changed, 119 insertions, 71 deletions
diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h
index 9f94f1cfc77b..ec7061da332f 100644
--- a/sys/net80211/ieee80211_proto.h
+++ b/sys/net80211/ieee80211_proto.h
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2001 Atsushi Onoe
- * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting
+ * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,63 +44,65 @@ enum ieee80211_state {
};
#define IEEE80211_S_MAX (IEEE80211_S_SLEEP+1)
-#define IEEE80211_SEND_MGMT(_ic,_ni,_type,_arg) \
- ((*(_ic)->ic_send_mgmt)(_ic, _ni, _type, _arg))
-
-/*
- * The formation of some management frames requires guidance to
- * deal with legacy clients. When the client is identified as
- * "legacy 11b" this parameter can be passed in the arg param of a
- * IEEE80211_SEND_MGMT call.
- */
-#define IEEE80211_SEND_LEGACY_11B 0x1 /* legacy 11b client */
-#define IEEE80211_SEND_LEGACY_11 0x2 /* other legacy client */
-#define IEEE80211_SEND_LEGACY 0x3 /* any legacy client */
+#define IEEE80211_SEND_MGMT(_ni,_type,_arg) \
+ ((*(_ni)->ni_ic->ic_send_mgmt)(_ni, _type, _arg))
extern const char *ieee80211_mgt_subtype_name[];
extern const char *ieee80211_phymode_name[];
void ieee80211_proto_attach(struct ieee80211com *);
void ieee80211_proto_detach(struct ieee80211com *);
+void ieee80211_proto_vattach(struct ieee80211vap *);
+void ieee80211_proto_vdetach(struct ieee80211vap *);
+
+void ieee80211_syncifflag_locked(struct ieee80211com *, int flag);
+void ieee80211_syncflag(struct ieee80211vap *, int flag);
+void ieee80211_syncflag_ext(struct ieee80211vap *, int flag);
-struct ieee80211_node;
-int ieee80211_input(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *, int, int, uint32_t);
-void ieee80211_deliver_data(struct ieee80211com *,
- struct ieee80211_node *, struct mbuf *);
-struct mbuf *ieee80211_decap1(struct mbuf *, int *);
-int ieee80211_setup_rates(struct ieee80211_node *ni,
- const uint8_t *rates, const uint8_t *xrates, int flags);
-void ieee80211_saveie(uint8_t **, const uint8_t *);
-void ieee80211_saveath(struct ieee80211_node *, uint8_t *);
-void ieee80211_recv_mgmt(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *, int, int, int, uint32_t);
-int ieee80211_mgmt_output(struct ieee80211com *, struct ieee80211_node *,
- struct mbuf *, int type);
+#define ieee80211_input(ni, m, rssi, noise, rstamp) \
+ ((ni)->ni_vap->iv_input(ni, m, rssi, noise, rstamp))
+int ieee80211_input_all(struct ieee80211com *, struct mbuf *,
+ int, int, uint32_t);
+int ieee80211_mgmt_output(struct ieee80211_node *, struct mbuf *, int);
struct ieee80211_bpf_params;
int ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *,
const struct ieee80211_bpf_params *);
int ieee80211_output(struct ifnet *, struct mbuf *,
struct sockaddr *, struct rtentry *);
+void ieee80211_start(struct ifnet *);
int ieee80211_send_nulldata(struct ieee80211_node *);
-int ieee80211_send_mgmt(struct ieee80211com *, struct ieee80211_node *,
- int, int);
+int ieee80211_classify(struct ieee80211_node *, struct mbuf *m);
+struct mbuf *ieee80211_encap(struct ieee80211_node *, struct mbuf *);
+int ieee80211_send_mgmt(struct ieee80211_node *, int, int);
+struct ieee80211_appie;
int ieee80211_send_probereq(struct ieee80211_node *ni,
const uint8_t sa[IEEE80211_ADDR_LEN],
const uint8_t da[IEEE80211_ADDR_LEN],
const uint8_t bssid[IEEE80211_ADDR_LEN],
- const uint8_t *ssid, size_t ssidlen,
- const void *optie, size_t optielen);
-int ieee80211_classify(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *);
-struct mbuf *ieee80211_encap(struct ieee80211com *, struct mbuf *,
- struct ieee80211_node *);
+ const uint8_t *ssid, size_t ssidlen);
+/*
+ * The formation of ProbeResponse frames requires guidance to
+ * deal with legacy clients. When the client is identified as
+ * "legacy 11b" ieee80211_send_proberesp is passed this token.
+ */
+#define IEEE80211_SEND_LEGACY_11B 0x1 /* legacy 11b client */
+#define IEEE80211_SEND_LEGACY_11 0x2 /* other legacy client */
+#define IEEE80211_SEND_LEGACY 0x3 /* any legacy client */
+struct mbuf *ieee80211_alloc_proberesp(struct ieee80211_node *, int);
+int ieee80211_send_proberesp(struct ieee80211vap *,
+ const uint8_t da[IEEE80211_ADDR_LEN], int);
+struct mbuf *ieee80211_alloc_rts(struct ieee80211com *ic,
+ const uint8_t [IEEE80211_ADDR_LEN],
+ const uint8_t [IEEE80211_ADDR_LEN], uint16_t);
+struct mbuf *ieee80211_alloc_cts(struct ieee80211com *,
+ const uint8_t [IEEE80211_ADDR_LEN], uint16_t);
void ieee80211_reset_erp(struct ieee80211com *);
void ieee80211_set_shortslottime(struct ieee80211com *, int onoff);
-int ieee80211_iserp_rateset(struct ieee80211com *,
- struct ieee80211_rateset *);
-void ieee80211_set11gbasicrates(struct ieee80211_rateset *,
+int ieee80211_iserp_rateset(const struct ieee80211_rateset *);
+void ieee80211_setbasicrates(struct ieee80211_rateset *,
+ enum ieee80211_phymode);
+void ieee80211_addbasicrates(struct ieee80211_rateset *,
enum ieee80211_phymode);
/*
@@ -146,16 +148,16 @@ ieee80211_anyhdrsize(const void *data)
/*
* Template for an in-kernel authenticator. Authenticators
* register with the protocol code and are typically loaded
- * as separate modules as needed.
+ * as separate modules as needed. One special authenticator
+ * is xauth; it intercepts requests so that protocols like
+ * WPA can be handled in user space.
*/
struct ieee80211_authenticator {
const char *ia_name; /* printable name */
- int (*ia_attach)(struct ieee80211com *);
- void (*ia_detach)(struct ieee80211com *);
- void (*ia_node_join)(struct ieee80211com *,
- struct ieee80211_node *);
- void (*ia_node_leave)(struct ieee80211com *,
- struct ieee80211_node *);
+ int (*ia_attach)(struct ieee80211vap *);
+ void (*ia_detach)(struct ieee80211vap *);
+ void (*ia_node_join)(struct ieee80211_node *);
+ void (*ia_node_leave)(struct ieee80211_node *);
};
void ieee80211_authenticator_register(int type,
const struct ieee80211_authenticator *);
@@ -166,23 +168,23 @@ struct ieee80211req;
/*
* Template for an MAC ACL policy module. Such modules
* register with the protocol code and are passed the sender's
- * address of each received frame for validation.
+ * address of each received auth frame for validation.
*/
struct ieee80211_aclator {
const char *iac_name; /* printable name */
- int (*iac_attach)(struct ieee80211com *);
- void (*iac_detach)(struct ieee80211com *);
- int (*iac_check)(struct ieee80211com *,
+ int (*iac_attach)(struct ieee80211vap *);
+ void (*iac_detach)(struct ieee80211vap *);
+ int (*iac_check)(struct ieee80211vap *,
const uint8_t mac[IEEE80211_ADDR_LEN]);
- int (*iac_add)(struct ieee80211com *,
+ int (*iac_add)(struct ieee80211vap *,
const uint8_t mac[IEEE80211_ADDR_LEN]);
- int (*iac_remove)(struct ieee80211com *,
+ int (*iac_remove)(struct ieee80211vap *,
const uint8_t mac[IEEE80211_ADDR_LEN]);
- int (*iac_flush)(struct ieee80211com *);
- int (*iac_setpolicy)(struct ieee80211com *, int);
- int (*iac_getpolicy)(struct ieee80211com *);
- int (*iac_setioctl)(struct ieee80211com *, struct ieee80211req *);
- int (*iac_getioctl)(struct ieee80211com *, struct ieee80211req *);
+ int (*iac_flush)(struct ieee80211vap *);
+ int (*iac_setpolicy)(struct ieee80211vap *, int);
+ int (*iac_getpolicy)(struct ieee80211vap *);
+ int (*iac_setioctl)(struct ieee80211vap *, struct ieee80211req *);
+ int (*iac_getioctl)(struct ieee80211vap *, struct ieee80211req *);
};
void ieee80211_aclator_register(const struct ieee80211_aclator *);
void ieee80211_aclator_unregister(const struct ieee80211_aclator *);
@@ -190,11 +192,12 @@ const struct ieee80211_aclator *ieee80211_aclator_get(const char *name);
/* flags for ieee80211_fix_rate() */
#define IEEE80211_F_DOSORT 0x00000001 /* sort rate list */
-#define IEEE80211_F_DOFRATE 0x00000002 /* use fixed rate */
+#define IEEE80211_F_DOFRATE 0x00000002 /* use fixed legacy rate */
#define IEEE80211_F_DONEGO 0x00000004 /* calc negotiated rate */
#define IEEE80211_F_DODEL 0x00000008 /* delete ignore rate */
#define IEEE80211_F_DOBRS 0x00000010 /* check basic rate set */
#define IEEE80211_F_JOIN 0x00000020 /* sta joining our bss */
+#define IEEE80211_F_DOFMCS 0x00000040 /* use fixed HT rate */
int ieee80211_fix_rate(struct ieee80211_node *,
struct ieee80211_rateset *, int);
@@ -233,15 +236,38 @@ struct ieee80211_wme_state {
int (*wme_update)(struct ieee80211com *);
};
-void ieee80211_wme_initparams(struct ieee80211com *);
-void ieee80211_wme_updateparams(struct ieee80211com *);
-void ieee80211_wme_updateparams_locked(struct ieee80211com *);
+void ieee80211_wme_initparams(struct ieee80211vap *);
+void ieee80211_wme_updateparams(struct ieee80211vap *);
+void ieee80211_wme_updateparams_locked(struct ieee80211vap *);
+
+/*
+ * Return the WME TID from a QoS frame. If no TID
+ * is present return the index for the "non-QoS" entry.
+ */
+static __inline uint8_t
+ieee80211_gettid(const struct ieee80211_frame *wh)
+{
+ uint8_t tid;
+
+ if (IEEE80211_QOS_HAS_SEQ(wh)) {
+ tid = ((const struct ieee80211_qosframe *)wh)->
+ i_qos[0] & IEEE80211_QOS_TID;
+ tid++;
+ } else
+ tid = IEEE80211_NONQOS_TID;
+ return tid;
+}
-#define ieee80211_new_state(_ic, _nstate, _arg) \
- (((_ic)->ic_newstate)((_ic), (_nstate), (_arg)))
-int ieee80211_init(struct ieee80211com *, int forcescan);
-void ieee80211_dturbo_switch(struct ieee80211com *, int newflags);
+void ieee80211_start_locked(struct ieee80211vap *);
+void ieee80211_init(void *);
+void ieee80211_start_all(struct ieee80211com *);
+void ieee80211_stop_locked(struct ieee80211vap *);
+void ieee80211_stop(struct ieee80211vap *);
+void ieee80211_stop_all(struct ieee80211com *);
+void ieee80211_dturbo_switch(struct ieee80211vap *, int newflags);
+void ieee80211_swbmiss(void *arg);
void ieee80211_beacon_miss(struct ieee80211com *);
+int ieee80211_new_state(struct ieee80211vap *, enum ieee80211_state, int);
void ieee80211_print_essid(const uint8_t *, int);
void ieee80211_dump_pkt(struct ieee80211com *,
const uint8_t *, int, int, int);
@@ -275,7 +301,7 @@ struct mbuf *ieee80211_beacon_alloc(struct ieee80211_node *,
struct ieee80211_beacon_offsets *);
/*
- * Beacon frame updates are signaled through calls to ic_update_beacon
+ * Beacon frame updates are signaled through calls to iv_update_beacon
* with one of the IEEE80211_BEACON_* tokens defined below. For devices
* that construct beacon frames on the host this can trigger a rebuild
* or defer the processing. For devices that offload beacon frame
@@ -283,7 +309,7 @@ struct mbuf *ieee80211_beacon_alloc(struct ieee80211_node *,
* array in the ieee80211_beacon_offsets structure is intended to record
* deferred processing requirements; ieee80211_beacon_update uses the
* state to optimize work. Since this structure is owned by the driver
- * and not visible to the 802.11 layer drivers must supply an ic_update_beacon
+ * and not visible to the 802.11 layer drivers must supply an iv_update_beacon
* callback that marks the flag bits and schedules (as necessary) an update.
*/
enum {
@@ -299,14 +325,36 @@ enum {
int ieee80211_beacon_update(struct ieee80211_node *,
struct ieee80211_beacon_offsets *, struct mbuf *, int mcast);
+void ieee80211_csa_startswitch(struct ieee80211com *,
+ struct ieee80211_channel *, int mode, int count);
+void ieee80211_csa_completeswitch(struct ieee80211com *);
+void ieee80211_cac_completeswitch(struct ieee80211vap *);
+
/*
* Notification methods called from the 802.11 state machine.
* Note that while these are defined here, their implementation
* is OS-specific.
*/
-void ieee80211_notify_node_join(struct ieee80211com *,
- struct ieee80211_node *, int newassoc);
-void ieee80211_notify_node_leave(struct ieee80211com *,
- struct ieee80211_node *);
-void ieee80211_notify_scan_done(struct ieee80211com *);
+void ieee80211_notify_node_join(struct ieee80211_node *, int newassoc);
+void ieee80211_notify_node_leave(struct ieee80211_node *);
+void ieee80211_notify_scan_done(struct ieee80211vap *);
+void ieee80211_notify_wds_discover(struct ieee80211_node *);
+void ieee80211_notify_csa(struct ieee80211com *,
+ const struct ieee80211_channel *, int mode, int count);
+void ieee80211_notify_radar(struct ieee80211com *,
+ const struct ieee80211_channel *);
+enum ieee80211_notify_cac_event {
+ IEEE80211_NOTIFY_CAC_START = 0, /* CAC timer started */
+ IEEE80211_NOTIFY_CAC_STOP = 1, /* CAC intentionally stopped */
+ IEEE80211_NOTIFY_CAC_RADAR = 2, /* CAC stopped due to radar detectio */
+ IEEE80211_NOTIFY_CAC_EXPIRE = 3, /* CAC expired w/o radar */
+};
+void ieee80211_notify_cac(struct ieee80211com *,
+ const struct ieee80211_channel *,
+ enum ieee80211_notify_cac_event);
+void ieee80211_notify_node_deauth(struct ieee80211_node *);
+void ieee80211_notify_node_auth(struct ieee80211_node *);
+void ieee80211_notify_country(struct ieee80211vap *, const uint8_t [],
+ const uint8_t cc[2]);
+void ieee80211_notify_radio(struct ieee80211com *, int);
#endif /* _NET80211_IEEE80211_PROTO_H_ */