Commit Graph

21946 Commits

Author SHA1 Message Date
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
Andrew Gallatin
534e6f47c1 Fix a bug in mxge's LRO which can cause dup acks to
get aggregated & hence prevent TCP from entering
fast retransmit.

Pointed out by: jeff
Reviewed by: gnn
MFC after:	7 days
2011-04-07 13:49:44 +00:00
Adrian Chadd
5e7d0e6482 Add some more OS_MARK probes to the RX DMA setup/teardown code path.
I'm trying to debug the RX DMA path and help the ath9k guys with
"RX dma abort stuck" issue that both our drivers have.
2011-04-07 13:14:51 +00:00
Alexander Motin
5b917bfc3f Add one more ID for Marvell 88SE912x chip found on Asus U3S6 card.
Submitted by:	Jonas Jonsson <fatbrain@gmail.com>
2011-04-07 08:28:53 +00:00
Navdeep Parhar
bd0d62016a Modify read/write ioctls to work with 64 bit registers too.
MFC after:	3 days
2011-04-07 07:10:42 +00:00
Xin LI
22f2616bd7 Update arcmsr(4) to vendor version 1.20.00.21. This release primarily
improves command timeout handling.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by:	Ching-Lung Huang <ching2048 areca com tw>
MFC after:	2 months
2011-04-06 20:54:26 +00:00
Andrew Gallatin
3cae73118e Implement mxge_init()
This fixes a long standing bug in mxge(4) where "ifconfig mxge0 $IP"
did not bring the interface into a RUNNING state, like it does on
most (all?) other FreeBSD NIC drivers.

Thanks to gnn for mentioning the bug, and yongari for pointing out that
ether_ioctl() invokes ifp->if_init() in SIOCSIFADDR.

MFC after: 7 days
2011-04-06 15:45:32 +00:00
David Christensen
07a558f997 - Removed multiple console error messages and replaced with statistic
counters to reduce spew.
- Fixed a TSO problem when an mbuf contains both header and payload in
  the same cluster.

MFC after:	One week.
2011-04-05 22:13:33 +00:00
Jack F Vogel
cf696f26c9 Important update for the igb driver:
- Add the change made in em to the actual unrefreshed number
    of descriptors is used as a basis in rxeof on the way out
    to determine if more refresh is needed. NOTE: there is a
    difference in the ring setup in igb, this is not accidental,
    it is necessitated by hardware behavior, when you reset the
    newer adapters it will not let you write RDH, it ALWAYS sets
    it to 0. Thus the way em does it is not possible.
  - Change the sysctl handling of flow control, it will now make
    the change dynamically when the variable setting changes rather
    than requiring a reset.
  - Change the eee sysctl naming, validation found the old unintuitive :)
  - Last but not least, some important performance tweaks in the TX
    path, I found that UDP behavior could be drastically hindered or
    improved with just small changes in the start loop. What I have
    here is what testing has shown to be the best overall. Its interesting
    to note that changing the clean threshold to start at a full half of
    the ring, made a BIG difference in performance.  I hope that this
    will prove to be advantageous for most workloads.

MFC in a week.
2011-04-05 21:55:43 +00:00
Jung-uk Kim
9abd8cd05b Lower the bar for ACPI-fast on real machines slightly. Empirical evidences
show that there are perfectly working PM timers with occasional "hiccups",
probably because of an SMI.  Now we ignore the maximum if it happens once in
the test loop and the width is small enough.  Also, relax normal width a bit
to count in a boundary case.
2011-04-05 18:40:19 +00:00
Pyun YongHyeon
f5459d4cad Add initial jumbo frame support for BCM5714/BCM5715 and BCM5780.
Unlike other controllers which have more advanced jumbo support,
these controllers have one send ring, one standard receive producer
ring and one receive return ring. In order to receive jumbo frames
on the controllers, driver now will increase Rx buffer size to 9k.
Two Rx modes are supported on these controllers and I chose
standard Rx BDs over extended Rx BDs. The extended Rx BD mode
allows up to 4 segmentations for each Rx BDs such that kernel does
not have to allocate large buffer of contiguous memory for
receiving. The extended Rx BD mode is already used on controllers
that have separate jumbo receive ring. However, using extended Rx
BDs on BCM5714/BCM5715/BCM5780 reduces the number of Rx BDs to 256
entries which in turn may reduce the performance.  Also UMA backed
page allocator for jumbo frame returns contiguous memory so using
extended Rx BD has no advantage on FreeBSD unless highly customized
local allocator implemented in driver is used.
To use jumbo buffers in standard receive ring, Rx buffer allocation
handler was changed to allocate MJUM9BYTES sized mbuf.

PR:		kern/155192
Tested by:	Vijay Singh <vijju.singh <> gmail dot com>
Submitted by:	mjacob (initial version)
2011-04-05 17:41:54 +00:00
Adrian Chadd
c5d5272355 Make the alq log path tunable 2011-04-05 16:14:54 +00:00
Adrian Chadd
74e3a02137 The xpaBiasLvlFreq[] fields in the modal header also need swapping
when the EEPROM contents are byte-swapped.
2011-04-05 13:14:17 +00:00
Jung-uk Kim
059e24646a Move a trivial acpi_TimerDelta() to acpivar.h to make it inlineable. 2011-04-04 18:39:04 +00:00
Jung-uk Kim
aa977fc70e Always check the current minimum value to make the test more predictable.
Use INT32_MAX instead of an arbitrary big number for the initial minimum.
2011-04-04 17:44:26 +00:00
Jung-uk Kim
8defd647f2 Fix bogus logic to calculate delta between two values from ACPI timers. 2011-04-04 17:30:33 +00:00
Jung-uk Kim
d141bf6e2f Lower the bar for ACPI-fast on virtual machines. The current logic depends
on the fact that real hardware has almost fixed cost to read the ACPI timer.
It is virtually always false for hardware emulation and it makes no sense to
read it multiple times, which is already quite expensive for full emulation.
2011-04-04 17:00:50 +00:00
Jung-uk Kim
93bd1f7e31 Add inline to acpi_timer_read() to reduce unnecessary jumps and calls. 2011-04-04 16:47:42 +00:00
Adrian Chadd
9e9ae8e207 Commit missing bits from the last commit:
* add the hal capability flag
* make sure its disabled for the ar9280/ar9285.
2011-04-04 14:53:36 +00:00
Adrian Chadd
8a2a6beedb Add a HAL capability bit for supporting self-linked RX descriptors and disable it for the 11n chipsets.
From the ath9k source:

==

11N: we can no longer afford to self link the last descriptor.
MAC acknowledges BA status as long as it copies frames to host
buffer (or rx fifo). This can incorrectly acknowledge packets
to a sender if last desc is self-linked.

==

Since this is useful for pre-AR5416 chips that communicate PHY errors
via error frames rather than by on-chip counters, leave the support
in there, but disable it for AR5416 and later.
2011-04-04 14:52:31 +00:00
Adrian Chadd
efa7c2b36c At least set the coverage class value here; worry about populating the
register values at a later date.
2011-04-04 11:01:53 +00:00
Hans Petter Selasky
6c352e994c - Fix for missing event if a libUSB USB transfer is started and
stopped rapidly in succession.

Reported by:	J.R. Oldroyd
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-03 20:22:49 +00:00
Hans Petter Selasky
3ea3537594 - Correct EHCI interrupt disabling at detach.
Submitted by:	Luiz Otavio O Souza
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-03 20:17:49 +00:00
Adrian Chadd
f90a170c46 I missed committing this last time - it's needed for the 5ghz fast clock calculation. 2011-04-03 20:15:41 +00:00
Hans Petter Selasky
31a1169186 - Improvements to USB PF solution
- Add more fields for USB device and host mode
- Add more information to USB PF header so that decoding
  can easily be done by software analyzer tools like
  Wireshark.
- Optimise usbdump to display USB streams in text format
  more efficiently.
- Software using USB PF must be recompiled after
  this commit, due to structure changes.

MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-03 20:03:45 +00:00
Adrian Chadd
97efbf40fc Add in the clock timing calculation when Merlin is using the 5ghz fast clock.
This is a 44mhz clock, not a 40mhz clock like normal for 5ghz operation.
2011-04-03 17:36:32 +00:00
Adrian Chadd
c55968698f Import a fix from the ath9k - reduce the TX FIFO size for Kite (AR9285.) 2011-04-03 12:02:49 +00:00
Adrian Chadd
3d45fa543f Add an explanation of the inivals 2011-04-03 11:59:52 +00:00
Adrian Chadd
bb4a39501a Import nvram2env, a device driver which imports various NVRAM-style
environments into the kernel environment.

The eventual aim is to replace these with specific drivers for
the various bootloaders (redboot, uboot, etc.) This however will
work for the time being until it can be properly addressed.

Submitted by: Aleksandr Rybalko <ray@dlink.ua>
2011-04-03 11:55:48 +00:00
Adrian Chadd
634a6d0283 From ath9k - clear the RX descriptor status before recycling it. 2011-04-02 00:27:22 +00:00
Adrian Chadd
5d51c507d0 Add some more debugging 2011-04-02 00:24:13 +00:00
Jack F Vogel
62d8da8c3a Fix to an error condition case, when an mbuf chain
get's defragged due to a mapping failure the header
pointers will be invalidated and can result in a
TSO or other failure down the line. So, when the
remapping occurs force a retry thru the offload
calculation code. Thanks to Andrew Boyer for discovering
this and cooking up the fix!!
2011-04-01 20:24:51 +00:00
Pyun YongHyeon
595615e6a4 Partially revert r184106. RX buffer ring also needs bus_dmamap_sync().
Tested by:	Yamagi Burmeister (lists <> yamagi dot org)
MFC after:	1 week
2011-04-01 18:53:41 +00:00
Jack F Vogel
e61e0b91af Change the refresh_mbuf logic slightly, add an inline
to calculate the outstanding descriptors that need to be
refreshed at any time, and use THAT in rxeof to determine
if refreshing needs to be done. Also change the local_timer
to simply fire off the appropriate interrupt rather than
schedule a tasklet, its simpler.

MFC in two weeks
2011-04-01 18:48:31 +00:00
Pyun YongHyeon
525e40979b 64bit DMA caused data corruption. Unfortunately there is no known
workaround to use 64bit DMA.
Disable 64bit DMA on Attansic L1 controller.

Tested by:	Yamagi Burmeister (lists <> yamagi dot org)
MFC after:	1 week
2011-04-01 16:45:26 +00:00