FreeBSD kernel WLAN code
ieee80211_adhoc.c File Reference
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_wlan.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/endian.h>
#include <sys/errno.h>
#include <sys/proc.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_media.h>
#include <net/if_llc.h>
#include <net/ethernet.h>
#include <net/bpf.h>
#include <net80211/ieee80211_var.h>
#include <net80211/ieee80211_adhoc.h>
#include <net80211/ieee80211_input.h>
#include <net80211/ieee80211_sta.h>
Include dependency graph for ieee80211_adhoc.c:

Go to the source code of this file.

Macros

#define IEEE80211_RATE2MBS(r)   (((r) & IEEE80211_RATE_VAL) / 2)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static void adhoc_vattach (struct ieee80211vap *)
 
static int adhoc_newstate (struct ieee80211vap *, enum ieee80211_state, int)
 
static int adhoc_input (struct ieee80211_node *, struct mbuf *, const struct ieee80211_rx_stats *, int, int)
 
static void adhoc_recv_mgmt (struct ieee80211_node *, struct mbuf *, int subtype, const struct ieee80211_rx_stats *, int, int)
 
static void ahdemo_recv_mgmt (struct ieee80211_node *, struct mbuf *, int subtype, const struct ieee80211_rx_stats *rxs, int, int)
 
static void adhoc_recv_ctl (struct ieee80211_node *, struct mbuf *, int subtype)
 
void ieee80211_adhoc_attach (struct ieee80211com *ic)
 
void ieee80211_adhoc_detach (struct ieee80211com *ic)
 
static void adhoc_vdetach (struct ieee80211vap *vap)
 
static void sta_leave (void *arg, struct ieee80211_node *ni)
 
static __inline int doprint (struct ieee80211vap *vap, int subtype)
 
static int is11bclient (const uint8_t *rates, const uint8_t *xrates)
 

Macro Definition Documentation

◆ IEEE80211_RATE2MBS

#define IEEE80211_RATE2MBS (   r)    (((r) & IEEE80211_RATE_VAL) / 2)

Definition at line 71 of file ieee80211_adhoc.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ adhoc_input()

static int adhoc_input ( struct ieee80211_node ni,
struct mbuf *  m,
const struct ieee80211_rx_stats rxs,
int  rssi,
int  nf 
)
static

Definition at line 309 of file ieee80211_adhoc.c.

References ieee80211_rx_stats::c_pktflags, doprint(), ieee80211_frame::i_addr1, ieee80211_frame::i_addr2, ieee80211_frame::i_addr3, ieee80211_frame::i_fc, ieee80211com::ic_flags, ieee80211com::ic_wme, IEEE80211_ADDR_EQ, ieee80211_ampdu_reorder(), ieee80211_check_rxseq(), ieee80211_crypto_decap(), ieee80211_crypto_demic(), ieee80211_decap(), ieee80211_decap_amsdu(), ieee80211_decap_fastframe(), ieee80211_defrag(), ieee80211_deliver_data(), IEEE80211_DISCARD, IEEE80211_DISCARD_MAC, IEEE80211_F_DROPUNENC, IEEE80211_F_PRIVACY, IEEE80211_F_SCAN, ieee80211_fakeup_adhoc_node(), IEEE80211_FC0_SUBTYPE_BEACON, IEEE80211_FC0_SUBTYPE_MASK, IEEE80211_FC0_SUBTYPE_NODATA, IEEE80211_FC0_SUBTYPE_PROBE_RESP, IEEE80211_FC0_SUBTYPE_QOS, IEEE80211_FC0_SUBTYPE_QOS_NULL, IEEE80211_FC0_TYPE_CTL, IEEE80211_FC0_TYPE_DATA, IEEE80211_FC0_TYPE_MASK, IEEE80211_FC0_TYPE_MGT, IEEE80211_FC0_VERSION_0, IEEE80211_FC0_VERSION_MASK, IEEE80211_FC1_DIR_DSTODS, IEEE80211_FC1_DIR_MASK, IEEE80211_FC1_DIR_NODS, IEEE80211_FC1_PROTECTED, ieee80211_getqos(), ieee80211_gettid(), IEEE80211_HAS_SEQ, ieee80211_hdrspace(), IEEE80211_IS_MULTICAST, ieee80211_mgt_subtype_name(), IEEE80211_MSG_ANY, ieee80211_msg_dumppkts, IEEE80211_MSG_INPUT, ieee80211_node_is_authorized(), IEEE80211_NODE_STAT, IEEE80211_QOS_AMSDU, IEEE80211_QOS_HAS_SEQ, ieee80211_radiotap_active_vap(), ieee80211_radiotap_rx(), IEEE80211_RSSI_LPF, IEEE80211_RX_F_DECRYPTED, IEEE80211_S_RUN, ieee80211_state_name, ieee80211_stats::is_rx_badstate, ieee80211_stats::is_rx_badversion, ieee80211_stats::is_rx_ctl, ieee80211_stats::is_rx_decap, ieee80211_stats::is_rx_demicfail, ieee80211_stats::is_rx_mgmt, ieee80211_stats::is_rx_mgtdiscard, ieee80211_stats::is_rx_noprivacy, ieee80211_stats::is_rx_tooshort, ieee80211_stats::is_rx_unauth, ieee80211_stats::is_rx_unencrypted, ieee80211_stats::is_rx_wrongbss, ieee80211_stats::is_rx_wrongdir, ieee80211vap::iv_bss, ieee80211vap::iv_flags, ieee80211vap::iv_ifp, ieee80211vap::iv_recv_ctl, ieee80211vap::iv_recv_mgmt, ieee80211vap::iv_state, ieee80211vap::iv_stats, M_AMPDU, M_AMPDU_MPDU, M_WEP, ieee80211_node::ni_avgrssi, ieee80211_node::ni_bssid, ieee80211_node::ni_ic, ieee80211_node::ni_inact, ieee80211_node::ni_inact_reload, ieee80211_node::ni_macaddr, ieee80211_node::ni_noise, ieee80211_node::ni_vap, ieee80211_node::ni_wdsvap, TID_TO_WME_AC, WME_AC_VI, and ieee80211_wme_state::wme_hipri_traffic.

Referenced by adhoc_vattach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ adhoc_newstate()

static int adhoc_newstate ( struct ieee80211vap vap,
enum ieee80211_state  nstate,
int  arg 
)
static

◆ adhoc_recv_ctl()

static void adhoc_recv_ctl ( struct ieee80211_node ni,
struct mbuf *  m,
int  subtype 
)
static

Definition at line 1054 of file ieee80211_adhoc.c.

References IEEE80211_FC0_SUBTYPE_BAR, and ieee80211_recv_bar().

Referenced by adhoc_vattach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ adhoc_recv_mgmt()

static void adhoc_recv_mgmt ( struct ieee80211_node ni,
struct mbuf *  m0,
int  subtype,
const struct ieee80211_rx_stats rxs,
int  rssi,
int  nf 
)
static

Definition at line 708 of file ieee80211_adhoc.c.

References ieee80211_scanparams::capinfo, ieee80211_node::data, ieee80211_scanparams::htcap, ieee80211_scanparams::htinfo, ieee80211_frame::i_addr1, ieee80211_frame::i_addr2, ieee80211_frame::i_fc, ieee80211com::ic_curchan, ieee80211com::ic_flags, ieee80211com::ic_flags_ext, ieee80211com::ic_recv_action, ieee80211_add_neighbor(), ieee80211_add_scan(), IEEE80211_ADDR_EQ, IEEE80211_CAPINFO_IBSS, IEEE80211_DISCARD, IEEE80211_DPRINTF, IEEE80211_ELEMID_RATES, IEEE80211_ELEMID_SSID, IEEE80211_ELEMID_XRATES, IEEE80211_F_HIDESSID, IEEE80211_F_SCAN, IEEE80211_FC0_SUBTYPE_ACTION, IEEE80211_FC0_SUBTYPE_ACTION_NOACK, IEEE80211_FC0_SUBTYPE_ASSOC_REQ, IEEE80211_FC0_SUBTYPE_ASSOC_RESP, IEEE80211_FC0_SUBTYPE_ATIM, IEEE80211_FC0_SUBTYPE_AUTH, IEEE80211_FC0_SUBTYPE_BEACON, IEEE80211_FC0_SUBTYPE_DEAUTH, IEEE80211_FC0_SUBTYPE_DISASSOC, IEEE80211_FC0_SUBTYPE_PROBE_REQ, IEEE80211_FC0_SUBTYPE_PROBE_RESP, IEEE80211_FC0_SUBTYPE_REASSOC_REQ, IEEE80211_FC0_SUBTYPE_REASSOC_RESP, IEEE80211_FC0_SUBTYPE_TIMING_ADV, IEEE80211_FEXT_PROBECHAN, IEEE80211_FHT_HT, ieee80211_ht_updateparams(), ieee80211_ht_updateparams_final(), ieee80211_ibss_node_check_new(), ieee80211_init_neighbor(), IEEE80211_IS_MULTICAST, ieee80211_lookup_channel_rxstatus(), IEEE80211_MSG_ANY, IEEE80211_MSG_DEBUG, IEEE80211_MSG_INPUT, IEEE80211_NODE_STAT, IEEE80211_NOTE_MAC, IEEE80211_NWID_LEN, ieee80211_parse_action(), ieee80211_parse_beacon(), ieee80211_probe_curchan(), IEEE80211_RATE_MAXSIZE, IEEE80211_RSSI_LPF, IEEE80211_S_RUN, IEEE80211_SEND_LEGACY_11B, ieee80211_send_probereq(), ieee80211_send_proberesp(), ieee80211_state_name, ieee80211_update_chw(), IEEE80211_VERIFY_ELEMENT, IEEE80211_VERIFY_LENGTH, IEEE80211_VERIFY_SSID, is11bclient(), ieee80211_stats::is_rx_badsubtype, ieee80211_stats::is_rx_beacon, ieee80211_stats::is_rx_mgtdiscard, ieee80211_stats::is_rx_ssidmismatch, ieee80211vap::iv_bss, ieee80211vap::iv_flags, ieee80211vap::iv_flags_ht, ieee80211vap::iv_myaddr, ieee80211vap::iv_state, ieee80211vap::iv_stats, ieee80211_node::ni_avgrssi, ieee80211_node::ni_bssid, ieee80211_node::ni_capinfo, ieee80211_node::ni_essid, ieee80211_node::ni_esslen, ieee80211_node::ni_ic, ieee80211_node::ni_macaddr, ieee80211_node::ni_noise, ieee80211_node::ni_tstamp, ieee80211_node::ni_vap, and ieee80211_scanparams::tstamp.

Referenced by adhoc_vattach(), and ahdemo_recv_mgmt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ adhoc_vattach()

◆ adhoc_vdetach()

static void adhoc_vdetach ( struct ieee80211vap vap)
static

Definition at line 96 of file ieee80211_adhoc.c.

Referenced by adhoc_vattach().

Here is the caller graph for this function:

◆ ahdemo_recv_mgmt()

◆ doprint()

static __inline int doprint ( struct ieee80211vap vap,
int  subtype 
)
static

Definition at line 287 of file ieee80211_adhoc.c.

References ieee80211com::ic_flags, IEEE80211_F_SCAN, IEEE80211_FC0_SUBTYPE_BEACON, IEEE80211_FC0_SUBTYPE_PROBE_REQ, and ieee80211vap::iv_ic.

Referenced by adhoc_input(), and ieee80211_mgmt_output().

Here is the caller graph for this function:

◆ ieee80211_adhoc_attach()

void ieee80211_adhoc_attach ( struct ieee80211com ic)

Definition at line 84 of file ieee80211_adhoc.c.

References adhoc_vattach(), ieee80211com::ic_vattach, IEEE80211_M_AHDEMO, and IEEE80211_M_IBSS.

Referenced by ieee80211_proto_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ieee80211_adhoc_detach()

void ieee80211_adhoc_detach ( struct ieee80211com ic)

Definition at line 91 of file ieee80211_adhoc.c.

Referenced by ieee80211_proto_detach().

Here is the caller graph for this function:

◆ is11bclient()

static int is11bclient ( const uint8_t *  rates,
const uint8_t *  xrates 
)
static

Definition at line 691 of file ieee80211_adhoc.c.

References IEEE80211_RATE_VAL.

Referenced by adhoc_recv_mgmt().

Here is the caller graph for this function:

◆ sta_leave()

static void sta_leave ( void *  arg,
struct ieee80211_node ni 
)
static

Definition at line 123 of file ieee80211_adhoc.c.

References ieee80211_node_leave(), ieee80211vap::iv_bss, and ieee80211_node::ni_vap.

Referenced by adhoc_newstate().

Here is the call graph for this function:
Here is the caller graph for this function: