Commit Graph

11837 Commits

Author SHA1 Message Date
njl
6cc8d1d266 Instead of doing everything in identify, do a proper probe/attach. Also,
don't add another device if identify is called twice.  Minor reworking by
myself.

Submitted by:	marcel
2004-07-22 05:32:56 +00:00
njl
45ea516f19 Remove unused (and bogus) locking, style cleanup, remove unnecessary casts. 2004-07-22 05:18:05 +00:00
imp
3c3bda2a22 Minor style nit 2004-07-22 00:16:50 +00:00
imp
d7343d0e32 It is a little better to return ENXIO from probe/match routine than EIO. 2004-07-21 20:38:12 +00:00
nyan
3c92d13fb3 Add the ACPI Panasonic extras driver.
Submitted by:	OGAWA Takaya <t-ogawa@triaez.kaisei.org> and nyan
2004-07-21 14:47:54 +00:00
julian
8c938ed70a Slight cosmetic changes.
Also introduce a macro to be called by persistent nodes to signal their
persistence during shutdown to hide this mechanism from the node author.

Make node flags have a consistent style in naming.

Document the change.
2004-07-20 17:15:38 +00:00
dfr
b303cee224 Temporary fix for interoperability with Windows and OS X. A more complete
fix will follow when its ready.

Submitted by: simokawa
2004-07-20 08:58:27 +00:00
simokawa
a9a75e4e9e Don't output too many debug messages for bootverbose.
This driver seems to be fairly stable now.
2004-07-20 04:49:44 +00:00
simokawa
25877174f8 Initialize ifp->if_output for FreeBSD-4. 2004-07-20 04:29:33 +00:00
simokawa
b5eb40de5b Adjust packet length correctly for FreeBSD-4.
Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de>
2004-07-20 03:56:23 +00:00
benno
3d95456d2a Identify VIA EHCI root hubs and at least one VIA USB2.0 controller. 2004-07-19 23:22:10 +00:00
le
9c4b73ba32 Diff reduction to NetBSD.
usbdi.c rev. 1.104, author: mycroft
   ugen_isoc_rintr() may recycle the xfer immediately.  Therefore, we
   avoid touching the xfer after calling the callback in
   usb_transfer_complete().  From PR 25960.
2004-07-19 20:49:02 +00:00
le
60a6d65c03 Diff reduction to NetBSD.
ehci.c rev. 1.69, author: mycroft
uhci.c rev. 1.179, author: mycroft
   hcpriv is not actually used here.  Remove references to it.

Obtained from:   NetBSD
2004-07-19 20:47:46 +00:00
markm
011bdc845d Start the entropy device insecure/unblocked. I'll be handing over
responsibility for critical randomness requirements (like sshd)
to rc.d/*

Requested by: many
2004-07-18 09:07:58 +00:00
sanpei
9a2bbe97a3 Add support System TALKS Inc. SGC-X2UL
PR:		FreeBSD-users-jp/80137
Submitted by:	HORIO Shinsuke <shin@happynet.co.jp>
2004-07-18 06:45:38 +00:00
sos
7eac47804a Dont set "address setup timing" on newer VIA chips.
closes PR:	69180
2004-07-17 14:48:46 +00:00
nyan
2527e98255 Correct typo. 2004-07-17 10:05:56 +00:00
nyan
36da044b35 Remove duplicate include. 2004-07-17 10:05:32 +00:00
simokawa
5cc76fae95 Add some PCI IDs for OHCI chips.
Obtained from: DragonFly BSD
2004-07-17 09:41:20 +00:00
imp
77a331dc4e Be consistant with probe 2004-07-16 23:07:38 +00:00
mux
8b8f22c839 Ignore more strange return values of the test_aux_port() function,
because some notebooks (apparently Compaq, Toshiba and Acer ones)
erroneously return 2 or 3 there.

PR:		kern/61482, kern/54188
Submitted by:	Ulf Lilleengen <lulf@kerneled.org>,
		Victor Balada Diaz <victor@alf.dyndns.ws>
MFC after:	3 days
2004-07-16 22:04:29 +00:00
njl
ebf6efd749 Use ACPI_ALL_NOTIFY instead of registering handlers separately. 2004-07-16 19:05:40 +00:00
njl
f4f7377474 Fix acpi_video loading. When we started cleaning up the duplicate handles
left around after the PCI probe, acpi_video stopped attaching because while
it was an acpi child device, it really is a PCI device.  Fix this by making
it a PCI child.

* Remove non-handle ivars accesses since child busses only implement
acpi_get_handle().
* Access the acpi softc directly through the devclass instead of through
the implied parent.
* Clean up a potential panic on unload by freeing the sysctl context before
storing NULL in the OID.

Found by:	marks
2004-07-16 16:59:32 +00:00
tanimura
217e78b745 Rename the sound device drivers:
- `sound'
  The generic sound driver, always required.

- `snd_*'
  Device-dependent drivers, named after the sound module names.
  Configure accordingly to your hardware.

In addition, rename the `snd_pcm' module to `sound' in order to sync
with the driver names.

Suggested by:	cg
2004-07-16 04:00:08 +00:00
phk
f00200d8a4 Preparation commit for the tty cleanups that will follow in the near
future:

rename ttyopen() -> tty_open() and ttyclose() -> tty_close().

We need the ttyopen() and ttyclose() for the new generic cdevsw
functions for tty devices in order to have consistent naming.
2004-07-15 20:47:41 +00:00
le
2f3742942c MFNetBSD.
rev. 1.67, author: mycroft
   Fix a byte order error.

rev. 1.68, author: mycroft
   Adjust some silliness that was causing us to do extra work for
   "frame list rollover" interrupts, which we pretty much ignore.

Obtained from:   NetBSD
2004-07-15 19:25:06 +00:00
njl
db94b43487 Clean up resources properly if attach fails. Always reset ISA drives on
probe.
2004-07-15 16:41:07 +00:00
njl
c36db208d3 Re-work for fdc_acpi. Expose fdc_add_child() and move the static
hints-based probe to fdc_hints_probe().

Also:
* Fix some resource leaks when attach fails.
* Remove the FDC_ATTACHED flag.  It was supposed to prevent multiple
  unloads but this is not necessary.
2004-07-15 16:39:40 +00:00
njl
b29a887bf7 Add an ACPI floppy drive attachment that probes via the _FDE and _FDI
methods.  It also now handles ordinary floppy drive probing for drives
attached to ACPI.

Reviewed by:	imp
2004-07-15 16:38:07 +00:00
njl
207d886bed Update the interface for child drivers. Add acpi_scan_children, which
allows a bus to re-enumerate its child handles and optionally replace
them with new children, arranged to the bus's liking.  (The current device
space is flat with all devices immediately under acpi0).  Add comments
for each interface.
2004-07-15 16:29:08 +00:00
phk
5c95d686a1 Do a pass over all modules in the kernel and make them return EOPNOTSUPP
for unknown events.

A number of modules return EINVAL in this instance, and I have left
those alone for now and instead taught MOD_QUIESCE to accept this
as "didn't do anything".
2004-07-15 08:26:07 +00:00
njl
ea079c2c7b Add a comment separator. 2004-07-14 22:09:32 +00:00
marks
7e3605cbad Some laptops report the "design-capacity" instead of the "real-capacity"
when the battery is fully charged. That breaks some of the arithmetic in
calculating the remaining capacity (ends up with more than 100%).
This commit makes sure the max is 100.

Approved by:	njl
2004-07-14 19:31:31 +00:00
imp
a352301884 Remove fdc_alloc_resources, which should have happened in last commit. 2004-07-14 07:04:17 +00:00
imp
29fd908e9d Fix the pccard attachment to have a chance of working.
Move the resource allocation into the bus front ends.
2004-07-14 06:59:58 +00:00
takawata
429743400f Follow PnP location string change in acpi.c. 2004-07-14 06:58:39 +00:00
rwatson
28c5014568 Switch snoop device to using C99 initialization for struct linesw. 2004-07-14 05:32:55 +00:00
phk
b0e6874188 Give kldunload a -f(orce) argument.
Add a MOD_QUIESCE event for modules.  This should return error (EBUSY)
of the module is in use.

MOD_UNLOAD should now only fail if it is impossible (as opposed to
inconvenient) to unload the module.  Valid reasons are memory references
into the module which cannot be tracked down and eliminated.

When kldunloading, we abandon if MOD_UNLOAD fails, and if -force is
not given, MOD_QUIESCE failing will also prevent the unload.

For backwards compatibility, we treat EOPNOTSUPP from MOD_QUIESCE as
success.

Document that modules should return EOPNOTSUPP for unknown events.
2004-07-13 19:36:59 +00:00
njl
17a59e7b09 Clean up our pnpinfo and location strings. 2004-07-13 18:59:49 +00:00
njl
3b1eaf7f0d Call device_identify routines after doing the namespace walk. This is
needed so that sysresource objects are created first to reserve all regions,
then other devices can allocate from them.  Otherwise, acpi_timer (the only
ACPI device with an identify routine), would allocate its resources from
the nexus, causing the later sysresource reserve to fail.

Debugging by:	Taku YAMAMOTO, Andrea Campi
2004-07-13 17:57:41 +00:00
stefanf
355a8ec494 Remove erroneous semicolons. 2004-07-13 16:06:19 +00:00
simokawa
0f9bf45316 Re-enable debugger port. 2004-07-13 09:41:45 +00:00
imp
d35148311b Set fdc_dev in attach 2004-07-13 02:44:40 +00:00
imp
02b4d8a438 Don't depend on implicit include of machine/bus.h in sys/rman.h, but instead
explicitly include it.
2004-07-13 02:42:23 +00:00
imp
bdcd057a4e Remove even more references to generating usbdevs_data.h, et al.
Noticed by: njl
2004-07-12 23:11:09 +00:00
imp
3c84bfe26f Remove the instructions for regenerating usbdevs.h: that's now no
longer necessary.
2004-07-12 22:57:06 +00:00
njl
7c75fe7d97 Remove unnecessary softc bzero calls. 2004-07-12 21:15:36 +00:00
njl
462b2a5e44 Add the ability to detach a battery. Now batteries that are detached are
also removed from the battery list.
2004-07-12 20:53:04 +00:00
njl
7b5fb1c0fe Update in preparation for adding the ACPI attachment.
* Add an fdtype ivar.  This will be the equivalent of fd->type.
* Move enabling the FIFO to the end of attach.
* Unify reset code into fdc_initial_reset().
* Add fdc_write_ivar().
* Update isa and pccard attachments accordingly.
* Set the flags unconditionally in probe since they may be overridden by
  other probe routines.  Both before and now, we're depending on probe
  being called a final time on the winning driver so the flags we get are
  the ones we intended.
* Use the bus accessor macros instead of defining our own.
* Remove duplicate assigns of fd->type.
2004-07-12 20:49:26 +00:00
sos
4997cbe712 Attempt to handle suspend/resume better. 2004-07-12 10:50:50 +00:00
imp
a6214e1123 Until I'm ready to commit the better pccard probe/attach routines, effectively
comment them out.
2004-07-11 16:01:25 +00:00
phk
3683e698d2 Introduce ttygone() which indicates that the hardware is detached.
Move dtrwait logic to the generic TTY level.
2004-07-11 15:18:39 +00:00
wpaul
16416501a9 Make NdisReadPcmciaAttributeMemory() and NdisWritePcmciaAttributeMemory()
actually work.

Make the PCI and PCCARD attachments provide a bus_get_resource_list()
method so that resource listing for PCCARD works. PCCARD does not
have a bus_get_resource_list() method (yet), so I faked up the
resource list management in if_ndis_pccard.c, and added
bus_get_resource_list() methods to both if_ndis_pccard.c and if_ndis_pci.c.
The one in the PCI attechment just hands off to the PCI bus code.
The difference is transparent to the NDIS resource handler code.

Fixed ndis_open_file() so that opening files which live on NFS
filesystems work: pass an actual ucred structure to VOP_GETATTR()
(NFS explodes if the ucred structure is NOCRED).

Make NdisMMapIoSpace() handle mapping of PCMCIA attribute memory
resources correctly.

Turn subr_ndis.c:my_strcasecmp() into ndis_strcasecmp() and export
it so that if_ndis_pccard.c can use it, and junk the other copy
of my_strcasecmp() from if_ndis_pccard.c.
2004-07-11 00:19:30 +00:00
marcel
6660e9e4c0 Update for the KDB framework. Sanitize the alpha console code now that
it's in the way even more. Basicly: remove all alpha specific console
support from gfb(4), sio(4) and syscons(4). Rewrite the alpha console
initialization to be identical to all other platforms. In a nutshell:
call cninit().
The platform specific code now only sets or clears RB_SERIAL and thus
automaticly causes the right console to be selected.

sio.c:
o  Replace the remote GDB hacks and use the GDB debug port interface
   instead.
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_alt_break() instead of db_alt_break().
o  Call kdb_enter() instead of breakpoint().
o  Remove the ugly compatibility of using the console as the debug
   port.
2004-07-10 22:29:41 +00:00
marcel
0d98473ef9 Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().
2004-07-10 21:21:13 +00:00
marcel
2f2074cbd9 Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_alt_break() insteadof db_alt_break().
2004-07-10 21:18:33 +00:00
marcel
3351894f4f Update for the KDB framework:
o  Call kdb_enter() instead of breakpoint().
o  Call kdb_alt_break() instead of db_alt_break().
o  Make debugging code conditional upon KDB instead of DDB.
2004-07-10 21:16:01 +00:00
marcel
f2187020e1 Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
2004-07-10 21:14:20 +00:00
marcel
153c72172f Remove DDB. The one user of this macro has been changed to use BVDDB.
Yes, DDB is unrelated to the debugger with the same acronym. Hence,
the change.
2004-07-10 21:13:28 +00:00
marcel
d6d823aef5 s/DDB/BVDDB/g
Note that DDB is unrelated to the debugger with the same acronym.
2004-07-10 21:12:27 +00:00
marcel
d6d709552d Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_alt_break() instead of db_alt_break().
2004-07-10 21:09:47 +00:00
marcel
069f39a671 Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_alt_break() instead of db_alt_break().
o  Call kdb_enter() instead of breakpoint().
2004-07-10 21:07:44 +00:00
marcel
5aaccdba8a Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
2004-07-10 21:06:08 +00:00
marcel
4aa6ec6ad9 Update for the KDB framework:
o  Make debugging code dependent upon KDB instead of DDB.
2004-07-10 21:05:14 +00:00
marcel
f95797fb06 Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().
o  Don't make such calls conditional upon KDB instead of DDB because
   they're already conditional upon EN_DEBUG.
2004-07-10 21:03:52 +00:00
marcel
2a624cf907 Update for the KDB framework:
o  Use kdb_alt_break() to handle the alternate break sequence instead
   of handcoding it here.
o  Remove GDB kluges to make this driver work with the pre-KDB remote
   GDB code.
o  Call kdb_enter() instead of Debugger().

Note that with this commit the dcons(4) driver cannot be used for
remote debugging anymore. This driver has to use the new GDB debug
port interface instead. Such has not been done yet.
2004-07-10 21:02:17 +00:00
marcel
5871b498c8 Update for the KDB framework:
o  Remove inclusion of opt_ddb.h
o  Make debugging code conditional upon KDB.
2004-07-10 20:57:43 +00:00
marcel
f4488175f3 Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().
2004-07-10 20:56:43 +00:00
marcel
81854db17f Add support for uart(4) being a debug port for the GDB backend. 2004-07-10 18:08:38 +00:00
phk
afe21b6175 Remove a pointless check. 2004-07-10 15:38:27 +00:00
marius
8526267db8 - Add missing <sys/module.h>. [1]
- Remove unused includes.
- Sort includes.

Reported by:	Pyun YongHyeon <yongari@kt-is.co.kr> [1]
2004-07-09 23:12:22 +00:00
cognet
113a0eae5d Do not bzero() the softc, as newbus does it for us. 2004-07-09 16:56:46 +00:00
cognet
10b0f934b6 Newbus returns a zeroed softc, so there's no need to call bzero() here. 2004-07-09 13:42:05 +00:00
bms
e828b3b382 Apply the long-overdue hatchet of style(9) death to this file. 2004-07-09 02:19:07 +00:00
bms
3600006e8c Further locking improvements for vr(4):
- Add *_locked() entry points as needed to avoid unnecessary lock thrashing.
 - Use these entry points wisely.
 - Only acquire the lock once when servicing an interrupt.
 - Check 'suspended' on interrupt to avoid racing detach.
 - Correct a mis-spelled comment.
 - Don't take the lock in vr_reset() to avoid lock thrashing in attach.
  - Comment this.

Reviewed by:	-net (silence)
2004-07-09 00:17:14 +00:00
bms
8336c29bfb Add a 'suspended' flag to softc so that we can avoid races on detach. 2004-07-09 00:12:41 +00:00
imp
78dfca3951 Break out the isa and pccard front ends from fdc. This is the first
step in making this driver more attachment neutral.  Others plan on
adding acpi front ends.

Still need to cleanup the MI part of the driver because it isn't as
bus independent as it could be.
2004-07-07 22:35:27 +00:00
wpaul
966185d797 Fix two problems:
- In subr_ndis.c:ndis_allocate_sharemem(), create the busdma tags
  used for shared memory allocations with a lowaddr of 0x3E7FFFFF.
  This forces the buffers to be mapped to physical/bus addresses within
  the first 1GB of physical memory. It seems that at least one card
  (Linksys Instant Wireless PCI V2.7) depends on this behavior. I
  don't know if this is a hardware restriction, or if the NDIS
  driver for this card is truncating the addresses itself, but using
  physical/bus addresses beyong the 1GB limit causes initialization
  failures.

- Create am NDIS_INITIALIZED() macro in if_ndisvar.h and use it in
  if_ndis.c to test whether the device has been initialized rather
  than checking for the presence of the IFF_UP flag in if_flags.
  While debugging the previous problem, I noticed that bringing
  up the device would always produce failures from ndis_setmulti().
  It turns out that the following steps now occur during device
  initialization:

	- IFF_UP flag is set in if_flags
	- ifp->if_ioctl() called with SIOCSIFADDR (which we don't handle)
	- ifp->if_ioctl() called with SIOCADDMULTI
	- ifp->if_ioctl() called with SIOCADDMULTI (again)
	- ifp->if_ioctl() called with SIOCADDMULTI (yet again)
	- ifp->if_ioctl() called with SIOCSIFFLAGS

  Setting the receive filter and multicast filters can only be done
  when the underlying NDIS driver has been initialized, which is done
  by ifp->if_init(). However, we don't call ifp->if_init() until
  ifp->if_ioctl() is called with SIOCSIFFLAGS and IFF_UP has been
  set. It appears that now, the network stack tries to add multicast
  addresses to interface's filter before those steps occur. Normally,
  ndis_setmulti() would trap this condition by checking for the IFF_UP
  flag, but the network code has in fact set this flag already, so
  ndis_setmulti() is fooled into thinking the interface has been
  initialized when it really hasn't.

  It turns out this is usually harmless because the ifp->if_init()
  routine (in this case ndis_init()) will set up the multicast
  filter when it initializes the hardware anyway, and the underlying
  routines (ndis_get_info()/ndis_set_info()) know that the driver/NIC
  haven't been initialized yet, but you end up spurious error messages
  on the console all the time.

Something tells me this new behavior isn't really correct. I think
the intention was to fix it so that ifp->if_init() is only called
once when we ifconfig an interface up, but the end result seems a
little bogus: the change of the IFF_UP flag should be propagated
down to the driver before calling any other ioctl() that might actually
require the hardware to be up and running.
2004-07-07 17:46:30 +00:00
bms
0b885a2c86 Eliminate unneeded return keywords. 2004-07-06 02:48:29 +00:00
bms
a3d7be0a38 Whitespace pass 2004-07-06 02:46:53 +00:00
bms
2cf04d55ce Whitespace nit 2004-07-05 22:52:01 +00:00
bms
2ced1b0135 Eliminate redundant return keywords. 2004-07-05 22:50:52 +00:00
bms
36da28d77c Whitespace pass. 2004-07-05 22:46:28 +00:00
bms
c3a45c579d style(9):
- Space before bracketized non-void function returns.
 - Space before condition for conditional blocks.
2004-07-05 22:42:07 +00:00
bms
31312e4bc9 Eliminate redundant return keywords. 2004-07-05 22:36:48 +00:00
bms
dce22f420f Whitespace nits 2004-07-05 22:35:18 +00:00
bms
e305581b9b style(9) pass on prototypes. 2004-07-05 22:27:26 +00:00
phk
fe7583f88c Allocate the DMA channel shareable and only aquire it while the
device is open.  This allows certain old and rather special dual
floppy controllers to work on both channels, as long as you only
have one open at a time.
2004-07-05 20:56:06 +00:00
phk
d0b755c141 Mark our interrupt shareable and don't insist on DMA. This gets us closer
to working with a secondary floppy controller on a PC.
2004-07-04 23:16:04 +00:00
bms
b9a0ef169c Check the return value of bus_dmamem_alloc() correctly.
Submitted by:	Darron Broad (with cleanups)
2004-07-04 18:40:36 +00:00
phk
e58c00e142 Add modemcontrol support for DTR and DCD.
Tested by:	ambrisko
2004-07-04 16:27:58 +00:00
imp
631556e5b2 Make the default memory range in the top 2GB of ram in the hopes that
this more accurately reflects what the underlying hardware of most
acpi machines that don't have children pci busses.

We still need a better way to get this information from acpi/hardware.
2004-07-04 16:23:25 +00:00
stefanf
9dea8aeba1 Consistently use __inline instead of __inline__ as the former is an empty macro
in <sys/cdefs.h> for compilers without support for inline.
2004-07-04 16:11:03 +00:00
sanpei
a819334bbc Add device ID for atuwi USB wlan driver, Linksys WUSB11 v2.8 wireless adapter.
(Atmel at76c503a http://vitsch.net/bsd/atuwi)

PR:		kern/68465
Submitted by:	Suihong Liang <s2liang@uwaterloo.ca>
2004-07-04 09:13:53 +00:00
bms
a4215c557a SMPng locking cleanup for vr(4).
- Remove recursive locking situations. Remove the MTX_RECURSE bit.
 - Take the lock for any routine which is not called from within if_vr.c
   itself; this includes entry points called by newbus, ifnet, callout,
   ifmedia, and polling subsystems.
 - Remove spl references from the code added to miibus callbacks in rev 1.60.
 - Add the INTR_MPSAFE bit.
 - Tidy up some assignments; locks are not needed for taking the address
   of something at a known offset, for example.
 - Tested on the machine this was committed from.

Tested on:	UP only, !debug.mpsafenet && debug.mpsafenet
Reviewed by:	rwatson
2004-07-03 02:59:02 +00:00
bms
507c96c429 - Another whitespace pass; make locking calls more obvious.
- Use C99 types for vr_miibus_readreg().
2004-07-03 02:52:32 +00:00
marcel
4c8ddc3ef6 Unbreak -O2 build: initialize nstatus to avoid uninitialized warning. 2004-07-03 02:10:52 +00:00
bms
47f5e31e2b style(9) compliance.
Put some braces around the busy-wait loop in vr_rxeoc() to make the
no-op semicolon more obvious.
No functional changes.
Running on the machine I am committing from without problems.

Reviewed by:	jmallett
2004-07-02 23:51:44 +00:00
njl
1f506bc6fa Remove duplicate FreeBSD id. 2004-07-02 20:15:53 +00:00
njl
f3e20d3d7b Get rid of the strict aliasing error by retrieving the ECDT via a table
header pointer and then casting it to the ecdt pointer.  This fixes the
-O2 build.  I'm unsure what changed recently to reveal this error since
this code has been unchanged for months.
2004-07-02 19:17:27 +00:00