Commit Graph

12155 Commits

Author SHA1 Message Date
Hidetoshi Shimokawa
5a11c2d9ea Sync with DragonFly BSD. 2004-09-24 12:43:57 +00:00
Poul-Henning Kamp
969d098b0f Hold thread reference while we frob cdevsw. 2004-09-24 08:12:41 +00:00
Peter Wemm
beafe28690 Implement the KDENABIO etc ioctl's for amd64 as well. 2004-09-24 01:19:11 +00:00
Peter Wemm
d88cc59371 Implement the syscons mouse pointer characters for amd64. It was only
implemented for i386 and alpha.
2004-09-24 01:18:22 +00:00
Peter Wemm
2169193596 Converge towards i386. I originally resisted creating <machine/pc/bios.h>
because it was mostly irrelevant - except for the silly BIOS_PADDRTOVADDR
etc macros.  Along the way of working around this, I missed a few things.

* Make syscons properly inherit the bios capslock/shiftlock/etc state like
  i386 does.  Note that we cannot inherit the bios key repeat rate because
  that requires a bios call (which is impossible for us).
* Give syscons the ability to beep on amd64.  Oops.

While here, make bios.c compile and add it to files.amd64.
2004-09-24 01:08:34 +00:00
Olivier Houchard
b19d97eb9c Re-route interrupts on arm as well. 2004-09-23 22:58:43 +00:00
Olivier Houchard
2ae0fcd220 Do not use the IO-mapping to issue the reset on the 82546 on arm. For some
reason, it results in corrupted descriptors.
2004-09-23 22:57:53 +00:00
Joerg Wunsch
02910eee10 Implement terminating the worker thread when the driver is about to
be deregistered.

Not yet tested, since by now, GEOM doesn't want us to deregister.  PHK
wants to fix that RSN.
2004-09-23 21:12:21 +00:00
Poul-Henning Kamp
3ad06fbb46 Remove bogus cdevsw frobbing code which tries to prevent double
loading of modules.

MODULE_VERSION() should be used for this I belive.
2004-09-23 12:21:11 +00:00
Matt Jacob
6976709916 PAE support changes that included at least some minimal actual testing
with a kernel that booted.
2004-09-23 05:25:22 +00:00
Stefan Farfeleder
e7b80a8e24 Prefer C99's __func__ over GCC's __FUNCTION__. 2004-09-22 17:16:04 +00:00
John Baldwin
e0a9358679 Add a couple of macros to extract the PCI slot (device) and function from
an ACPI _ADR value and use that rather than inlining the same shifts and
masks everywhere.
2004-09-22 15:46:16 +00:00
Warner Losh
9c3ae2ef4b Add a temporary workaround to the panic on boot with hub attached and
panic on hub detach bugs that have been reported.  This work around
detaches the device before deleting it.  This changes the detach order
from in-order to pre-order.  This avoids uhub's deleting the children
after its subdevs has been deleted.

This is only a workaround.  This leads to a strange condition in the
device tree where attached devices are children of detached ones.  I
really don't know what that's supposed to mean, but does violate my
sense of POLA.  Fortunately, the violation is short lived, which is
why I'm going ahead and committing the work around.

# We really need to consider life w/o the multiple nested layers of
# compatibility macros.  They make finding bugs like this *MUCH*
# harder.

Patch by: iadowse

MT5 before: next_release(5.3-BETA5) (unless someting better comes along)
2004-09-22 06:02:10 +00:00
Nate Lawson
95c973ff52 Initialize the flags value properly. We used to do this in acpi_tz_all_off()
but that function has been removed.  This avoids a potential unnecessary
fan switch on boot.  Also remove some commented out code.

MFC after:	3 days
2004-09-21 18:39:10 +00:00
Nate Lawson
ba36768b22 Don't disable acpi in shutdown if we're panicing (panicstr != NULL). This
may help with double panics.
2004-09-21 17:19:38 +00:00
Dag-Erling Smørgrav
c70315d4a8 Correct the capitalization of "nVidia". 2004-09-21 13:17:55 +00:00
Yoshihiro Takahashi
31eac965cd MFpc98: Check a pointer is NULL, remove unused variable. 2004-09-20 13:55:26 +00:00
MIHIRA Sanpei Yoshiro
82ad8eff9e Add support Nvidia nForce2(audio)
PR:		kern/71317
Submitted by:	Mezz <mezz@freebsd.org>
MFC after:	1 week
2004-09-20 07:19:49 +00:00
John-Mark Gurney
aedd16d964 trim trailing white space..
call the re mutex by it's name..

MFC after:	3 days
2004-09-20 06:33:37 +00:00
Warner Losh
083ba097fd das@ has a ACPI bios that lists 0x3f0-0x3f1, 0x3f2-0x3f3, 0x3f4-0x3f5
and 0x3f7.  fdc_isa_alloc_resource() didn't work right in this case
(it accessed FDOUT correctly due to an overflow of the first resource.
It accesed FDSTS and FDDATA incorrectly via the second resource (which
wound up accessing FDOUT and the tape register at 0x3f3) and badly for
the CTL register (at location 0x3f4).  This is a minimal fix that just
'eats' the first one if it covers two locations and has an offset of
0.  This confusion lead the floppy driver to think there'd been a disk
change, which uncovered a deadlock in the floppy/geom code which lead
to a panic.  These changes fix that by fixing the underlying resource
problem, but doesn't address the potential deadlock issue that might
still be there.

This is a minimal fix so it can more safely be merged into 5 w/o risk
for known working configurations (hence the use of the ugly goto,
which reduces case 8 to case 6 w/o affecting cases 1-7).  A more
invasive fix that will handle more ACPI resource list diversity is in
the pipeline that should kill these issues once and for all, while
staying within the resources that we allocate.

Tested/Reported by: das
Reviewed by: njl
MFC before: re->next_release_name(5.3-BETA5);
2004-09-20 06:12:19 +00:00
MIHIRA Sanpei Yoshiro
e99e85532a Add support nForce3 250 audio
PR:		kern/71726
Submitted by:	FUJIMOTO Kou <fujimoto@j.dendai.ac.jp>
MFC after:	1 week
2004-09-20 05:59:17 +00:00
Nate Lawson
520467d3ba Record a problem we can't workaround for now regarding duplicate interrupts
because of links left enabled while in APIC mode.  A large scale rework of
irq links is underway by jhb@ which should fix this eventually.
2004-09-20 05:56:01 +00:00
MIHIRA Sanpei Yoshiro
4e526aae71 add '/* Panasonic products */' line(I removed it) 2004-09-20 04:56:13 +00:00
Marius Strobl
9aee2491ec Fix compilation of vinum(4) when VINUMDEBUG is not defined.
PR:		71341
Submitted by:	Phil Budne <phil@tripadvisor.com>
MT5 candidate.
2004-09-20 00:13:10 +00:00
Marius Strobl
46b3f0f811 Correct value and description of the unused MK48TXX_WDAY_FT macro. 2004-09-20 00:09:32 +00:00
Poul-Henning Kamp
e8f89940e2 Commit the new version of the adlink driver which can do non-cyclic
capture.  Now we just need somebody to write a gnu-radio frontend :-)
2004-09-19 21:52:15 +00:00
Marius Strobl
6b1c98e2be - Some of the upper bits of the time related (seconds, minutes, etc.)
registers are control bits or depending on the model contain additional
  time bits with a different meaning than the lower ones. In order to
  only read the desired time bits and not change the upper bits on write
  use appropriate masks in the gettime and settime function respectively.
  Due to the polarity of the stop oscillator bit and the fact that the
  century bits aren't used on sparc64 not masking them didn't cause
  problems so far.
- Fix two off-by-one errors in the handling of the day of week. The
  genclock code represents the dow as 0 - 6 with 0 being Sunday but the
  mk48txx use 1 - 7 with 1 being Sunday. In the settime function when
  writing the dow to the clock the range wasn't adjusted accordingly but
  the clock apparently played along nicely otherwise the second bug in
  the gettime function which mapped 1 - 7 to 0 - 6 but with 0 meaning
  Saturday would have been triggered. Fixing these makes the date being
  stored in the same format Sun/Solaris uses and cures the "Invalid time
  in real time clock. Check and reset the date immediately!" when the
  date was set under Solaris prior to booting FreeBSD/sparc64. [1]
  Looking at other clock drivers/code e.g. FreeBSD/alpha the former "bug",
  i.e. storing the dow as 0 - 6 even when the clock uses 1 - 7, seems to
  be common but might be on purpose for compatibility when multi-booting
  with other OS which do the same. So it might make sense to add a flag
  to handle the dow off-by-one for use of this driver on platforms other
  than sparc64.
- Check the state of the battery on mk48txx that support this in the
  attach function.
- Add a note that use of the century bit should be implemented but isn't
  required at the moment because it isn't used on sparc64.

Problem noted by:	joerg [1]
MT5 candidate.
2004-09-19 21:38:11 +00:00
John-Mark Gurney
6102153685 spell RX correctly
don't call re_rxeof a second time when we've already done the work
pull common code out from if and else clauses

MFC after:	3 days
2004-09-19 17:51:41 +00:00
Ian Dowse
abb67fff1c Add Sitecom's LN-029 USB 2.0 Ethernet adapter. 2004-09-18 19:48:10 +00:00
Maxime Henrion
048ca166ff Add support for the fxp(4) based card in ICH6 (i915) chipsets.
This is a RELENG_5 candidate.

Submitted by:	Mike Tancsa <mike@sentex.net>
2004-09-18 19:13:13 +00:00
John-Mark Gurney
80a2a305b2 pass in pointer to m_head to re_encap because m_defrag could free the
original mbuf causing a free'd mbuf passed to bpf later and panic'ing the
system..  This should only effect jumbo frames.

MFC after:	5 days
2004-09-18 18:08:28 +00:00
Poul-Henning Kamp
9e51d6f15d Use tty->t_sc to find out softc. 2004-09-18 16:43:44 +00:00
Pawel Jakub Dawidek
e4cdd0d4b5 Actually this order (unlock, wakeup) in this case is race-safe and can
save us 2 context switches.

Explained by:	njl
2004-09-18 09:16:19 +00:00
Poul-Henning Kamp
08d79b63f6 Fix an issue with ng_tty which (ab)used the tty->t_sc field which is
reserved for the device drivers:

Add a t_lsc field for line discipline private use.
2004-09-17 22:26:27 +00:00
Poul-Henning Kamp
dfcb390b5b Fix compilation again. 2004-09-17 19:24:58 +00:00
Warner Losh
27df52f999 The long dead hand of the past has pushed forward useless bits in this
driver.  Trim its fingernails by removing some useless bits before
fixing the 'thread not terminated on detach' problem.

o dmacnt is no longer used now that we allocate at attach time.  Remove
  it from struct fdc_data.
o ISPNP was only ever set, but never tested.  It used to be used for the
  allocation routines to change how it allocated resources.  Since that's
  no longer necessary, retire the flag.
o ISPCMICA was only ever tested, but never set.  GC it.  This removes
  a special case in determining the drive type.  The drive type is
  now set in fdc_pcmcia.c, so the hack isn't needed anymore.  Sadly,
  this isn't tested with a Y-E Data pcmcia floppy drive because there
  are a number of other issues that preclude it from working.
o Fix ifdef for reading from the rtc.  I'm of the opinion that this ifdef
  should be moved into fdc_isa.c, but not today as ideally there'd be
  other fixes to the probing of children.  So now we just read it on
  i386 ! pc98 (there's no #define for MACHINE_ARCH, just MACHINE, hence
  this slightly inelegant kludge) and amd64.  The PC98 exclusion likely
  isn't meaningful since pc98 uses a different driver, but will be when
  merging of the pc98 floppy code into this driver is complete (this is the
  other reason I think this block of code belongs outside fdc.c).

All of these changes are safe to MT5.
2004-09-17 18:50:38 +00:00
Poul-Henning Kamp
d75207f145 Overhaul ucom serial driver by using generic stuff instead of homerolled
all over the place.
2004-09-17 11:53:45 +00:00
Poul-Henning Kamp
a45b36ad47 Use ttyalloc() instead of ttymalloc(NULL) 2004-09-17 07:28:07 +00:00
Bill Paul
dc961de0b4 Commit patch to supress spurious link change events. Apparently, with
copper NICs, a link change event is posted whenever MII autopolling is
toggled off and on, which happens whenever someone calls
bge_miibus_readreg() or bge_miibus_writereg() to access the PHY
registers. This means anytime someone called the SIOCGIFMEDIA ioctl
on a bge interface, the link would reset. Even a simple "ifconfig bge0"
would do it, though other apps like dhclient or the PPPoE daemon could
trigger it as well. An obvious symptom of this problem is lots of
"bgeX: gigabit link up" messages appearing on the console for no
apparent reason.

Through experimentation, I determined that when a real link change
event occurs, the BGE_MIMODE_AUTOPOLL in the BGE_MI_MODE register
is always set, so now if we have a copper NIC and an link change
event occurs and the BGE_MIMODE_AUTOPOLL bit is clear, we ignore
the event.

Note that this does not apply to the original BCM5700 chip since we
use a different method for sensing link changes with that chip (the
status block method was broken), nor to fiber optic NICs since they
don't use the GMII PHY access registers.
2004-09-17 04:58:17 +00:00
Nate Lawson
a3f51d1971 Handle _FDE results of 5 bytes (vs. 5 uint32_t's). BIOS vendors find yet
another way to misinterpret the spec.  Also, always fall back to the hints
probe on any attach failure, not just when _FDE fails.

Thanks to imp and scottl for finding this.

Tested by:	rwatson (minimally)
MFC after:	5 days
2004-09-17 04:14:38 +00:00
Pawel Jakub Dawidek
b830359bc5 - Make md(4) 64-bit clean.
After this change it should be possible to use very big md(4) devices.
- Clean up and simplify the code a bit.
- Use humanize_number(3) to print size of md(4) devices.
- Add 't' suffix which stands for terabyte.
- Make '-S' to really work with all types of devices.
- Other minor changes.
2004-09-16 21:32:13 +00:00
Pawel Jakub Dawidek
fcd57fbe6f There is no need to keep 'npage' value inside our softc structure,
it is only used in one function. While doing so, change its type to
vm_ooffset_t.
We are still limited for swap-backed devices to 16TB on 32-bit architectures
where PAGE_SIZE is 4096 bytes.
2004-09-16 20:38:11 +00:00
Poul-Henning Kamp
4aa1a77d6f Allocate tty at attach time rather than open time.
Use the init/lock*in/out fields in struct tty and remove them from our softc.

Use tty->t_sc to find out softc when convenient.

Mostly OK'ed by:	bde
2004-09-16 19:46:23 +00:00
Pawel Jakub Dawidek
a8a58d03f6 - Do not use bio_pblkno as it is going away anyway.
- Prefer bio_length than bio_bcount.
2004-09-16 19:42:17 +00:00
Pawel Jakub Dawidek
4b07ede4a7 First wakeup, then unlock. 2004-09-16 18:59:19 +00:00
Pawel Jakub Dawidek
6ab0a0aefe Type 'int' is too small for 'i' and 'lastp' variables. Use proper type,
which is vm_pindex_t (unsigned 64bit on i386).
2004-09-16 18:56:20 +00:00
Nate Lawson
ad7b13796e Don't print a warning message if the _CRS value is empty. This is already
covered by other printfs under ACPI_DEBUG and is not a failure case.

MFC after:	3 days
2004-09-16 17:19:16 +00:00
Søren Schmidt
a49513587b Ignore leading '_' in model name returned by devices.
This make "_NEC" devices appear as "NEC" which is more corrent.
The reason is tha NEC originally screwed up on the byteorder in the
model string, so now that they have realized that they prefixed the '_'
so that not every ATA driver on the planet would call them "EN C" :)
2004-09-16 09:35:01 +00:00
Warner Losh
f6ddde7cfa default: case shouldn't set an error yet either. 2004-09-16 06:37:05 +00:00
Warner Losh
7964bd0c70 Reserve the DMA memory at attach time, rather than at use. While
reserving it at use time is more miserly, low memory (< 16MB)
evaporates quickly on many systems, so there may not be any suitable
buffers available.  This specifically doesn't use the newer, fancier
isa_dma_init to ease merging to 5.

Reviewed by: tegge, phk
2004-09-16 06:34:00 +00:00