Commit Graph

11805 Commits

Author SHA1 Message Date
Nate Lawson
3309d2fbc8 Add missing function debug trace macros to the new powerres functions.
Reported by:	phk
2004-06-30 20:31:13 +00:00
Warner Losh
0363a12688 Hide struct resource and struct rman. You must define
__RMAN_RESOURCE_VISIBLE to see inside these now.

Reviewed by: dfr, njl (not njr)
2004-06-30 16:54:10 +00:00
Nate Lawson
d4b9ff9179 Move flags into a private ivar so it can't collide with device flags.
Unify the code to disable GPEs with the enable code.  Shutdown is handled
the same way.  ACPI now does all wake/sleep prep for child devices so
now they no longer need to call external functions in the suspend/resume
path.  Add the flags to non-ACPI busses (i.e., pci).
2004-06-30 16:08:03 +00:00
Nate Lawson
d3b9d3d1d7 Add a method for referencing/switching power resources based on _PRW.
This brings us into line with the standard, which requires power resources
be enabled when wake is enabled for a given device.  Move the dereferencing
code into its own function, +acpi_pwr_dereference_resource().
2004-06-30 16:02:40 +00:00
Nate Lawson
340a7f6a9b Disable the EC GPE in the shutdown path. This is correct but is not known
to fix any bug.
2004-06-30 16:00:20 +00:00
Nate Lawson
346eda4f40 Diff reduction for style. 2004-06-30 15:10:02 +00:00
Søren Schmidt
3e3807252b Remove leftover debug output. 2004-06-30 09:22:47 +00:00
Nate Lawson
89fb5af803 Add new quirk code that disables problem BIOS versions. Remove old quirk
code that was never really used.  Print a message when disabling ACPI via
a quirk.  Allow the user to override the blacklist decision by setting
hint.acpi.0.disabled="0".  Add missing AcpiTerminate() calls; they are
needed to clean up if bailing out after AcpiInitializeSubsystem().
2004-06-30 04:49:54 +00:00
Nate Lawson
1bf4426682 Add the table quirk matching code. It matches rules defined in acpi_quirks
and sets the flags.  It also calls the machdep quirk code first.  This
allows table quirks (or whitelists) to override machdep quirks.
2004-06-30 04:45:32 +00:00
Nate Lawson
1a26ea7f2c Add machdep quirks functions. On i386, this disables acpi on systems with
BIOS dates earlier than Jan 1, 1999.  Add prototypes and quirks flags.
2004-06-30 04:42:29 +00:00
Warner Losh
1c91aaf9ab Add pnpinfo and location information to uhub. We also keep track of
the subdevices of uhub better now to accomplish this.

Submitted by: Bernd Walter
2004-06-30 02:56:24 +00:00
Warner Losh
2756272aea Remove saved_* from dc_softc. They are now no longer needed.
Submitted by: Marius Strobl
2004-06-29 20:38:44 +00:00
Søren Schmidt
d485c7bcf3 Update the special handling code for ATA devices to allow usage of
PCI native addressing. That means that if the HW says that using "real"
addresses instead of the hardwired legacy compat ones is allowed, we will
use them.
2004-06-29 20:25:43 +00:00
Nate Lawson
3ed1dfa11d Update for acpi_id_probe() 2004-06-29 19:05:20 +00:00
Nate Lawson
0e01bb0580 Staticize acpi_MatchHid() and include acpi_if.h 2004-06-29 19:03:50 +00:00
Nate Lawson
5fcc8a587e Use the acpi_id_probe() method instead of acpi_MatchHid(), which is now
static.
2004-06-29 19:02:27 +00:00
Nate Lawson
ce619b2e38 Add implementation of the ACPI methods which hands them off to ACPI-CA.
acpi_id_probe() returns NULL for no match or the ID string that matched
if the driver should attach.
2004-06-29 19:00:36 +00:00
Nate Lawson
d13e5a4065 Add acpi methods for HID/CID probing, evaluating objects, and walking the
namespace.  This is to allow decoupling of attachments from ACPI where they
need some functionality when ACPI is present but do not want to require ACPI
to always be loaded.
2004-06-29 18:56:14 +00:00
Nate Lawson
8c541590b6 Use a default of the FADT for matching CreatorId quirks. Use XSDT to mean
"match either RSDT or XSDT."
2004-06-29 14:32:06 +00:00
Nate Lawson
c796e27ba8 Include isa/pnpvar.h and remove a duplicate copy of PNP_EISAID. 2004-06-29 01:33:35 +00:00
Nate Lawson
636af3826f While booting, use DELAY() for waiting for the EC to respond instead of
msleep().  Until we're finally up, msleep is a no-op.

Explained by:	peter
2004-06-28 20:41:30 +00:00
Warner Losh
794950069f Remove the setting of the pci config variables on power state changes.
The bus does this now.
2004-06-28 20:26:21 +00:00
Warner Losh
922a60559a Remove code to slam the config space on transition to d0. 2004-06-28 20:09:02 +00:00
Warner Losh
c3e7434f34 Remove burn bridges code that saved/restored the pci config registers
that are now handled in the pci bus layer.  They are no longer
necessary.
2004-06-28 20:07:03 +00:00
Warner Losh
4c0142a129 another format nit 2004-06-28 16:38:53 +00:00
Warner Losh
7f9369480d casting for printf happiness 2004-06-28 16:30:49 +00:00
John Baldwin
3df6c4de7e - Shorten the names for the TTY related swi interrupt handlers as the
'tty:' prefix is largely redundant.
- Fix the priority of the low-priority TTY SWIs that are hung off of the
  softclock thread.

Submitted by:	bde (2)
2004-06-28 16:17:11 +00:00
Warner Losh
ed67d9de40 rman_reserve_resource doesn't set the bushandle, so we have to do it here.
Badness noted by: njl
Perforce reply not read by: imp
2004-06-28 03:36:37 +00:00
Alexander Langer
52b8c8cd00 - Fix style bug in Dell Bluetooth adapter (don't repeat Vendor in
device listing).
- Add generic "Port Replicator" entry for the USB Hubs used in
  Dell port replicators.
2004-06-27 17:27:04 +00:00
Warner Losh
0661633386 Now that all the in-tree referrences to these old files are gone, go
ahead and remove them.
2004-06-27 16:59:15 +00:00
Warner Losh
39bd8f0099 MFp4:
Add Intel Pro100Lan56 card.

Also integrate changes from Carlos Velasco.  Only attch if we're a
network device (to filter out the serial devices).  Also, increment
vpmatch if we match to conform to the pccard match function api.
2004-06-27 13:25:28 +00:00
Warner Losh
5af9f729ec MFp4:
Use bus space rather than direct inb/outb.  Minor style changes while
I'm here.  Extremely preliminary support for siliconix ethernet cards
(but more work is required).
2004-06-27 13:10:20 +00:00
Warner Losh
5d11e83faa MFp4:
The hack for setting the bus has been moved down into the cbb driver.
I've been running without this hack in my tree for so long I had
forgotten that I'd removed it :-).  Please let me know if this causes
difficulty for your laptop.
2004-06-27 13:07:02 +00:00
Warner Losh
a323657048 MFp4: Set the bus handle to the bus handle of the resource, not the
starting value.  This is more pedantically correct (since the handle
isn't always identical to the start of the resource) and also doesn't
access the innards of struct resource direct (which I forbid in my
tree).  We need to do this for all resource types, not just ioport.

Reviewed by: njl
2004-06-27 13:04:19 +00:00
Warner Losh
d1458cfdf4 MFp4: First batch of dev/usb/usbdevs.h -> usbdevs.h changes. 2004-06-27 12:41:44 +00:00
Poul-Henning Kamp
ae404e3427 Guard against us having no tty pointer. 2004-06-27 11:29:54 +00:00
Jens Schweikhardt
5383b89356 Fix a tuner problem.
PR:		kern/66006
Submitted by:	Josh Elsasser <jre@vineyard.net>
MFC after:	1 week
2004-06-27 09:59:02 +00:00
Lukas Ertl
5d4284a178 Catch up with usbd_get_string_desc() change. 2004-06-26 13:21:31 +00:00
Lukas Ertl
35ea382b1a Our softc has no sc_hdev, but a sc_dev. This in turn has no direct
sc_parent, so back out the previous commit, as it breaks the build.

If there's a pointy hat left, pass it on.
2004-06-26 13:12:46 +00:00
Lukas Ertl
5bebcf6d1c MFNetBSD.
uhid.c (1.61), author: jdolecek
   add support for USB_GET_DEVICEINFO and USB_GET_STRING_DESC ioctls,
   with same meaning as for ugen(4)

usbdi_util.h (1.29), usb_quirks.c (1.50), uhid.c (1.62),
ugen.c (1.68), usb_subr.c (1.114) author: mycroft
   Yes, some devices return incorrect lengths in their string
   descriptors.  Rather than losing, do what Windows does: just
   request the maximum size, and allow a shorter response.  Obsoletes
   the need for UQ_NO_STRINGS, and therefore these "quirks" are removed.

usb_subr.c (1.116), author: mycroft
    In the "seemed like a good idea until I found the fatal flaw"
    department...  Attempting to read a maximum-size string descriptor
    causes my kue device to go completely apeshit.  So, go back to the
    original method, but allow the device to return a shorter string than
    it claimed.

Obtained from:   NetBSD
2004-06-26 10:35:10 +00:00
Poul-Henning Kamp
cb9ea5f4cb Pick the hotchar out of the tty structure instead of caching private
copies.

No current line disciplines have a dynamically changing hotchar, and
expecting to receive anything sensible during a change in ldisc is
insane so no locking of the hotchar field is necessary.
2004-06-26 09:20:07 +00:00
Lukas Ertl
57ceda5d84 MFNetBSD.
ohci.c (1.147), author: mycroft
   Failure to properly mask off UE_DIR_IN from the endpoint address
   was causing OHCI_ED_FORMAT_ISO and EHCI_QH_HRECL to get set
   spuriously, causing rather interesting lossage.

   Suddenly I get MUCH better performance with ehci...

ohci.c (1.148), author: mycroft
   Adjust a couple of comments to make it clear WTF is going on.

Obtained from:   NetBSD
2004-06-26 09:19:31 +00:00
Lukas Ertl
dae4042053 MFNetBSD ehci.c and ehcireg.h
ehci.c (1.55), ehcireg.h (1.16); author: mycroft
     Set the data toggle correctly, and use EHCI_QTD_DTC.  This fixes
     problems with my ALi-based drive enclosure (it works now, rather
     than failing to attach).  Also seems to work with a GL811-based
     enclosure and an ASUS enclosure with a CD-RW, on both Intel and
     NEC controllers.

     Note: The ALi enclosure is currently very SLOW, due to some issue
     with taking too long to notice that the QTD is complete.  This
     requires more investigation.

ehci.c (1.56); author: mycroft
     Failure to properly mask off UE_DIR_IN from the endpoint address
     was causing OHCI_ED_FORMAT_ISO and EHCI_QH_HRECL to get set
     spuriously, causing rather interesting lossage.

     Suddenly I get MUCH better performance with ehci...

ehci.c (1.58); author: mycroft
     Fix a stupid bug in ehci_check_intr() that caused use to try to
     complete a transaction that was still running.  Now ehci can
     handle multiple devices being active at once.

ehci.c (1.59); author: enami
     As the ehci_idone() now uses the variable `epipe'
     unconditionally, always declare it (in other words, make this
     file compile w/o EHCI_DEBUG).

ehci.c (1.60); author: mycroft
     Remove comment about the data toggle being borked.

ehci.c (1.61); author: mycroft
     Update comment.

ehci.c (1.62); author: mycroft
     Adjust a couple of comments to make it clear WTF is going on.

ehci.c (1.63); author: mycroft
     Fix an error in a debug printf().

ehci.c (1.64), ehcireg.h (1.17); author: mycroft
     Further cleanup of toggle handling.  Now that we use EHCI_QH_DTC,
     we don't need to fiddle with the TOGGLE bit in the overlay
     descriptor, so minimize how much we fuss with it.

Obtained from:   NetBSD
2004-06-26 00:52:37 +00:00
Søren Schmidt
dfc7e0081f Add support for LSI type software RAID's.
Made possible by: John Cagle @ HP
2004-06-25 21:21:59 +00:00
Poul-Henning Kamp
45671a9eb6 Use generic routines for BREAK and modem control ioctls.
This eliminates the need for a local ioctl method.
2004-06-25 20:33:52 +00:00
Poul-Henning Kamp
89274131e2 Use generic modem control and BREAK ioctl handling. This eliminated
the need for a local ioctl handler.
2004-06-25 20:32:51 +00:00
Julian Elischer
327b288e5c Convert Netgraph to use mbuf tags to pass its meta information around.
Thanks to Sam for importing tags in a way that allowed this to be done.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
Also allow the sr and ar drivers to create netgraph versions of their modules.
Document the change to the ksocket node.
2004-06-25 19:22:05 +00:00
Josef El-Rayes
ae6d3a22dc Fix uninitialized variable, that breaks the build.
Approved by: hmp
Reviewed by: chris
Pointy hat to: josef (for ignoring warning)
2004-06-25 16:34:33 +00:00
Peter Grehan
aa77148daf - set resid correctly so that a failed seek (e.g. end of file) returns
correctly
- included required <sys/module.h>
2004-06-25 13:43:56 +00:00
Peter Grehan
40cdee9dab Catchup to now-required <sys/module.h> for PowerPC 2004-06-25 13:42:48 +00:00
Poul-Henning Kamp
4550ad5b99 Use generic support for BREAK and modem control ioctls 2004-06-25 10:54:46 +00:00
Poul-Henning Kamp
96df2b0bfb Use generic support for BREAK and modem control ioctls. 2004-06-25 10:54:05 +00:00
Poul-Henning Kamp
85bc8ea7fc Use generic support for modemcontrol and BREAK ioctls. 2004-06-25 10:51:33 +00:00
Scott Long
c63d83f7c2 Fix a typo that made the busdma tag have a 0 highaddr. This driver heavily
abuses busdma in other ways, and those will likely be fixed another day.
2004-06-24 18:30:08 +00:00
Doug Ambrisko
c3c409c498 Add PCI Device ID for 6300ESB ICH. If allocating 16 bytes fails then try 32.
This is also require for 6300ESB.
2004-06-24 18:21:28 +00:00
Josef El-Rayes
8ba7f5cfee Change the possibility to configure pcm(4) via boot/loader.conf
to use boot/device.hints now

As discussed on cvs-src@

Reviewed by:	Hiten Pandya <hmp@backplane.com>
2004-06-24 17:41:20 +00:00
Poul-Henning Kamp
28710806cb Use the new serial port definitions for modemsignals. 2004-06-24 10:07:28 +00:00
Nate Lawson
bef5734687 Update some comments and remove non-standard notation. 2004-06-24 06:37:23 +00:00
Nate Lawson
e008d0c51c Add a quirks array based on matching ACPI tables. The entries in this file
are currently all bad BIOS revisions that will never be able to support
ACPI.  They were derived by examining which BIOS's are blacklisted by other
operating systems.  Other types of quirks will be possible here as well.
2004-06-24 06:27:05 +00:00
John Birrell
bbfccfb3c6 Sync to usbdevs 1.183 2004-06-24 05:25:04 +00:00
John Birrell
f1912fcf16 Add Delorme Publishing Earthmate GPS 2004-06-24 05:05:56 +00:00
David E. O'Brien
a82b25f9b2 Better OFW console support on Sun Ultra2 machines.
Ultra2 users may want to set OFWCONS_POLL_HZ to a value of '20'.
I have left default value at '4' as higher values can consume a more
than is acceptable amount of CPU, and we don't have a consensus yet
what is an optimal value.

Submitted by:	Pyun YongHyeon <yongari@kt-is.co.kr>
2004-06-24 02:57:11 +00:00
Nate Lawson
30d577a014 Attach the correct handle, not the one that was just deleted. Also,
remove some duplicated code.
2004-06-24 01:57:31 +00:00
Nate Lawson
80f0e4c265 Run the power off code directly instead of using indirection through
smp_rendezvous() to ensure we run on the BSP.  This reverts rev 1.128.
Add a comment indicating that MI code should be the one that runs all
shutdown functions on the BSP with the APs halted.  This should work
around problems in power off while waiting for the MI code to be improved.
2004-06-24 00:48:45 +00:00
Nate Lawson
4a03551ddd Use uintmax_t for CPU statistics and add a cast to prevent truncation of
the statistics in a multiply.

Pointed out by:	YONETANI Tomokazu
2004-06-24 00:38:51 +00:00
Roman Kurakin
de98a7eeee Use bus_dma* instead of contigmalloc()+vtophys() for RELENG_5. 2004-06-23 18:13:10 +00:00
John Baldwin
95957f6256 - Defer BUS_CONFIG_INTR() on ACPI IRQ resources until the resources are
actually used.  For most ACPI devices this means deferring the call
  until bus_alloc_resource().
  - Add a function acpi_config_intr() to call BUS_CONFIG_INTR() for an
    ACPI IRQ resource using the trigger mode and polarity information
    stored in the ACPI resource object.
  - Add a function acpi_lookup_irq_resource() to lookup the ACPI IRQ
    resource that corresponds to a specified rid and new-bus resource.
  - Have the ACPI PCI bridge driver call BUS_CONFIG_INTR() on interrupts
    that it routes through link devices.
- Remove needactivate variable from acpi_alloc_resource() by changing the
  function not modify the flags variable but just mask off RF_ACTIVE when
  calling rman_reserve_resource().

Reviewed by:	njl (1, an earlier version)
2004-06-23 17:21:02 +00:00
John Baldwin
81bb99d26b Now that we associate a device_t with ACPI device handles, lookup the
device associated with any PCI devices that are enumerated in the ACPI
tree when adding children to an ACPI PCI bus and remove the duplicate
ACPI-only device_t and replace the device_t associated with the handle with
the ACPI and PCI aware device_t.
2004-06-23 15:08:40 +00:00
Warner Losh
b0ba9e25bc Improve the kludge assignment of sub-bus numbers a little by fixing an
off by one error.  subbus must be > than pribus, so the right test is
<= not just <.

Reported by: Peter Losher
2004-06-23 13:49:46 +00:00
Roman Kurakin
3cc90ff9d1 Make code more clean: backout support for 3.x branch. 2004-06-23 11:23:54 +00:00
Lukas Ertl
5980decb5b MFNetBSD 1.60, author: augustss
Several changes:
    * Implement read for ulpt.
    * If the device is not opened for reading, occasionally drain any
      data the printer might have (but don't hammer the printer with reads).
    * Lower the buffer size to one page.
   The driver seems to work with more printers now.

Obtained from: NetBSD
2004-06-23 11:16:12 +00:00
Poul-Henning Kamp
ee531086ca save a few redundant lines by moving the retry loop further backwards. 2004-06-23 10:28:09 +00:00
Paul Saab
5cf5a43040 Reset the update flag when scanning for new devices. 2004-06-22 23:05:06 +00:00
Poul-Henning Kamp
fdf5c3da04 Remove the TIOCDCDTIMESTAMP option.
The RFC-2783 PPS-API (<sys/timepps.h>) provides better and more
configurable service.
2004-06-22 20:32:17 +00:00
Paul Saab
6768864478 Use the maximum physical bus when rescanning those targets. This
fixes a panic on cards which do not have any drives attached.
2004-06-22 17:39:57 +00:00
Søren Schmidt
29dc49f725 Use the right ordering of args on mtx_init(). No functional changes
since the args in question was all zero's.

Found by: Jimmy Olgeni <olgeni@FreeBSD.org>
2004-06-22 11:18:25 +00:00
Christian Brueffer
889608790b Fix typos and add spaces before `(' in some comments
Submitted by:	markus
Approved by:	njl
MFC after:	3 days
2004-06-22 08:23:26 +00:00
Lukas Ertl
3202f019e7 Catch up with g_dev_open() changes and pass over the current thread
pointer.

Submitted by:    cperciva
2004-06-22 06:38:01 +00:00
Poul-Henning Kamp
ec66f15d14 Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES. 2004-06-21 22:57:16 +00:00
Paul Saab
139233cbd6 on media exchange, update/rescan the drives. This allows a volume
in a failed stated to come back on-line without a reboot.
2004-06-21 22:57:10 +00:00
Paul Saab
88c78a3815 There is no need to call ciss_media_accept async anymore since all
notify events are handled in a kthread.
2004-06-21 21:56:57 +00:00
Brian Feldman
5fd2bb173d Call the detach function with g_waitfor_event() so that it can access
the GEOM topology.

There are still issues with not detaching from cam correctly such that
upon a device detach there's an invalid pointer dereference from the
later call to cam_rescan().
2004-06-21 20:42:03 +00:00
Scott Long
1fe6c4ee54 Add SCSI passthrough support to CISS. This allows devices like tape drives
that are on a CISS bus to be exported up to CAM and made available as normal
devices.  This will typically add one or two buses to CAM, which will be
numbered starting at 32 to allow room for CISS proxy buses.  Also, the CISS
firmware usually hides disk devices, but these can also be exposed as 'pass'
devices if you set the hw.ciss.expose_hidden_physical tunable.

Sponsored by:	Tape Laboratories, Inc.
MFC After: 3 days
2004-06-21 20:18:40 +00:00
Poul-Henning Kamp
894b335393 Give control devices their own cdevsw{} so that we can eliminate them
from the trafic functions.

Do not use com_addr() when we don't need it.
2004-06-21 20:09:23 +00:00
Andrew Gallatin
d6a774ca4a Prevent the rp driver from panic'ing on first access and make at
least the pci device unloadable

- Use ttymalloc() rather than a plain  malloc to allocate the
  rp->rp_tty ttys.  This is now required due to the recent locking
  changes to ttys and prevents a panic due to locking an unitialized
  t_mtx.

- Allow the pci driver to be unloaded.  This involved moving
  the call rp_releaseresource() to the end of rp_pcireleaseresource(),
  since rp_pcireleaseresource() uses ctlp->dev, which is freed
  by rp_releaseresource().

- Allow the generic part of the driver to be unattached by providing
  a hook to cancel timeouts.

Glanced at by: obrien
2004-06-21 13:02:25 +00:00
Scott Long
f46519d1c1 Include module.h
Submitted by:	Koop Mast
2004-06-21 07:27:34 +00:00
Josef El-Rayes
9d12118e78 Enable pcm to read kenv variables to set default values for
mixer channels.

e.g.: pcm0.line=0

to muten input line per default.

Approved by:    cg
Reviewed by:    le, stefanf
Requested by:   Eugene Grosbein <eugen@grosbein.pp.ru> (implicitly)
PR:             kern/63771
2004-06-20 15:38:11 +00:00
Lukas Ertl
1f6625d1f8 MFNetBSD 1.15, author: mycroft
Fix an unimportant typo.
2004-06-20 15:32:19 +00:00
Mark Murray
4456263490 Micro-tweaking. 2004-06-20 13:50:50 +00:00
MIHIRA Sanpei Yoshiro
66f600d2e1 Sync to 1.182 of usbdevs 2004-06-19 22:17:34 +00:00
MIHIRA Sanpei Yoshiro
e67a98a725 Add support Microtune Bluetooth dongle
PR:		kern/68049
Submitted by:	Markus Brueffer <markus@brueffer.de>
2004-06-19 22:16:03 +00:00
Nate Lawson
3e7fa136ea Add more precision to the cx_usage sysctl output and special-case 0%.
Submitted by:	YONETANI Tomokazu <qhwt+freebsd-acpi AT les.ath.cx>
2004-06-19 02:27:23 +00:00
Nate Lawson
98910d5551 Remove compat code and unused lock declarations. 2004-06-18 17:58:11 +00:00
Nate Lawson
c5fe3c3311 Remove compat defines. 2004-06-18 17:56:45 +00:00
Hidetoshi Shimokawa
e1ebf69098 Fix the description of hw.firewire.sbp.exclusive_login.
Submitted by: KIYOHARA Takashi <kiyohara@kk.iij4u.or.jp>
2004-06-18 08:02:49 +00:00
Warner Losh
973796c882 A couple more style(9) nits I should have included in last commit 2004-06-18 01:28:54 +00:00
Warner Losh
b3cb6e3742 Style nits in the prototypes 2004-06-18 01:27:19 +00:00
Søren Schmidt
b2c082c98b Up SiI reset wait a bit, some devices got lost. 2004-06-17 21:36:10 +00:00
Poul-Henning Kamp
f3732fd15b Second half of the dev_t cleanup.
The big lines are:
	NODEV -> NULL
	NOUDEV -> NODEV
	udev_t -> dev_t
	udev2dev() -> findcdev()

Various minor adjustments including handling of userland access to kernel
space struct cdev etc.
2004-06-17 17:16:53 +00:00
Brian Feldman
3c632a5847 atapicam(4) is currently off by three orders of magnitude regarding the
timeout values in the CAM CCBs.  Divide by 1000 to get values in seconds
which are what ata(4) timeouts internally use.

This does lose granularity, though, and small values can now round down
to zero.  It's probably worth making all ata(4) timeouts in terms of
hz/ticks/milliseconds/something.
2004-06-17 07:29:56 +00:00
Doug Ambrisko
6cca5e3463 While setting up a transmit packet disable interupts on the card then
re-enable them after we are done setting up the packet.  This seems
to fix the MPI350 newer firmware hangs.
2004-06-17 02:19:11 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Paul Saab
6f71a9531a If a device is not ONLINE, do not attempt to submit any commands
or I/O to the volume.  This solves a panic when removing a disk in
a RAID 0 volume.

Reported by:	le
2004-06-15 19:40:47 +00:00
Nate Lawson
591b993b83 s/device_get_handle/acpi_get_handle
Submitted by:	Hiroyuki Aizu
2004-06-15 16:49:20 +00:00
Doug Rabson
c2216c0ac6 Fix spelling. 2004-06-15 16:03:49 +00:00
Søren Schmidt
821b5752b3 Oops, backout debug code.. 2004-06-15 11:38:48 +00:00
Søren Schmidt
ebb6fc23c2 Dont set prefetch etc on VIA chips, causes problems on newer chips and
ATAPI devices.
2004-06-15 11:16:36 +00:00
Søren Schmidt
ca5d21e917 Increase robustness of SATA handling. 2004-06-15 11:02:09 +00:00
Nate Lawson
f6c8318b0f Catch one more use of acpi_MatchHid and update for new API. 2004-06-15 02:17:23 +00:00
John Baldwin
522542cc9c Revert the removal of the initial_irq hack for now as this code is more
broken than I thought and doesn't do a good job of routing virgin
interrupts at all.
2004-06-14 18:54:14 +00:00
John Polstra
4717d22a7c Change the return value of sema_timedwait() so it returns 0 on
success and a proper errno value on failure.  This makes it
consistent with cv_timedwait(), and paves the way for the
introduction of functions such as sema_timedwait_sig() which can
fail in multiple ways.

Bump __FreeBSD_version and add a note to UPDATING.

Approved by:	scottl (ips driver), arch
2004-06-14 18:19:05 +00:00
Josef El-Rayes
134896e1fc Improve mapping of relative to absolute volume.
I added bounds checking to the patch and cg improved
the formular.

Submitted by:	Andriy Gapon <avg@icyb.net.ua>
PR:		kern/65485
Approved by:	cg
Reviewed by:	imp, rwatson, le
2004-06-14 15:01:16 +00:00
Doug Rabson
ee2f2ccc2f If we run out of transmission labels, just re-queue the packet for later
instead of printing endless error messages on the console and discarding
the packet.
2004-06-14 09:34:20 +00:00
Nate Lawson
59e472e952 Remove disable_on_poweroff and our pre-sync shutdown handler. Disabling
of GPEs is now done in acpi_shutdown() and so we no longer need the option
of disabling ACPI in the poweroff case.
2004-06-14 04:37:45 +00:00
Nate Lawson
b82ca9a91f Clean up acpi_probe_order() a bit and clarify some comments. 2004-06-14 04:01:12 +00:00
Nate Lawson
f504b6074b Don't probe/attach in the ACPI_DEBUG case. 2004-06-14 03:52:19 +00:00
Nate Lawson
7a15653c9c Use the new API for acpi_MatchHid(). The difference between ACPI_HANDLE
and device_t isn't caught by the compiler.
2004-06-14 03:40:56 +00:00
Nate Lawson
9123341378 Add support to ACPI to manage its own resources. Previously, resource
allocation was passed up to nexus.  Now, we probe sysresource objects and
manage the resources they describe in a local rman pool.  This helps
devices which attach/detach varying resources (like the _CST object) and
module loads/unloads.  The allocation/release routines now check to see if
the resource is described in a child sysresource object and if so,
allocate from the local rman.  Sysresource objects add their resources to
the pool and reserve them upon boot.  This means sysresources need to be
probed before other ACPI devices.

Changes include:
* Add ordering to the child device probe.  The current order is:  system
resource objects, embedded controllers, then everything else.
* Make acpi_MatchHid take a handle instead of a device_t arg.
* Replace acpi_{get,set}_resource with the generic equivalents.
2004-06-13 22:52:30 +00:00
David E. O'Brien
07f5454078 Add PCI identifier for Dell modified SBLive! card
Submitted by:	Joseph Dunn <joseph@magnesium.net>
2004-06-13 22:12:02 +00:00
Scott Long
6387afd9c5 Pass the correct argument to ncr53c9x_timeout() 2004-06-13 18:45:57 +00:00
David E. O'Brien
13709702ba Cast printf'ed values to intmax_t. 2004-06-13 17:57:15 +00:00
Nate Lawson
59a890e6a3 Associate a device_t with an ACPI_HANDLE. This make AcpiWalkNamespace more
useful.  If ACPI-CA allowed null object handlers, we wouldn't need the
placeholder function.
2004-06-13 17:29:35 +00:00
Max Laier
02b199f158 Link ALTQ to the build and break with ABI for struct ifnet. Please recompile
your (network) modules as well as any userland that might make sense of
sizeof(struct ifnet).
This does not change the queueing yet. These changes will follow in a
seperate commit. Same with the driver changes, which need case by case
evaluation.

__FreeBSD_version bump will follow.

Tested-by:	(i386)LINT
2004-06-13 17:29:10 +00:00
Doug Rabson
04fa3b29f5 Add configuration rom entries for IP over firewire. 2004-06-13 13:58:00 +00:00
MIHIRA Sanpei Yoshiro
ee0f521c12 To support the promiscuous mode udav(4) driver
PR:		kern/67862
Submitted by:	WATANABE Shingo <nabe@nabechan.org>
2004-06-13 11:22:58 +00:00
Doug Rabson
b8b3323469 Add a new driver to support IP over firewire. This driver is intended to
conform to the rfc2734 and rfc3146 standard for IP over firewire and
should eventually supercede the fwe driver. Right now the broadcast
channel number is hardwired and we don't support MCAP for multicast
channel allocation - more infrastructure is required in the firewire
code itself to fix these problems.
2004-06-13 10:54:36 +00:00
Scott Long
1da2ceea66 Get rid of UMA zones and instead allocate all ecb's up front and track them
in a TAILQ.  Re-arrange some of the ecb elements so that they can stay
stable through alloc/free cycles while the rest get bzero'd.

- Use the tag_id from the ecb rather than fro the ccb.  The latter is only
for target mode.

- Honor the ccb flags for tag_action when deciding whether to do a tagged
or untagged transaction.

- Re-arrange autosense completion so that it works correctly in failure
cases.

- Turn on the PI_TAG_ABLE flag so that CAM will send us tagged transactions.

This enables tagged queueing in the driver.
2004-06-13 09:08:44 +00:00
John-Mark Gurney
0ddcf11c52 make code less broken, only try to create unit 0 since there can only
be one, this will help prevent multipling devices if this driver is
ever loaded/unloaded multiple times...

Prodded by:	julian
2004-06-13 05:00:19 +00:00
Scott Long
fec4efc10b When autosense is retrieved, tell CAM about it instead of juust pretending
that the command succeeded.  Sheesh!  This makes CDROMs no longer cause an
instant panic at boot.  Thanks to Jake Burkholder for providing a remote
test setup.
Also make device resets work, thanks to another typo.
2004-06-12 05:19:17 +00:00
Scott Long
76ff08d072 Correct typo from previous commit. 2004-06-12 03:23:37 +00:00
Marius Strobl
093caf3332 Back out 1.23 until I figure out why it causes Netra t1 100 to no longer
pass any traffic. Unfortunately this means no full-duplex link with auto-
negotiation on hme(4) using DP83840A PHYs again.
I really thought I had tested this also on a Netra t1 100...
2004-06-12 02:23:06 +00:00
Jens Schweikhardt
d809991124 Style cleanup. 2004-06-11 18:47:44 +00:00
Vinod Kashyap
75e4d88db4 Fix for a problem seen only on 6xxx series controllers, where-in the
driver tries to submit the same request repeatedly, on finding the
controller cmd queue to be full.

Submitted by:ps, vkashyap
Reviewed by:re
Approved by:re
2004-06-11 18:42:44 +00:00
Jens Schweikhardt
37522eed80 * Fix typo in comment.
* remove extraneous semicolon between function definitions.
* vm_offset_t is not a pointer, so return 0, not NULL. This
  fixes two warnings.
2004-06-11 17:51:37 +00:00
Scott Long
13bbbdd9c2 Make the XPT_CALC_GEOMETRY op dependent on the sc_extended_geometry flag
that is set in the bus front-end.
2004-06-11 15:33:20 +00:00
Poul-Henning Kamp
1930e303cf Deorbit COMPAT_SUNOS.
We inherited this from the sparc32 port of BSD4.4-Lite1.  We have neither
a sparc32 port nor a SunOS4.x compatibility desire these days.
2004-06-11 11:16:26 +00:00
Søren Schmidt
68599b781f Back out the last change as that broke some SATA devices.
Now we are cleaing up remove a few lines of unused code.
2004-06-11 07:39:15 +00:00
Eric Anholt
3ba181deb2 Merge from DRI CVS as of 2004-05-26. Most of the meat is new PCI IDs and a new
packet for Radeon.
2004-06-11 03:26:59 +00:00
Marius Strobl
543912b386 Remove second <sys/cdefs.h> and __FBSDID. 2004-06-10 22:15:51 +00:00
Marius Strobl
397f6b1e7f Add a first version of a pcf(4) front-end for the Sun i2c devices ("i2c"
is the actual name here) on EBus and which are PCF8584 (on systems having
a boot-bus controller the i2c are said to not be a PCF8584). Similar to the
SUNW,envctrl devices, onboard slaves for monitoring fans, temperatures and
such hang off of these i2c devices. But there's also stuff like EEPROMs
housing the hostid of the system and the boards usally have a connector to
add custom slave devices (on CP1500 there's actually a second PCF8584 with
its own I2C bus for these).
This driver already works fine but I'm not yet sure if access to the slave
devices on CP1400/CP1500 marked as "reserved for factory use" in the docs
should be blocked (most likely these are the voltage controllers wich aren't
meant to be controller by software and even not by the firmware). Once the
issues with polled mode are fixed in the common pcf(4) part in pcf.c, this
front-end should probably honour the poll-mode property of the i2c devices.
Tested on Ultra AXe and CP1500 (Netra t1 100).

OK'ed by:	joerg, nsouch
2004-06-10 21:56:52 +00:00
Marius Strobl
a9f012c75d - Add missing <sys/module.h>.
- Use "envctrl" as the name when registering this module rather than "pcf";
  we can't have "pcf" as the name for all pcf(4) front-ends or we would get
  conflicts.

OK'ed by:	joerg
2004-06-10 21:53:04 +00:00
Marius Strobl
cdd89aebf5 - Add missing <sys/module.h>.
- s,pcf_,pcf_isa, to better reflect the purpose of this front-end and to
  avoid conflicts.
- Don't use this front-end for attaching to EBus, declaring it as an EBus
  driver was a cut&paste accident according to joerg.

OK'ed by:	joerg, nsouch
2004-06-10 21:51:39 +00:00
Marius Strobl
f2ce1eaef9 - #define\tFOO\tBAR
- Remove two tabs from an otherwise empty line.

OK'ed by:	nsouch
2004-06-10 21:48:51 +00:00
John Baldwin
092a5c4530 Remove atdevbase and replace it's remaining uses with direct references to
KERNBASE instead.
2004-06-10 20:31:00 +00:00
Roman Kurakin
2a8436eae5 Free tty at detach().
Tested by:	`pstat -t`
Requested by:	phk
2004-06-10 13:50:28 +00:00
Scott Long
c31d0cf77b Port the NetBSD esp(4) driver. This only includes the sbus front-end, so
its primary use is for the FEPS/FAS366 SCSI found in Sun Ultra 1e and 2
machines.  Once the pci front-end is ported, this driver can replace the
amd(4) driver.

The code as-is is fairly stable.  I've disabled tagged-queueing until I can
figure out a corruption bug related to it.  I'm importing it now so that
people with these machines can (finally) stop netbooting and report bugs
before 5.3.
2004-06-10 05:11:39 +00:00
Ian Dowse
f2b2cfdac0 Initialise `restartcnt' in the newly malloc'd usbd_port structure,
as otherwise the junk it contains may cause uhub_explore to give
up without ever trying to restart the port. This fixes the following
errors I was seeing with a VIA UHCI controller:

	uhub0: port error, restarting port 1
	uhub0: port error, giving up port 1
2004-06-10 01:13:26 +00:00
Marius Strobl
9d3be787c2 - Add a LLADDR() forgotten in the conversion to ether_crc32_le().
- Remove a variable no longer used after the conversion.
- While here, save on another one no longer really necessary after the
  conversion.
2004-06-10 00:06:04 +00:00
Marius Strobl
c240bd8cf8 - Remove a variable no longer used after the conversion to ether_crc32_le().
- While here, save on another one no longer really necessary after the
  conversion.
2004-06-10 00:04:16 +00:00
Roman Kurakin
daac3fffc8 Check if we control device. Else we will go to panic cause we don't have
properly initialized dev_t structure at open.
2004-06-09 17:58:51 +00:00
Warner Losh
09f3862add When adding files to the repo, it is very important to not forget
the cvs add function.
2004-06-09 16:56:22 +00:00
Warner Losh
6732641e0a Step 1 in moving EISA devices to kobj/newbus. Use kobj methods for
all of the interface between the driver and the bus.  This will enable
us to stop special casing eisa bus attachments in modules and treat them
like we treat all other busses.

In the longer run, we need to eliminate much (all?) of these interfaces
and switch to using the standard bus_alloc_resource(), but that's not
done right now.

# I've not updated the modules to include eisa, etc, just yet

Tested on: Compaq Proliant 3000/333 purchased for eisa work
2004-06-09 16:08:20 +00:00
Bill Paul
da3003f09a Add some special case code to fix a problem with the BCM5704 in TBI (fiber)
mode. The 5704 apparently has some s00p3r s33kr1t registers for setting
the advertisement of pause frame ability (i.e flow control) when in
autoneg mode. If we don't set these registers correctly, we may not
be able to negotiate a proper link with some switches. (Symptom is that
the NIC reports the link as up (PCS synched) but no traffic can be
exchanged.)

PR:		kern/67598
2004-06-09 16:01:59 +00:00
Christian Weisgerber
0e939c0cea Replace handrolled CRC calculation with ether_crc32_[lb]e(). 2004-06-09 14:34:04 +00:00
Warner Losh
8c81529f45 Only match cards that claim to be network cards. I've had two
different cards that matched vendor/id, but weren't wi cards.  This is
because the vendor foolishly didn't have unique product ids.  Symbol
has a serial card that would otherwise match the wi driver, for
example...

Taken from a patch for xe posted by: Carlos Velasco
2004-06-09 06:31:40 +00:00
Christian Weisgerber
ea48e26883 Replace convoluted and broken CRC calcuation with ether_crc32_le().
This should fix multicast reception.
2004-06-09 00:30:11 +00:00
Christian Weisgerber
1d5056708c * Fix multicast reception.
* Replace handrolled crc calculation with ether_crc32_le().

Based on:

PR:		67544
Submitted by:	HASHI Hiroaki <hashiz@tomba.cskk-sv.co.jp>
2004-06-09 00:25:44 +00:00
Joerg Wunsch
a91a792fed Implement the BREAK_TO_DEBUGGER option for sab(4). 2004-06-08 11:58:34 +00:00
Roman Kurakin
a5d60d8852 1. struct tty => struct tty *tty.
Requested by:	phk
2004-06-08 10:38:20 +00:00
Nate Lawson
1f36889f63 Remove accidental change. 2004-06-07 21:44:01 +00:00
Nate Lawson
45e556cc69 Avoid printing extraneous warning messages when trying to switch a device
which doesn't support ACPI power states.  Return AE_NOT_FOUND for these
cases and don't print the warning message.  Also, print the name of the
handle instead of device when unable to switch states.  The device is often
not attached at this point and so its name is NULL, which doesn't help
debugging.
2004-06-07 21:39:15 +00:00
Poul-Henning Kamp
5df76176f7 Make linesw[] an array of pointers to linedesc instead of an array of
linedisc.
2004-06-07 20:45:45 +00:00
John Baldwin
4dc4ea2604 - Use PCI_INVALID_IRQ macro rather than a magic number.
- Remove obsolete comment about APIC_IO routing.
2004-06-07 17:36:22 +00:00
Bill Paul
cdd83ba354 Add an entry to the PCI ID list to support the serial interface on the
Broadcom 802.11g/GPRS CardBus card.

Submitted by:	Yann Berthier yb at sainte-barbe dot org
2004-06-07 16:33:47 +00:00
Don Lewis
144a53875b Nuke a cryptic and useless diagnostic printf(). 2004-06-07 12:25:14 +00:00
MIHIRA Sanpei Yoshiro
55184d950a Sync to 1.181 of usbdevs 2004-06-05 21:36:06 +00:00
MIHIRA Sanpei Yoshiro
7c48241358 Add support Sony/Ericsson SEMC DSS-20 SyncStation,
which can be used to communicate with the P900 mobile phone.

PR:		misc/67606
Submitted by:	Christian Gusenbauer <c47g@gmx.at>
MFC after:	1 week
2004-06-05 21:33:59 +00:00
Paul Saab
a54e98d365 Document the 64bit version of blocks_to_recover for logical drive status.
Pad the struct to 1024 bytes as defined in the firmware spec.
2004-06-05 18:31:04 +00:00
Paul Saab
b612d5e1ea Add pci id's for the SmartArray 6422 and V100 controllers. Also
add a whole bunch of pci id's for future controllers.

Submitted by:	John Cagle <first.last@hp.com>
2004-06-05 18:12:56 +00:00
MIHIRA Sanpei Yoshiro
157077e99b Sync to 1.180 of usbdevs 2004-06-05 13:37:54 +00:00
MIHIRA Sanpei Yoshiro
a9ec4ac997 Add device ID for atuwi USB wlan driver, AWL400 Wireless adapter.
(Atmel at76c503a http://vitsch.net/bsd/atuwi)

PR:		kern/67254
Submitted by:	Arjan van Leeuwen <avleeuwen@piwebs.com>
2004-06-05 13:36:10 +00:00
Nate Lawson
0e4148688c Don't forget to pass shutdown events down to children first now that we
handle them at the bus level too.
2004-06-05 09:56:04 +00:00
Nate Lawson
169b539a33 Disable wake GPEs in the reboot path as well as poweroff path. This fixes
"stray irq 9" messages on my Thinkpad.  It may also help with general
reboot consistency although the recent hang on reboot was solved by
acpi_cpu.c rev 1.39.
2004-06-05 07:25:58 +00:00
Nate Lawson
a2afe45a8a Rework acpi_cpu_idle() to select the next idle state before sleeping, not
after.  Unify the paths for all Cx states.  Remove cpu_idle_busy and
instead do the little profiling we need before re-enabling interrupts.
Use 1 quantum as estimate for C1 sleep duration since the timer interrupt
is the main reason we wake.

While here, change the cx_history sysctl to cx_usage and report statistics
for which idle states were used in terms of percent.  This seems more
intuitive than counters.  Remove the cx_stats structure since it's no
longer used.  Update the man page.

Change various types which do not need explicit size.
2004-06-05 07:02:18 +00:00
MIHIRA Sanpei Yoshiro
4845af6ce0 Sync to 1.179 of usbdevs 2004-06-05 05:25:16 +00:00
MIHIRA Sanpei Yoshiro
b9ebb45a96 Add support Neodio-3260 8-in-1 multi format USB memory card / flash controller
PR:		kern/67115
Submitted by:	Jukka A. Ukkonen <jau@iki.fi>
MFC after:	1 week
2004-06-05 05:23:46 +00:00
Dag-Erling Smørgrav
63eaecc921 Take advantage of the dev sysctl tree.
Approved by:	wpaul
2004-06-04 22:24:46 +00:00
Poul-Henning Kamp
13e84a71e0 Centralize the line discipline optimization determination in a function
called ttyldoptim().

Use this function from all the relevant drivers.

I belive no drivers finger linesw[] directly anymore, paving the way for
locking and refcounting.
2004-06-04 21:55:55 +00:00
Poul-Henning Kamp
fe3ec6224a Manual edits to change linesw[]-frobbing to ttyld_*() calls. 2004-06-04 20:04:52 +00:00
Paul Saab
bbfb452827 Update logical drive structure 2004-06-04 17:22:13 +00:00
Peter Wemm
f2b6954343 Work around the preemption problem in acpi_cpu.c for shutting down.
Submitted by:  nate / jhb
2004-06-04 17:03:18 +00:00
Yaroslav Tykhiy
3e4482412b Implement support for controlling VLAN_HWTAGGING through ioctl(SIOCSIFCAP).
This includes not only toggling the flag in if_capenable, but also really
reconfiguring the hardware.

Approved by:	tackerman (as the em(4) maintainer)
2004-06-04 16:57:18 +00:00
Maxime Henrion
0547806326 Make the emu10k1 pcm driver INTR_MPSAFE. The locking is modeled
exactly as done in the cmi driver.  I am quite confident this is
safe since I'm runing this for more than two weeks now, on an SMP
box.  A few people tested this patch for me successfully as well.
2004-06-04 16:42:33 +00:00
Poul-Henning Kamp
2140d01b27 Machine generated patch which changes linedisc calls from accessing
linesw[] directly to using the ttyld...() functions

The ttyld...() functions ar inline so there is no performance hit.
2004-06-04 16:02:56 +00:00
Poul-Henning Kamp
e451f9b758 Make the remaining serial drivers call ttyioctl() rather than calling
the linedisc directly.
2004-06-04 08:02:37 +00:00
Bill Paul
55cfa737d7 Unbreak the Intel 2100 Centrino wireless driver (and probably others):
- In subr_ndis.c, my_strcasecmp() actually behaved like my_strncasecmp():
  we really need it to behave like the former, not the latter. (It was
  falsely matching "RadioEnable", which defaults to 1 with "RadioEnableHW"
  which the driver creates itself and to 0, because we were using
  strlen("RadioEnable") as the length to test. This caused the radio to
  always be turned off. :( )

- In if_ndis.c, only set IEEE80211_CHAN_A for channels if we actually
  set any IEEE80211_MODE_11A rates. (ieee80211_attach() will "helpfully"
  add IEEE80211_MODE_11A to ic_modecaps for you if you initialize any
  802.11a channels. This caused "ndis0: 11a rates:" to erroneously be
  displayed during driver load.)

- Also in if_ndis.c, when using TESTSETRATE() to add in any missing 802.11b
  rates, remember to OR the rates with IEEE80211_RATE_BASIC, otherwise
  comparing against existing basic rates won't match. (1, 2, 5.5 and
  11Mbps are basic rates, according to the 802.11b spec.) This erroneously
  cause 11Mbps to be added to the 11b rate list twice.
2004-06-04 04:43:36 +00:00
Poul-Henning Kamp
186f2b9e04 Add missing <sys/module.h> includes currently relying on nested include
in <sys/kernel.h>
2004-06-03 06:10:02 +00:00
Maxime Henrion
67fc050f0c Abstract the locking in fxp(4) a bit more by using macros for
mtx_assert() and mtx_owned(), as it is done in other places,
for instance proc locking.
2004-06-02 22:59:57 +00:00
Maxime Henrion
0f1db1d60f Use the device sysctl tree instead of rolling our own. Some of the
sysctls were global (hw.fxp_rnr and hw.fxp_noflow), all of them are
now per-device.  Sample output of "sysctl dev.fxp0" with this patch,
with the standard %foo nodes removed :

dev.fxp0.int_delay: 1000
dev.fxp0.bundle_max: 6
dev.fxp0.rnr: 0
dev.fxp0.noflow: 0
2004-06-02 22:52:18 +00:00
Scott Long
03b5fe51bf Collapse sync fib locking into normal i/o locking. The former didn't
protect the registers so it was trivially possible for a sync command and
i/o command to fight each other and confuse the controller.  Make the
sync fib alloc/release functions inline and remove the somewhat worthless
AAC_SYNC_LOCK_FORCE flag.  Thanks to Adil Katchi for helping me to track
this down in RELENG_4.
2004-06-02 18:15:48 +00:00
Max Khon
9455fe9a67 Remove extra semicolon. 2004-06-02 18:03:07 +00:00
Bill Paul
a1b1f3821d Explicitly #include <sys/module.h> in these files too (they use
MODULE_DEPEND()).
2004-06-01 23:27:36 +00:00
Poul-Henning Kamp
9c01a318d2 A major overhaul of the nmdm(4) driver:
It was based on the pty(4) driver which as a tty side an a non-tty side.

Nmdm(4) seems to have inherited two symmetric sides from pty but
unfortunately they are not quite ttys.  Running a getty one one
side and tip on the other failed to produce NL->CRNL mapping for
instance.

Rip out the basically bogus cdevsw->{read,write} functions and rely
on ttyread() and ttywrite() which does the same thing.

Use taskqueue_swi_giant to run a task for either side to do what
needs to be done.  (Direct calling is not an option as it leads to
recursion.)  Trigger the task from the t_oproc and t_stop methods.

Default the ports to not ECHO.  Since we neither rate limiting nor
emulation, two ports echoing each other is a really bad idea, which
can only be properly mitigated by rate limiting, rate emulation or
intelligent detection.  Rate emulation would be a neat feature.

Ditch the modem-line emulation, if needed for some app, it needs
to be thought much more about how it interacts with the open/close
logic.
2004-06-01 22:53:00 +00:00
Poul-Henning Kamp
4b5f407579 Remove unused variable. 2004-06-01 19:02:51 +00:00
Scott Long
614c22b2a2 Commit the correct version of the patch from last night. This fixes an
immediate panic when doing any i/o, and it closes a completion race.
2004-06-01 15:50:11 +00:00
Poul-Henning Kamp
138fbf675a Gainfully employ the new ttyioctl in the trivial cases. 2004-06-01 13:49:28 +00:00
Søren Schmidt
86e711a393 When waiting for drive to become ready, reinit the request params as they
might get trashed by autosensing.
2004-06-01 12:28:45 +00:00
Søren Schmidt
c83c43b66e Use the right cmd+errorcode if we are in autosense/not. 2004-06-01 12:26:08 +00:00
Poul-Henning Kamp
be9bd88238 There is no need to explicitly call the stop function. In all likelyhood
->l_close() did it and ttyclose certainly will.
2004-06-01 11:57:15 +00:00
Poul-Henning Kamp
a1cda79464 There is no need to explicitly call ttwakeup() and ttwwakeup() after
ttyclose() has been called.  It's already been done once by ttyclose,
and probably once by the line-discipline too.
2004-06-01 11:38:06 +00:00