Commit Graph

20659 Commits

Author SHA1 Message Date
Weongyo Jeong
ae5e95fa23 calculates the integer square root if a positive integer X is larger
than 256 instead of using sqrt_table.

Reported by:	Joe Marcus Clarke <marcus at freebsd dot org>
2010-03-01 23:51:13 +00:00
Pyun YongHyeon
cf570c1f34 Implement rudimentary interrupt moderation with programmable
countdown timer register. The timer resolution may vary among
controllers but the value would be represented by core clock
cycles. msk(4) will automatically computes number of required clock
cycles from given micro-seconds unit.
The default interrupt holdoff timer value is 100us which will
ensure less than 10k interrupts under load. The timer value can be
changed with dev.mskc.0.int_holdoff sysctl node.

Note, the interrupt moderation is shared resource on dual-port
controllers so you can't use separate interrupt moderation value
for each port. This means we can't stop interrupt moderation in
driver stop routine. Also have msk_tick() reclaim transmitted Tx
buffers as safety belt. With this change there is no need to check
missing Tx completion interrupt in watchdog handler, so remove it.
2010-03-01 23:39:43 +00:00
Pyun YongHyeon
42f3ea9fc2 Make sure to enable flow-control only if established link is
full-duplex. Previously msk(4) used to allow flow-control on
1000baseT half-duplex media. Also GMAC pause is enabled if link
partner is capable of handling it.
While I'm here use IFM_OPTIONS instead of using IFM_GMASK to check
optional flags of link.
2010-03-01 22:55:35 +00:00
Pyun YongHyeon
17f6f326e9 Properly sync status LEs after processing. 2010-03-01 22:43:22 +00:00
Xin LI
506b3c39b8 Add PCI ID for MCS9901.
Submitted by:	gcooper
PR:		kern/144397
MFC after:	1 month
2010-03-01 20:41:27 +00:00
Rui Paulo
9425e26b82 Properly setup the TX FIFO threshold for AR5416 based chipsets,
including the AR9285. This seems to fix some users's problems.

Submitted by:	Jorge Boncompte [DTI2] <jorge at dti2.net>
2010-03-01 17:04:19 +00:00
Joel Dahl
eac073cde2 The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-01 16:52:11 +00:00
Alexander Motin
f60d46f99a - Add ALI M5228 PATA ID.
- Add missed DMA initialization for ALI SATA chips.
2010-03-01 07:32:49 +00:00
Weongyo Jeong
8600d13245 fixes a bug to load firmware images for LP PHY. For LP PHY always,
`lp_' string is contained in its full image names.
2010-02-27 23:42:32 +00:00
Weongyo Jeong
7478ae9730 supports the adhoc demo mode that it's tested on modified aircrack-ng
suite and worked.

Submitted by:	Paul B Mahol <onemda at gmail dot com>
2010-02-27 23:04:29 +00:00
Edward Tomasz Napierala
5ed1eb2bb0 Fix panic on invalid 'mdconfig -at preload' usage.
PR:		kern/80136
2010-02-27 10:41:30 +00:00
Matt Jacob
443e752d97 Revamp the pieces of some of the stuff I forgot to do when shifting to
32 bit handles. The RIO (reduced interrupt operation) and fast posting
for the parallel SCSI cards were all 16 bit handles. Furthermore,
target mode parallel SCSI only can have 16 bit handles.

Use part of a supplied patch to switch over to using 32 bit handles.
Be a bit more conservative here and only do this for parallel SCSI
for the 12160 (Ultra3) cards. There were a lot of marginal Ultra2
cards, and, frankly, few are findable now for testing.

Fix the target handle routine to only do 16 bit handles for parallel
SCSI cards. This is okay because the upper sixteen bits of the new
32 bit handles is a sequence number to help protect against duplicate
completions. This would be very unlikely to happen with parallel
SCSI target mode, and wasn't present before, so we're no worse off
than we used to be.

While we're at it, finally split the async mailbox completion handlers
into FC and parallel SCSI functions. This makes it much cleaner and
easier to figure out what is or isn't a legal async mailbox completion
code for different card classes.

PR:		kern/144250
Submitted partially by:	Charles D
MFC after:	1 week
2010-02-27 05:41:23 +00:00
Weongyo Jeong
5fb654dcd1 don't need to check BWN_RX_PHYST0_SHORTPRMBL flag because it's already
handled in later.

Reported from:	imp, nwhitehorn
2010-02-27 02:20:38 +00:00
Matt Jacob
32b3ec7df1 Fix misallocation error in target mode.
MFC after:	1 day
2010-02-27 01:58:41 +00:00
Pyun YongHyeon
5b8b73f675 Add TSO support on VLANs. While I'm here remove unnecessary check
of VLAN hardware checksum offloading. vlan(4) already takes care of
this.
2010-02-26 22:46:36 +00:00
Pyun YongHyeon
0fe060a8f5 Add TSO support on VLANs. While I'm here remove unnecessary check
of VLAN hardware checksum offloading. vlan(4) already takes care of
this.
2010-02-26 22:43:23 +00:00
Pyun YongHyeon
be95548d86 Disable TSO on BCM5755M controller until I understand better for
the issue. I still have no idea why TSO does not work on this
controller. davidch@ also confirmed there is no known TSO related
issues for this controller.
2010-02-26 22:29:42 +00:00
Pyun YongHyeon
6401cf0ccc Add TSO support on VLANs. bce(4) controllers require VLAN hardware
tagging to make TSO work on VLANs so explicitly disable TSO on VLAN
if VLAN hardware tagging is disabled.

Reviewed by:	davidch
2010-02-26 21:26:07 +00:00
Pyun YongHyeon
c3b399103c Move TSO setup to new function bce_tso_setup(). Also remove VLAN
parsing code in TSO path as the controller requires VLAN hardware
tagging to make TSO work over VLANs.
While parsing the mbuf in TSO patch, always perform check for
writable mbuf as bce(4) have to reset IP length and IP checksum
field of IP header and make sure to ensure contiguous buffer before
accessing IP/TCP headers. While I'm here replace magic number 40 to
more readable sizeof(struct ip) + sizeof(struct tcphdr).

Reviewed by:	davidch
2010-02-26 21:19:46 +00:00
Pyun YongHyeon
80a48895fc Prefer m_collapse(9) over m_defrag(9).
Reviewed by:	davidch
2010-02-26 20:41:28 +00:00
Pyun YongHyeon
b2ec4a73f5 Make toggling TSO, VLAN hardware checksum offloading work. Also fix
TX/RX checksum handler to set/clear relavant assist bits which was
used to cause unexpected results.
With this change, bce(4) can be bridged with other interfaces that
lack TSO, VLAN checksum offloading.

Reviewed by:	davidch
2010-02-26 20:39:07 +00:00
Pyun YongHyeon
03c28f4ef5 Make sure to stop controller first before changing MTU. And if
interface is not running don't initialize controller.
While here remove unnecessary update of error variable.

Reviewed by:	davidch
2010-02-26 20:26:17 +00:00
Pyun YongHyeon
e89abed364 Allow disabling VLAN hardware tag stripping with software work
around. Management firmware(ASF/IPMI/UMP) requires the VLAN
hardware tag stripping so don't actually disable VLAN hardware tag
stripping. If VLAN hardware tag stripping was disabled, bce(4)
manually reconstruct VLAN frame by appending stripped VLAN tag.
Also remove unnecessary IFCAP_VLAN_MTU message.

Reviewed by:	davidch
2010-02-26 20:17:17 +00:00
Pyun YongHyeon
8c1643b6db Remove trailing white spaces. 2010-02-26 19:38:12 +00:00
Pyun YongHyeon
c72f075a24 Allocate single MSI message. msk(4) used to allocate 2 MSI messages
for controllers like 88E8053 which reports two MSI messages.
Because we don't get anything useful things with 2 MSI messages,
allocating 1 MSI message would be more sane approach.
While I'm here, enable MSI for dual-port controllers too. Because
status block is shared for dual-port controllers, I don't think
msk(4) will encounter problem for using MSI on dual-port
controllers.
2010-02-26 19:37:03 +00:00
Pyun YongHyeon
7420e9dc9d Don't hardcod register offset to set PCIe max read request size.
The register offset is not valid on 88E8072 controller. Also don't
blindly increase max read request size to 4096, instead, use 2048
which seems to be more sane value and only change the value if the
hardware default size(512) was used on that register.
For PCIX controllers, use system defined constant rather than using
magic value.
While I'm here stop showing negotiated link width.
2010-02-26 19:18:29 +00:00
Pyun YongHyeon
1b7757c024 Optimize inserting LE for TX checksum computation. Controller does
not require checksum LE configuration if checksum start and write
position is the same as before. So keep track last checksum start
and write position and insert new LE whenever the position is
changed. This reduces number of LEs used in TX path as well as
slightly enhance TX performance.
2010-02-26 18:18:02 +00:00
Pyun YongHyeon
4858893b6e Add TSO support on VLANs. Controller requires VLAN hardware tagging
to make TSO work over VLANs.
2010-02-26 17:33:43 +00:00
Pyun YongHyeon
d06930af52 Reuse the configured LE for VLAN if new LE was created for TSO.
Only old controllers need to create new LE for TSO. This change
makes TSO work over VLANs.
2010-02-26 17:27:16 +00:00
Alexander Motin
2dc59e87e6 Store path for rescan to the right place. This should fix panic on boot,
introduced by r203108.
2010-02-26 12:31:16 +00:00
Alexander Motin
28889a0022 Fix bug in headphones audio redirection using separate DAC. It was exposed
by removing channel duplication during multichannel audio implementation.
2010-02-26 09:31:50 +00:00
Navdeep Parhar
f9c6e16451 Support IFCAP_VLANHWTSO in cxgb(4). It works with or without vlanhwtag.
While here, remove old DPRINTFs and tidy up the capability code a bit.
2010-02-26 07:08:44 +00:00
Jung-uk Kim
4a9b63a454 Improve VESA mode switching via loader tunable `hint.sc.0.vesa_mode'.
The most notable change is history buffer is fully saved/restored now.
2010-02-24 20:13:34 +00:00
Navdeep Parhar
e83ec3e5c3 There is no need to test __FreeBSD_version for features that have
been around for a long time now (7.1-ish or even earlier); assume
they are present.  These includes MSI, TSO, LRO, VLAN, INTR_FILTERS,
FIRMWARE, etc.

Also, eliminate some dead code and clean up in other places as part
of this quick once-over.

MFC after:	1 week
2010-02-24 10:16:18 +00:00
Navdeep Parhar
be688bde90 Accessing an mbuf after it has been handed off to the hardware is a bad
race as it could already have been tx'd and freed by that time.  Place
the bpf tap just _before_ writing the gen bit.

This fixes a panic when running tcpdump on a cxgb interface.
2010-02-24 01:44:39 +00:00
Jung-uk Kim
8d521790d0 Yet another attempt to make palette loading more safer:
- Add a separate palette data for 8-bit DAC mode when SC_PIXEL_MODE is set
and fill it up with default gray-scale palette data for text.  Now we don't
have to set `hint.sc.0.vesa_mode' to get the default palette data.
- Add a new adapter flag, V_ADP_DAC8 to track whether the controller is
using 8-bit palette format and load correct palette when switching modes.
- Set 8-bit DAC mode only for non-VGA compatible graphics mode.
2010-02-23 21:51:14 +00:00
Ed Maste
dbfc596084 Minor diff reduction with Adaptec's driver: in aac_release_command() set
cm_queue to AAC_ADAP_NORM_CMD_QUEUE by default.  In every place it was set,
it was set to AAC_ADAP_NORM_CMD_QUEUE anyhow.
2010-02-23 21:41:13 +00:00
Weongyo Jeong
d2ee7771f1 o adds sysctl variables to show device statistics.
o records RTS success/fail statistics.

Pointed by:	imp
2010-02-23 19:55:54 +00:00
Weongyo Jeong
e355ad550c fixes a compile error; invalid type argument of '->'. 2010-02-23 19:44:51 +00:00
Alexander Motin
5261b668c1 Fix recursive lock attempt on hot-plug event in non-ATA_CAM mode. 2010-02-23 16:39:53 +00:00
Ivan Voras
b8bba24e06 The New and Improved snake_server - Service Pack 1: now even more
sensitive to load average variations!
2010-02-23 15:27:07 +00:00
Ivan Voras
c0414ca779 Upgrade the "snake" syscons screensaver to the new, multimedia version!
Now, with color! And system load averages!

Amused by it:	gnn
2010-02-23 15:12:41 +00:00
Matt Jacob
940907907b xpt_rescan only honors a wildcard in the target field. Revert the previous
change and have isp_make_here scan the whole bus which will then scan all
luns.

I think xpt_rescan needs to be fixed, but that's a separable issue.

Suggested by: Alexander
2010-02-23 14:35:44 +00:00
Warner Losh
0d05eee2f9 Fix compilation problems with INVARIANTS.
# also limit RX decryption attempted messages to 50

Reviewed by:	weongyo
2010-02-23 05:02:10 +00:00
Jung-uk Kim
0dc682e029 Re-add accidentally removed pixel format for direct memory model. 2010-02-23 01:02:11 +00:00
Jung-uk Kim
6a6289a2b8 Fix FBIO_ADPINFO ioctl on amd64. 2010-02-23 01:00:19 +00:00
Matt Jacob
75c1db5d67 When we rescan, just scan from logical unit 0. In other words, don't
specify a wildcard lun here.

This unbreaks disk re-arrival.

MFC after:	2 days
2010-02-23 00:34:20 +00:00
Pyun YongHyeon
01d60a6594 Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
not support TSO over VLAN if VLAN hardware tagging is disabled so
there is no need to check VLAN here.
2010-02-22 23:35:35 +00:00
Pyun YongHyeon
e67344a3be Add TSO support on VLANs. Also make sure to update TSO capability
whenever jumbo frame is configured.
While I'm here remove unnecessary check of VLAN hardware checksum
offloading. vlan(4) already takes care of this.
2010-02-22 22:41:27 +00:00
Pyun YongHyeon
7bd35300da Add TSO support on VLANs. jme(4) controllers do not require VLAN
hardware tagging to make TSO work over VLANs.
2010-02-22 22:05:49 +00:00
Pyun YongHyeon
5b355c4fb1 Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
not support TSO over VLAN if VLAN hardware tagging is disabled so
there is no need to check VLAN here.
While I'm here make sure to pullup IP/TCP headers in the first
buffer.
2010-02-22 21:03:15 +00:00
Marius Strobl
9e48f1e7a5 According to the Linux sungem driver, in case of Apple (K2) GMACs
GEM_MIF_CONFIG_MDI0 cannot be trusted when the firmware has powered
down the chip so the internal transceiver has to be hardcoded. This
is also in line with the AppleGMACEthernet driver, which just doesn't
distinguish between internal/external transceiver and MDIO/MDI1
respectively in the first place. Tested by: Andreas Tobler

MFC after:	1 week
2010-02-22 21:01:08 +00:00
Pyun YongHyeon
ecafbbb5b9 Add TSO on VLANs. Because re(4) has a TSO limitation for jumbo
frame, make sure to update VLAN capabilities whenever jumbo frame
is configured.
While I'm here rearrange interface capabilities configuration. The
controller requires VLAN hardware tagging to make TSO work on VLANs
so explicitly check this requirement.
2010-02-22 18:51:14 +00:00
Alexander Motin
41a11d8753 Oops! Wrong word order. :( 2010-02-22 17:34:35 +00:00
Andrew Gallatin
0dce6781ae Update mxge to support IFCAP_VLAN_HWTSO.
Note: If/when FreeBSD supports TSO over IPv6, the minimal mxge fw
rev to enable IFCAP_VLAN_HWTSO will need to be increased to 1.4.37
2010-02-22 16:57:03 +00:00
Alexander Motin
6f2c1316f0 Add Intel PCH SATA controller IDs. 2010-02-22 16:27:47 +00:00
Alexander Motin
6a5d28b93a Improve output for controllers that doesn't report SATA speed. 2010-02-22 10:45:40 +00:00
Kip Macy
227ca25786 - make printf conditional
- fix witness warnings by making configuration lock a mutex
2010-02-21 01:11:39 +00:00
Pyun YongHyeon
02d77e455f Increase PCIe maximuim read request size to 2048. Because re(4) uses
Tx DMA burst size 2048, I beleive PCIe maximum read request size
also should match to the value of Tx DMA burst size. With this
change I can get more than 800Mbps for TCP bulk transfers.
Previously I was not able to get more than 700Mbps. If I enable TSO
it now shows 927Mbps.
2010-02-21 00:00:55 +00:00
Pyun YongHyeon
04bde8528b Add TSO support on VLAN. Controller requires VLAN hardware tagging
to make TSO work on VLAN. So if VLAN hardware tagging is disabled
explicitly clear TSO on VLAN. While I'm here remove duplicated
VLAN_CAPABILITIES call.
2010-02-20 23:21:06 +00:00
Pyun YongHyeon
cf5756a6bf Correct inversed programming of ethernet hardware address on
big-endian architecture.

Submitted by:	C. Jayachandran <c.jayachandran at gmail dot com> (initial version)
2010-02-20 22:24:24 +00:00
Marius Strobl
30b9cadca4 Add support for BCM54K2 found in combination with Apple K2 GMAC.
Submitted by:   Andreas Tobler
Obtained from:  OpenBSD
MFC after:      1 week
2010-02-20 22:01:24 +00:00
Ulrich Spörlein
8fa03d08ca Fix common misspelling of hierarchy
Pointed out by:		bf1783 at gmail
Approved by:		np (cxgb), kientzle (tar, etc.), philip (mentor)
2010-02-20 10:19:19 +00:00
Daniel Eischen
4fa8d4eff4 Correct spelling of reseting (found while researching the "bb hang detected"
messages that are plaguing me).  While I'm here, delete trailing whitespace.
2010-02-19 18:23:45 +00:00
Weongyo Jeong
ef0894bfd2 o print msgs with length if the frame is too short to pass to net80211.
o print key index for debugging if the frame is attempted to decrypt for
  WEP, AES or TKIP though currently HW decryption isn't supported.
2010-02-19 03:36:02 +00:00
Matt Jacob
ee3e6d9906 Don't try and re-use a handle, even if the firmware tells you that's what is logged in.
PR:		kern/144026
MFC after:	1 week
2010-02-18 18:35:09 +00:00
Ed Maste
5aa4bb5b49 Include command type in COMMAND TIMEOUT messages to aid in debugging. 2010-02-17 22:28:37 +00:00
Rafal Jaworowski
d6bdd318a3 Assorted fixes for mge(4).
- Use proper map for the busdma sync on mge descriptor.
- Remove unnecesary busdma sync.
- Eliminate redundant locking in mge_reinit_rx() (just assert).
- Kill unused variable.

Submitted by:	Grzegorz Bernacki
Obtained from:	Semihalf
MFC after:	1 week
2010-02-17 17:03:04 +00:00
Rui Paulo
8c53f2f83c Fix Kite and Merlin version check. 2010-02-16 12:43:55 +00:00
Weongyo Jeong
45d9abdbc3 adds bwn(4) driver for supporting Broadcom BCM43xx chipsets.
o uses v4 firmware instead of v3.  A port will be committed to create
    the bwn firmware module.
  o supports B/G and LP(low power) PHYs.
  o supports 32 / 64 bits DMA operations.
  o tested on big / little endian machines so should work on all
    architectures.

It'd not connected to the build until the firmware port is committed.
2010-02-16 01:44:14 +00:00
Weongyo Jeong
5c984ceaf9 supports SPROM rev8 informations properly which are used to support
low-power PHY of bwn(4) and LDO voltage adjustments.
2010-02-16 01:22:33 +00:00
Jung-uk Kim
463537a097 Rename some macros to clarify their intentions and fix style nits. 2010-02-15 20:46:01 +00:00
Jung-uk Kim
aba311e1d4 Add support for cycle' and zero' events for LCD brightness control.
Submitted by:	Daniel Walter (d dot walter at 0x90 dot at) (intial version)
2010-02-15 19:30:28 +00:00
Bernhard Schmidt
ae6fd00faf Fix for the Intel WiFi Link 1000. The EEPROM image is in the OTPROM block
before the last block, not in the last block itself.

Approved by:	rpaulo (mentor)
Obtained from:	OpenBSD
MFC after:	3 weeks
2010-02-15 19:18:46 +00:00
Rui Paulo
1480515a8b Fix KITE version check.
Obtained from:	//depot/user/rpaulo/80211n/...
2010-02-15 18:47:42 +00:00
Rui Paulo
7d4f72b39d Bring back AR9285 support. This fixes most of the issues and should be
pretty usable.

MFC after:	1 month
2010-02-15 17:49:49 +00:00
Andrew Thompson
8bbbf173a2 Add device ID for the FTDI 4232H.
PR:		usb/143832
Submitted by:	UEMURA Tetsuya
2010-02-14 20:10:41 +00:00
Andrew Thompson
2386d71421 Add support for the E1752 3G modem and the required eject command.
Submitted by:	Milan Obuch
2010-02-14 20:05:12 +00:00
Andrew Thompson
3e889e246c Make umodem more tolerant for devices which modem descriptors are misplaced.
Reported by:	Erick Wales
Submitted by:	Hans Petter Selasky
2010-02-14 19:59:19 +00:00
Andrew Thompson
b60541a9ec Add UQ_KBD_BOOTPROTO quirk needed in r203896 2010-02-14 19:56:05 +00:00
Andrew Thompson
1bdb81f124 Detect when we are polling from kernel via cngetc() in the boot process and
reserve the keypresses so they do not get passed to syscons.

Submitted by:	Hans Petter Selasky
2010-02-14 19:53:45 +00:00
Ed Maste
8e7e6335bc Diff reduction with Adaptec's vendor driver.
Driver version 2.1.9 chosen as that Adaptec version roughly corresponds
with the current feature set merged to the in-tree driver.
2010-02-14 17:14:11 +00:00
Rui Paulo
12fefae25c Revert part of the 9285 support because it breaks the 9280 support. I'll
try to do the 9285 support without interfering with any other chipset
revisions support.
2010-02-14 16:26:32 +00:00
Alexander Motin
b41cd53957 MFp4:
With FBS enabled, we have no idea what command caused timeout.
Implement same logic as in siis(4) - wait for other commands
complete or timeout and then give some more time.
2010-02-14 12:30:35 +00:00
Alexander Motin
301c88be98 MFp4:
After last running command completed, give commands in timeout state
second time.
2010-02-14 12:27:49 +00:00
Max Laier
193cbc4d24 Fix drbr and altq interaction:
- introduce drbr_needs_enqueue that returns whether the interface/br needs
   an enqueue operation: returns true if altq is enabled or there are
   already packets in the ring (as we need to maintain packet order)
 - update all drbr consumers
 - fix drbr_flush
 - avoid using the driver queue (IFQ_DRV_*) in the altq case as the
   multiqueue consumer does not provide enough protection, serialize altq
   interaction with the main queue lock
 - make drbr_dequeue_cond work with altq

Discussed with:		kmacy, yongari, jfv
MFC after:		4 weeks
2010-02-13 16:04:58 +00:00
Jung-uk Kim
f29d6f75fa Make sanity check slightly more useful and tweak an error message. 2010-02-13 05:38:21 +00:00
Jung-uk Kim
f67f8ffd43 Prefer correct and simpler backlight control methods for ASUS G2K laptop. 2010-02-13 02:30:43 +00:00
Jung-uk Kim
35dd1ef75c Implement LCD brightness control notify handler.
Submitted by:	Daniel Walter(d dot walter at 0x90 dot at) (intial version)
2010-02-13 02:24:23 +00:00
Ed Maste
2134e2ef57 Garbage collect Falcon/PPC support that has not been used in released
products, based on discussion with Adaptec.
2010-02-12 18:48:18 +00:00
Andriy Gapon
0430ba9e55 acpi: drop the second bus_generic_attach pass
It is belived that that pass s not needed anymore.
Specifically it is not required now for the reasons that were given
in the removed comment.

Discussed with:	jhb
MFC after:	4 weeks
2010-02-11 18:24:00 +00:00
Andriy Gapon
aa83516001 acpi cpu: probe+attach before all other enumerated children on acpi bus
Some current systems dynamically load SSDT(s) when _PDC/_OSC method
of Processor is evaluated.  Other devices in ACPI namespace may access
objects defined in the dynamic SSDT.  Drivers for such devices might
have to have a rather high priority, because of other dependencies.
Good example is acpi_ec driver for EC.
Thus we attach to Processors as early as possible to load the SSDTs
before any other drivers may try to evaluate control methods.
It also seems to be a natural order for a processor in a device
hierarchy.

On the other hand, some child devices on acpi cpu bus need to access
other system resources like PCI configuration space of chipset devices,
so they need to be probed and attached rather late.
For this reason we probe and attach the cpu bus at
SI_SUB_CONFIGURE:SI_ORDER_MIDDLE SYSINIT level.
In the future this could be done more elegantly via multipass.

Please note that acpi drivers that might access ACPI namespace from
device_identify will do that before _PDC/_OSC of Processors are evaluated.

Legacy cpu driver is not affected by this change.

PR:		kern/142561 (in part)
Reviewed by:	jhb
Silence from:	acpi@
MFC after:	5 weeks
2010-02-11 08:50:21 +00:00
Rui Paulo
1ac5dac214 Fix typo in comment.
Pointed out by:	danfe
2010-02-10 11:12:39 +00:00
Rui Paulo
24b509868d 't' stands for Turbo and is a valid mode, so fix previous commit.
Pointed out by:	sam
2010-02-10 11:11:37 +00:00
Pyun YongHyeon
4150ce6f17 Move device specific flag configuration to attach routine.
The softc obtained in device probe wouldn't be the same one used in
device attach. Drivers should not assume any values stored in softc
structure in probe routine will be available for its attach routine.
2010-02-09 19:12:06 +00:00
Tai-hwa Liang
4a97e4f030 Fixing compilation bustage by removing a stray comment fragment. 2010-02-09 04:07:39 +00:00
Andrew Thompson
cf223a88bc Disable the use of the IAAD usb doorbell on NVidia controllers as it can cause
the hardware to stall.

Submitted by:	Hans Petter Selasky
2010-02-09 00:38:40 +00:00
Rebecca Cran
31615ef723 Document the usfs driver and the NO_SYSCTL_DESCR option, and update the comment for umass.
Don't include the sysctl description variables in aic7xxx when NO_SYSCTL_DESCR is used.

Approved by:	rrs (mentor)
2010-02-08 20:57:42 +00:00
Rui Paulo
9ac01d39ad Add multicast key search support. This fixes corrupted mcast packets
when we have more than one hostap vap.

Submitted by:	Russell Yount <russell.yount at gmail.com>
MFC after:	2 weeks
2010-02-08 20:23:20 +00:00
Rui Paulo
21d18f0e20 Fix TX power problems with AR9285. 2010-02-08 20:12:01 +00:00
Rui Paulo
b605438031 Fix typo in comment. 2010-02-08 20:04:02 +00:00
Rebecca Cran
4c21be9b2d Rename usb2_ structures and variables to usb_.
Approved by:	rrs (mentor)
Discussed with:	hps
2010-02-08 19:44:09 +00:00
Gavin Atkinson
b31b20fa02 Add support for a few more Sony-specific ACPI features (default display
brightness, wired LAN power and bass gain), and update the description of
one previously unknown feature (display contrast).  While here, expand on
a comment and remove two defines left over from an old version of the code.

Also update man page to document the above changes, and correct grammar.

PR:		kern/127581
2010-02-07 18:36:30 +00:00
Andriy Gapon
f4ab0cccce acpi_cpu: prefer _OSC over _PDC, just in case
_PDC was deprecated in favor of _OSC long time ago, but it
seems that they still peacefully coexist and in some case
only _PDC is present.
Still _OSC provides a reacher interface and is capable to
report back its status.
If the status is non-zero, then report it, we may find
it useful to understand what firmware expects from OS.
Also clean up some comments that became less useful over time.

Reviewed by:	njl, jhb, rpaulo
MFC after:	3 weeks
2010-02-06 12:48:06 +00:00
Jung-uk Kim
316bcf56a2 Map and report actual video memory we need. 2010-02-06 00:52:42 +00:00
Jung-uk Kim
f801fa102d Replace some homegrown functions with better/correct ones. 2010-02-05 18:00:24 +00:00
Alexander Motin
2622a559a7 Use new helper functions to set PCIe max read request size. 2010-02-05 17:20:48 +00:00
Alexander Motin
24d6a5ed27 Add pci_get|set_max_read_req() helper functions to control maximum PCIe
read request size.

Reviewed by:	jhb@
2010-02-05 17:18:48 +00:00
Alexander Motin
a4271edc11 Report SATA300 chips also as SATA. 2010-02-05 14:41:18 +00:00
Alexander Motin
57ae362c8f When hacking INQUIRY result, make sure that it is right INQUIRY and there
is enough of result to hack.
2010-02-05 12:40:18 +00:00
Andrew Thompson
504cfaf891 The ZTE MF633R modem has a different type of cdrom driver disk, add the product
ID and use a standard scsi eject.

Reported by:	Patrick Lamaiziere
MFC after:	3 days
2010-02-05 01:47:43 +00:00
Andrew Thompson
0988266155 Properly name the 0x0016 ZTE product as MF633R now that its known. 2010-02-04 23:34:35 +00:00
Alexander Motin
0a65b79f42 Return CAM_RELEASE_SIMQ flag only when it is needed, when SIM really
was frozen before and should be released.
2010-02-04 14:40:08 +00:00
Alexander Motin
e28a47de96 Do not release device, when changing number of openings. 2010-02-04 08:54:14 +00:00
Matt Jacob
54e81dece7 Yet another target mode compilation error. 2010-02-04 06:45:14 +00:00
Matt Jacob
97efa6dde8 Fix target mode compilation problem with previous delta 2010-02-04 00:40:12 +00:00
Jung-uk Kim
bfd1f292d4 Remove dead code and fix style(9) bugs. 2010-02-03 22:20:57 +00:00
Jung-uk Kim
c5813a500a Use bytes per scan line from mode table. The previous implementation did
not reflect actual number of bytes when it was not exactly width * bpp * 8.
2010-02-03 22:17:30 +00:00
Jung-uk Kim
a95cde0132 Correct virtual address of frame buffer for non-linear mode.
Reported by:	Marc UBM Bocklet (ubm dot freebsd at googlemail dot com)
2010-02-03 22:07:50 +00:00
Alexander Motin
8c38cd7ceb Implement poll method for atapicam.
It is not perfect, but better then nothing.
2010-02-03 21:45:09 +00:00
Alexander Motin
fff784a8da Report to CAM unit number of underlying ataX bus device, instead of this
atapicamX. It is more apropriate and useful together with "ata" name.
2010-02-03 21:26:54 +00:00
Matt Jacob
c8b8a2c4e6 Redo how commands handles are created and managed and implement sequence
numbers and handle types in rational way. This will better protect from
(unwittingly) dealing with stale handles/commands.

Fix the watchdog timeout code to better protect itself from mistakes.

If we run an abort on a putatively timed out command, the command
may in fact get completed, so check to make sure the command we're
timing it out is still around. If the abort succeeds, btw, the command
should get returned via a different path.
2010-02-03 21:09:32 +00:00
Andriy Gapon
877a6d9994 acpi_cpu: correct capabilities arguments for Processor _OSC evaluation
Populate capabilities buffer according to
Intel Processor Vendor-Specific ACPI Interface Specification.

MFC after:	2 weeks
2010-02-03 14:35:33 +00:00
Alexander Motin
4c9d5e6b0f Disable PHY of unconnected ports when interface power management enabled.
It allows to save a bit more power (about 0.5W on 2 unused ports of ICH8M).
2010-02-03 12:00:57 +00:00
Alexander Motin
4cca153030 - Give ATA/SATA SIMs info about ATAPI packet size, supported by device.
- Make ATA XPT to reject longer SCSI CDBs then supported by device, or
any SCSI CDBs, if device doesn't support ATAPI.
2010-02-02 11:09:28 +00:00
Joerg Wunsch
ac0797c3d1 GPIB overhaul, part #2: make the tnt4882 driver work with the newer
TNT5004 IC.  This involved a major rewrite of a number of things, as
this chip no longer supports the NAT7210 legacy mode but requires the
host to use the (more modern) FIFO mode.

In theory, this also ought to work on the older TNT4882C chip.  I'll
probably add this as optional support (perhaps by a device.hints flag)
later on.  By now, FIFO mode is *only* activates iff a TNT5004 chip
has been detected (where the old code didn't work at all), while
everything else is supposed to use the old code.

MFC after:	2 weeks
2010-02-01 21:21:10 +00:00
Pyun YongHyeon
9a6e301de2 PCI express device status register has W1C feature. Writing 0 has
no effect. Make sure to clear error bits by writing 1. [1]
While I'm here use predefined value instead of hardcodig magic
vlaue.

Submitted by:	msaitoh at NetBSD [1]
2010-02-01 20:58:45 +00:00
Pyun YongHyeon
bde52fe26d Add more bit definitions to PCI express device control and device
status register.

Reviewed by:	jhb
2010-02-01 20:50:49 +00:00
Jack F Vogel
29e1e1a3a7 A few minor changes: add altq option header, add missing conditional
around a buf_ring call that will break 7.3, and thanks to Fabien Thomas
add POLLING support for igb and a minor related fix in the em driver.
2010-02-01 19:28:43 +00:00
Alexander Motin
e024cf2af0 NetCell is a PCI hardware RAID without cable and mode setting. 2010-02-01 15:22:22 +00:00
Weongyo Jeong
1155ca9677 Adds siba_bwn module which is used with bwn(4). Main purpose of this
module is to distinguish parts of Silicon Backplane and of Broadcom
Wireless.
2010-01-31 21:18:22 +00:00
Robert Noland
b1ba33ffbe Welcome drm support for VIA unichrome chips.
MFC after:	2 weeks
2010-01-31 14:30:39 +00:00
Robert Noland
139890fd20 Import simple drm memory manager.
This is required for the VIA driver and at least some parts are needed
for GEM.

MFC after:	2 weeks
2010-01-31 14:25:29 +00:00
Jack F Vogel
146f25649d Fix for kern/141646: when stacking pseudo drivers like
lagg and vlan the vlan attach/detach event is not being
handed down to em, this caused some init code not to run,
and thus VLANs did not work. Ultimately having the event
get propagated would be nice, but for now the solution is
to have HWFILTER off by default, when this is the case
VLANs will work, ifconfig can be used to turn it on and
then get HW tag filtering.
2010-01-30 00:11:44 +00:00
Alexander Motin
ed70cffd35 Reset port on disconnect event, to abort any running requests. 2010-01-29 12:47:04 +00:00
Rui Paulo
f3d3bf8731 Add support for the AR9285 chipset, which is found on many netbooks
available today.

This card is a low power 802.11bgn that only does 11n rates up to MCS 7
(that's 65 Mbps in 20Mhz mode and 135 in 40Mhz mode).
802.11n is  not yet supported, but will be in the future.

The driver still has a problem regarding to the setting of txpower on
the card, so don't expect good performance yet. After fixing this
problem, an MFC is possible.

Special thanks to iXsystems and S Smirnov <tonve at yandex.ru> for help
with the purchase of a netbook with this card.

Sponsored by:	iXsystems, Inc.
2010-01-29 10:10:14 +00:00
Rui Paulo
b0a5caf4f2 Replace Id keyword with the FreeBSD keyword. 2010-01-29 10:07:17 +00:00
Rui Paulo
ed72d9a70b Replace Id keyword with the FreeBSD keyword. 2010-01-29 10:02:50 +00:00
Andrew Thompson
2155c5d814 Rework cam error handling to fix Mitsumi floppy drives.
Submitted by:	mav
2010-01-29 02:38:34 +00:00
Andrew Thompson
c2b2c741a0 Simplify attach for UMASS_PROTO_CBI_I mode and change some switch() returns
into breaks.

Submitted by:	Hans Petter Selesky
2010-01-29 02:35:50 +00:00
Andrew Thompson
4d69093fcc Add null check on quirk lookup and add a couple of umass quirks.
Submitted by:	Hans Petter Selesky
2010-01-29 02:33:50 +00:00
Andrew Thompson
dae1952f93 Add the Netgear WPN111 2010-01-29 02:32:46 +00:00
Andrew Thompson
8fa484e2cc Sync usb products to perforce. 2010-01-29 02:32:18 +00:00
Andrew Thompson
0283fab7f0 Attempt to recover on a TX error rather than stopping all transfers.
Submitted by:	Hans Petter Selesky
2010-01-29 02:31:33 +00:00
Andrew Thompson
89119752d0 Optimise EHCI ISOC HS done check.
Submitted by:	Hans Petter Selasky
2010-01-29 01:30:13 +00:00
Andrew Thompson
031c7388a2 Add device ID.
PR:		usb/142427
2010-01-29 01:27:54 +00:00
Andrew Thompson
97ccc89052 Use device_printf rather than printf + device_get_nameunit. 2010-01-28 22:54:01 +00:00
Andrew Thompson
8b1d9a81e9 Release the firmware after loading to the device. 2010-01-28 22:46:04 +00:00
Andrew Thompson
069f1a8056 Add run(4), a driver for Ralink RT2700U/RT2800U/RT3000U USB 802.11agn devices.
This driver was written for OpenBSD by Damien Bergamini and ported over by
Akinori Furukoshi.
2010-01-28 22:24:54 +00:00
Alexander Motin
0e6eb06168 Add FIS-based switching support. If controller supports FBS, it allows
several devices beyond Port Multiplier to work simultaneously, substantially
increasing performance.
2010-01-28 17:54:47 +00:00
Alexander Motin
83c5d981ac MFp4: Large set of CAM inprovements.
- Unify bus reset/probe sequence. Whenever bus attached at boot or later,
CAM will automatically reset and scan it. It allows to remove duplicate
code from many drivers.
- Any bus, attached before CAM completed it's boot-time initialization,
will equally join to the process, delaying boot if needed.
- New kern.cam.boot_delay loader tunable should help controllers that
are still unable to register their buses in time (such as slow USB/
PCCard/ CardBus devices), by adding one more event to wait on boot.
- To allow synchronization between different CAM levels, concept of
requests priorities was extended. Priorities now split between several
"run levels". Device can be freezed at specified level, allowing higher
priority requests to pass. For example, no payload requests allowed,
until PMP driver enable port. ATA XPT negotiate transfer parameters,
periph driver configure caching and so on.
- Frozen requests are no more counted by request allocation scheduler.
It fixes deadlocks, when frozen low priority payload requests occupying
slots, required by higher levels to manage theit execution.
- Two last changes were holding proper ATA reinitialization and error
recovery implementation. Now it is done: SATA controllers and Port
Multipliers now implement automatic hot-plug and should correctly
recover from timeouts and bus resets.
- Improve SCSI error recovery for devices on buses without automatic sense
reporting, such as ATAPI or USB. For example, it allows CAM to wait, while
CD drive loads disk, instead of immediately return error status.
- Decapitalize diagnostic messages and make them more readable and sensible.
- Teach PMP driver to limit maximum speed on fan-out ports.
- Make boot wait for PMP scan completes, and make rescan more reliable.
- Fix pass driver, to return CCB to user level in case of error.
- Increase number of retries in cd driver, as device may return several UAs.
2010-01-28 08:41:30 +00:00
Jack F Vogel
89d507fcf7 Add a link tasklet so updates can be sleepable. 2010-01-27 20:12:04 +00:00
Weongyo Jeong
1d3d5952a3 adds sysctl knobs to show rate statistics that it could be useful to
debug slow TX speed.
2010-01-27 19:43:14 +00:00
Jack F Vogel
afb98829ac Two more build problems, missing includes and semicolon. 2010-01-27 18:00:24 +00:00
Pyun YongHyeon
8281a098c6 Add initial support for RTL8103E PCIe fastethernet.
PR:	kern/142974
2010-01-27 17:49:27 +00:00
Jack F Vogel
6c8d4b16d4 Opps, completely wrong version of if_em.h got into
the checkin, sorry all :(
2010-01-27 17:35:58 +00:00
Jung-uk Kim
dd6155ac34 Use VESA palette load/save functions if VESA BIOS says the current palette
format is higher than 6-bit instead of relying VGA compatibility flag.
This fixes palette problem of NVIDIA GeForce 6600.  Reduce code differences
between palette load/save functions while we are here.

Tested by:	danfe
2010-01-27 17:00:42 +00:00
John Baldwin
47a933e3df Initialize the ifnet before calling mii_phy_probe() as some phy drivers
(e.g. e1000phy(4)) expect if_dname to be valid when they are probed.

MFC after:	3 days
2010-01-27 14:43:28 +00:00
Andriy Gapon
9a6a6ecb3a acpi_hpet: correctly get number of timers/comparators in a timer block
Also, account for a quirk of AMD/ATI HPET which reports number of timers
instead of id of the last timer as manadated by the specification.
Currently this has no effect on functionality but in the future we may
make actual use of the HPET timers, not only of its timecounter.

MFC after:	2 weeks
2010-01-27 10:17:28 +00:00
Alexander Motin
6d21c943a3 Add one more type cast, missed in r203043. 2010-01-27 06:28:16 +00:00
Jack F Vogel
ac95ee294c Missing a fix for the new watchdog handling. 2010-01-26 23:04:13 +00:00
Jack F Vogel
4b502b77de Remove some internal conditional defines that will
fail in kernel tree.
2010-01-26 22:38:31 +00:00
Jack F Vogel
a69ed8dfb3 Update the 1G drivers, shared code sync with Intel,
igb now has a queue notion that has a single interrupt
with an RX/TX pair, this will reduce the total interrupts
seen on a system. Both em and igb have a new watchdog
method. igb has fixes from Pyun Yong-Hyeon that have
improved stability, thank you :)

I wish to MFC this for 7.3 asap, please test if able.
2010-01-26 22:32:22 +00:00
Alexander Motin
a868f1265e Do not place fake interrupt register on chip.
Now we have better place for it.
2010-01-26 20:27:20 +00:00
Alexander Motin
8abceb703e Restore SATA speed reporting, broken by ATA_CAM changes. 2010-01-26 16:18:45 +00:00
Alexander Motin
ad753ac2a7 Clear ch->devices, if hard-reset failed.
This makes hot-plug work nicely.

HW donated by:	James R. Van Artsdalen
2010-01-26 16:05:49 +00:00
Alexander Motin
6268666c1b Add support for SATA part of Marvell 88SE912x controllers to ahci(4).
Limit early revisions from 6Gb/s to 3Gb/s by default, or they negotiate
only 1.5Gbps, when 3Gb/s devices connected.

Add dummy driver for PATA part of these controllers, preventing generic
driver attach them. It causes system freeze when SATA controller used after
PATA was touched.
2010-01-26 15:25:24 +00:00
Neel Natu
61f7c762de Create the "cfecons" tty directly using tty_makedev(). It is not clear what
the intention of having two ttys pointing to the same cfe console device was.

Also we were not initializing the output[] array passed in as input to
tty_makedev() so one name of the ttys was garbage.

Fix the code that calls cfe_write() to deal with the case where only a partial
buffer is written out.

cfe_cngetc() needs to return if there is no character available as input.
If we don't do this then the cfe_timeout() function will spin forever
because cfe_cngetc() will only ever return if there is valid input.

Approved by: imp (mentor)
2010-01-26 03:42:34 +00:00
Rui Paulo
654baa4adf o add more notification strings in iwn_intr_str()
o sync with OpenBSD code

Submitted by:	Bernhard Schmidt <bschmidt at techwires.net>
MFC after:	3 days
2010-01-25 19:36:48 +00:00
Remko Lodder
b6a18bc939 Add support for the NM10 chipset.
PR:		kern/143118
Submitted by:	Koshin sumitani <ksumitani at mui dot biglobe dot ne dot jp>
Approved by:	imp (mentor, implicit)
MFC after:	3 days
2010-01-24 10:50:20 +00:00
Joerg Wunsch
ce3853023f Fix breakage introduced to the tnt4882 driver in r202870. This PCI
frontend uses the same uPD7210 backend as the pcii ISA frontend, so
the backend has to cope with both situations.

Also, hide the first printf in pcii_probe (address mismatch) behind
bootverbose as the ISA bus parent tries to probe all configured ISA
devices against each driver, so a the console has been cluttered with
this message for a bunch of unrelated driver probes.

MFC after:	3 days
2010-01-23 21:33:33 +00:00
Joerg Wunsch
72821110ac Overhaul of the pcii driver:
. Properly allocate all IO space resources.  These cards scatter their
  IO addresses over a range of 0x1600 bytes, and they require an
  additional address for "special interrupt handling".

. Implement the "special interrupt handling" per the GPIB-PCIIA
  Technical Reference Manual; this was apparently not declared for the
  clone card this driver has been originally implemented for, but it
  turned out to be needed for both, an original NI brand PCII/PCIIA
  card as well as the Axiom AX5488 clone.

. Add some diagnostic messages for various resource allocation etc.
  failures during probe.

. Add some comments about the structure of the IO address space that
  is used by these cards.

MFC after:	1 day
2010-01-23 07:54:06 +00:00
Navdeep Parhar
3c0e59de3e Don't forget to release the adapter lock for a no-op. 2010-01-23 01:44:30 +00:00
Pyun YongHyeon
84e3651eb3 Yukon Ultra2 has 126MHz clock. 2010-01-22 20:15:49 +00:00
Pyun YongHyeon
a91981e4ba s/Mhz/MHz/g
Submitted by:	N.J. Mann <njm <> njm dot me dot uk >
2010-01-22 20:10:12 +00:00
Pyun YongHyeon
d67eba2f3f Use new handshake command for BCM5750 or new controllers. 2010-01-22 18:46:37 +00:00
Pyun YongHyeon
899d684659 Fix a long standing ASF heartbeat sending bug. The initial
implementation of heartbeat interval was 2 but there was typo which
caused the heartbeat is sent approximately every 5 seconds. This
caused unintended controller reset by firmware because firmware
thought OS was crashed.

Submitted by:	Floris Bos < info <> je-eigen-domein dot nl >
Tested by:	Andrzej Tobola < ato <> iem dot pw dot edu dot pl >
2010-01-22 18:35:50 +00:00
Ed Maste
b8c05be0c1 Add H55 ID from Mike Tancsa, with minor rewording from avg@.
PR:		kern/143068
Submitted by:	Mike Tancsa (Sentex)
MFC after:	1 week
2010-01-22 16:05:10 +00:00
Alexander Motin
8da30a896a Oops! r202789 broke recording from input mixer. Restore previous "mix"
usage and use "igain" instead for input-to-output monitoring loopback.
2010-01-22 09:54:40 +00:00
Alexander Motin
028b92a574 - Improve tracer, to handle more cases of input-to-output monitoring
loopback.
- Change the meaning of "mix" OSS control. Now it controls loopback level,
according to comments in soundcard.h.
- Allow AD1981HD codecs to use playback mixer. Now driver should be able to
really use it.
- Fix bug in shared muters operation.
2010-01-22 09:31:10 +00:00
Jung-uk Kim
9a179dd8be Merge ACPICA 20100121. 2010-01-21 21:14:28 +00:00
Alexander Motin
09aa060e71 Print playback channels paths in order of their sequence numbers, not nids. 2010-01-21 09:11:50 +00:00
David Christensen
bff0eb4e5c - Added a workaround for NC-SI management firmware that would allow
frames to be accepted while the driver is resetting the hardware.
  This failure is generally observed when broadcast frames are received
  during driver load and will generate "Unable to write CTX memory"
  errors.
- Small changes to driver flags display.
2010-01-20 20:33:10 +00:00
Rui Paulo
4135f5cf7d Make ata_getrev() an optional method by implementing ata_null_getrev().
This fixes a bogus '???' boot message on Cambria boards with a CompactFlash
card.

Reviewed by:	mav
2010-01-20 14:29:55 +00:00
Navdeep Parhar
1299e07187 Complain if freelist queue sizes are significantly less than desired.
MFC after:	1 day
2010-01-20 07:28:14 +00:00
Navdeep Parhar
b302b77ca7 Fix for a cxgb(4) panic. cxgb_ioctl can be called by the IP and IPv6
layers with non-sleepable locks held.  Don't (potentially) sleep in
those situations.
2010-01-20 03:40:43 +00:00
Weongyo Jeong
07f8d9afd2 Product ID of D-Link DWA-120 after loading the firmware is incorrect. 2010-01-19 01:26:40 +00:00
Weongyo Jeong
97ac268fcb removes a hack to attach TRENDnet TEW-504UB/EU that I think this issue
is solved with r202607.  Now idProduct of all uath(4) devices should be
decreased after loading the firmware.
2010-01-19 01:11:27 +00:00
Warner Losh
73f0e8eb9c Add a warning if we're inw'ing from an odd address. This could happen
due to a bug and might be the real basis for the cardbus workaround
hack.
2010-01-18 17:53:44 +00:00
Warner Losh
9103854246 Fix indentation nit. 2010-01-18 17:52:57 +00:00
Andriy Gapon
bfd1961beb acpi_ec: remove redundant acpi_disabled check in probe method
MFC after:	4 days
2010-01-18 11:33:58 +00:00
Andriy Gapon
943124d3f0 acpi_ec: clean up 'private' ivar when freeing memory to which it points
This is not only a prudent thing to do, but also makes sure that probe
method is not confused by non-NULL 'private', if the previous attach
attempt fails for any reason.

PR:		kern/142561
Tested by:	Alex Goncharov <alex-goncharov@comcast.net>
MFC after:	4 days
2010-01-18 10:30:11 +00:00
Matt Jacob
78a235dd3f Amazingly we've been freeing a handle and using that which it refers to
for years. Bad!

MFC after:	1 week
2010-01-15 20:08:08 +00:00
Pyun YongHyeon
261f04d654 Don't free mbuf chains when bge(4) fails to collapse the mbuf
chains. This part of code is to enhance performance so failing the
collapsing should not free TX frames. Otherwise bge(4) will
unnecessarily drop frames which in turn can freeze the network
connection.

Reported by:	Igor Sysoev (is <> rambler-co dot ru)
Tested by:	Igor Sysoev (is <> rambler-co dot ru)
2010-01-15 17:55:18 +00:00
Pyun YongHyeon
cb2ed75f7e Add check for fiber mode for BCM5714 PHY. This PHY supports both
copper and fiber interfaces over GMII so an explicit check is
necessary to know whether it was configured for fiber interface.
This change make BCM5715S work.

Tested by:	olli
MFC after:	1 week
2010-01-14 19:14:24 +00:00
Pyun YongHyeon
ea3b412711 For controllers that has dual mode PHY(copper or fiber) interfaces
over GMII, make sure to enable GMII. With this change brgphy(4) is
used to handle the dual mode PHY. Since we still don't have a sane
way to pass PHY specific information to mii(4) layer special
handling is needed in brgphy(4) to determine which mode of PHY was
configured in parent interface.
This change make BCM5715S work.

Tested by:	olli
Obtained from:	OpenBSD
MFC after:	1 week
2010-01-14 19:08:43 +00:00
Andrew Thompson
f644abcf6e Grammar nits.
Submitted by:	Ben Kaduk
2010-01-14 01:16:20 +00:00
Pyun YongHyeon
ba84b911c4 Add BCM5754 PHY id that is found on Dell Studio XPS 16.
Tested by:	scf
MFC after:	1 week
2010-01-14 00:36:49 +00:00
Xin LI
f7d1b2eb75 o Add PCI ID for BCM 5756.
o Don't enable BGE_FLAG_BER_BUG on both 5722 and 5756, and based
   on their PCI IDs rather than their chip IDs.

Reported by:	several PC-BSD users via kmoore
Reviewed by:	yongari, imp, jhb, davidch
Sponsored by:	iXsystems, Inc.
MFC after:	2 weeks
2010-01-13 22:39:39 +00:00
Alexander Motin
1d676e56c6 Hide from default sndstat some information not used on daily basis,
to make it readable by average user with average screen size.
2010-01-13 22:22:16 +00:00
Andrew Thompson
9b6ffc1f49 Update to Fredrik's latest uhso driver. This changes port detection, adds
comments and other code nits.

Submitted by:	Fredrik Lindberg <fli@shapeshifter.se>
2010-01-13 20:54:18 +00:00
Andrew Thompson
941e286383 Add a driver by Fredrik Lindberg for Option HSDPA USB devices. These differ
from standard 3G wireless units by supplying a raw IP/IPv6 endpoint rather than
using PPP over serial. uhsoctl(1) is used to initiate and close the WAN
connection.

Obtained from:	Fredrik Lindberg <fli@shapeshifter.se>
2010-01-13 03:16:31 +00:00
Alexander Motin
b7d561a3f1 Make OSS_GETVERSION ioctl supported also for DSP devices,
same as 4Front and Linux do.

MFC after:	1 month
2010-01-12 20:10:40 +00:00
Alexander Motin
d6b230d20a Make default recording source choosing more intelligent.
Change default recording level from 0 to 75.
It should increase chances for things to work just out of the box.
2010-01-12 19:41:07 +00:00
Gavin Atkinson
7964930201 Spell "Hz" correctly wherever it is user-visible.
PR:		bin/142566
Submitted by:	N.J. Mann   njm njm.me.uk
Approved by:	ed (mentor)
MFC after:	2 weeks
2010-01-12 17:59:58 +00:00
Alexander Motin
481ad2f5b4 Align buffer size to LCM of 128bytes, required by hardware, and alignment of
current format. This fixes problems with non-power-of-2 number of channels.

Enable 5.1 formats support, as they are working fine now.
2010-01-12 16:40:13 +00:00
Alexander Motin
2fdb5f0b86 Make OSS_GETVERSION ioctl really work. It has 'M' group, not 'P',
as different nearby ones, and was grabbed by MIXER_xxx() handler.

While there, replace '(cmd & MIXER_xxx(0)) == MIXER_xxx(0)' expressions
with more correct '(cmd & ~0xff) == MIXER_READ(0)'. Use of bit operations
to compare numeric fields doesn't looks sane.

MFC after:	1 month
2010-01-12 11:11:25 +00:00
Alexander Motin
fbf9cd2256 Add multichannel (4.0 and 7.1) playback support. 5.1 mode support blocked
now due to unidentified synchonization problem. For 7.1 soundcards 5.1
support handled correctly via software upmix done by sound(4).

Stereo stream is no more duplicated to all ports. If you loose sound, check
you are using right connectors. Front speakers connector is usually green,
center/LFE - orange, rear - black, side - gray.
2010-01-11 22:57:52 +00:00
Andrew Gallatin
5769c5efb0 Use better default RSS hash (src + dst, rather than just src port)
MFC after:3 days
2010-01-11 22:28:40 +00:00
Andrew Gallatin
669f23dee5 Update mxge(4) firmware to 1.4.48b (latest available) from Myricom.
Pertinant highlights from Myricom CHANGES file include:

- Make sure invalid external smbus activity cannot affect performance
- Fix to avoid a bug where the link could sometimes stay reported as
   up on after unplugging the cable.
- For 8B NIC, make smbus connection passive at init to avoid
   possible address conflicts
- Increase number of slices to 17 for multi-slice fw
- Fix a bug where packets dropped because of link_overflow could
     be occasionally reported as bad_crc32
- Add selectable failover strategy for dual-port chip: symmetric or primary/backup
- On failover, send RARP broadcast to make the change immediately
  known to the network
- Change endianess for PCI Device Serial Number
- For dual-port NICs, time to failover is now a few microsecs
    instead of a few millisecs.

MFC after:	3 days
2010-01-11 22:25:09 +00:00
Andrew Gallatin
51bc2092fe Fix reporting of 10G Twinax media
Reported by: mjacob
MFC after: 3 days
2010-01-11 22:08:59 +00:00
Marcel Moolenaar
409a390c33 Use io(4) for I/O port access on ia64, rather than through sysarch(2).
I/O port access is implemented on Itanium by reading and writing to a
special region in memory. To hide details and avoid misaligned memory
accesses, a process did I/O port reads and writes by making a MD system
call. There's one fatal problem with this approach: unprivileged access
was not being prevented. /dev/io serves that purpose on amd64/i386, so
employ it on ia64 as well. Use an ioctl for doing the actual I/O and
remove the sysarch(2) interface.

Backward compatibility is not being considered. The sysarch(2) approach
was added to support X11, but support for FreeBSD/ia64 was never fully
implemented in X11. Thus, nothing gets broken that didn't need more work
to begin with.

MFC after:	1 week
2010-01-11 18:10:13 +00:00
Warner Losh
3274f529db Fix bug in cfe_enumenv(). The CFE API to invoke is CFE_CMD_ENV_ENUM
and not CFE_CMD_ENV_SET.

Submitted by:	neel@
2010-01-11 17:16:06 +00:00
Warner Losh
18f323353c Merge from projects/mips to head by hand:
Defintions for cavium uart (do they belong here?)
2010-01-11 04:13:06 +00:00
Warner Losh
05ace0e870 Merge from projects/mips to head by hand:
copy over cfe_env.c...
2010-01-11 03:43:18 +00:00
Warner Losh
c15423bb79 This was somehow copied to the wrong place :(. Remove the spare copy. 2010-01-11 00:41:14 +00:00
Warner Losh
f403c751b9 Move this to the right location. Grump. 2010-01-11 00:40:19 +00:00
Andrew Thompson
e191eb5a50 Add the Globetrotter GE40x.
Submitted by:	Mike Tancsa
2010-01-11 00:18:40 +00:00
Alexander Motin
f343c07f96 While AHCI specification tells that multi-vector MSI doesn't use global IS
register, nVidia chipsets have different oppinion, requiring every interrupt
to be acknowledged there.

While there, add interrupt descriptions in multi-vector MSI mode.
2010-01-10 16:05:05 +00:00
Gavin Atkinson
7c9fdc4d36 Don't panic on attach if we can't allocate ifp
Approved by:	ed (mentor)
MFC after:	2 weeks
2010-01-10 14:48:42 +00:00
Alexander Motin
2d0163ee22 Report which of IXP700 legacy ATA channels is SATA. 2010-01-10 11:02:10 +00:00
Alexander Motin
0025eb12c8 - Report SATA in legacy emulation mode still as SATA.
- Make ATA XPT able to handle such case.
2010-01-10 09:20:56 +00:00
Warner Losh
5b12181c4e Merge from projects/mips to head by hand:
merge register definitions for mx25l flash.
2010-01-10 05:16:55 +00:00
Warner Losh
c5455f1b46 Merge from projects/mips to head by hand:
Merge support for MX25L spi flash.
2010-01-10 05:15:46 +00:00
Warner Losh
522e41fcac Merge from projects/mips to head by hand:
Merge the siba bus device.  This was moved from mips to dev because
siba bus can be in other architectures, like ARM.
2010-01-10 05:07:29 +00:00
Navdeep Parhar
b6783ad018 Extra parantheses to keep certain compilers happy.
Submitted by:	trasz@
2010-01-09 18:07:10 +00:00
Giorgos Keramidas
578fece5ff Revert iwn channel-argument handling of set_txpower() to r201822
Pass the channel argument as a real argument and not through
RXON.  The RXON version seems to have problem with both the older
228.57.2.23 firmware and the latest 228.61.2.24 version resulting
in device initialization errors like:

  wpa_supplicant[2928]: Failed to initiate AP scan.
  kernel: firmware error log:
  kernel: error type      = "SYSASSERT" (0x00000005)
  kernel: program counter = 0x0000147C
  kernel: source line     = 0x0000058B
  kernel: error data      = 0x0000058B00000000
  kernel: branch link     = 0x0000145A00001492
  kernel: interrupt link  = 0x000006DE00000000
  kernel: time            = 7310
  ...
  kernel: iwn0: iwn_config: could not set TX power
  kernel: iwn0: iwn_init_locked: could not configure device, error 35

By passing the current channel to hal->set_txpower() the firmware
error is fixed, at least for the 4965 chipset of my Thinkpad and
the ones tested by Bernhard.

Submitted by:	Bernhard Schmidt <bschmidt@techwires.net>
Approved by:	rpaulo
2010-01-09 04:00:22 +00:00
Edward Tomasz Napierala
78eb86c35d Fix array overflow.
Reviewed by:	rpaulo
2010-01-08 21:02:12 +00:00
Edward Tomasz Napierala
5de96da8e3 Get rid of #ident. 2010-01-08 20:40:28 +00:00
Edward Tomasz Napierala
28bce2e992 Get rid of #ident, GCC 4.4 warns about it being deprecated.
OK-ed by:	scottl
2010-01-08 17:20:41 +00:00
Edward Tomasz Napierala
bcd694ce76 One more #ifdef fix for GCC 4.4. 2010-01-08 15:57:56 +00:00
Edward Tomasz Napierala
07020dae57 Remove unused uhci_dump_qhs().
Reviewed by:	hps
2010-01-08 15:52:06 +00:00
Edward Tomasz Napierala
d8a9f5a9d9 Remove unused iir_watchdog().
Reviewed by:	scottl
2010-01-08 15:47:23 +00:00
Edward Tomasz Napierala
913e66b64f Put mly_timeout() under MLY_DEBUG, so that newer GCC versions don't
complain about unused static function.

Reviewed by:	scottl
2010-01-08 15:46:27 +00:00
Edward Tomasz Napierala
3745cc73d0 Replace several instances of 'if (!a & b)' with 'if (!(a &b))' in order
to silence newer GCC versions.
2010-01-08 15:44:49 +00:00
Gavin Atkinson
51d930e747 If we fail to read the Ethernet address from the card, just print an
warning message and attach without setting the Ethernet address to a
random address.  It is not believed that this code can actually be
executed, and if it does, we're better off printing an error message than
faking up an Ethernet address.

PR:		kern/133239
Reviewed by:	yongari (earlier version of patch)
Approved by:	ed (mentor)
2010-01-08 10:32:27 +00:00
Pyun YongHyeon
e036acc008 Make sure to store dma address of RX buffer in little endian form.
This fixes the last bug which keeps ste(4) from working on sparc64.
2010-01-08 02:43:20 +00:00
Pyun YongHyeon
fcd8385e19 Fix EEPROM access code to return data in host byte order.
EEPROM on ST201 always returns 16bits data with little endian
format so conversion to host order is required.
This change fixes inversed ethernet address on sparc64.
2010-01-08 02:39:53 +00:00
Andrew Thompson
e54f81e0b9 Remove unneeded includes. 2010-01-08 01:41:58 +00:00
Martin Blapp
c2ede4b379 Remove extraneous semicolons, no functional changes.
Submitted by:	Marc Balmer <marc@msys.ch>
MFC after:	1 week
2010-01-07 21:01:37 +00:00
Andrew Thompson
e33b1a7e54 Fix debug printf on 64bit arches.
Spotted by:	b. f.
2010-01-07 02:25:19 +00:00
Andrew Thompson
1feda9b418 Add new umass quirks for Western Digital MYBook and JMicron JM20337.
PR:		usb/142225, usb/142228
Submitted by:	Thomas Ward, Yoshikazu GOTO
MFC after:	1 week
2010-01-07 00:30:59 +00:00
Andrew Thompson
d84a79e731 Improve u3g device ejecting by providing additional methods for the eject
command in the usb_msctest routines, as well as a general tidyup.

This now properly ejects the ZTE MF636, Option Gi0322 and Novatel MC950D
devices I have on my desk.
2010-01-06 22:14:05 +00:00
Andrew Thompson
c10e1453e7 scratch_size was incorrectly passed as language ID when retrieving the language
ID table, this broke string retrieval on some devices.

Submitted by:	Hans Petter Selasky
Reported by:	Renato Botelho
2010-01-06 21:46:08 +00:00
Warner Losh
c0156af7e0 Sync to r201658 on head. 2010-01-06 18:21:22 +00:00
Rui Paulo
7edea21b22 len must be int, not size_t
Submitted by:	novel
2010-01-06 13:13:14 +00:00
Warner Losh
9199c09a15 Merge from head at r201628.
# This hasn't been tested, and there are at least three bad commits
# that need to be backed out before the branch will be stable again.
2010-01-06 05:58:07 +00:00
Rui Paulo
ab925d255d Add net80211 media status reporting.
PR:		142197
Submitted by:	Paul <onemda at gmail.com>
2010-01-05 22:59:59 +00:00
John Baldwin
af827f9642 Move the PCI-specific logic of removing a cardbus device into a
pci_delete_child() function called by the cardbus driver.  The new function
uses resource_list_unreserve() to release the BARs decoded by the device
being removed.

Reviewed by:	imp
Tested by:	brooks
2010-01-05 20:42:25 +00:00
Mitsuru IWASAKI
a50f74cc3a Update acpi_ibm syctl nodes on resume.
This should fix some Thinkpad specific problems such as
connecting to a headphone jack is not functional on X41.

Reviewed by:	takawata
MFC after:	1 week
2010-01-05 20:29:30 +00:00
Warner Losh
f29b8b7f41 cardbus -> CardBus 2010-01-03 23:31:58 +00:00
Warner Losh
f33a1c1621 cardbus -> CardBus 2010-01-03 23:29:49 +00:00
Warner Losh
afa45c0763 cardbus -> CardBus 2010-01-03 23:28:32 +00:00
Warner Losh
cba55405e1 CardBus instead of cardbus. 2010-01-03 23:26:29 +00:00
Warner Losh
a2d61e43c2 Fix CardBus spelling.
MFC after:	1 month
2010-01-03 23:15:14 +00:00
Pyun YongHyeon
4f4a16e152 Fix regression introduced in r198318. BCM5754/BCM5754M uses the
same ASIC ID of BCM5758 such that r198318 incorecctly enabled TSO
on BCM5754.BCM5754M controllers. BCM5754/BCM5754M needs a special
firmware to enable TSO and bge(4) does not support firmware based
TSO.

Reported by:	ed
Tested by:	ed
2010-01-03 21:49:24 +00:00
Martin Blapp
593a1aea1a Fix card/device names, no functional change
The ADMtek AN985 is the cardbus variant of ADMtek AN983
The Netgear FA511 is just a relabled ADMtek AN985

PR:		kern/50574
MFC after:	1 month
2010-01-03 13:59:59 +00:00
Matt Jacob
1943fd192a Make sure that the WWNN is also created for 2100..2300 cards.
MFC after:	1 day
2010-01-03 02:43:46 +00:00
Marius Strobl
209817b163 Fix botches in r201005:
- Actually use the newly introduced sc_res in the front-end.
- Remove a whitespace glitch in mk48txx_gettime().
2010-01-01 22:47:53 +00:00
Matt Jacob
1d52a1ad42 Create a Node WWN from the *Port* WWN, not vice versa, for 2400s.
If the NAA is type 2, the Node WWN is the Port WWN with the 12 bits
of port (48..60) cleared. This iff a wwn fetched from NVRAM is zero.

MFC after:	1 week
2009-12-31 04:16:18 +00:00
Andrew Thompson
87b88f757d Add new device ID to uipaq driver
PR:		usb/141936
Submitted by:	HASHI Hiroaki
2009-12-31 00:55:50 +00:00
Ed Schouten
03bc68ca09 Disable K&R style function definitions for WARNS=6.
Unfortunately there are two slight problems with that:

- Yacc and lex might generate code that generates warnings because of
  this. Require yacc and lex to be rebuilt during bootstrap. I'm not
  incrementing __FreeBSD_version here, because I assume someone else
  will do this eventually.

- When running `make buildkernel', it uses share/mk from the source
  treeo to build aicasm. Because aicasm also depends on lex, this would
  break. Lower WARNS to 5 for now. We should just increment it to 6
  again somewhere in the very far future.
2009-12-31 00:07:26 +00:00
John Baldwin
3a6b4b04ab Fix an error case I missed in the previous change so that the CIS resource
is fully cleaned up if we fail to find the CIS in the devices ROM.
2009-12-30 22:34:26 +00:00
John Baldwin
767dff0ac9 Delete the CIS resource after releasing it. This is needed when the CIS is
stored in a BAR since the CIS BAR is mapped before the PCI bus driver
enumerates all the BARs.  Without this change, the PCI bus driver would
attempt to initialize a BAR that was already allocated resulting in a panic.
2009-12-30 20:49:13 +00:00
John Baldwin
4e8790e943 Teach the PCI bus driver to handle PCIR_BIOS BARs properly and remove special
handling for the PCIR_BIOS decoding enable bit from the cardbus driver.
The PCIR_BIOS BAR does include type bits like other BARs.  Instead, it is
always a 32-bit non-prefetchable memory BAR where the low bit is used as a
flag to enable decoding.

Reviewed by:	imp
2009-12-30 20:47:14 +00:00
John Baldwin
f26d7f8e95 Use bus_*() rather than bus_space_*(). 2009-12-30 20:42:07 +00:00
John Baldwin
1280c1198d Remove no longer used pci_release_resource(). 2009-12-30 19:46:09 +00:00
John Baldwin
ef36004841 Use a constant instead of a magic number for the flag that enables decoding
of a device ROM.
2009-12-30 19:42:27 +00:00
Ed Schouten
73c4bad04d Add missing `void' keywords. 2009-12-30 16:56:50 +00:00
Justin T. Gibbs
491e647805 In blkif_queue_cb(), test the return value from gnttab_claim_grant_reference()
for >= 0 instead of != ENOSPC.
2009-12-29 23:31:21 +00:00
Robert Noland
cfd7bacef2 Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.
This replaces d_mmap() with the d_mmap2() implementation and also
changes the type of offset to vm_ooffset_t.

Purge d_mmap2().

All driver modules will need to be rebuilt since D_VERSION is also
bumped.

Reviewed by:	jhb@
MFC after:	Not in this lifetime...
2009-12-29 21:51:28 +00:00
Alexander Motin
723bd8c6b5 Usually these controllers are able to automatically decode command code to
get required command protocol. But they have no idea about new commands,
such as DATA SET MANAGEMENT (TRIM). As soon as this info any way provided
by CAM, give controller specific instructions.
2009-12-29 21:49:11 +00:00
Rui Paulo
0f454b93f8 iwn(4) update. Notable changes:
* new firmware
* untested support for 1000 and 6000 series
* bgscan support
* remove unnecessary RXON changes
* allow setting of country/regdomain by enforcing channel flags read
  from the EEPROM
* suspend/resume fixes
* RF kill switch fixes
* LED adjustments
* several bus_dma*() related fixes
* addressed some LORs
* many other bug fixes

Submitted by:	Bernhard Schmidt <bschmidt at techwires.net>
Obtained from:	Brandon Gooch <jamesbrandongooch at gmail dot com> (LED
		related changes), Benjamin Kaduk <kaduk at mit dot edu>
		(LOR fixes), OpenBSD
2009-12-29 19:47:34 +00:00
Philip Paeps
a6eb469d8e Fix autonegotiation: tell the MAC where to find the PHY.
Fix crashes in the detach path.

Submitted by:	Kristof Provost <kristof@sigsegv.be>
MFC after:	1 month
2009-12-29 14:00:17 +00:00
Joseph Koshy
e9b5dc16ef Use VFS_{LOCK,UNLOCK}_GIANT() around the call to vrele().
Reviewed by:	 kib
2009-12-29 02:35:50 +00:00
Antoine Brodin
13e403fdea (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
Fix some wrong usages.
Note: this does not affect generated binaries as this argument is not used.

PR:		137213
Submitted by:	Eygene Ryabinkin (initial version)
MFC after:	1 month
2009-12-28 22:56:30 +00:00
Justin T. Gibbs
a4660d594f Correct alignment and boundary constraints in blkfront's bus dma tag. The
blkif interface in Xen requires all I/O to be 512 byte aligned with each
segment bounded by a 4k page.

Note: This submission only documents the proper contraints for blkif I/O.
      The alignment code in busdma does not yet handle alignment constraints
      correctly in all cases.
2009-12-28 18:59:13 +00:00
Andrew Thompson
b55b073f14 Compact USB_VENDOR_X and USB_PRODUCT_Y in the quirk tables. 2009-12-28 00:42:42 +00:00
Andrew Thompson
9e6b53136e Use macros to strip off USB_VENDOR_ and USB_PRODUCT_ from some id tables to make
them more compact and readable.
2009-12-26 19:03:28 +00:00
Joseph Koshy
8ca7958478 * Support the L1D_CACHE_LD event on Core2 processors.
* Correct a group of typos: for Core2 programmable events, check
  user supplied umask values against the correct event descriptor
  field.

Submitted by:	Ryan Stone <rysto32 at gmail dot com>
2009-12-26 14:39:23 +00:00
Joseph Koshy
bf792d68c7 Log process mappings for existing processes at PMC start time.
Submitted by:	Marc Unangst <mju at panasas dot com> [original patch]
Tested by:	fabient
2009-12-26 13:58:52 +00:00
Marius Strobl
0c516eae87 Remove clause 3 from Izumi Tsutsui's licenses.
Obtained from:	NetBSD
2009-12-25 22:58:43 +00:00
Marius Strobl
de6a190429 Style changes
Obtained from:	NetBSD (mc146818reg.h)
2009-12-25 22:53:46 +00:00
Marius Strobl
033a5c8ce1 - Take advantage of bus_{read,write}_*(9).
- Set dow = -1 in mk48txx_gettime() because some drivers (for example
  the NetBSD and OpenBSD mk48txx(4)) don't set it correctly.
2009-12-25 21:53:20 +00:00
Marius Strobl
1b02305785 Remove clause 3 and 4 from TNF licenses.
Obtained from:	NetBSD
2009-12-25 21:41:05 +00:00
Marius Strobl
a64ac9c1e3 Style changes 2009-12-25 21:32:26 +00:00
Gavin Atkinson
cd3135e9ec Set the locally-assigned bit in the randomly generated Ethernet address
if we end up having to generate one.

PR:		kern/133239
Discussed with:	yongari
Approved by:	ed (mentor)
MFC after:	2 weeks
2009-12-25 19:57:28 +00:00
Gavin Atkinson
f0b108cf03 Small spelling fix, "Ethetnet" -> "Ethernet"
Approved by:	ed (mentor)
MFC after:	1 week
2009-12-25 19:38:12 +00:00
Alexander Motin
c078c19633 Teach twe driver to report array stripe size to GEOM. 2009-12-25 17:34:43 +00:00
Alexander Motin
f45946a8f7 Avoid false positive probe on ICH6 chipsets. 2009-12-25 07:59:31 +00:00
Pyun YongHyeon
55219c9044 Remove wrong assertion. 2009-12-25 00:23:47 +00:00
Pyun YongHyeon
cb05ec6606 ether_ifattach sets if_mtu, remove unnecessary code. 2009-12-24 20:45:33 +00:00
Pyun YongHyeon
da57a8c835 Update if_iqdrops in case of RX buffer allocation failure. 2009-12-24 20:43:31 +00:00
Pyun YongHyeon
b4c170e1f5 Add suspend/resume support as well as basic WOL.
While I'm here simplify SIOCSIFCAP handler.
2009-12-24 18:17:53 +00:00
Pyun YongHyeon
fabbaac560 Implement RX interrupt moderation using one-shot timer interrupt.
Unlike TX interrupt, ST201 does not provide any mechanism to
suppress RX interrupts. ste(4) can generate more than 70k RX
interrupts under heavy RX traffics such that these excessive
interrupts make system useless to process other useful things.
Maybe this was the major reason why polling support code was
introduced to ste(4).
The STE_COUNTDOWN register provides a programmable counter that
will generate an interrupt upon its expiration. We program
STE_DMACTL register to use 3.2us clock rate to drive the counter
register. Whenever ste(4) serves RX interrupt, the driver rearm
the timer to expire after STE_IM_RX_TIMER_DEFAULT time and disables
further generation of RX interrupts. This trick seems to work well
and ste(4) generates less than 8k RX interrupts even under 64 bytes
UDP torture test. Combined with TX interrupts, the total number of
interrupts are less than 10k which looks reasonable on heavily
loaded controller.

The default RX interrupt moderation time is 150us. Users can change
the value at any time with dev.ste.%d.int_rx_mod sysctl node.
Setting it 0 effectively disables the RX interrupt moderation
feature. Now we have both TX/RX interrupt moderation code so remove
loop of interrupt handler which resulted in sub-optimal performance
as well as more register accesses.
2009-12-24 17:22:15 +00:00
Rui Paulo
0ce207d2af Intel XScale hwpmc(4) support.
This brings hwpmc(4) support for 2nd and 3rd generation XScale cores.
Right now it's enabled by default to make sure we test this a bit.
When the time comes it can be disabled by default.
Tested on Gateworks boards.

A man page is coming.

Obtained from:	//depot/user/rpaulo/xscalepmc/...
2009-12-23 23:16:54 +00:00
Marius Strobl
48533564ca Recognize the NS16552 found in PCIe-based sun4u machines. 2009-12-23 22:31:43 +00:00
Pyun YongHyeon
ae49e7a695 We don't need to generate DMA complete interrupt for every
transmitted frames. So request interrupt for every 16th frames. Due
to the limitation of hardware we can't suppress the interrupt as
driver should have to check TX status register. The TX status
register can store up to 31 TX status so driver can't send more
than 31 frames without reading TX status register.
With this change controller would not generate TX completion
interrupt for every frame, so reclaim transmitted frames in
ste_tick().
2009-12-23 19:38:22 +00:00
Pyun YongHyeon
95a3c23b51 Correct STE_COUNTDOWN register offset. The datasheet was wrong. 2009-12-23 19:26:38 +00:00
Pyun YongHyeon
13e052e416 Remove unused duplicated register definition. It seems the
definition was made to access STE_ASICCTL register as 16bits but
ste(4) always access the register as 32bits so it was never used
before.
2009-12-23 19:21:37 +00:00
Pyun YongHyeon
8657caa66b Implement hardware MAC statistics counter support. The counters
could be accessed with dev.ste.0.stats sysctl node.
2009-12-23 19:18:07 +00:00
Pyun YongHyeon
bfe051bd2e Report the correct result of mii_mediachg(). Previously it always
used to return success without respect to the result.
While I'm here use mii_mediachg() in ste_init_locked which allows
driver to use currently configured media. ste_ifmedia_upd() is
supposed to be called whenever user changes current media settings.
2009-12-23 18:42:25 +00:00
Pyun YongHyeon
5b7e31187e Don't report link status if driver is not running. 2009-12-23 18:28:47 +00:00
Pyun YongHyeon
931ec15a83 Overhaul RX filter programming.
o Let RX filter handler program promiscuous/multicast filter as
   well as broadcasting.
 o Remove unnecessary register access.
 o Simplify ioctl handler and have set_rxfilter to handle
   IFF_PROMISC and IFF_ALLMULTI change instead of directly
   programming the controller.
 o Removed unnecessary error variable reinitialization in ioctl
   handler.
 o Add IFF_DRV_RUNNING check before programming multicast filter.
 o Configure maximum allowed frame length before enabling MAC.
   Datasheet didn't say the exact ordering of programming sequence
   but it looks more natural to set maximum allowed frame length
   first prior to enabling controller.
2009-12-23 18:24:22 +00:00
Pyun YongHyeon
38c52cfdc1 Reimplement controller reset. Datasheet says full reset takes about
1ms. Since we switched to memory register mapping make sure to
flush PCI posted write by reading the register again.
While I'm here add additional delays in loop while driver waits the
completion of the reset.
2009-12-23 17:54:24 +00:00
Pyun YongHyeon
55d7003e48 Don't reinitialize controller if driver is already running. This
reduces number of link state UP/DOWN changes.
2009-12-23 17:46:11 +00:00
Andrew Thompson
47d54fbb13 Shorten the USB_QUIRK_ENTRY macro and undef it at the end, its only internal. 2009-12-23 01:41:52 +00:00
Andrew Thompson
eb58441685 Move all Mass Storage Quirks over to the USB quirk module.
Submitted by:	Hans Petter Selasky
2009-12-23 01:16:24 +00:00
Andrew Thompson
7b360bcc6c Sync usb vendor/product defines to p4
Submitted by:	HPS
2009-12-23 01:12:54 +00:00
Pyun YongHyeon
81598b3e5e Reimplement Tx status error handler as recommended by datasheet.
If ste(4) encounter TX underrun or excessive collisions the TX MAC
of controller is stalled so driver should wake it up again. TX
underrun requires increasing TX threshold value to minimize
further TX underruns. Previously ste(4) used to reset controller
to recover from TX underrun, excessive collision and reclaiming
error. However datasheet says only TX underrun requires resetting
entire controller. So implement ste_restart_tx() that restarts TX
MAC and do not perform full reset except TX underrun case.
Now ste(4) uses CSR_READ_2 instead of CSR_READ_1 to read
STE_TX_STATUS register. This way ste(4) will also read frame id
value and we can write the same value back to STE_TX_FRAMEID
register instead of overwriting it to 0. The datasheet was wrong
in write back of STE_TX_STATUS so add some comments why we do so.
Also always invoke ste_txeoc() after ste_txeof() in ste_poll as
without reading TX status register can stall TX MAC.
2009-12-22 23:57:10 +00:00
Pyun YongHyeon
ec89b8a856 Prefer bus_write_{1,2,4}/bus_read_{1,2,4} to
bus_space_write_{1,2,4}/bus_space_read_{1,2,4}.
Remove unused ste_bhandle and ste_btag in softc.
2009-12-22 21:44:25 +00:00
Pyun YongHyeon
c0270e602a Prefer memory space register mapping over io space. If memory space
mapping fails fall back to old io space mapping.
While I'm here use PCIR_BAR macro.
2009-12-22 21:39:34 +00:00
Marius Strobl
1bba41a506 Enroll these drivers in multipass probing. The motivation behind this
is that the JBus to EBus bridges share the interrupt controller of a
sibling JBus to PCIe bridge (at least as far as the OFW device tree
is concerned, in reality they are part of the same chip) so we have to
probe and attach the latter first. That happens to be also the case
due to the fact that the JBus to PCIe bridges appear first in the OFW
device tree but it doesn't hurt to ensure the right order.
2009-12-22 21:02:46 +00:00
Pyun YongHyeon
8d9f6dd948 Instead of relying on hard resetting of controller to stop
receiving incoming traffics, try harder to gracefully stop active
DMA cycles and then stop MACs. This is the way what datasheet
recommends and seems to work reliably. Resetting controller while
active DMAs are in progress is bad thing as we can't predict how
DMAs touche allocated TX/RX buffers. This change ensures controller
stop state before attempting to release allocated TX/RX buffers.
Also update MAC statistics which could have been updated during the
wait time of MAC stop.

While I'm here remove unnecessary controller resets in various
location. ste(4) no longer relies on hard controller reset to stop
controller and resetting controller also clears all configured
settings which makes it hard to implement WOL in near future.
Now resetting a controller is performed in ste_init_locked().
2009-12-22 20:57:30 +00:00
Pyun YongHyeon
10f695ee22 Reimplement miibus_statchg method. Don't rely on link state change
interrupt. If we want to use link state change interrupt ste(4)
should also implement auto-negotiation complete handler as well as
various PHY access handling. Now link state change is handled by
mii(4) polling so it will automatically update link state UP/DOWN
events which in turn make ste(4) usable with lagg(4).

r199559 added a private timer to drive watchdog and the timer also
used to drive MAC statistics update. Because the MAC statistics
update is called whenever statistics counter reaches near-full, it
drove watchdog timer too fast such that it caused false watchdog
timeouts under heavy TX traffic conditions.
Fix the regression by separating ste_stats_update() from driving
watchdog timer and introduce a new function ste_tick() that handles
periodic job such as driving watchdog, MAC statistics update and
link state check etc.
While I'm here clear armed watchdog timer in ste_stop().
2009-12-22 20:11:56 +00:00
Alexander Motin
7aab51b33e Add support for Intel SCH PATA controller.
PR:		kern/140251
2009-12-22 19:48:06 +00:00
Pyun YongHyeon
4465097b57 Introduce sc_flags member variable and use it to keep track of
link state and PHY related information.
Remove ste_link and ste_one_phy variable of softc as it's not used
anymore.
While I'm here add IFF_DRV_RUNNING check in ste_start_locked().
2009-12-22 19:32:16 +00:00
Pyun YongHyeon
1bf71544de Add minimal dealy while ste(4) is waiting for the end of active DMA
cycle.
2009-12-22 19:00:18 +00:00
Pyun YongHyeon
a1b2c20925 Add bus_dma(9) and endianness support to ste(4).
o Sorted includes and added missing header files.
 o Added basic endianness support. In theory ste(4) should work on
   any architectures.
 o Remove the use of contigmalloc(9), contigfree(9) and vtophys(9).
 o Added 8 byte alignment limitation of TX/RX descriptor.
 o Added 1 byte alignment requirement for TX/RX buffers.
 o ste(4) controllers does not support DAC. Limit DMA address space
   to be within 32bit address.
 o Added spare DMA map to gracefully recover from DMA map failure.
 o Removed dead code for checking STE_RXSTAT_DMADONE bit. The bit
   was already checked in each iteration of loop so it can't be true.
 o Added second argument count to ste_rxeof(). It is used to limit
   number of iterations done in RX handler. ATM polling is the only
   consumer.
 o Removed ste_rxeoc() which was added to address RX stuck issue
   (cvs rev 1.66). Unlike TX descriptors, ST201 supports chaining
   descriptors to form a ring for RX descriptors. If RX descriptor
   chaining is not supported it's possible for controller to stop
   receiving incoming frames once controller pass the end of RX
   descriptor which in turn requires driver post new RX
   descriptors to receive more frames. For TX descriptors which
   does not support chaning, we exactly do manual chaining in
   driver by concatenating new descriptors to the end of previous
   TX chain.
   Maybe the workaround was borrowed from other drivers that does
   not support RX descriptor chaining, which is not valid for ST201
   controllers. I still have no idea how this address RX stuck
   issue and I can't reproduce the RX stuck issue on DFE-550TX
   controller.
 o Removed hw.ste_rxsyncs sysctl as the workaround was removed.
 o TX/RX side bus_dmamap_load_mbuf_sg(9) support.
 o Reimplemented optimized ste_encap().
 o Simplified TX logic of ste_start_locked().
 o Added comments for TFD/RFD requirements.
 o Increased number of RX descriptors to 128 from 64. 128 gave much
   better performance than 64 under high network loads.
2009-12-22 18:57:07 +00:00
John Baldwin
43d9473499 - Rename the __tcpi_(snd|rcv)_mss fields of the tcp_info structure to remove
the leading underscores since they are now implemented.
- Implement the tcpi_rto and tcpi_last_data_recv fields in the tcp_info
  structure.

Reviewed by:	rwatson
MFC after:	2 weeks
2009-12-22 15:47:40 +00:00
Andrew Gallatin
57e42c95a4 Don't take the driver mutex in mxge_tick(), as it
is run with the mutex held.

Submitted by: rwatson
MFC after:	3 days
2009-12-22 15:41:58 +00:00
Andrew Thompson
46e977391b Add missed usb product define in r200826. 2009-12-22 02:15:36 +00:00
Andrew Thompson
cc92254a07 add new ID to UFTDI driver.
Submitted by:	YAMAMOTO, Shigeru
2009-12-22 02:13:23 +00:00
Andrew Thompson
afbfddd901 - add support for more than 2 audio channels. [1]
- add support for more sample rates

Submitted by:	[1] ariff (earlier version), Hans Petter Selasky
2009-12-22 02:11:37 +00:00
Andrew Thompson
f1ea98c024 Set correct USB device description
Submitted by:	Paul B Mahol
2009-12-22 02:04:16 +00:00
Andrew Thompson
725f67ad7b Add more OHCI pci ids.
Submitted by:	Hans Petter Selasky
2009-12-22 01:59:17 +00:00
Andrew Thompson
bae15f4ab1 Add more EHCI pci ids.
Submitted by:	Hans Petter Selasky
2009-12-22 01:57:34 +00:00
Gavin Atkinson
eb8e36c9f6 Support the tablet in (at least) the Toshiba Portege M200 Tablet PC.
This device only appears on the ACPI bus, so isn't caught by the current
entry for it in the uart(4) ISA attachment.

PR:		kern/140172
Reviewed by:	jhb, marcel
Approved by:	ed (mentor)
MFC after:	2 weeks
2009-12-21 22:57:40 +00:00
Alexander Motin
922706175e Spell AMD properly. 2009-12-21 21:47:33 +00:00
Marius Strobl
75b02cac5a Provide and consume missing module dependency information. 2009-12-21 21:29:16 +00:00
Alexander Motin
45e1aff18a Clear all ports interrupt status bits in single write. Clearing one by one
causes additional MSIs messages sent if several ports asked for attention
same time. Time window before clearing is not important, as these interrupts
are level triggered by interrupt source.
2009-12-21 21:27:56 +00:00
Pyun YongHyeon
084dc54bb3 Sort function prototyes. 2009-12-21 20:42:23 +00:00
Pyun YongHyeon
f2632c3b48 style(9) 2009-12-21 20:18:01 +00:00
Pyun YongHyeon
9c7dcf0e47 Remove trailing white spaces. 2009-12-21 20:02:12 +00:00
Pyun YongHyeon
56af54f28f s/u_intXX_t/uintXX_t/g 2009-12-21 20:00:27 +00:00
Pyun YongHyeon
42306cb0b3 o Remove unnecessary return statement.
o Remove register keyword.
2009-12-21 19:56:11 +00:00
Pyun YongHyeon
60270842b7 Use ANSI function definations. 2009-12-21 19:50:29 +00:00
Robert Noland
66ab1230f1 Fix a handful of issues with via agp support.
* Read the pci capability register to identify AGP 3 support
  * Add missing smaller aperture sizes for AGP3 chips.
  * Fix the aperture size calculation on AGP2 chips.
    All sizes between 32M and 256M reported as 256M.
  * Add \n to error string.

This all seems to get the CLE266 EPIA-M board agp working properly, now
back to work on drm.

MFC after:	2 weeks
2009-12-21 03:28:05 +00:00
Pyun YongHyeon
33a0d70b86 Disable jumbo frame support for PCIe VT6130/VT6132 controllers.
Quite contrary to VT6130 datasheet which says it supports up to 8K
jumbo frame, VT6130 does not seem to send jumbo frame that is
larger than 4K in length. Trying to send a frame that is larger
than 4K cause TX MAC hang.
Even though it's possible to allow 4K jumbo frame for VT6130, I
think it's meaningless to allow 4K jumbo frame. I'm not sure VT6132
also has the same limitation but I guess it uses the same MAC of
VT6130.
2009-12-20 19:45:46 +00:00
Pyun YongHyeon
564340e7cf VT6130 datasheet was wrong. If VT6130 receive a jumbo frame the
controller will split the jumbo frame into multiple RX buffers.
However it seems the hardware always dma the frame to 8 bytes
boundary for the split frames. Only the first part of the fragment
can have 4 byte alignment and subsequent buffers should be 8 bytes
aligned. Change RX buffer the alignment requirement to 8 bytes from
4 bytes.
2009-12-20 19:11:32 +00:00
Pyun YongHyeon
c743849615 Correct fragment bit definition in comments. 2009-12-20 18:53:34 +00:00
Alexander Motin
c357f2c827 Add VIA CX700/VX800 chipsets SATA/PATA support.
PR:		kern/121521
Tested by:	Alex Deiter
2009-12-20 16:23:11 +00:00
Alexander Motin
1905fcfe0a Fairly set master/slave shared PIO/WDMA timings on ITE 821x controllers.
Previous implementation could only limit mode, but not rise it back.
2009-12-20 15:03:57 +00:00
Pyun YongHyeon
12ea9beca9 Swap VGE_TXQTIMER and VGE_RXQTIMER register definition. Pending
timer for Tx queue is at 0x3E.
2009-12-19 20:45:23 +00:00
Pyun YongHyeon
7fc94bc4e0 Add rudimentary WOL support. While I'm here remove enabling
busmastering/memory address in resume path. Bus driver will handle
that.
2009-12-18 22:14:28 +00:00
Pyun YongHyeon
45e564a90b Make sure to enable Next Page bit for IP1001. Otherwise the PHY
fails to re-establishe 1000baseT link after downgrading to
10/100Mbps link.
2009-12-18 21:57:51 +00:00
Jean-Sébastien Pédron
b469a43897 Add new "hw.psm.tap_enabled" tunable and sysctl.
This tunable allows one to enable (1) or disable (0) gestures like tap
and tap-hold on Synaptics TouchPad when the Extended mode isn't enabled
(ie. "hw.psm.synaptics_support" not set).

By default, the value is -1 in order to keep the current behaviour of
not enabling/disabling gestures explicitly.

PR:		kern/139272
Submitted by:	David Horn <dhorn2000 AT gmail DOT com>
Reviewed by:	David Horn <dhorn2000 AT gmail DOT com>
2009-12-18 17:46:57 +00:00
John Baldwin
becf6b3db8 - Add missing newlines to some error messages.
- Add interrupt descriptions when using mulitple MSI-X interrupts.

Reviewed by:	jfv
2009-12-18 16:14:31 +00:00
Joseph Koshy
68c3e04122 Recognize Intel CPUs with Family 0x6, Models 0x1E and 0x1F.
Submitted by:	Marc Unangst <mju at panasas dot com>
2009-12-18 15:01:46 +00:00
Ruslan Ermilov
a46a1e767d - Fixed incorrect watchdog timeout setting: MSB of a 2-byte
value is obtained by dividing it by 256, not by 2550; also,
  one second is 10^9 nanoseconds, not 1800000000 nanoseconds.

- Due to rounding error, setting watchdog to a really small
  timeout (<1 sec) was turning the watchdog off.  It should
  set the watchdog to a small timeout instead.

- Implemented error checking in ipmi_wd_event(), as required
  by watchdog(9).

PR:		kern/130512
Submitted by:	Dmitrij Tejblum

- Additionally, check that the timeout value is within the
  supported range, and if it's too large, act as required by
  watchdog(9).

MFC after:	3 days
2009-12-18 12:10:42 +00:00