Commit Graph

16553 Commits

Author SHA1 Message Date
Scott Long
5878cbeccf Make the driver fully MPSAFE. This fixes some serious locking problems
that could cause panics and corruption under moderate load.  Many thanks
to Matt Reimer, Tom McDonald, and the rest of the guys at VPOP.net for
their help in identifying and testing this.

Approved by: re
2007-07-31 20:16:50 +00:00
Scott Long
9ab0fe8075 Fix locking mistakes in the error recovery paths of the AHC and AHD drivers.
Approved by: re
2007-07-31 20:11:03 +00:00
David Christensen
990a2aa530 - Fixed a problem that would cause kernel panics and "bce0: discard frame .."
errors (especially when jumbo frames are enabled or in low memory systems)
  because the RX chain was corrupted when an mbuf was mapped to an unexpected
  number of buffers.
- Fixed a problem that would cause kernel panics when an excessively
  fragmented TX mbuf couldn't be defragmented and was released by
  bce_tx_encap().

Approved by:	re(hrs)
MFC after:	7 days
2007-07-31 00:06:04 +00:00
Nate Lawson
430eaa744e Dynamically choose the quality of the ACPI timer depending on whether
the fast or safe/slow method is in use.  Fast remains at 1000, slow is
now at 850 (always preferred to TSC).  Since the HPET has proven slower
than ACPI-fast on some systems, drop its quality to 900.  In the future,
it is hoped that HPET performance will improve as it is the main
timer Intel supports.  HPET may move back to 2000 in -current once RELENG_7
is branched to ensure that it gets tested.

Approved by:	re
2007-07-30 15:21:26 +00:00
Warner Losh
1dfb823e11 Add missing newline in printf.
Submitted by:  "R.Mahmatkhanov" cvs-src at yandex ru
Approved by: re (blanket)
2007-07-29 18:16:43 +00:00
Marcel Moolenaar
7f67bed625 In pci_alloc_map(), restore the original value of the BAR for
the duration of the function.  The device we would otherwise
have left in an useless state may just as well be the low-level
console. When booting verbose, we do need it addressable if we
want to avoid a MCA.

Approved by: re (kensmith)
2007-07-29 02:44:41 +00:00
Olivier Houchard
a9b444d065 Use coherent mapping for DMA on arm. This is propably suitable for the
other archs, but I can't test it so I made it conditionnal on __arm__
for now.

Approved by:	re (blanket)
2007-07-27 14:48:05 +00:00
Takanori Watanabe
32ee7eee09 Minor Bug fix that will cause panic with some terminal with voice path on USB.
Approved by: re@ (kensmith)
2007-07-27 12:00:29 +00:00
Robert Watson
33d2bb9ca3 First in a series of changes to remove the now-unused Giant compatibility
framework for non-MPSAFE network protocols:

- Remove debug_mpsafenet variable, sysctl, and tunable.
- Remove NET_NEEDS_GIANT() and associate SYSINITSs used by it to force
  debug.mpsafenet=0 if non-MPSAFE protocols are compiled into the kernel.
- Remove logic to automatically flag interrupt handlers as non-MPSAFE if
  debug.mpsafenet is set for an INTR_TYPE_NET handler.
- Remove logic to automatically flag netisr handlers as non-MPSAFE if
  debug.mpsafenet is set.
- Remove references in a few subsystems, including NFS and Cronyx drivers,
  which keyed off debug_mpsafenet to determine various aspects of their own
  locking behavior.
- Convert NET_LOCK_GIANT(), NET_UNLOCK_GIANT(), and NET_ASSERT_GIANT into
  no-op's, as their entire behavior was determined by the value in
  debug_mpsafenet.
- Alias NET_CALLOUT_MPSAFE to CALLOUT_MPSAFE.

Many remaining references to NET_.*_GIANT() and NET_CALLOUT_MPSAFE are still
present in subsystems, and will be removed in followup commits.

Reviewed by:	bz, jhb
Approved by:	re (kensmith)
2007-07-27 11:59:57 +00:00
Pyun YongHyeon
4693e424a7 style(9)
Pointed out by:	cnst
Approved by:	re (kensmith)
2007-07-27 00:43:12 +00:00
Andrew Thompson
c4dd9fb67a Fix up ndis interaction with net80211
- make NDIS_DEBUG a sysctl
 - default to IEEE80211_MODE_11B if the card doesnt tell us the channels
 - dont mess with ic_des_chan when we assosciate
 - Allow a directed scan by setting the ESSID before scanning (verified
   with wireshark). Hidden APs probably wouldnt have worked before.
 - Grab the channel type and use it to look up the correct curchan for
   the scan results (mistakenly used 11B before)
 - Fix memory leak in the ndis_scan_results

Tested by:	matteo
Reviewed by:	sam
Approved by:	re (rwatson)
2007-07-26 20:11:16 +00:00
Warner Losh
6dc2dedb7a Start to converge on standard ways of saying some things like
Ethernet and Adapter.

Obtained from: NetBSD (kinda)
Approved by: re (blanket)
2007-07-25 07:11:08 +00:00
Warner Losh
3b62e837c9 Fix absolutely maddening autorepeat bug that would cause the last key
to repeat if you had more than two keys down at any given time (which
happened to me all the time with emacs).

This is taken from PR 110681, although what URATAN Shigenobu describes
there is different than the pathology that I have been seeing.  I'm
seeing this only in X, while he sees it on his console, yet I think
the two problems are related.  I've also reworked the patch slightly
to conform to the coding standards of adjacent code.

It is unclear to me if this merely masks the maddening bug that I have
seen, or if this is a real fix.  I typically see the problem when I'm
typing fast in emacs and using lots of motion keys (meta and control).
In either case, my workstation at work again is finally useful with
this patch.

PR:		110681
Submitted by:	URATAN Shigenobu
Approved by: 	re (blanket)
2007-07-25 06:48:33 +00:00
Warner Losh
8a639d8fb6 ums(4) does not work if the mouse defaults to boot protocol. Force
the protocol to be report on each open, but ignore any errors as set
protocol for mice that don't implement the boot protocol can generate
an error.  Evidentally, the Gyration GyroPoint RF Technology Receiver
(Gyration Ultra Cordless) device has this problem.

Submitted by: Eugene M. Kim
PR: 106565
Approved by: re (blanket)
2007-07-25 06:43:06 +00:00
Scott Long
c5933b2086 Introduce Danny Braniss' iSCSI initiator, version 2.0.99. Please read the
included man pages on how to use it.  This code is still somewhat experimental
but has been successfully tested on a number of targets.  Many thanks to
Danny for contributing this.

Approved by: re
2007-07-24 15:35:02 +00:00
Warner Losh
0e0e91989d Add support for ShanTou ST268 usb nic. This is from a patch for NetBSD
the PR pointed to.  This appears to have been written by Julian Suschlik.

Submitted by: Kuan-Chung Chiu
Obtained from: http://www.nabble.com/Patch-for-udav(4)-t4070804.html
PR: 114860
Approved by: re@ (blanket)
2007-07-24 14:44:23 +00:00
Pyun YongHyeon
5774c5ff93 Add MSI support.
Ever since switching to adaptive polling re(4) occasionally spews
watchdog timeouts on systems with MSI capability. This change is
minimal one for supporting MSI and re(4) also needs MSIX support
for RTL8111C in future. Because softc structure of re(4) is shared
with rl(4), rl(4) was touched to use the modified softc.

Reported by:	cnst
Tested by:	cnst
Approved by:	re (kensmith)
2007-07-24 01:24:03 +00:00
Pyun YongHyeon
8b590ad2d1 Don't fail on device attach if jumbo frame support was unsuccessful.
Because nfe(4) hardware doesn't support SG on Rx path, supporting
jumbo frame requires very large contiguous kernel memory(i.e. several
mega bytes). In case of lack of contiguous kernel memory that
allocation request may always fail. However nfe(4) can operate on normal
sized MTU frames, so go ahead and just disable jumbo frame support.
While I'm here add a new tunable "hw.nfe.jumbo_disable" to disable
jumbo frame support.
In nfe_poll, make sure to invoke correct Rx handler.

Approved by:	re (kensmith)
2007-07-24 01:11:00 +00:00
Nate Lawson
9bbad5af65 The HPET appears to be broken on silby's Acer Pentium M system, never
advancing.  Read from the timer before attaching to be sure it advances
in 1 us.  Since the slowest rate allowed by the spec is 10 MHz, the
timer is guaranteed to change in this interval if it is working.

Tested by:	Rui Paulo
Approved by:	re
MFC after:	3 days
2007-07-22 20:45:27 +00:00
Warner Losh
944f82cd4f Change new Wi-Spy device name to Wi-Spy 2.4x.
Submitted by: Brix Andersen
Approved by: re@ (blanket)
PR: 114807
2007-07-22 18:29:18 +00:00
Warner Losh
9fb43cb678 WISPY added an X.
Approved by: re
2007-07-22 15:59:45 +00:00
Kevin Lo
36ffd4ba6d Use bus_get_dma_tag() to obtain the parent DMA tag.
Reviewed by: sam, sephe, thompsa
Approved by: re (kensmith)
2007-07-22 06:44:10 +00:00
Warner Losh
7e23029ae6 Add some additional devices.
Submitted by: HPS hselasky at c2i dot net
Approved by: re (blanket)
2007-07-22 03:45:35 +00:00
Stefan Eßer
d2a748e232 Fix Symbios driver on amd64: Since amd64 has 64 bit pointers but the same
4KB pages as i386, data structures that just fit in one page on i386 (and
on 64 bit architectures with 8KB pages) can be distributed over two pages
on amd64. This is a porblem in the case of the Symbios driver, since the
SCRIPTS engine in the SCSI chip operates on physical addresses and needs
physically contiguous memory. Earlier patches used contigmalloc on amd64,
but this version replaces part of a structure by a pointer to that data.
In order to not introduce an extra indirection for other architectures,
the change has been made conditional on __amd64__.

Earlier attempts to repair this problem are removed (i.e. the macros that
made amd64 use contigmalloc). The fix was submitted by Jan Mikkelsen and
modified by me to only affect amd64.

PR:		89550
Submitted by:	janm at transactionware dot com (Jan Mikkelsen)
Approved by:	re (Hiroki Sato)
MFC after:	2 weeks
2007-07-20 23:02:01 +00:00
Hidetoshi Shimokawa
b0f99fbdbc Protect transaction labels by its own lock to reduce lock contention.
Approved by: re (rwatson)
2007-07-20 03:42:57 +00:00
Pyun YongHyeon
53dcfbd18b Add legacy interrupt handler which would be more appropriate for
interrupt that is shared with other devices(e.g. USB) in system and
provide a new tunable "hw.msk.legacy_intr" to activate the legacy
interrupt handler. Setting the tunable automatically disables MSI
for msk(4). Previously msk(4) used adoptive polling with taskqueue(9)
as all msk(4) hardwares I know supports MSI. However, there are cases
that MSI couldn't be used on some hardwares due to bugs in MSI
implementatins.

Tested by:	Li-Lun Wang < llwang AT infor DOT org >
Approved by:	re (kensmith)
2007-07-20 00:25:20 +00:00
Andrew Gallatin
f9ae02802f - Enable static building of mxge(4) and its firmware.
- Add custom .c wrappers for the firmware, rather than the standard
  firmware(9) generated firmware objects to work around toolchain
  problems on ia64 involving linking objects produced by
  ld -b -binary into the kernel.

- Move from using Myricom's ".dat" firmware blobs to using Myricom's
  zlib compressed ".h" firmware header files.  This is done to
  facilitate the custom wrappers, and saves a fair amount of wired
  memory in the case where the firmware is built in, or preloaded.

- Fix two compile issues in mxge which only appear on non-i386/amd64.

Reviewed by: mlaier, mav (earlier version with just zlib support)
Glanced at by: sam
Approved by: re (kensmith)
2007-07-19 16:16:00 +00:00
Sepherosa Ziehau
733ab6b6c8 Correct RSSI calculation.
Noticed by: Hans Petter Selasky <hselasky@c2i.net>
Approved by: re (kensmith), sam (mentor)
2007-07-17 11:27:57 +00:00
Kip Macy
ac3a6d9cef - integrate most recent changes from vendor branch and upgrade to firmware revision 4.5.5
- add filter support
	- further improvements for T304
- recover gracefully from spurious immediate packets

Approved by: re(blanket)
Supported by: Chelsio
MFC after: 3 days
2007-07-17 06:50:35 +00:00
Kip Macy
8870f0e16b - Increase descriptors per call to start
- enqueue per-txq task
- fix per-txq task initialization

Approved by: re (blanket)
2007-07-17 06:12:22 +00:00
Doug Ambrisko
72d7331539 Add support to the ipmi, isa attachment to attempt to read ipmi
config info. from device.hints.  Some machines have ipmi controllers
that do not have attachment info in either PCI, SMBIOS or ACPI.
This idea was hacked together by me and then done properly by
jhb.

Submitted by:	jhb
Reviewed by:	jhb (man page)
Approved by:	re (Ken Smith)
MFC after:	1 week
2007-07-16 17:03:48 +00:00
Hidetoshi Shimokawa
f0441453c1 Improve acquisition of transaction labels.
- Keep last transaction label for each destination.
- If the next label is not free, just give up.
- This should reduce CPU load for TX on if_fwip under heavy load.

Approved by: re (hrs)
2007-07-15 13:00:29 +00:00
Eric Anholt
d450e052dc Add support for G965/Q965/GM965/GME965/GME945 AGP.
This adds a function to agp.c to set the aperture resource ID if it's
not the usual AGP_APBASE.  Previously, agp.c had been assuming
AGP_APBASE, which resulted in incorrect agp_info, and contortions by
agp_i810.c to work around it.

This also adds functions to agp.c for default AGP_GET_APERTURE() and
AGP_SET_APERTURE(), which return the aperture resource size and disallow
aperture size changes.  Moving to these for our AGP drivers will likely
result in stability improvements.  This should fix 855-class aperture
size detection.

Additionally, refuse to attach agp_i810 when some RAM is above 4GB and
the GART can't reference memory that high.  This should be very rare.
The correct solution would be bus_dma conversion for agp, which is
beyond the scope of this change.  Other AGP drivers could likely use
this change as well.

G33/Q35/Q33 AGP support is also included, but disconnected by default
due to lack of testing.

PR:             kern/109724 (855 aperture issue)
Submitted by:   FUJIMOTO Kou<fujimoto@j.dendai.ac.jp>
Approved by:	re (hrs)
2007-07-13 16:28:12 +00:00
Jack F Vogel
d2a744ffea A couple late breaking bugs that testing have turned up.
- change include style so build in kernel try OR standalone work.
	- Limit HWCSUM - I was led to believe that it would work with RSS,
	  but our testing had odd issues which suggests this is false.
	- A fatfinger error in the ioctl code made ifconfig up not work.

Approved by: re
2007-07-12 19:04:11 +00:00
Andrew Gallatin
eb8e82f5fd Update the mxge(4) driver's copyright to 2007, and drop
the binary distribution clause.

Approved by: re (bmah)
2007-07-12 16:04:55 +00:00
Robert Watson
07cb08fd48 Directly initialize nxge's ifaddrp pointer to ifnetp->if_addr rather
than indirecting through ifaddr_byindex, which makes things easier with
respect to virtualized network stacks.

Submitted by:	Marko Zec <zec at icir dot org>
Reviewed by:	Leonid Grossman <Leonid dot Grossman at neterion dot com>
Approved by:	re (kensmith)
2007-07-12 10:03:29 +00:00
Konstantin Belousov
73f37bf31a bus_dma_tag_create() and bus_dma_mem_alloc() shall not be called with a
non-sleepable lock held. drm_pci_alloc() calls them, thus drm mutex shall
not be held during the call.

Move the drm_pci_alloc() to the start of the i915_initialize() and drop the
the drm mutex around it.

Reported by:	Ganbold <ganbold micom mng net>
Reviewed by:	anholt
Approved by:	re (hrs)
MFC after:	1 week
2007-07-12 09:02:31 +00:00
Andrew Thompson
cddce0cb90 Improve the net80211 handling within ndis
- use net80211 for scanning and pass the results back to the scan cache
 - use ieee80211_init_channels to fill our channel list
 - fix up state transitions
 - depreciate the old wicontrol ioctls
 - add some debugging lines (#define NDIS_DEBUG)

Reviewed by:	sam
Approved by:	re (kensmith)
2007-07-12 02:54:05 +00:00
Jack F Vogel
13705f88fa Add the actual source too :)
Approved by:	re
2007-07-11 23:03:16 +00:00
Matt Jacob
06b642b55d Remove the internal use of __packed and put it on the structures
themselves.

Reviewed by:	nate, peter, warner, robert
Approved by:	re (ken)
2007-07-11 22:34:34 +00:00
Andrew Thompson
9baf942d49 Now that wicontrol has been removed from the base system the corresponding
ioctls can be removed. These have been #ifdef'd out and left as a reference in
case any of the RIDs need to be turned into sysctls at a later date.

Reviewed by:	sam, avatar
Approved by:	re (kensmith)
2007-07-11 21:25:48 +00:00
Maksim Yevmenkin
190fa66b39 Fix kbdmux(4) issue with backslash/underscore key not working on
Japanese 106/109 keyboard.

PR:		kern/112214, kern/99090
Submitted by:	TOMITA Yoshinori, TAKAHASHI Yoshihiro
Approved by:	re (hrs)
MFC after:	3 days
2007-07-11 18:57:15 +00:00
Ariff Abdullah
05cba74005 Protect against divide by zero while calculating bus speed due to
possible broken kernel timecounter.

Reported/Tested by:	silby
Approved by:		re (hrs)
MFC after:		1 day
2007-07-11 14:27:45 +00:00
Warner Losh
5b26652b0c Add Micro Research PCMCIA LAN Adapter MR10TPC support. Patch slightly
reworked by me.

Submitted by: Osamu Hasegawa-san
PR: 93393
Approved by: re (hrs)
2007-07-11 04:14:41 +00:00
Warner Losh
36fef1500d Add additional product id and quirks entry for MetaGeek Wi-Spy
Submitted by: Robert Noland
PR: 114481
Approved by: re@ (blanket)
2007-07-10 21:00:10 +00:00
Matt Jacob
2e4637cd75 Get rid of a couple of Coverity found sign comparison errors.
Approved by:	re (Ken)
MFC after:	3 days
2007-07-10 07:55:59 +00:00
Matt Jacob
bb4f528dd8 Be more conservative- turn off fast posting and RIO for 22XX cards.
Approved by:	re (ken)
MFC after:	3 days
2007-07-10 07:55:04 +00:00
Kip Macy
b8fe6051bf MFp4 122896
- reduce cpu usage by as much as 25% (40% -> 30) by doing txq reclaim more efficiently
   - use mtx_trylock when trying to grab the lock to avoid spinning during long encap loop
   - add per-txq reclaim task
   - if mbufs were successfully re-claimed try another pass
- track txq overruns with sysctl

Approved by: re (blanket)
2007-07-10 06:01:45 +00:00
Warner Losh
2f33a9032b Missed in last commit: add usb task for rue to use for its ticks.
Approved by: re (bmah)
2007-07-09 20:56:39 +00:00
Ariff Abdullah
0937dd1ec0 - Add codec id for Realtek ALC268.
- Add controller id for Intel 82801I (ICH9).
  PR:			kern/114399
  Submitted by:		Michael Fuckner <michael@fuckner.net>

- MSI support. Disable by default due to various issues with too many
  broken hardwares. MSI can be enabled through device.hints(5) or
  kenv(8) by setting "hint.pcm.%d.msi=1".
  Partially submitted by:	kevlo
                         	YAMAMOTO Taku <taku@tackymt.homeip.net>
  Tested by:			joel, kevlo, YAMAMOTO Taku

Approved by:	re (hrs)
MFC after:	3 days
2007-07-09 20:42:11 +00:00