Commit Graph

84 Commits

Author SHA1 Message Date
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
thorpej 67568419ee Eliminate use of M_HASFCS. 2005-01-31 03:04:25 +00:00
dyoung 5dc6377838 IBSS-merge clean-up, inspired by some Linux patches from Jon Anderson
(mail@janderson.ca): remove ieee80211_ibss_merge's TSFT argument.
Do the TSFT comparison in the drivers (ath, atw).  Remove a lot of
extraneous debug statements from ieee80211_ibss_merge.

Set the ieee80211_node's state to IEEE80211_STA_BSS after it's been
copied to the ic_bss, not before.

In struct ieee80211_node, make the ni_tstamp field a union of a
uint64_t and the 8 TSF octets so that it's easier to compare a
neighbor's TSF with the local TSF.

Log IBSS merges (Greg Troxel's suggestion).  Also log IBSS creation.
These are rare and important events that deserve to be logged.
2005-01-04 00:56:51 +00:00
mycroft 06e4fe7f62 Replace d_plcp_svc with d_residue. The latter is the number of whole
empty/unused octets to fill out the data time slot.  The value is constrained
by math to 0 for <= 5.5Mb, 0-1 for 11Mb, and 0-2 for 22Mb.  It is used to
signal to the MAC that there is residue.
2004-12-27 01:51:49 +00:00
thorpej e9818f5b5e When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
2004-10-30 18:08:34 +00:00
dyoung 8abb07d1ac Make the node table into an LRU cache: least-recently used nodes
are at the end of the node queue.  Change the reference-counting
discipline: ni->ni_refcnt indicates how many times net80211 has
granted ni to the driver.  Every node in the table with ni_refcnt=0
is eligible to be garbage-collected.  The mere presence of a node
in the table does not any longer indicate its auth/assoc state;
nodes have a ni_state variable, now.  A sysctl,
net.link.ieee80211.maxnodecache, controls the maximum LRU cache
size.

While I am here, patch ieee80211_find_node_for_beacon to do a "best
match" by bssid/ssid/channel, not a "perfect match."  This keeps
net80211 from caching duplicate nodes in the table.
2004-08-10 00:57:20 +00:00
dyoung 6f9ff5e059 Vastly simplify ieee80211_ibss_merge, eliminating the needless
callbacks.  Change the reference IBSS-merge implementation in atw
to match.
2004-07-28 08:12:49 +00:00
dyoung 24fb56e3b4 Cancel scan callout when the device detaches. Pointed out by Todd
Miller.
2004-07-27 23:57:02 +00:00
dyoung ce488d2bf7 Pull the IBSS merge logic out of atw and into net80211, since ath
will eventually share it.

In the IBSS merge logic, check conditions in a different order so
that they run faster in the common case---no merge.  Fix the
rate-limiting on the debug outputs (enabled by IFF_LINK0).
2004-07-24 23:53:49 +00:00
dyoung c743c6b066 Doh, we really do need to set bit ATW_NAR_MM in ATW_NAR, or else
no multicast packets are let through.
2004-07-24 04:59:01 +00:00
dyoung 32dee95c54 Add atw_nar_init, atw_next_scan prototypes (thanks Todd Miller)
and sort prototypes.

In-line atw_tsft.
2004-07-24 01:26:20 +00:00
mycroft f526e7326b Cleanup of ieee80211_node from madwifi:
* Don't use ifp pointers; use ieee80211com.
* Implement the locking macros that are used under FreeBSD and Linux.
2004-07-23 10:15:13 +00:00
mycroft 64f68f9cf8 Fix mismerge. 2004-07-23 08:36:01 +00:00
mycroft 50d44f4f07 IEEE80211_F_WEPON -> IEEE80211_F_PRIVACY 2004-07-23 08:31:39 +00:00
dyoung f63e03e538 Instrument atw(4) delays so that I can experiment and shorten the
conservative delays that I derived from the reference driver.
2004-07-23 07:20:44 +00:00
dyoung 571aedf36b Print and store Cardbus/PCI revision number.
Begin conditioning device configuration on revision number.  Four
revisions are known:

        1.1/1.5 -> ADM8211A,
        2.0 -> ADM8211B,
        3.0 -> ADM8211C.

The B and C parts, which are not supported yet, have AP capability.
2004-07-23 07:07:55 +00:00
dyoung fe366eb669 Fix IBSS merges in atw(4). 2004-07-23 06:57:50 +00:00
dyoung 72cea14142 Use the new SRAM size constants. 2004-07-23 05:06:26 +00:00
dyoung 084b007d1b The RSSI field in the Rx descriptor is the unadulterated content
of the DIVCTL/RSSI register on the RF3000 baseband.  Mask all but
the RSSI bits.
2004-07-16 23:13:27 +00:00
dyoung 0f8b8b27c5 Insist that callers use atw_write_sram to copy even-length buffers
to even offsets in the ADM8211 SRAM.

assert->KASSERT
2004-07-15 07:31:05 +00:00
dyoung 3341b62f3e Totally revamp device initialization using clue from the reference
driver.  I also have re-organized the code a lot.
2004-07-15 07:26:17 +00:00
dyoung 9ad89f8c4a Totally revamp device resets using clue from the reference driver. 2004-07-15 07:25:40 +00:00
dyoung d6014cf055 Make atw_read_srom static. 2004-07-15 07:25:06 +00:00
dyoung 611fc69801 Re-organize, add new, and remove old prototypes. 2004-07-15 07:22:13 +00:00
dyoung e083028d58 Once again, stop calling the bus front-end's interrupt-acknowledgement
callback.
2004-07-15 07:20:46 +00:00
dyoung d1b1d2ead4 Totally revamp the way that I program the synthesizer and baseband. 2004-07-15 07:19:46 +00:00
dyoung 3e1b8a977f Take the paranoia out of the code for writing baseband registers. 2004-07-15 07:13:44 +00:00
dyoung 7a7588432a Simplify the Rx filter setup, following the AL981 code in tlp(4). 2004-07-15 07:11:23 +00:00
dyoung 6a35b15406 Countdown correctly to the Target Beacon Transmission Time.
Borrowing an idea from the reference driver, use no 64-bit arithmetic.
2004-07-15 07:10:25 +00:00
dyoung 1146f43c7a In atw_start_beacon, set CAP0 as well as BCNT and CAP1. 2004-07-15 07:01:20 +00:00
dyoung 24e7e4403a Simplify IBSS merge code. 2004-07-15 07:00:43 +00:00
dyoung 1616cd784d Only write the SSID buffer to the ADM8211 SRAM up to the end of
the SSID, not up to the end of the buffer.  Given the (too
conservative?) delays involved, this should save some time when we
join a new network.
2004-07-15 06:53:11 +00:00
dyoung 0404143d84 Change the order in which I write the BSSID registers on the ADM8211,
to match the reference driver.  This probably does not make any
functional difference.
2004-07-15 06:50:34 +00:00
dyoung 81c734b57d Set up the Tx descriptor ring more safely. Fix an endianness bug.
"It's a wonder this ever worked."  (Actually, it's not.)
2004-07-15 06:48:45 +00:00
dyoung fce6670792 Re-synchronize TSFT after an IBSS merge. 2004-07-15 06:46:08 +00:00
dyoung 6e8ef3ee56 Delay for tens of milliseconds lot after writing the Network Access
Register.  I am slavishly imitating the reference driver, here.
I will come back and lower the delays later.
2004-07-15 06:38:46 +00:00
dyoung 9bd30b81ae In the transmit interrupt handler, do not unnecessarily synchronize
all the descriptors for a buffer chain.  Just synchronize the last
one, which has the interesting stuff.

I still synchronize all the descriptors for the buffer chain if
super-verbose debugging is enabled, since the driver will print
all the descriptors for the chain.
2004-07-15 06:37:22 +00:00
dyoung 73815df521 Remove a less-than-helpful comment. 2004-07-15 06:34:24 +00:00
dyoung d7d89cb468 Clamp the length of a received packet, just in case the chip lies. 2004-07-15 06:33:43 +00:00
dyoung e53ab344b8 When super-verbose debugging is enabled, convert Rx descriptors'
endianness before printing them.
2004-07-15 06:32:42 +00:00
dyoung 630f4475eb Delete some dead code.
Don't call back into the bus-specific code for resets any longer.
It does not seem to be necessary.
2004-07-15 06:31:43 +00:00
dyoung 02c31c63b0 During scans, initialize the BSSID to ff:ff:ff:ff:ff:ff before
sending the first probe request.
2004-07-15 06:30:12 +00:00
dyoung 196e58570e Clear dead code out of atw_clear_sram. 2004-07-15 06:28:37 +00:00
dyoung 769e7e2b01 Don't send data packets until the interface is in state RUN. This
stops ARP and IPv6 Neighbor Discovery packets from trickling out
the interface before it is time.
2004-07-15 06:20:58 +00:00
dyoung 8218b1f277 I'm not treating the lost beacon count specially any more. It is
kind of a dumb way to track the link condition, anyway....
2004-07-15 06:06:53 +00:00
dyoung 69529834b9 Rid atw of some dead code and some test instrumentation. 2004-07-15 05:54:13 +00:00
dyoung 57e4881b70 In ad hoc mode, don't set the mysterious EA bit in the Network
Access Register.  ADMtek's reference driver does not use it at all,
and it does not seem to make any difference whether I leave it in
or take it out.
2004-07-15 05:43:50 +00:00
dyoung bb016ff89a Only drain the transmit queue if we are idling the transmit section. 2004-06-23 09:41:54 +00:00
dyoung ff69458fef After we wait for the MAC's transmit section to idle, drain the
transmit queue and cancel the watchdog timer.  This ends the annoying
"atw0: transmit timeout" messages that disrupted my WiFi tonight.
2004-06-23 09:27:59 +00:00
dyoung 60565a3dfb Fix a commit-o: handle all cases in the switch-statement. 2004-06-23 09:05:50 +00:00