Commit Graph

21526 Commits

Author SHA1 Message Date
Jung-uk Kim
e1c9d39ebe Stop lying about supporting cpu_est_clockrate() when TSC is invariant. This
function always returned the nominal frequency instead of current frequency
because we use RDTSC instruction to calculate difference in CPU ticks, which
is supposedly constant for the case.  Now we support cpu_get_nominal_mhz()
for the case, instead.  Note it should be just enough for most usage cases
because cpu_est_clockrate() is often times abused to find maximum frequency
of the processor.
2010-12-14 20:07:51 +00:00
Pyun YongHyeon
e23559db8e Remove unecessary and clearly wrong usage of atomic(9).
Reported by:  avg
2010-12-14 17:39:10 +00:00
Andriy Gapon
c82eedb465 acpi_fujitsu: update for P8010
PR:		kern/121102
Submitted by:	Anish Mistry <amistry@am-productions.biz>
MFC after:	3 weeks
2010-12-11 10:55:18 +00:00
Andriy Gapon
d009878bb9 fix atomic_set_xxx misuse in drm
It seems that atomic_set_xxx and atomic_store_xxx were confused.

Reviewed by:	jhb
MFC after:	3 weeks
2010-12-11 10:18:05 +00:00
Andriy Gapon
5579e006db fix incorrect use of atomic_set_xxx in cxgb
There is no need to use an atomic operation at structure initialization
time.
Note that the file changed is not connected to the build at this time.

Reviewed by:	jhb (general issue)
Approved by:	np
MFC after:	2 weeks
2010-12-11 10:14:08 +00:00
Kenneth D. Merry
d970279c91 Fix setting LUN numbers in the mps(4) driver.
Prior to this change, the addressing method wasn't getting set, and
so the LUN field could be set incorrectly in some instances.

This fix should allow for LUN numbers up to 16777215 (and return an error
for anything larger, which wouldn't fit into the flat addressing model).

Submitted by:	scottl (in part)
2010-12-11 00:36:35 +00:00
Joerg Wunsch
029e96939d Implement more of __ibsta: END and SRQI status bits (taken out of the
uPD7210 IRQ status).

MFC after:	1 week
2010-12-10 22:20:11 +00:00
Kenneth D. Merry
49dfe4a2d4 Fix an event handling bug with the mps(4) driver.
This bug manifested itself after repeated device arrivals and
departures.  The root of the problem was that the last entry in the
reply array wasn't initialized/allocated.  So every time we got
around to that event, we had a bogus address.

There were a couple more problems with the code that are also fixed:

 - The reply mechanism was being treated as sequential (indexed by
   sc->replycurindex) even though the spec says that the driver
   should use the ReplyFrameAddress field of the post queue
   descriptor to figure out where the reply is.  There is no
   guarantee that the reply descriptors will be used in sequential
   order.

 - The second word of the reply post queue descriptor wasn't being
   checked in mps_intr_locked() to make sure that it wasn't
   0xffffffff.  So the driver could potentially come across a
   partially DMAed descriptor.

 - The number of replies allocated was one less than the actual
   size of the queue.  Instead, it was the size of the number of
   replies that can be used at one time.  (Which is one less than
   the size of the queue.)

mps.c:		When initializing the entries in the reply free
		queue, make sure we initialize the full number that
		we tell the chip we have (sc->fqdepth), not the
		number that can be used at any one time (sc->num_replies).

		When allocating replies, make sure we allocate the
		number of replies that we've told the chip exist,
		not just the number that can be used simultaneously.

		Use the ReplyFrameAddress field of the post queue
		descriptor to figure out which reply is being
		referenced.  This is what the spec says to do, and
		the spec doesn't guarantee that the replies will be
		used in order.

		Put a check in to verify that the reply address passed
		back from the card is valid.  (Panic if it isn't, we'll
		panic when we try to deference the reply pointer in any
		case.)

		In mps_intr_locked(), verify that the second word of the
		post queue descriptor is not 0xffffffff in addition to
		verifying that the unused flag is not set, so we can
		make sure we didn't get a partially DMAed descriptor.

		Remove references to sc->replycurindex, it isn't needed
		now.

mpsvar.h:	Remove replycurindex from the softc, it isn't needed now.

Reviewed by:	scottl
2010-12-10 21:45:10 +00:00
Pyun YongHyeon
7e86a37e0d Remove unecessary and clearly wrong usage of atomic(9).
Reported by:	avg, jhb, attilio
2010-12-10 21:43:20 +00:00
Andreas Tobler
7cea3d952b On the Xserve G5 we find the LM75 instead of the DS1775. The core
functionality is the same, a difference is that the DS1775 has a better
precision than the LM75. But we do not use it in our setup. Make the
LM75 work the same as the DS1775.

Fix a typo in device_set_desc.

Tested by: Paul Mather <paul at gromit dlib vt edu>

Approved by:	nwhitehorn (mentor)
2010-12-10 20:27:50 +00:00
Tijl Coosemans
61faa8d87d Use SYS_RES_IOPORT instead of PCIM_CMD_PORTEN when calling pci_enable_io.
Approved by:	kib (mentor)
2010-12-10 15:05:49 +00:00
Joerg Wunsch
933be1f00c Fix __retval vs. retval confusion: retval is meant to store the (userland)
pointer where data is to be returned by ibask() (currently unimplemented),
while __retval holds the value returned by the libgpib ibfoo() functions.

The confusion resulted in the ibfoo() functions returning an uninitialized
value except in situations where the GPIB activity has been terminated
abnormally.

MFC after:	3 days
2010-12-10 14:04:41 +00:00
Alexander Motin
ee65f30a14 Add IDs of HighPoint RocketRAID 62x cards (Marvell 88SE9128 chips).
PR:		kern/152926
Submitted by:	Mike Tancsa <mike@sentex.net>
MFC after:	1 week
2010-12-08 20:35:20 +00:00
Attilio Rao
cb1f5a37e9 Use convenience macro for minimum and maximum value capping when
re-arming the watchdog timeout.

Sponsored by:	Sandvine Incorporated
Submitted by:	Mark Johnston <mjohnston at sandvine dot com>
Reviewed by:	des
MFC after:	10 days
2010-12-08 15:32:54 +00:00
Pyun YongHyeon
65c12bf571 r184610 changed the way how TX frames are handled on AX88178 and
AX88772 controllers. ASIX added a new feature for AX88178/AX88772
controllers which allows combining multiple TX frames into a single
big frame. This was to overcome one of USB limitation where it
can't generate more than 8k interrupts/sec which in turn means USB
ethernet controllers can not send more than 8k packets per second.
Using ASIX's feature greatly enhanced TX performance(more than 3~4
times) compared to 7.x driver. However it seems r184610 removed
boundary checking for buffered frames which in turn caused
instability issues under certain conditions. In addition, using
ASIX's feature triggered another issue which made USB controller
hang under certain conditions. Restarting ethernet controller
didn't help under this hang condition and unplugging and replugging
the controller was the only solution. I believe there is a silicon
bug in TX frame combining feature on AX88178/AX88772 controllers.

To address these issues, reintroduce the boundary checking for both
AX88178 and AX88772 after copying a frame to USB buffer and do not
use ASIX's multiple frame combining feature. Instead, use USB
controller's multi-frame transmit capability to enhance TX
performance as suggested by Hans[1].
This should fix a long standing axe(4) instability issues reported
on AX88772 and AX88178 controllers. While I'm here remove
unnecessary TX frame length check since upper stack always
guarantee the size of a frame to be less than MCLBYTES.

Special thanks to Derrick Brashear who tried numerous patches
during last 4 months and waited real fix with patience. Without
this enthusiastic support, patience and H/W donation I couldn't fix
it since I was not able to trigger the issue on my box.

Suggested by:	hselasky [1]
Tested by:	Derrick Brashear (shadow <> gmail dot com>
H/W donated by:	Derrick Brashear (shadow <> gmail dot com>
PR:		usb/140883
2010-12-08 01:24:05 +00:00
Weongyo Jeong
6e3cb00068 Introduces IFF_CANTCONFIG interface flag to point that the interface
isn't configurable in a meaningful way.  This is for ifconfig(8) or
other tools not to change code whenever IFT_USB-like interfaces are
registered at the interface list.

Reviewed by:	brooks
No objections:	gavin, jkim
2010-12-07 20:23:47 +00:00
Ed Maste
0c761ee78d Add a comment to clarify that some BIOSes may clear the hw watchdog
indicator bit, preventing us from reporting in that case.

X-MFC-with:	r215868
2010-12-07 19:18:00 +00:00
John Baldwin
4a588c1ba7 Use proper resource ID's for HPET IRQ resources. This mostly consists of
looking to see if there is an existing IRQ resource for a given IRQ
provided by the BIOS and using that RID if so.  Otherwise, allocate a new
RID for the new IRQ.

Reviewed by:	mav (a while ago)
2010-12-07 18:49:11 +00:00
Hans Petter Selasky
0e777d8457 Re-add a status check which sneaked out during r214804.
This change can fix some USB error messages showing up
during bootup.

MFC after:	3 days
Approved by:	thompsa (mentor)
2010-12-07 08:20:20 +00:00
Colin Percival
518c824362 Set correct maximum I/O length. We can only handle I/O of up to
max_request_segments * PAGE_SIZE if the I/O is page-aligned; the
largest I/O we can guarantee will work is PAGE_SIZE less than that.
This unbreaks 'diskinfo -t'.
2010-12-06 20:40:15 +00:00
Bernhard Schmidt
3934c8a53f Fix scanning after loosing a connection. The firmware assumes that as long
as an association ID is set any scan is supposed to be a background scan.
This implies that the firmware will switch back to the associated channel
after a certain threshold, though, we are not notified about that. We
currently catch this case by a timer which will reset the firmware after
a 'scan timeout', though, upper layers are not notified about that and
will simply hang until manual intervention. Fix this by resetting the
firmware's knowledge about any association on RUN -> ASSOC and
!INIT -> SCAN transitions.

Tested by:	Zhihao Yuan <lichray at gmail.com>
MFC after:	1 week
2010-12-06 19:05:44 +00:00
Bernhard Schmidt
1b6b62c900 Fixes for monitor mode:
- Do not call iwn_calib_reset() for monitor mode. We do not want to query
  information and do runtime calibration while in monitor mode. Poking the
  firmware with adjustments for calibration results in firmware asserts.
  This could happened on RUN -> RUN transition only.
- Adjust blink rate for monitor mode. It's supposed to not freak out and
  turn off after a while.
- While here, remove one useless assignment of calib.state, it gets
  overwritten later in the function.

Submitted by:	Brandon Gooch <jamesbrandongooch at gmail.com>
MFC after:	1 week
2010-12-06 18:28:39 +00:00
John Baldwin
6074a71604 When masking direct and processor devices during an inquiry, properly
preserve the upper bits of the first data byte.

Reviewed by:	scottl
MFC after:	1 week
2010-12-06 17:06:21 +00:00
John Baldwin
b596082ba7 When masking direct and processor devices during an inquiry, properly
preserve the upper bits of the first data byte.

While here, shorten a few nearby lines.

PR:		kern/152768
Reported by:	Sascha Wildner  saw of online.de
Reviewed by:	scottl
MFC after:	1 week
2010-12-06 17:02:56 +00:00
Kevin Lo
7df9d5acad Fix double ;; 2010-12-06 10:24:06 +00:00
Bernhard Schmidt
2d5c617a52 For 6000 series and newer devices the DC calibration results are no
longer requested of the boot firmware. Instead of sending those results
to the runtime firmware the firmware is told to do the DC calibration
itself.

MFC after:	1 week
2010-12-05 09:00:32 +00:00
Jack F Vogel
1ce42f7249 Correct build error. 2010-12-04 06:38:21 +00:00
Jack F Vogel
aa8dea58c6 Remove the bogus test in the TX context setup for IPV6,
the size can be smaller than the constant when you are
doing HW TAGGING, and you still need to process this
packet in a normal way. I'm not sure where the notion
to just return came from, but its wrong.

MFC after: 3 days
2010-12-04 02:04:02 +00:00
Jack F Vogel
9d43b64dbf Small cut and paste bug in flow control string fixed.
Second, correct the discard/refresh_mbufs code to behave
more like igb, there have been panics due to discards and
this should fix them.

MFC after: 3 days
2010-12-04 01:59:58 +00:00
Jack F Vogel
43fcb978a7 This small little change is a bug that drove me nuts
finding. The test to compare the mbuf m_len against
a fixed value and then returning needs to be removed.

When using VLANS and doing HW_TAGGING, and IPV6, the
ICMP6 packets actually fail this condition, the constant
assumes that the tag is IN the frame, and its not, so
the length is actually tiny. Furthermore, I'm not sure
what the point was to just return??

MFC after: 3 days
2010-12-04 01:43:38 +00:00
Pyun YongHyeon
6e854927d1 If RX lockup workaround is enabled, fxp(4) will periodically reset
the controller to workaround silicon bug of i82557. Each reset will
re-establish link which in turn triggers MII status change
callback. The callback will try to reconfigure controller if the
controller is not i82557 to enable flow-control. This caused
endless link UP/DOWN when the workaround was enabled on non-i82557
controller.

To fix the issue, apply RX lockup workaround only for i82557.
Previously it blindly checked undocumented EEPROM location such
that it sometimes enabled the workaround for other controllers. At
this time, only i82557 is known to have the silicon bug.
This fixes a regression introduced in r215906 which enabled flow
control support for all controllers except i82557.

Reported by:	Karl Denninger (karl <> denninger dot net)
Tested by:	Karl Denninger (karl <> denninger dot net)
MFC after:	3 days
2010-12-02 03:53:29 +00:00
Weongyo Jeong
b172e30376 Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's attached
or detached.  Normally it should be changed through user land ioctl(2)
system calls but it looks there's no apps for USB and no need.

With this patch, libpcap would detect the usbus interfaces correctly and
tcpdump(1) could dump the USB packets into PCAP format with -w option.
However it couldn't print the output to console because there's no
printer-routine at tcpdump(1).
2010-12-01 03:51:06 +00:00
Kenneth D. Merry
06e794928b Add Serial Management Protocol (SMP) passthrough support to CAM.
This includes support in the kernel, camcontrol(8), libcam and the mps(4)
driver for SMP passthrough.

The CAM SCSI probe code has been modified to fetch Inquiry VPD page 0x00
to determine supported pages, and will now fetch page 0x83 in addition to
page 0x80 if supported.

Add two new CAM CCBs, XPT_SMP_IO, and XPT_GDEV_ADVINFO.  The SMP CCB is
intended for SMP requests and responses.  The ADVINFO is currently used to
fetch cached VPD page 0x83 data from the transport layer, but is intended
to be extensible to fetch other types of device-specific data.

SMP-only devices are not currently represented in the CAM topology, and so
the current semantics are that the SIM will route SMP CCBs to either the
addressed device, if it contains an SMP target, or its parent, if it
contains an SMP target.  (This is noted in cam_ccb.h, since it will change
later once we have the ability to have SMP-only devices in CAM's topology.)

smp_all.c,
smp_all.h:		New helper routines for SMP.  This includes
			SMP request building routines, response parsing
			routines, error decoding routines, and structure
			definitions for a number of SMP commands.

libcam/Makefile:	Add smp_all.c to libcam, so that SMP functionality
			is available to userland applications.

camcontrol.8,
camcontrol.c:		Add smp passthrough support to camcontrol.  Several
			new subcommands are now available:

			'smpcmd' functions much like 'cmd', except that it
			allows the user to send generic SMP commands.

			'smprg' sends the SMP report general command, and
			displays the decoded output.  It will automatically
			fetch extended output if it is available.

			'smppc' sends the SMP phy control command, with any
			number of potential options.  Among other things,
			this allows the user to reset a phy on a SAS
			expander, or disable a phy on an expander.

			'smpmaninfo' sends the SMP report manufacturer
			information and displays the decoded output.

			'smpphylist' displays a list of phys on an
			expander, and the CAM devices attached to those
			phys, if any.

cam.h,
cam.c:			Add a status value for SMP errors
			(CAM_SMP_STATUS_ERROR).

			Add a missing description for CAM_SCSI_IT_NEXUS_LOST.

			Add support for SMP commands to cam_error_string().

cam_ccb.h:		Rename the CAM_DIR_RESV flag to CAM_DIR_BOTH.  SMP
			commands are by nature bi-directional, and we may
			need to support bi-directional SCSI commands later.

			Add the XPT_SMP_IO CCB.  Since SMP commands are
			bi-directional, there are pointers for both the
			request and response.

			Add a fill routine for SMP CCBs.

			Add the XPT_GDEV_ADVINFO CCB.  This is currently
			used to fetch cached page 0x83 data from the
			transport later, but is extensible to fetch many
			other types of data.

cam_periph.c:		Add support in cam_periph_mapmem() for XPT_SMP_IO
			and XPT_GDEV_ADVINFO CCBs.

cam_xpt.c:		Add support for executing XPT_SMP_IO CCBs.

cam_xpt_internal.h:	Add fields for VPD pages 0x00 and 0x83 in struct
			cam_ed.

scsi_all.c:		Add scsi_get_sas_addr(), a function that parses
			VPD page 0x83 data and pulls out a SAS address.

scsi_all.h:		Add VPD page 0x00 and 0x83 structures, and a
			prototype for scsi_get_sas_addr().

scsi_pass.c:		Add support for mapping buffers in XPT_SMP_IO and
			XPT_GDEV_ADVINFO CCBs.

scsi_xpt.c:		In the SCSI probe code, first ask the device for
			VPD page 0x00.  If any VPD pages are supported,
			that page is required to be implemented.  Based on
			the response, we may probe for the serial number
			(page 0x80) or device id (page 0x83).

			Add support for the XPT_GDEV_ADVINFO CCB.

sys/conf/files:		Add smp_all.c.

mps.c:			Add support for passing in a uio in mps_map_command(),
			so we can map a S/G list at once.

			Add support for SMP passthrough commands in
			mps_data_cb().  SMP is a special case, because the
			first buffer in the S/G list is outbound and the
			second buffer is inbound.

			Add support for warning the user if the busdma code
			comes back with more buffers than will work for the
			command.  This will, for example, help the user
			determine why an SMP command failed if busdma comes
			back with three buffers.

mps_pci.c:		Add sys/uio.h.

mps_sas.c:		Add the SAS address and the parent handle to the
			list of fields we pull from device page 0 and cache
			in struct mpssas_target.  These are needed for SMP
			passthrough.

			Add support for the XPT_SMP_IO CCB.  For now, this
			CCB is routed to the addressed device if it supports
			SMP, or to its parent if it does not and the parent
			does.  This is necessary because CAM does not
			currently support SMP-only nodes in the topology.

			Make SMP passthrough support conditional on
			__FreeBSD_version >= 900026.  This will make it
			easier to MFC this change to the driver without
			MFCing the CAM changes as well.

mps_user.c:		Un-staticize mpi_init_sge() so we can use it for
			the SMP passthrough code.

mpsvar.h:		Add a uio and iovecs into struct mps_command for
			SMP passthrough commands.

			Add a cm_max_segs field to struct mps_command so
			that we can warn the user if busdma comes back with
			too many segments.

			Clear the cm_reply when a command gets freed.  If
			it is not cleared, reply frames will eventually get
			freed into the pool multiple times and corrupt the
			pool.  (This fix is from scottl.)

			Add a prototype for mpi_init_sge().

sys/param.h:		Bump __FreeBSD_version to 900026 for the for the
			inclusion of the XPT_GDEV_ADVINFO and XPT_SMP_IO
			CAM CCBs.
2010-11-30 22:39:46 +00:00
Marius Strobl
978f2704bd - Remove the remaining support for older (in this case pre-7.0-RELEASE)
versions of FreeBSD. In fact we are already missing a lot of conditional
  code necessary to support older versions of FreeBSD, including alternatives
  for vital functionality not yet provided by the respective subsystem back
  then (see for example r199663). So this change shouldn't actually break
  this driver on versions of FreeBSD that were supported before. Besides,
  this driver also isn't maintained as an multi-release version outside of
  the main repository, so removing the conditional code shouldn't be a
  problem in that regard either.
- Sprinkle some more const on tables.
2010-11-30 21:08:59 +00:00
Jung-uk Kim
1658038ce7 Rename a variable to match scvidctl.c. 2010-11-30 17:34:15 +00:00
Jung-uk Kim
732e8e1632 Stop hardcoding default font size. 2010-11-30 17:32:28 +00:00
Jung-uk Kim
fd7a9ebcca Clean up code a bit to make it more readable. 2010-11-30 16:46:15 +00:00
Hans Petter Selasky
02c4024199 We need to define a cdev variable associated with each USB device,
hence existing applications like webcamd are expecting that.
This problem was introduced by SVN change 214221 where cdev=
was replaced by ugen= by accident. Solve this problem by
redefining cdev= in devd notifications.

MFC after 3 days.

Approved by:	thompsa (mentor)
2010-11-30 08:25:57 +00:00
Jung-uk Kim
82515b4f1f Clean up code a bit to make it more readable. 2010-11-29 22:20:44 +00:00
Jung-uk Kim
0cb06f72d5 Honor font size for the video mode when default fonts are compiled in kernel
and VESA mode is enabled from loader.
2010-11-29 22:19:19 +00:00
MIHIRA Sanpei Yoshiro
54de08a963 Add new device ids.
Buffalo (Melco Inc.) WLI-UC-G

PR:		141777
2010-11-29 15:08:18 +00:00
Gavin Atkinson
f6fa0b2b95 Support the Falcom Twist USB GSM/GPRS modem in uftdi(4)
PR:		usb/151862
Submitted by:	Alessandro de Manzano <demanzano dqmicro.it>
MFC after:	1 week
2010-11-29 08:17:44 +00:00
Marius Strobl
1510a2b019 Several chipset drivers alter parameters relevant for the DMA tag creation,
i.e. alignment, max_address, max_iosize and segsize (only max_address is
thought to have an negative impact regarding this issue though), after
calling ata_dmainit() either directly or indirectly so these values have
no effect or at least no effect on the DMA tags and the defaults are used
for the latter instead. So change the drivers to set these parameters
up-front and ata_dmainit() to honor them.

Reviewd by:	mav
MFC after:	1 month
2010-11-28 18:53:29 +00:00
Pyun YongHyeon
45b0a3494d Add initial AX88772A support.
H/W donated by:	Derrick Brashear (shadow <> gmail dot com)
2010-11-28 01:56:44 +00:00
Pyun YongHyeon
8c09fbe458 Introduce new macro AXE_IS_178_FAMILY and AXE_IS_772. Include
AX88772A and AX88772B for future extension. While here add TX
buffer size for 178 family controllers.
2010-11-28 01:43:28 +00:00
Pyun YongHyeon
ff5fbbc49b Do full controller initialization in axe_reset() for controllers
that require special configuration from EEPROM. This will put
controllers into known sane state.
2010-11-28 01:16:37 +00:00
Pyun YongHyeon
d743bdd2f6 Make sure to change to currently selected media. 2010-11-28 01:03:06 +00:00
Pyun YongHyeon
0369b60472 Do not reinitialize controller if it's already running. 2010-11-28 01:00:39 +00:00
Pyun YongHyeon
675c1ae83d Move axe_reset() to axe_init(). 2010-11-28 00:57:48 +00:00
Pyun YongHyeon
6dd81ec722 Apply GPIO configuration for all CICADA PHYs.
While I'm here show selected phymode to ease of debugging.
2010-11-28 00:52:02 +00:00
Matt Jacob
c4f65bca0b Partially revert 208119. We were overwriting tunable settings.
Obtained from:	Oleg Sharoyko
MFC after:	1 week
2010-11-27 20:33:08 +00:00
Alexander Motin
8a1d183fb7 Do hard reset before soft reset for SATA channels. Soft reset reported to be
not enough to restore device readiness in some situations.

Tested by: 	Roger Hammerstein <cheeky.m@live.com> on ServerWorks HT1000.
2010-11-27 07:03:31 +00:00
Jack F Vogel
f0fe67b43c Interrupt handler, and stats changes from Michael Tuexen,
thanks Michael!
2010-11-27 01:34:09 +00:00
Marius Strobl
12d314a661 Allow pause support advertisement to be turned off again.
Submitted by:	yongari (ip1000phy(4))
2010-11-27 01:26:59 +00:00
Ed Maste
84fe19c742 Fix build by correcting function name. Pointed out by dougb. 2010-11-27 00:26:19 +00:00
Jack F Vogel
38104ecc27 and the header... 2010-11-27 00:00:33 +00:00
Jack F Vogel
aa26851c4f A couple fixes got clobbered, putting them back. 2010-11-26 23:57:13 +00:00
Jack F Vogel
1a4e34498c Update ixgbe driver to verion 2.3.6
- This adds a VM SRIOV interface, ixv, it is however
	  transparent to the user, it links with the ixgbe.ko,
	  but when ixgbe is loaded in a virtualized guest with
	  SRIOV configured this will be detected.
	- Sync shared code to latest
	- Many bug fixes and improvements, thanks to everyone
	  who has been using the driver and reporting issues.
2010-11-26 22:46:32 +00:00
Jack F Vogel
f4b4ba3ed2 Unwanted extra call to set_vlan_hw added back by mistake. 2010-11-26 22:36:47 +00:00
Marius Strobl
1845b5c37b Fix and implement missing parts of flow control support. This also removes
the dev.fxp.%d.noflow tunable as the same effect can now be achieved with
ifconfig(8) by setting the flowcontrol media option as desired (besides
the tunable never having a chance to actually enable flow control support
so far).
In joint forces with:	yongari
2010-11-26 21:52:33 +00:00
Marius Strobl
60c1e4c405 Ensure Bay flow control is disabled as we're going to use IEEE 802.3 annex
31B full duplex flow control instead.
2010-11-26 21:41:42 +00:00
Attilio Rao
fe4424cbbd - Advertise when the reboot came from a watchdog-induced reset.
- Fix a bug where TCO_BOOT_STS was supposed to be cleared after
  TCO_SECOND_TO_STS and not before.

Sponsored by:	Sandvine Incorporated
Submitted by:	Mark Johnston <mjohnston at sandvine dot com>
Reviewed by:	des
MFC after:	10 days
2010-11-26 15:35:08 +00:00
Pyun YongHyeon
9f4e8f4601 Enable ethernet flow-control on all alc(4) controllers. This change
should reduce a lot of dropped frames under high network load.
2010-11-26 02:10:56 +00:00
Pyun YongHyeon
fc519a189b Enable ethernet flow-control on all jme(4) controllers. 2010-11-26 02:01:16 +00:00
Pyun YongHyeon
7bcbe6cb58 Allocate 1 MSI/MSI-X vector. Originally jme(4) was designed to
support multi-queue but the hardware limitation made it hard to
implement supporting multi-queue. Allocating more than necessary
vectors is resource waste and it can be added back when we
implement multi-queue support.
2010-11-26 01:58:25 +00:00
Pyun YongHyeon
cd96c3c984 Disable retrying RX descriptor loading. The counter is used to set
number of retry to be performed whenever controller found RX
descriptor was empty. RX empty interrupt is generated only when the
retry counter is over. Experimentation shows retrying RX descriptor
loading increased number of dropped frames under flow-control
enabled environments so disable it and have controller generate RX
empty interrupt as fast as it can.
While I'm here fix RXCSR_DESC_RT_CNT macro.
2010-11-26 01:48:29 +00:00
Weongyo Jeong
b443638277 Removes a unused function `usb_bus_find'. 2010-11-25 22:56:26 +00:00
Brian Somers
86e38263d2 Don't zero 'Info' after setting it up in the ASR_IOCTL_COMPAT case.
MFC after:	2 days
2010-11-25 21:51:43 +00:00
John Baldwin
9d76324839 Add device IDs for two more ServerWorks Host-PCI bridges so that we can
read their starting PCI bus number for older systems that do not support
ACPI (or have a broken _BBN method).

PR:		kern/148108
MFC after:	1 week
2010-11-25 15:42:33 +00:00
Weongyo Jeong
fe1c24e3d6 Handles the unit number correctly that the previous commit had a problem
(wrong unit number for a host controller) when the module is load /
unloaded repeatly.  Attaching the USB pf is moved to usbus device's
attach.

Pointed by:	yongari
2010-11-25 03:30:43 +00:00
Weongyo Jeong
537e254f0a Assigning the unit number for each interfaces could not use ubus->parent
because it could differ depending on the host controller type.  It could
lead the duplicate unit number assignment.
2010-11-25 03:02:53 +00:00
Jack F Vogel
12203744da The purpose of this change is to add a routine to
disable ASPM L0S and L1 LINK states on 82573, 82574,
and 82583. The theory is that this is behind certain
hangs being experienced by some customers.

Also included a small optimization in the rxeof routine
that was in my internal code.

Change the PBA size for pchlan, it was incorrect.

MFC after: 3 days
2010-11-24 22:24:07 +00:00
Weongyo Jeong
10798b4875 Fixes a compiler warning when it's compiled with INVARIANTS.
Pointy hat to:	me
2010-11-24 21:43:36 +00:00
Weongyo Jeong
e376f9c3e7 Removes all duplicated code with BPF that it's greatly simplified and
take all benefits whenever BPF code is improved.

Pointed by:	jkim
Reviewed by:	thompsa
2010-11-24 19:11:32 +00:00
Jack F Vogel
ffdb071a24 Add shared code glue for new 82580 devices. 2010-11-24 01:13:55 +00:00
Jack F Vogel
46b9f1ff9f - New 82580 devices supported
- Fixes from John Baldwin: vlan shadow tables made per/interface,
  make vlan hw setup only happen when capability enabled, and
  finally, make a tuneable interrupt rate. Thanks John!
- Tweaked watchdog handling to avoid any false positives, now
  detection is in the TX clean path, with only the final check
  and init happening in the local timer.
- limit queues to 8 for all devices, with 82576 or 82580 on
  larger machines it can get greater than this, and it seems
  mostly a resource waste to do so. Even 8 might be high but
  it can be manually reduced.
- use 2k, 4k and now 9k clusters based on the MTU size.
- rework the igb_refresh_mbuf() code, its important to
  make sure the descriptor is rewritten even when reusing
  mbufs since writeback clobbers things.

MFC: in a few days, this delta needs to get to 8.2
2010-11-23 22:12:02 +00:00
Marius Strobl
e0fe5c6dd3 - Sprinkle const on tables.
- Remove an alpha remnant.
- Minor comment and style fixes.
2010-11-23 21:09:42 +00:00
Weongyo Jeong
3c0efe7424 Fixes a kernel crash when usb module is reloaded after unload that it
didn't destroy the cdev properly.

Pointy hat to:	me
Reported by:	Brandon Gooch <jamesbrandongooch at gmail dot com>, jkim
2010-11-23 20:23:25 +00:00
Nick Hibma
294fe04afc Make the Huawei E1820 work (Emile Coetzee).
Shorten the descriptive strings for Huawei devices. The vendor or
operator name should not be included in the device name.

Submitted by:	Emile Coetzee
MFC after:	3 days
2010-11-23 08:15:14 +00:00
Alexander Motin
96ecb95ed9 Fix small typo.
Submitted by:	Artem Belevich
2010-11-22 23:04:25 +00:00
Marius Strobl
9a68cbd33d - Fix and enable support for flow control.
- Partially revert r172334; as it turns out the DELAYs in gem_reset_{r,t}x()
  are actually necessary although bus space barriers and gem_bitwait() are
  used, otherwise the controller may trigger an IOMMU errors on at least
  sparc64. This is in line with what Linux and OpenSolaris do.
2010-11-22 22:13:26 +00:00
Marius Strobl
36334c57d9 - Fix and enable support for flow control.
- Fix compilation with CAS_DEBUG defined.
2010-11-22 22:06:30 +00:00
Marius Strobl
a16ce54ca6 - Also probe BCM5214 and BCM5222.
- Add some DSP init code for BCM5221. The values derived from Apple's GMAC
  driver and the same init code also exists in Linux's sungem_phy driver.
- Only read media status bits when they are valid.

Obtained from:	NetBSD, OpenBSD
2010-11-22 22:03:11 +00:00
Jung-uk Kim
f68ff88c87 Resume critical PCI devices (and their children) first, then everything else
later.  This give us better chance to catch device driver problems.
2010-11-22 21:58:00 +00:00
Marius Strobl
4b9b1e1163 Add support for flow control.
Obtained from:	NetBSD (partially)
2010-11-22 21:24:29 +00:00
Marius Strobl
b84d962610 Given that unlike f.e. rgephy(4) these drivers doen't explicitly start an
autonegotiation along with manual media selection and also only report flow
control status when BMCR_AUTOEN is set (at least with gentbi(4) determining
the flow control status results in false-positives when not set), use
MIIF_NOMANPAUSE.
2010-11-22 21:20:11 +00:00
Marius Strobl
1aeedb9617 Given that unlike f.e. rgephy(4) this driver doesn't explicitly start an
autonegotiation along with manual media selection and ukphy_status() also
only reports flow control status when BMCR_AUTOEN is set (at least with
gentbi(4) determining the flow control status results in false-positives
when not set), use MIIF_NOMANPAUSE.
2010-11-22 21:13:42 +00:00
Marius Strobl
7a05baaebe Add missing newlines.
MFC after:	3 days
2010-11-22 20:57:44 +00:00
Andrew Gallatin
4ed8ca8f25 Fix a TSO checksum bug on mxge(4):
The Myri10GE NIC will assume all TSO frames contain partial checksum,
and will emit TSO segments with bad TCP checksums if a TSO frame
contains a full checksum.  The mxge driver takes care to make sure
that TSO is disabled when checksum offload is disabled for this
reason.  However, modules that modify packet contents (like pf) may
end up completing a checksum on a TSO frame, leading to the NIC emitting
TSO segments with bad checksums.

To workaround this, restore the partial checksum in the mxge driver
when we're fed a TSO frame with a full checksum.

Reported by: Bob Healey

MFC after:	3 days
2010-11-22 16:43:05 +00:00
Weongyo Jeong
18ec652552 Adds a USB packet filter feature to the stack that it could capture
packets which go through each USB host controllers.  Its implementations
are almost based on BPF code and very similar with it except it's
little bit customized for USB packet only.  The userland program
usbdump(8) would be committed soon.

Discussed with:	hps, thompsa, yongari
2010-11-22 01:11:28 +00:00
John Baldwin
d2014f5180 Various small typos and grammar nits in comments. 2010-11-18 22:17:20 +00:00
Alexander Motin
95e97044c7 Make ATA_CAM wrapper to report SATA power management capabilities to CAM to
make it configure device to initiate transitions if controller configured
to accept them. This makes hint.ata.X.pm_level=1 mode working.
2010-11-18 19:28:45 +00:00
Marius Strobl
bab85d8dcc Fix a bug introduced with r215298; when atphy_reset() is called from
atphy_attach() the current media has not been set, yet, leading to a
NULL-dereference in atphy_setmedia().

Submitted by:	jkim (initial version)
2010-11-18 17:58:59 +00:00
Alexander Motin
5c2a4ae217 Even if we are skipping SATA hard reset - set power management bits in
SControl register. This should make things consistent and help to avoid
unexpected PHY events that I've noticed in some cases on VIA controllers.
2010-11-18 11:58:17 +00:00
Alexander Motin
1f6aa21d47 Record that there is no devices if SATA reset found none. 2010-11-18 10:34:18 +00:00
Alexander Motin
ee597c8246 Some VIA SATA controllers provide access to non-standard SATA registers via
PCI config space. Use them to implement hot-plug and link speed reporting.
Tested on ASRock PV530 board with VX900 chipset.
2010-11-18 08:03:40 +00:00
Pyun YongHyeon
2f4fcd485d MCP55 is the only NVIDIA controller that supports VLAN tag
insertion/stripping and it also supports TSO over VLAN. Implement
TSO over VLAN support for MCP55 controller.

While I'm here clean up SIOCSIFCAP ioctl handler. Since nfe(4)
sets ifp capabilities based on various hardware flags in device
attach, there is no need to check hardware flags again in
SIOCSIFCAP ioctl handler. Also fix a bug which toggled both TX and
RX checksum offloading even if user requested either TX or RX
checksum configuration change.

Tested by:	Rob Farmer ( rfarmer <> predatorlabs dot net )
2010-11-17 18:09:02 +00:00
Alexander Motin
040545848d Add IDs for VIA VX900 chipset SATA controller.
(Missed part of r215428)
2010-11-17 17:52:04 +00:00
Alexander Motin
2cbfd42740 Add IDs for VIA VX900 chipset SATA controller.
MFC after:	1 week
2010-11-17 16:17:35 +00:00
Nathan Whitehorn
17a6d97402 Make drm(4) build, if not work reliably, on PowerPC. 2010-11-16 03:43:06 +00:00
Jung-uk Kim
8299c44bdd Restore the previous behaviour of substring match. 2010-11-15 23:38:52 +00:00
Jung-uk Kim
51460278cf Plug memory leakage introduced in r204989.
Reported by:	yongari
2010-11-15 23:13:25 +00:00
Pyun YongHyeon
b0630da9ad Plug memory leakage introduced in r215327.
Submitted by:	jkim
2010-11-15 22:05:08 +00:00
Marius Strobl
d0fae855ef Return from mii_attach() after calling bus_generic_attach(9) on the device_t
of the MAC driver in order to attach miibus(4) on the first pass instead of
falling through to also calling it on the device_t of miibus(4). The latter
code flow was intended to attach the PHY drivers the same way regardless of
whether it's the first or a repeated pass, modulo the bus_generic_attach()
call in miibus_attach() which shouldn't be there. However, it turned out
that these variants cause miibus(4) to be attached twice under certain
conditions when using MAC drivers as modules.

Submitted by:	yongari
MFC after:	3 days
2010-11-15 21:41:45 +00:00
Kevin Lo
7dc246bc0f Remove unused struct rue_type 2010-11-15 06:04:25 +00:00
Doug Barton
eb581844e4 Remove references to MAKEDEV(8) 2010-11-15 05:25:51 +00:00
Andrew Thompson
fcc8d2e17b Add the Sierra MC8700. 2010-11-15 02:27:01 +00:00
Pyun YongHyeon
64436f6e91 Add flow control for all re(4) controllers. re(4) controllers do
not provide any MAC configuration interface for resolved flow
control parameters. There is even no register that configures water
mark which will control generation of pause frames.
However enabling flow control surely enhanced performance a lot.
2010-11-15 00:06:19 +00:00
Pyun YongHyeon
aee0e78619 Add flow control for 3C905B and newer controllers. Note, these
controllers support RX pause only.

Reviewed by:	marius
2010-11-14 23:53:13 +00:00
Pyun YongHyeon
7e7a45ce6f P5N32-SLI PREMIUM from ASUSTeK is known to have MSI/MSI-X issue
such that nfe(4) does not work with MSI-X. When MSI-X support was
introduced, I remember MCP55 controller worked without problems so
the issue could be either PCI bridge or BIOS issue. But I also
noticed snd_hda(4) disabled MSI on all MCP55 chipset so I'm still
not sure this is generic issue of MCP55 chipset. If this was PCI
bridge issue we would have added it to a system wide black-list
table but it's not clear to me at this moment whether it was caused
by either broken BIOS or silicon bug of MCP55 chipset.

To workaround the issue, maintain a MSI/MSI-X black-list table in
driver and lookup base board manufacturer and product name from the
table before attempting to use MSI-X. If driver find an matching
entry, nfe(4) will not use MSI/MSI-X and fall back on traditional
INTx mode. This approach should be the last resort since it relies
on smbios and if another instance of MSI/MSI-X breakage is reported
with different maker/product, we may have to get the PCI bridge
black-listed instead of adding an new entry.

PR:	kern/152150
2010-11-14 23:37:43 +00:00
Dima Dorfman
b2e7926915 Add a special INIT product ID used by some models of the HUAWEI
K3765 datacard. After ejecting this device, it reappears using
the normal K3765 ID. It does not switch automatically

Reviewed by:	n_hibma
Obtained from:	OpenBSD
MFC after:	2 weeks
2010-11-14 23:05:57 +00:00
Marius Strobl
d6a4eec458 Use the correct variable for determining the verbosity level in mpt_lprtc().
While at it, fix the whitespace of that macro.

PR:		149502
Submitted by:	Andrew Boyer
MFC after:	1 week
2010-11-14 22:34:33 +00:00
Marius Strobl
fb772a6c98 Move the limiting of the PHY to 10/100 modes of operation due to limitations
of certain MAC models from brgphy(4) to bge(4) where it belongs. While at it,
update the list of models having that restriction to what OpenBSD uses, which
in turn seems to have obtained that information from the Linux tg3 driver.
2010-11-14 15:15:22 +00:00
Marius Strobl
78102c2f8b Remove redundant cases and a style(9) bug. 2010-11-14 14:25:04 +00:00
Marius Strobl
991ab941ee - Change these drivers to take advantage and use the generic IEEE 802.3
annex 31B full duplex flow control as well as the IFM_1000_T master
  support committed in r215297. For atphy(4) and jmphy(4) this includes
  changing these PHY drivers to no longer unconditionally advertise
  support for flow control but only if the selected media has IFM_FLOW
  set (or MIIF_FORCEPAUSE is set).
- Rename {atphy,jmphy}_auto() to {atphy,jmphy}_setmedia() as these handle
  other media types as well.

Reviewed by:	yongari (plus additional testing)
Obtained from:	NetBSD (partially), OpenBSD (partially)
MFC after:	2 weeks
2010-11-14 13:31:01 +00:00
Marius Strobl
efd4fc3fb3 o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control
support in mii(4):
  - Merge generic flow control advertisement (which can be enabled by
    passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from
    NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD,
    IFM_FLOW isn't implemented as a global option via the "don't care
    mask" but instead as a media specific option this. This has the
    following advantages:
    o allows flow control advertisement with autonegotiation to be
      turned on and off via ifconfig(8) with the default typically
      being off (though MIIF_FORCEPAUSE has been added causing flow
      control to be always advertised, allowing to easily MFC this
      changes for drivers that previously used home-grown support for
      flow control that behaved that way without breaking POLA)
    o allows to deal with PHY drivers where flow control advertisement
      with manual selection doesn't work or at least isn't implemented,
      like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4),
      by setting MIIF_NOMANPAUSE
    o the available combinations of media options are readily available
      from the `ifconfig -m` output
  - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE
    and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so
    these are understood by ifconfig(8).
o Make the master/slave support in mii(4) actually usable:
  - Change IFM_ETH_MASTER from being implemented as a global option via
    the "don't care mask" to a media specific one as it actually is only
    applicable to IFM_1000_T to date.
  - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to
    actually configure manually selected slave mode (like we also do in
    the PHY specific implementations).
  - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it
    is understood by ifconfig(8).
o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4),
  e1000phy(4) and ip1000phy(4) to use the generic flow control support
  instead of home-grown solutions via IFM_FLAGs. This includes changing
  these PHY drivers and smcphy(4) to no longer unconditionally advertise
  support for flow control but only if the selected media has IFM_FLOW
  set (or MIIF_FORCEPAUSE is set) and implemented for these media variants,
  i.e. typically only for copper.
o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and
  set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0
  and some IFM_FLAGn.
o Switch brgphy(4) to add at least the the supported copper media based on
  the contents of the BMSR via mii_phy_add_media() instead of hardcoding
  them. The latter approach seems to have developed historically, besides
  causing unnecessary code duplication it was also undesirable because
  brgphy_mii_phy_auto() already based the capability advertisement on the
  contents of the BMSR though.
o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not
  just BCM5701. Apparently this was a misinterpretation of a workaround
  in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and
  BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but
  this doesn't mean we can't set these as well on other PHYs for manual
  media selection.
o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so
  IFM_1000_T master mode support now is generally available with all PHY
  drivers.
o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's
  not applicable there.

Reviewed by:	yongari (plus additional testing)
Obtained from:	NetBSD (partially), OpenBSD (partially)
MFC after:	2 weeks
2010-11-14 13:26:10 +00:00
Xin LI
add5afdc93 Workaround build for PAE case for now - revert the PHYS
case to previous panic behavior.

I have a real fix that changes the sg dma tag allocation
to be limited to the under 4GB address space but would
prefer to have review before committing.
2010-11-14 05:05:41 +00:00
Nick Hibma
c175c7deff Add the switch config for the XS Stick.
It speaks AT commands on 2 out of 3 serial ports, but it has not been
verified to work at all speaking PPP yet.
2010-11-13 20:45:16 +00:00
Hans Petter Selasky
876cab6fc2 Fix compiler warnings.
Submitted by:	Alexander Best (arundel)
Approved by:	thompsa (mentor)
2010-11-13 19:26:45 +00:00
Xin LI
231c8b7113 Update to vendor release 1.20.00.19.
Bug fixes:
  * Fixed "inquiry data fails comparion at DV1 step"
  * Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B
  * Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0

Many thanks to Areca for continuing to support FreeBSD.

This commit is intended for MFC before 8.2-RELEASE.

Submitted by:   Ching-Lung Huang <ching2048 areca com tw>
2010-11-13 08:58:36 +00:00
Pyun YongHyeon
603b8e29db Fix regression introduced in r215132. Caller always holds a driver
lock before accessing mii, so locking is not needed here.

Reported by:	Rob Farmer (rfarmer <> predatorlabs dot net)
2010-11-12 19:33:13 +00:00
Jung-uk Kim
68d5e11c9f Create C1 state when _CST is valid but _CST does not have one. Some BIOSes
do not report C1 state in _CST object, probably because it is a mandatory
state with or without existence of the optional _CST.

Reviewed by:	avg
2010-11-12 17:10:12 +00:00
Andrew Thompson
54873b4cd6 Add a GPIO driver for the Gateworks Cambria platform.
The external gpio pins are connected to a PLD on the i2c bus, unfortunatley
this device does not conform by failing to send an ack after each byte written.
The iicbb driver will abort the transfer when the address is not ack'd and it
would introduce a lot of churn to be able to pass a flag down to
iicbb_start/iicbb_write. Instead we do bad things by grabbing the iicbus but
then doing our own bit banging.
2010-11-11 20:18:33 +00:00
Pyun YongHyeon
52a1393e4c Add basic WOL support for MCP ethernet controllers. It seems the
controller does not perform automatic switching from 1000Mbps link
to 10/100Mbps link when WOL is activated. Implement establishing
10/100Mps link with auto-negotiation in driver. Link status change
handler was modified to remove taskqueue based approach since driver
now needs synchronous handling for link establishment.

Submitted by:	Yamagi Burmeister (lists <> yamagi.org ) (initial version)
Tested by:	Yamagi Burmeister (lists <> yamagi.org )
MFC after:	1 week
2010-11-11 18:08:50 +00:00
Rafal Jaworowski
96fe0b3552 Return IEEE 1275 compliant error codes.
Submitted by:	nwhitehorn
2010-11-11 13:42:46 +00:00
Nick Hibma
0ea0127a4d Add a man page for usb_quirk module, plus references in other man pages,
and updated comments in the usb_quirk.h header file.

The main purpose of this is to expose the quirks for ejecting 3G
modules. usb_modeswitch in Linux does a great job of collecting
information on these, and with the quirks module people can try out the
modeswitch config file entries on FreeBSD, hence the SCSI strings in the
man page.

MFC after:	2 weeks
2010-11-10 23:45:44 +00:00
Jung-uk Kim
93a8847473 Make APM emulation look more closer to its origin. Use device_get_softc(9)
instead of hardcoding acpi(4) unit number as we have device_t for it.
2010-11-10 18:50:12 +00:00
Nick Hibma
e7702e9e1b Allow specification of eject method through quirks, so people can test
drive eject methods before supplying patches.
2010-11-10 18:41:38 +00:00
Jung-uk Kim
7c2bf852d7 Refactor acpi_machdep.c for amd64 and i386, move APM emulation into a new
file acpi_apm.c, and place it on sys/x86/acpica.
2010-11-10 01:29:56 +00:00
Nathan Whitehorn
0bad71a347 Make all OF client interface calls return the maximum kind of
does-not-exist error when no client interface module is installed instead
of dereferencing NULL pointers. This eases implementation of platforms
that may or may not have Open Firmware.
2010-11-09 19:45:29 +00:00
Rebecca Cran
b1ce21c6ef Fix typos.
PR:	bin/148894
Submitted by:	olgeni
2010-11-09 10:59:09 +00:00
Pyun YongHyeon
5e6906ee36 Only moderate TX completion interrupts. Relying on taskqueue to
suppress RX interrupts seems to give better RX performance than
RX interrupt moderation.
2010-11-09 01:52:09 +00:00
Pyun YongHyeon
483cc44070 Follow the lead of vendor's interrupt moderation mechanism.
It seems RTL8169/RTL8168/RTL810xE has a kind of interrupt
moderation mechanism but it is not documented at all. The magic
value dramatically reduced number of interrupts without noticeable
performance drops so apply it to all RTL8169/RTL8169 controllers.
Vendor's FreeBSD driver also applies it to RTL810xE controllers but
their Linux driver explicitly cleared the register, so do not
enable interrupt moderation for RTL810xE controllers.

While I'm here sort 8169 specific registers.

Obtained from:	RealTek FreeBSD driver
2010-11-08 21:50:50 +00:00
Juli Mallett
e875cf292c Recognize the BCM5482S. 2010-11-08 21:23:28 +00:00
Nathan Whitehorn
134a9563c7 Provide support for IIC_M_NOSTOP/IIC_M_NOSTART for bit-banging and
otherwise low-level controllers.

Reviewed by:	thompsa
2010-11-08 19:53:16 +00:00
Jung-uk Kim
affa18265a Consistently use padding `_' in the comment. 2010-11-08 19:52:14 +00:00
Pyun YongHyeon
2bc085c69c Reduce spin wait time consumed in GMII register access routine.
There were a couple of attempts in the past to reduce it since it
took more than 1ms. Because mii_tick() periodically polls link
status, waiting more than 1ms for each GMII register access was
overkill. Unfortunately all previous attempts were failed with
various ways on different controllers.
This time, add additional 20us dealy at the end of GMII register
access which seems to requirement of all RealTek controllers to
issue next GMII register access request. This is the same way what
Linux does.
2010-11-08 19:15:31 +00:00
Alexander Motin
ba3a999598 Teach ahci(4), siis(4) and ATA_CAM ata(4) wrapper report to CAM residual
I/O length on underruns, that often happens for some SCSI commands.
2010-11-08 15:36:15 +00:00
Andrew Thompson
cac6df751b Set the pin to output on attach, we can't assume it already is.
Reviewed by:	gonzo
2010-11-08 03:08:01 +00:00
Nick Hibma
96a6480a53 Bugfix: Set the bit that marks a device number in use.
This would cause a panic when disconnecting the second serial device.

Submitted by:	Lucius Windschuh
2010-11-07 15:36:07 +00:00
Marius Strobl
97901c4bc9 Fix indentation in r213894. 2010-11-07 12:29:26 +00:00
Pyun YongHyeon
fec5229ac0 Fix a long standing bug in programming station address for Yukon
controllers. sk(4) never reprogrammed station address for Yukon
controllers so overriding station address with ifconfig(8) was not
possible.
Fix the bug by reprogramming all registers that control station
address, flow-control and virtual station address. Virtual station
address has no use at this moment since driver does not make use of
fail over feature.

Tested by:	"Mikhail T." <mi+thun <> aldan.algebra.com>
MFC after:	1 week
2010-11-06 22:07:22 +00:00
Pyun YongHyeon
adfe075ce0 If we got an invalid station address, generate random address. This
might be caused by broken BIOS.

Reported by:	"Mikhail T." <mi+thun <> aldan.algebra.com>
MFC after:	1 week
2010-11-06 21:54:32 +00:00
Alexander Motin
285ba17329 Mark command submission timeouts as timeouts. This should trigger device
resets and increase chances of getting device back again.
2010-11-06 19:11:49 +00:00
Bernhard Schmidt
a7c6aabdc3 Instead of using the AMRR ratectl algo as default for drivers which have
the IEEE80211_C_RATECTL flag set, default to NONE for all drivers. Only if
a driver calls ieee80211_ratectl_init() check if the NONE algo is still
selected and try to use AMRR in that case. Drivers are still free to use
any other algo by calling ieee80211_ratectl_set() prior to the
ieee80211_ratectl_init() call.

After this change it is now safe to assume that a ratectl algo is always
available and selected, which renders the IEEE80211_C_RATECTL flag pretty
much useless. Therefore revert r211314 and 211546.

Reviewed by:	rpaulo
MFC after:	2 weeks
2010-11-06 18:17:20 +00:00
Alexander Motin
618c8d01f2 Add support for odd-sized PIO transfers, sometimes used by ATAPI. 2010-11-06 14:22:50 +00:00
Nick Hibma
b38fd2d93c Bugfix: In rev 213509 Alexander committed a duplicate ID for ZTE STOR
based devices (QUALCOMMINC 0x2000). He made it use SCSI eject instead of
ZTE STOR eject. This prevented my ZTE MF626 dongle from switching.

- Apply both eject methods for ZTE STOR based devices. Works on my as
  well as mav's device.
- Remove the duplicate.
- Sort the usbdevs entries for Qualcomm so this won't happen again.
- Add bootverbose message displaying the fact that we are ejecting (and
  how).

Reviewed by:	mav
MFC after:	2 weeks
2010-11-05 21:17:55 +00:00
Jung-uk Kim
e7bb9ab605 Add a forgotten change from the previous commit. 2010-11-05 20:24:26 +00:00
Jung-uk Kim
9fe3e6c023 Fix a use-after-free bug for extended IRQ resource[1]. When _PRS buffer is
copied as a template for _SRS, a string pointer for descriptor name is also
copied and it becomes stale as soon as it gets de-allocated[2].  Now _CRS is
used as a template for _SRS as ACPI specification suggests if it is usable.
The template from _PRS is still utilized but only when _CRS is not available
or broken.  To avoid use-after-free the problem in this case, however, only
mandatory fields are copied, optional data is removed, and structure length
is adjusted accordingly.

Reported by:	hps[1]
Analyzed by:	avg[2]
Tested by:	hps
2010-11-05 19:50:09 +00:00
Marius Strobl
8edfedadeb Correct an inverted check in r213893. 2010-11-05 19:38:28 +00:00