Commit graph

56968 commits

Author SHA1 Message Date
Gleb Smirnoff 408b85a1e2 Help Warner with merge from p4. 2005-12-29 10:38:42 +00:00
Andrew Thompson a47f91cdc4 When pfil(9) is enabled the bridge only considers ETHERTYPE_ARP, ETHERTYPE_IP and
ETHERTYPE_IPV6 frames. Change this to be a sysctl knob so that is able to still
bridge non-IP packets if desired.

Also return early if all pfil_* sysctls are turned off, the user obviously does
not want to filter on the bridge.
2005-12-29 09:39:15 +00:00
Peter Grehan 590ccf8c74 Add user-space profiling support. Kernel profiling still todo.
Obtained from:	NetBSD
2005-12-29 04:07:36 +00:00
Joseph Koshy ad3869b48e Refer readers to the hwpmc(4) manual page where the additional
(architecture specific) kernel configuration options needed for
hwpmc are documented.

PR:		kern/83738
MFC after:	3 days
2005-12-29 02:12:54 +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
Alexander Kabaev 3f34977614 Trim trailing whitespace. 2005-12-28 17:13:31 +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
Gleb Smirnoff 747cdba40e In ng_netflow_disconnect() check whether we are working with "iface"
or with "out" hook, and clear the right pointer.

Reported by:	Vitaliy Ovsyannikov <V.Ovsyannikov kr.ru>
2005-12-28 12:56:59 +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
Xin LI fc9fac4c78 Correct a typo 2005-12-28 10:03:48 +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
Tom Rhodes 0e36e11d57 Cast tv_sec to intmax_t and print with %jd in some ifdef'ed code. 2005-12-28 07:08:54 +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 1bd8f78656 Uncomment ti(4) as it's now working. 2005-12-28 02:59:16 +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
Pawel Jakub Dawidek 619f284195 In realloc(9), determine size of the original block based on
UMA_SLAB_MALLOC flag.
In some circumstances (I observed it when I was doing a lot of reallocs)
UMA_SLAB_MALLOC can be set even if us_keg != NULL.

If this is the case we have wonderful, silent data corruption, because less
data is copied to the newly allocated region than should be.

I'm not sure when this bug was introduced, it could be there undetected
for years now, as we don't have a lot of realloc(9) consumers and it was
hard to reproduce it...
...but what I know for sure, is that I don't want to know who introduce
the bug:) It took me two/three days to track it down (of course most of
the time I was looking for the bug in my own code).
2005-12-28 01:53:13 +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
Pawel Jakub Dawidek 70665fda32 Fix watch address truncation. The address was truncated when it was passed to
amd64_set_watch() as 'unsigned int' and 'unsigned int' is 32bit long on amd64.

Even with that fix hardware watchpoint don't work for me on amd64, ie. when
I set the watchpoint and write a byte there, nothing happens.
2005-12-27 23:23:47 +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
Stefan Farfeleder c14284a637 Try to unbreak the tinderbox: Cast a time_t argument to long before printing
it with %ld.
2005-12-27 12:33:18 +00:00
David Xu 9f8eb3cb52 Use variable i instead of variable cpus as an index to get correct kseq. 2005-12-27 12:02:03 +00:00
Gleb Smirnoff 3c6160327d Add \n to log() message.
Submitted by:	Stanislaw Halik <weirdo tehran.lain.pl>
2005-12-27 00:17:11 +00:00
Maxim Sobolev d49b21093c Fix breakage introduced in the previous commit. 2005-12-26 22:32:52 +00:00
Olivier Houchard 81e5864f2e Fix typo in comment. 2005-12-26 22:09:09 +00:00
Maxim Sobolev 900b28f9f6 Remove kern.elf32.can_exec_dyn sysctl. Instead extend Brandinfo structure
with flags bitfield and set BI_CAN_EXEC_DYN flag for all brands that usually
allow executing elf dynamic binaries (aka shared libraries). When it is
requested to execute ET_DYN elf image check if this flag is on after we
know the elf brand allowing execution if so.

PR:		kern/87615
Submitted by:	Marcin Koziej <creep@desk.pl>
2005-12-26 21:23:57 +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
Yoshihiro Takahashi 3b52aaddac MFi386: revision 1.621 2005-12-26 12:46:36 +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
David Xu 1bfa910843 Move global variable private_tss into per-cpu area.
Reviewed by: jhb
2005-12-26 00:07:19 +00:00
Max Laier 6ae8d74a9e Only decrement the max-src-conn counter for tcp connections that reached
"established" state.

Similar to OpenBSD's rev. 1.499 by joel but not breaking ABI.

Obtained from:	OpenBSD (with changes)
Reported by:	Bruno Afonso
MFC after:	3 days
X-MFC:		together with local_flags
2005-12-25 23:52:00 +00:00
Sam Leffler a8af2cc7ce add a sysctl to turn debug msgs on/off when built with IFMEDIA_DEBUG 2005-12-25 23:28:23 +00:00
Max Laier 8d13037cda Fix build after timeval.tv_sec changed from long to time_t. 2005-12-25 22:57:08 +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
Peter Grehan 4ca162b6c4 Forward-declare struct trapframe to allow the aic module to compile. 2005-12-24 08:27:45 +00:00
Alan Cox 60bb39431a Maintain the lock on the vnode for most of exec_elfN_imgact().
Specifically, it is required for the I/O that may be performed by
elfN_load_section().

Avoid an obscure deadlock in the a.out, elf, and gzip image
activators.  Add a comment describing why the deadlock does not occur
in the common case and how it might occur in less usual circumstances.

Eliminate an unused variable from exec_aout_imgact().

In collaboration with: tegge
2005-12-24 04:57:50 +00:00