Commit Graph

16716 Commits

Author SHA1 Message Date
Jung-uk Kim
4ea603ec6b Make VPD register access more robust:
- Implement timing out of VPD register access.[1]
- Fix an off-by-one error of freeing malloc'd space when checksum is invalid.
- Fix style(9) bugs, i.e., sizeof cannot be followed by space.
- Retire now obsolete 'hw.pci.enable_vpd' tunable.

Submitted by:	cokane (initial revision)[1]
Reviewed by:	marius (intermediate revision)
Silence from:	jhb, jmg, rwatson
Tested by:	cokane, jkim
MFC after:	3 days
2007-11-16 20:49:34 +00:00
Jung-uk Kim
d949071d71 Do not report MAC, TX, and RX stats via sysctl(8) with BCM5705+.
The register layout is little different from memory-mapped stats
in the previous generation chips.  In fact, it is bad because
registers in this range are cleared after reading them.

Reviewed by:	scottl
MFC after:	3 days
2007-11-16 16:39:27 +00:00
Sam Leffler
cbb1d39de7 use the private task q thread instead of the shared system thread
Reviewed by:	yongari
MFC after:	1 week
2007-11-16 15:51:47 +00:00
Tai-hwa Liang
6404b10238 MFP4(128855, 129015):
- Trying to eliminate another racing by replacing the timeout(9) with
  callout APIs.  In addition to that, the callout_drain() in an_detach()
  help us to avoid a possible panic-on-free due to the callout API tries
  to lock a destroyed mutex.
- In an_stats_update(), check the return value of an_read_record(). This
  should reduce the chance of device removal(PCCARD) panic [2].
- Adding a comment to state the fact that an_stats_update() is now called
  via callout(9) with a lock held [2].

Submitted by:	jhb [1], ambrisko [2]
Reviewed by:	jhb, ambrisko
Reported by:	dhw
Tested by:	dhw
MFC after:	3 days
2007-11-16 11:22:18 +00:00
Pyun YongHyeon
5f36bdfcc2 Reset autonegotation timer if media option is not IFM_AUTO.
Make mii_ticks advance, autonegiation is retried every
mii_anegticks seconds.
2007-11-16 10:39:18 +00:00
Pyun YongHyeon
55da31830a Read MII_ANAR register and get common denominator ability.
PR:	92599
2007-11-16 10:32:10 +00:00
Pyun YongHyeon
d612cc5947 IEEE 802.3 Annex 28B.3 explicitly specifies the following relative
priorities of the technologies supported by 802.3 Selector Field
value.

1000BASE-T full duplex
1000BASE-T
100BASE-T2 full duplex
100BASE-TX full duplex
100BASE-T2
100BASE-T4
100BASE-TX
10BASE-T full duplex
10BAST-T

However PHY drivers didn't honor the order such that 100BASE-T4 had
higher priority than 100BASE-TX full duplex. Fix that long standing
bugs such that have PHY drivers choose the highest common denominator
ability.
Fix a bug in dcphy which inadvertently aceepts 100BASE-T4.

PR:	92599
2007-11-16 10:25:36 +00:00
Jack F Vogel
b8b1729d3c Add PCI device support for Intel S7000FC4UR in usb and ichwd, systems
will not install without the usb changes in the install kernel, so I
would like to MFC this in time for 7.0 RC

MFC: 3 days
2007-11-15 23:59:36 +00:00
Rink Springer
c7fca64fe1 Remove the IEEE80211_C_WEP capability flag - setting it makes net80211 expect
that the driver will handle WEP encryption. However, this does not seem to be
implemented by this driver (or maybe the chipset doesn't support it?)

Removing the flag makes my wpi card work using wpa_supplicant(8) on a
network with 802.1x security (without this change it authenticated fine, but
tcpdump only saw garbage packets)

Reviewed by:	benjsc, imp (mentor)
Approved by:	imp (mentor), sam
2007-11-13 16:12:59 +00:00
John Baldwin
dbac8ff400 Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version was
bumped to 800004 to note the change though userland apps should not be
affected since they use <sys/agpio.h> rather than the headers in
sys/dev/agp.

Discussed with:	anholt
Repocopy by:	simon
2007-11-12 21:51:38 +00:00
Remko Lodder
3b9982e59c Add support for D-Link DGE-528(T) Rev.B1
PR:		112774
Submitted by:	Denis Fortin <fortin at acm dot org>
Approved by:	imp (mentor), yongari
MFC After:	3 days
2007-11-12 15:44:00 +00:00
Henrik Brix Andersen
419f6676c3 Update quirks for the MetaGeek Wi-Spy 1A, 1B and 2.4x.
PR:		usb/116057
Approved by:	imp, erwin (mentor)
2007-11-11 20:57:08 +00:00
Scott Long
bbb28fad82 The ESP driver isn't really MPSAFE, so don't mark it that it is. 2007-11-11 14:45:35 +00:00
Sam Leffler
b0db4c9328 Add private tx/rx buffer management to support large frame sizes
and update the rx code to handle multiple frames in a single usb
transfer.  AX772 parts (at least) exhibit many input errors when
operated with a 2K rx buffer and no errors w/ a 4K rx buffer (it's
unclear what the cause of the errors is for 2K so this may just be
covering up the real issue).  Larger rx buffer sizes show no
significant performance improvement for AX772.  Bypassing the common
buffer management routines also eliminates an extra context switch
on every packet which noticeably improves performance (TCP netperf
rx goes from 45 Mb/s to 85 MB/s).

Submitted by:	"J.R. Oldroyd" <fbsd@opal.com>
Reviewed by:	imp
Obtained from:	openbsd (partly)
MFC after:	3 weeks
2007-11-10 16:23:38 +00:00
Ariff Abdullah
8b18769048 Limit total playback channels to just 1, for ALi M5451.
The reliability of it's multi DAC / playback channels is
not that good. Enabling vchans make the bug more visible
since playback allocation will look for possible free
hardware channels first (i.e: the next DAC, the very first
has been consumed by vchan mixer) which in this case has
been proven faulty.

Reported / Tested by:	Sascha Klauder
MFC after:		3 days
2007-11-10 04:32:50 +00:00
Benjamin Close
607b0aec7c Turn off debug output, its been confusing users.
Approved by: mlaier (comentor)
2007-11-08 21:57:08 +00:00
Nate Lawson
69d3f89624 Whitespace only. 2007-11-08 21:20:34 +00:00
Ariff Abdullah
20005f72d1 - Remove magic number and fit max rx buffer size accurately.
- Patch registers CR47 and CR157 on devices that require it.
- Fix power calibration setting on ZD1211B.

Obtained from:	OpenBSD

- Fix multicast transfer by properly reprogram multicast global
  hash table, which in turns fix promiscuous mode and IPv6
  autoconfiguration / local networking.

Reviewed by:	sam, Weongyo Jeong
Tested using:	Aztech WL230 , Belkin F5D7050, Unicorn WL-54G,
             	3COM 3CRUSB10075
MFC after:	1 week
2007-11-08 08:25:58 +00:00
Maxim Sobolev
a03be42da6 Put back devstat support that was lost during GEOM transition. Initially,
I've tried to move md(4) to use geom_disk class, like real disks do, but
this requires major rework of some of the existing features such as
configuration dumping for example. Therefore just putting devstat support
directly into md(4) seems to be optimal solution.

Now you can see md(4) stats in `systat -vm' again.

MFC after:	2 weeks
2007-11-07 22:47:41 +00:00
Rui Paulo
32a8088fef Driver for the Apple System Management Console (SMC). This hardware is
present on the MacBook, MacBook Pro, and Intel MacMini.

This driver exports information via sysctl in its private sysctl tree
dev.asmc.*. You can get information about temperatures, fan speeds, the
keyboard light sensor and the Sudden Motion Sensor (SMS).
The SMS is very useful to park the disk heads when the laptop is
moved. Basically, the SMS is setup so that, under movement, we get an
interrupt on irq 6 and a devd notification is sent.

Sponsored by:	 Google Summer of Code 2007
Approved by:	 njl (mentor)
Reviewed by:	 attilio (previous version, but very similar), jhb (interrupt
	 	 specific review)
2007-11-07 20:05:13 +00:00
Kevin Lo
02f0a39fed Check wep flag in *_tx_mgt since we need to encrypt some management frame
in case of shared authentification.

Obtained from: NetBSD
2007-11-06 07:30:12 +00:00
Pyun YongHyeon
144e07f0e7 Apparently some NVIDIA NICs store ethernet address in reverse order
while other variants have inorder ethernet address for the same
chipset. Override ethernet address ordering if we already know how
it was stored. This fixes the use of inversed ethernet address on
MCP67.

Submitted by:	ariff
MFC after:	3 days
2007-11-06 01:01:38 +00:00
Alexander Kabaev
907aa90518 Do not pass an address to local stack variable to usbd_set_report_async.
Allocate space in keyboard state structure instead to prevent random byte
from possibly overwritten stack location frombeing shoved into USB device
when transfer actually takes place.

This fixes at least one instance of LEDs not working with USB keyboards.
2007-11-05 19:51:12 +00:00
Mitsuru IWASAKI
54d02e0aa7 Fix NOP message sending in ciss_periodic() which causes panic with
option INVARIANTS.

Reviewed by:	simokawa
Tested by:	noriyosi_kawano
MFC after:	1 week
2007-11-05 13:54:23 +00:00
Benjamin Close
6607310b74 Initial Import of wpi driver based on p4 changeset 128641.
This import includes:
   o wpi Wireless driver for the Intel 3945 Wireless Lan Controller (802.11abg) (sys/dev/wpi)
   o Intel firmware revision 2.14.4 & associated LICENSE (sys/dev/contrib/wpi, sys/contrib/dev/wpi/LICENSE)
   o wpifw Firmware driver (sys/modules/wpifw)

Approved by: mlaier, sam (co-mentors)
2007-11-05 11:47:19 +00:00
Scott Long
762d6411cf Add missing locking for SBus controllers. 2007-11-05 11:22:18 +00:00
Ariff Abdullah
ee2b7497ea Add support for trimmed down version of ATI SB600 AC97 audio
controller.

URL:		http://www.ipc2u.de/catalog/P/PE/36486.html
PR:		kern/117813
Submitted by:	Klaus Mayr
MFC after:	1 day
2007-11-04 16:03:10 +00:00
Sam Leffler
96492b1b20 upgrade zd1211b firmware for the zyd driver. This solves a hardware
reset problem when we reboot the system with the zyd device inserted.

Submitted by:	Weongyo Jeong
Reported by:	Ted Lindgreen (ted@tednet.nl)
MFC after:	1 week
2007-11-03 19:24:51 +00:00
Sam Leffler
38cb62eb95 fix a typo in rx radiotap's flags
Submitted by:	Weongyo Jeong
Reviewed by:	sam
MFC after:	3 days
2007-11-03 19:22:54 +00:00
Sam Leffler
d8e40e35ce correct entry 2007-11-03 19:11:35 +00:00
Sam Leffler
88bba87429 bandaid crash as I have no time to research the issue and the driver
is unusable in its present state; refer to the PR for details

PR:		kern/110662
MFC after:	3 days
2007-11-03 19:10:14 +00:00
Scott Long
fee67c1a14 Ever since the module registration system was introduced to this driver,
it's been printing out scary messages about "Unhanded Event Notify Frame"
that are needlessly worrisome to users.  Change this warning to only print
out at an elevated debugging level.
2007-11-03 17:33:41 +00:00
Nate Lawson
cc3c11f9c9 Fix a shutdown hang on some SMP systems. The previous logic was to IPI all
CPUs to make sure idle threads are evicted from the softc before returning
from acpi_cpu_shutdown().  However, this is unnecessary since stop_cpus()
handles this for itself and at this point it's possible that our IPI will be
blocked (interrupts disabled).

Thanks to:	Glen Leeder <glen.leeder / nokia.com>
MFC after:	3 days
2007-11-02 17:29:36 +00:00
Ed Maste
eb5cbaa020 Rework aac locking for MPSAFE CAM. This fixes a Giant mutex assertion
reported on freebsd-current [1].

Also dequeue all events in aac_release_command (instead of just one)
so that there's no risk of them getting stranded.

Reported by:    Steven Brown [1]
Submitted by:   scottl@

[1] http://lists.freebsd.org/pipermail/freebsd-current/2007-October/077928.html
2007-11-01 20:45:29 +00:00
John Baldwin
f82a1d4987 Split agp_generic_detach() up into two routines: agp_free_cdev() destroys
/dev/agpgart and agp_free_res() frees resources like the BAR for the
aperture.  Splitting this up lets chipset-specific detach routines
manipulate the aperture during their detach routines without panicing.

MFC after:	1 week
Reviewed by:	anholt
2007-10-30 22:09:16 +00:00
Pyun YongHyeon
fa99a6317c Setting sc->mii_anegticks to MII_ANEGTICKS_GIGE in rgephy_attach()
is redundant. mii_phy_add_media() already takes care of that.

Pointed out by:	marius
2007-10-30 00:37:35 +00:00
Marius Strobl
2a6a6e5ca7 - Remove MIIF_NOISOLATE; there's generally no reason to let gentbi(4)
set this flag and it was more or less just copied and pasted from
  another FreeBSD driver while porting this driver from NetBSD, whose
  gentbi(4) doesn't set MIIF_NOISOLATE either.
- Fix spelling in a comment.

OK'ed by:	yongari
MFC after:	3 months
2007-10-29 21:11:55 +00:00
Robert Watson
3be4cb0b4a Merge Neterion if_nxge driver version 2.0.9.11230 with the following
changes:

  01 -  Enhanced LRO:
  LRO feature is extended to support multi-buffer mode. Previously,
  Ethernet frames received in contiguous buffers were offloaded.
  Now, frames received in multiple non-contiguous buffers can be
  offloaded, as well. The driver now supports LRO for jumbo frames.

  02 - Locks Optimization:
  The driver code was re-organized to limit the use of locks.
  Moreover, lock contention was reduced by replacing wait locks
  with try locks.

  03 - Code Optimization:
  The driver code was re-factored  to eliminate some memcpy
  operations.  Fast path loops were optimized.

  04 - Tag Creations:
  Physical Buffer Tags are now optimized based upon frame size.
  For better performance, Physical Memory Maps are now re-used.

  05 - Configuration:
  Features such as TSO, LRO, and Interrupt Mode can be configured
  either at load or at run time. Rx buffer mode (mode 1 or mode 2)
  can be configured at load time through kenv.

  06 - Driver Statistics:
  Run time statistics are enhanced to provide better visibility
  into the driver performance.

  07 - Bug Fixes:
  The driver contains fixes for the problems discovered and
  reported since last submission.

  08 - MSI support:
  Added Message Signaled Interrupt feature which currently uses 1
  message.

  09  Removed feature:
  Rx 3 buffer mode feature has been removed. Driver now supports 1,
  2 and 5 buffer modes of which 2 and 5 buffer modes can be used
  for header separation.

  10  Compiler warning:
  Fixed compiler warning when compiled for 32 bit system.

  11 Copyright notice:
  Source files are updated with the proper copyright notice.

MFC after:	3 days
Submitted by:	Alicia Pena <Alicia dot Pena at neterion dot com>,
		Muhammad Shafiq <Muhammad dot Shafiq at neterion dot com>
2007-10-29 14:19:32 +00:00
Pyun YongHyeon
6fd47025e1 Add 88E1116/88E1116R PHY support code that takes the PHY out of
power-down mode.

PR:	kern/114086
MFC after:	3 days
2007-10-29 05:50:22 +00:00
Pyun YongHyeon
0bc6ff67a0 Add a newer RTL8211B(L) PHY. 2007-10-29 02:17:44 +00:00
Pyun YongHyeon
648bfbe6a7 Add support for RealTek RTL8211B(L) PHY. It's based on the patch
made by Michael Eisele and the patch was slightly modified by me.
With this change several NVIDIA ethernet controllers(e.g. MCP61)
works.

RTL8211B(L) is RealTek's new gigabit PHY. The PHY has several
features including crossover correction, polarity correction as
well as supporting triple speed(10/100/1000bps). Data transfer
between MAC and PHY is via RGMII for 1000baseT, MII for
10baseT/100baseTX.
Unfortunately, RealTek used the same model number for RTL8211B(L)
PHY so there is no way to discriminate between RTL8211B(L) and its
predecessors. ATM RTL8211B uses revision number 2 so checking the
revision number seems to be only way to identify it.

Obtained from:	Michael Eisele [1]
Tested by:	clemens fischer < ino-qc AT spotteswoode DOT de DOT eu DOT org >
2007-10-29 02:17:07 +00:00
Pyun YongHyeon
37fd5f0fed o RTL8169S/8110S integrated PHY and RTL8211B are gigabit PHYs so set
mii_anegticks to MII_ANEGTICKS_GIGE and use it. Previously it used
  to MII_ANEGTICKS which may not be enough to wait before retrying
  autonegotiation process at 1000bps.
o Reset autonegotation timer if media option is not IFM_AUTO or we
  got a valid link.
o Announce link loss right after it happends.
o Autonegiation is retried every mii_anegticks seconds.
o Report link state changes right after setting autonegotiation.
2007-10-29 02:06:15 +00:00
John Baldwin
e71f249b66 Don't return an error from resume() if execution of _DIS fails for some
reason (not all BIOSen have _DIS methods for all link devices for example).
This matches the behavior of attach() with respect to _DIS as well.

Submitted by:	njl
2007-10-27 22:14:17 +00:00
John Baldwin
3052da8bb3 Don't destroy an ACPI device_t for a PCI device and reassign the ACPI
handle to the PCI device_t if the ACPI device_t is already attached to a
driver.  This happens on the Tablet TC1000 which for some reason includes
two PCI-ISA bridges and treats the second bridge as an ACPI system resource
device.

Reviewed by:	njl (a while ago)
MFC after:	3 days
2007-10-27 14:54:43 +00:00
John Baldwin
2445af1a8a Don't always re-route IRQs on resume. If this link hasn't been used, then
disable it with _DIS rather than assigning it an IRQ on resume.

MFC after:	1 week
2007-10-27 13:12:29 +00:00
Ariff Abdullah
554314911c Remap and virtualize mixer controls for HP nx6110 with
AD1981B AC97 codec, unifying master volume control.

  * Remap "phout" --> SOUND_MIXER_VOLUME (internal speakers)
  * Virtual "vol" --> { "phout", "ogain" (headphone) }

Tested by:	Frederic Chardon
MFC after:	3 days
2007-10-26 20:49:59 +00:00
Ariff Abdullah
f29120c085 Enable headphone jack-sense for HP nx6100 with AD1981B AC'97 codec,
automuting internal speakers.

Tested by:	Frederic Chardon
MFC after:	3 days
2007-10-26 20:49:23 +00:00
Søren Schmidt
53a8035b0f Fix the signature matching code on AHCI controllers.
Add SATA ATAPI support for AHCI controllers.
2007-10-26 09:01:06 +00:00
Søren Schmidt
13a0de8755 Update the way we get the mode pages on probe. 2007-10-26 08:59:23 +00:00
Søren Schmidt
f31e86f556 Fix treating some modern chips (mem mapped) as legacy devices. 2007-10-26 08:57:08 +00:00