Commit Graph

376 Commits

Author SHA1 Message Date
MIHIRA Sanpei Yoshiro
ab410acc0a Add IOD0081 - I-O DATA DEVICE,INC. IFML-560
PR:		kern/25173
Submitted by:	Yohsuke Fujikawa <yohsuke@mx2.nisiq.net>
2001-03-07 14:19:55 +00:00
Jonathan Lemon
608a3ce62a Extend kqueue down to the device layer.
Backwards compatible approach suggested by: peter
2001-02-15 16:34:11 +00:00
Mark Murray
d888fc4e73 RIP <machine/lock.h>.
Some things needed bits of <i386/include/lock.h> - cy.c now has its
own (only) copy of the COM_(UN)LOCK() macros, and IMASK_(UN)LOCK()
has been moved to <i386/include/apic.h> (AKA <machine/apic.h>).
Reviewed by:	jhb
2001-02-11 10:44:09 +00:00
John Baldwin
062d8ff5a0 - Catch up to the new swi API changes:
- Use swi_* function names.
  - Use void * to hold cookies to handlers instead of struct intrhand *.
- In sio.c, use 'driver_name' instead of "sio" as the name of the driver
  lock to minimize diffs with cy(4).
2001-02-09 17:46:35 +00:00
Bosko Milekic
9ed346bab0 Change and clean the mutex lock interface.
mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)
2001-02-09 06:11:45 +00:00
Peter Wemm
8ab109d131 Remove count for NSIO. The only places it was used it were incorrect.
(alpha-gdbstub.c got sync'ed up a bit with the i386 version)
2001-01-31 10:54:45 +00:00
Seigo Tanimura
307afaf3c6 Add OZO8008 - Zoom (33.6k Modem).
PR:		kern/23336
Submitted by:	Paulo Menezes <root@samurai.dee.uc.pt>
2000-12-26 06:52:57 +00:00
John Baldwin
6d0006c203 Convert the sio driver to use a spin mutex instead of a s_lock. This is
going to hurt sio(4) performance for the time being.  As we get closer to
release and have more of the kernel unlocked we can come back to doing
arcane optimizations to workaround the limitations of the sio hardware.
2000-12-18 23:56:16 +00:00
John Baldwin
8088699f79 - Overhaul the software interrupt code to use interrupt threads for each
type of software interrupt.  Roughly, what used to be a bit in spending
  now maps to a swi thread.  Each thread can have multiple handlers, just
  like a hardware interrupt thread.
- Instead of using a bitmask of pending interrupts, we schedule the specific
  software interrupt thread to run, so spending, NSWI, and the shandlers
  array are no longer needed.  We can now have an arbitrary number of
  software interrupt threads.  When you register a software interrupt
  thread via sinthand_add(), you get back a struct intrhand that you pass
  to sched_swi() when you wish to schedule your swi thread to run.
- Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit
  more intuitive.  Also, prefix all the members of struct intrhand with
  'ih_'.
- Make swi_net() a MI function since there is now no point in it being
  MD.

Submitted by:	cp
2000-10-25 05:19:40 +00:00
Seigo Tanimura
300b36ab36 Add MAE0021 - Jetstream Int V.90 56k Voice Series 2.
PR:		i386/19920
Submitted by:	Peter Ortner <port@iname.com>
2000-10-10 10:06:26 +00:00
Bruce Evans
185fee17ad Use schedsofttty() again so that siopoll() gets scheduled as designed
(SMPng casualty in rev.1.308 with wrong fix in rev.1.310).
2000-10-08 14:13:31 +00:00
John Baldwin
1931cf940a - Heavyweight interrupt threads on the alpha for device I/O interrupts.
- Make softinterrupts (SWI's) almost completely MI, and divorce them
  completely from the x86 hardware interrupt code.
  - The ihandlers array is now gone.  Instead, there is a MI shandlers array
    that just contains SWI handlers.
  - Most of the former machine/ipl.h files have moved to a new sys/ipl.h.
- Stub out all the spl*() functions on all architectures.

Submitted by:	dfr
2000-10-05 23:09:57 +00:00
John Baldwin
e268a9aae5 - Wrap functions and variables that aren't used in the alpha console probe
with #ifndef __alpha__/#endif
- Add function prototypes for functions used during the alpha console
  probe and gdb port setup inside of #ifdef __alpha__/#endif.
2000-09-22 08:42:30 +00:00
John Baldwin
9a94c9c5c3 - Remove the inthand2_t type and use the equivalent driver_intr_t type from
newbus for referencing device interrupt handlers.
- Move the 'struct intrec' type which describes interrupt sources into
  sys/interrupt.h instead of making it just be a x86 structure.
- Don't create 'ithd' and 'intrec' typedefs, instead, just use 'struct ithd'
  and 'struct intrec'
- Move the code to translate new-bus interrupt flags into an interrupt thread
  priority out of the x86 nexus code and into a MI ithread_priority()
  function in sys/kern/kern_intr.c.
- Remove now-uneeded x86-specific headers from sys/dev/ata/ata-all.c and
  sys/pci/pci_compat.c.
2000-09-13 18:33:25 +00:00
John Baldwin
a0e1678488 Add a nasty hack to get remote kernel gdb working from ddb. ddb would
complain before that a suitable gdb port had not been setup because gdbdev
was NULL.  This abuses the fact that the gdb port is hard-coded to the
address normally assigned to sio1 and thus hard-codes in sio1 as the gdb
port.  Yuck.
2000-09-11 04:33:36 +00:00
John Baldwin
9c25701692 Back out my previous commit as well as some SMPng changes to revert the
siosetwater() function to its previous behavior of always disabling
interrupts and obtaining the com_lock before returning.

Requested by:	bde (in principle)
2000-09-08 08:50:25 +00:00
Greg Lehey
e45e88e8aa siointr1: Schedule soft interrupt when needed. This fixes the "no
interrupt" problem people had seen with SMPng.

Approved by:       jasone
Tested by:         bp
2000-09-08 06:58:58 +00:00
John Baldwin
60ee19d500 Fix a problem where we would recursively try to get the com lock within
comparam when calling siosetwater().

Noticed by:	bp
2000-09-08 00:35:46 +00:00
Jason Evans
0384fff8c5 Major update to the way synchronization is done in the kernel. Highlights
include:

* Mutual exclusion is used instead of spl*().  See mutex(9).  (Note: The
  alpha port is still in transition and currently uses both.)

* Per-CPU idle processes.

* Interrupts are run in their own separate kernel threads and can be
  preempted (i386 only).

Partially contributed by:	BSDi (BSD/OS)
Submissions by (at least):	cp, dfr, dillon, grog, jake, jhb, sheldonh
2000-09-07 01:33:02 +00:00
Sheldon Hearn
bade5944c9 Add ZTIA001 - Zoom Internal V90 Faxmodem.
PR:		21028
Submitted by:	Glenn Johnson <glennpj@charter.net>
2000-09-05 09:42:47 +00:00
Sheldon Hearn
1eb283fdc2 Add Boca K56Flex PnP modem.
PR:		21000
Submitted by:	Andrew Sparrow <spadger@best.com>
2000-09-04 13:50:37 +00:00
Poul-Henning Kamp
62ddc84e08 Call destroy_dev() when sio devices go away. 2000-08-27 14:46:13 +00:00
Peter Wemm
d7db4e569d Add another USR modem.
PR: 20621
Submitted by: Masanori Taira <mtaira@logicaleffect.com>
2000-08-15 21:03:28 +00:00
Poul-Henning Kamp
77978ab8bc Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.
Pointed out by:	bde
2000-07-04 11:25:35 +00:00
Poul-Henning Kamp
82d9ae4e32 Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:
Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our
sources:

        -sysctl_vm_zone SYSCTL_HANDLER_ARGS
        +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
2000-07-03 09:35:31 +00:00
Paul Saab
26b6ea69c3 Add option ALT_BREAK_TO_DEBUGGER.
Implement the Solaris way to break into DDB over a serial console
instead of sending a break.  Sending the character sequence
CR ~ ^b will break the kernel into DDB (if DDB is enabled).

Reviewed by:	peter
2000-06-14 06:41:33 +00:00
Seigo Tanimura
26605df75f Add SUP1670 - Supra 336i V+ Intl. Since we update the PnP IDs
more frequently than the core part of the sio driver, it might
be good to move the PnP IDs to sio_isapnp.h or something like
that.

PR:		i386/18828
Submitted by:	J.P. King <jpk28@cam.ac.uk>
2000-05-26 11:41:08 +00:00
Seigo Tanimura
07a1e11832 Add RSS0262 - 5614Jx3[G] V90+K56Flex Modem.
PR:		kern/18168
Submitted by:	Tony Voet <voet@engineer.com>
2000-05-19 10:02:15 +00:00
Seigo Tanimura
026957712e Add ACH2012 - 5634BTS 56K Video Ready Modem.
PR:		kern/17351
Submitted by:	Eric D. Futch <efutch@nyct.net>
2000-05-19 03:41:22 +00:00
Seigo Tanimura
ca39cee745 Add a couple of new PnP IDs.
o OZO800f - Zoom 2812 (56k Modem)
PR:		kern/18603
Submitted by:	Matt Loschert <loschert@servint.com>

o DAV0336 - DAVICOM 336PNP MODEM
PR:		kern/18608
Submitted by:	Martijn Plak <martijn@be3.com>
2000-05-18 02:06:24 +00:00
Yoshihiro Takahashi
bb7d754339 Use bus_space stuff except where it needs high performance.
Reviewed by:	bde
2000-05-12 12:37:28 +00:00
Seigo Tanimura
af2dfb5b69 Add the logical ID of FUJITSU Modem 33600 PNP/I2.
PR:		kern/18257
Submitted by:	Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
2000-05-02 05:54:11 +00:00
Warner Losh
b6f6dacdd3 Add support for pci modems. ONLY CONTROLLER BASED MODEMS. This
doesn't support winmodems, softmodems, hcf or any other modem that
relies on the host to do any sort of soft control for any aspect of
the modem's function.  There are two modems known to work:
	3COM FaxModem PCI.
	ActionTec 56k VoiceMessaging PCI Modem
and the following modem might work
	Multitech PCI FaxModem	(not sure about this)
and the serial pci cards might work too.  I have neither these
hardware items so I can't add support for them.
2000-04-01 06:14:21 +00:00
Peter Wemm
39f1e703ec Recognize USR3050 "U.S. Robotics 56K FAX INT" fax modem.
PR:		17702
Submitted by:	Scot W. Hetzel <hetzels@westbend.net>
2000-03-31 07:09:08 +00:00
Poul-Henning Kamp
91266b96c4 Isolate the Timecounter internals in their own two files.
Make the public interface more systematically named.

Remove the alternate method, it doesn't do any good, only ruins performance.

Add counters to profile the usage of the 8 access functions.

Apply the beer-ware to my code.

The weird +/- counts are caused by two repocopies behind the scenes:
	kern/kern_clock.c -> kern/kern_tc.c
	sys/time.h -> sys/timetc.h
(thanks peter!)
2000-03-20 14:09:06 +00:00
Warner Losh
633f93bee5 Fix crashes on card eject for pccard modems. We check for NULL when
we get the com address.  If so, we go ahead and return.  Bruce thinks
there's a bug in the pccard layer that it terminates devices with
extreme prejustice rather than letting them deside for themselves when
to terminate (and he's likely right).  This fix doesn't change that,
but instead works around it by checking for NULL pointers at more
places than before.

The detach routine still calls functions at interrupt level that
aren't reentrant.  In theory this could cause a problem, but none
showed up in practice.  Future versions should correct this problem,
likely by making the detach process a thread/process at the pccard
level.  NEWCARD will do this, and the current pccard layer should
likely be modified to that as well, should it live long enough.

A few style nits of the same form that were in my original patch sent
off to bde were also fixed as part of this process.  Mostly use of
!ptr and return ENOPARENS.

This should prevent a crash on suspend with an active ppp link as
well, but that wasn't tested.

Reviewed by:	bde
Approved by:	jkh
2000-03-11 20:22:09 +00:00
Peter Wemm
d365f16644 Recognize another modem, "PMC2430 - Pace 56 Voice Internal Modem"
Submitted by:	Mark Ovens <mark@ukug.uk.freebsd.org>
2000-03-05 14:44:05 +00:00
Peter Wemm
fee576b2e5 Fix two more problems with freeing the softc data manually. subr_bus.c
is responsible for this and this will lead to malloc 'freeing already
free' type panics.  One was in the probe code, the other was in the
pccard eject? code.

Not explicitly approved by: jkh (but the first is fallout from subr_bus.c
rev 1.54 which was an approved commit, the second is the same problem)
2000-03-02 03:45:41 +00:00
Bruce Evans
34ae9210dd Fixed regressions in rev.1.274:
1) Non-AST4 multiport cards were broken by bypassing the code that changes
   `idev' to the multiport master device.
2) AST4 multiport cards apparently were broken by inverting the test for
   the master device having an irq.
3) Error handling for nonexistent master devices was broken by removing a
   check for a null pointer.
4) `int' error codes returned by bus_get_resource() were assigned directly
   to the boolean variable com->no_irq.  Probably harmless, since the
   boolean is implemented as a u_char.

Submitted by:	part 1) by Chris Radek <cradek@in221.inetnebr.com>
		part 2) by yokota
Approved by:	jkh
2000-02-15 17:29:09 +00:00
Bruce Evans
689315d4f7 "Completed" the previous fix. Return ENOMEM on memory allocation failure
in sioattach(), not ENXIO.  Free resources before returning early in
sioprobe() and sioattach().
2000-01-29 03:02:55 +00:00
Nick Hibma
9c918de3de Return ENXIO on error, not 0. Seems to have been skipped when converting
to newbus.

Reviewed by:	bde
2000-01-23 15:11:15 +00:00
Peter Wemm
5995e84e19 Add another four device ID's for isa pnp modems. The USR's seem to use
the same vendor and logical ID.  The rest I am not sure whether they
are vendor or logical, but it won't hurt if I've put a vendor ID here
as merely will not match.  These came from the old sio-pnp code, hence
the uncertainty about which ID it is.
2000-01-18 09:30:58 +00:00
Andrew Gallatin
91dab55369 Make this compile on alpha 2000-01-13 02:09:44 +00:00
Kazutaka YOKOTA
35e61cbd71 Add a new mechanism, cndbctl(), to tell the console driver that
ddb is entered.  Don't refer to `in_Debugger' to see if we
are in the debugger.  (The variable used to be static in Debugger()
and wasn't updated if ddb is entered via traps and panic anyway.)

- Don't refer to `in_Debugger'.
- Add `db_active' to i386/i386/db_interface.d (as in
  alpha/alpha/db_interface.c).
- Remove cnpollc() stub from ddb/db_input.c.
- Add the dbctl function to syscons, pcvt, and sio. (The function for
  pcvt and sio is noop at the moment.)

Jointly developed by: bde and me

(The final version was tweaked by me and not reviewed by bde.  Thus,
if there is any error in this commit, that is entirely of mine, not
his.)

Some changes were obtained from: NetBSD
2000-01-11 14:54:01 +00:00
Peter Wemm
9928855f97 Recognize the GVC0505 (GVC 56k Faxmodem) as a sio device.
Obtained from: Dan J Fraser <dfraser@capybara.org> (for NetBSD)
1999-12-27 05:02:25 +00:00
Peter Wemm
684fb19e34 Extract a list of extra isa pnp modem ID's from NetBSD and OpenBSD. Some
of these are bound to have a PNP05xx compatid, but there's no easy way to
tell.  Since it's just an ID list and uses the pnp header's description
strings rather than encoding strings here, it doesn't seem to be too
expensive to err on the safe side.
1999-12-21 09:16:03 +00:00
Peter Wemm
99c215c08b Add SUP2070 (Diamond SupraExpress 56i)
Submitted by:  Kenneth Wayne Culver <culverk@wam.umd.edu>

Add MOT4560
Obtained from: wollman
1999-12-20 20:31:23 +00:00
Warner Losh
0712c356a3 o Make pccard work at all by including card.h
o fix return type of sio_pccard_detach
o don't free softc in deatch, since that is done by newbus
o disconnect interrupt we used to have.  Add cookie to com so that we can
  tear down the interrupt on unload
o Set gone earlier, but likely doesn't matter

This makes sio pccards work again.  Cards that are active when ejects may
not work (but they might, softc goes away quickly).

These changes are unreviewed by bde.  I'll make any style changes he wants.
1999-12-10 08:19:19 +00:00
Peter Wemm
4246912f31 Fix a pair of silly warnings that I introduced (that would have been
nasty on an Alpha or some other sizeof(int) != sizeof(long) machine).
1999-12-06 17:52:20 +00:00
Peter Wemm
d0029cf5f3 Use bus_get_resource() instead of bus_get_resource_start() as the latter
returns "0" on failure, which is indistinguishable from (say) irq 0.  This
should stop a couple of stray messages that turn up.

Also, if a BUS_SETUP_INTR() fails with INTR_TYPE_FAST, try falling back to
a normal interrupt.  This might help pccard folks with a shared slot
interrupt.  This whole thing needs to be revisited.
1999-12-06 06:47:02 +00:00
Warner Losh
e09f49b6fa Fix the hang on card eject problem and maybe the hang on suspend
problem.

o Create new timeout routine so we don't detach the card inside a ISR
  but instead drop back to spl0 via a timeout of 0.
o Actually delete the child of the pccard device rather than just faking
  it badly.
o Fix sio, ed and ep to have pccard detach routines that are int rather
  than void.
o Fix ep and ed pccard detach routines to use if_detach rather than just
  if_down.  if_detach destroys the device, while if_down just marks it
  down.  In this incarnation of the pccard things, we map the disable
  the slot action to detach the driver, which removes the driver from the
  device tree.  When that is done, a panic would soon follow as the
  ifconfig tried to down the device.

Didn't fix:
o Should cache the pccard dev child's pointer in struct slot
o remove now unused parts of struct slot
o Any driver using softc after detach has been called.  sio's softc used
  to be statically allocated, so you could check sc->gone, but that is
  now gone.
o Didn't remove gone from softc of drivers that use the old pccard method.

Didn't test:
o ed driver changes
o sio driver changes on pccards
o suspend (no laptop or apm support on my desktop)
1999-12-01 07:38:54 +00:00
Peter Wemm
592b1c00b5 Argh, don't turn the IIR test on unless it's a pccard. These tests mess
up the subsequent probes.
1999-11-18 10:29:06 +00:00
Peter Wemm
1447114333 Merge some typo fixes from dev/sio/sio.c (siostop -> comstop)
Remove EXTRA_SIO/NSIOTOT and make it fully dynamic (from dev/sio/sio.c)
Make sio work for pccard here - pccardd doesn't activate interrupts
until after prove has succeeded.
Mark the initial reset of likely sio ports as broken as it depended on
config supplying a list of locations to probe, devices are now proved
standalone.
Optimize a bit of COM_NOAST4() logic.
Use bus_get_resource_start() etc rather than using isa-centric calls.
Reactivate the IIR_TXRDYBUG test, I've got a card here with it.
Try to be a bit smarter about activating interrupts (ie: don't panic
if polled)
Fix some style bugs that have crept in over time (there are still more).
1999-11-18 07:22:41 +00:00
Warner Losh
806338b15d Last change to pccard_nbk now obviates the need to check the name of
the device in question.
Also fix warnings on if_ep_pccard.c
1999-10-28 05:06:14 +00:00
Warner Losh
a57cd933dc Add newbus pccard attachment for sio. Some of this code was written
by Peter Wemm, but I've not merged all the changes he sent to me yet.
This has not been reviewed by bde, so I'm committing to resolve any
issues he has with this when he returns from FreeBSD CON 99.

I've had four reports of this working for them.  I've been able to
communicate to both my built in modem and a pccard modem with these
patches.
1999-10-25 02:46:52 +00:00
Steve Price
004348c300 Add support for the USRobotics Courier V.Everything (USR0101) modem.
Submitted by:	Robert Blayzor <robert@superior.net>
1999-10-11 15:06:14 +00:00
Daniel Eischen
3c6967023c Change pnp ID for the SupraExpress 56i Sp V.90 modem (logical ID
0x8024b04e) so that the cards description is used instead of overriding
it.  While I'm here, add an ID for the SUP2080 and the SUP2030.

PR:		kern/13983
Submitted by:	Kurt D. Zeilenga <Kurt@OpenLDAP.Org> (SUP2030)
		dfr  (rest of change)
Reviewed by:	dfr
1999-10-03 22:25:19 +00:00
Daniel Eischen
c0d3a0d572 Add logical device ID for the Diamond SupraExpress 56K PnP modem:
Vendor ID SUP2480 (0x8024b04e), Serial Number 0x00001334
  PnP Version 1.0, Vendor Version 0
  Device Description: SupraExpress 56i Sp V.90

Reviewed by:	dfr
1999-10-03 17:50:09 +00:00
Poul-Henning Kamp
d6a0e38a1b Remove five now unused fields from struct cdevsw. They should never
have been there in the first place.  A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags
1999-09-25 18:24:47 +00:00
Poul-Henning Kamp
ae8e1d08d7 This patch clears the way for removing a number of tty related
fields in struct cdevsw:

        d_stop          moved to struct tty.
        d_reset         already unused.
        d_devtotty      linkage now provided by dev_t->si_tty.

These fields will be removed from struct cdevsw together with
d_params and d_maxio Real Soon Now.

The changes in this patch consist of:

        initialize dev->si_tty in *_open()
        initialize tty->t_stop
        remove devtotty functions
        rename ttpoll to ttypoll
        a few adjustments to these changes in the generic code
        a bump of __FreeBSD_version
        add a couple of FreeBSD tags
1999-09-25 16:21:39 +00:00
Peter Wemm
213fcefef2 Make it build, copy from dev/sio/sio.c:
isa_set_flags -> device_set_flags
isa_get_flags -> device_get_flags
1999-09-08 13:46:54 +00:00
Peter Wemm
f97d942bd0 Restore the old sio* - bruce can fix it himself. 1999-09-08 10:59:03 +00:00
Peter Wemm
e5174d14c5 Repo copy isa/sio* to dev/sio/sio* in preperation for extra bus methods
including pci.
Also, eliminate NSIOTOT and do it dynamically where it matters.
1999-09-06 14:06:23 +00:00
Peter Wemm
945f740363 Move the #if 0 to catch the card.h include and make sure it's zero. 1999-09-06 13:30:36 +00:00
Warner Losh
13264f28fb Start to disentangle the isa attachments from other buses. Partially
rewrite the pccard attachment case.  This is a work in progress, but
doesn't break the isa case.

I left the #if 0...#endif around the pccard stuff, at Peter's request,
so that normal users don't shoot themselves in the foot.

While I was here:
	o Indent a comment to the right location
	o Spell Unknown with a final 'n'.

Reviewed by: peter
1999-09-06 06:45:20 +00:00
Doug Rabson
bd64ce72a8 Add USR3031 pnp id.
Submitted by: Steve Price <sprice@hiwaay.net>
1999-09-04 14:31:56 +00:00
Doug Rabson
1c3111dc06 Remove the last vestiges of the old pnp code in favour of the new one. 1999-09-03 20:01:08 +00:00
Doug Rabson
4249382df0 This represents essentially a complete rewrite of the ISA PnP code. The
new system is integrated with the ISA bus code more cleanly and allows
the future addition of more enumerators such as PnPBIOS and ACPI.

This commit also enables the new pcm driver since it is somewhat tied to
the new PnP code.
1999-09-01 20:53:43 +00:00
Poul-Henning Kamp
c5b72c3d85 s/si_tty_tty/si_tty/g 1999-08-30 10:35:37 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Poul-Henning Kamp
9dcbe2404a Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().
1999-08-23 20:59:21 +00:00
Poul-Henning Kamp
f1fe3bf115 make alpha compile again. 1999-08-09 11:02:45 +00:00
Poul-Henning Kamp
ce9edcf5b5 Merge the cons.c and cons.h to the best of my ability. alpha may or
may not compile, I can't test it.
1999-08-09 10:35:05 +00:00
Poul-Henning Kamp
4cb4c215e5 Allocate and register struct tty on the fly. 1999-08-08 20:25:14 +00:00
Poul-Henning Kamp
03016f421b Remove cmaj and bmaj args from DEV_DRIVER_MODULE. 1999-07-04 14:58:56 +00:00
Kazutaka YOKOTA
f94ae09657 Skip the device if it is disabled, when searching for a serial port
to be used for the kernel console in sccnprobe().
1999-06-29 17:34:16 +00:00
Kazutaka YOKOTA
6e8394b8ba The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
  some of complicated functions.

- Many static variables are moved to the softc structure.

- Added a new key function, PREV.  When this key is pressed, the vty
  immediately before the current vty will become foreground.  Analogue
  to PREV, which is usually assigned to the PrntScrn key.
  PR: kern/10113
  Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>

- Modified the kernel console input function sccngetc() so that it
  handles function keys properly.

- Reorganized the screen update routine.

- VT switching code is reorganized.  It now should be slightly more
  robust than before.

- Added the DEVICE_RESUME function so that syscons no longer hooks the
  APM resume event directly.

- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
  SC_NO_HISTORY and SC_NO_SYSMOUSE.
  Various parts of syscons can be omitted so that the kernel size is
  reduced.

  SC_PIXEL_MODE
  Made the VESA 800x600 mode an option, rather than a standard part of
  syscons.

  SC_DISABLE_DDBKEY
  Disables the `debug' key combination.

  SC_ALT_MOUSE_IMAGE
  Inverse the character cell at the mouse cursor position in the text
  console, rather than drawing an arrow on the screen.
  Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)

  SC_DFLT_FONT
  makeoptions "SC_DFLT_FONT=_font_name_"
  Include the named font as the default font of syscons.  16-line,
  14-line and 8-line font data will be compiled in.  This option replaces
  the existing STD8X16FONT option, which loads 16-line font data only.

- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.

- The video driver provides a set of ioctl commands to manipulate the
  frame buffer.

- New kernel configuration option: VGA_WIDTH90
  Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60.  These
  modes are mot always supported by the video card.
  PR: i386/7510
  Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.

- The header file machine/console.h is reorganized; its contents is now
  split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
  (another new file).  machine/console.h is still maintained for
  compatibility reasons.

- Kernel console selection/installation routines are fixed and
  slightly rebumped so that it should now be possible to switch between
  the interanl kernel console (sc or vt) and a remote kernel console
  (sio) again, as it was in 2.x, 3.0 and 3.1.

- Screen savers and splash screen decoders
  Because of the header file reorganization described above, screen
  savers and splash screen decoders are slightly modified.  After this
  update, /sys/modules/syscons/saver.h is no longer necessary and is
  removed.
1999-06-22 14:14:06 +00:00
Peter Wemm
20510b2017 Use the proper interfaces to find if a device is enabled, don't dig into
the bus mechanism's private internals!
1999-06-20 13:10:09 +00:00
Greg Lehey
89bf63adaa sioprobe: Don't try to initialize disabled ports. In particular,
attempting to initialize sio3 caused problems with ATI video boards,
which cleverly share the I/O space.

PR: kern/12295
1999-06-19 08:14:56 +00:00
Kirk McKusick
5e1a20fd26 COM_LLCONSOLE should over-ride COM_DEBUGGER request. 1999-06-15 22:15:10 +00:00
Poul-Henning Kamp
3faff79c9e The PPSAPI group defines the polarity in draft 3, we guessed it wrong. 1999-05-31 06:57:31 +00:00
Poul-Henning Kamp
4e2f199e0c This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".

        Initialize the d_maj and d_bmaj fields.

        The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format.  Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.
1999-05-30 16:53:49 +00:00
Doug Rabson
46e1f231cd Simplistic pnp support. Needs more ids to be added. 1999-05-30 11:14:39 +00:00
Doug Rabson
0476a4d4ff Allow a sio port with its flags set to DEBUGGER+LLCONSOLE to be used for
gdb. This allows the sio probe for that port to be disabled which stops
it from confusing the debugger.
1999-05-28 09:37:11 +00:00
Doug Rabson
6f50cfb43a Use the resource apis to manipulate resources. 1999-05-22 15:47:34 +00:00
Doug Rabson
1d3710bdf3 Adjust console stuff now that makedev is no longer a macro. 1999-05-10 14:01:35 +00:00
Peter Wemm
d1935ba94c Make COM_ESP and COM_MULTIPORT compile for LINT. It might even work.. 1999-05-09 20:35:02 +00:00
Peter Wemm
1d361692a7 Optimize out a couple of places where com_addr() is used twice in a row,
although this is pretty trivial.  devclass_get_softc() is a tad more
expensive than the old com_addr() implementation.  If Bruce is really
worried about the cost of this, it could always be changed so that the
softc pointer is stored in a local array again.
1999-05-09 16:56:38 +00:00
Peter Wemm
6f42b336a5 Move opt_sio.h options to conf/options and activate in isa/sio.c 1999-05-09 13:10:49 +00:00
Poul-Henning Kamp
52400704e9 Unconfuse DEV_MODULE() and DEV_DRIVER_MODULE() about the difference between
a major number for a dev_t.
1999-05-09 13:00:50 +00:00
Poul-Henning Kamp
3000820ae0 add some amount of sanity to the way the gdb stuff finds its device.
I'm not too happy about the result either, but at least it has less
chance of backfiring.

This particular feature could be called "a mess" without offending
anybody.
1999-05-09 10:51:13 +00:00
Poul-Henning Kamp
1a4dd80a43 siocngetc & putc can be staticized. 1999-05-09 10:28:50 +00:00
Doug Rabson
566643e39e Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.
1999-05-08 21:59:43 +00:00
Kirk McKusick
5c92a5b353 Get rid of extern declarations on gdb stuff so systems compiled without
DDB will compile. Warn users that try to use GDB without specifying a GDB
port in their configuration file.
1999-05-07 23:08:23 +00:00
Matt Jacob
49c36ff4f3 fix it so it compiles on alpha again 1999-05-07 17:52:01 +00:00
Poul-Henning Kamp
46eede0058 Continue where Julian left off in July 1998:
Virtualize bdevsw[] from cdevsw.  bdevsw() is now an (inline)
        function.

        Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention
        to the order of the cmaj/bmaj arguments!)

        Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE
        (ditto!)

(Next step will be to convert all bdev dev_t's to cdev dev_t's
before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
1999-05-07 10:11:40 +00:00
Kirk McKusick
e244fe31d6 Generalize to allow any serial port to be used as the GDB port.
Mark the GDB port in the config file with flags 0x80. Currently
only the sio driver checks these flags and sets up a GDB port,
but adding similar code to other serial drivers would be easy.
For backward compatibility, if an sio port is marked as the console
and no port is marked as the gdb port, the GDB port will be mapped
to the console port. This hack should go away at some point.
1999-05-07 06:50:41 +00:00
Peter Wemm
d5558c001a Fix up a few easy 'assignment used as truth value' and 'suggest parens
around && within ||' type warnings.  I'm pretty sure I have not masked
any problems here, I've committed real problem fixes seperately.
1999-05-06 18:44:42 +00:00
Poul-Henning Kamp
f711d546d2 Suser() simplification:
1:
  s/suser/suser_xxx/

2:
  Add new function: suser(struct proc *), prototyped in <sys/proc.h>.

3:
  s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/

The remaining suser_xxx() calls will be scrutinized and dealt with
later.

There may be some unneeded #include <sys/cred.h>, but they are left
as an exercise for Bruce.

More changes to the suser() API will come along with the "jail" code.
1999-04-27 11:18:52 +00:00
Dmitrij Tejblum
b079102dc5 Modify the non-i386 version of disable_intr() and enable_intr() so that they
don't produce a warning on every use.
1999-04-24 10:41:21 +00:00