Commit Graph

14349 Commits

Author SHA1 Message Date
Søren Schmidt
e2bf77c5c2 Get rid of the advertising clause in the copyright. 2006-01-05 21:27:19 +00:00
Jean-Sébastien Pédron
dcde7cd573 Fix a bug in Synaptics Touchapd support where psm(4) will enter an infinite
loop if it receives an out of sync packet.

Reviewed by:	mux (mentor)
MFC after:	4 days
2006-01-05 19:24:01 +00:00
Warner Losh
2b6fb51f02 Check for 10BaseT media correctly. Before we were confusing
ifm_status and ifm_active.  IFM_10_T gets set in the ifm_active field,
not in the ifm_status field, as far as I can tell.

Note: this was to enable a workaround that's rarely enabled.  I don't know
how to corrupt my eeprom to test it, and would rather not know...
2006-01-04 23:00:01 +00:00
Søren Schmidt
49824061be Return the proper rmi field in DVDIOCREADSTRUCTURE.
PR:	89650
2006-01-04 21:35:57 +00:00
Ariff Abdullah
1333b4a431 Fix broken capabilities, causing failure during channel reset.
Its min/max speed were off by -/+ 1000.

Reported by:	[1] Ion-Mihai Tetcu <itetcu@people.tecnik93.com>
            	[2] barner
MFC after:	1 day

[1] http://lists.freebsd.org/mailman/htdig/freebsd-multimedia/2005-December/003189.html
[2] http://lists.freebsd.org/mailman/htdig/freebsd-multimedia/2006-January/003422.html
2006-01-04 15:35:55 +00:00
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
Søren Schmidt
796bd93e5e Further updates to the Marvell support code.
Should be reliable enough for actual use by now.
2005-12-28 11:55:43 +00:00
Gleb Smirnoff
086745614c When in rev. 1.47 cardbus_alloc_resources() function was moved from
cardbus_cis.c to this file, some code was not merged and thus resource
list entries were invalid. They didn't have a resources attached to
them.
  However, the problem was masked for some time later, because newer
resources list entries were added to the head of the list, and
resource_list_find() always returned the first matching resource list
entry. Usually the underlying driver allocated a valid resource and
added it to the head of the list, and invalid one wasn't used.
  In rev. 1.174 of subr_bus.c the sorting of resource list entries was
reversed demasking the problem in cardbus_alloc_resources().
  This commit fixes the problem returning back some code from
cardbus_cis.c, pre-1.49 revisions.

PR:			kern/87114
PR:			kern/90441
Hardware provided by:	Vasily Olekhov <olekhov yandex.ru>
Reviewed by:		imp
2005-12-28 10:15:01 +00:00
Gleb Smirnoff
6bbdde89f5 A style nit. 2005-12-28 09:37:04 +00:00
Gleb Smirnoff
dd157f8102 Tidy up em_resume():
- Don't call em_init_locked() twice.
  - Collapse two if() blocks into one.
2005-12-28 08:58:28 +00:00
Scott Long
557e53c6f7 Cache the tx producer index instead of reading it every time ti_start is
called.
2005-12-28 08:36:32 +00:00
Scott Long
3c41ebd1f8 Fix a serious regression from the busdma conversion. Check to make sure
that we don't overrun the tx descriptor ring before actually trying to
overrun it.
2005-12-28 08:14:35 +00:00
Warner Losh
df2f828a8f Add some sanity checking to the pccard insertion case. Whine if the
bridge tries to tell us about a new card when we have one already in
the socket.
2005-12-28 05:30:09 +00:00
Pyun YongHyeon
d54c905707 Bring big-endian architecture support for ti(4).
. remove unnecessay header files after Scott's bus_dma(9) commit.
 . remove global variable tis which was introduced at the time of
   zero_copy(9) changes. The variable tis was not used at all. The
   same applyes to ti_links in softc so axe it.
 . deregister variables.
 . axe ti_vhandle and switch to use explicit register access for
   accessing NIC local memory. Creates three variants of ti_mem to
   read/write NIC local memory(ti_mem_read, ti_mem_write) and clearing
   NIC local memory(ti_mem_zero). This greatly enhances code
   readability and have ti(4) drop using shared memory scheme for
   Tigon 1. As Tigon 1 switched to use explicit register access for Tx,
   axe ti_tx_ring_nic/ti_cmd_ring in softc.(Tigon 2 used to host ring
   scheme which means there is no need to access NIC local memory via
   register access for Tx and NIC would DMA the modified Tx rings into
   its local memory.) [1]
 . introduce new macro TI_EVENT_*/TI_CMD_* to handle NIC envent/command.
   Instead of using bit fields assginment for accessing the event, use
   shift operations to set/get it. [1]
 . add additional check for valid DMA tags in ti_free_dmamaps().
 . add missing bus_dmamap_sync/bus_dmamap_unload in ti_free_*_ring_*.
 . fix locking nits(MTX_RECURSE mutex) and make ti(4) MPSAFE.
 . change data type of ti_rdata_phys to bus_addr_t and don't blindly
   cast to uint32_t.
 . rearrange detach path and make ti(4) survive during device detach.
 . for Tigon 1, use explicit register access for checking Tx descriptors
   in ti_encap()/ti_txeof(). [1]
 . properly call bus_dmamap_sync(9) for updating statistics.
 . remove extra semicolon in ti_encap()
 . rewrite loading MAC address to work on strict-alignment architectures.
 . move TI_RD_OFF macro to if_tireg.h
 . axe ETHER_ALIGN as it's already defined in <net/ethernet.h>.
 . make macros immuine from expansion by adding parenthesis and do-while.
 . remove alpha specific hack as vtophys(9) is no longer used in ti(4)
   after Scott's bus_dma(9) fix.

Reviewed by:	scottl
Obtained from:	OpenBSD [1]
2005-12-28 02:57:19 +00:00
Florent Thoumie
333051eeb3 Add a hid blacklist quirk.
PR:		usb/80383
Submitted by:	Lonnie Mendez <lmendez19@austin.rr.com>
Tested by:	Adam Kropelin <akropel1@rochester.rr.com>, thierry, fenner
Approved by:	pjd
MFC after:	1 week
2005-12-27 23:35:38 +00:00
Warner Losh
0e6e3c1384 Ensure that we're aligned at leas tto the size of the resource being requested.
When cbb_debug is on, print the windows that we're mapping.
2005-12-27 19:18:11 +00:00
Warner Losh
0780312f3d nits 2005-12-27 18:55:21 +00:00
Søren Schmidt
7af3abd894 Change the probes in ATA to return a negative value on success.
This allows other driver to take over if needed during probe, and allows
me to distribute new drivers as modules.
2005-12-27 18:22:11 +00:00
Søren Schmidt
091bb42ceb Update the last commit to also take 48Bit access functions. 2005-12-27 17:13:11 +00:00
Søren Schmidt
4b55f0c7c7 Add initial support for the Marvell 88SX[56]0[48][01] series of SATA chips.
Hardware donated by: Matthew Jacob
Hardware donated by: Y!
2005-12-27 17:09:52 +00:00
Søren Schmidt
8ec96d7b8d Fix rebuilds of arrays that got stuck.
Misc minor fixes.

Bughunting and initial fixes by Pav@ and Anton.
2005-12-27 16:49:33 +00:00
Joseph Koshy
ba8ae2de36 - Plug a memory leak: free up per-cpu sample buffers at module unload time.
- Correct a few style nits.
2005-12-26 16:10:00 +00:00
Gleb Smirnoff
0b6169c0fa Add simple suspend and resume methods. We call em_stop() on suspend and
em_init() on resume. With this change the network is ready right after
resume, without half minute lag.

Tested by:	Jacques Garrigue
2005-12-26 10:39:21 +00:00
Joseph Koshy
06490ba975 Wrap comment lines to be under 80 characters wide.
MFC after:	3 days
2005-12-26 09:27:24 +00:00
Ariff Abdullah
88a50509af Add suspend and resume support. 2005-12-25 00:43:03 +00:00
Tom Rhodes
09c00166e4 Make tv_sec a time_t on all platforms but alpha. Brings us more in line with
POSIX.  This also makes the struct correct we ever implement an i386-time64
architecture.  Not that we need too.

Reviewed by:	imp, brooks
Approved by:	njl (acpica), des (no objects, touches procfs)
Tested with:	make universe
2005-12-24 22:22:17 +00:00
Pyun YongHyeon
fe806fda54 Use device_printf() and if_printf() rather than printf() and axe
bge_unit from the softc.

Requested by:	marius
2005-12-23 02:04:41 +00:00
John Baldwin
be7ccc4ba3 Return BUS_PROBE_GENERIC rather than 0 in the probe routine.
Requested by:	marius
2005-12-22 16:25:22 +00:00
John Baldwin
2a3d3a660b Use the copy of the card's MAC address saved in tulip_enaddr() in the softc
if we need a valid MAC address (for probing the media for example) before
ether_ifattach() has been called since IF_LLADDR() is NULL then.

Tested by:	tisco
2005-12-22 16:18:23 +00:00
Gleb Smirnoff
d375e52490 - All bge(4) supported hardware is known to support RX/TX checksum offloading,
except for BGE_CHIPID_BCM5700_B0, which is buggy.
- All bge(4) supported hardware, has a bug that produces incorrect checksums
  on Ethernet runts. However, in case of a transmitted packet, the latter can
  be padded with zeroes, and the checksum would be correct. (Probably chip
  includes the pad data into checksum). In case of receive, we just don't
  trust checksum data in received runts.

Obtained from:	NetBSD (jonathan) via Mihail Balikov
2005-12-22 15:14:42 +00:00
Gleb Smirnoff
0014abfcc4 Add a quirk to fix resume on some laptops.
Reported by:	joe
Reported by:	Huang wen hui <huang gddsn.org.cn>
Reported by:	Jacques Garrigue <garrigue math.nagoya-u.ac.jp>
PR:		kern/89825
2005-12-22 09:09:39 +00:00
Pyun YongHyeon
f6789fba46 Fix bge_eeprom_getbyte() to return 1 when timeout happens.
Previously it always returned 0 which means success regardless of
EEPROM status.

While here, add a check whether EEPROM read is successful.

Submitted by:   jkim
2005-12-22 02:03:57 +00:00
Pyun YongHyeon
e65bed95af Add bge(4) support for big-endian architectures(part 2/2).
- removed unused funtion bge_handle_events().
 - removed bus_dmamap_destroy(9) calls for DMA maps created by
   bus_dmamem_alloc(9). This should fix panics seen on sparc64
   in device detach.
 - added check for parent DMA tag creation.
 - switched to use __NO_STRICT_ALIGNMENT as bge(4) supports all
   architectures.
 - added missing bus_dmamap_sync(9) in bge_txeof().
 - added missing bus_dmamap_sync(9) in bge_encap().
 - corrected memory synchronization operation on status block.
   As the driver just read status block that was DMAed by NIC it
   should use BUS_DMASYNC_POSTREAD. Likewise the driver does not
   need to write status block back, so remove unnecessary
   bus_dmamap_sync(9) calls in bge_intr().
 - corrected memory synchronization operation on RX return ring.
   The driver only read the block so remove unnecessary
   bus_dmamap_sync(9) in bge_rxeof().
 - force bus_dmamap_sync(9) for only modified descriptors. Blindly
   synching all desciptor rings would reduce performance.
 - call bus_dmamap_sync(9) for DMA maps that were modified in bge_rxeof().

Reviewed by:	jkim(initial version)
Tested by:	glebius(i386), jkim(amd64 initial version)
2005-12-22 01:44:27 +00:00
Ruslan Ermilov
4d5f30e06e Drivers for AMD-8111 and NVIDIA nForce2/3/4 SMBus 2.0 controllers. 2005-12-21 15:49:51 +00:00
John Baldwin
87f34c405b Use ETHER_ADDR_LEN rather than hardcoding 6. 2005-12-21 15:15:43 +00:00
Ruslan Ermilov
f5fd56117e Add missing MODULE_DEPEND() so that ppbus.ko and these .ko's can be
loaded dynamically.
2005-12-21 10:54:47 +00:00
Sam Leffler
1528156d71 bandaid assumption that char is signed
MFC after:	1 week
2005-12-21 00:09:11 +00:00
Pav Lucistnik
612477f7ac - Fix type in previous commit; unbreak build
Approved by:	ssouhlal
Pointy hat to:	pav
2005-12-20 23:07:38 +00:00
John Baldwin
33181681c7 - Use PCIR_BAR() macro for the BAR for the aperture.
- Axe macros used for walking PCI capabilities list.  We now ask the PCI
  bus to find caps for us rather than doing it in the drm and agp drivers.
2005-12-20 22:45:24 +00:00
John Baldwin
e9aa66d283 - Bump FreeBSD version for the hostb(4) and vgapci(4) drivers as well as
the addition of pci_find_extcap().
- Change the drm drivers to attach to vgapci.  This is #ifdef'd so the
  code can be shared across branches.
- Use pci_find_extcap() to look for AGP and PCIE capabilities in drm.
- GC all the drmsub stuff for i810/i830/i915.  The agp and drm devices are
  now both children of vgapci.
2005-12-20 22:44:36 +00:00
John Baldwin
a1ee13ef19 Attach to the vgapci device rather than pci. 2005-12-20 22:42:16 +00:00
John Baldwin
8e8e46ccfc Add a vgapci(4) stub device driver for VGA PCI devices. This device serves
as a bus so that other drivers such as drm(4), acpi_video(4), and agp(4)
can attach to it thus allowing multiple drivers for the same device.  It
also removes the need for the drmsub hack for the i8[13]0/i915 drm and agp
drivers.
2005-12-20 22:41:33 +00:00
Paul Saab
efbbe8fa79 Remove GIANT from device random.
Submitted by:	ups
2005-12-20 21:41:52 +00:00
John Baldwin
c626f1fe9a Change the various AGP drivers that attach to the Host-PCI bridge device to
attach to the hostb driver instead.  This means that agp can now be loaded
at runtime (in theory at least).  Also, the drivers no longer have to
explicity call device_verbose() to cancel out any earlier calls to
device_quiet() by the hostb(4) driver (this shows a limitation in new-bus,
drivers really shouldn't be doing device_quiet() until they know they are
going to drive that device, i.e. in attach).
2005-12-20 21:12:26 +00:00
John Baldwin
5b2119223e Move the hostb driver out of the i386 and amd64 PCI code (where it was
duplicated anyways) and into a single MI driver.  Extend the driver a bit
to implement the bus and PCI kobj interfaces such that other drivers can
attach to it and transparently act as if their parent device is the PCI
bus (for the most part).
2005-12-20 21:09:45 +00:00
Ruslan Ermilov
9a77af905e Create "smb" device when "smbus" device is attached, so that it's
possible to load/unload smb.ko and smbus-implementing driver in
any order, and get expected results.
2005-12-20 21:06:57 +00:00
John Baldwin
c8d81a41f4 Change the agp_find_device() to return the first agp device that has been
attached to a driver rather than always returning agp0.
2005-12-20 21:06:43 +00:00
John Baldwin
5bcf484019 Don't map the AGP aperture into contiguous KVA. The various graphics
drivers already map sections into KVA as needed anyway.  Note that this
will probably break the nvidia driver, but I will coordinate to get that
fixed.

MFC after:	2 weeks
2005-12-20 20:05:21 +00:00
John Baldwin
4c2546c1a9 Destroy the /dev device before destroying the mutex or releasing resources
rather than afterwards.

MFC after:	1 week
2005-12-20 20:03:16 +00:00
John Baldwin
04d6a912e4 Use pci_find_extcap() to search for AGP capabilities (PCIY_AGP). 2005-12-20 19:58:28 +00:00
John Baldwin
4f9795b9fe Add a new method PCI_FIND_EXTCAP() to the pci bus interface that is used
to search for a specific extended capability.  If the specified capability
is found for the given device, then the function returns success and
optionally returns the offset of that capability.  If the capability is
not found, the function returns an error.
2005-12-20 19:57:47 +00:00