Commit Graph

21200 Commits

Author SHA1 Message Date
Marius Strobl
485fc5eb4e - Remove clause 3 and 4 from TNF licenses.
- Remove closes 3 & 4 from Manuel Bouyer's license.

Obtained from:	NetBSD
2010-09-26 22:11:41 +00:00
Marius Strobl
cd23a6e019 Take mpt_req_on_{free,pending}_list() out from under INVARIANTS as these
are generally useful and not just for debugging.
2010-09-24 23:54:03 +00:00
Marius Strobl
67a1357c25 Improve r56796; the reply handler actually may remove the request from
the chain in which case it shouldn't be removed twice.
Reported by:	Staale Kristoffersen

MFC after:	1 week
2010-09-24 16:40:46 +00:00
Alexander Motin
433d4558c1 Add missing le32toh(), same as recently done in ata-siliconimage.c. 2010-09-24 07:14:14 +00:00
Oleksandr Tymoshenko
ea14ae7aed - Do not place variables to memory allocated by busdma. pre/post ops
might invalidate cache and hence effectively void validity of values
2010-09-24 04:46:46 +00:00
Pyun YongHyeon
1432824670 Always show asic/chip revision in device attach phase. There are
too many bge(4) controllers there and model name does not
necessarily match asic/chip revision. Relying on VPD string made
it hard to identify exact asic/chip revision so the first step to
debug bge(4) was getting exact asic/chip information with verbose
boot which may not be available on production server.
2010-09-23 18:55:54 +00:00
Jayachandran C.
831826341b Add missing byteswap, works on big endian systems now (tested on Netlogic
XLS MIPS processor).

Submitted by:	Sreekanth M. S. <kanthms at netlogicmicro dot com>
Reviewed by:	mav
2010-09-23 05:17:36 +00:00
Pyun YongHyeon
4a4dd474db Fix build breakage introduced in r212972. 2010-09-22 16:48:24 +00:00
Alexander Motin
48fe2e6719 Quick fix for unmotivated C2 state usage during boot, introduced at r212541.
That caused LAPIC timer failure and huge delays during boot on some systems.
2010-09-22 11:32:22 +00:00
Andriy Gapon
9c2d052943 acpi_attach: do not explicitly install default handlers for default
address spaces

There has been no need to do that starting with ACPICA 20040427 as
AcpiEnableSubsystem() installs the handlers automatically.
Additionaly, explicitly calling AcpiInstallAddressSpaceHandler before
AcpiEnableSubsystem is not supported by ACPICA and leads to too early
execution of _REG methods in some DSDTs, which may result in problems.

Big thanks to Robert Moore of ACPICA/Intel for explaining the above.

Reported by:	Daniel Bilik <daniel.bilik@neosystem.cz>
Tested by:	Daniel Bilik <daniel.bilik@neosystem.cz>
Reviewed by:	jkim
Suggested by:	"Moore, Robert" <robert.moore@intel.com>
MFC after:	1 week
2010-09-22 06:10:22 +00:00
MIHIRA Sanpei Yoshiro
87b6f1855b Add new device ids.
Buffalo (Melco Inc.) LUA3-U2-AGT
 Logitec LAN-GTJ/U2A(usb/119981)

PR:		usb/119981 and me
Submitted by:	"Y.Okabe" <be_works_us at yahoo.com>, hiroo at oikumene.gcd.org
Reviewed by:	thompsa
MFC after:	3 days
2010-09-21 22:42:14 +00:00
Pyun YongHyeon
fc05868abd Remove unnecessary controller reinitialization.
PR:	kern/87506
2010-09-21 17:52:32 +00:00
Pyun YongHyeon
e9dfd82ff1 Remove unnecessary controller reinitialization.
StarFire controller does not require controller reinitialization to
program perfect filters. While here, make driver immediately exit
from interrupt/polling handler if driver reinitialized controller.

PR:	kern/87506
2010-09-21 17:42:19 +00:00
Pyun YongHyeon
744ec7f282 Make sure to clear IFF_DRV_RUNNING to reinitialize controller.
While I'm here update if_oerrors counter when driver encounters
watchdog timeout.
2010-09-21 17:31:14 +00:00
Pyun YongHyeon
b7dc7dd4f5 Remove unnecessary controller reinitialization.
PR:	kern/87506
2010-09-21 17:25:15 +00:00
John Baldwin
8385f4cf94 Tweak the stats exported by the e1000 drivers:
- Add a single sysctl procedure to all three drivers to read an arbitrary
  register (the register is passed as arg2).  Use it to replace existing
  routines in igb(4) that used a separate routine for each register, and
  to add support for missing stats in em(4) and lem(4).
- Move the 'rx_overruns' and 'watchdog_timeouts' stats out of the MAC stats
  section as they are driver stats, not MAC counters.
- Simplify the code that creates per-queue stats in igb(4) to use a single
  loop and remove duplicated code.
- Properly read all 64 bits of the 'good octets received/transmitted' in
  em(4) and lem(4).
- Actually read the interrupt count registers in em(4), and drop the
  'host to card' sysctl stats from em(4) as they are not implemented in
  any of the hardware this driver supports.
- Restore several stats to em(4) that were lost in the earlier stats
  conversion including per-queue stats.
- Export several MAC stats in em(4) that were exported in igb(4) but not
  in em(4).
- Export stats in lem(4) using individual sysctls as in em(4) and igb(4).

Reviewed by:	jfv
MFC after:	1 week
2010-09-20 16:04:44 +00:00
Bernhard Schmidt
71203720f3 Fix typo in previous commit. 2010-09-19 12:52:23 +00:00
Bernhard Schmidt
d8ac0e6633 Rewrite parts of the calibration code which is run while bringing up
the device:
- unobscure some of the code by moving it into its own functions
- get rid of some magic numbers
- create similar structure as the reference driver has, this should
  make further syncs easier
2010-09-19 12:47:41 +00:00
Bernhard Schmidt
0fc7c4008f Group functions used for initial calibration. 2010-09-19 12:39:04 +00:00
Nick Hibma
15dba72121 Cleanup white space and typos. 2010-09-18 22:37:47 +00:00
Jung-uk Kim
a90b8833d2 Rework r210248. Although it fixed most of problems, it did not fix one
particular edge case where X-axis resolution is not multiple of font width.
Now we just advance enough scan lines, then deduct a partial scan line.
It is more intuitive than the previous code.  Apply the same wisdom to EGA
and VGA planar renderers for consistency.

Reported by:	David DEMELIER (demelier dot david at gmail dot com)
2010-09-17 23:09:31 +00:00
Kenneth D. Merry
0b883cf6b4 Fix a couple of mps problems.
When the driver is completely saturated with commands (1024 in the
case of the SAS2008 in my test system), I/O stops.  If we tell CAM
that we have one less command slot than we have actually allocated,
everything works fine.  We also need a few extra command slots to
allow for aborts and other task management commands to be sent down.

This needs more investigation to determine the root cause, but for
now this fixes things in my testing.

mps.c:		Change a printf() to mps_printf().

mps_sas.c:	Subtract 5 command slots when we tell CAM how many
		commands we can handle.

		Add some commented-out logic to print the contents
		the CDBs for timed-out commands.  This can help
		in debugging devices that are timing out.  This
		will be uncommented once I bring some CAM changes in.

Reported by:	Andrew Boyer <aboyer at averesystems dot com>
2010-09-17 21:53:56 +00:00
Ed Maste
dbb34a64a0 Use device_printf where possible, and otherwise at least include the
driver name in printf strings.

Reported by:	Mark Johnston
2010-09-16 23:33:24 +00:00
Kenneth D. Merry
63feedfd46 MFp4 (//depot/projects/mps/...):
According to the MPT2 spec, task management commands are
serialized, and so no I/O should start while task management
commands are active.

So, to comply with that, freeze the SIM queue before we send any
task management commands (abort, target reset, etc.) down to the
IOC.  We unfreeze the queue once the task management command
completes.

It isn't clear from the spec whether multiple simultaneous task
management commands are supported.  Right now it is possible to
have multiple outstanding task management commands, especially in
the abort case.  Multiple outstanding aborts do complete
successfully, so it may be supported.

We also don't yet have any recovery mechanism (e.g. reset the IOC)
if the task management command fails.
2010-09-16 22:54:56 +00:00
Xin LI
9ed03f0231 status bits should be &'ed against status to be really functional.
Reported by:	Jike Song
Reviewed by:	yongari
MFC after:	1 week
2010-09-16 21:06:23 +00:00
Jung-uk Kim
01b36cb089 Remove an unnecessary hack from ACPICA 20100915 (r212761). 2010-09-16 20:11:40 +00:00
Jung-uk Kim
42fecd1294 Merge ACPICA 20100915. 2010-09-16 20:08:00 +00:00
Attilio Rao
dfe2c294f3 Implement device unbusying via a cdevpriv destructor.
Suggested by:	jhb
Tested by:	Mark Johnston <mjohnston at sandvine dot com>
Reviewed by:	emaste, jhb
MFC after:	10 days
X-MFC:		r212661
2010-09-16 17:49:10 +00:00
Pyun YongHyeon
767c3593eb Fix incorrect RX BD producer updates. The producer index was
already updated after allocating mbuf so driver had to use the last
index instead of using next producer index. This should fix driver
hang which may happen under high network load.

Reported by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
Tested by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
MFC after:	10 days
2010-09-16 17:32:37 +00:00
Matthew D Fleming
4e6571599b Re-add r212370 now that the LOR in powerpc64 has been resolved:
Add a drain function for struct sysctl_req, and use it for a variety
of handlers, some of which had to do awkward things to get a large
enough SBUF_FIXEDLEN buffer.

Note that some sysctl handlers were explicitly outputting a trailing
NUL byte.  This behaviour was preserved, though it should not be
necessary.

Reviewed by:    phk (original patch)
2010-09-16 16:13:12 +00:00
Alexander Motin
bf12976c76 Fix panic, when due to some kind of congestion on FIS-based switching
port multiplier some command triggers false positive timeout, but then
completes normally.

MFC after:	2 weeks
2010-09-16 12:39:50 +00:00
Marius Strobl
65f2c0ff58 Merge r207585 from cas(4):
- Don't probe for PHYs if we already know to use a SERDES. Unlike as with
  cas(4) this only serves to speed up the the device attach though and can
  only be determined via the OFW device tree but not from the VPD.
- Don't touch the MIF when using a SERDES.
- Add some missing bus space barriers, mainly in the PCS code path.
2010-09-16 09:29:48 +00:00
Navdeep Parhar
225f5b4adc Fix t3_gate_rx_traffic and t3_open_rx_traffic. Parts of them always operated
on XGMAC0 instead of the specified XGMAC.

MFC after:	3 days
2010-09-15 21:50:37 +00:00
Attilio Rao
04f798ecea Fix bogus busying mechanism from cdevsw callbacks:
- D_TRACKCLOSE may be used there as d_close() are expected to match up
  d_open() calls
- Replace the hand-crafted counter and flag with the
  device_busy()/device_unbusy() proper usage.

Sponsored by:	Sandvine Incorporated
Reported by:	Mark Johnston <mjohnston at sandvine dot com>
Tested by:	Mark Johnston
Reviewed by:	emaste

MFC after:	10 days
2010-09-15 14:24:21 +00:00
Ed Maste
435c8a15cf Add some enums and constants from Adaptec's latest driver
(build 17911).
2010-09-15 01:19:11 +00:00
Marius Strobl
6c3c4d7109 Use saner nsegments and maxsegsz parameters when creating certain DMA tags;
tags for 1-byte allocations cannot possibly be split across 2 segments and
maxsegsz must not exceed maxsize.
2010-09-14 20:41:06 +00:00
Kenneth D. Merry
cb1d2fe2cd MFp4: (//depot/projects/mps/...)
Report data overruns properly.

Submitted by:	scottl
2010-09-14 17:22:06 +00:00
Ed Maste
3e50771086 Avoid repeatedly spamming the console while a timed out command is waiting
to complete.  Instead, print one message after the timeout period expires,
and one more when (if) the command eventually completes.

MFC after:	1 month
2010-09-14 01:51:04 +00:00
Jung-uk Kim
f6ff063a6e Fix segment:offset calculation of interrupt vector for relocated video BIOS
when the original offset is bigger than size of one page.  X86BIOS macros
cannot be used here because it is assumed address is only linear in a page.

Tested by:	netchild
2010-09-13 19:58:46 +00:00
Matthew D Fleming
404a593e28 Revert r212370, as it causes a LOR on powerpc. powerpc does a few
unexpected things in copyout(9) and so wiring the user buffer is not
sufficient to perform a copyout(9) while holding a random mutex.

Requested by: nwhitehorn
2010-09-13 18:48:23 +00:00
Andriy Gapon
09c22c66e1 acpi_cpu: do not apply P_LVLx_LAT rules to latencies returned by _CST
ACPI specification sates that if P_LVL2_LAT > 100, then a system doesn't
support C2; if P_LVL3_LAT > 1000, then C3 is not supported.
But there are no such rules for Cx state data returned by _CST.  If a
state is not supported it should not be included into the return
package.  In other words, any latency value returned by _CST is valid,
it's up to the OS and/or user to decide whether to use it.

Submitted by:	nork
Suggested by:	mav
MFC after:	1 week
2010-09-13 09:51:24 +00:00
Alexander Motin
a157e42516 Refactor timer management code with priority to one-shot operation mode.
The main goal of this is to generate timer interrupts only when there is
some work to do. When CPU is busy interrupts are generating at full rate
of hz + stathz to fullfill scheduler and timekeeping requirements. But
when CPU is idle, only minimum set of interrupts (down to 8 interrupts per
second per CPU now), needed to handle scheduled callouts is executed.
This allows significantly increase idle CPU sleep time, increasing effect
of static power-saving technologies. Also it should reduce host CPU load
on virtualized systems, when guest system is idle.

There is set of tunables, also available as writable sysctls, allowing to
control wanted event timer subsystem behavior:
  kern.eventtimer.timer - allows to choose event timer hardware to use.
On x86 there is up to 4 different kinds of timers. Depending on whether
chosen timer is per-CPU, behavior of other options slightly differs.
  kern.eventtimer.periodic - allows to choose periodic and one-shot
operation mode. In periodic mode, current timer hardware taken as the only
source of time for time events. This mode is quite alike to previous kernel
behavior. One-shot mode instead uses currently selected time counter
hardware to schedule all needed events one by one and program timer to
generate interrupt exactly in specified time. Default value depends of
chosen timer capabilities, but one-shot mode is preferred, until other is
forced by user or hardware.
  kern.eventtimer.singlemul - in periodic mode specifies how much times
higher timer frequency should be, to not strictly alias hardclock() and
statclock() events. Default values are 2 and 4, but could be reduced to 1
if extra interrupts are unwanted.
  kern.eventtimer.idletick - makes each CPU to receive every timer interrupt
independently of whether they busy or not. By default this options is
disabled. If chosen timer is per-CPU and runs in periodic mode, this option
has no effect - all interrupts are generating.

As soon as this patch modifies cpu_idle() on some platforms, I have also
refactored one on x86. Now it makes use of MONITOR/MWAIT instrunctions
(if supported) under high sleep/wakeup rate, as fast alternative to other
methods. It allows SMP scheduler to wake up sleeping CPUs much faster
without using IPI, significantly increasing performance on some highly
task-switching loads.

Tested by:	many (on i386, amd64, sparc64 and powerc)
H/W donated by:	Gheorghe Ardelean
Sponsored by:	iXsystems, Inc.
2010-09-13 07:25:35 +00:00
Alexander Motin
373d257ef0 Add tunable 'hint.hpet.X.per_cpu' to specify how much per-CPU timers driver
should provide if there is sufficient hardware. Default is 1.
2010-09-13 06:32:56 +00:00
Alexander Motin
6184f8d60e Instead of storing last event timestamp, store the next event timestamp.
It corrects handling of the first event offset in emulated periodic mode.
2010-09-12 11:11:53 +00:00
Marius Strobl
cdb25d827e Change OF_interpret() to also take an array of cell_t (missed in r209801).
Reviewed by:	nwhitehorn
2010-09-11 18:55:00 +00:00
Andriy Gapon
f5aadc99a6 make acpi_hp device a child of acpi_wmi
to properly reflect dependency between the devices/drivers

PR:		kern/147858
Suggested by:	jhb
Tested by:	Maciej Suszko <maciej@suszko.eu>
MFC after:	1 week
2010-09-11 08:09:14 +00:00
Kenneth D. Merry
d3c7b9a08a MFp4 (//depot/projects/mps/...)
Bring in a driver for the LSI Logic MPT2 6Gb SAS controllers.

This driver supports basic I/O, and works with SAS and SATA drives and
expanders.

Basic error recovery works (i.e. timeouts and aborts) as well.

Integrated RAID isn't supported yet, and there are some known bugs.

So this isn't ready for production use, but is certainly ready for
testing and additional development.  For the moment, new commits to this
driver should go into the FreeBSD Perforce repository first
(//depot/projects/mps/...) and then get merged into -current once
they've been vetted.

This has only been added to the amd64 GENERIC, since that is the only
architecture I have tested this driver with.

Submitted by:	scottl
Discussed with:	imp, gibbs, will
Sponsored by:	Yahoo, Spectra Logic Corporation
2010-09-10 15:03:56 +00:00
Andriy Gapon
3d844eddb7 bus_add_child: change type of order parameter to u_int
This reflects actual type used to store and compare child device orders.
Change is mostly done via a Coccinelle (soon to be devel/coccinelle)
semantic patch.
Verified by LINT+modules kernel builds.

Followup to:	r212213
MFC after:	10 days
2010-09-10 11:19:03 +00:00
Bernhard Schmidt
571d92b012 Fix firmware module dependencies.
malo and mwl use the firmware framework to access firmware images.
Depending on the firmware modules itself is not required and in this
case even wrong because no modules with those names exist.

Pointed out by:	brucec
MFC after:	1 week
2010-09-10 08:11:48 +00:00
John Baldwin
d1a02e0932 Catch up to rename of the constant for the Master Data Parity Error bit in
the PCI status register.

Pointed out by:	mdf
Pointy hat to:	jhb
2010-09-09 20:26:30 +00:00
Matthew D Fleming
10e0075ddb Fix an incorrect use of sbuf_overflowed() after a call to sbuf_finish(). 2010-09-09 18:35:08 +00:00
Matthew D Fleming
dd67e2103c Add a drain function for struct sysctl_req, and use it for a variety of
handlers, some of which had to do awkward things to get a large enough
FIXEDLEN buffer.

Note that some sysctl handlers were explicitly outputting a trailing NUL
byte.  This behaviour was preserved, though it should not be necessary.

Reviewed by:	phk
2010-09-09 18:33:46 +00:00
John Baldwin
da6b22afaf - Rename the constant for the Master Data Parity Error flag in the
PCI status register to map its current name.
- Use PCIM_* rather than PCIR_* for constants for fields in various AER
  registers.  I got about half of them right in the previous commit.

MFC after:	1 week
2010-09-09 18:19:15 +00:00
Nathan Whitehorn
c14e163ad1 Fix a problem where device detection would work unreliably on Serverworks
K2 SATA controllers. The chip's status register must be read first, and
as a long, for other registers to be correctly updated after a command, and
this includes the command sequence in device detection as well as the
previously handled case after interrupts. While here, clean up some
previous hacks related to this controller.

Reported by:	many
Reviewed by:	mav
MFC after:	3 weeks
2010-09-09 13:17:30 +00:00
Ed Schouten
1901fd2ffe Let psm(4) use si_drv1 to refer to its softc. 2010-09-09 07:52:15 +00:00
Pyun YongHyeon
a8924cde73 Correct definition of T2 mode bit of MRBE Message Page 5 Next Page
Control Register.
2010-09-08 21:08:54 +00:00
John Baldwin
79c2de35b5 - Add register definitions related to extended capability IDs in
PCI-express.  I used PCIZ_* for ID constants (plain capability IDs use
  PCIY_*).
- Add register definitions for the Advanced Error Reporting, Virtual
  Channels, and Device Serial Number extended capabilities.
- Teach pciconf -c to list extended as well as plain capabilities.   Adds
  more detailed parsing for AER, VC, and device serial numbers.

MFC after:	2 weeks
2010-09-08 17:53:34 +00:00
Alexander Motin
b28fc1b5c8 During SMP startup there is time window, when SMP started, but interrupts
are still bound to BSP. It confuses timer management logic in per-CPU mode
and may cause timer not being reloaded. Check such cases on interrupt
arival and reload timer to give system some more time to manage proper
binding.
2010-09-08 16:59:22 +00:00
Pyun YongHyeon
a64ee4e18f Consistently use tab characters instead of tab + space characters.
No functional changes.
2010-09-07 23:08:38 +00:00
Pyun YongHyeon
beab55bfc5 Remove trailing CR at EOL. 2010-09-07 22:44:29 +00:00
Jack F Vogel
26c88ee828 Code correction in refresh_mbufs, just continuing
without index recalc was wrong.
2010-09-07 21:28:45 +00:00
Jack F Vogel
d9f1a5aa8e Tighten up the rx mbuf refresh code, there were some
discrepencies from the igb version which was the target.

Change the message when neither MSI or MSIX are enabled
and a fallback to Legacy interrupts happen, the existing
message was confusing.
2010-09-07 20:13:08 +00:00
Pyun YongHyeon
12c65daeaf Make sure to create DMA'able memory for statistics block. This was
missed in r212061 and it caused crashes for 570x controllers as
controller DMAed statistics to physical address 0.

Reported by:	kan
2010-09-07 18:29:29 +00:00
Andriy Gapon
9fa1edb882 acpi_hp: fix bus attachment code
- add identify method to create driver's own device_t
- successfully probe only driver's own device_t instead of any device_t
- (ab)use device order to hopefully be probed/attached after acpi_wmi

PR:		kern/147858
Tested by:	Maciej Suszko <maciej@suszko.eu>
MFC after:	1 week
2010-09-06 07:34:32 +00:00
Alexander Motin
af82b9a9ee Add support for the Sharp/Micron flash chips to powermac_mvram(4).
Tested on PowerMac G4 AGP.

Reviewed by:	nwhitehorn
2010-09-05 20:04:02 +00:00
Alexander Motin
09538b1020 Several improvements to HPET driver:
- Add special check for case when time expires before being programmed.
This fixes interrupt loss and respectively timer death on attempt to
program very short interval. Increase minimal supported period to more
realistic value.
 - Add support for hint.hpet.X.allowed_irqs tunable, allowing manually
specify which interrupts driver allowed to use. Unluckily, many BIOSes
program wrong allowed interrupts mask, so driver tries to stay on safe
side by not using unshareable ISA IRQs. This option gives control over
this limitation, allowing more per-CPU timers to be provided, when FSB
interrupts are not supported. Value of this tunable is bitmask.
 - Do not use regular interrupts on virtual machines. QEMU and VirtualBox
do not support them properly, that may cause problems. Stay safe by default.
Same time both QEMU and VirtualBox work fine in legacy_route mode.
VirtualBox also works fine if manually specify allowed ISA IRQs with above.
2010-09-05 19:24:32 +00:00
Fabien Thomas
2aef9dd6d3 Fix invalid class removal when IAF is not the last class.
Keep IAF class with 0 PMC and change the alias in libpmc to IAP.

MFC after:	1 week
2010-09-05 13:31:14 +00:00
Bjoern A. Zeeb
3887319477 Fix a compile problem introduced with r212008 on 32bit:
Both deadline and current_time are time_seconds (+ utc_offset())
casted to unsigned long long. No need to cast to or print as pointers.

MFC after:	4 days
2010-09-04 16:27:14 +00:00
Pyun YongHyeon
443f331ec5 Fix another bug introduced in r212109. We should unload DMA maps
only after sending the last fragment of a frame so the mbuf pointer
also should be stored in the last descriptor index.
2010-09-03 18:00:17 +00:00
Andriy Gapon
b1f9b9965b acpi: update stale comments about order of cpu devices probing
These comments should have been updated in r203776 when the order was
changed.

Pointyhat to:	avg
MFC after:	3 days
2010-09-03 08:07:04 +00:00
Pyun YongHyeon
0af3989be9 Initial WOL support. NS DP8315 was tested but SiS900/SiS7016 was
not tested.
While I'm here, clean up SIOCSIFCAP handler.
2010-09-03 00:34:45 +00:00
Pyun YongHyeon
7968da57dc Implement initial device suspend/resume method. 2010-09-02 22:37:13 +00:00
Pyun YongHyeon
94222398d1 Unlike most other controllers, NS DP83815/DP83816 controllers seem
to pad with 0xFF when it encounter short frames.  According to RFC
1042 the pad bytes should be 0x00.
Because manual padding consumes extra CPU cycles, introduce a new
tunable which controls the padding behavior. Turning this tunable
on will have driver pad manually but it's disabled by default. Users
can enable software padding by setting the following tunable to
non-zero value.

dev.sis.%d.manual_pad="1"

PR:	kern/35422 (patch not used)
2010-09-02 18:10:11 +00:00
Pyun YongHyeon
74e8a3238f Fix the last endianness issue on handling station address which
prevented driver from working on big-endian machines. Also rewrite
station address programming to make it work on strict-alignment
architectures. With this change, sis(4) now works on sparc64 and
performance number looks good even though sis(4) have to apply
fixup code to align received frames on 2 bytes boundary on sparc64.
2010-09-02 17:51:41 +00:00
Jung-uk Kim
90017de999 Disable video ROM shadowing by default as I originally intended. I found
a case where video ROM for an IGP is too tightly coupled with system BIOS
to get relocated.
2010-09-02 17:22:12 +00:00
Dag-Erling Smørgrav
2cd149f045 Remove the freelist, which simply duplicates some of the zone allocator's
functionality.

Submitted by:	Daniel Braniss <danny@cs.huji.ac.il>
MFC after:	3 weeks
2010-09-02 14:13:43 +00:00
Alexander Motin
a6c48c7c72 Add fix for SiI3114 and SiI3512 chips bug, which caused sending R_ERR in
response to DMA activate FIS under certain circumstances. This is
recommended fix from chip datasheet. If triggered, this bug most likely
cause write command timeout.

MFC after:	2 weeks
2010-09-02 12:32:29 +00:00
Alexander Motin
a250a687f7 SATA1.x SiliconImage controllers on power-on reset TFD Status register into
value 0xff. On hot-plug this value confuses ata_generic_reset() device
presence detection logic. As soon as we already know drive presence from
SATA hard reset, hint ata_generic_reset() to wait for device signature
until success or full timeout.
2010-09-02 11:18:43 +00:00
Andrew Thompson
ae538d8533 Reduce the need to accesss struct usb_device by providing functions to access
the product, manufacturer and serial strings.

Submitted by:	Hans Petter Selasky
2010-09-02 04:39:45 +00:00
Andrew Thompson
d2d71ce7a8 Add support for power mode filtering as some USB hardware does not support
power saving.

Submitted by:	Hans Petter Selasky
2010-09-02 04:05:00 +00:00
Andrew Thompson
527aa7b226 Change argument for usbd_get_dma_delay() from USB bus to USB device, some
embedded hardware needs to know exactly which device is in question before it
exactly can decide the required delay.

Submitted by:	Hans Petter Selasky
2010-09-02 04:01:18 +00:00
Andrew Thompson
dd5c0f870a Fix setting of the rx_max and tx_max variables. If the expected buffer size is
greater than 65535 bytes then the CDC driver might not work as expected, which
is not likely with the existing USB speeds.

Submitted by:	Hans Petter Selasky
2010-09-02 03:55:08 +00:00
Andrew Thompson
1f27b68522 Fix UMS_BUTTON_MAX define name 2010-09-02 03:52:04 +00:00
Andrew Thompson
13226c4c02 Fix build breakage from r212127 2010-09-02 03:50:11 +00:00
Andrew Thompson
edd913eb1a Add GPIO programming for more PHY hardware.
Submitted by:	yongari
2010-09-02 03:47:07 +00:00
Andrew Thompson
ee6e1a6f5a Add support for extra buttons on the Kensington Slimblade Trackball.
Submitted by:	Lee, Chung-Yeol
2010-09-02 03:44:56 +00:00
Andrew Thompson
a6eb83193e Silence debug error by default.
PR:		usb/141212
Submitted by:	Hans Petter Selasky
2010-09-02 03:42:26 +00:00
Andrew Thompson
8d8bdb018d We need to grab a node reference count to vap->iv_bss before using it as it is
possible for the node to be replaced and freed at any time by
ieee80211_sta_join1().
2010-09-02 03:28:03 +00:00
Pyun YongHyeon
8c6cd8631f Fix stupid error in r212109 which didn't swap DMA maps. This caused
IOMMU panic on sparc64 under high TX load.
2010-09-02 00:44:05 +00:00
Andrew Thompson
910cb8feb9 Add missing MODULE_VERSION() definitions, this resolves problems around
duplicate module loads.

PR:		usb/125736
Submitted by:	danger, mm
Reviewed by:	hselasky
2010-09-01 23:47:53 +00:00
Pyun YongHyeon
7723fa2e04 Move sis_reset() to sis_initl(). This ensures driver starts with
known good state of controller.
2010-09-01 22:50:11 +00:00
Pyun YongHyeon
d199ef7e0d Avoid controller reinitialization which could be triggered by
dhclient(8) or alias addresses are added.

PR:	kern/87506
2010-09-01 22:16:25 +00:00
Pyun YongHyeon
ae9e8d4935 Do not reinitialize controller whenever promiscuous mode or
allmulti is toggled. Controller does not require reinitialization.
This removes unnecessary controller reinitialization whenever
tcpdump is used.
While I'm here remove unnecessary variable reinitialization.
2010-09-01 22:08:23 +00:00
Pyun YongHyeon
fc58ee15ff Report result of link state change to caller. Previously it always
returned success.
2010-09-01 21:44:36 +00:00
Pyun YongHyeon
d7b57e79e5 Overhaul link state change handling. Previously sis(4) blindly
configured TX/RX MACs before getting a valid link. After that, when
link state change callback is called, it called device
initialization again to reconfigure TX/RX MACs depending on
resolved link state. This hack created several bad side effects and
it required more hacks to not collide with sis_tick callback as
well as disabling switching to currently selected media in device
initialization. Also it seems sis(4) was used to be a template
driver for long time so other drivers which was modeled after
sis(4) also should be changed.

TX/RX MACs are now reconfigured after getting a valid link. Fix for
short cable error is also applied after getting a link because it's
only valid when the resolved speed is 100Mbps.

While I'm here slightly reorganize interrupt handler such that
sis(4) always read SIS_ISR register to see whether the interrupt is
ours or not. This change removes another hack and make it possible
to nuke sis_stopped variable in softc.
2010-09-01 21:42:19 +00:00
Pyun YongHyeon
91c265b83d s/u_intXX_t/uintXX_t/g 2010-09-01 19:53:15 +00:00
Pyun YongHyeon
a629f2b183 bus_dma(9) cleanup.
o Enforce TX/RX descriptor ring alignment. NS data sheet says the
   controller needs 4 bytes alignment but use 16 to cover both SiS
   and NS controllers. I don't have SiS data sheet so I'm not sure
   what is alignment restriction of SiS controller but 16 would be
   enough because it's larger than the size of a TX/RX descriptor.
   Previously sis(4) ignored the alignment restriction.
 o Enforce RX buffer alignment, 4.
   Previously sis(4) ignored RX buffer alignment restriction.
 o Limit number of TX DMA segment to be used to 16. It seems
   controller has no restriction on number of DMA segments but
   using more than 16 looks resource waste.
 o Collapse long mbuf chains with m_collapse(9) instead of calling
   expensive m_defrag(9).
 o TX/RX side bus_dmamap_load_mbuf_sg(9) support and remove
   unnecessary callbacks.
 o Initial endianness support.
 o Prefer local alignment fixup code to m_devget(9).
 o Pre-allocate TX/RX mbuf DMA maps instead of creating/destroying
   these maps in fast TX/RX path. On non-x86 architectures, this is
   very expensive operation and there is no need to do that.
 o Add missing bus_dmamap_sync(9) in TX/RX path.
 o watchdog is now unarmed only when there are no pending frames
   on controller. Previously sis(4) blindly unarmed watchdog
   without checking the number of queued frames.
 o For efficiency, loaded DMA map is reused for error frames.
 o DMA map loading failure is now gracefully handled. Previously
   sis(4) ignored any DMA map loading errors.
 o Nuke unused macros which are not appropriate for endianness
   operation.
 o Stop embedding driver maintained structures into descriptor
   rings. Because TX/RX descriptor structures are shared between
   host and controller, frequent bus_dmamap_sync(9) operations are
   required in fast path. Embedding driver structures will increase
   the size of DMA map which in turn will slow down performance.
2010-09-01 19:33:40 +00:00
Pyun YongHyeon
1d885b48c1 Nuke unnecessary return at the end of function. 2010-09-01 18:41:59 +00:00
Pyun YongHyeon
cc26c0fd68 style(9) - space after keywords. 2010-09-01 18:39:35 +00:00
Pyun YongHyeon
8eca70be71 Remove leading and trailing white spaces.
No functional changes.
2010-09-01 18:28:08 +00:00
Alexander Motin
901c71c704 Increase device reset timeout from 10 to 15 seconds, same as in ahci(4).
Some devices found need about 10-12 seconds to spinup.
2010-09-01 06:43:41 +00:00
Pyun YongHyeon
175f87424f Remove unnecessary atomic operation in bge_poll. bge(4) always
holds a driver lock in the function entry and
memory synchronization is handled by bus_dmamap_sync(9).
2010-08-31 20:56:18 +00:00
Jung-uk Kim
c74dea9cc1 Make sure the interrupt entry point is within the video ROM range. We must
not change interrupt vector if it is not pointing the ROM itself.  Actually,
we just fail shadowing altogether if that is the case because the shadowed
copy will be useless for sure and POST may not be relocatable or useful.
While I'm here, fix a debugging message under bootverbose, really.  r211829
fixed one case but broke another.  Mea Culpa.
2010-08-31 20:21:52 +00:00
Pyun YongHyeon
95a0a340f4 bge_txeof() already checks whether it has to free transmitted mbufs
or not by comparing reported TX consumer index with saved index. So
remove unnecessary check done after freeing transmitted mbufs.
While I'm here nuke unnecessary variable initializations.
2010-08-31 19:59:18 +00:00
Pyun YongHyeon
38cc61518b Handle PAE case correctly. You cannot effectively specify a 4GB
boundary in PAE case so use a 2GB boundary for PAE as suggested by
jhb.

Pointed out by:	jhb
Reviewed by:	jhb
2010-08-31 18:48:09 +00:00
Pyun YongHyeon
5b610048ec Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA
tag. All controllers that are not BCM5755 or higher have 4GB
boundary DMA bug. Previously bge(4) used 32bit DMA address to
workaround the bug(r199670). However this caused the use of bounce
buffers such that it resulted in poor performance for systems which
have more than 4GB memory. Because bus_dma(9) honors boundary
restriction requirement of DMA tag for dynamic buffers, having a
separate TX/RX mbuf DMA tag will greatly reduce the possibility of
using bounce buffers. For DMA buffers allocated with
bus_dmamem_alloc(9), now bge(4) explicitly checks whether the
requested memory region crossed the boundary or not.
With this change, only the DMA buffer that crossed the boundary
will use 32bit DMA address. Other DMA buffers are not affected as
separate DMA tag is created for each DMA buffer.
Even if 32bit DMA address space is used for a buffer, the chance to
use bounce buffer is still very low as the size of buffer is small.
This change should eliminate most usage of bounce buffers on
systems that have more than 4GB memory.

More correct fix would be teaching bus_dma(9) to honor boundary
restriction for buffers created with bus_dmamem_alloc(9) but it
seems that is not easy.

While I'm here cleanup bge_dma_map_addr() and remove unnecessary
member variables in bge_dmamap_arg structure.

Tested by:	marcel
2010-08-31 17:33:48 +00:00
Xin LI
08390ba4c9 Drain watchdog callouts before detaching. This prevents a panic while
unloading the kernel module.

Submitted by:	Tom Cough
2010-08-30 21:33:33 +00:00
Xin LI
a806ad4021 Vendor update to version 3.80.06.003 to fix a panic with ZFS when under
heavy I/O load.

Many thanks to LSI for continuing to support FreeBSD.

PR:		kern/149968
Submitted by:	LSI (Tom Couch)
Reported by:	Kai Kockro <kkockro web de>
Tested by:	Kai Kockro, jpaetzel
MFC after:	7 days
2010-08-30 19:15:04 +00:00
Alexander Motin
90400bed63 MFata(4):
Add Intel Cougar Point PCH SATA Controller DeviceIDs. Correct some existing
entries for Intel Ibex Peak (5 Series/3400 Series) PCH SATA controllers.
2010-08-28 07:24:45 +00:00
Alexander Motin
bfc8500c34 Add Intel Cougar Point PCH SATA Controller DeviceIDs. Correct some existing
entries for Intel Ibex Peak (5 Series/3400 Series) PCH SATA controllers.

Submitted by:	jfv@
MFC after:	1 week
2010-08-28 07:10:51 +00:00
Pyun YongHyeon
dd20cce19a Do not allocate multicast array memory in multicast filter
configuration function. For failed memory allocations, em(4)/lem(4)
called panic(9) which is not acceptable on production box.
igb(4)/ixgb(4)/ix(4) allocated the required memory in stack which
consumed 768 bytes of stack memory which looks too big.

To address these issues, allocate multicast array memory in device
attach time and make multicast configuration success under any
conditions. This change also removes the excessive use of memory in
stack.

Reviewed by:	jfv
2010-08-28 00:34:22 +00:00
Jack F Vogel
f0d5a975b3 Add Intel Cougar Point PCH HD Audio Controller ID
MFC in a week
2010-08-28 00:23:13 +00:00
Pyun YongHyeon
880a50b513 If em(4) failed to allocate RX buffers, do not call panic(9).
Just showing some buffer allocation error is more appropriate
action for drivers. This should fix occasional panic reported on
em(4) when driver encountered resource shortage.

Reviewed by:	jfv
2010-08-28 00:16:49 +00:00
Jack F Vogel
6d23f8741b Add Intel Cougar Point PCH LPC Controller Device IDs
for watchdog support. Also add additional Intel Ibex
Peak (5 Series/3400 Series) PCH IDs.

MFC after a week
2010-08-28 00:09:46 +00:00
Pyun YongHyeon
ad1917be37 Do not call voluntary panic(9) in case of if_alloc() failure.
Reviewed by:	jfv
2010-08-28 00:09:19 +00:00
Pyun YongHyeon
5c8080f0d9 Make sure not to access unallocated stats memory.
Reviewed by:	jfv
2010-08-27 23:50:13 +00:00
Jack F Vogel
dce8a362df Add support for Intel Cougar Point SMBus controller.
MFC afer 1 week
2010-08-27 23:24:08 +00:00
Jung-uk Kim
2b13785931 Fix a debugging message under bootverbose. This address is not linear. 2010-08-25 22:48:18 +00:00
Jung-uk Kim
a73f383ee9 Add an experimental feature to shadow video BIOS. Long ago, this trick was
supported by many BIOSes to improve performance of VESA BIOS calls for real
mode OSes but it is not our intention here.  However, this may help some
platforms where the video ROMs are inaccessible after suspend, for example.
Note it may consume up to 64K bytes of contiguous memory depending on video
controller model when it is enabled.  This feature can be disabled by
setting zero to 'debug.vesa.shadow_rom' loader tunable via loader(8) or
loader.conf(5).  The default is 1 (enabled), for now.
2010-08-25 22:09:02 +00:00
Warner Losh
253953cd5b On second thought, we need to force 16-bit mode 2010-08-25 02:09:07 +00:00
Warner Losh
e94b9f21a8 Prodded by Yongari, add support for Holtek HT80232. Add the device
ID, plus the ability to force '16-bit mode' which really means NE-2000
mode.  Other open source drivers suggest that the Holtek misbehaves if
you allow the 8-bit probe.  Also, all of the PCI chips emulate
NE-2000ish cards, so always force 16-bit mode for memory transfers.

PR:		84202 (patch not used)
2010-08-25 02:03:48 +00:00
Pyun YongHyeon
3ca447da3d Remove unnecessary controller reinitialization.
PR:	kern/87506
2010-08-24 19:41:15 +00:00
Pyun YongHyeon
6a085e6341 vr_init_locked() will stop and reset the controller. Remove
unnecessary vr_stop()/vr_reset() calls.
2010-08-24 18:44:12 +00:00
Pyun YongHyeon
9fb40e0a9b Remove unnecessary controller reinitialization.
CAM filter handling was rewritten long time ago so it should not
require controller reinitialization.

PR:	kern/87506
2010-08-24 18:40:11 +00:00
Pyun YongHyeon
7c45b43651 Add PNP id for Compex RL2000.
I'm not sure whether adding this logical id is correct or not
because Compex RL2000 is in the list of supported hardware list.
I guess the Compex RL2000 could be PCI variant while the controller
in question is ISA controller. It seems PNP compat id didn't match
or it had multiple compat ids so isa_pnp_probe() seemed to return
ENOENT.

PR:	kern/80853
2010-08-24 18:17:40 +00:00
Pyun YongHyeon
820b53e152 Fix a possible unaligned access to savebyte array.
PR:	kern/122195
2010-08-23 21:40:03 +00:00
Pyun YongHyeon
9ae11bbaa6 Implement basic WOL support. Note, not all xl(4) controllers
support WOL. Some controllers require additional 3-wire auxiliary
remote wakeup connector to draw power. More recent xl(4)
controllers may not need the wakeup connector though.
2010-08-23 19:18:50 +00:00
Pyun YongHyeon
ac68109179 Move xl_reset() to xl_init_locked(). This will make driver
initialize controller from a known good state. Previously driver
used to issue controller reset while TX/RX DMA are in progress.
I guess resetting controller in active TX/RX DMA cycle is to ensure
stopping I/Os in xl_shutdown(). I remember some buggy controllers
didn't respond with stop command if controller is under high
network load at the time of shutdown so resetting controller was
the only safe way to stop the I/Os. However, from my experiments,
controller always responded with stop command under high network
load so I think it's okay to remove the xl_reset() in
device_shutdown handler.
Resetting controller also will clear configured RX filter which
in turn will make WOL support hard because driver have to reprogram
RX filter in WOL handler as well as setting station address.
2010-08-23 18:51:31 +00:00
Pyun YongHyeon
27b031a9ad Remove unnecessary controller reinitialization by checking
IFF_DRV_RUNNING flag.
2010-08-23 00:31:55 +00:00
Pyun YongHyeon
a3835274a4 Clean up SIOCSIFCAP handler and allow RX checksum offloading could
be controlled by user.
2010-08-23 00:24:12 +00:00
Pyun YongHyeon
35f945cd62 It seems all Broadcom controllers have a bug that can generate UDP
datagrams with checksum value 0 when TX UDP checksum offloading is
enabled.  Generating UDP checksum value 0 is RFC 768 violation.
Even though the probability of generating such UDP datagrams is
low, I don't want to see FreeBSD boxes to inject such datagrams
into network so disable UDP checksum offloading by default.  Users
still override this behavior by setting a sysctl variable or loader
tunable, dev.bge.%d.forced_udpcsum.

I have no idea why this issue was not reported so far given that
bge(4) is one of the most commonly used controller on high-end
server class systems. Thanks to andre@ who passed the PR to me.

PR:	kern/104826
2010-08-22 01:39:09 +00:00
Pyun YongHyeon
7e32f79a44 Load tunable from loader.conf(5) instead of device.hints(5). 2010-08-21 23:13:16 +00:00
Jack F Vogel
1ed622958d Eliminate the ambiguous queue setting logic for
the VF, it made it possible to have 2 queues which
we don't want, the HOST is unable to handle it.
2010-08-19 17:00:33 +00:00
Rui Paulo
187278cadc For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in
Makefiles or *.mk files, use ${CC:T:Mfoo} instead, so only the basename
of the compiler command (excluding any arguments) is considered.

This allows you to use, for example, CC="/nondefault/path/clang -xxx",
and still have the various tests in bsd.*.mk identify your compiler as
clang correctly.

ICC if cases were also changed.

Submitted by:	Dimitry Andric <dimitry at andric.com>
2010-08-17 20:39:28 +00:00
Adrian Chadd
a122fea4ff Add s25sl064a, an 8mb SPI flash part. 2010-08-17 16:27:13 +00:00
John Baldwin
62508c531e Add a new method to the PCI bridge interface, PCIB_POWER_FOR_SLEEP(). This
method is used by the PCI bus driver to query the power management system
to determine the proper device state to be used for a device during suspend
and resume.  For the ACPI PCI bridge drivers this calls
acpi_device_pwr_for_sleep().  This removes ACPI-specific knowledge from
the PCI and PCI-PCI bridge drivers.

Reviewed by:	jkim
2010-08-17 15:44:52 +00:00
Navdeep Parhar
21d68a68bf Fix tx pause quanta and timer calculations.
MFC after:	3 days
2010-08-15 20:52:15 +00:00
Navdeep Parhar
3dd6d7570f Always reset the XGMAC's XAUI PCS on a link up.
MFC after:	3 days
2010-08-15 20:45:16 +00:00
Navdeep Parhar
61cb6c9076 wakeup is required if the adapter lock is released anywhere during
init and not just for the may_sleep case.

Pointed out by:	Isilon
MFC after:	3 days
2010-08-15 20:34:51 +00:00
Adrian Chadd
f70c72aa0c Fix indenting/whitespace issues introduced by me. 2010-08-15 11:40:53 +00:00
Adrian Chadd
5674f4a799 The comment is misleading - that register setting seems to kick off the
initial chip NF cal.
2010-08-15 11:32:05 +00:00
Bernhard Schmidt
ad8e331bf2 Introduce IEEE80211_C_RATECTL, drivers which use the ratectl framework
should set this capability.

MFC after:	2 weeks
2010-08-14 20:12:10 +00:00
Adrian Chadd
627e7864f1 A local addition, not imported from ath9k.
AR_PHY_CALMODE is explicitly reset on interface reset for other chipsets;
this commit also sets it for the AR9160.
2010-08-14 15:48:18 +00:00
Adrian Chadd
6a0c1a60c0 * Merge in AR9160 initval updates from Linux-2.6.34.
* Grab the AR_PHY_CCA and AR_PHY_EXT_CCA initvals from Linux wireless-testing.

Obtained from: Linux-2.6.34
2010-08-14 15:46:18 +00:00
Adrian Chadd
49d2d79b7a Merge in a fix for the power/(gain?) calculation. Apply it to both
the 5416/9160 and 9285 code paths.

Obtained from:	OpenWRT r22123, 522-ath9k_pwrcal_fix.patch
2010-08-14 15:29:21 +00:00
Adrian Chadd
8f279cf6e7 Fix the calibration logic to correctly clamp the calculated coefficient.
Obtained from:	OpenWRT r22123, 521-ath9k_iqcal_fix.patch
2010-08-14 15:28:15 +00:00
Adrian Chadd
e8dabfbea9 Export ath stats via snmp, rather than requiring a debugging interface
and "athstats".
2010-08-14 14:18:02 +00:00
Adrian Chadd
7ec4e6b83b Add a global counter of missed beacons.
The existing missed beacon count is reset once a beacon isn't missed.
2010-08-14 14:01:12 +00:00
Pyun YongHyeon
5bec76e720 Make sure to disable RX MAC in alc_stop_mac(). Previously there
was a logic error which it always enabled RX MAC.
2010-08-13 19:39:33 +00:00
Adrian Chadd
d86cdfe4b0 * Fix indentation
* Restore comment erroneously deleted from the previous commit
2010-08-12 08:39:54 +00:00