#
32176cfd |
| 18-Feb-2010 |
Rui Paulo <rpaulo@FreeBSD.org> |
First pass at converting the net80211 infrastrcture from FreeBSD.
|
#
a3dd34d2 |
| 05-Apr-2009 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
Split ifnet serialize step 1/many: Add if_{serialize,deserialize,tryserialize}() function pointers to ifnet.
These three function pointers accept ifnet struct and ifnet_serialize enumeration.
The i
Split ifnet serialize step 1/many: Add if_{serialize,deserialize,tryserialize}() function pointers to ifnet.
These three function pointers accept ifnet struct and ifnet_serialize enumeration.
The ifnet_serialize enumeration indicates the serialization type: IFNET_SERIALIZE_ALL: All of the serializers should be held. Except for if_start and if_input, this enumeration must be used when call ifnet function pointers. IFNET_SERIALIZE_TX: Only transmit serializer should be held. This enumeration could be used when calling ifnet.if_start. IFNET_SERIALIZE_RX: Only receive serializer should be held. This enumeration could be used when calling ifnet.if_input.
If the NIC driver does not set these three function pointer, then if_attach() will set them to the default ones: only one serializer (if_serializer) is used and ifnet_serialize parameter is ignored.
Following several inline functions are added which are sheer wrappers of the three ifnet serialize function pointers: ifnet_serialize_{all,tx,rx}() ifnet_deserialize_{all,tx,rx}() ifnet_tryserialize_{all,tx,rx}()
All of the protocol layers and most of the pseudo drivers are converted.
Discussed-with: dillon@
show more ...
|
#
846cf0bc |
| 26-Apr-2007 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
- Factor out ieee80211_reset_state() from ieee80211_newstate(), so 802.11 layer can clean up its internal state machine without state changing or going through driver code. - Merge sta_disassoc()
- Factor out ieee80211_reset_state() from ieee80211_newstate(), so 802.11 layer can clean up its internal state machine without state changing or going through driver code. - Merge sta_disassoc() and sta_disauth() into sta_disconnect(), which sends disassoc to associated STA and deauth to authenticating STA. - Call ieee80211_reset_state(), if operational mode is going to be changed, so we will do a proper state machine clean up. In the original way, if we are acting as AP and switch directly to act as STA, we will send out wrong management frames. - Call ieee80211_reset_state(), if PHY is going to be changed. This prevents panic (due to a proper assertion) under following scenario: o Current PHY of the AP is 11b. o An 11b STA joins the BSS created by the AP. Since AP's current PHY is 11b, this STA will not be counted as long slot time STA, i.e. long slot time STA count left untouched. o Switch AP's PHY to 11g. AP will panick (long slot time STA count is zero, while there is a long slot time STA associated, in ieee80211_node_leave_11g()). The assertion fails, because 802.11 state machine is doing its clean up as if AP were using 11g PHY, but it actually used 11b PHY.
show more ...
|
#
23d1bc3a |
| 22-Apr-2007 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
Const-fy rate set argument of ieee80211_iserp_rateset().
|
#
c0563bfe |
| 16-Mar-2007 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
Make libpcap parse following expressions, so tcpdump can filter 802.11 frames based on frame types and/or subtypes: tcpdump -ni wifi_iface -y ieee802_11 wlan type TYPE tcpdump -ni wifi_iface -y ieee8
Make libpcap parse following expressions, so tcpdump can filter 802.11 frames based on frame types and/or subtypes: tcpdump -ni wifi_iface -y ieee802_11 wlan type TYPE tcpdump -ni wifi_iface -y ieee802_11 wlan type TYPE subtype SUBTYPE tcpdump -ni wifi_iface -y ieee802_11 wlan subtype SUBTYPE
Thank Sam Leffer to point out that libpcap supports dynamic link layer headers.
# This commit has been merged into main stream code, so local patches can # be nuked upon next vendor release updating.
show more ...
|
#
31358101 |
| 02-Jan-2007 |
Sascha Wildner <swildner@dragonflybsd.org> |
[committed on behalf of sephe]
- Fix ieee80211_node leakage. The leakage is caused by calling IF_DRAIN() on management ifqueue whose mbuf's m_pkthdr.rcvif has special meaning: it holds ieee8021
[committed on behalf of sephe]
- Fix ieee80211_node leakage. The leakage is caused by calling IF_DRAIN() on management ifqueue whose mbuf's m_pkthdr.rcvif has special meaning: it holds ieee80211_node to which the management frame should be sent and the node has its reference count bumped. Add a new function ieee80211_drain_mgtq(), which frees ieee80211_node pointed by mbuf's m_pkthdr.rcvif before freeing the mbuf. Use this function to drain management ifqueue instead of IF_DRAIN(). - In acx(4), ipw(4), ral(4) and rum(4) 'stop' routines, move ieee80211_new_state(IEEE80211_S_INIT) before clearing IFF_RUNNING in ifnet.if_flags, so these drivers may send out management frames injected by ieee80211_newstate(IEEE80211_S_INIT). (*)
# (*) Without proper hardware TX queue drain functionality, the management # frames injected by ieee80211_newstate(IEEE80211_S_INIT) almost no # chance to float in the air.
show more ...
|
#
9639b71d |
| 01-Jan-2007 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
- In ieee80211_setmode(), don't mark basic rates on ieee80211com.ic_sup_rates. The basic rates will be marked on ieee80211com.ic_sup_rates once we get the BSS' basic rate set, in ieee80211_sta_jo
- In ieee80211_setmode(), don't mark basic rates on ieee80211com.ic_sup_rates. The basic rates will be marked on ieee80211com.ic_sup_rates once we get the BSS' basic rate set, in ieee80211_sta_join(). - Rename ieee80211_set11gbasicrates() to ieee80211_set_basicrates(). Add additional parameter to indicate whether we are using Pure G or not. - In ieee80211_set_basicrates(): o Extend basic rate set array by adding items for Turbo G mode (mixed 11B/G basic rates) and Turbo A mode (11A mandatory rates). o Add an assertion to make sure we will not go beyond the end of the basic rate set array. o Use a seperate constant for Pure G basic rate set. o If 'mode' is 11G or Turbo G, and Pure G is required, use Pure G's basic rate set, instead of mixed 11B/G basic rate set. This makes a standard conforming 11B STA not try joining a Pure G BSS created by us. - In ieee80211_recv_mgmt(): o Send probe response even if rate negotiation fails. According to IEEE Std 802.11, 1999 Edition, subclause 11.1.3.2.1: .... STAs, subject to criteria below, receiving Probe Request frames shall respond with a probe response only if the SSID in the probe request is the broadcast SSID or matches the specific SSID of the STA. ... ... An AP shall respond to all probe requests meeting the above criteria. In an IBSS, the STA that generated the last beacon shall be the STA that responds to a probe request. ....
If we reach the rate negotiation step, then the "criteria" outlined by the standard is already met. o Don't do rate negotiation for temporary nodes, which are created just for sending probe responses. This may save us some cpu time. - Reset NIC for Pure G change, only if opmode is HOSTAP or IBSS(*), and phy mode is either Turbo G or 11G. - Don't allocate TX rate control data for temporary nodes, since they will be reclaimed immediately after management frames are sent.
# (*) Actually, for IBSS opmode, we need to reset the NIC iff we are the only # member of the current IBSS.
show more ...
|
#
208a1285 |
| 23-Dec-2006 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
Massive 802_11 XRATE bug fixing.
- Correct ieee80211_fix_rate(IEEE80211_F_DODEL) operation by entering IEEE80211_F_DONEGO code segment but avoiding real negotiation. - In ieee80211_fix_rate(), rem
Massive 802_11 XRATE bug fixing.
- Correct ieee80211_fix_rate(IEEE80211_F_DODEL) operation by entering IEEE80211_F_DONEGO code segment but avoiding real negotiation. - In ieee80211_fix_rate(), remove duplicated rates if rate set is to be sorted. This should be enough to protect us against maliciously minted 802.11 management frames which contain supported rate and extended supported rate ies. [*] - In ieee80211_sta_join(), call ieee80211_fix_rate(IEEE80211_F_DODEL), if the wireless NIC operates in STA mode. So drivers can depend on ieee80211com.ic_bss's ni_rates even before entering RUN state, this is *very important* for certain driver e.g. iwi(4) [*]. - Add ic_nbasicrates in ieee80211com, which records the number of basic rates in the current BSS. [1] - Add a new function ieee80211_copy_basicrates(). This function is used to propagate IEEE80211_RATE_BASIC bit from second parameter to the first parameter. It will return number of basic rates in the second parameter. It is called in ieee80211_sta_join() to properly setup basic rates in ieee80211com.ic_sup_rates and ieee80211com.ic_nbasicrates. [2] - Introduce extra parameter to ieee80211_setup_rates() and ieee80211_fix_rate(). This parameter only affects how IEEE80211_F_DONEGO is done. Adjust IEEE80211_F_DONEGO behavior after introducing this parameter: If the new parameter is 1, then the negotiation is performed on the behalf of a STA which wants to join either an infrastructured or an independent BSS, and the rate set going to be negotiated is the BSS's supported rate set: o Don't overwrite the BSS basic rate set. So drivers and TX rate control algorithm can have knowledge of the BSS basic rate set and can do various setting accordingly. o Avoid joining the BSS, if certain rates in the BSS basic rate set are not supported. If the new parameter is 0, then the negotiation is performed on the behalf of a HOSTAP, or a STA that already joined/started an independent BSS, and the rate set going to be negotiated is peer STA's supported rate set: o Overwrite the basic rates of peer STA's supported rate set with basic rates in ieee80211com.ic_sup_rates, which is set up properly in ieee80211_sta_join() by ieee80211_copy_basicrates() (see [2]), so TX rate control algorithm can act accordingly. o If the current operation mode is IEEE80211_M_HOSTAP, use a counter to bookkeep how many basic rates got overwritten during negotiation. If at the end of the negotiation the counter is less than ieee80211com.ic_nbasicrates (see [1] and [2]), then it means that the peer STA does not support certain rates in our basic rate set. This kind of STA should not be allowed to join the current BSS. This prevention mechanism should be more straightforword than the old one in ieee80211_recv_mgmt(), nuke the old prevention mechanism after this change. - In ieee80211_init_neighbor(), do full rate set negotiation, so nodes created by ieee80211_add_neighbor() or ieee80211_fakeup_adhoc_node(), will not contain rates that the wireless NIC does not support. - In ieee80211_{beacon,probe_resp}_alloc(), use ieee80211com.ic_sup_rates to setup supported rates and extended supported rates ie, instead of using ieee80211com.ic_bss's ni_rates. So two 11g STAs in a 11g/11b mixed IBSS can comunicate with each other using OFDM rates, given proper protection, like RTS-CTS/CTS-to-self, is applied. [**] - In ieee80211_send_mgmt(), use ieee80211com.ic_sup_rates to create supported rates and extended supported rates ie of (re)association response. So these ies are consistent with what's in beacon and probe response. [**] - In ieee80211_send_mgmt(), use ieee80211_probe_resp_alloc() to create frame body of probe response. - Add more XRATE debug messages.
# # [*] Details: # http://lists.freebsd.org/pipermail/freebsd-current/2006-October/066679.html # # [**] Basic rates in ieee80211com.ic_sup_rates are set beforehand (see [2]) #
show more ...
|
#
a6ec04bc |
| 22-Dec-2006 |
Sascha Wildner <swildner@dragonflybsd.org> |
Rename printf -> kprintf in sys/ and add some defines where necessary (files which are used in userland, too).
|
#
476d885d |
| 15-Dec-2006 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
- Factor out ieee80211_print_rateset(). - Add a debug macro: IEEE80211_PRINT_NODERATES(). Replace two almost same debug code segments with it.
|
#
ab0665aa |
| 26-Nov-2006 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
- Factor out front part of ieee80211_set_shortpreamble() into ieee80211_update_shpreamble(). So that the former only turns on/off short preamble and informs driver about the changes, while the
- Factor out front part of ieee80211_set_shortpreamble() into ieee80211_update_shpreamble(). So that the former only turns on/off short preamble and informs driver about the changes, while the latter makes the decision whether short preamble should be turned on or off. - Replace rest of the places where short preamble is turned on/off manually with ieee80211_set_shortpreamble() - For associated STAs, update short preamble state only when related fields of ERP information or capability information in received beacons are changed
show more ...
|
#
da9c2b36 |
| 25-Nov-2006 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
Correct short preamble support.
Problems: - The assumption that "Short Preamble" field in "Capability information" will not be changed, is not correct at least for a *BSD based HostAP - "Barker Pr
Correct short preamble support.
Problems: - The assumption that "Short Preamble" field in "Capability information" will not be changed, is not correct at least for a *BSD based HostAP - "Barker Preamble mode" in "EPR information" is ignored
Fixes: - Add a new function ieee80211_set_shortpreamble() (named after its relative ieee80211_set_shortslot()): 1) For 11a mode, always turn on short preamble, though it is not used under 11a mode 2) For 11g mode (ERP), turn on short preamble iff all of the following conditions are met: o "Short Preamble" field in "Capability information" is 1 o "Barker Preamble mode" in "ERP information" is 0 [*] o ieee80211.ic_caps has IEEE80211_C_PREAMBLE set 3) For the reset of the mode (11b?), turn on short preamble iff all of the following conditions are met: o "Short Preamble" field in "Capability information" is 1 o ieee80211.ic_caps has IEEE80211_C_PREAMBLE set - Add ieee80211com.ic_upadate_preamble. This field could be set by drivers which want to be informed about the preamble changes
# # [*] # IEEE Std 802.11g-2003 subclause 7.3.2.13 page 10: # ... # ... # ERP APs and ERP STAs shall use long preambles when transmitting Clause 15, # Clause 18, and Clause 19 frames after transmission or reception of an ERP # Information Element with a Barker_Preamble_Mode value of 1 in an MMPDU to # or from the BSS that the ERP AP or ERP STA has joined or started, regardless # of the value of the short preamble capability bit from the same received or # transmitted MMPDU that contained the ERP Information Element ... # ... # ... #
show more ...
|
#
841ab66c |
| 18-May-2006 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
Sync 802.11 support with FreeBSD6: "it includes completed 802.11g, WPA, 802.11i, 802.1x, WME/WMM, AP-side power-save, crypto plugin framework, authenticator plugin framework, and access
Sync 802.11 support with FreeBSD6: "it includes completed 802.11g, WPA, 802.11i, 802.1x, WME/WMM, AP-side power-save, crypto plugin framework, authenticator plugin framework, and access control plugin frameowrk."
Reoriganize the layout of netproto/802_11: put generic 802.11 layer, crypto modules, authentication module and access control module into their own directories. Header files are still in their original place.
Nuke all of the mutexing in generic 802.11, reorganize ieee80211_node table scanning a little bit.
Rename FreeBSD's m_append() to ieee80211_mbuf_append(), rename FreeBSD's m_unshare() to ieee80211_mbuf_clone() and put them into netproto/802_11/wlan/ieee80211_dragonly.c They are not generic enough for public using, at least for now. Pointed-out-by: hsu
Expose ieee80211_add_{ssid, xrates, rates}() which are used by acx(4)
Keep using opencrypto's AES implmentation for 802.11 CCMP crypto module
Sync ifconfig(8)'s 802.11 support with FreeBSD6
Update acx(4) and ndis(4) for the new 802.11 support
Sync iwi(4), ipw(4), wi(4) and ray(4) with FreeBSD6
For iwi(4): - Fix ieee80211_node leakage - Use a bitmap instead of FreeBSD's "unit number alloctor" to allocate IBSS node
Add generic 802.11 layer and crypto modules into GENERIC and LINT, authentication module and access module are only added to LINT
Unhook awi(4) from GENERIC and LINT temporarily, since as of this commit it is broken :( It will be fixed sometime later.
Thank Sam Leffler and many other people for their work on 802.11 support.
Thank Andrew Atrens and Adrian Michael Nida for submitting the patch.
Thank all the people that helped testing 802.11 patches for this commit
Based-on-Patch-Submitted-by: Andrew Atrens <atrens@nortelnetworks.com> Adrian Michael Nida <nida@musc.edu>
Tested-by: Thomas Schlesinger <schlesinger@netcologne.de> Johannes Hofmann <Johannes.Hofmann@gmx.de> Andrew Thompson <andrew@hijacked.us> Erik Wikström <erik-wikstrom@telia.com>
show more ...
|
#
f186073c |
| 26-Jul-2004 |
Joerg Sonnenberger <joerg@dragonflybsd.org> |
Import generic 802.11 layer.
Choose netproto/802_11 instead of net80211 as source location.
Use token API instead mutexing. The locking heavenly depends on atomic Operations and needs additional wo
Import generic 802.11 layer.
Choose netproto/802_11 instead of net80211 as source location.
Use token API instead mutexing. The locking heavenly depends on atomic Operations and needs additional work.
Use POSIX int types.
Add dev/wi/if_wavelan_ieee.h as netproto/802_11/if_wavelan_ieee.h, since this is used by all wireless interfaces and beside the variable and constant naming mostly wi(4) indepedent.
Obtained-from: FreeBSD
show more ...
|