Commit Graph

21270 Commits

Author SHA1 Message Date
tsutsui c2d79bf895 Don't touch the VR_STICKHW register on VT3043.
The commit log in FreeBSD's if_vr.c rev 1.43 says
"This is really only for the VT6102, but it doesn't hurt the older chips,"
but at least it hurts my VT86C100A (which returns a product ID of VT3043)
on macppc and causes kernel MCHK trap while the same board on i386
and VT6102 on macppc have no problem with it.
2006-11-02 17:32:11 +00:00
garbled 8e03013027 Comment out the debug options to siop, and change the undef to define.
This way they will be compiled by the i386 DEBUG kernel and tested.
2006-11-02 15:08:30 +00:00
garbled a68eec4cf9 Make these compile when SIOP_DEBUG is enabled, by nuking the reference to
t_offset, which no longer seems to exist.
2006-11-02 14:55:04 +00:00
tsutsui 7f2c078b18 Pull some RX fixes from FreeBSD's if_vr.c rev 1.59:
- in vr_rxeoc() (i.e. on RX error interrupts), disable RX before
  calling vr_rxeof() and check it actually stopped
- no recovery is needed for VR_ISR_DROPPED, so just account ierrors
- also account ierrors in vr_rxeoc()
2006-11-02 11:02:58 +00:00
tsutsui 06503d5611 - make DMA descriptor members volatile
- set VR_RXSTAT_OWN after all other descriptor data is set

With these changes, vr_init() seems to initialize
the vr chip stuck on RX properly.
2006-11-02 10:44:30 +00:00
tsutsui c04f54e8f4 Fix another botch in rev 1.14:
vge_encap() should bail out if there is not enough free
TX descriptor _OR_ TX descriptor is still owned by the chip.

Anyway, we already check if the TX descriptor already has an mbuf
to be sent in vge_start() so no need to bother to check sc_tx_free
and VGE_TDSTS_OWN in the descriptor in normal case, then make it use
KASSERT(9) or wrap with #ifdef DIAGNOSTIC.

XXX1: I don't know why original FreeBSD driver checks
      if a number of free TX descriptors is more than two, not zero.
XXX2: Is it better to check a number of free descriptors in vge_start()
      like other our drivers rather than mbuf chain for each descriptor?
2006-11-01 18:11:18 +00:00
tsutsui 2b93194cee Remove a debug statement which was slipped in rev 1.21. 2006-11-01 17:13:37 +00:00
tsutsui ced98add61 Also copy csum_flags and csum_data in vge_m_defrag().
Fix checksum error problem on sending fragmented large packets,
which was introduced in rev 1.14.

BTW, should we have m_defrag() in MI for other drivers?
2006-11-01 16:26:27 +00:00
cbiere 293f5e50a2 Set oldpblksize and oldrblksize early enough so that zero-initialisation
isn't necessary. The GCC warning was not a false-positive, AFAICS.
2006-11-01 10:13:37 +00:00
xtraeme 5975efbaee Initialize old[pr]blksize to 0 to avoid gcc warnings. 2006-11-01 09:36:52 +00:00
xtraeme c671ada84e Missing __KERNEL_RCSID() 2006-11-01 08:39:25 +00:00
thorpej 3cea1a3abd Detect if we're talking to a VMware virtual interface, and, if so,
limit the number of Tx segments to 8 to work around a VMware bug.
2006-11-01 06:42:12 +00:00
cbiere 87261698f4 Fix for kern/17446. Restore the audio settings if an error occured. 2006-11-01 06:39:19 +00:00
manu 888bf2baaa regen 2006-10-31 23:32:20 +00:00
manu 1bdd4dec3b Add support for Perle systems PCI-RAS 4 modem ports
See http://www.perle.com/products/Multimodem-Cards.shtml for product details
2006-10-31 23:04:49 +00:00
joerg fc0bc19fc7 Add rum(4) for newer USB Ralink devices. Obtained from OpenBSD.
Special thanks to Sepherosa Ziehau for helping debugging USB issues.
Hook up rum(4) for i386 config files.
2006-10-31 22:21:16 +00:00
joerg de54b391eb Move AMRR code out of wpi(4) and ural(4) into net80211 itself.
From OpenBSD.
2006-10-31 21:53:41 +00:00
joerg 8934eeb830 Split the USB task queue into two parts, one for normal device tasks and
one for tasks of the host controllers. This is needed for drivers like
ural(4) that want to do synchronous USB transfers from the task handler.
Before the split timeouts could not be handled correctly as the task
thread was still blocked. From FreeBSD.
2006-10-31 20:43:31 +00:00
plunky e500250b17 enable 'Application Control Pan' in Consumer usage group as an equivalent
to the Z direction since some mice (Apple Mighty Mouse) provide horizontal
scrolling direction with that report.
2006-10-31 19:17:04 +00:00
tsutsui e903fd730c This has been megered into if_vge.c. 2006-10-31 14:15:23 +00:00
tsutsui 056982dcb8 Make vge(4) look a NetBSD native driver like pcn(4) or epic(4) etc:
- merge if_vgevar.h into if_vge.c since no other file refers it
- rename some macro (VGE_TX_DESC_CNT -> VGE_NTXDESC etc.) and structs
- change prefixes of structure members to represent parents
- put TX and RX descriptors into single struct vge_control_data and
  allocate DMA memory at once
- no need to specify BUS_DMA_ALLOCNOW
- define appropriate macro for offsets and addresses of DMA descriptors
- define struct vge_txsoft and vge_rxsoft, and put common data for
  each descriptor into them
- remove struct vge_list_data and move its members into struct vge_softc
- remove #ifdef DEVICE_POLLING code we don't support
- merge vge_[tr]x_list_init() functions into vge_init()
- use aprint_error() to print errors
- put splnet(9) where appropriate and remove unused VGE_{LOCK,UNLOCK}() macro
- clear TX timeout only if there is no pending descriptor
- check dm_nsegs properly otherwise padding short packets could fail
- prepare zero'ed DMA memory to pad short packets rather than putting
  random data
- fix a wrong VGE_TXDESCSYNC() usage which should be VGE_TXFRAGSYNC()

Tested on my i386 which is my development machine.
(more bus_dmamap_sync(9) cleanup will be done later)
2006-10-31 14:13:30 +00:00
thorpej f347528e49 In the pcn driver:
- Remove the PCN_NO_PROM option.  Instead, query the am79c970-no-eeprom
  property, and read the MAC address from the CSRs if that property is TRUE.

In the ibmnws port:
- Implement device_register().
- In device_register(), set the am79c970-no-eeprom property for the
  built-in Ethernet.
2006-10-31 14:04:29 +00:00
toshii 37977d3367 Match ATI SB[34]00 smbus controllers. 2006-10-31 14:03:07 +00:00
skrll ebb445db43 Remove the boot-from-disk hppa hack now that a real fix has been found. 2006-10-30 16:15:56 +00:00
elad cc83a2c614 Don't use memcmp() and memcpy() on userspace addresses.
Pointed out by mrg@, thanks.

This also makes it so a malicious root user can't panic the kernel by
passing junk pointers.
2006-10-30 12:37:08 +00:00
elad 048a21b75e Simplify and rework duplication check code.
If we already have an entry, we only print a message mentioning it if the
fingerprints mismatch; that may indicate a security issue.

If the fingerprints match, there's a good chance it's the same file
appearing multiple times as a hard-link, in which case print a message
only if the verbose level is 1 or more.
2006-10-30 00:30:20 +00:00
freza e224ffd4ee Inline UPDATE_INTERVAL macro, it's only used once. Per mrg@'s note
on previous.
2006-10-29 11:29:58 +00:00
itohy 74588a5b22 Turn on PHY power earlier in the initialization.
This should make 3c575CT work and fix following PRs:

kern/12965: 3com 575CT does not work
port-i386/16295: Problems in pci routing table and ex0 (3c575c-tx) networking
2006-10-29 05:56:35 +00:00
christos f26b055a0e PR/34933: Sami Kantoluoto: RealTek 8168B found from Asus P5B motherboard
is not recognized
2006-10-28 23:18:34 +00:00
tsutsui 6ed1365e7f - bcopy -> strcpy (in debug message)
- bcopy -> memcpy
2006-10-28 18:45:57 +00:00
tsutsui 40c87dddb4 - use continue for an empty statement in for() loop
- remove an empty statement in if() clause by inverting logic
- use KDASSERT(9) rather than #ifdef DEBUG + KASSERT(9)
- replace commented out M_WRITABLE() with !M_READONLY(9)
2006-10-28 18:26:15 +00:00
tsutsui b62bfc53fd M_TRALINGSPACE(m) returns 0 if M_READONLY(m) is true,
so no need to call both.  Pointed out by Pavel Cahyna.
2006-10-28 18:00:53 +00:00
elad 40d6264cec Remove bogus sanity check.
The passed size doesn't mean anything really and can only help detect
corrupted configuration files, which should be done in userland anyway.

Note it's possible to trigger a kernel panic by passing a junk
pointer in the 'fingerprint' member of the parameters, but then again
that's true for anything that copies in data from a userland-supplied
pointer. And we have plenty of those.

At the moment, Veriexec only allows the super-user to open the pseudo
device, so it's ~okay. Maybe we should address that in copy(9) or
something?
2006-10-28 15:13:11 +00:00
tsutsui 1696b0bb2f Put common data for each RX DMA descriptor into a new rxsoft structure
for micro optimization.
2006-10-28 03:42:55 +00:00
freza ec743521b3 Use curcpu() instead of referencing &cpu_info_primary (which is only
defined by a handful of ports).

OK by christos@
2006-10-28 02:21:36 +00:00
reinoud 8b52dc54b3 Implement another class of `unit not ready' sense handling that is not
fatal.. A `long write in progress' is a retry again later command that is
issued when a device returns immediately after a write request but needs
some time before it can handle read requests.
2006-10-28 01:24:29 +00:00
christos e1ae6bce13 - don't allocate huge arrays on the stack
- no bogus ; after }; in block statements!
2006-10-27 21:58:59 +00:00
dogcow 6cb622186f Sync up with rtk 'common macro' changes. 2006-10-27 18:47:07 +00:00
tsutsui dee13e6f7d Remove redundant byteswap ops. 2006-10-27 13:26:34 +00:00
tsutsui 5ee73a035c Use common macro rather than local one. 2006-10-27 09:57:26 +00:00
bouyer f91ce46f20 Add SATA native registers support for VIA SATA controllers, so that
drives are probed using the SATA way (from FreeBSD). While here add the
VT8237A SATA Controller to the tables, should fix PR kern/34927.

Thanks to the César Catrián Carreño and paul (at) whooppee.com for
tests.
2006-10-27 08:22:31 +00:00
macallan 4022a1c7d3 fix a typo in chipsfb_bitblt() 2006-10-27 06:14:17 +00:00
uwe 523122cd3e Nuke GPROF cargo-cult I've been cut-n-pasting around in my drivers. 2006-10-27 00:08:32 +00:00
bjh21 be9c217769 Regen (__KERNEL_RCSID()). 2006-10-26 23:21:23 +00:00
bjh21 8eda8c47a7 Emit __KERNEL_RCSID() into videomodes.c so that kernels using it can be
more easily identified.
2006-10-26 23:19:50 +00:00
joerg 8f704ed76b Revert last change. The DWL122C1 is *not* an ural device. 2006-10-26 17:29:03 +00:00
thorpej f0c0486c7b Use the new prop_dictionary_util functions. 2006-10-26 05:04:18 +00:00
bouyer c55d38dab6 Exclude wdc_sataprobe() when no SATA controllers are present. Fix
build of *_TINY kernels.
2006-10-25 20:14:00 +00:00
bouyer fe6228aefa Regen: Add VIA VT8237A Integrated SATA Controller 2006-10-25 19:22:57 +00:00
bouyer 99697bfb44 Add VIA VT8237A Integrated SATA Controller, from FreeBSD. 2006-10-25 19:22:31 +00:00