Commit Graph

14294 Commits

Author SHA1 Message Date
Søren Schmidt
93b2c0cf02 Fix the promise modesetting for old chips.
Pointy hat to:	sos
2006-01-04 10:23:47 +00:00
Poul-Henning Kamp
8a7f77816e Use ttyalloc() instead of ttymalloc() 2006-01-04 09:20:41 +00:00
Poul-Henning Kamp
4c29738452 Use ttyalloc() instead of ttymalloc() 2006-01-04 08:34:23 +00:00
Søren Schmidt
8a07d88d9f Fix promise probe printing. 2006-01-04 08:20:25 +00:00
Scott Long
8a436e7554 Shuffle some definitions so that this can be included from userland. 2006-01-03 23:03:39 +00:00
Scott Long
df67b5c133 Add some more data structures and definitions for communicating with the
ServeRAID firmware.
2006-01-03 23:03:15 +00:00
John Baldwin
8294689115 Release the pci_link acpi serial lock if a link device has no actual links.
MFC after:	3 days
2006-01-03 20:19:34 +00:00
Brian Somers
0d10741255 This signal handling code is worse than a no-op. If a
signal is received during the msleep, the msleep is retried
indefinitely as it just keeps returning ERESTART because of
the pending signal.

Instead, just don't PCATCH - the signal can wait.

Sponsored by:	Sophos/ActiveState
2006-01-03 17:01:43 +00:00
Pyun YongHyeon
ff3ced1270 - Tx side bus_dmamap_load_mbuf_sg(9) support. This reduces bookkeeping
requiried to keep consistent softc state before/after callback function
  invocation and supposed to be sligntly faster than previous one as it
  wouldn't incur callback overhead. With this change callback function
  was gone.
- Decrease TI_MAXTXSEGS to 32 from 128. It seems that most mbuf chain
  length is less than 32 and it would be re-packed with m_defrag(9) if
  its chain length is larger than TI_MAXTXSEGS. This would protect ti(4)
  against possible kernel stack overflow when txsegs[] is put on stack.
  Alternatively, we can embed the txsegs[] into softc. However, that
  would waste memory and make Tx/Rx speration hard when we want to
  sperate Tx/Rx handlers to optimize locking.
- Fix dma map tracking used in Tx path. Previously it used the dma map
  of the last mbuf chain in ti_txeof() which was incorrect as ti(4)
  used dma map of the first mbuf chain when it loads a mbuf chain with
  bus_dmamap_load_mbuf(9). Correct the bug by introducing queues that
  keep track of active/inactive dma maps/mbuf chain.
- Use ti_txcnt to check whether driver need to set watchdog timer instead
  of blidnly clearing the timer in ti_txeof().
- Remove the 3rd arg. of ti_encap(). Since ti(4) now caches the last
  descriptor index(ti_tx_saved_prodidx) used in Tx there is no need to
  pass it as a fuction arg.
- Change data type of producer/consumer index to int from u_int16_t in
  order to remove implicit type conversions in Tx/Rx handlers.
- Check interface queue before getting a mbuf chain to reduce locking
  overhead.
- Check number of available Tx descriptores to be 16 or higher in
  ti_start(). This wouldn't protect Tx descriptor shortage but it would
  reduce number of bus_dmamap_unload(9) calls in ti_encap() when we are
  about to running out of Tx descriptors.
- Command NIC to send packets ony when the driver really has packets
  enqueued. Previously it always set TI_MB_SENDPROD_IDX which would
  command NIC to DMA Tx descriptors into NIC local memory regardless
  of Tx descriptor changes.

Reviewed by:	scottl
2006-01-03 06:14:07 +00:00
Warner Losh
bee89c7386 Use the child to allocate the resource rather than bridge, since we're
allocating a resource that's in the card itself.

Remove more now-redundant resource_list_add, and now-redunant code
that lives in the pci layer.

# This fixes the atheros card that I have which had its CIS in one of
# the BARs.  Don't know yet if this fixes the amd64 issues reported.
2006-01-03 03:36:17 +00:00
Warner Losh
c732cf3b2c Minor style(9) hacking, plus use a macro in place of (struct resource *)~0UL
(what the heck does that mean?).
2006-01-03 03:16:53 +00:00
Warner Losh
a48895a77e Use __HAVE_ACPI and __PCI_REROUTE_INTERRUPT as appropriate rather than
the complicated #ifdefs.
2006-01-01 21:04:31 +00:00
Warner Losh
70261a611f Remove left-over #ifdef alpha routines. They aren't used by any of
our drivers, and don't appear to be necessary for GENERIC and LINT on
the alpha.  They don't belong in a MI header anyway...
2006-01-01 20:40:08 +00:00
Ariff Abdullah
cc6882e1a4 Fix another xruns counting logic, this time, for recording. 2006-01-01 18:16:13 +00:00
Warner Losh
98b7810732 Remove stray debug from p4 integration. 2006-01-01 08:26:39 +00:00
Warner Losh
ef8984f5dc Remove extra debugging that crept in with the integration from p4. 2005-12-31 20:04:39 +00:00
Maxime Henrion
bc184556bf Add a new vendor ID for Personal Cummunication Systems. They make a nice
USB HID device that allows to plug two PS2 controllers.  This specific
device doesn't work yet but will as soon as we support devices with
multiple report IDs.

MFC after:	3 days
2005-12-31 04:41:17 +00:00
Maxime Henrion
092dbdfb4c Add support for the Wacom Graphire 3 4x5. Like the Graphire 3, it has a
broken report descriptor.  While I'm here, make all the other report
descriptors const to match the newly added one.

Obtained from:	NetBSD
MFC after:	1 week
2005-12-31 04:38:50 +00:00
Maxime Henrion
0cb0bc8808 Add support for Xbox 360 gamepads. They are HID-capable devices, but
lack a report descriptor and don't use the standard interface class.
This patch works around these deficiencies so that the uhid(4) driver
can recognize and use those broken devices.

PR:		usb/90141
Submitted by:	Ed Schouten <ed@fxq.nl> (with minor mods from me)
MFC after:	1 week
2005-12-31 04:22:34 +00:00
Ariff Abdullah
c3ebbcbdf8 Fix LOR #174.
Tested with:	WITNESS, INVARIANTS and DIAGNOSTICS
2005-12-31 01:58:40 +00:00
Tai-hwa Liang
93d9fd1136 Fixing build bustage. 2005-12-31 01:45:40 +00:00
Søren Schmidt
d028250086 Add hotplug support for Marvell chips. 2005-12-30 23:15:02 +00:00
Warner Losh
8d10dd1a82 Make RID2BAR actually return a number that can be plugged into PCIR_BAR()
rather than a bitmask.

Submitted by: ru@
2005-12-30 20:25:40 +00:00
Warner Losh
388395ccaa Remove now-obsolete printf warning. 2005-12-30 19:38:47 +00:00
Warner Losh
0c4246bd98 Remove debug now that I've looped back the big changes into my p4 tree. 2005-12-30 19:36:29 +00:00
Warner Losh
a9883bc8c4 Expose pci_add_resources to the outside world, add a 'force' flag to
force allocation of unallocated BARs (cardbus uses this to preallocate
everything).  Add a prefetchmask to allow for busses that get prefetch
hints to set them.  Addjust pci_add_map and pci_ata_maps to take a new
force flag which pci_add_resources will pass in.  Implement 'force' in
pci_add_map.  Write new value of allocated resource into the bar, if
the allocation succeeded (we should have done this before, but with
the new force the bug was very obvious).
2005-12-30 19:28:26 +00:00
Warner Losh
ef5cc9accd Move all of the resource allocation into the pci layer. The resource
allocation here just duplicated it (badly).
2005-12-30 19:25:04 +00:00
Warner Losh
f3d3468db3 The RID2BAR macro returns a number, not a bitmask. Fix this.
Spotted by: ru, jhb
2005-12-30 19:23:32 +00:00
Gleb Smirnoff
6afb2250fb - Retire BARBIT in favor of new PCI_RID2BAR.
- Fix build.
2005-12-30 11:31:47 +00:00
Ariff Abdullah
f935ac6015 Disable frantic DMA update within few SNDCTL_DSP_* ioctl.
This should reduce huge playback / recording latency for
applications that try to act smarter and manage their own
buffering (XMMS, Skype, etc.).

Note to Skype + via8xxx users: Remove previous hackish
"hint.pcm.<unit>.via_dxs_disabled" from kernel hint and see
whether this changes cure all those annoying sound issues.
2005-12-30 07:33:28 +00:00
Ariff Abdullah
764907327e Underruns counting logic should be based on bufhard free space
and must be done after sndbuf_feed(), or any attempt to fill
up bufhard. This should fix false underruns counter.
2005-12-30 07:33:01 +00:00
Warner Losh
3fc2d9dbe5 Add a bunch of ipod entries, one as suggested by Bryan Liesner. We
should likely fix this better...

Submitted by: Bryan Liesner (ipod mini)
2005-12-30 05:06:26 +00:00
Ariff Abdullah
eaf700837f Few codec such as Conexant CX20468-21 does have this control
register, although the only usable part is the mute bit.

Noticed by:	Hans Petter Selasky <hselasky@c2i.net>
2005-12-30 01:06:29 +00:00
Warner Losh
3cd242d123 Retire BARBIT in favor of new PCI_RID2BAR. 2005-12-29 23:41:29 +00:00
Warner Losh
b60c6f4683 Add a macro to map from BAR to rid # (inverse of PCIR_BARS). 2005-12-29 23:40:41 +00:00
Warner Losh
3ac604874c Simplify the opening of the resources for cardbus cards. Before we'd
try very hard to be perfect.  However, these attempts broke down when
there were large numbers of resources.  We'd not be able to map them all.

Instead, accept that we might pass more range to thse subbus than
might be optimal be able to compute.  However, there's little harm in
this and it allows us to pass greater resources through.

# it has been suggested that we allocate a fixed amount of resources
# on attach and give it out upon request.  This might not be a bad idea...
2005-12-29 23:38:45 +00:00
Alexander Leidinger
e5f62bf901 Sync the type (and size, compare mousestatus_t in /usr/include/sys/mouse.h)
of a variable according to the usage (after increasing the number of max
buttons this may matter).

Noticed by:	flz
2005-12-29 18:35:28 +00:00
Alexander Leidinger
d677792c20 Add support for the HP 8200C/8250C/8290C scanners.
PR:		90467
Submitted by:	Adam McDougall <mcdouga9@egr.msu.edu>
2005-12-29 18:25:25 +00:00
Alexander Leidinger
1b4c44fb4c Add support for the Canon CanoSvan LIDE 25.
PR:		89509
Submitted by:	David Gilbert <dgilbert@daveg.ca>
2005-12-29 18:15:03 +00:00
Alexander Leidinger
293b843c5e Fix some kind of "off by one"-error: the min or max sample rate the
device is able to reproduce should be usable too instead of failing
in such a case.

PR:		89269
Submitted by:	Don L. Belcher <don@siad.net>
2005-12-29 18:11:11 +00:00
Alexander Leidinger
70422404a7 Merge NetBSD rev. 1.61:
- Support more than 7 buttons for USB mice. Patch from NetBSD kern/30248.

PR:		83353
Submitted by:	Seán Farley <sean-freebsd@farley.org>
2005-12-29 17:44:40 +00:00
Alexander Leidinger
247eac7f18 Add support for Epson 2480 scanner.
PR:		86094
Submitted by:	Erik Norgaard <norgaard@locolomo.org>
2005-12-29 17:38:03 +00:00
Alexander Leidinger
1ea136a1ca Emit USB_EVENT_DRIVER_DETACH on detach.
PR:		83247
Submitted by:	Sangwoo Shim <ssw@neo.redjade.org>
MFC after:	2 weeks
2005-12-29 17:29:18 +00:00
Gleb Smirnoff
408b85a1e2 Help Warner with merge from p4. 2005-12-29 10:38:42 +00:00
Warner Losh
47147ce799 Implement /dev/cardbus%d.cis, same thing as /dev/pccard%d.cis. There
are some rough edges with this still, but it seems to work well enough
to commit.
2005-12-29 01:43:47 +00:00
Scott Long
065dd78ccf Initialize the event tailq.
Submitted by: Frank Mayhar
PR: kern/90882
MFC After: 1 day
2005-12-28 21:18:55 +00:00
Gleb Smirnoff
5108cc565a Add missing parens.
Submitted by:	njl
2005-12-28 18:00:37 +00:00
Alexander Leidinger
9190333ce7 Fix the order of the stereo channels (left <-> right).
From the PR:
---snip---
 I think I have found the change which reversed the channels.
 Revision 1.44 of emu10k1.c, which added Audigy support, has the line

 emu_wrptr(sc, v->vnum, FXRT, 0xd01c0000);

 replaced with the following lines:

 if (sc->audigy) {
         emu_wrptr(sc, v->vnum, A_FXRT1, v->fxrt1);
         emu_wrptr(sc, v->vnum, A_FXRT2, v->fxrt2);
         emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, 0);
 }
 else
         emu_wrptr(sc, v->vnum, FXRT, v->fxrt1 << 16);

 where v->fxrt1 << 16 == 0xd10c0000

 I don't have Audigy, so I'm not sure if the problem affects Audigy cards
 too. The order of the channels can't be tested by just altering mixer
 settings. Here's a small program to test if the channels are reversed on
 your sound card:

 #include <sys/soundcard.h>
 #include <fcntl.h>
 #include <unistd.h>

 int main(int argc, char **argv)
 {
 	int fd = open("/dev/dsp", O_WRONLY), format = AFMT_S16_LE;
   int channels = 2, rate = 22050, i;

   /* 450 Hz sine wave on left channel, right channel silent */
   unsigned char samples[] = {0, 0, 0, 0, 94, 16, 0, 0, 120, 32, 0, 0,
     9, 48, 0, 0, 208, 62, 0, 0, 143, 76, 0, 0, 12, 89, 0, 0, 19, 100,
     0, 0, 117, 109, 0, 0, 11, 117, 0, 0, 182, 122, 0, 0, 92, 126, 0,
     0, 239, 127, 0, 0, 105, 127, 0, 0, 202, 124, 0, 0, 32, 120, 0, 0,
     124, 113, 0, 0, 251, 104, 0, 0, 193, 94, 0, 0, 249, 82, 0, 0,
     212, 69, 0, 0, 138, 55, 0, 0, 85, 40, 0, 0, 120, 24, 0, 0, 51, 8,
     0, 0, 205, 247, 0, 0, 136, 231, 0, 0, 171, 215, 0, 0, 118, 200,
     0, 0, 44, 186, 0, 0, 7, 173, 0, 0, 63, 161, 0, 0, 5, 151, 0, 0,
     132, 142, 0, 0, 224, 135, 0, 0, 54, 131, 0, 0, 151, 128, 0, 0,
     17, 128, 0, 0, 164, 129, 0, 0, 74, 133, 0, 0, 245, 138, 0, 0,
     139, 146, 0, 0, 237, 155, 0, 0, 244, 166, 0, 0, 113, 179, 0, 0,
     48, 193, 0, 0, 247, 207, 0, 0, 136, 223, 0, 0, 162, 239, 0, 0};

   ioctl(fd, SNDCTL_DSP_SETFMT,&format);
   ioctl(fd, SNDCTL_DSP_CHANNELS,&channels);
   ioctl(fd, SNDCTL_DSP_SPEED,&rate);

   for(i=0;i<500;i++)
     write(fd, &samples, sizeof(samples));
   write(fd, &samples, 2); /* swap channels */
   for(i=0;i<500;i++)
     write(fd, &samples, sizeof(samples));

   return 0;
 }

 You should hear a sound on the left channel followed by a sound on the
 right channel. If you hear a sound on the right channel first, the
 channels are reversed.
---snip---

Owners of an audigy card should verify if it DTRT and report back.

Noticed by:	Matthias Buelow <mkb@mukappabeta.de>
Submitted by:	Juha-Matti Tilli <juhis@nallukka.net>
PR:		72221
2005-12-28 17:57:36 +00:00
Maxim Konovalov
6c3cd0e2f6 o Fix typos in the comments.
Submitted by:	Wojciech A. Koszek
2005-12-28 15:18:18 +00:00
Gleb Smirnoff
7ed2454cb3 Check for IFF_DRV_RUNNING in the interrupt loop.
Reported & tested by:	Martin P. Hansen <mph lima.dyndns.dk>
2005-12-28 13:21:05 +00:00