Commit graph

42368 commits

Author SHA1 Message Date
Sam Leffler ecddff40a0 o do not filter received frames based on type or length; pass 'em all up
to the 802.11 layer if they are at least IEEE80211_MIN_LEN
o mask off interrupt status bits that we don't care about so we don't do
  the wrong thing; this fixes a problem where the beacon miss interrupt status
  bit is delivered together with other status bits when operating in monitor
  mode (we would post a beacon miss swi and then do the wrong thing)
2003-09-15 19:41:54 +00:00
Sam Leffler 18f897abe0 Change input handling to not expect drivers to filter short frames.
In particular, let drivers send up control frames so we can dispatch
them to bpf in monitor mode.

This is the first (small) step to adding more functionality such as
power save mode.
2003-09-15 19:38:29 +00:00
Sam Leffler 993338b6ab add definitions for various control frames and a minimum-sized frame that
we use to define IEEE80211_MIN_LEN; the minimal length for frames drivers
may pass up into the 802.11 layer
2003-09-15 19:36:34 +00:00
Bruce Evans 7c24ca50f8 Quick fix for a pessimization in rev.1.194. An extra i/o instruction
was added to the fast path to support the COM_IIR_RXRDYBUG() case even
when that case is not configured.  This increased the relative overhead
of sio input by almost 25% in the worst case and by 2-3% in the usual
case (usually only about 0.2% absolute per port at 115200 bps).  The
quick fix is to significantly pessimize only the COM_IIR_RXRDYBUG()
case.
2003-09-15 13:49:18 +00:00
Mark Murray 56c5b842f0 Add a module dependancy. Now CAM will autoload when you load this.
OK'ed by:	mdodd
2003-09-15 06:41:33 +00:00
Nate Lawson 2d610c4638 Only enable S4BIOS by default if the FACS says it is available. The
user can override this with a sysctl.

Be sure to return the acpi_SetSleepState return value to userland.
2003-09-15 06:29:31 +00:00
Alan Cox 82f9defeaf Eliminate the use of Giant from vm_object_reference(). 2003-09-15 05:58:27 +00:00
Marcel Moolenaar 991e61c934 Sort: build uart_bus_pccard.c before uart_bus_pci.c. 2003-09-15 04:53:11 +00:00
Marcel Moolenaar 39e7b60930 Remove inclusion of <sys/timepps.h>. It's included in "uart_bus.h"
to avoid having to include it in almost all other source files.
2003-09-15 04:49:22 +00:00
Takanori Watanabe 45b3a50925 Remove useless #ifdef PC98.
Submitted by: nyan
2003-09-15 03:12:27 +00:00
Alan Cox 35b86dc8de Correct a typo in the previous revision. 2003-09-15 02:56:48 +00:00
Sam Leffler 3065b96e25 must also check for 5Ghz channels when marking short preamble capability in
the beacon frames

Reminded by:	Stephane Laroche <stephane.laroche@colubris.com>
2003-09-14 22:53:41 +00:00
Sam Leffler f6aa038bbe o mark the device capable of short preamble (meaningless for the 5210 but
safe since the 802.11 layer does the right thing for 11a operation)
o select short preamble operation based on the negotiated capabilities; not
  just the local state/capability
o fillin the duration field in the 802.11 header as appropriate
o remove detection of 11g support; no longer needed

Obtained from:	MADWIFI (with modifications)
2003-09-14 22:39:19 +00:00
Sam Leffler 4f2e09c4b2 Honor the short preamble capability/state flag when calculating the
capabilities for outbound management frames.  But beware of sending
this when operating on 5GHz channels; some 11a AP's reject association
requests if this bit is set in the capabilities listed.

Obtained from:	MADWIFI (with modifications)
2003-09-14 22:34:24 +00:00
Sam Leffler fba3db9f57 short preamble capability is not just for 11g; mark IEEE80211_F_SHPREAMBLE
regardless of the operating mode

Obtained from:	MADWIFI
2003-09-14 22:32:18 +00:00
Scott Long ec40a9f9d0 Teach the PCI code to parse MSI extended capabilities. Re-arrange the
pcicfg struct a bit to hold extcap structures instead of structure members.
2003-09-14 19:30:00 +00:00
Nate Lawson 5f7e1e2f82 Print notify values as hex. 2003-09-14 17:47:44 +00:00
Takanori Watanabe 0d62746979 Add uart pccard attachment decription on conf/files, too.
Pointed out by: ru
2003-09-14 17:02:59 +00:00
Matthew N. Dodd cdeb7b18af - Avoid calling pci_get_device() more than once in a single function.
- Provide a mechanism to prevent the use of MMIO.
- Prevent the use of MMIO for all 3c575 cardbus cards.
2003-09-14 16:33:48 +00:00
Takanori Watanabe a9f6e997b5 Add uart pccard bus attachment,based on sio_pccard.c .
Wrote at: Hakone.
Powered by: Warner Losh's scotch whisky.
Tested by: nork
2003-09-14 16:21:06 +00:00
Scott Long 3c358d0ca0 Expand the extended capabilities list and add definitions for MSI. 2003-09-14 14:42:26 +00:00
Robert Watson 62c45ef40a Add a new sysctl, security.bsd.conservative_signals, to disable
special signal-delivery protections for setugid processes.  In the
event that a system is relying on "unusual" signal delivery to
processes that change their credentials, this can be used to work
around application problems.

Also, add SIGALRM to the set of signals permitted to be delivered to
setugid processes by unprivileged subjects.

Reported by:	Joe Greco <jgreco@ns.sol.net>
2003-09-14 07:22:38 +00:00
Scott Long cadbc399ea Remove most of the magic constants from the extcap parsing code. 2003-09-14 06:23:19 +00:00
Alan Cox 30bb12a4e8 Call vm_page_unmanage() on pages belonging to the kmem_object. This
eliminates the unnecessary overhead of managing "PV" entries for these
pages.
2003-09-14 02:37:59 +00:00
Matthew N. Dodd 2049fdeefd Enable IPv6 for Token Ring. 2003-09-14 02:32:31 +00:00
Matthew N. Dodd f8f1abafd2 Cosmetic cleanups. 2003-09-14 02:26:45 +00:00
Matthew N. Dodd 5dbc58b5ba Cosmetic adjustment. 2003-09-14 02:18:54 +00:00
Bill Paul c2c6548b3a Teach the re(4) driver about the CFG2 register, which tells us whether
we're on a 32-bit/64-bit bus or not. Use this to decide if we should
set the PCI dual-address cycle enable bit in the C+ command register.
(Enabling DAC on a 32-bit bus seems to do bad things.)

Also, initialize the C+ command register early in the re_init() routine.
The documentation says this register should be configured first.
2003-09-13 23:51:35 +00:00
Bill Paul dcdc6667ce The in6_ifattach() routine contains the following code:
in6_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp);
        in6_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp);

The problem here is that udbinfo.listhead and ripcbinfo.listhead are
not initialized during the device probe/attach phase of the kernel
boot process. So if, for example, a network driver calls ether_ifattach()
in its foo_attach() routine and then decides that something is wrong
and calls ether_ifdetach() to reverse the process, we will panic trying
to dereference the uninitialized list head pointers. (Though the
same sequence of events performed after the kernel has come up works
file, i.e. doing kldload if_foo from multiuser.)

Change this to:

        if (udbinfo.listhead != NULL)
                in6_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp);
        if (ripcbinfo.listhead != NULL)
                in6_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp);

to avoid the NULL pointer dereferences.
2003-09-13 22:34:52 +00:00
Alan Cox 6d66d714c7 Simplify (and micro-optimize) pmap_unuse_pt(): Only one caller,
pmap_remove_pte(), passed NULL instead of the required page table
page to pmap_unuse_pt().  Compute the necessary page table page
in pmap_remove_pte().  Also, remove some unreachable code from
pmap_remove_pte().
2003-09-13 21:57:38 +00:00
Nate Lawson 64fdad2352 Add the -i flag to acpiconf(8) to retrieve battery information.
Rename a few structure elements.
2003-09-13 20:13:01 +00:00
Alan Cox b881da26a5 There is no need for an atomic increment on the vm object's generation
count in _vm_object_allocate().  (Access to the generation count is
governed by the vm object's lock.)  Note: the introduction of the
atomic increment in revision 1.238 appears to be an accident.  The
purpose of that commit was to fix an Alpha-specific bug in UMA's
debugging code.
2003-09-13 20:07:26 +00:00
Jacques Vidrine 5949ba2136 sched_setscheduler: Return EINVAL when a invalid policy is specified,
thus complying with POLA and the man page.  (Previously, no error was
returned for this case.)
2003-09-13 18:46:24 +00:00
Scott Long ba42f5be52 Apply Aleksander Fafula's crayons to the beastie. Add the this line to
/boot/loader.conf to see the pretty colors =-)

loader_color="YES"
2003-09-13 18:35:01 +00:00
Jacques Vidrine b5e80ae344 Correct mostly harmless off-by-one error in getdomainname().
Reviewed by:	imp
2003-09-13 17:12:22 +00:00
Yoshihiro Takahashi 211822ccef Merged from sys/isa/fd.c revision 1.258. 2003-09-13 12:56:05 +00:00
Marcel Moolenaar 84c7b427f5 Add support for automatic hardware flow control for 16[679]50 UARTs.
We simply use the detected FIFO size to determine whether we have
a post 16550 UART or not. The support lacks proper serialization of
hardware access for now.
2003-09-13 06:25:04 +00:00
Alan Cox 58abfe0051 Convert vmapbuf() from using pmap_extract() to using
pmap_extract_and_hold().  Note, however, that GIANT_REQUIRED should not be
removed until all platforms fully implement the "prot" parameter to
pmap_extract_and_hold().

Reviewed by:	tegge
2003-09-13 04:29:55 +00:00
Matt Jacob 53d0345138 I forgot whom I got this from- only set single initiator buffered mode
if we've recorded in our softc that we should set it.
2003-09-13 02:01:56 +00:00
Matt Jacob 4b39f27d17 NetBSD'er with time on their hands (dma->DMA) 2003-09-13 01:59:14 +00:00
Matt Jacob 799cbab17e Bland synchronization of common source with no effect on FreeBSD whatsomever. 2003-09-13 01:58:51 +00:00
Matt Jacob 2f9e7606fe Some ridiculous target mode botches- like having the wrong definitions
for messages. Some spelling fixes. Some target mode structure cleanups
to reflect reality.
2003-09-13 01:58:26 +00:00
Matt Jacob 5c1596a04a Some canonicalization function cleanups based upon some target mode
structure cleanups.
2003-09-13 01:57:31 +00:00
Matt Jacob 4578084aa3 No time like the present to turn back on SMP locking. 2003-09-13 01:56:45 +00:00
Matt Jacob fd6eb9f769 Report correct active vs. nvram node/port WWNs in an ioctl. 2003-09-13 01:56:24 +00:00
Matt Jacob 28f0575cf1 On reset, make sure that we have some parameters set correctly. This
fixes a longstanding issue WRT resetting the chip after startup- it
would fail if we were connected as an F-port to a switch. If we
were connected as an F-port, we got assigned a hard loop ID of 255,
which is really a bogus loop id. Then when we turned around to
reset ourselves, the firmware would reject the ICB_INIT request
because the loop id was bogus. *sputter*

Minor fixlet from somebody in NetBSD with too much time on their
hands (dma -> DMA).
2003-09-13 01:55:44 +00:00
Tim J. Robbins 5f39b226ce Move an overly verbose message under #ifdef CODA_VERBOSE. 2003-09-13 01:13:56 +00:00
Thomas Moestl 09c06ee91f When determining the device class to use for the serial console, check
the "compatible" property too in the ns8250 case. This gets the serial
console to work on Blade 100s, where the device name is just "serial".

Reviewed by:	marcel
2003-09-12 20:13:23 +00:00
Thomas Moestl 894b85b150 Handle ISA devices in OF_decode_addr(), with the same code that is
used in the EBus case.
2003-09-12 20:04:29 +00:00
Poul-Henning Kamp 2a3d23acc6 Name the vnode method vectors consistently with the rest of the filesystems.
This improves the output of src/tools/tools/vop_table
2003-09-12 16:44:40 +00:00
Alan Cox 27d203eab3 pipe_build_write_buffer() only requires read access of the page that it
obtains from pmap_extract_and_hold().
2003-09-12 07:13:15 +00:00
Alan Cox b9850eb224 Add a new parameter to pmap_extract_and_hold() that is needed to eliminate
Giant from vmapbuf().

Idea from:	tegge
2003-09-12 07:07:49 +00:00
Paul Saab faf13262a4 Delay most of the adapter initilization until after interrupts are
enabled.

Tested by:	Richard Puga <puga@mauibuilt.com>
2003-09-11 23:30:28 +00:00
Marcel Moolenaar 8194412b89 Add support for using uart(4) for pulse capturing for the Pulse Per
Second (PPS) timing interface. The support is non-optional and by
default uses the DCD line signal as the pulse input. A compile-time
option (UART_PPS_ON_CTS) can be used to have uart(4) use the CTS line
signal.

Include <sys/timepps.h> in uart_bus.h to avoid having to add the
inclusion of that header in all source files.

Reviewed by: phk
2003-09-11 23:06:42 +00:00
Ruslan Ermilov 78f94aa951 Fix a bunch of off-by-one errors in the range checking code. 2003-09-11 21:40:21 +00:00
Poul-Henning Kamp 0c7721e8f9 Disable the use of cloning use in floppy and CD drivers.
This commit puts the relevant code snippets under #ifdef GONE_IN_5
(rather than #ifndef BURN_BRIDGES) thereby disabling the code now.

The code wil be entirely removed before 5.2 unless we find reasons
why this would be a bad idea.

Approach suggested by:	imp
2003-09-11 19:27:24 +00:00
Thomas Quinot cc9ed6619f (atapi_action, case XPT_PATH_INQ): Handle properly the case of
CAM_TARGET_WILDCARD (target_id_t is an unsigned integer type).
Fixes boot-time crash on Alpha.

Reviewed by:	roberto
Approved by:	re (murray)
MFC after:	1 week
2003-09-11 17:34:47 +00:00
Søren Schmidt fe78f9d47c Add support of the DIOCGSECTORSIZE & DIOCGMEDIASIZE ioctl's
so that newfs works on dvd-rw/dvd-ram again..
2003-09-11 15:59:16 +00:00
Yoshihiro Takahashi 8278014bce MFi386 revisions 1.570 and 1.571. 2003-09-11 14:07:02 +00:00
Yoshihiro Takahashi 916a70c619 MFi386: revision 1.204. 2003-09-11 14:05:06 +00:00
Yoshihiro Takahashi c475aa0304 MFi386: revision 1.1093. 2003-09-11 13:44:48 +00:00
Yoshihiro Takahashi 79a5a35f9e Merged from sys/isa/fd.c revisions 1.252, 1.253, 1.254, 1.255 and 1.257. 2003-09-11 13:35:35 +00:00
Bill Paul d5a5045921 Clean up dead code. 2003-09-11 08:28:38 +00:00
Bill Paul 804af9a1af Toggle the interface on and off before starting the diag test. This
seems to be necessary for the 8139C+ under certain circumstances, and
doesn't appear to hurt the other chips. (In the failure case, the
packet would be sent through the TX DMA ring but not get echoed
back. I suspect this has something to do with the link state changing
unexpectedly.)
2003-09-11 07:54:16 +00:00
Bill Paul abc8ff44d3 - For the 8169 chips, read the station address by forcing an EEPROM
autoload and then copying the contends of the station address
  registers. For some reason, reading the EEPROM on the 8169S doesn't
  work right. This gets around the problem, and allows us to read
  the station address correctly on the 8169S.

- Insert a delay after initiating packet transmition in re_diag() to
  allow lots of time for the frame to echo back to the host, and wait
  for both the 'RX complete' and 'timeout expired' bits in the ISR
  register to be set.

- Deal more intelligently with the fact that the frame length
  field in the RX descriptor is a different width on the 8139C+
  than it is on the 8169/8169S/8110S

- For the 8169, you have to set bit 17 in the TX config register
  to enter digital loopback mode, but for the 8139C+, you have to
  set both bits 17 and 18. Take this into account so that re_diag()
  works properly for both types of chips.
2003-09-11 06:56:46 +00:00
Warner Losh 3e49a687ff Minor commentary cleanup, since I didn't understand the comments that
I wrote.
2003-09-11 04:22:28 +00:00
Warner Losh 04ea3df7d9 Fix compile on pc98. Maybe this is correct. 2003-09-11 04:14:26 +00:00
Bill Paul 5c75626b05 Re-enable VLAN_MTU capability for this driver. (Got reverted when
I pulled out the C+/8169 bits.)
2003-09-11 04:05:01 +00:00
Bill Paul 9bac70b851 Add a PHY driver to support the built-in gigE PHY in the 8169S/8110S
ethernet chips. This driver is pretty simple, however it contains
special DSP initialization code which is needed in order to get
the chip to negotiate a gigE link. (This special initialization
may not be needed in subsequent chip revs.) Also:

- Fix typo in if_rlreg.h (RL_GMEDIASTAT_1000MPS -> RL_GMEDIASTAT_1000MBPS)

- Deal with shared interrupts in re_intr(): if interface isn't up,
  return.

- Fix another bug in re_gmii_writereg() (properly apply data field mask)

- Allow PHY driver to read the RL_GMEDIASTAT register via the
  re_gmii_readreg() register (this is register needed to determine
  real time link/media status).
2003-09-11 03:53:46 +00:00
Nate Lawson 5c5967082f Add a system notify handler in addition to the device notify handler.
At least some Toshiba notebooks use a Notify of 0 or 1 for this.

PR:
Submitted by:	Hiroyuki Aizu <aizu@navi.org>
2003-09-11 03:17:33 +00:00
Poul-Henning Kamp e060b6bd03 Reorder a couple of KASSERTS to give more sensible messages.
Found by:	GEOM 101 class of '03
2003-09-11 00:49:02 +00:00
Marcel Moolenaar 87ad0260ff Rewrite the SAPIC initialization to always program the RTEs with what
we think is the correct trigger mode and polarity. This allows us to
implement BUS_CONFIG_INTR() as an update of the RTE in question.
Consequently, we can trust the RTE when we enable an interrupt and
avoids that we need to know about the trigger mode and polarity at
that time.
2003-09-10 22:49:38 +00:00
Marcel Moolenaar 24752c4291 Extend the ACPI resource handling to make use of the BUS_CONFIG_INTR()
method. This is necessary on ia64 where it's known that serial interfaces
described in the ACPI namespace may not have the well-known IRQs assigned
to them. This confuses us in thinking they are PCI based interrupts and
wrongly program the APIC.
2003-09-10 22:06:41 +00:00
Marcel Moolenaar da13b8f9fe Introduce BUS_CONFIG_INTR(). The method allows devices to tell parents
about interrupt trigger mode and interrupt polarity. This allows ACPI
for example to pass interrupt resource information up the hierarchy.
The default implementation of the method therefore is to pass the
request to the parent.

Reviewed by: jhb, njl
2003-09-10 21:37:10 +00:00
David E. O'Brien 39e5f914ee Relent and back out rev 1.15. 2003-09-10 19:08:16 +00:00
David E. O'Brien 3fc40c2484 Sort 'bge' correctly. 2003-09-10 18:54:59 +00:00
Alan Cox 8373f36dbb In case vmapbuf() fails, release all of the held resources.
Submitted by:	tegge
2003-09-10 18:23:43 +00:00
Hidetoshi Shimokawa 8edbaf859d Fix asynchronous physio breakage introduced in rev 1.163.
We cannnot use bp->b_caller2 because DEV_STRATEGY will overwrite it.
2003-09-10 15:48:51 +00:00
Bill Paul 4ee1666125 Fix bug in re_gmii_writewreg(): we don't need to be screening out certain
PHY addresses here. (The chip will only let you talk to one PHY anyway.)
2003-09-10 15:14:46 +00:00
Bill Paul 966a07e907 Teach rl(4) about new hwrev codes. 2003-09-10 15:12:55 +00:00
Søren Schmidt 2194b6a479 Try a bit harder to probe disks that doesn't quite set BUSY right. 2003-09-10 09:57:16 +00:00
Bill Paul 69a6b7fb50 Update hardware revision table. 0x04000000 appears to be the revision
for the 8169S, according to my sample board. The RealTek Linux driver
mentions 0x00800000. I'm assigning this to the 8110S until I get
more info on it. (The (preliminary) RealTek docs only say that 8169S/8110S
chips will have some combination of those two bits set, but doesn't say
exactly what bit combination goes with which chip variant.)
2003-09-10 07:21:43 +00:00
John Baldwin bbdaad6fee Whitespace. 2003-09-10 07:09:16 +00:00
John Baldwin 42a12b2bd8 Move the definitions for ACPI MADT table entries not present in the ACPICA
distribution to a MI header so it can be shared with other architectures.
2003-09-10 06:32:27 +00:00
John Baldwin 810cb9ef5e We represent PCI intpin's two different ways. One is the way that the
intpin register is expressed in hardware where 0 means none, 1 means INTA,
2 INTB, etc.  The other way is commonly used in loops where 0 means INTA,
1 means INTB, etc.  The matchpin argument to pci_cfgintr_search() is
supposed to be the first form, but we passsed in a loop index of the
second.  This fix adds one to the loop index to convert to the first form.

Reported by:	Pavlin Radoslavov <pavlin@icir.org>
2003-09-10 06:00:53 +00:00
John Baldwin a7321ecb19 Finish an earlier commit:
Add a acpi_SetDefaultIntrModel() method to allow drivers to set the
interrupt model prior to the acpi0 device being probed and attached.
2003-09-10 05:29:30 +00:00
Marcel Moolenaar c21e0da2f8 If we failed to size the Rx FIFO, assume the worst. This however
is not a size of 1. Since we already know there is a FIFO, we can
safely assume that it is at least 16 bytes. Note that all this is
mostly academic anyway. We don't use the size of the Rx FIFO
currently. If we add support for hardware flow control, we only
care about Rx FIFO sizes larger than 16.
2003-09-10 05:01:08 +00:00
Tim J. Robbins e1d237ec05 Move an annoying printf() call that gets triggered every time an
operation is interrupted (with ^C or ^Z) under CODA_VERBOSE.
2003-09-10 01:41:15 +00:00
John Baldwin a547af297d Remove an XXX comment by using the per CPU mask added after this comment
was added.
2003-09-10 01:36:48 +00:00
John Baldwin 4c93af3788 Add a acpi_SetDefaultIntrModel() method to allow drivers to set the
interrupt model prior to the acpi0 device being probed and attached.
2003-09-10 01:14:42 +00:00
John Baldwin f03cb48d41 Fix a typo. 2003-09-10 01:11:58 +00:00
John Baldwin 674e1d4532 Add comments to the members of the timecounter struct similar to other
timecounters.
2003-09-10 01:10:24 +00:00
John Baldwin 2b3c42a9e9 Update the license on this file to be a bit more sane. 2003-09-10 01:09:32 +00:00
John Baldwin 0e85b19ba9 Add constants for entries in the IDT and use those instead of magic
numbers.
2003-09-10 01:07:04 +00:00
Ruslan Ermilov 8e75a37bb0 Fixed -Wpointer-arith warning.
Submitted by:	Stefan Farfeleder
PR:		bin/56653
2003-09-09 23:50:57 +00:00
Peter Wemm 2c25d12414 Clean up get/set_mcontext() and get/set_fpcontext(). These are operated
on data structures on the kernel stack which are guaranteed to be 16 byte
aligned by gcc, the amd64 ABI and __aligned(16).

Ensire the tss_rsp0 initial stack pointer is 16 byte aligned in case
sizeof(pcb) becomes odd at some point.  This is convenient for the
interrupt handler case because the ring crossing pushes cause the
required odd alignment before the call to the C code.

Have fast_syscall add an additional 8 bytes to ensure that the trapframe
has the correct odd alignment for the call to C code.  Note that there are
no checks to make sure that the trapframe size is appropriate for this.

This makes get/setfpcontext work properly (finally).  You get a GPF in
kernel mode if any of this is botched without the alignment fixup code
that is apparently needed on i386.
2003-09-09 19:32:09 +00:00
Dag-Erling Smørgrav 7d10d0554c Fix some broken comments. 2003-09-09 19:22:55 +00:00
Marcel Moolenaar 999a2bfab3 Add LOG2_ID_PAGE_SIZE to the mix of options on ia64. 2003-09-09 18:30:20 +00:00
Bill Paul af8512b863 Remove unnecessary #include of brgphyreg.h, left over from when Stuart used
the bge(4) driver as a template.
2003-09-09 18:21:17 +00:00
Bill Paul b9f78d2b4a Add a device driver for the Broadcom BCM4401 ethernet controller,
written by Stuart Walsh and Duncan Barclay (with some kibbitzing by
me). I'm checking it in on Stuart's behalf.

The BCM4401 is built into several x86 laptop and desktop systems. For the
moment, I have only enabled it in the x86 kernel config because although
it's a PCI device, I haven't heard of any standalone NICs that use it. If
somebody knows of one, we can easily add it to the other arches.

This driver uses register/structure data gleaned from the Linux
driver released by Broadcom, but does not contain any of the code
from the Linux driver itself. It uses busdma.
2003-09-09 18:17:23 +00:00
Dag-Erling Smørgrav 0dd872f5bb Add cwd, root and statm (modeled on a 2.4.20 kernel). De-obfuscate
linprocfs_init() a little and remove some gratuitous whitespace.
2003-09-09 08:19:06 +00:00
Scott Long 5b80c0d74d Use PCIR_BAR() instead of a magic offset. 2003-09-09 06:44:58 +00:00
Scott Long 5fdcb0a62e Re-arrange the raid section a small bit and put drivers into their proper
category.
2003-09-09 06:36:32 +00:00
Marcel Moolenaar e6882c3469 Introduce IA64_ID_PAGE_{MASK|SHIFT|SIZE} and LOG2_ID_PAGE_SIZE. The
latter is a kernel option for IA64_ID_PAGE_SHIFT, which in turn
determines IA64_ID_PAGE_MASK and IA64_ID_PAGE_SIZE.

The constants are used instead of the literal hardcoding (in its
various forms) of the size of the direct mappings created in region
6 and 7. The default and probably only workable size is still 256M,
but for kicks we use 128M for LINT.
2003-09-09 05:59:09 +00:00
Nate Lawson 9817561470 Disallow attempts to suspend to S0. It was only enabled for testing.
Print a more informative message if a sleep state is not supported by BIOS.
Add comments.
2003-09-09 04:09:25 +00:00
Eric Anholt a1810e1513 Hook the SiS DRM up to the build
Sponsored by:	LinuxFund
2003-09-09 00:29:02 +00:00
Eric Anholt 6608b729ea Merge from DRI CVS. Includes newly ported SiS 300/305/540/630/730 driver and
updates to allow system memory to be used for textures on PCI Radeons.

Sponsored by:	LinuxFund
2003-09-09 00:24:31 +00:00
Peter Wemm df6ece387b Turn aac back on now that its been cleaned up for 64 bit compilation 2003-09-08 20:00:55 +00:00
Ruslan Ermilov fe08efe680 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
Poul-Henning Kamp d5ce9dac89 Correct bzero length so we clear the entire key structure. 2003-09-08 18:35:26 +00:00
Poul-Henning Kamp 5fdd8d28a3 Correctly bzero the entire context, not just the first sizeof(void *) bytes.
Found by:	Juergen Buchmueller <pullmoll@stop1984.com>
2003-09-08 18:32:33 +00:00
Peter Wemm 292bbfd103 Argh. This file was completely out of sync with mcontext/trapframe. 2003-09-08 18:31:48 +00:00
Peter Wemm 7fe089a006 Hmm. Two copies of the mcontext... 2003-09-08 18:28:41 +00:00
Paul Saab 88ff7f004e Quiet down boot verbose and allow commands to be submitted to a target
which does not have a volume attached.  This will stop cam from retrying
a bunch of time at boot for devices which do not exsist.
2003-09-08 16:45:33 +00:00
Ian Dowse ffe40c80ea In the !MNT_BYFSID case, return EINVAL from unmount(2) when the
specified directory is not found in the mount list. Before the
MNT_BYFSID changes, unmount(2) used to return ENOENT for a nonexistent
path and EINVAL for a non-mountpoint, but we can no longer distinguish
between these cases. Of the two error codes, EINVAL was more likely
to occur in practice, and it was the only one of the two that was
documented.

Update the manual page to match the current behaviour.

Suggested by:	tjr
Reviewed by:	tjr
2003-09-08 16:23:21 +00:00
Søren Schmidt a127b17621 Add another ID for the SiI3112a SATA chip as used on the Adaptec 1210SA.
RAID support is still in the works, so for now just normal ATA ops.

Sponsored by:	Matt Douhan(www.fruitsalad.org)
2003-09-08 13:55:05 +00:00
Søren Schmidt df63f1d988 Limit the size of the rebuild requests to be within safety. 2003-09-08 13:36:26 +00:00
Tim J. Robbins 9e05721545 Bump __FreeBSD_version for Coda 6.x venus<->kernel API support. 2003-09-08 11:54:59 +00:00
David E. O'Brien 7d4724590e Use __FBSDID().
Also some minor style cleanups.
2003-09-08 09:11:32 +00:00
Søren Schmidt 4514dcad32 #ifdef out the vague ATA disk detection code causing fake ATA disks
to be found on some systems.
Hopefully this doesn't loose any real ATA disks...
2003-09-08 08:36:46 +00:00
Søren Schmidt 08c26854a3 Handle shared channels better.
Try to avoid the spurios interrupts better.
2003-09-08 08:32:25 +00:00
Søren Schmidt 9855ae3844 Update the PIO mode gathering code.
Reported by: bde
2003-09-08 08:30:43 +00:00
Søren Schmidt 6e9e1e9753 Dont re-arm the timeout twice on a timeout error.
The problem with the first timeout still exsists though, but not
it doesn't enter a groundbound spin loop :)

Found by:	Aaron Smith <aaron@mutex.org>
2003-09-08 06:28:50 +00:00
Nate Lawson bf10d4f8c4 Don't disable interrupts a second time. Remove an extraneous interrupt
enable (that happens elsewhere).  Clarify the interrupt disabling point
by using ACPI_DISABLE_IRQS().

Tested by:	Kevin Oberman
2003-09-08 06:22:54 +00:00
Alan Cox 03be99d20c Use pmap_extract_and_hold() in pipe_build_write_buffer(). Consequently,
pipe_build_write_buffer() no longer requires Giant on entry.

Reviewed by:	tegge
2003-09-08 04:58:32 +00:00
Bill Paul 20512f29f2 Fix path of pci #includes that I botched.
Also pointed out by: Larry Rosenman
2003-09-08 04:28:20 +00:00
Bill Paul 3ad525ef3c Fix PATH: directive in sys/modules/re/Makefile, and add the re(4) driver to
devd.conf.

Pointed out by: Larry Rosenman
2003-09-08 03:24:29 +00:00
Alan Cox ba2157f218 Introduce a new pmap function, pmap_extract_and_hold(). This function
atomically extracts and holds the physical page that is associated with the
given pmap and virtual address.  Such a function is needed to make the
memory mapping optimizations used by, for example, pipes and raw disk I/O
MP-safe.

Reviewed by:	tegge
2003-09-08 02:45:03 +00:00
Bill Paul a94100fa9b Take the support for the 8139C+/8169/8169S/8110S chips out of the
rl(4) driver and put it in a new re(4) driver. The re(4) driver shares
the if_rlreg.h file with rl(4) but is a separate module. (Ultimately
I may change this. For now, it's convenient.)

rl(4) has been modified so that it will never attach to an 8139C+
chip, leaving it to re(4) instead. Only re(4) has the PCI IDs to
match the 8169/8169S/8110S gigE chips. if_re.c contains the same
basic code that was originally bolted onto if_rl.c, with the
following updates:

- Added support for jumbo frames. Currently, there seems to be
  a limit of approximately 6200 bytes for jumbo frames on transmit.
  (This was determined via experimentation.) The 8169S/8110S chips
  apparently are limited to 7.5K frames on transmit. This may require
  some more work, though the framework to handle jumbo frames on RX
  is in place: the re_rxeof() routine will gather up frames than span
  multiple 2K clusters into a single mbuf list.

- Fixed bug in re_txeof(): if we reap some of the TX buffers,
  but there are still some pending, re-arm the timer before exiting
  re_txeof() so that another timeout interrupt will be generated, just
  in case re_start() doesn't do it for us.

- Handle the 'link state changed' interrupt

- Fix a detach bug. If re(4) is loaded as a module, and you do
  tcpdump -i re0, then you do 'kldunload if_re,' the system will
  panic after a few seconds. This happens because ether_ifdetach()
  ends up calling the BPF detach code, which notices the interface
  is in promiscuous mode and tries to switch promisc mode off while
  detaching the BPF listner. This ultimately results in a call
  to re_ioctl() (due to SIOCSIFFLAGS), which in turn calls re_init()
  to handle the IFF_PROMISC flag change. Unfortunately, calling re_init()
  here turns the chip back on and restarts the 1-second timeout loop
  that drives re_tick(). By the time the timeout fires, if_re.ko
  has been unloaded, which results in a call to invalid code and
  blows up the system.

  To fix this, I cleared the IFF_UP flag before calling ether_ifdetach(),
  which stops the ioctl routine from trying to reset the chip.

- Modified comments in re_rxeof() relating to the difference in
  RX descriptor status bit layout between the 8139C+ and the gigE
  chips. The layout is different because the frame length field
  was expanded from 12 bits to 13, and they got rid of one of the
  status bits to make room.

- Add diagnostic code (re_diag()) to test for the case where a user
  has installed a broken 32-bit 8169 PCI NIC in a 64-bit slot. Some
  NICs have the REQ64# and ACK64# lines connected even though the
  board is 32-bit only (in this case, they should be pulled high).
  This fools the chip into doing 64-bit DMA transfers even though
  there is no 64-bit data path. To detect this, re_diag() puts the
  chip into digital loopback mode and sets the receiver to promiscuous
  mode, then initiates a single 64-byte packet transmission. The
  frame is echoed back to the host, and if the frame contents are
  intact, we know DMA is working correctly, otherwise we complain
  loudly on the console and abort the device attach. (At the moment,
  I don't know of any way to work around the problem other than
  physically modifying the board, so until/unless I can think of a
  software workaround, this will have do to.)

- Created re(4) man page

- Modified rlphy.c to allow re(4) to attach as well as rl(4).

Note that this code works for the sample 8169/Marvell 88E1000 NIC
that I have, but probably won't work for the 8169S/8110S chips.
RealTek has sent me some sample NICs, but they haven't arrived yet.
I will probably need to add an rlgphy driver to handle the on-board
PHY in the 8169S/8110S (it needs special DSP initialization).
2003-09-08 02:11:25 +00:00
Marcel Moolenaar 5e3cb29a6b Untangle the code in this file to improve understandability. Both
ia64_count_cpus() and ia64_probe_sapics() called a single function
to do the the actual work. The difference in behaviour was handled
in that function and was further complicated by adding bootverbose
related code. As such, even the simplest of changes was hard to
comprehend.

Untangling has been done by increasing code duplication and using
a more naive style of coding. FWIW, the object file is slightly
smaller than before, so things aren't as bad as it may seem.

Triggered by: a simple fix on the P4 branch that never got merged.
2003-09-07 23:09:08 +00:00
Marcel Moolenaar 5cc705512d Remove the assumption that a bus_space_handle_t is an I/O address
from the SAB82532 and the Z8530 hardware drivers by introducing
uart_cpu_busaddr(). The assumption is not true on pc98 where
bus_space_handle_t is a pointer to a structure.
The uart_cpu_busaddr() function will return the bus address
corresponding the tag and handle given to it by the BAS.

WARNING: the intend of the function is STRICTLY to allow hardware
drivers to determine which logical channel they control and is NOT
to be used for actual I/O. It is therefore EXPLICITLY allowed that
uart_cpu_busaddr() returns only the lower 8 bits of the address
and garbage in all other bits. No mistakes...
2003-09-07 21:51:03 +00:00
Alan Cox 5d314346f5 MFamd64/i386
Add necessary page locking to pmap_mincore().
2003-09-07 20:02:38 +00:00
Marcel Moolenaar c8956b36d6 Improved English, proper spacing and capitalization for the serial
drivers. The shared 0x10 flag has been reworded to be more precise
and complete.

Submitted by: bde
Edited by: marcel
2003-09-07 19:19:49 +00:00
Alan Cox 7ebcee376a Revise the locking in mincore(2). 2003-09-07 18:47:54 +00:00
Cameron Grant 3f22597838 update my email address. 2003-09-07 16:28:03 +00:00
Bruce Evans 4df0520624 clock.c:
Quick fix for calling DELAY() for ddb input in some (atkbd-based)
console drivers.  ddb must not use any normal locks, but DELAY()
normally calls getit() which needs clock_lock.  One problem with using
normal locks in ddb is that deadlock is possible, but deadlock on
clock_lock is unlikely becaluse clock_lock is bogusly recursive,
apparently just to hide the problem of ddb using it.  The i8254 clock
hardware has mostly write-only registers so it is important for it to
use a lock that gives exclusive access.  (atkbd hardware is also
unfriendly to reentrant software but that problem is more local and
already solved.)  I mostly saw the symptoms of the bug caused by
unlocking in getit() running cpu_unpend().  cpu_unpend() should not
be called while in ddb and Debugger() calls for failing assertions
about this caused a breakpoint within ddb.

ddb must also not call getit() because ddb may be being used to step
through clock initialization code that has stopped or otherwise mangled
the clock.  If the clock is stopped, then getit() always returns the
same value and DELAY() takes forever if it trusts getit().

The quick fix is implement DELAY(n) as (n * timer_freq / 1000000)
inb(0x84)'s if ddb is active.

machdep.c:
Don't permit recursion on clock_lock.
2003-09-07 14:23:08 +00:00
Bruce Evans 8aa1e716af Moved stop/start code for other CPUs to near the beginning/end of
kdb_trap().  Stopping the other CPUs acts like locking them out, but
it wasn't done early enough or held long enough to prevent concurrent
accesses to shared data.  In particular, the saved regs could be
clobbered.
2003-09-07 13:43:01 +00:00
Bruce Evans 2cf50c62a6 Restored non-egregious casts so that this file compiles on i386's with
64-bit longs again.
2003-09-07 13:23:45 +00:00
Bruce Evans 34eec0a169 Restored a non-egregious cast so that this file compiles on i386's
with 64-bit longs again.  This was fixed in rev.1.42 but the fix
rotted non-fatally in rev.1.105 and fatally in rev.1.137.

Many more non-egregrious casts are strictly required for conversions
from semi-opaque types to pointers, but we avoid most of them by using
types that are almost certain to be compatible with uintptr_t for
representing pointers (e.g., vm_offset_t).  Here we don't really want
the u_longs, but we have them because a.out.h and its support code
doesn't use typedefs (it uses unsigned in V7 and unsigned long in
FreeBSD) and is too obsolete to fix now.
2003-09-07 13:03:13 +00:00
Tim J. Robbins f05a427aa6 Return EINVAL if the contested bit is not set on the umtx passed to
_umtx_unlock() instead of firing a KASSERT.
2003-09-07 11:14:52 +00:00
Tim J. Robbins d14e51c95c Add support for the Coda 6.x venus<->kernel interface. This extends
FIDs to be 128-bits wide and adds support for realms.

Add a new CODA_COMPAT_5 option, which requests support for the old
Coda 5.x interface instead of the new one.

Create a new coda5.ko module that supports the 5.x interface, and make
the existing coda.ko module use the new 6.x interface. These modules
cannot both be loaded at the same time.

Obtained from:	Jan Harkes & the coda-6.0.2 distribution,
		NetBSD (drochner) (CODA_COMPAT_5 option).
2003-09-07 07:43:10 +00:00
Marcel Moolenaar 763d340b43 Now that PC98 has it's own MD file, use uart_cpu_${MACHINE}.c and
not uart_cpu_${MACHINE_ARCH}.c.
2003-09-07 06:50:08 +00:00
Marcel Moolenaar 10a686623d MFp4: Revamped GENERIC (and hints). This is some much more pleasant
to look at...
2003-09-07 06:39:51 +00:00
Marcel Moolenaar f1220bfe41 Replace sio(4) with uart(4). Remove the sio(4) hints and only add
those hints used by uart(4) for the determination of the serial
console in the absence of the HCDP table.
2003-09-07 05:47:10 +00:00
Alan Cox ffe5125eac msync(2) should be declared MP-safe. 2003-09-07 05:42:07 +00:00
Marcel Moolenaar a91af2c44b Fix build breakage caused by the inclusion of <ddb/ddb.h> while
building a module. Inclusion of option files (opt_ddb.h in this
case) is not possible for modules. The inclusion of opt_ddb.h
in this header is questionable.
2003-09-07 05:33:46 +00:00
David Xu 75764c27a8 Turning on warning for static LDT allocation. 2003-09-07 05:23:28 +00:00
Warner Losh 4d60276b05 Add proper pc98 MD files. Add a commented out cbus attachment for
uart because that depends on the cbus implementation that nyan-san and
I came up with after the CBUG meeting and not yet ready for the tree.
2003-09-07 05:05:40 +00:00
Warner Losh 080684ba71 add i8251 2003-09-07 05:00:32 +00:00
Warner Losh af1af2d2cc Better stab at MD code for pc98. The 8251 stuff is a total lie
(ns8250 copied and s/ns8250/i8251/g), but there for linkage purposes.
Real code to follow, once I get past some boot issues on my pc98 boxes
with recent current.
2003-09-07 04:59:15 +00:00
Marcel Moolenaar 501ef98fe8 Add uart(4). Shuffle the information about sio(4) flags and options
so that it's clear whicfh flags/options are used by both sio(4) and
uart(4) and which flags/options are specific to sio(4).
2003-09-07 03:45:48 +00:00
Marcel Moolenaar 2bec1c8919 Hook-up the uart(4) driver to the build. For a detailed description
of what uart(4) is and/or is not see the initial commit log of one
of the files in sys/dev/uart (or see share/man/man4/uart.4).

Note that currently pc98 shares the MD file with i386. This needs
to change when pc98 support is fleshed-out to properly support the
various UARTs. A good example is sparc64 in this respect.

We build uart(4) as a module on all platforms. This may break
the ppc port. That depends on whether they do actually build
modules.

To use uart(4) on alpha, one must use the NO_SIO option.
2003-09-06 23:23:26 +00:00
Marcel Moolenaar 27d5dc189c The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o  Fully newbusified to allow for memory mapped I/O. This is a must
   for ia64 and sparc64,
o  Machine dependent code to take full advantage of machine and firm-
   ware specific ways to define serial consoles and/or debug ports.
o  Hardware abstraction layer to allow the driver to be used with
   various UARTs, such as the well-known ns8250 family of UARTs, the
   Siemens sab82532 or the Zilog Z8530. This is especially important
   for pc98 and sparc64 where it's common to have different UARTs,
o  The notion of system devices to unkludge low-level consoles and
   remote gdb ports and provides the mechanics necessary to support
   the keyboard on sparc64 (which is UART based).
o  The notion of a kernel interface so that a UART can be tied to
   something other than the well-known TTY interface. This is needed
   on sparc64 to present the user with a device and ioctl handling
   suitable for a keyboard, but also allows us to cleanly hide an
   UART when used as a debug port.

Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o  The uart(4) driver determines the FIFO size and automaticly takes
   advantages of larger FIFOs and/or additional features. Note that
   since I don't have sufficient access to 16[679]5x UARTs, hardware
   flow control has not been enabled. This is almost trivial to do,
   provided one can test. The downside of this is that broken UARTs
   are more likely to not work correctly with uart(4). The need for
   tunables or knobs may be large enough to warrant their creation.
o  The uart(4) driver does not share the same bumpy history as sio(4)
   and will therefore not provide the necessary hooks, tweaks, quirks
   or work-arounds to deal with once common hardware. To that extend,
   uart(4) supports a subset of the UARTs that sio(4) supports. The
   question before us is whether the subset is sufficient for current
   hardware.
o  There is no support for multiport UARTs in uart(4). The decision
   behind this is that uart(4) deals with one EIA RS232-C interface.
   Packaging of multiple interfaces in a single chip or on a single
   expansion board is beyond the scope of uart(4) and is now mostly
   left for puc(4) to deal with. Lack of hardware made it impossible
   to actually implement such a dependency other than is present for
   the dual channel SAB82532 and Z8350 SCCs.

The current list of missing features is:
o  No configuration capabilities. A set of tunables and sysctls is
   being worked out. There are likely not going to be any or much
   compile-time knobs. Such configuration does not fit well with
   current hardware.
o  No support for the PPS API. This is partly dependent on the
   ability to configure uart(4) and partly dependent on having
   sufficient information to implement it properly.

As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
Marcel Moolenaar dc7d0dea12 Enhance puc(4) to support uart(4). This includes:
o  Introduce PUC_PORT_TYPE_UART so that we can attach to uart(4),
o  Introduce port sub-types (eg PUC_PORT_UART_NS8250, PUC_PORT_UART_Z8530)
   to handle different hardware and determine resource sizes.
o  Introduce two new IVARs: PUC_IVAR_SUBTYPE and PUC_IVAR_REGSHFT. Both
   are used by uart(4) to get sufficient information to talk to the HW.
o  Introduce PUC_FLAGS_ALTRES to tell puc(4) to try memory mapped I/O
   if I/O port space cannot be allocated, or vice versa.
o  Have ports of type PUC_PORT_TYPE_COM attach to uart(1) if attaching
   to sio(4) fails (due to not having the sio driver).
o  Put struct puc_device_description in struct puc_softc instead of
   having a pointer to a device description in the softc. This allows
   us to create device descriptions on the fly without having to use
   malloc() or otherwise have them staticly defined.
o  Move puc_find_description() from puc.c to puc_pci.c as it's specific
   to PCI.
o  Add EBUS and SBUS frontends for use on sparc64. Note that the P in
   puc stands for PCI, so we kinda mess things up here. It's too soon
   to worry about it though. We'll know what to do about it in time.

NOTE: This commit changes the behaviour of puc(4) to not quieten the
device probe and attach for child devices. The uart(4) driver provides
additional device description that is valuable to have.
2003-09-06 21:48:50 +00:00
Sam Leffler 6c024e8ef6 add fast swi taskqueue spinlock to the order_list so witness doesn't complain
Submitted by:	Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
2003-09-06 21:06:08 +00:00
Sam Leffler 7e2282a5a6 correct fast swi taskqueue spinlock name to be different from the sleep lock
Submitted by:	Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
2003-09-06 21:05:18 +00:00
Alan Cox 603d3d4a44 Giant is no longer required by pipe_destroy_write_buffer(). Reduce
unnecessary white space from pipe_destroy_write_buffer().
2003-09-06 21:02:10 +00:00
Poul-Henning Kamp a8c1568e29 Bzero the right number of bytes.
Found by:	Juergen Buchmueller <pullmoll@stop1984.com>
2003-09-06 18:37:17 +00:00
Doug Rabson a5c1ae0c87 Make indentation uniform. 2003-09-06 14:04:30 +00:00
Doug Rabson ef0040ab3b No need for a separate nfpm driver now - amdpm handles both. 2003-09-06 13:58:06 +00:00
Doug Rabson 8e60aa28ab When recording resources for the amdpm driver, only describe the ports
we actually use. Originally, the code reserved 0x8000 to 0x80ff inclusive
which on my hardware conflicts with the acpi timer. This broke the amdpm
driver since it was actually given ports 0x800c to 0x810b (which should
not have happened, IMHO).

This also allows us to considerably simplify the handling of the nForce
smb driver, removing the need for a separate nfpm driver. With this, SMB
accesses appear to work on my Tyan Tiger MP board. Your mileage may vary.
In particular, the nForce changes have not been tested.
2003-09-06 13:56:56 +00:00
Marcel Moolenaar dfbd7790d4 Load the kernel at a 64M instead of 5M. The advantage of this is that
we can switch to 64M-sized identity mappings and not having to map the
first 64M. This is especially important because the first 1M contains
the VGA frame buffer and is otherwise a legacy memory range. Best to
make as little assumptions about it as possible. Switching to 64M-sized
mappings is important to avoid creating overlapping translations, which
have the side-effect of triggering machine checks. This is currently
what's preventing us to boot on an Intel Tiger 4.

Note that since we currently use 256M-sized identity mappings, we
would reduce the size of the mappings and consequently increase the
TLB pressure. The performance implications of this are minimal if
measurable at all because identify mappings are not our primary
means for memory management.

Also note that there's no guarantee that physical memory exists at
64M. Then again, we didn't had the guarantee when we were loading at
5M. We'll deal with this when it's a problem.

Discussed with: arun@
2003-09-06 05:15:36 +00:00
Sam Leffler 468cf6f61a Add locking.
Special thanks to Pavlin Radoslavov <pavlin@icir.org> for testing and
fixing numerous problems.

Sponsored by:	FreeBSD Foundation
Reviewed by:	Pavlin Radoslavov <pavlin@icir.org>
2003-09-06 04:53:43 +00:00
Sam Leffler f82c9e70f9 "fast swi" taskqueue support. This is a taskqueue that uses spinlocks
making it useful for dispatching swi tasks from fast interrupt handlers.

Sponsered by:	FreeBSD Foundation
2003-09-05 23:09:22 +00:00
Sam Leffler 7c00e355a2 Print a message at boot for interrupt handlers created with INTR_MPSAFE
and/or INTR_FAST.  This belongs elsehwere and perhaps under bootverbose;
I'm committing it for now as it's uesful to know which drivers have
been converted and which have not.
2003-09-05 22:51:18 +00:00
Marcel Moolenaar 8d8d970db1 Fix a place where I forgot to change the code that checks whether
we return to kernel or userland. This triggered a panic in a KSE
application when TDF_USTATCLOCK was set in the case userland was
interrupted, but we never called ast() on our way out. As such,
we called ast() at some other time. Unfortunately, TDF_USTATCLOCK
handling assumes running in the interrupt thread. This was not
the case anymore.

To avoid making the same mistake later, interrupt() now returns
to its caller whether we interrupted userland or not. This avoids
that we have to duplicate the check in assembly, where it's bound
to fall off the scope. Now we simply check the return value and
call ast() if appropriate.

Run into this: davidxu
2003-09-05 22:50:10 +00:00
Sam Leffler 45276e4aa4 change timeout to be MPSAFE
Sponsored by:	FreeBSD Foundation
2003-09-05 22:37:31 +00:00
Sam Leffler 55b659ffc1 change timer to MPSAFE
Sponsored by:	FreeBSD Foundation
2003-09-05 22:33:44 +00:00
Sam Leffler 8df91fc8bc o add experimental radiotap capture format
o add netbsd logic to convert rssi to device-independent values

Obtained from:	NetBSD (rssi conversion code)
2003-09-05 22:29:30 +00:00
Sam Leffler 73454c7385 Add support for the experimental radiotap capture format. With this
we no longer need the debugging code to dump packets.
2003-09-05 22:22:49 +00:00
Sam Leffler 95a22a9a71 Experimental bpf capture format for 802.11 devices. The link layer
type belongs in net/bpf.h but we keep it here for the moment.

P:
Submittep by:
Obtained from:	David Young <dyoung@pobox.com>
2003-09-05 22:19:32 +00:00
Peter Wemm 917cf8d2a3 Log involuntary context switches correctly. 2003-09-05 22:15:26 +00:00
Sam Leffler 4faedfe87f Add locking. We use a single lock to guard the global vlan list and also
to protect the vlan state in each ifnet (e.g. vlan count).  The latter is
probably better handled through an ifnet-centric means but since changes
are infrequent shouldn't matter for now.

Sponsored by:	FreeBSD Foundation
2003-09-05 20:58:59 +00:00
Peter Wemm c896a8adbf Oops. sizeof(long) = 8, not 4. Get the fxsave buffer inside mcontext
the right size.  I'm planning on *possibly* stealing the two 'spare'
variables on either side for botched alignment correction.
2003-09-05 20:47:27 +00:00
Peter Wemm 116b8c8695 Mark the isa compat shims for BURN_BRIDGES for 6.0 2003-09-05 14:55:11 +00:00
Peter Wemm b324e86370 Clean up some antique stuff. We do not support Weitek FPUs etc, and never
did.
2003-09-05 14:54:26 +00:00
Poul-Henning Kamp 0ace036ce5 Remove now unused BOOTP tags related to NFS swap device. 2003-09-05 11:12:55 +00:00
Poul-Henning Kamp ce914a08b0 Put the message about msgbuf cksum mismatch under bootverbose and tell
people what the consequence is.
2003-09-05 11:12:00 +00:00
Poul-Henning Kamp 9aad651f23 Fix off-by-one error in array bounds check. 2003-09-05 11:09:26 +00:00
Poul-Henning Kamp bc7c831fc7 Forgotten in previous commit to atapi-cd.c: Add #ifndef BURN_BRIDGES
around cloning routines.
2003-09-05 11:08:55 +00:00
Poul-Henning Kamp 4740a0e7f2 Be less confusing in a comment. 2003-09-05 11:05:41 +00:00
Poul-Henning Kamp 7837155fa2 Put the device cloning functions for disk-drivers under #ifndef BURN_BRIDGES.
For the floppy driver, use fdcontrol to manipulate density selection.

For the CD drivers, the 'a' and 'c' suffix is without actual effect and
any applications insisting on it can be satisfied with a symlink:
	ln -s /dev/cd0 /dev/cd0a

Ongoing discussion may result in these pieces of code being removed before
the 5-stable branch as opposed to after.
2003-09-05 10:40:16 +00:00
Warner Losh a48c0be85d Whacked out CIS configurations can cause us to not have any child. When
such a card is ejected, we'd panic.  Instead, just ignore it.

I should also add a sanity check in the FUNCID code as well, but this
isn't wrong since the check is cheap and happens infrequently.
2003-09-05 03:08:08 +00:00
Sam Leffler 2fad1e931e lock ip fragment queues
Submitted by:	Robert Watson <rwatson@freebsd.org>
Obtained from:	BSD/OS
2003-09-05 00:10:33 +00:00
Sam Leffler 26f91065e7 o add locking
o move the global divsrc socket address to a local variable
  instead of locking it

Sponsored by:	FreeBSD Foundation
2003-09-05 00:00:51 +00:00
Sam Leffler e0111e4de5 Reduce window during which a race can occur when detaching
an interface from each descriptor that references it. This
is just a bandaid; the locking here needs to be redone.
2003-09-04 22:27:45 +00:00
Poul-Henning Kamp f03bec944d Make sure to return ENOIOCTL if the ioctl is not handled. 2003-09-04 21:23:46 +00:00
Nate Lawson faf9513401 Calling KNOTE with locks held may result in recursion when it calls back
into targreadfilt().  Unlock around calls to notify_user().  If an application
is sending CCBs while the endpoint is shutting down, this may result in
incomplete disable.  A more complete solution will come with a "dying" flag.

Submitted by:	simokawa
2003-09-04 16:30:03 +00:00
Nate Lawson 5512662bdf Upon receiving a CCB for a LUN that is not enabled, be sure to unlock the
softc on exit.

Submitted by:	simokawa
2003-09-04 16:05:41 +00:00
Nate Lawson f97739da4d Don't free the buffer if it wasn't actually allocated. 2003-09-04 15:55:41 +00:00
Thomas Moestl eec804bbb8 Use stream bus space accesses to program the ID (station address)
registers; otherwise, the byte order of the address is changed on
big-endian machines.
2003-09-04 15:39:44 +00:00
Thomas Moestl 2cda2e47da - Clear the CE AFSR bits which indicate the error condition when handling
a correctable DMA error. Failing to do so can cause the error interrupt
  to be triggered over and over again.
- Clean up the comments for UEAFSR_* constants, fix a typo (UEAFSR_BLK is
  (1 << 23), not (1 << 22)), and add two more. Also, add similar constants
  for the CE AFSR bits.
2003-09-04 15:25:10 +00:00
Diomidis Spinellis cf669e5456 KNF: parentheses around return values.
Suggested by:	bde
Approved by:	schweikh (mentor - blanket)
MFC after:	6 weeks
2003-09-04 11:27:13 +00:00
Nate Lawson f3e99b763a Remove the quirk for the FujiFilm camera. Submitter indicates it is now
working without the quirk.

PR:
Submitted by:	guido
Reviewed by:
Approved by:
Obtained from:
MFC after:	30 days
2003-09-04 01:01:20 +00:00
John Baldwin b66752c4a1 Bring back PCIR_HEADERTYPE as an alias for PCIR_HDRTYPE under BURN_BRIDGES
for backwards compat.  The old name will be gone in 6.0, but will be
around in 5.x.  This will help unbreak 3rd party code, e.g. the nvidia
DRM module.
2003-09-03 17:48:22 +00:00
John Baldwin ab551d918c Replace another instance of PCIR_MAPS with PCIR_BAR(x).
Reminded by:	dfr
2003-09-03 15:24:31 +00:00
Kenneth D. Merry 700a0cbaca Unbreak buildworld. sys/taskqueue.h is a kernel-only include.
Pointy Hat to:	ken
2003-09-03 12:31:03 +00:00
Poul-Henning Kamp c679c73452 Use the quality to disable timecounters for which we deem Hz too low. 2003-09-03 08:14:16 +00:00
Poul-Henning Kamp 753374dad4 Give the ELAN timecounter better quality than i8254 2003-09-03 08:13:12 +00:00
Poul-Henning Kamp 27cb47196a Add BOOT_PXELDR_ALWAYS_SERIAL option which forces serial console. 2003-09-03 08:12:20 +00:00
David E. O'Brien 0204ca844f Recognize the OHCI USB device on Opteron-based nForce3 motherboards
(such as the Asus SK8N).
2003-09-03 07:40:17 +00:00
Poul-Henning Kamp 8196d06a54 Examine and record the Silicon Revision Register on NS parts.
We can't update the device description in attach (why not ?), so
we device_print() what we find.

Conditionalize the short cable fix on this being older than rev 16A.

Call device_printf() when we apply short cable fix.

Include interrupt hold-off setting for rev 16+ under "#ifdef notyet"

The device_printf()'s will go under bootverbose once the various
issues have settled a bit.
2003-09-03 07:40:04 +00:00
David E. O'Brien bbee264035 Recognize the sound chip on the Opteron-based nForce3 motherboards
(such as the Asus SK8N).
2003-09-03 07:38:21 +00:00
Kenneth D. Merry cb32189e23 Move dynamic sysctl(8) variable creation for the cd(4) and da(4) drivers
out of cdregister() and daregister(), which are run from interrupt context.

The sysctl code does blocking mallocs (M_WAITOK), which causes problems
if malloc(9) actually needs to sleep.

The eventual fix for this issue will involve moving the CAM probe process
inside a kernel thread.  For now, though, I have fixed the issue by moving
dynamic sysctl variable creation for these two drivers to a task queue
running in a kernel thread.

The existing task queues (taskqueue_swi and taskqueue_swi_giant) run in
software interrupt handlers, which wouldn't fix the problem at hand.  So I
have created a new task queue, taskqueue_thread, that runs inside a kernel
thread.  (It also runs outside of Giant -- clients must explicitly acquire
and release Giant in their taskqueue functions.)

scsi_cd.c:	Remove sysctl variable creation code from cdregister(), and
		move it to a new function, cdsysctlinit().  Queue
		cdsysctlinit() to the taskqueue_thread taskqueue once we
		have fully registered the cd(4) driver instance.

scsi_da.c:	Remove sysctl variable creation code from daregister(), and
		move it to move it to a new function, dasysctlinit().
		Queue dasysctlinit() to the taskqueue_thread taskqueue once
		we have fully registered the da(4) instance.

taskqueue.h:	Declare the new taskqueue_thread taskqueue, update some
		comments.

subr_taskqueue.c:
		Create the new kernel thread taskqueue.  This taskqueue
		runs outside of Giant, so any functions queued to it would
		need to explicitly acquire/release Giant if they need it.

cd.4:		Update the cd(4) man page to talk about the minimum command
		size sysctl/loader tunable.  Also note that the changer
		variables are available as loader tunables as well.

da.4:		Update the da(4) man page to cover the retry_count,
		default_timeout and minimum_cmd_size sysctl variables/loader
		tunables.  Remove references to /dev/r???, they aren't used
		any longer.

cd.9:		Update the cd(9) man page to describe the CD_Q_10_BYTE_ONLY
		quirk.

taskqueue.9:	Update the taskqueue(9) man page to describe the new thread
		task queue, and the taskqueue_swi_giant queue.

MFC after:	3 days
2003-09-03 04:46:28 +00:00
Jeff Roberson cfd5600c66 - Several of the callers to getdirtybuf() were erroneously changed to pass
in a list head instead of a pointer to the first element at the time of
   the first call.  These lists are subject to change, and getdirtybuf()
   would refetch from the wrong list in some cases.

Spottedy by:	tegge
Pointy hat to:	me
2003-09-03 04:08:15 +00:00
Bruce M Simpson 8a538743b5 PR: kern/56343
Reviewed by:	tjr
Approved by:	jake (mentor)
2003-09-03 02:19:29 +00:00
David E. O'Brien be8d2cbf2c MFi386: add device ataraid, this is now seperate and not pulled in by atadisk. 2003-09-03 01:24:47 +00:00
David E. O'Brien debffe8383 Support the nForce3 chip found on Opteron motherboards:
atapci0: <nVidia nForce3 UDMA133 controller>

Approved by:	sos
2003-09-02 21:02:46 +00:00
Sam Leffler 28ace1bf60 move domain list mutex initialization to earlier in the boot sequence so
statically configured modules like netgraph can call net_init_domain

Noticed by:	D.Rock@t-online.de (D. Rock)
2003-09-02 20:59:23 +00:00
Marcel Moolenaar 2ec1dc3639 Add function OF_decode_addr(). This function obtains the physical
address of the device identified by its phandle_t by traversing OFW's
device tree. The space and address returned by this function can
subsequently be passed to sparc64_fake_bustag() to construct a valid
tag and handle for use by the newbus I/O functions.

Use of this function is expected to be limited to pre-newbus access to
devices, such as consoles and keyboards.

Partially obtained from: tmm
Reviewed by: jake, jmg, tmm
SBus testing made possible by: jake
Tested with: LINT
2003-09-02 20:32:12 +00:00
Marcel Moolenaar 11a91bffe5 Preparatory commit to allow prototypes in ofw_machdep.h to contain
both newbus types and OFW types. This involves either including
<machine/bus.h> or <dev/ofw/openfirm.h>.

Reviewed by: jake, jmg, tmm
2003-09-02 20:24:42 +00:00
Marcel Moolenaar e43e17a2e6 Move the inclusion of <machine/ofw_machdep.h> after the inclusion of
<dev/ofw/openfirm.h> to allow the former to contain prototypes that
use types defined in the latter.

Reviewed by: mjacob@
2003-09-02 19:52:31 +00:00
John Baldwin e27951b29c Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by:	imp, gibbs
Tested by:		i386 LINT
2003-09-02 17:30:40 +00:00
John Baldwin 56802c46e2 - Deprecate PCIR_MAPS under BURN_BRIDGES (meaning it will be gone in 6.0)
and replace it with the more intuitive name PCIR_BARS.
- Add a PCIR_BAR(x) macro that returns the config space register offset of
  the 32-bit BAR x.

MFC after:	3 days
2003-09-02 17:11:27 +00:00
Diomidis Spinellis 5a5f2134b8 Fix errno return values to better represent failure reasons for
read and open.

Approved by:	schweikh (mentor)
Agreed:		bde
MFC after:	6 weeks
2003-09-02 16:46:31 +00:00
Søren Schmidt b57e5e1898 cosmetics 2003-09-02 15:53:01 +00:00
Søren Schmidt dce3b7cc71 Adjust the max transfer size used. 2003-09-02 13:26:02 +00:00
Scott Long 1b4404f9ab Prepare for locking mlx(4) by cleaning up the use of busdma. No real
functional changes should result from this.
2003-09-02 08:30:31 +00:00
Poul-Henning Kamp afeb65e61d Don't open with exclusive bit, swapon(8) wants to trash our swapdev.
Add XXX comment with a rating of this concept.
2003-09-02 05:53:44 +00:00
Poul-Henning Kamp 497c334767 Simplify the ioctl handling in GEOM.
This replaces the current ioctl processing with a direct call path
from geom_dev() where the ioctl arrives (from SPECFS) to any directly
connected GEOM class.

The inverse of the above is no longer supported.  This is the
situation were you have one or more intervening GEOM classes, for
instance a BSDlabel on top of a MBR or PC98.  If you want to issue
MBR or PC98 specific ioctls, you will need to issue them on a MBR
or PC98 providers.

This paves the way for inviting CD's, FD's and other special cases
inside GEOM.
2003-09-01 20:45:32 +00:00
Scott Long 8778f63db2 Commands submitted through the management interface won't have scatter/
gather lists.  Stop ignoring them and instead call the callback directly.
This unbreaks the management interface.
2003-09-01 20:44:18 +00:00
Eivind Eklund 2ae51145e8 Change clean_map from a global to an auto variable 2003-09-01 16:46:47 +00:00
Doug Rabson d37a68d05a Don't try to enable io or memory access for non-standard resource
addresses. This stops resource allocations for e.g. amdpm failing - this
has its own special ways of enabling access.
2003-09-01 15:01:49 +00:00
Doug Rabson 21c5ddf529 Add support for AMD766 and AMD768 chipsets.
PR: 41812
2003-09-01 14:58:34 +00:00
Poul-Henning Kamp ce1ee7895e Try to close the race between disk_destroy() and a subsequent disk_create(). 2003-09-01 12:03:13 +00:00
Søren Schmidt 7c78880561 Rearrange the probe code yet again. 2003-09-01 11:13:21 +00:00
Bernd Walter c4bc00e509 Try a port reset if initial contact to a device failed.
tested by:	Lee Damon <nomad@castle.org>
2003-09-01 07:47:42 +00:00
Marcel Moolenaar f02e8e8122 Use pmap_steal_memory() for the msgbuf instead of trying to squeeze
it in the last chunk (phys_avail block). The last chunk very often is
not larger than one or two pages, resulting in a msgbuf that's too
small to hold a complete verbose boot.
Note that pmap_steal_memory() will bzero the memory it "allocates".
Consequently, ia64 will never preserve previous msgbufs. This is not
a noticable difference in practice. If the msgbuf could be reused,
it was invariably too small to have anything preserved anyway.
2003-09-01 07:06:57 +00:00
Mike Silbersack 3390d47670 Implement MBUF_STRESS_TEST mark II.
Changes from the original implementation:

- Fragmentation is handled by the function m_fragment, which can
be called from whereever fragmentation is needed.  Note that this
function is wrapped in #ifdef MBUF_STRESS_TEST to discourage non-testing
use.

- m_fragment works slightly differently from the old fragmentation
code in that it allocates a seperate mbuf cluster for each fragment.
This defeats dma_map_load_mbuf/buffer's feature of coalescing adjacent
fragments.  While that is a nice feature in practice, it nerfed the
usefulness of mbuf_stress_test.

- Add two modes of random fragmentation.  Chains with fragments all of
the same random length and chains with fragments that are each uniquely
random in length may now be requested.
2003-09-01 05:55:37 +00:00
Sam Leffler 6464079f10 Locking and misc cleanups; most of which I've been running for >4 months:
o add locking
o strip irrelevant spl's
o split malloc types to better account for memory use
o remove unused IPSEC_NONBLOCK_ACQUIRE code
o remove dead code

Sponsored by:	FreeBSD Foundation
2003-09-01 05:35:55 +00:00
Sam Leffler 638ed548b7 add locking
NB: There is a known LOR on the forwarding path; this needs to be resolved
    together with a similar issue in the bridge.  For the moment it is
    believed to be benign.

Sponsored by:	FreeBSD Fondation
2003-09-01 05:12:36 +00:00
Sam Leffler b9651df42c o interlock domain list when adding domains
o remove irrlevant spl

Notes:

1. We don't lock domain list traversals as this is safe until we start
   removing domains.
2. The calculation of max_datalen in net_init_domain appears safe as
   noone depends on max_hdr and max_datalen having consistent values.
3. Giant is still held for fast and slow timeouts; this must stay until
   each timeout routine is properly locked (coming soon).

Sponsored by:	FreeBSD Fondation
2003-09-01 05:01:55 +00:00
Sam Leffler 611ceef62a remove warning about use of old divert sockets; this was marked
for removal before 5.2

Reviewed by:	silence on -net and -arch
2003-09-01 04:27:34 +00:00
Sam Leffler 3b6dd5a9d0 add locking
Sponsored by:	FreeBSD Foundation
2003-09-01 04:23:48 +00:00
Sam Leffler f07a6d989f Explicitly enable probe request frame reception when not in station mode;
this is needed for the 5212 which a separate filter bit for these frames.

Submitted by:   Stephane Laroche <stephane.laroche@colubris.com>
2003-09-01 03:12:19 +00:00
Alexander Kabaev 1d49585050 Standardize idempotentcy ifdefs. Consistently use _MACHINE_VARARGS_H_
symbol.
2003-09-01 03:01:45 +00:00
Sam Leffler 7997bcbc55 o correct logic that checks frame size to decide if a cluaster is needed
o add an assertion to check the max possible packet size

Noticed by:	David Young <dyoung@pobox.com>
2003-09-01 02:55:09 +00:00
John-Mark Gurney c5b3755306 eliminate casts from the DMAADDR macro. This depends upon bus_addr_t being
a type that you can do arithmetic with.  This eliminates many warnings when
compiling with PAE.

Various by:	scottl
2003-09-01 01:07:24 +00:00
Scott Long 0bcbebd6df If ~ chars were pennies, I'd be pennyless. This should fix all of the
'command not in queue' panics.  Also fix a nearby style problem.
2003-09-01 00:20:29 +00:00
Marcel Moolenaar 47f756866a Use direct mapped KVA for the sf_buf allocator, as made possible
by the previous commit. While here, fix a typo, reformat comments
and fix a long line.

Tested with: ftpd
2003-09-01 00:12:27 +00:00
Jake Burkholder 93dee5536e Implement cpu_set_upcall_kse. May need tweaking. 2003-08-31 22:58:56 +00:00
Nate Lawson 5fd86f39d0 Update the comment to indicate ICH5 support 2003-08-31 19:23:00 +00:00
Poul-Henning Kamp f633e00615 Detect Geode CPUs and initialize the 27MHz timecounter "Geode".
This timecounter is 2usec faster than the i8254 and has 22 times
better resolution.
2003-08-31 16:20:34 +00:00
Jeff Roberson 23efe6dafc - Backout rev 1.142. This caused a deadlock that I do not understand. More
investigation is required.
2003-08-31 11:26:52 +00:00
Jeff Roberson d919a11d06 - Define a new flag for getblk(): GB_NOCREAT. This flag causes getblk() to
bail out if the buffer is not already present.
 - The buffer returned by incore() is not locked and should not be sent to
   brelse().  Use getblk() with the new GB_NOCREAT flag to preserve the
   desired semantics.
2003-08-31 08:50:11 +00:00
Jeff Roberson a0ebaaddef - Don't acquire the vnode interlock in drain_output(). Instead, require the
caller to acquire it.  This permits drain_output() to be done atomically
   with other operations as well as reducing the number of lock operations.
 - Assert that the proper locks are held in drain_output().
 - Change getdirtybuf() to accept a mutex as an argument.  This mutex is used
   to protect the vnode's buf list and the BKGRDWAIT flag.  This lock is
   dropped when we successfully acquire a buffer and held on return
   otherwise.  These semantics reduce the number of cumbersome cases in
   calling code.
 - Pass the mtx from getdirtybuf() into interlocked_sleep() and allow this
   mutex to be used as the interlock argument to BUF_LOCK() in the LOCKBUF
   case of interlocked_sleep().
 - Change the return value of getdirtybuf() to be the resulting locked buffer
   or NULL otherwise.  This is for callers who pass in a list head that
   requires a lock.  It is necessary since the lock that protects the list
   head must be dropped in getdirtybuf() so that we don't have a lock order
   reversal with the buf queues lock in bremfree().
 - Adjust all callers of getdirtybuf() to match the new semantics.
 - Add a comment in indir_trunc() that points at unlocked access to a buf.
   This may also be one of the last instances of incore() in the tree.
2003-08-31 07:29:34 +00:00
Nate Lawson 58f946c5f5 Add support for the 82801EB (ICH5) SMBus controller.
PR:		kern/55485
Submitted by:	Shin-ichi Yoshimoto <yosimoto@waishi.jp>
MFC after:	1 day
2003-08-31 01:28:02 +00:00
Jeff Roberson a7db559087 - If there is no vp assume that BKGRDINPROG is not set and set RELPBUF in
brelse().
2003-08-31 01:07:45 +00:00
Jeff Roberson b5c61abd82 - In some cases bp->b_vp can be NULL in brelse, don't try to lock the
interlock in that case.

Found by:	alc
2003-08-31 00:06:07 +00:00
Alan Cox 3562af1215 - Add vm object locking to the part of vm_pageout_scan() that launders
dirty pages.
 - Remove some unused variables.
2003-08-31 00:00:46 +00:00