Commit Graph

12263 Commits

Author SHA1 Message Date
Lukas Ertl
fb88672937 Add support for the Vodafone Mobile Connect 3G datacard. 2004-10-16 21:27:28 +00:00
Justin T. Gibbs
a1a3da9b38 Skip probe attempts for ISA PnP devices.
Pointed out by: imp
2004-10-15 23:39:52 +00:00
Nate Lawson
ecb7c87d1c Re-add an acpi attachment for the legacy probe that was inadvertently
removed.
2004-10-15 05:13:25 +00:00
Nate Lawson
926660271c Remove unused variable. Pointy hat candidate. 2004-10-15 04:54:16 +00:00
Sam Leffler
1ab4eff43b add missing ';' that didn't show up with INVARIANTS enabled 2004-10-15 03:54:56 +00:00
Pyun YongHyeon
cea54ee291 Plug possible memory leak in sound DMA buffer handling. It also
changes return code to ENOMEM in case of allocation failure.

Approved by:	jake (mentor), scottl (co-mentor)
Reviewed by:	truckman, matk
2004-10-15 03:50:04 +00:00
Alexander Kabaev
95cb3d1a6b Use a taskqueue rather than an swi to handle deferred notifications.
Obtained from:	same change for umct(4) driver.
2004-10-15 03:44:56 +00:00
Sam Leffler
fe9b390b9d Move session state from on-card memory to host memory so we no longer are
constrained to a small number of sessions by the small on-card memories found
in newer devices.  This is really a stopgap solution as having session state
in main memory incurs a (small but noticeable) performance penalty. The better
solution is to manage session state so that it's cached on chip.

Obtained from:	openbsd
2004-10-15 00:36:07 +00:00
Nate Lawson
e5979322ba Remove local hacks to set flags now that the device probe does this for us.
Tested on every device except sio_pci and the pc98 fd.c.  Perhaps something
similar should be done for the "disabled" hints also.

MFC after:	2 weeks
2004-10-14 22:21:59 +00:00
Poul-Henning Kamp
1919daf339 Remove unused ttys field.
Spotted by:	Peter Jeremy <PeterJeremy@optushome.com.au>
2004-10-14 18:37:59 +00:00
Poul-Henning Kamp
097afe9133 Fix echo in console mode. 2004-10-14 08:58:28 +00:00
Brian Feldman
9b4fab9ef6 Fix a spelling error in a panic string. 2004-10-14 03:05:39 +00:00
Hidetoshi Shimokawa
370f9086a6 Fix warnings on non-i386 arch.
Submitted by: keramida
2004-10-14 00:21:32 +00:00
Søren Schmidt
b2d35a0408 Refine locking so it covers the "running" variable as well.
Adjust comments etc to fit the new locking system.
2004-10-13 15:16:35 +00:00
Lukas Ertl
d533a2843b Add device IDs for Intel ICH6.
PR:             kern/72492
Submitted by:   Florian Le Goff <madflo@beertech.org>
2004-10-13 14:51:42 +00:00
Poul-Henning Kamp
6c3f1a47fe Use generic tty code instead of local copy. 2004-10-13 09:27:18 +00:00
Poul-Henning Kamp
9cb9afbd68 Use generic tty code instead of local stuff.
NB:  device names are now consistent:  {cua,tty}d$(port)[.lock,.init]
2004-10-13 08:27:20 +00:00
Nate Lawson
2c8d3b23ed Print before the footer, not after. 2004-10-13 07:29:29 +00:00
Nate Lawson
a91c5fa830 If flags are present, print them like ISA does.
MFC after:	1 day
2004-10-13 07:27:21 +00:00
Poul-Henning Kamp
1acd87a81f First half of tty code rework: unifdef -D__FreeBSD_Version=600000
The changes in the next commit would make the code totally unreadable
if the #ifdef'ing were maintained.

It might make a lot of sense to split if_cx.c in a netgraph related
and in a tty related file but I will not attempt that without hardware.
2004-10-13 07:02:56 +00:00
Pyun YongHyeon
a2f4d2f5b0 Limit DMA address space to 1GB since the trident audio cards can't
handle DMA addresses located above 1GB. The LBA(loop begin address)
register which holds DMA base address is 32bits register. But the
MSB 2bits are used for other purposes. This effectivly limits the
DMA address space up to 1GB.

Approved by:	jake (mentor)
Reviewed by:	truckman, matk
2004-10-13 06:04:01 +00:00
Pyun YongHyeon
eba1cb6e3e Audio drivers failed to detect failure condition and attempted to
assign DMA address to the wrong address. It can cause system lockup
or other mysterious errors. Since most sound cards requires low DMA
address(BUS_SPACE_MAXADDR_24BIT) sndbuf_alloc() would fail when the
audio driver is loaded after long running of operations.

Approved by:	jake (mentor)
Reviewed by:	truckman, matk
2004-10-13 05:45:16 +00:00
Hidetoshi Shimokawa
31a5877786 - Split dcons core code and OS dependent code.
- Implement dcons_ischar() and dcons_load_buffer().
- If loader passed a dcons buffer address, keep using it.
	(We still need a patch to cheat memory management system.)
2004-10-13 05:38:42 +00:00
Brian Feldman
d363b98e1f Permit fcntl(F_SETFL) to work on a ugen(4) device by not returning failure
for FIOASYNC.
2004-10-13 04:13:05 +00:00
Brian Feldman
601486239c Back out rev.1.91 which implemented bulk read transfers in ugen(4) as
asynchronous.  I realize that this means the custom application will
not work as written, but it is not okay to break most users of ugen(4).

The major problem is that a bulk read transfer is not an interrupt
saying that X bytes are available -- it is a request to be able to
receive up to X bytes, with T timeout, and S short-transfer-okayness.

The timeout is a software mechanism that ugen(4) provides and cannot
be implemented using asynchronous reads -- the timeout must start at
the time a read is done.

The status of up to how many bytes can be received in this transfer
and whether a short transfer returns data or error is also encoded
at least in ohci(4)'s requests to the controller.  Trying to detect
the "maximum width" results in using a single buffer of far too
small when an application requests a large read.

Even if you combat this by replacing all buffers again with the
maximal sized read buffer (1kb) that ugen(4) would allow you to
use before, you don't get the right semantics -- you have to
throw data away or make all the timeouts invalid or make the
short-transfer settings invalid.

There is no way to do this right without extending the ugen(4) API
much further -- it breaks the USB camera interfaces used because
they need a chain of many maximal-width transfers, for example, and
it makes cross-platform support for all the BSDs gratuitously hard.

Instead of trying to do select(2) on a bulk read pipe -- which has
neither the information on desired transfer length nor ability to
implement timeout -- an application can simply use a kernel thread
and pipe to turn that endpoint into something poll-able.

It is unfortunate that bulk endpoints cannot provide the same semantics
that interrupt and isochronous endpoints can, but it is possible to just
use ioctl(USB_GET_ENDPOINT_DESC) to find out when different semantics
must be used without preventing the normal users of the ugen(4) device
from working.
2004-10-13 04:12:20 +00:00
Poul-Henning Kamp
d16c35256c Use generic tty code instead of local copies.
New devicename is ttyz{port}

No callout devices created.

Isn't this driver superseeded by uart(4) anyway ?
2004-10-12 22:33:19 +00:00
Nate Lawson
9e0dd54fea Attach the device description for ISA devices on the ACPI bus.
MFC after:	1 day
2004-10-12 21:33:08 +00:00
Poul-Henning Kamp
c5c5a2ad8a Add a couple of XXX comments and fix a couple of fine points.
I have not tried to make this a "canonical tty driver".
2004-10-12 21:23:33 +00:00
Poul-Henning Kamp
fbbec42fe4 Remove asserts which are not correct if the port is a tty. 2004-10-12 21:00:19 +00:00
Poul-Henning Kamp
04e9e86c1f Use ttyconsolemode() to set the console tty modes. 2004-10-12 20:16:02 +00:00
Robert Watson
f5c3a74502 Assert that the entropy source category provided by a caller submitting
entropy is valid, as an invalid source will cause dereferencing of an
array of queues to an incorrect memory location.
2004-10-12 14:57:14 +00:00
Poul-Henning Kamp
920f6e438f Use generic tty code.
New device names are ttyy{unit}
2004-10-12 09:21:03 +00:00
Poul-Henning Kamp
71ee88dacc Use generic tty code instead of local copies.
New devicename is ttyy{unit}{port}

No callout devices created as there is no modemcontrol on these ports.

Add data structure to represent each port to avoid excessive array use.
2004-10-12 09:18:37 +00:00
Bruce M Simpson
cdd2389652 Pass through the commands necessary to format USB floppy devices,
from within umass_ufi_transform(). This includes the 12-byte commands
FORMAT_UNIT, WRITE_AND_VERIFY, VERIFY, and READ_FORMAT_CAPACITIES
(sorted in numerical order).

Reviewed by:	ken, scottl
MFC after:	2 weeks
2004-10-12 08:58:57 +00:00
Poul-Henning Kamp
79a8d927d3 Use generic tty code instead of (comparatively little) local copies. 2004-10-12 08:22:31 +00:00
Brian Feldman
812851b6c9 Account for failure in vm_pager_allocate() or vm_pager_get_pages() in
md(8).  The former is generally not going to fail, but the latter can
fail when the underlying swap device returns an error.

There are still plenty of other places where vm_pager_get_pages() failing
will lead directly to crashes, so it's a good idea to put your swap on
RAID if you care enough to put any of your disks on RAID....
2004-10-12 04:47:16 +00:00
Brian Feldman
00b5244e28 Further modify bulk endpoint behavior to be able to tear down the
current transfer fully in the "purge" routine, and to actually finish
kicking out any read()s in progress.
2004-10-12 04:02:06 +00:00
Nate Lawson
4a25d7ffe2 * Remove the acpi attachment from the es1888. It has an identify method
that conjures up the device node so it isn't true PNP.  Noticed by jhb@.

* Add an attachment for esscontrol since it too uses ISA_PNP_PROBE.

* Move an attachment from snd_mss to snd_pnpmss.  The latter is the real
  PNP user.
2004-10-12 01:56:03 +00:00
Nate Lawson
f435261d6d Update C3 support when BM control is not present.
* Fix a bug where caches were flushed on non-C3 transitions.
* Be sure a working flush cache instruction is present before using it.
* Disable C3 completely if it isn't present.
2004-10-11 21:15:10 +00:00
Warner Losh
fd492ee0e6 Make the lower range of the memory area 0x80000000 again. Also
introduce hw.{pci,acpi}.host_mem_start tunable to change this.

MFC: ASAP
2004-10-11 21:10:23 +00:00
Nate Lawson
8909901fdd Add acpi attachments for ISA sound drivers. This is needed so they'll
probe and attach when ACPI is enabled.

Submitted by:	takawata (sbc fix)
MFC after:	1 day
2004-10-11 19:52:31 +00:00
Nate Lawson
a0885d3f14 Notify the user when the battery is critically low. In the future, we
may want to shut down here but the chance of BIOS vendors getting this
wrong is high.  They're only supposed to announce this when all batteries
hit their critical level but past experience indicates we should be
conservative about this for now.
2004-10-11 06:18:07 +00:00
Nate Lawson
18ececa0b8 If bus mastering control is not available (PM2_BLK), don't just disable
C3.  Instead, flush caches before entering C3.  This may be slower but
provides good power savings.
2004-10-11 06:06:42 +00:00
Nate Lawson
31ad3b8802 Move the code for halting the CPU (acpi_cpu_c1) into machdep files.
This removes the last MD portion of acpi_cpu.c.

MFC after:	2 weeks
2004-10-11 05:39:15 +00:00
Warner Losh
905454c86c Fix conflicts I didn't fix before I committed my busspace changes.
Noticed by: ru@ (and likely tinderbox, I haven't checked)
2004-10-11 00:58:24 +00:00
Peter Edwards
8fe457d687 Fix off-by-one error in fd_native_types that results in a panic on boot
for machines with 2.88M floppies.

Reviewed By: phk
2004-10-10 23:39:59 +00:00
Søren Schmidt
b913aa0b7f Dont sleep with lock held. 2004-10-10 13:24:39 +00:00
Warner Losh
ac00fac23a Convert to newbus. (chances are we could now move this to dev/pbio
since I believe it is now MI, but that hasn't been done yet).

Reviewed by: dds
2004-10-10 03:26:20 +00:00
Robert Watson
a28ce935d9 Modify entropy harvesting locking strategy:
- Trade off granularity to reduce overhead, since the current model
  doesn't appear to reduce contention substantially: move to a single
  harvest mutex protecting harvesting queues, rather than one mutex
  per source plus a mutex for the free list.

- Reduce mutex operations in a harvesting event to 2 from 4, and
  maintain lockless read to avoid mutex operations if the queue is
  full.

- When reaping harvested entries from the queue, move all entries from
  the queue at once, and when done with them, insert them all into a
  thread-local queue for processing; then insert them all into the
  empty fifo at once.  This reduces O(4n) mutex operations to O(2)
  mutex operations per wakeup.

In the future, we may want to look at re-introducing granularity,
although perhaps at the granularity of the source rather than the
source class; both the new and old strategies would cause contention
between different instances of the same source (i.e., multiple
network interfaces).

Reviewed by:	markm
2004-10-09 22:04:13 +00:00
Søren Schmidt
8353d82bfd Add support for the ICH6 in legacy mode.
The AHCI part is not supported yet, but is in the works.

5.3 RC1 candidate
2004-10-09 16:27:13 +00:00