Commit Graph

21980 Commits

Author SHA1 Message Date
Bernhard Schmidt
65aa0234f0 RSSI related syncs with the OpenBSD code:
- read RSSI only for the active chains
- cast RSSI/NF to int8_t before passing it up to radiotap
- remove the htole64() for the timestamp

Obtained from:	OpenBSD
2011-04-16 07:32:57 +00:00
Bernhard Schmidt
1eccdf31c1 Pass errors that might happen during state transitions up to net80211. 2011-04-16 07:21:00 +00:00
Bernhard Schmidt
c2c3b03223 Obtain the channel number directly from the laster RXON command, also
chan is an uint8_t.
2011-04-16 07:17:03 +00:00
Bernhard Schmidt
f6bb3360b6 fix the order of the prototypes from the previosu commit 2011-04-15 20:40:49 +00:00
Bernhard Schmidt
89a84499e4 The 6005 series devices need additional temperature offset calibration
as well as the IWN_GP_DRIVER_CALIB_VER6 bit set.

Obtained from:	OpenBSD
2011-04-15 20:35:15 +00:00
Bernhard Schmidt
083e216732 Revert some of local calibration changes in favour of the OpenBSD
implementation. This includes the fix required for the 6050 series
devices.
2011-04-15 20:31:02 +00:00
Bernhard Schmidt
518e267e38 remove debug left-overs 2011-04-15 20:19:18 +00:00
Bernhard Schmidt
af2e228dc4 Split up watchdog and calibration callout. This allows us to use different
timing on both and to remove some monitor mode specific hacks (which has
no calibration).
2011-04-15 20:17:52 +00:00
Bernhard Schmidt
16b483cb8d Split out bluetooth coexistence setup. 2011-04-15 17:10:52 +00:00
Bernhard Schmidt
b558f70709 Fixes for firmware handling:
- there is a local variable for sc->fw_dma, use that instead
- OpenBSD uses 5*hz to wait for firmware to be loaded
- in case the firmware module contains invalid data, actually release it
2011-04-15 16:59:56 +00:00
Bernhard Schmidt
a7387751dd Only handle beacon misses while in RUN state and not scanning. 2011-04-15 16:55:45 +00:00
Bernhard Schmidt
69e775c384 Don't timeout when stopping DMA channels.
Obtained from:	OpenBSD
2011-04-15 16:50:37 +00:00
Alexander Motin
06ccfe1dd7 Some changes around hot-plug and interface power-management:
- use ATA_SE_EXCHANGED (SError.DIAG.X) bit to detect hot-plug events when
power-management enabled and ATA_SE_PHY_CHANGED (SError.DIAG.N) can't be
trusted;
 - on controllers supporting staggered spin-up (SS) put unused channels
into Listen state instead of Off. It should still save some power, but
allow plug-in events to be detected;
 - on controllers supporting cold presence detection (CPD), when power
management enabled, use CPD events to detect hot-plug in addition to PHY
events.
2011-04-15 16:40:31 +00:00
Navdeep Parhar
2be67d2948 Fix a couple of bad races that can occur when a cxgbe interface is taken
down.  The ingress queue lock was unused and has been removed as part of
these changes.

- An in-flight egress update from the SGE must be handled before the
  queue that requested it is destroyed.  Wait for the update to arrive.

- Interrupt handlers must stop processing rx events for a queue before
  the queue is destroyed.  Events that have not yet been processed
  should be ignored once the queue disappears.

MFC after:	1 week
2011-04-15 03:09:27 +00:00
Jung-uk Kim
4a8fa6fe58 Add event handlers for (ACPI) suspend/resume events. Suspend event handlers
are invoked right before device drivers go into sleep state and resume event
handlers are invoked right after all device drivers are waken up.
2011-04-14 22:17:39 +00:00
Navdeep Parhar
6b49a4ece8 There is no need to request a tx credit flush if such a request is already
pending.

MFC after:	3 days
2011-04-14 20:06:23 +00:00
Bernhard Schmidt
9289984d4b Instead of trying to figure out which rxon.flags to clear, restart
from scratch. Remove htole16() calls, rxon.chan is an uint8_t,
ieee80211_chan2ieee() does return an ic_ieee as an int, but I heavily
doubt a htole16() will buy us anything here.
2011-04-14 17:42:21 +00:00
Bernhard Schmidt
8dace48f6b iwn_cleanup() is just a wrapper around iwn_detach(), call it directly
instead.
2011-04-14 17:31:34 +00:00
Bernhard Schmidt
b2d64bef7e Reuse net80211 code:
- IWN_TXOP_TO_US is equal to IEEE80211_TXOP_TO_US
- use IEEE80211_DUR_TU
- ieee80211_add_rates/ieee80211_add_xrates are public, use em
- copied ieee80211_add_ssid it is not public
2011-04-14 17:26:13 +00:00
Bernhard Schmidt
abd8979b98 Remove IWN_FLAG_HAS_5GHZ and IWN_PCI_BAR0, both unused. 2011-04-14 17:19:33 +00:00
Alexander Motin
70b7af2b21 Refactor hard-reset implementation in mvs(4).
Instead of spinning in a tight loop for up to 15 seconds, polling for device
readiness while it spins up, return reset completion just after PHY reports
"connect well" or 100ms connection timeout. If device was found, use callout
for checking device readiness with 100ms period up to full 31 second timeout.

This fixes system freeze for 5-10 seconds on drives hot plug-in.
2011-04-14 07:49:45 +00:00
Ruslan Ermilov
14689886a5 Fixed firmware revision decoding:
- the major is 7-bit binary encoded
- the minor is BCD encoded

PR:		kern/151586
MFC after:	3 days
2011-04-14 07:14:22 +00:00
Jung-uk Kim
5331d61da4 Add some tunable descriptions about x86 timers.
Requested by:	arundel
2011-04-14 00:07:08 +00:00
Pyun YongHyeon
246419ba87 Remove mii(4) dependency and unneeded headers.
Reviewed by:	davidch
2011-04-13 16:35:43 +00:00
Alexander Motin
8d169381e4 Improve SATA Asynchronous Notification feature support in CAM:
- make SATA SIMs announce capabilities to handle SDB with Notification bit;
 - make PMP driver honor this SIMs capability;
 - make SATA XPT to negotiate and enable this feature for ATAPI devices.

This feature allows supporting SATA ATAPI devices to inform system about
some events happened, that may require attention. In my case this allows
LG GH22LS50 SATA DVR-RW drive to report tray open/close events. Events
reported to CAM in form of AC_SCSI_AEN async. Further they could be used
as a hints for checking device status and reporting media change to upper
layers, for example, via spoiling mechanism of GEOM.
2011-04-13 16:20:54 +00:00
Adrian Chadd
235ab70e0a Add in the AR9285 (Kite) diversity to if_ath, enabling TX/RX antenna
diversity.

This is bit dirty and likely should be revised at a later date,
with an eye to unifying/tidying up the whole diversity setup
and allowing developers to do "tricky stuff" as they desire.
For now, this works.
2011-04-13 15:17:23 +00:00
Adrian Chadd
81484cdb07 Add in the last bit of the HAL support for Kite diversity.
* add a new method, specifically for doing per-RX packet
  antenna diversity
* set that HAL method only if it's Kite and a Kite chip that
  does diversity.
2011-04-13 15:12:48 +00:00
Adrian Chadd
1171c869d7 More kite diversity related changes.
* add a diversity flag to the HAL debugging section
* add a check to make sure the kite diversity code doesn't run
  on boards that don't require it, as not all Kite chips will
  implement it.
* add some debug statements when the diversity code makes
  changes to the antenna diversity/combining setup.
2011-04-13 15:08:51 +00:00
Adrian Chadd
ac27b8ff27 Change this to be less noisy. 2011-04-13 14:51:07 +00:00
Adrian Chadd
77823fbc2c Bring over the antenna diversity logic support for Kite.
Again, this is just the code ported from ath9k and included in the build,
it isn't yet enabled.
2011-04-13 11:32:15 +00:00
Alexander Motin
54fc853acf As soon as siis_reset() doesn't waits for device readiness, but only for
controller port readiness (that should set just after PHY ready signal),
reduce wait time from 10s to 1s before trying more aggressive reset method.

This should improve system responsibility in some failure conditions.
2011-04-13 06:36:22 +00:00
Adrian Chadd
c772d0204f Port over a TX gain fix from ath9k specific to the AR9285 (Kite) and AR9271.
Note: this HAL currently only supports the AR9285.

From Linux ath9k:

The problem is that when the attenuation is increased,
the rate will start to drop from MCS7 -> MCS6, and finally
will see MCS1 -> CCK_11Mbps. When the rate is changed b/w
CCK and OFDM, it will use register desired_scale to calculate
how much tx gain need to change.

The output power with the same tx gain for CCK and OFDM modulated
signals are different. This difference is constant for AR9280
but not AR9285/AR9271. It has different PA architecture
a constant. So it should be calibrated against this PA
characteristic.

The driver has to read the calibrated values from EEPROM and set
the tx power registers accordingly.
2011-04-13 04:40:59 +00:00
Adrian Chadd
6984989598 Add new fields to the v4k EEPROM modal header. 2011-04-13 03:05:42 +00:00
Adrian Chadd
132163b12f Add OS_REG_RMW, which mirrors ath9k's REG_RMW.
This macro does a read-modify-write pass with register bits to set and clear.
2011-04-13 03:05:15 +00:00
Adrian Chadd
1c554472de Add the initial AR9285 PHY glue for supporting antenna diversity.
This code isn't currently used anywhere; it's just linked into the build.
2011-04-13 02:40:45 +00:00
Alexander Motin
df1439e31f Refactor hard-reset implementation in ahci(4).
Instead of spinning in a tight loop for up to 15 seconds, polling for device
readiness while it spins up, return reset completion just after PHY reports
"connect well" or 100ms connection timeout. If device was found, use callout
for checking device readiness with 100ms period up to full 31 second timeout.

This fixes system freeze for 5-10 seconds on drives hot plug-in.
2011-04-12 20:50:57 +00:00
Alexander Motin
97fd3ac63f Implement automatic SCSI sense fetching for mvs(4).
Make few improvements/changes to ATAPI PIO support to pass most of scgcheck
(cdrtools) tests.
2011-04-12 16:01:27 +00:00
Alexander Motin
b8b7a9027b Implement automatic SCSI sense fetching for siis(4).
Fix device freeze leak on recovery request (READ LOG, REQUEST SENSE)
failure.
2011-04-12 11:29:15 +00:00
Alexander Motin
6bbd332e5d Implement automatic SCSI sense fetching for ahci(4). 2011-04-12 11:24:59 +00:00
Alexander Motin
f3c987e58e Implement automatic SCSI sense fetching for ata(4) in ATA_CAM mode.
While it could be successfully done by CAM error recovery code, I was
told by several people that it is also a SIM obligation.
2011-04-12 09:55:24 +00:00
Hans Petter Selasky
b0a5e05f62 We don't need to call EOWRITE4(sc, EHCI_USBINTR, 0) directly from each EHCI
bus driver at detach, hence ehci_detach() does exactly this since r199718.

Submitted by:	Luiz Otavio O Souza
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-12 07:49:11 +00:00
Adrian Chadd
a03467b1ba De-dup the ar5416 rates array definition. 2011-04-11 11:15:34 +00:00
Alexander Motin
669d9046a9 Rework change made at r203146. Instead of reporting all wire errors as
SCSI status errors to CAM (that was wrong, as it too often turned retriable
wire errors into non-retriable REQUEST SENSE errors), do it only for STALL
errors on control pipe of the CBI devices. STALL on control pipe is just
a one of the ways to report error for CBI devices.

PR:		usb/150401, usb/154593.
Reviewed by:	hselasky
MFC after:	1 week
2011-04-11 08:23:27 +00:00
Bernhard Schmidt
139127ce5e Don't hardcode assumptions about basic rates, similar to what the rt2661
support code does. While here remove an unnecessary loop.
2011-04-09 14:45:50 +00:00
Adrian Chadd
7ab2ab919c Fix the completely wrong types I used in the previous commit. 2011-04-08 08:49:50 +00:00
Adrian Chadd
82c30dc46e Begin fleshing out a public HAL routine to export the per-chain
ctl/ext noise floor values.

This routine doesn't check to see whether the radio is MIMO
capable - instead, it simply returns either the raw values,
the "nominal" values if the raw values aren't yet available
or are invalid, or '0' values if there's no valid channel/
no valid MIMO values.

Callers are expected to verify the radio is a MIMO radio
(which for now means it's an 11n chipset, there are non-11n
MIMO chipsets out there but I don't think we support them,
at least in MIMO mode) before exporting the MIMO values.
2011-04-08 07:44:00 +00:00
Adrian Chadd
f1ff114882 Export the per-chain ctl/ext noise floor values, raw and uncut, to the
upper-level HAL.

Right now the per-chain noise floor values aren't used anywhere in
the upper-level HAL, so the driver currently has no real reference
to compare the per-chain RSSI values to.

This is needed before per-chain RSSI values (for ctl and ext radios)
are can be thrown upstairs to the net80211 code.
2011-04-08 06:58:01 +00:00
Adrian Chadd
8cc7d3572f Extend the RX descriptor block to include two more EVM words.
This will be needed for later AR93xx/AR94xx 3-stream devices.
2011-04-08 06:29:41 +00:00
Jung-uk Kim
3453537fa5 Use atomic load & store for TSC frequency. It may be overkill for amd64 but
safer for i386 because it can be easily over 4 GHz now.  More worse, it can
be easily changed by user with 'machdep.tsc_freq' tunable (directly) or
cpufreq(4) (indirectly).  Note it is intentionally not used in performance
critical paths to avoid performance regression (but we should, in theory).
Alternatively, we may add "virtual TSC" with lower frequency if maximum
frequency overflows 32 bits (and ignore possible incoherency as we do now).
2011-04-07 23:28:28 +00:00
David Christensen
3a1594a579 - Fixed a problem when multiqueue mode was enabled which caused the CQ
chain to be corrupted.
- Removed many console print warnings and replaced with driver maintained
  counters.
- Several style(9) fixes.

MFC after:      One week.
2011-04-07 20:15:36 +00:00