Commit Graph

17002 Commits

Author SHA1 Message Date
Kip Macy
10b16b260c Add support for selectively dumping the state of the hardware response queue.
Change ordering of a couple of types.
2008-01-10 06:54:20 +00:00
Kip Macy
4fa42a6fa6 should always free when refcount is 1 2008-01-10 06:52:48 +00:00
Attilio Rao
cb05b60a89 vn_lock() is currently only used with the 'curthread' passed as argument.
Remove this argument and pass curthread directly to underlying
VOP_LOCK1() VFS method. This modify makes the code cleaner and in
particular remove an annoying dependence helping next lockmgr() cleanup.
KPI results, obviously, changed.

Manpage and FreeBSD_version will be updated through further commits.

As a side note, would be valuable to say that next commits will address
a similar cleanup about VFS methods, in particular vop_lock1 and
vop_unlock.

Tested by:	Diego Sardina <siarodx at gmail dot com>,
		Andrea Di Pasquale <whyx dot it at gmail dot com>
2008-01-10 01:10:58 +00:00
Kip Macy
f001b63dcb - make 9k clusters the default unless a tunable is set
- return the error from cxgb_tx_common so that when an error is hit we dont
  spin forever in the taskq thread
- remove unused rxsd_ref
- simplify header_offset calculation for embedded mbuf headers
- fix memory leak by making sure that mbuf header initialization took place
- disable printf's for stalled queue, don't do offload/ctrl queue restart
  when tunnel queue is restarted
- add more diagnostic information about the txq state
- add facility to dump the actual contents of the hardware queue using sysctl
2008-01-10 00:55:42 +00:00
Scott Long
15d0222f66 Fix a buffer overflow in the processing of various SCSI commands. This likely
fixes a an great number of weird problems that have been reported with this
driver.

PR: 119114
Submitted by: Jens Rehsack
2008-01-09 20:02:56 +00:00
Kip Macy
8d5754afc5 make nqsets a uint32_t so that sysctl will work
add 2 fields for allowing queue dumping
2008-01-09 08:12:24 +00:00
Kip Macy
b3fa5e2f65 don't decrement ref count below 1 for EXT_PACKET 2008-01-09 08:01:42 +00:00
Kip Macy
5f78571d1c EXT_PACKET is one of the valid mbuf types 2008-01-09 08:01:08 +00:00
Attilio Rao
d7a7e17968 Remove explicit calling of lockmgr() with the NULL argument.
Now, lockmgr() function can only be called passing curthread and the
KASSERT() is upgraded according with this.

In order to support on-the-fly owner switching, the new function
lockmgr_disown() has been introduced and gets used in BUF_KERNPROC().
KPI, so, results changed and FreeBSD version will be bumped soon.
Differently from previous code, we assume idle thread cannot try to
acquire the lockmgr as it cannot sleep, so loose the relative check[1]
in BUF_KERNPROC().

Tested by: kris

[1] kib asked for a KASSERT in the lockmgr_disown() about this
condition, but after thinking at it, as this is a well known general
rule, I found it not really necessary.
2008-01-08 23:48:31 +00:00
John Baldwin
e46502943a Make ftruncate a 'struct file' operation rather than a vnode operation.
This makes it possible to support ftruncate() on non-vnode file types in
the future.
- 'struct fileops' grows a 'fo_truncate' method to handle an ftruncate() on
  a given file descriptor.
- ftruncate() moves to kern/sys_generic.c and now just fetches a file
  object and invokes fo_truncate().
- The vnode-specific portions of ftruncate() move to vn_truncate() in
  vfs_vnops.c which implements fo_truncate() for vnode file types.
- Non-vnode file types return EINVAL in their fo_truncate() method.

Submitted by:	rwatson
2008-01-07 20:05:19 +00:00
Weongyo Jeong
6be174137b Fix incorrect dependencies of zyd(4).
Approved by:	thompsa (mentor)
2008-01-07 11:31:55 +00:00
Dag-Erling Smørgrav
909a07a8cf Add support for ICH8M.
PR:		kern/119351
Submitted by:	Takeharu KATO <takeharu1219@ybb.ne.jp>
MFC after:	1 week
2008-01-07 09:46:39 +00:00
Kevin Lo
0b119ae588 Add the SparkLAN RT2573, found in HP s3200n
Obtained from: OpenBSD
2008-01-07 09:14:37 +00:00
Kip Macy
f09b75d98b Fix mvec code to handle the case of the packet zone
this was missed in the initial import
2008-01-07 01:18:16 +00:00
Poul-Henning Kamp
24ecb0cb15 If the disk reports that it support the Compact Flash Association command
set, announce BIO_DELETE capability and issue ATA_CFA_ERASE when we get one.

Once we issue more BIO_DELETE, this will improve lifetime, and
possibly write speed of Flash based devices which have usable flash
adaptation layers.

For now, about the only usage is the newfs(1) -E flag.

Approved by:	sos
2008-01-02 20:33:54 +00:00
Poul-Henning Kamp
08d2425f6f Follow the current fashion of gratuitously stomping into other
peoples code with irrelevant changes[1]:

Use bus_{read|write_*() instead of bus_space_{read|write}_*() for
purely stylistic reasons.

Due to compiler optimizations and inlining, this is for all practical
purposes without effect in the compiled code.

[1] NB: Approved by:	sos
2008-01-02 20:31:14 +00:00
Julian Elischer
b6ae6984e8 Don't duplicate the whole of arpresolve to arpresolve 2 for the sake
of two compares against 0. The negative effect of cache flushing
is probably more than the gain by not doing the two compares (the
value is almost certainly in register or at worst, cache).
Note that the uses of m_freem() are in error cases and m_freem()
handles NULL anyhow. So fast-path really isn't changed much at all.
2007-12-31 23:48:06 +00:00
John Baldwin
c903c5fbae Use devclass_get_count() instead of devclass_get_maxunit() to get the
correct number of acpi_thermalX devices.  Having this wrong caused the
acpi_thermal thread to realloc the array of devices on each loop iteration.

MFC after:	1 week
PR:		kern/118497
Submitted by:	Pasi Parviainen
2007-12-31 15:56:03 +00:00
Dag-Erling Smørgrav
89dbcee8ce Add device IDs for the ICH9 family.
PR:		i386/119126
Submitted by:	Dan Lukes <dan@obluda.cz>
MFC after:	1 week
2007-12-31 11:44:01 +00:00
Dag-Erling Smørgrav
abb75f864a Tabify. 2007-12-31 11:42:31 +00:00
Warner Losh
8ac3902acc Add Winbond W89C940F to the list. Also, stub in some entries for two
Holtek cards that will need some special support later, but leave them
commented out for now.

These ID's are transcribed from the Linux ne2k-pci.c
2007-12-31 03:29:02 +00:00
Warner Losh
ac13f66337 Add missing 'sc->chip_type ==' to an ugly switch statement expression
so that for RealTek 8019 cards, we consider AUI as well as BNC bits.
2007-12-31 03:27:21 +00:00
Jeff Roberson
397c19d175 Remove explicit locking of struct file.
- Introduce a finit() which is used to initailize the fields of struct file
   in such a way that the ops vector is only valid after the data, type,
   and flags are valid.
 - Protect f_flag and f_count with atomic operations.
 - Remove the global list of all files and associated accounting.
 - Rewrite the unp garbage collection such that it no longer requires
   the global list of all files and instead uses a list of all unp sockets.
 - Mark sockets in the accept queue so we don't incorrectly gc them.

Tested by:	kris, pho
2007-12-30 01:42:15 +00:00
Marius Strobl
2a79fd39b4 o In preparation for basing a new driver on this one:
- ANSIfy
  - try to bring closer to style(9)
  - remove banal comments.
o Add my copyright for having done lots of fixes and improvements.
2007-12-30 01:32:03 +00:00
Marius Strobl
d2d9ab366b Correct the comments in am7990_intr() and am79900_intr(); it's not
possible to end up in the interrupt handler again while processing the
previous RX interrupt in ifp->if_input() because the MD interrupt code
disables the delivery of the respective interrupt until all associated
handlers were called (in the INTR_FILTER case the MI code supposedly
does the same). Toggling the NIC interrupt enable bit in these handlers
still is necessary though as some chips (f.e. the VMware emulated one)
require this to be done in order to keep issuing interrupts.

MFC after:	1 month
2007-12-30 00:23:38 +00:00
Wojciech A. Koszek
9336e0699b Replace explicit calls to video methods with their respective variants
implemented with macros. This patch improves code readability. Reasoning
behind vidd_* is a sort of "video discipline".

List of macros is supposed to be complete--all methods of video_switch
ought to have their respective macros from now on.

Functionally, this code should be no-op. My intention is to leave current
behaviour of touched code as is.

No objections:	rwatson
Silence on:	freebsd-current@
Approved by:	cognet
2007-12-29 23:26:59 +00:00
Wojciech A. Koszek
259699b294 Remove explicit calls to keyboard methods with their respective variants
implemented with macros. This patch improves code readability. Reasoning
behind kbdd_* is a "keyboard discipline".

List of macros is supposed to be complete--all methods of keyboard_switch
should have their respective macros from now on.

Functionally, this code should be no-op. My intention is to leave current
behaviour of code as is.

Glanced at by:	rwatson
Reviewed by:	emax, marcel
Approved by:	cognet
2007-12-29 21:55:25 +00:00
Marius Strobl
c5860546c4 Fix some bugs in the FreeBSD 4/5/6 pci(4) IOCTLs compatibility code:
- Use the correct offsets when copying out the results of PCIOCGETCONF_OLD.
  This happened to not affect the 64-bit architectures because there the
  addition of pc_domain to struct pcisel didn't change the overall size of
  struct pci_conf. [1]
- Always copy the name and unit information to conf_old so it's also part
  of the output once this information is cached in dinfo.
- Use the correct type for flags in struct pci_match_conf_old. This
  change is more or less cosmetic though.

Reported and tested by:	bde [1]
Reviewed by:		imp
MFC after:		3 days
Committed from:		24C3
2007-12-26 21:50:59 +00:00
Rui Paulo
12b98c52dd Sync with rev 1.63 of NetBSD's ums.c:
If a mouse has both a wheel and a Z direction we report both.
     XXX Due to tradition the wheel is reported as the Z direction (and the Z
     direction as W).
     Now Apple's Mighty Mouse is fully supported, except the X11 mouse driver
     doesn't know what to do with the new coordinate.

MFC after:   3 months

Approved by:   njl (mentor), imp
2007-12-26 14:31:16 +00:00
Remko Lodder
effef9789a Add support for the BMC5722.
Reported by:		Chris Shenton <chris at shenton dot org> on current@
Approved by:		imp (mentor)
2007-12-25 19:51:18 +00:00
Robert Watson
3de213cc00 Add a new 'why' argument to kdb_enter(), and a set of constants to use
for that argument.  This will allow DDB to detect the broad category of
reason why the debugger has been entered, which it can use for the
purposes of deciding which DDB script to run.

Assign approximate why values to all current consumers of the
kdb_enter() interface.
2007-12-25 17:52:02 +00:00
Hajimu UMEMOTO
0c3e489dce Add sysctl mibs for _TSP, _TC1 and _TC2 which is user overridable
but is blocked on user_override mib.
Not a few people want to use a passive cooling without their ACPI
BIOS support.

Reviewed by:	njl
2007-12-24 16:32:14 +00:00
Konstantin Belousov
316d90a37b Move the check for the snp device being already attached after the
fget() call, that is sleeping point, and possibly dropping Giant.

The snp_target == NULL implies the snp_tty == NULL. Remove the code
that is put under snp_target == NULL and snp_tty != NULL clause.

In snpclose(), do the snp_detach() before scheduling the snp device
destruction. Otherwise, after the return from snpclose(), the snp
device is already removed from the snp_list, but tty is still in
snooped state. Any attempt to do i/o on such tty cause panic because
ttytosnp() returns NULL.

Tested by:	Peter Holm
MFC after:	1 week
2007-12-24 13:47:16 +00:00
Ed Maste
f16627aadc Avoid holding the aac_io_lock over copyout.
Submitted by: Achim Leubner @ Adaptec.
2007-12-20 21:13:58 +00:00
Pyun YongHyeon
a0637caa3f By definition promiscuous mode should see all unicast frames as well
as multicast/broadcast frames. Previously re(4) ignored multicast
frames in promiscuous mode. The RTL8169 datasheet was not clear
how it handles multicast frames in promiscuous mode.

PR:	kern/118572
MFC after:	3 days
2007-12-20 07:26:20 +00:00
Marius Strobl
75d63045d9 In openprom_ioctl() ensure appropriate permissions and that data isn't
NULL and doesn't point to a NULL pointer before dereferencing it. This
fixes a panic triggered by Xorg 7.3.

Reported and tested by:	Bill Green
MFC after:		3 days
2007-12-20 00:31:04 +00:00
Marcel Moolenaar
de2fa7b8af Redefine bus_space_tag_t on PowerPC from a 32-bit integral to
a pointer to struct bus_space. The structure contains function
pointers that do the actual bus space access.

The reason for this change is that previously all bus space
accesses were little endian (i.e. had an explicit byte-swap
for multi-byte accesses), because all busses on Macs are little
endian.
The upcoming support for Book E, and in particular the E500
core, requires support for big-endian busses because all
embedded peripherals are in the native byte-order.

With this change, there's no distinction between I/O port
space and memory mapped I/O. PowerPC doesn't have I/O port
space. Busses assign tags based on the byte-order only.
For that purpose, two global structures exist (bs_be_tag and
bs_le_tag), of which the address can be taken to get a valid
tag.

Obtained from: Juniper, Semihalf
2007-12-19 18:00:50 +00:00
Doug Ambrisko
4844f5c009 Add Dell's sub-vendor id to identify PERC6 RAID controller which has LSI
vendor id's.
2007-12-19 17:23:47 +00:00
Doug Ambrisko
9df7763bf3 I incorrectly assumed the log buffer started from the beginning when it
is actually a circular log.  Deal with it rolling around.  Fortunately,
the log area is big and I haven't seen any roll over yet.  Update and
get rid of the obsolete comment.
2007-12-19 17:22:07 +00:00
Ed Maste
0c40d5be19 Do not recursively acquire aac_io_lock in aac_ioctl_event.
MFC After: 3 days
2007-12-19 14:33:40 +00:00
Kip Macy
b96ebbf2e8 Don't overload tcp_usrreqs unless the kernel doesn't provide offload support. 2007-12-18 23:00:25 +00:00
Kip Macy
81186fb40c only include intr_machdep.h when it is needed for intr_bind
ia64 doesn't have an intr_machdep.h
2007-12-17 23:39:28 +00:00
Kip Macy
c662126d0c disable update in place on transmit 2007-12-17 10:02:29 +00:00
Kip Macy
8090c9f504 Make TCP offload work on HEAD (modulo negative interaction between sbcompress
and t3_push_frames).
 - Import latest changes to cxgb_main.c and cxgb_sge.c from toestack p4 branch
 - make driver local copy of tcp_subr.c and tcp_usrreq.c and override tcp_usrreqs so
   TOE can also functions on versions with unmodified TCP

- add cxgb back to the build
2007-12-17 08:17:51 +00:00
Kip Macy
ea6ee7d60a Include cdefs.h and param.h for architectures with less header pollution 2007-12-16 21:22:24 +00:00
Kip Macy
fc5a2e51fb Use the vm include convention of busdma 2007-12-16 18:43:57 +00:00
Kip Macy
04b25f8e3e need M_IOVEC define 2007-12-16 18:36:57 +00:00
Kip Macy
01cf8d43b8 Don't globally include mvec.h its only needed by cxgb_sge.c 2007-12-16 18:26:04 +00:00
Stanislav Sedov
64425c8f7b - Add quirk for the TrendNet TU-S9 adapter, which uses new version of PL2303
chip (revision 0x400). This allows it to be correctly identified as PL2303X.

Approved by:	maxim
MFC after:	1 week
2007-12-16 12:39:50 +00:00
Kip Macy
d202ae29cf Don't use old-style mbuf iovecs 2007-12-16 07:41:57 +00:00
Kip Macy
280b95e8b5 Add driver for TCP offload
Sponsored by: Chelsio Inc.
2007-12-16 05:27:26 +00:00
Kip Macy
501e15907b Update the buffer management support code needed by the tcp offload module 2007-12-16 05:19:48 +00:00
Kip Macy
c186903b0d Sanitize of a routine that is going away 2007-12-16 05:14:25 +00:00
Kip Macy
35f70ae1d3 overlead mbuf fields for use by toe 2007-12-16 05:11:42 +00:00
Kip Macy
92328e3882 Add system includes for mvec.h 2007-12-16 05:11:10 +00:00
Kip Macy
3e96c7e790 Import updated support code for the TOM (tcp offload module). 2007-12-15 21:54:59 +00:00
Scott Long
b063a42270 Add the 'hptrr' driver for supporting the following Highpoint RocketRAID
cards:

     o   RocketRAID 172x series
     o   RocketRAID 174x series
     o   RocketRAID 2210
     o   RocketRAID 222x series
     o   RocketRAID 2240
     o   RocketRAID 230x series
     o   RocketRAID 231x series
     o   RocketRAID 232x series
     o   RocketRAID 2340
     o   RocketRAID 2522

Many thanks to Highpoint for their continued support of FreeBSD.

Submitted by: Highpoint
2007-12-15 00:56:17 +00:00
Ariff Abdullah
667aaea554 Limit total hardware playback channels to just 1. 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.

Tested by:	Dominic Fandrey <LoN_Kamikaze at gmx dot de>
URL:		http://lists.freebsd.org/pipermail/freebsd-stable/2007-December/039022.html
2007-12-14 02:16:26 +00:00
Ariff Abdullah
d155e640d8 Add speaker/headphone controls for HP Compaq DC7700 Small Form Factor PC
@ ALC262.

Submitted by:	Carlos A. M. dos Santos <unixmania at gmail dot com>
2007-12-13 15:48:45 +00:00
Ariff Abdullah
c8d361d42d nid 28 for Acer @ ALC268 should be identified as analog CD input pin,
though it doesn't provides proper (sane, valid, usable, etc) analog CD
playback due to its stripped down nature.
2007-12-13 15:44:53 +00:00
Søren Schmidt
4c088dcd6c Implement a workaround of the datacorruption problem on serverworks HT1000 chipsets.
The HT1000 DMA engine seems to not always like 64K transfers and sometimes barfs data all over memory leading to instant chrash and burn.
Also fix 48bit adressing issues, apparently newer chips needs 16bit writes and not the usual fifo thing.

HW donated by: Travis Mikalson at TerraNovaNet
2007-12-13 11:47:36 +00:00
Ariff Abdullah
909f7f7f4e Disable AC97 microphone channel. Due to the channel allocation priority
that favours true hardware channel, the first instance of recording
request will grab this channel (the first channel is being used as
vchan master). In many cases, it is not really work as intended and give
false impression of broken recording.

PR:		kern/118546
MFC after:	3 days
2007-12-12 18:21:05 +00:00
Scott Long
281017a577 Rewrite the DMA code paths from being an impenitrable maze of special cases
to a much saner and simplier unified code path.  Along the way, fix various
CAM nits and bugs so that the passthrough works correctly for all cases.
2007-12-12 05:55:03 +00:00
David Xu
f5ae94753b Add quirks for Netac Onlydisk 2000 USB disk. 2007-12-11 06:41:38 +00:00
Andrew Thompson
2aec24b515 sc->ndis_tq variable is only initialized when a driver module is for wireless
NICs.

PR:		kern/118439
Submitted by:	Weongyo Jeong
2007-12-09 20:14:01 +00:00
Scott Long
f40b4cabee Fix an incorrect FreeBSD version test. 2007-12-09 19:24:27 +00:00
Scott Long
579ec1a53f Modify locking so that a single version of the driver src can be used on 6.x
and beyond.
2007-12-09 19:22:25 +00:00
Scott Long
44f05562de Support new ARC120x family of controllers. Many thanks for Areca's continued
support of FreeBSD.

Submitted by: Erich Chen @ Areca
2007-12-08 20:48:26 +00:00
Pyun YongHyeon
1acbb78ada Add another RTL8168 revision 3 which is found on RTL8111-GR Gigabit
Ethernet Controller. Multicast filtering wasn't tested and needs more
expore. While I'm here change complex if statements with switch
statement which would improve readability.

Reported by:	Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca >
Tested by:	Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca >
2007-12-08 00:14:09 +00:00
Ed Maste
9bffabcec9 Merge from Adaptec a 64 bit fix and a workaround for luns != 0 returning
CAM_SEL_TIMEOUT on SAS controllers, which prevented passthrough devices
from being created.
2007-12-07 20:37:12 +00:00
Ed Maste
7ea2d5586c Add family support to allow the driver to attach to new devices that
share the same interface.

Submitted by:	Achim Leubner at Adaptec
2007-12-07 18:05:41 +00:00
Joseph Koshy
9596916c4d Add stub functions to unbreak LINT. 2007-12-07 17:21:53 +00:00
Søren Schmidt
02d76bfa1b Fix speed report on Intel SATA chips in compat mode.
Fix broken detect of JMicron 368.
2007-12-07 13:14:31 +00:00
Andrew Thompson
30d9c7698a Preallocate some space to return the scan results, some drivers do not properly
pass back the desired buffer length. This fixes scanning with the Marvell
88W8335 and BCM4328 wireless cards.

PR:		kern/118370
Submitted by:	Weongyo Jeong
Tested by:	Ed Schouten
2007-12-07 10:37:25 +00:00
Joseph Koshy
d07f36b075 Kernel and hwpmc(4) support for callchain capture.
Sponsored by:	FreeBSD Foundation and Google Inc.
2007-12-07 08:20:17 +00:00
Ed Maste
a723a5482e Allow simultaneous opens of the device for issuing commands to the
controller.  This is merged from Adaptec driver build 11669.
2007-12-07 00:22:23 +00:00
Ed Maste
8af086fd5c Add more PCI ID's from Adaptec's driver, including two requested
by Daniel Kamm.

  Adaptec RAID 51245
  Adaptec RAID 51645
  Adaptec RAID 52445
  Adaptec RAID 5405
  Sun STK RAID REM
  Sun STK RAID EM
  SG-XPCIESAS-R-IN
  SG-XPCIESAS-R-EX
2007-12-06 18:25:29 +00:00
Ed Maste
e9faf6c240 Add PCI IDs for additional cards:
AOC-USAS-S4i
AOC-USAS-S8i
AOC-USAS-S4iR
AOC-USAS-S8iR
AOC-USAS-S8i-LP
AOC-USAS-S8iR-LP
2007-12-06 02:10:07 +00:00
Philip Paeps
e383ee75af Fix a use-after-free.
Submitted by:	Ilja van Sprundel <ilja -at- netric.org>
Reviewed by:	secteam
MFC after:	1 day
2007-12-05 19:32:59 +00:00
Philip Paeps
6c3c35e413 Plug two potential (root-only, local) information leaks. buf is not
initialized before use and returned integrally instead of up to size.

Submitted by:	Ilja van Sprundel <ilja -at- netric.org>
Reviewed by:	secteam
MFC after:	1 day
2007-12-05 19:32:07 +00:00
Remko Lodder
28d34c0e95 Bring in support for: Marvell Yukon 8039
PR:		118401
Submitted by:	Skip Ford <skip at menantico dot com>
Approved by:	imp (mentor), yongari
MFC After:	3 days
2007-12-05 09:41:58 +00:00
Julian Elischer
abc3f1d24b Stop serial console and gdb serial port from getting all screwed up.
PR: 65278
MFC in: 3 days
Submitted by: ups@
2007-12-05 05:16:56 +00:00
Wojciech A. Koszek
8b249eccbc Cast address of 'bssid' to uint8_t since printf() expects to get unsigned
argument in %6D case.

Submitted by:	thompsa
Compile-tested:	wkoszek
Reviewed by:	cognet (mentor)
Approved by:	cognet (mentor)
2007-12-04 20:48:32 +00:00
Wojciech A. Koszek
9977143467 Cast 'data' to 'u_char', as printf() requires this type to be unsigned. This
is what gcc3 complains about.

Without this change, it's impossible to build the kernel with gcc3.

Tested by:	cognet@ (mentor)
Approved by:	cognet@ (mentor)
2007-12-04 20:33:58 +00:00
Andrew Thompson
7218dd5f5a Remove compatibilty defines to simplify reading the code, this is around 10% of
the total LOC. These are mostly for the 6.x branch and it will be easier to
cherrypick any changes (if at all).
2007-12-03 21:51:28 +00:00
Ariff Abdullah
84793af6a9 Fix audio playback aborted with SNDCTL_DSP_SETTRIGGER, affecting
PortAudio version 19.

PR:		kern/118395
Submitted by:	Henrik Gulbrandsen <henrik at gulbra dot net>
MFC after:	3 days
2007-12-03 14:26:56 +00:00
Konstantin Belousov
6ed4cfc05d Do not allow the SNPSTTY ioctl for the snoop device that has a tty
attached. Otherwise, the snp->snp_tty would be overwritten, while the
tty line discipline still set to the snpdisc. Then snplwrite() causes
panic because ttytosnp() cannot find the snp.

MFC after:	1 week
2007-12-03 14:02:27 +00:00
Pyun YongHyeon
7c103000b6 Always honor promiscuous flag prior to programming Rx multicast
filter. This fixes a regression introduced in rev 1.89.

PR:	114632
MFC after:	3 days
2007-12-03 01:28:08 +00:00
Scott Long
cdc03cc897 Provide unqiue malloc types instead of using M_DEVBUF. 2007-12-02 19:54:45 +00:00
Scott Long
f4b5c2581d Refactor completion handlers so that they can be combined into a single
function.  Add missing locking.
2007-12-02 19:50:01 +00:00
Scott Long
4059f1cc7d Make a pass at style.9 compliance 2007-12-02 18:48:17 +00:00
Scott Long
4c92c3889c Fix a typo that was hidden by AMR_DEBUG. 2007-12-02 18:47:31 +00:00
Scott Long
3002614d91 Fix printf format bugs that where hidden by AMR_DEBUG. 2007-12-02 18:45:37 +00:00
Ariff Abdullah
229acba1d0 Headphone / speakers automute fixup for Acer Aspire 4710 @ ALC268 laptop.
Tested by:	Liyu, She
2007-12-02 16:38:28 +00:00
Andrew Thompson
4d50f65ceb Hide a debug printf, NDIS_DEBUG is always defined and we test the sysctl.
MFC after:	3 days
2007-12-02 09:03:43 +00:00
Peter Wemm
66e7bdd4dc Based in info gleaned from the web and other drivers (including the Linux
sx driver), change a magic value in the PLX bridge chip.  Apparently later
builds of the PCI cards had corrected values in the configuration eeprom.
This change supposedly fixes some pci bus problems.
2007-12-01 20:39:47 +00:00
Kevin Lo
a770f1e136 ieee80211com.ic_fixed_rate holds rate instead of rate index
Reviewed by: Weongyo Jeong
2007-12-01 08:53:03 +00:00
Peter Wemm
3e3d9737c7 Allow the sio acpi attachment to be disabled (ie: use hints only). This
hack means you can get the units and flags to match up more easily with
serial consoles on machines with acpi tables that cause the com ports
to be probed in the wrong order (and hence get the wrong sio unit number).

This replaces the common alternative hack of editing the code to comment
out the acpi attachment.  This could go away entirely when device wiring
patches are committed.
2007-11-30 21:45:07 +00:00
Peter Wemm
585484b918 Add sio_puc_kludge_unit() to stop sio devices originating from puc
stomping on the units intended for the motherboard sio ports.  This is
no real substitute for the not-yet-committed device wiring enhancements.

Code taken from sio's pci attachment.
2007-11-30 21:36:12 +00:00
Simon L. B. Nielsen
9790a3cbd4 Correct a random value disclosure in random(4).
Security:	FreeBSD-SA-07:09.random
2007-11-29 16:06:12 +00:00
Joseph Koshy
4dd9b0c085 Revert revision 1.4.
Intel CPUs with family 0x6, model 0xE and later (i.e., Intel Core(TM))
have a PMC architecture that differs somewhat from previous CPUs in
family 0x6.  Even though the basic programming model is similar, the
documented set of legal values that may be loaded into their PMC MSRs
differs from that of the previous PMCs in family 0x6 and reusing bit
values valid for the older PMCs could result in undefined behaviour in
the general case.
2007-11-29 06:43:58 +00:00
Jack F Vogel
2635265800 Add COHERENT to descriptor mem allocation for the
benefit of ARM (request from Olivier Houchard), its
a noop on most architectures and goodness on those
that use it.
2007-11-28 23:04:11 +00:00
Scott Long
0a5c91d058 Turn the CAM passthroug interface to AMR back ON. Adjust the
T_DIRECT filtering so that disk drives can be attached via the
pass driver.  Add CAM locking.  Don't mark CAM commands as SG64
since the hardware isn't designed to deal with 64-bit passthru
commands.  Hopefully the bounce buffer changes that were done
for the management/ioctl interface are robust enough to handle
this deficiency for CAM as well.
2007-11-28 19:40:17 +00:00
Jack F Vogel
fd4ae6dcff A minor issue with lock names, WITNESS complains
when the two locks are the same...
2007-11-28 19:14:06 +00:00
Ariff Abdullah
1cb55600a0 - Add Analog Devices AD1984 codec id.
- Enable pcbeep control for Acer + ALC268 (nid 29). Give enough (fake)
  hints so the parser will grab it and allocate "speaker" control.
- Fix regression while preparing DAC and ADC for multichannel
  format. Since playback policy is to output to every possible path,
  ensure that each DAC is started.

Reported / Tested by:	Guy Brand
2007-11-28 15:27:22 +00:00
Ariff Abdullah
fcdde99a89 Add missing MCP65 id which was accidentally removed in previous commit. 2007-11-28 02:13:20 +00:00
Benjamin Close
8b92cdc94c Fix up a race condition with the callout_stop method in newstate.
The call should happen with the driver lock held. We don't hold the driver
lock in newstate as it's a separate thread where we can't sleep (and we only
call wpi_cmd in async mode).

Discovered By: Attillo's callout rework
Approved By: mlaier (comentor)
2007-11-27 09:09:09 +00:00
Benjamin Close
a7099588fc Handle missed beacons correctly
Approved by: mlaier (comentor)
2007-11-27 08:58:32 +00:00
Tai-hwa Liang
8c81b154da MFP4(129048): Eliminating an unnecessary check on an_gone inside
an_stats_update() since a properly locked callout_stop(9) does do the
right thing.

Reviewed by:	ambrisko, jhb
MFC after:	3 days
2007-11-27 08:29:24 +00:00
Remko Lodder
1b72425ab3 Add the Intel 82801FB (ICH6) SMBus controller and the
Intel 82801GB (ICH7) SMBus controller.

PR:		85106 [1]
PR:		99663 [2]
Approved by:	imp (mentor), jhb
Submitted by:	Oliver Fromme <olli at lurza.secnetix dot de>, [1]
		Arthur Hartwig <arthur dot hartwig at nokia dot com>, [1]
		Lowell Gilbert <lgfbsd at be-well dot ilk dot org> [2]@
MFC After:	3 days
2007-11-26 19:54:54 +00:00
Jack F Vogel
abcc80c87a Fix for a reported panic in certain circumstances. When
calling em_stop() now make sure the TX lock is held as
well as CORE.
2007-11-26 19:47:03 +00:00
Søren Schmidt
91b4ff52c7 Use device_set_desc_copy in the generic ident as its used on a temp buffer. 2007-11-26 19:08:08 +00:00
Remko Lodder
64d0afa7f8 Add the 845M GMCH controller.
PR:		114802
Approved by:	imp (mentor), anholt (private mail)
Submitted by:	Alex Goncharov <algo1 at comcast dot net>
MFC After:	3 days
2007-11-26 18:17:07 +00:00
John Birrell
1b655ceb37 Add Dell's Photo AIO Printer 926. 2007-11-26 05:47:15 +00:00
Robert Watson
3b6efc61a3 Respell 'Conatainer' as 'Container'.
MFC after:	3 days
Reported by:	Toomas Aas <toomas dot aas at raad dot tartu dot ee>
2007-11-24 18:39:01 +00:00
Søren Schmidt
506310cd36 Add preliminary SATA ATAPI support for sii 3132/3124 chips. 2007-11-23 08:17:14 +00:00
Sam Leffler
28aba29eb9 - add the Planex GW-US54GXS adapter
Submitted by:	Weongyo Jeong <weongyo.jeong@gmail.com>
Obtained from:	openbsd
MFC after:	3 days
2007-11-23 05:44:29 +00:00
Rui Paulo
4b07bf84dd Move ASMC_FAN_FUNCS in the Macmini structure declaration one line up
so that this macro expands in the right place.

Submitted by:	Ed Schouten <ed at fxq.nl>
Approved by:	njl (mentor)
2007-11-22 23:38:24 +00:00
Pyun YongHyeon
6a087a8722 Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
Ruslan Ermilov
c87e4fcd08 Take out em_poll() prototype from under EM_FAST_IRQ control.
Reported by:	tindebox compiling a LINT kernel
2007-11-21 12:55:33 +00:00
Ariff Abdullah
46e5fdd5af * Fix support for followings:
o Acer Aspire 4520 laptop
    - jack sensing / automute
  o Toshiba Satellite A135-S4527 laptop
    - jack sensing / automute
      Tested by: lioux
  o Apple Macbook 3 (is it?)
    - require gpio0 (for speakers) and ovref50 (for headphone)
      to make it works
    - jack sensing / automute
      Tested by: Ed Schouten
* Add Nvidia MCP67 controller ids.
* Be sensible about simmilar controller with multiple pci ids.
* Connect unused DAC/ADC to stream#0 rather than forcing each of them
  managing their own stream.

MFC after:	3 days
2007-11-21 11:39:27 +00:00
Kevin Lo
d618552420 Fix NULL dereference in rum_txeof()
PR: kern/117820
2007-11-21 05:51:43 +00:00
Pyun YongHyeon
8463d7a051 Add MSI support for 88E8058(Yukon EC Ultra). Unlike other Yukon II
family 88E8058 supports only one MSI message. Teach msk(4) to handle
that case.

Tested by:	Ed Schouten < ed AT fxq DOT nl >
2007-11-21 00:42:42 +00:00
Jack F Vogel
559930e525 One nit, FAST handling is now in #ifdef's for compatibility
between RELEASES, but we want it on by default in 7 and later,
add that define, and take out a fragment left from a workaround
being removed.
2007-11-20 22:06:01 +00:00
Jack F Vogel
f6b1d9cab8 Driver version 6.7.3
- Bring HEAD up to the latest shared code
 - Fix TSO problem using limited MSS and forwarding
 - Dual lock implementation
 - New device support
 - For my ease, this code can compile in either 6.x or later
 - brings this driver in sync with the 6.3
2007-11-20 21:41:22 +00:00
Jung-uk Kim
1de9b7e4c9 Check battery presence first before trying to get battery information.
PR:		kern/117591
Tested by:	Jessica Mahoney (root at varusonline dot com)
2007-11-20 18:35:36 +00:00
Pyun YongHyeon
75ef16df96 Add device id for 88E8058(Yukon EC Ultra) which is found on 3rd
generation MacBooks.
Unfortunately 88E8058 supports one MSI message so msk(4) needs more
generic way to handle the MSI capability.

PR:	118110
2007-11-20 07:47:32 +00:00
Pyun YongHyeon
431e606d74 Make phy respond only at address 0. This makes phy driver attached
only at address 0 which is supposed to be the only valid phy address
on Marvell PHY. The more correct solution would be masking PHY
address ranges allowable in PHY probe routine. Unfortunately,
FreeBSD has no way to retrict the PHY address ranges or to pass special
flags to PHY driver.
This change assumes that PHY hardwares attached to msk(4) would be
Marvell made 88E11xx PHY.

With this changes the phantom phys attached on 88E8036(Yukon FE)
should disappear.

Reported by:	Oleg Lomaka  < oleg AT lomaka DOT org DOT ua >
Tested by:	Oleg Lomaka  < oleg AT lomaka DOT org DOT ua >
2007-11-20 07:33:01 +00:00
Pyun YongHyeon
e4a5f4e04b o Don't hardcode that Yukon FE has 16KB SRAM. In fact, Yukon FE has
only 4KB SRAM.
 o Rework setting Tx/Rx RAM buffer size. Give receiver 2/3 of memory
   and round it down to the multiple of 1024. The RAM buffer size of
   Yukon II should be multiple of 1024. This fixes bogus RAM buffer
   configuration used in Yukon FE.

Reported by:	Oleg Lomaka  < oleg AT lomaka DOT org DOT ua >
Tested by:	Oleg Lomaka  < oleg AT lomaka DOT org DOT ua >
2007-11-20 07:07:33 +00:00
Pyun YongHyeon
cfd540e7db Drop maintaing hardware feature(bug) lists for Yukon II. We don't have
publicly available datasheet for Yukon II and don't know what
bug/workaround exist for the specific hardware revision. Also I don't
think the vendor will release hardware errata in near future.
The hardware feature lists were not used at all except setting water
mark registers. Since msk(4) should know exact chip model/revision
number to decide which hardware capability could be used the extra
feature lists were redundant.
2007-11-20 06:52:29 +00:00
Pyun YongHyeon
a109c74fc9 Various fixes for EC Ultra.
o Enable jumbo frame support for EC Ultra and disable jumbo frame
   for FE.
 o Enable store and forward mode for standard MTU sized frame.
 o Enable TSO for EC Ultra. However TSO/checksum offload is disabled
   for jumbo frame case. Because EC Ultra can't use store and forward
   mode for jumbo frame TSO/checksum offload is not available.
 o Adjust Tx GMAC almost empty threshold value and add a jumbo frame
   water mark. The maic value was obtained from Marvell's sk98lin
   driver.
 o Fix EC Ultra chip revision number.
2007-11-20 06:20:02 +00:00
Kevin Lo
2f3ad9ba29 Fix KASSERT messages. 2007-11-20 04:52:19 +00:00
Søren Schmidt
2d9f60ca25 Dont fumble the ivars on reinit, avoids panic on suspend/resume om some systems that looses thier devices.
Patch by: jhb@
2007-11-19 21:11:26 +00:00
Søren Schmidt
34cf71f7ef Try to workaound silicon bugs in Promise gen2 (ie TX4) chips
Initial patch by Alexander Sabourenkov who found it in Promise's own driver.

Further fixes and sanity checks by yours truely.
2007-11-19 20:47:31 +00:00
Søren Schmidt
6b899f5077 Fix the problem with certain ATAPI commands on AHCI devices.
Revert the probe in atapi-cd.c to the old usage now its fixed on AHCI.
THis change also fixes using virtual CD's om fx parallels.

Still leaves the GEOM problem of telling media vs device access apart in the access function.
2007-11-19 18:05:48 +00:00
Søren Schmidt
200c7605c8 Add generic support for chipsets that say they support AHCI. This should catch new chipsets that we dont know but that we should support.
Add a few new PCI id's.
Misc cleanups.
2007-11-18 14:44:52 +00:00
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
Warner Losh
b2068c0c18 Simplify the old compat #ifdefs. 2007-10-26 05:02:47 +00:00
Peter Wemm
d556638404 Split /dev/nvram driver out of isa/clock.c for i386 and amd64. I have not
refactored it to be a generic device.
Instead of being part of the standard kernel, there is now a 'nvram' device
for i386/amd64.  It is in DEFAULTS like io and mem, and can be turned off
with 'nodevice nvram'.  This matches the previous behavior when it was
first committed.
2007-10-26 03:23:54 +00:00
Takanori Watanabe
68fb6c4858 More style nit.
Pointed out by: njl.
2007-10-25 20:02:38 +00:00
John Baldwin
cc75dfe70b Don't attach to the "IBM0057" ID. This ID is used by IBM machines for
the PS/2 mouse controller.  Thus, when acpi_ibm(4) claimed the mouse
device, the mouse would stop working.  The one ACPI dump of an R40 that
I've looked at includes an HKEY device with the proper "IBM0068" ID, so
I'm not sure how the "IBM0057" ID could have helped at all.

MFC after:	1 week
Approved by:	njl
2007-10-25 17:30:18 +00:00
Takanori Watanabe
1de5ce99e3 Fix variable name to be clear what it means. 2007-10-25 17:03:07 +00:00
Takanori Watanabe
0bfeaded17 Turn EC into poll mode before device_resume invoked . 2007-10-25 16:49:07 +00:00
Marius Strobl
33d3fffa90 Add ABI backwards compatibility to the FreeBSD 4/5/6 versions of
the PCIOCGETCONF, PCIOCREAD and PCIOCWRITE IOCTLs, which was broken
with the introduction of PCI domain support.
As the size of struct pci_conf_io wasn't changed with that commit,
this unfortunately requires the ABI of PCIOCGETCONF to be broken
again in order to be able to provide backwards compatibility to
the old version of that IOCTL.

Requested by:	imp
Discussed with:	re (kensmith)
Reviewed by:	PCI maintainers (imp, jhb)
MFC after:	5 days
2007-10-24 20:51:44 +00:00
Kevin Lo
e3e2d9bf7c - Use pci_enable_busmaster() to turn on busmaster.
- Don't test memory/port status and emit an error message; the PCI bus
  will do this.

Reviewed by: sam
2007-10-23 04:25:43 +00:00
Alexander Motin
11bfc2922d Add one of HTC Smartphone/PocketPC device IDs.
Tested with Qtek S200 (HTC Prophet).
2007-10-22 08:28:24 +00:00
Julian Elischer
e1ff3d508a fix up some code for older systems changed by accident in the last commit
this whole support for systems earlier than 5.0 should probably be removed
but I'll at least FIX it before removing it, so that CVS has it right.
2007-10-21 04:11:13 +00:00
Julian Elischer
3745c395ec Rename the kthread_xxx (e.g. kthread_create()) calls
to kproc_xxx as they actually make whole processes.
Thos makes way for us to add REAL kthread_create() and friends
that actually make theads. it turns out that most of these
calls actually end up being moved back to the thread version
when it's added. but we need to make this cosmetic change first.

I'd LOVE to do this rename in 7.0  so that we can eventually MFC the
new kthread_xxx() calls.
2007-10-20 23:23:23 +00:00
Sam Leffler
df8a38f46a fix an incorrect setting of `retry times' in case of zd1211b, we
should set the ZYD_MACB_MAX_RETRY register instead of ZYD_MAC_RETRY

Submitted by:	Weongyo Jeong
MFC after:	1 week
2007-10-19 16:33:31 +00:00
Ariff Abdullah
fd0a47907c - Gigabyte G33-S2H fixup, due to the present of multiple competing
codecs. Codec at address 0 seems purely digital, or perhaps an HDMI
  interface. Let the driver skip it and continue scanning the codecs
  starting with address 2 (Realtek ALC885).
  * Due to possibilities of future similar cases, put enough logic
    in hdac_scan_codecs() to force codec scanning starting from
    XX address via tunable "hint.pcm.%d.codec_index".

  Reported / Tested by:	Toomas Pelberg <toomasp@gmx.net>

- Trivial headphone / speaker automute fixup for Fujitsu-Siemens
  AMILO Si 1848 laptop.

  Reported / Tested by:	Ed <ed@bsd.it>

- Trivial headphone / speaker automute fixup for Fujitsu-Siemens
  Lifebook S7020D laptop.

  Reported / Tested by: Jaromir Dvoracek <jarek@ataxo.com>

- Some smart vendor trying to create interplanetary wormhole by
  screwing pci config space during their BIOS update. The side effects
  of their failure attempt includes mutilated hardware id, broken
  speaker automuting and loosing the entire analog CD connectivity,
  thus causing enough collateral damages to collapse the entire
  universe.  Move along with it.

  Please exercise extra cautious when applying BIOS updates.

  Reported / Tested by:	Pietro Cerutti <gahr@gahr.ch>
                       	- assembled laptop, based on the MSI-1034
                          (662) which is now becoming MSI-034A.

- Fix no sound issues (on headphones) for Lenovo ThinkCentre A55 due
  to global automute table entry which is not applicable for
  non-laptops.

  Reported / Tested by:	Piotr Smyrak <piotr.smyrak@heron.pl>

- Speaker mute control for HP DC7700 since the front headphone jack
  does not generate any interesting unsolicited signal/response.

  Reported / Tested by:	tyop @ irc.freenode.net

Approved by:	re (kensmith)
MFC after:	3 days
2007-10-19 15:49:39 +00:00
Takanori Watanabe
02c788a24e Add Winchiphead (or Nanjin QinHeng Electronics) USB Serial converter driver.
I tested it on cheap serial converter.(Only costs 980JPY.)
2007-10-18 10:51:06 +00:00