Commit Graph

181 Commits

Author SHA1 Message Date
mycroft 8f64992310 Add sc_txstart and sc_txstarted, to keep track of the current FID we want to
start and the number we've started that have not been alloced yet.  Currently
sc_txstarted is constained to 0 or 1 because of the way we start the next
packet, but this will change.
2004-07-22 21:56:58 +00:00
mycroft 5e0a5ea2f8 Copyright maintenance. 2004-07-22 21:31:56 +00:00
mycroft d9907678ec Change some DELAY(2) to more sensible values. 2004-07-22 20:36:11 +00:00
mycroft 0e8c7f506b Add some histogram code (controlled by an #ifdef) to track how long various
busy-wait loops take.
2004-07-22 20:34:52 +00:00
mycroft 1854f1b055 Keep a count of packets written to the chip but not yet initiated. This
simplifies some logic, and is needed for later changes.
2004-07-22 20:30:43 +00:00
mycroft 04cd0b261d Change some names.
sc_txnext -> sc_txalloc
sc_txcur -> sc_txqueue
2004-07-22 20:25:23 +00:00
mycroft 9df2197095 Keep a count of FIDs allocated, rather than storing a packet length in the
ring.
2004-07-22 20:23:31 +00:00
mycroft f0d981931c Make the radiotap header reflect the actual transmit rate. 2004-07-22 20:13:20 +00:00
mycroft f14903982d Ack events in only one place. Reduces register writes sometimes. 2004-07-22 20:12:20 +00:00
mycroft 9951a8362a Only read the part of the frame header we use in wi_tx_intr(). 2004-07-22 20:07:38 +00:00
mycroft 94e3bc2cef Rework the rate-lowering hack:
* Update sc_txpending[] when a packet is written, even before we issue the TX
  command, since it may be active when we issue the TX command for the
  following packet.
* Do not lower the rate in ni_txrate or id_rateidx, because these are used to
  keep track of sc_txpending[], and could cause us to get "stuck" at the lower
  rate.
2004-07-22 20:06:05 +00:00
mycroft 3a862ed4bf Make the logic in wi_write_txrate() less obscure. 2004-07-22 19:56:55 +00:00
mycroft 928d2d1d6b For Intersil firmware, use the ROM rate list to determine the correct bitmask
for BASIC_RATE and SUPPORT_RATE.  Always set these, because otherwise probe
frames will not get the correct list.
2004-07-22 19:55:08 +00:00
mycroft 0d69a42fb3 Missed one change in the previous. Now we really don't try to write it. 2004-07-22 19:51:37 +00:00
mycroft 6f32bd0675 Symbol firmware doesn't support the power management register, so don't try to
do power management there.
2004-07-22 19:50:43 +00:00
mycroft df9b04fdbb Whoops, change one back to regular "static" for an inline function. 2004-07-22 19:48:28 +00:00
mycroft 91f4c8a166 I hate "static". Add an #ifdef so I can turn it off easily. 2004-07-22 19:47:24 +00:00
dyoung b678db6630 Indicate link status changes on the routing socket. 2004-07-02 23:41:34 +00:00
dyoung d16482800f Cosmetic: shift a break-statement into the right column. 2004-07-02 21:22:18 +00:00
dyoung ef5c009e5c wi_start compaction: check for software descriptor exhaustion in
one place.  Check for the _RUN state in one place.
2004-07-02 21:20:10 +00:00
dyoung 43dcf72c5f Finally, refactor wi_media_change and ieee80211_media_change.
ieee80211_media_change handles a lot more conditions than
wi_media_change did.

This helps with the second bug mentioned in kern/25604, which causes
"SIOCSIFMEDIA: Invalid argument."
2004-06-06 05:32:17 +00:00
dyoung 4d9e630e22 Don't set a frame's WEP bits, the 802.11 layer already has. 2004-05-31 11:42:00 +00:00
dyoung f0b37d23ab Actually, disabling RSS rate-adaptation does not make any discernible
difference in locking up STA f/w 8.42.1.
2004-03-26 06:43:25 +00:00
dyoung 046f811cb5 Firmware revisions are decimal. 2004-03-26 06:39:56 +00:00
dyoung eaf23d986f Enable Tx and TxExc interrupts. Somehow this escaped my initial
commit. The rate adaptation code expects them. Usually wi gets
lucky, and an Rx/Alloc/Info event triggers the interrupt handler,
but I had not intended for wi to count on it.

Without Tx/TxExc interrupts enabled, wi will sometimes exhaust all
its rssdescs and cease transmitting.  Usually it sets IFF_OACTIVE
in that situation.
2004-03-25 06:17:51 +00:00
dyoung 9ef4dd42f2 Prevent a buffer overflow that's been seen in the wild. The firmware
will sometimes return 0; subtracting 1 from that yields a too-big
buffer length.
2004-03-17 17:19:13 +00:00
dyoung 73a618d5f3 In wi(4), wi_choose_rate used to contain device-independent code.
I have pulled that code into the function ieee80211_rssadapt_choose
so that I can re-use it in ath(4), atw(4), and in other drivers.

In rssadapt(9), I have also created a struct ieee80211_rssadapt_expavgctl
that contains parameters for rate adaptation. When IEEE80211_RSSADAPT_DEBUG
is enabled, I will using sysctl to expose an ieee80211_rssadapt_expavgctl
for each wireless device.

Also in rssadapt(9), I have introduced an interpolate() macro which
makes the exponential-averaging code more compact.
2004-03-17 17:00:34 +00:00
dyoung 6f9c4a91f1 If the firmware returns to us an RSS descriptor index that is out
of bounds, then complain and recover by freeing all of the descriptors.
That will usually provoke additional complaints---see the next
paragraph.

If the firmware returns to us an RSS descriptor that is in-bounds
but out of service (id_node == NULL), then gripe and get out of
the interrupt handler. ***This will still leak RSS descriptors.***
I'm working on a better solution. Possibly I will just free all of
the descriptors.
2004-02-10 01:08:05 +00:00
dyoung 9f147300d1 Disable rate-adaptation for Lucent firmware version 8.42.1, per a
bug report from Simon Burge: the firmware seems to lock up.

If rate-adaptation is disabled on a Lucent card, then do all the
rate-adaptation work *except* for writing the new transmit rate,
since I suspect that is what locks-up the firmware.
2004-02-10 00:59:38 +00:00
dyoung b664edb5ad Shorten the retry count on Prism APs to improve the speed of
rate-adaptation.
2004-02-10 00:52:12 +00:00
dyoung d32ed08a80 Factor out the initialization/reset of RSS descriptors, making
wi_rssdescs_init, wi_rssdescs_reset, which I will use to receover
when the firmware botches up the RSS descriptor index.
2004-02-10 00:47:41 +00:00
dyoung c9dcac9ffa The radiotap header is little-endian. 2004-02-10 00:32:40 +00:00
dyoung cc1434eac0 wi_stop tells which stations' rssadapt descriptors it cleans up
when IFF_DEBUG is set.
2004-01-31 10:40:19 +00:00
dyoung 609617af90 Enable RSSI-based rate-adaptation for wi(4). This enables wi(4)-based
APs to run at "full speed" where before they ran at just 1 or 2Mb/s.
The AP will adapt the data rate for each client based on packet
losses and the received signal strength.

I have also enabled rate adaptation for STA mode and for IBSS mode,
but the hardware gives us less control over the data rate in those
modes.
2003-12-07 05:44:49 +00:00
keihan b8702f530b netbsd.org -> NetBSD.org
This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean".  Thanks for the patiance, and sorry for all the commits.
2003-12-04 13:57:30 +00:00
dyoung 18652e3785 From Steve Woodford (scw@): fix wi(4) and wiconfig(8) on big-endian
machines.
2003-11-16 09:41:01 +00:00
dyoung fe919dfeb0 Fix spelling/grammar in a comment. 2003-11-16 09:05:53 +00:00
dyoung 23d8f48692 Add data-link type DLT_IEEE802_11_RADIO to wi and atw. DLT_IEEE802_11_RADIO
lets you monitor radio stats like received signal strength, which
diversity antenna was used, channel/frequency, modulation, and data
rate.
2003-11-16 09:02:42 +00:00
dyoung 76db6bfa8c Use ieee80211_find_rxnode to attribute Rx packets to the write
ieee80211_node. This reduces code duplication.  It will help us
support passive scanning and rate adaptation.
2003-11-02 01:55:40 +00:00
dyoung 45f756f520 Mark the available channels using the ic_channels table instead of
setting bits in ic_chan_avail, which is the responsibility of
ieee80211_ifattach. I cannot believe the previous code worked.
2003-11-02 01:39:22 +00:00
dyoung f64ab7b2a4 Get the ieee80211_node for management packets from the rcvif field. 2003-11-02 00:55:46 +00:00
dyoung bf9644d3d3 Fix bugs in power-saving:
Use a power-saving station's ieee80211_node, which is stored in
the rcvif field.

Do not free a node if it is put onto the power-saving queue.
2003-11-02 00:22:49 +00:00
dyoung e3bc096fe4 Bug fix: in wi_cfg_txrate, do not divide the 802.11 rate by 2 and
take off the flags before giving it to wi_write_txrate.

Also add a useful debug message to wi_write_txrate.
2003-11-01 23:57:05 +00:00
mycroft f253f37fb0 In wi_newstate(), read the BSSID into a temporary buffer that has guaranteed
alignment.  Fixes a really obscure failure mode on Alpha, and panics on other
machines.
2003-10-24 23:58:22 +00:00
dyoung ab4a574ce1 Don't take the 802.11 header off of a frame until after we've given
it to the driver's BPF tap.
2003-10-19 22:00:54 +00:00
dyoung 5dca575ce1 ieee80211_newstate() wants for ic->ic_state to equal the previous
state, so do not update ic->ic_state in wi_newstate() before calling
ieee80211_newstate(). Instead, update ic->ic_state when we do not
let ieee80211_newstate() run.
2003-10-17 03:58:23 +00:00
dyoung d531221c67 Prepare for wi rate adaptation. Add wi_write_txrate, which only
writes a hardware register when the data rate selection actually
changes. Add wi_cfg_txrate, which writes the data rate selection
regardless.

Name some fields in the wi Tx buffer which we will use for rate
adaptation.

Name the Prism "Alternate Retry Count" RID, WI_RID_ALT_RETRY_COUNT.
2003-10-16 10:57:35 +00:00
dyoung 50daf0a217 The upper & lower bounds on wi RSSI are completely bogus, AFAICT. 2003-10-16 10:38:07 +00:00
dyoung ef743c64b6 Switch wi(4) to the new 802.11 layer. 2003-10-13 08:07:21 +00:00
dyoung 6e3daf0a07 Still more consolidation of 802.11 media-handling, moving moving
common code from awi and wi into the 802.11 framework. Inspired by
Sam Leffler's patches to FreeBSD.
2003-07-06 20:01:17 +00:00