Commit Graph

21 Commits

Author SHA1 Message Date
Sam Leffler
32346d607a make malloc tag for ieee80211_node more recognizable 2004-04-05 04:15:55 +00:00
Sam Leffler
750d6d0c60 fix adhoc/ibss operation for drivers that require host support (e.g. ath):
o remove IEEE80211_C_RCVMGT capability
o on transmit craft new nodes as needed using new ieee80211_find_txnode routine
o add ieee80211_find_txnode routine to lookup a node by mac address and
  if not present create one when operating in ibss/ahdemo mode; new nodes
  are dup'd from bss and the driver is told to treat the node as if a new
  association has been created so driver-private state (e.g. rate control
  handling) is setup

Obtained from:	netbsd (basic idea)
2004-04-02 23:25:39 +00:00
Sam Leffler
694dca643b o change ieee80211_dup_bss to inherit explicit data from ic_bss instead of
blindy copying the node contents; this turns out to be a bad idea as we
  add more state in the node for things like WPA
o track node allocation failures in ieee80211_dup_bss instead of the callers

Obtained from:	madwifi
2004-04-02 23:09:24 +00:00
Sam Leffler
c64bfa0f8f track node allocation failure stats in ieee80211_alloc_node instead
of each caller

Obtained from:	madwifi
2004-04-02 23:06:41 +00:00
Sam Leffler
410ca74bb8 replace explicit malloc/free with MALLOC/FREE for portability
Obtained from:	madwifi
2004-04-02 23:02:24 +00:00
Sam Leffler
b4c5a90fee extract node matching logic into new ieee80211_match_bss routine for use
in background/incremental scanning

Obtained from:	madwifi
2004-04-02 23:00:30 +00:00
Sam Leffler
849b898054 diff reduction against madwifi 2004-04-02 22:56:09 +00:00
Sam Leffler
2e79ca9762 o add support for controlling the power of transmitted frames
o add support for controlling the 11g protection mechanism used
  to protect OFDM frames in a mixed 11b/g network

Reviewed by:	imp
2004-03-30 22:57:57 +00:00
Sam Leffler
bca1062ba5 fix typo that broke AP scanning by BSSID
Submitted by:	Len Widra
2003-11-09 23:36:46 +00:00
Brooks Davis
9bf40ede4a Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)
2003-10-31 18:32:15 +00:00
Sam Leffler
1be50176db add statistics for all failures and/or abnormal events; still need
to add per-node statistics
2003-10-17 23:15:30 +00:00
Sam Leffler
1e343b38be parameterize locking to improve portability and possible
change to different locking strategies
2003-10-17 21:41:52 +00:00
Sam Leffler
303ebc3c87 Try yet again to deal with timing out nodes. We cannot hold the
node lock while sending a management frame as this will potentially
result in a LOR with a driver lock.  This doesn't happen for the
Atheros driver but does for the wi driver.  Use a generation number
to help process each node once when scanning the node table and
drop the node lock if we need to timeout a node and send a frame.
2003-09-26 17:00:44 +00:00
Sam Leffler
37c150c4a6 allocate node table entries with a specific malloc type 2003-09-26 16:52:12 +00:00
Sam Leffler
d1e61976a0 Generalize the per-node RSSI data so drivers can do more interesting
things than record a single value.

o add a per-node method for returning the "current RSSI" for a node
o create a default method that returns ni_rssi which is the rssi for
  the last received frame
o use the per-node "get rssi" method to return data for the RID's
  submitted by wicontrol, et. al.

Loosely based on work by Tom Marshall <tommy@home.tig-grr.com> for MADWIFI.
2003-09-15 22:28:07 +00:00
Sam Leffler
0a915fad5d MFp4 changes to fix locking issues and correct reference
count handling of station entries in hostap mode:

Input path:

o driver is now expected to find the node associated with the
  sender of a received frame; use ic_bss if none is located
o driver passes the (referenced) node into ieee80211_input for
  use within the wlan module and is responsible for cleaning up
  on return
o the antenna state is no longer passed up with each frame; this
  is now considered driver-private state and drivers are responsible
  for keeping it in the driver-private part of a node

Output path:

Revamp output path for management frames to eliminate redundant
locking that causes problems and to correct reference counting
bogosity that occurs when stations are timed out due to inactivity
(in AP mode).  On output the refcnt'd node is stashed in the pkthdr's
recvif field (yech) and retrieved by the driver.  This eliminates
an unref/ref scenario and related node table unlock/lock due to the
driver looking up the node.  This is particularly important when
stations are timed out as this causes a lock order reversal that
can result in a deadlock.  As a byproduct we also reduce the overhead
for sending management frames (minimal).  Additional fallout from
this is a change to ieee80211_encap to return a refcn't node for
tieing to the outbound frame.  Node refcnts are not reclaimed until
after a frame is completely processed (e.g. in the tx interrupt
handler).  This is especially important for timed out stations as
this deref will be the final one causing the node entry to be
reclaimed.

Additional semi-related changes:
o replace m_copym use with m_copypacket (optimization)
o add assert to verify ic_bss is never free'd during normal operation
o add comments explaining calling conventions by drivers for frames
  going in each direction
o remove extraneous code that "cannot be executed" (e.g. because
  pointers may never be null)
2003-08-19 22:17:04 +00:00
Sam Leffler
2692bb26d4 Delay creating ic_bss until after the super-class has a chance
to override the method pointers for manipulating nodes; this fixes
a problem where the ic_bss node was not being created properly
for the ath driver causing the driver to scribble on random memory.

Noticed by:	David Young <dyoung@pobox.com>
2003-08-13 22:09:44 +00:00
Sam Leffler
a11c9a5cc2 o change ieee80211_new_state handling to use a proper method that drivers
override in their sub-class; this eliminates the hack of interpreting the
  EINPROGRESS return value to mean "don't do any of the normal work"
o correct active scanning so the first channel is only scanned once and so
  per-channel passive mode is properly honored
o expose 802.11 FSM state names so every driver doesn't keep a private copy
o eliminate node parameter to ieee80211_begin_scan; it was not being used
2003-07-20 21:36:08 +00:00
Sam Leffler
58f40303c4 insure ic_bss always has a "valid" channel; avoids problems where users could
query the state of a card and find a null channel since allocating the node
left ni_chan zero
2003-06-29 20:13:38 +00:00
Sam Leffler
7535e66acd revise copyright notices per discussion with Atsushi Onoe <onoe@sm.sony.co.jp> 2003-06-27 05:13:52 +00:00
Sam Leffler
1a1e1d2157 new 802.11 layer:
o code reorg (relative to old netbsd-derived code) for future growth
o drivers now specify available channels and rates and 802.11 layer handles
  almost all ifmedia actions
o multi-mode support for 11a/b/g devices
o 11g protocol additions (incomplete)
o new element id additions (for other than 11g)
o node/station table redone for proper locking and to eliminate driver
  incestuousness
o split device flags and capabilities to reduce confusion and provide room
  for expansion
o incomplete power management infrastructure (need to revisit)
o incomplete hooks for software retry
o more...
2003-06-23 16:55:01 +00:00