Commit Graph

2993 Commits

Author SHA1 Message Date
Greg Lehey
2a11f45e35 Add declaration for vinum_setstate_by_force. 1999-08-24 02:21:46 +00:00
Greg Lehey
0c5c538d29 give_sd_to_drive: If we don't have space, deallocate the subdisk.
Previously we could end up with a valid subdisk
                  entry pointing to offset -1 on the drive.
1999-08-24 02:20:30 +00:00
Greg Lehey
8d9ef32fdd vinumclose: close raw plexes and subdisks. 1999-08-24 02:18:55 +00:00
Greg Lehey
fe89164039 Add support for logging subdisk I/O.
Change parameters of unlockrange to allow calling from revive_block,
which doesn't use request groups.
1999-08-24 02:17:42 +00:00
Bruce Evans
d009ccfaf5 Cast pointers to uintptr_t instead of casting them to u_long, and/or vice
versa.  Cosmetic.
1999-08-24 00:56:50 +00:00
Nick Hibma
0b77022752 Reset the UHCI controller when the device comes back from suspend.
This should be replaced by proper support for suspend one day (global
suspend).

Submitted-by:   Christopher Masto <chris@netmonger.net>
1999-08-23 21:00:08 +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
Bruce Evans
d918320517 Use devtoname() to print dev_t's instead of casting them to long or u_long
for misprinting in %lx format.
1999-08-23 20:35:21 +00:00
KATO Takenori
614926e47a - Make binary size smaller.
- Fix typo in TDK/LANX stuff.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1999-08-23 13:54:35 +00:00
Peter Wemm
0c3c5956d1 Disable some apparently stray debug printfs:
ahc0: <Adaptec 274X SCSI host adapter> at 0x1c00-0x1cff, irq 11 (edge)
ahc0: on eisa0 slot 1
ahc0: aic7770 >= Rev E, SBLKCTL = 0x8
SSTAT0 = 0x0
SFUNCT = 0x0
Twin Channel, A SCSI Id=7, B SCSI Id=7, primary A, 4/255 SCBs

Not objected to by:	gibbs
1999-08-23 12:08:45 +00:00
Poul-Henning Kamp
b3ddbd9504 Fix the breakage caused by hanging softc off dev_t. This is only
a workaround.
1999-08-23 09:35:12 +00:00
Kazutaka YOKOTA
800da3b22a - Remove cdevsw entry points in individual keyboard drivers;
instead, use generic entry points for all drivers.
- Eliminate bogus makedev().
- Eliminate softc in the lower drivers, as it is no longer necessary.

Submitted (95%) by: phk
1999-08-22 09:52:33 +00:00
Kazutaka YOKOTA
7d27f93ac4 Improve the detection code for GlidePoint. This is still a kludge,
but better than before...

PR: kern/13215
1999-08-22 06:11:52 +00:00
Bill Paul
a30ecd6149 Crap, I knew I was going to forget something: add missing miibus method
description file which slipped through the cracks.

Pointed out by: Doug <Doug@gorean.org>
1999-08-22 00:56:39 +00:00
Mike Smith
3ed7a59b07 Clean up after removing sys/eventhandler.h from sys/systm.h at the last
minute.  This should cover all of the missed cases (and should let LINT
build again).
1999-08-21 22:10:49 +00:00
Bill Fumerola
775ef6178d Add missing include.
Submitted by:	Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org>
Reviewed by:	Alex Perel <veers@disturbed.net>
1999-08-21 21:35:59 +00:00
Bill Paul
d00275330d This commit adds support for the NetBSD MII abstraction layer and
MII-compliant PHY drivers. Many 10/100 ethernet NICs available today
either use an MII transceiver or have built-in transceivers that can
be programmed using an MII interface. It makes sense then to separate
this support out into common code instead of duplicating it in all
of the NIC drivers. The mii code also handles all of the media
detection, selection and reporting via the ifmedia interface.

This is basically the same code from NetBSD's /sys/dev/mii, except
it's been adapted to FreeBSD's bus architecture. The advantage to this
is that it automatically allows everything to be turned into a
loadable module. There are some common functions for use in drivers
once an miibus has been attached (mii_mediachg(), mii_pollstat(),
mii_tick()) as well as individual PHY drivers. There is also a
generic driver for all PHYs that aren't handled by a specific driver.
It's possible to do this because all 10/100 PHYs implement the same
general register set in addition to their vendor-specific register
sets, so for the most part you can use one driver for pretty much
any PHY. There are a couple of oddball exceptions though, hence
the need to have specific drivers.

There are two layers: the generic "miibus" layer and the PHY driver
layer. The drivers are child devices of "miibus" and the "miibus" is
a child of a given NIC driver. The "miibus" code and the PHY drivers
can actually be compiled and kldoaded as completely separate modules
or compiled together into one module. For the moment I'm using the
latter approach since the code is relatively small.

Currently there are only three PHY drivers here: the generic driver,
the built-in 3Com XL driver and the NS DP83840 driver. I'll be adding
others later as I convert various NIC drivers to use this code.

I realize that I'm cvs adding this stuff instead of importing it
onto a separate vendor branch, but in my opinion the import approach
doesn't really offer any significant advantage: I'm going to be
maintaining this stuff and writing my own PHY drivers one way or
the other.
1999-08-21 17:40:53 +00:00
Mike Smith
fcb893a801 Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc
implementations currently in use.

Retire the at_shutdown family of functions and replace them with
new event handler lists.

Rework kern_shutdown.c to take greater advantage of the use of event
handlers.

Reviewed by:	green
1999-08-21 06:24:40 +00:00
Julian Elischer
1744fcd082 First small steps at merging DEVFS and PHK's Dev_t stuff. 1999-08-20 20:25:00 +00:00
Matthew N. Dodd
ef2d104210 Fix stupid error (xse -> xsc).
Notice that 'unit' wasn't defined once I changed the parameters of the func.

These things make me feel like wading in with a flamethrowr or something.

Too much cruft!
</rant>
1999-08-20 14:36:40 +00:00
Matthew N. Dodd
e4fd6edfd8 Set ifp->if_init to the right function.
if_init_f_t is passed void * containing the address of ifp->if_softc
not the unit number.

Someone tell me if these things don't work as I don't have the hardware
needed to test them. (thats a first.)

I'll get if_ze and if_zp later.

Pointed out by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
1999-08-20 14:12:14 +00:00
Peter Wemm
e9fc0b372f Replace the tulip_delay_300ns() with a DELAY(1). Hammering the PCI bus
to achieve a delay is pretty mean.

Andrew reports:
"The tulip_delay_300ns() is, well, bloody stupid on machines with a
heavily loaded PCI bus.  It tries to do a delay by assuming PCI reads
will take a certain amount of time & issues a large amount of
(expensive, 5% CPU when your PCI bus is heavily loaded) pci reads.

Locally, we've replaced the calls to tulip_delay_300ns(sc) in the EMIT
macros with a simple DELAY(1) and not seen any problems.  Plus we've
gained about 50Mb/sec throughput on our gigabit network cards because
of the added PCI bus bandwidth available."

Also, I do not understand why, but this change appears to stop the
Transmit Fifo underrun on one of my systems (but not the Alpha PC164SX).
This shouldn't make that much of a difference since the mii bus isn't
touched all that often, but perhaps when it does get accessed and hence
hammers the register, it was causing the chip to get upset.

Submitted by:	Andrew Gallatin <gallatin@cs.duke.edu>
1999-08-19 15:07:20 +00:00
Matthew N. Dodd
4b31e9d6a7 Make these actually compile. I got a little delete happy pruning includes
and used 'command' instead of 'cmd' in a few cases.  Also clear up some
unused variables.

Pointed out by: phk
1999-08-18 22:14:24 +00:00
Poul-Henning Kamp
f04626ff22 Add pin-numbers for easy reference. 1999-08-18 20:45:57 +00:00
Nick Sayer
7cc9cff983 printf("%x",dev); -> printf("%s",devtoname(dev)); 1999-08-18 17:42:41 +00:00
Nick Hibma
25519565df 1) rename dev->self to be consistent
2) use device_printf
3) properly tear down and disable interrupts when init fails
1999-08-18 10:24:59 +00:00
Matthew N. Dodd
b2864868b3 SIOCSIFADDR, SIOCGIFADDR, and SIOCSIFMTU are implemented in
sys/net/if_ethersubr.c:ether_ioctl().  Drivers need not implement generic
behavior.

PR: kern/12126
Submitted by: in part by Boris Popov <bp@butya.kz>
1999-08-18 06:12:00 +00:00
Bill Fumerola
aa498bf3d4 Wrap two declarations that are only used in an #ifdef in their own #ifdef.
Reviewed by:	bde
1999-08-17 22:06:17 +00:00
Bill Fumerola
b8e49f681b Welcome devtoname(), to most likely be used when printing information
about a dev_t.

printf("%x", dev) now becomes printf("%s", devtoname(dev)) because
printing actual information about the device is much more useful then
printing a pointer to an address that would never help the developer debug.

Submitted by:	phk, bde
1999-08-17 20:25:50 +00:00
Kazutaka YOKOTA
e6d37e188f Recognize Interlink VersaPad. `Tap' action will be recognized
as the button 4.

Submitted by: Masachika ISHIZUKA <ishizuka@ish.org>
1999-08-17 12:14:13 +00:00
Nick Hibma
6efd8273f4 - Added documentation
- fix bug in data toggle handling
1999-08-17 07:36:34 +00:00
Justin T. Gibbs
99cfa26a69 Differentiate between aic7895C chips and their earlier brethren
via the PCI revid register.
1999-08-16 22:50:37 +00:00
Justin T. Gibbs
7457cf2d46 Add support for issuing immediate notify event ccbs for bus resets, bdr
messages, abort messages, and abort tag messages.

Fix a bug in how default transfer negotiations are handled if the
user had disabled initial bus resets.

Support multi-targetid on the aic7895C.
1999-08-16 22:49:29 +00:00
Justin T. Gibbs
42aed36923 Kill an unused INTSTAT type. 1999-08-16 22:43:08 +00:00
Justin T. Gibbs
95a5efc2c3 Fix a few compiler nits.
Submitted by:	Bill Fumerola <billf@jade.chc-chimes.com>
1999-08-16 22:42:33 +00:00
Matt Jacob
0470d791d0 Clarify and cleanup some CAM queueing breakages. 1999-08-16 20:11:45 +00:00
Matt Jacob
1a43c1fc14 add in SIMQFRZ_TIMED && CMD_RQLATER defines 1999-08-16 20:04:06 +00:00
Matt Jacob
4b9f078cf2 add in new ICB structure variant (for 2200) 1999-08-16 20:02:09 +00:00
Matt Jacob
0f747d722c Clarify lun limits for FC && SCSI. 1999-08-16 20:01:14 +00:00
Matt Jacob
ce7f792d94 More code cleanup. Go back to using FULL_LOGIN Fibre Chan if f/w is less than
1.17.0 level. Change where we do the loop database init. Add in the CMD_RQLATER
return. Add some register debounce.
1999-08-16 19:59:55 +00:00
Matt Jacob
0a5f7e8bd9 Set some correct return values. Prefer I/O map all the time unless configured
otherwise.
1999-08-16 19:52:29 +00:00
Greg Lehey
b70434e69d free_drive: mark drive down. This may fix a panic in the 'start' command.
Reported-by:	peter
1999-08-16 05:09:39 +00:00
Greg Lehey
0888504040 Clean up some comments.
format_config: code preening.

vinum_scandisk: If we find a partition in the first pass over a drive,
note the fact so we don't grab the compatibility partition as well.

Submitted-by:  peter
1999-08-16 05:08:46 +00:00
Justin T. Gibbs
7debf5e75e Fix a long standing bug in the auto-termination control settings for
the aic7890/91/96/97 cards.  This could cause the system to go into
a long retry/recovery loop during probe.

Fix the alignment argument to bus_dma_tag_create().

Don't set the CACHETHEN bit in dscommand0 for Ultra2 controllers
until we know more about its behavior.  The description for this
bit makes it sound like it could cause problems with certain
PCI chipsets.
1999-08-16 02:33:46 +00:00
Justin T. Gibbs
086646f7c6 Properly set the alignment argument to bus_dma_tag_create(). If we
don't care about the alignment, set it to 1, meaning single byte alignment.
1999-08-16 01:52:21 +00:00
Kazutaka YOKOTA
6c6028fffb Correctly save `flags' bits. 1999-08-15 06:06:14 +00:00
Greg Lehey
3438940a01 Add note that a change needs backing out. 1999-08-15 02:31:19 +00:00
Greg Lehey
3764607a6e Ensure that we can't create two different drives on the same
partition.

Reported-by:	Remy Nonnenmacher <remy@synx.com>
1999-08-15 02:30:34 +00:00
Greg Lehey
60402eb12d Add 'initialized' state for subdisks. After initializing, the subdisk
goes into initialized state, not 'up'.  This makes it easier to ensure
consistency in multi-plex volumes.

update_plex_state: redo transitions from empty and initialized
subdisks to up or reviving, depending on the number of plexes.

Reported-by:	Bernd Walter <ticso@cicely.de>
		Remy Nonnenmacher <remy@synx.com>
1999-08-15 02:29:14 +00:00
Bill Paul
2b028af745 Minor glitch in ti_newbuf_jumbo(): m_adj() was being called on
m instead of m_new.

Submitted by: Kenneth D. Merry <ken@kdm.org>
1999-08-14 15:45:03 +00:00
Poul-Henning Kamp
49ff4debd3 Spring cleaning around strategy and disklabels/slices:
Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout.
please see comment in sys/conf.h about the flag argument.

Remove strategy argument from all the diskslice/label/bad144
implementations, it should be found from the dev_t.

Remove bogus and unused strategy1 routines.

Remove open/close arguments from dssize().  Pick them up from dev_t.

Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
1999-08-14 11:40:51 +00:00
Greg Lehey
af78609425 Tidy up comments.
Add definitions for VINUM_BLOCK_PLEX and VINUM_CHAR_PLEX.

struct plex: add lock-related variables.

struct rangelock: add variables.
1999-08-14 06:31:37 +00:00
Greg Lehey
c515a27bbd Clean up comments.
Don't return "can't do it" when the user requests a state change to
the current state.  This previously caused silly messages like "Can't
start <foo>: invalid argument", when in fact <foo> was already
started.

set_plex_state: don't set state for non-existent plexes.

update_plex_status: as long as we have initializing subdisks, we're
		    initializing.
1999-08-14 06:30:56 +00:00
Greg Lehey
b8962e0ff8 Clean up some comments.
Move the declaration of freerq() to request.h.

logrq: add support for lock events.

vinumstart: solve a problem where removing a plex from an active
	    volume could cause attempts to access non-existent plexes.

launch_requests: don't set a request group active until we're sure we
		 can launch it.  This caused some hangs under unusual
		 circumstances.

bre: don't set XFR_BAD_SUBDISK if we're not going to use it.

build_read_request: correct recovery, which caused some hangs under
		    (other) unusual circumstances.

build_rq_buffer: don't set bp->b_dev if we don't have a dev.

sdio: clean up, remove obsolete code.

deallocrqg: unlock any locks the rqg may have.
1999-08-14 06:30:15 +00:00
Greg Lehey
a87d57a3e8 Tidy up some comments.
bre5:
  Shorten some lines.

  Desired-by:  bde

  If we're reading from a short plex, return EOF indication.

  Always lock the stripe before starting a transfer.  Hopefully the
  current version will solve some data integrity problems that have
  been reported with degraded RAID-5 plexes.

  Reported-by:	Bernd Walter <ticso@cicely.de>
		Remy Nonnenmacher <remy@synx.com>
1999-08-14 06:29:25 +00:00
Greg Lehey
e5738c9f66 Add keypairs replace and readpol. These got forgotten in a previous
commit, but since they don't work yet, nobody noticed.
1999-08-14 06:28:48 +00:00
Greg Lehey
998115ba43 rewrite lockrange and unlockrange. Hopefully the current version will
solve some data integrity problems that have been reported with
degraded RAID-5 plexes.

Reported-by:	Bernd Walter <ticso@cicely.de>
		Remy Nonnenmacher <remy@synx.com>
1999-08-14 06:28:21 +00:00
Greg Lehey
56a39b0546 Add hotspare keyword. 1999-08-14 06:27:52 +00:00
Greg Lehey
55eecd1064 vinumioctl: add ioctls for raw subdisks and plexes. Remove code for
drives (we refuse to touch drives, that's the disk driver's business).
1999-08-14 06:27:25 +00:00
Greg Lehey
4fd49b9f73 Remove some XXX comments (they're not really gone, just invisible).
Tidy other comments.

open_drive: don't call set_drive_state if we decide to take it down.
This could help avoid some race conditions with the daemon.

init_drive: don't set the drive down, we'll let close_locked_drive do
that.

close_locked_drive: set drive state to down without calling
set_drive_state.  This could help avoid some race conditions with the
daemon.

driveio: remove the function, it wasn't being used.

get_volume_label: remove volume dependencies so that we can return a
label for plexes and subdisks as well.  What a kludge.
1999-08-14 06:26:32 +00:00
Greg Lehey
6dd671ea60 Remove some XXX comments (they're not really gone, just invisible).
Remove declarations for freerq and free_rqg.

Remove DEBUG_RESID code.

freerq: check whether the request is holding a lock, free if so.

free_rqg: remove.  It wasn't being used any more.

Change the Debugger calls to panics.
1999-08-14 06:25:52 +00:00
Greg Lehey
5425c19ce4 Change definitions for get_volume_label, lockrange.
Move definition for unlockrange to request.h (it now contains
request-related parameters).

Add sddownstate.
1999-08-14 06:25:14 +00:00
Greg Lehey
b7904c2bf9 Add code which someday will help support hot spares.
checkdiskconfig(): remove.  It didn't make any sense to complain about
kernel keywords in user config files; it just made it more difficult
to convert.  Now we ignore kernel keywords if we're not in kernel
mode.

get_empty_sd: initialize sectors.

free_drive: don't close if we don't have a vp.  Maybe this will help
fix the problem that peter had, but I wouldn't count on it.

config_plex: If the plex is RAID-5, give it a rangelock structure.

start_config: Reset current drive, plex and volume so that a new
'create' command doesn't get long-dead defaults.
1999-08-14 06:24:34 +00:00
Greg Lehey
466c1060d9 vinumopen: add code for opening raw plexes. Volume-related plex
devices will probably die a death soon (yes, DES, that's correct
usage).
1999-08-14 06:22:15 +00:00
Greg Lehey
98256dfef8 Clarify some comments.
struct rqelement, enum rqinfo_type, struct rqinfo, union rqinfou: add
lock requests.

Add declarations for freerq and unlockrange.  Since they include
request structures, they can't go in vinumext.h
1999-08-14 06:21:45 +00:00
Dmitrij Tejblum
e9e879c34d Fix a warning on the alpha. 1999-08-13 16:17:54 +00:00
Poul-Henning Kamp
7dc5cd047f The bdevsw() and cdevsw() are now identical, so kill the former. 1999-08-13 10:29:38 +00:00
Nick Hibma
e0f5b7a3be Protect the file interface against disconnects. 1999-08-12 18:55:41 +00:00
Søren Schmidt
f63c7e582a Support DMA on ATAPI devices (finally).
This makes my system use only ~5% CPU on reading 4.5Mbyte/sec
from a CDROM, which before was limitted to 1.8Mbyte/sec due
to 100% CPU load..
1999-08-10 21:59:58 +00:00
Bill Paul
ee67e42e43 Small tweak: remember to free the tx ring data (which is malloc()ed) if
we have to bail out of vr_attach().
1999-08-10 21:12:11 +00:00
Bill Paul
08339b4fa4 Convert the VIA Rhine driver to newbus and set it up to be compiled as
a module. Also modified the code to work on FreeBSD/alpha and added
device vr0 to the alpha GENERIC config.

While I was in the neighborhood, I noticed that I was still using
#define NFPX 1 in all of the Makefiles that I'd copied from the fxp
module. I don't really use #define Nfoo X so it didn't matter, but
I decided to customize this correctly anyway.
1999-08-10 17:15:20 +00:00
Matthew N. Dodd
2825e76714 Add support for the Am79C978. (AMD PCHome/PCI Ethernet adapter)
See: http://www.amd.com/products/npd/overview/homenetworking/intro.html

PR: kern/12275
Submitted by: Robert Watson <robert@cyrus.watson.org>
1999-08-10 01:03:51 +00:00
Peter Wemm
a063132590 A little more tidying up. 1999-08-09 14:43:39 +00:00
Peter Wemm
b2368001b4 Expand a heap of macros that obscure readability and are no longer needed
here, and do a bit of general tidy up.
1999-08-09 14:15:46 +00:00
Peter Wemm
ac6b4b7c14 More pre-lite2 support zapped and some more tidy-up. 1999-08-09 13:24:55 +00:00
Peter Wemm
48cadfb15e Unifdef -D__FreeBSD__ - and remove pre-lite2 support. 1999-08-09 13:15:53 +00:00
Peter Wemm
d1292ac4bc Unifdef -U__NetBSD__ 1999-08-09 13:07:37 +00:00
Peter Wemm
28acbab4e0 Unifdef -U__bsdi__ 1999-08-09 13:01:58 +00:00
Peter Wemm
fff7a5bef5 s/Id/FreeBSD/ 1999-08-09 12:52:49 +00:00
Peter Wemm
b46f22127f Strip __FreeBSD_version >= 300000 conditionals. 1999-08-09 12:50:12 +00:00
Peter Wemm
3d3bfc5db5 Merge changes from NetBSD rev 1.82 -> 1.86 via vendor branch.
Among the changes:  1.84: support compex 4-port cards.
1999-08-09 12:29:29 +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
1a03ce6c63 Remove compile time limit on number of devices. 1999-08-08 22:25:46 +00:00
Poul-Henning Kamp
fca3f34ff8 Passing the unit number to an interrupt routing is kind of narrowminded,
add a way to get the entire struct ppb_device back.
1999-08-08 22:25:21 +00:00
Poul-Henning Kamp
fa81b03de6 Remove compiled in limit on number of devices. 1999-08-08 22:01:50 +00:00
Poul-Henning Kamp
57ad459b75 register tty devices so they will look right in pstat. 1999-08-08 21:35:17 +00:00
Poul-Henning Kamp
4cb4c215e5 Allocate and register struct tty on the fly. 1999-08-08 20:25:14 +00:00
Peter Wemm
61ec30585f s/TULUP/TULIP/ - from vendor branch. 1999-08-08 19:56:06 +00:00
Poul-Henning Kamp
0ef1c82630 Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,
a few lines into <sys/vnode.h>.

Add a few fields to struct specinfo, paving the way for the fun part.
1999-08-08 18:43:05 +00:00
Bruce Evans
890c628e79 Fixed all printf format errors reported by gcc -Wformat on i386's:
- %q -> %ll.

Fixed nearby errors not reported by gcc -Wformat on i386's:
- don't assume that the promotion of [u_]int64_t is [u_]quad_t.
- don't use signed formats for unsigned args.
1999-08-08 14:11:03 +00:00
Greg Lehey
1943d3438c Import RAID-5 code.
Add Cybernet copyright.

OK'd-by:     Chuck Jacobus <chuck@cybernet.com>
1999-08-07 08:22:49 +00:00
Greg Lehey
5b19bbcb6f Import RAID-5 code.
Add Cybernet copyright.

OK'd-by:     Chuck Jacobus <chuck@cybernet.com>

Define VINUM_BLOCK_SD and VINUM_CHAR_SD macros to create raw subdisk
device numbers.

Add VF_HOTSPARE flag.
1999-08-07 08:15:25 +00:00
Greg Lehey
bbc227eaa9 Update a comment. 1999-08-07 08:14:44 +00:00
Greg Lehey
1c49cd396f Import RAID-5 code.
Add Cybernet copyright.

OK'd-by:     Chuck Jacobus <chuck@cybernet.com>

update_plex_state:
  If any subdisk in the plex is initializing, set the plex to
  initializing state.  This gets rid of the ugly corrupt/degraded/up
  transitions which previously occurred.

  Desired-by: Steve Taylor <staylor@cybernet.com>

sddownstate:
  Add new function, used by checksdstate.

checksdstate:
  Let sddownstate decide what status to return.
1999-08-07 08:14:01 +00:00
Greg Lehey
780f9fa3e3 Import RAID-5 code.
Add Cybernet copyright.

OK'd-by:     Chuck Jacobus <chuck@cybernet.com>

logrq: save device major and minor numbers to compensate for lost
  dev_t.

launch_requests: Don't issue requests which are marked
  XFR_BAD_SUBDISK.  This may make things easier in bre().

bre:
  Rearrange.
  - Change some comments
  - Recognize holes in plex structure.  Formerly this could lead to
    incorrect write to the plex.  Return REQUEST_DEGRADED on a read
    request, but carry on to the bitter end on a write request, and
    mark the requests for the inaccessible subdisks with
    XFR_BAD_SUBDISK.
  - return REQUEST_EOF if the requested transfer goes beyond the end
    of the plex.  This is not an error, since other plexes may go
    further into the volume address space.

build_read_request:
  Handle REQUEST_DEGRADED returned from bre().

sdio:
  Lock buffer before issuing the requests.
1999-08-07 08:13:23 +00:00
Greg Lehey
b853969e09 Import RAID-5 code.
Add Cybernet copyright.

OK'd-by:     Chuck Jacobus <chuck@cybernet.com>
1999-08-07 08:11:22 +00:00
Greg Lehey
f9c8e4cda3 Import RAID-5 code.
Add Cybernet copyright.

OK'd-by:     Chuck Jacobus <chuck@cybernet.com>

detchobject:  Don't update the object configuration.

replaceobject: Add preliminary code.  This is not yet complete.

vinumw.h vinumparser.c:

Add keyword 'hotspare'.
1999-08-07 08:09:36 +00:00
Greg Lehey
dbac8959f7 Add definition of new ioctl (READPOL) for setting the read policy of a
plex.  The code is not yet complete.
1999-08-07 08:08:18 +00:00
Greg Lehey
78436bf362 Remove code to accept partitions of type 'unused'. From now on, Vinum
will only accept partitions of type 'vinum'.

format_config: Use the new %q format option in kvprintf, thus getting
  rid of some of the filthiest code I've written in a long time.  Also
  remove the lltoa() function.

With-great-thanks-to:	peter

format_config: Accept the fact that a subdisk might not be attached to
  a plex, and save the config correctly.

vinum_scandisk: Scan all slices on a drive with a Microsoft partition
  table.  Only look at the compatibility slice if nothing was found in
  the Microsoft slices.

  This change removes a frequently employed method of shooting
  yourself in the foot: people would decide that the Vinum drives
  belonged on their own slice, and they wouldn't be able to start the
  subsystem after a reboot.  Documentation updates to follow.
1999-08-07 08:07:05 +00:00
Greg Lehey
ffb0a6283d Close a memory leak. 1999-08-07 08:06:05 +00:00
Greg Lehey
b583bb9698 vinumopen: add code to open raw subdisks. This is now used to
initialize subdisks.  Probably the plex-related subdisk type will die
a death.

vinumconfig.c:

Accept (and ignore) kernel state information in userland config
files.  This saves a lot of error recovery and also makes it possible
to use the output of printconfig to create new configuration.

Remove checkdiskconfig().  It wasn't needed any more.

Start adding support for hot spare drives.  You can't put anything on
them (yet).

Change message formats from %lld to %qd.

get_empty_sd: Initialize size to -1.  Previously this was done in
config_subdisk, which is the wrong place.

start_config: set current drive, plex and volume to -1, thus stopping
  update configurations from taking their defaults from old configs.
1999-08-07 08:05:46 +00:00
Greg Lehey
9640a3a8f8 Rework many comments.
requeststatus:
  add REQUEST_DEGRADED status

struct rqinfo:
  add members devmajor and devminor to compensate for lost dev_t.
1999-08-07 08:05:19 +00:00
Søren Schmidt
2203dc0030 Add limitted support for the Promise Ultra/66 controller. Its
only supported upto UDMA33 like the old Promise, but it works
now. More when I have specs ....
1999-08-06 17:39:38 +00:00
Brian Feldman
e32c66c539 Fix fd race conditions (during shared fd table usage.) Badfileops is
now used in f_ops in place of NULL, and modifications to the files
are more carefully ordered. f_ops should also be set to &badfileops
upon "close" of a file.

This does not fix other problems mentioned in this PR than the first
one.

PR:		11629
Reviewed by:	peter
1999-08-04 18:53:50 +00:00
Matthew N. Dodd
dfc196bf2a I'm not sure how this wasn't in the last commit but anyhow...
'int irq' -> 'struct irq_node *irq'
1999-08-02 20:01:40 +00:00
Matthew N. Dodd
0d6ab4a16a Move the specification of EDGE/LEVEL triggered interrupts to
eisa_add_intr() which now takes an additional arguement (one of
EISA_TRIGGER_LEVEL or EISA_TRIGGER_EDGE).

The flag RR_SHAREABLE has no effect when passed to
bus_alloc_resource(dev, SYS_RES_IRQ, ...) in an EISA device context as
the eisa_alloc_resource() call (bus_alloc_resource method) now deals
with this flag directly, depending on the device ivars.

This change does nothing more than move all the 'shared = inb(foo + iobsse)'
nonesense to the device probe methods rather than the device attach.

Also, print out 'edge' or 'level' in the IRQ announcement message.

Reviewed by: dfr
1999-08-01 22:57:09 +00:00
Mark Newton
8e70e7d663 Cleanup - diked out a heap of old KLM stuff that isn't needed anymore. 1999-08-01 12:51:06 +00:00
Matthew N. Dodd
96a0f2956f Don't use at_shutdown() now that we have new_bus which lets us
specify a DEVICE_SHUTDOWN method instead.

Reviewed by: me, since nobody else seems to run this hardware in -CURRENT
1999-07-31 00:43:48 +00:00
Matthew N. Dodd
24116fdd0a Restore the pre-new_bus behavior of printing out the reserved resources
during device announcement. (irq, ioport, maddr)

Reviewed by: dfr, peter
1999-07-30 13:54:00 +00:00
Mark Newton
04f84b3402 Eliminate 'WARNING: "streams" is usurping "streams"'s cdevsw[]' messages
at boot
1999-07-30 12:39:49 +00:00
Joerg Wunsch
25d01e9527 Revert rev 1.149. Bruce convinced me that the problem already disappeared
by the fix in rev 1.120, which i wasn't immediately aware of.
1999-07-29 11:27:33 +00:00
Matthew N. Dodd
15317dd875 Alter the behavior of sys/kern/subr_bus.c:device_print_child()
- device_print_child() either lets the BUS_PRINT_CHILD
	  method produce the entire device announcement message or
	  it prints "foo0: not found\n"

Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on
the previous behavior of device_print_child() (printing the
"foo0: <FooDevice 1.1>" bit of the announce message.)

Provide bus_print_child_header() and bus_print_child_footer()
to actually print the output for bus_generic_print_child().
These functions should be used whenever possible (unless you can
just use bus_generic_print_child())

The BUS_PRINT_CHILD method now returns int instead of void.

Modify everything else that defines or uses a BUS_PRINT_CHILD
method to comply with the above changes.

	- Devices are 'on' a bus, not 'at' it.
	- If a custom BUS_PRINT_CHILD method does the same thing
	  as bus_generic_print_child(), use bus_generic_print_child()
	- Use device_get_nameunit() instead of both
	  device_get_name() and device_get_unit()
	- All BUS_PRINT_CHILD methods return the number of
	  characters output.

Reviewed by: dfr, peter
1999-07-29 01:03:04 +00:00
Doug Rabson
aa595accc9 Add support for SYS_RES_DENSE and SYS_RES_BWX resource types. These are
equivalent to SYS_RES_MEMORY for x86 but for alpha, the rman_get_virtual()
address of the resource is initialised to point into either dense-mapped
or bwx-mapped space respectively, allowing direct memory pointers to be
used to device memory.

Reviewed by: Andrew Gallatin <gallatin@cs.duke.edu>
1999-07-28 07:57:48 +00:00
Nick Hibma
2cc20f83b3 Every reqh in an aborted pipe is given status CANCELED and the callback is
called. It might be necessary to split that routine into two parts in
which calling the callback is not done at splusb().
1999-07-27 20:22:29 +00:00
Bill Paul
070f62142c Roar! Finish what I started last night: somehow only the header file change
got committed.
1999-07-27 13:54:15 +00:00
Matthew N. Dodd
0158b2dcc3 Case matters.
DEv_METHOD to DEV_METHOD.
1999-07-27 05:08:36 +00:00
Matthew N. Dodd
5a8cee9a60 Implement the BUS_PROBE_NOMATCH method for the PCI bus.
This function is called for each device for which no driver
was found.

Output is similar to the eisa_probe_nomatch() function but with the
added benefit of displaying the assigned IRQ (since PCI gives us
this information up front.)

Output is like so:

pci0: unknown card CPQ0508 (vendor=0x0e11, dev=0x0508) at 11.0 irq 9
pci0: unknown card DFZ0508 (vendor=0x10da, dev=0x0508) at 11.0 irq 9
pci0: unknown card DBL0508 (vendor=0x104c, dev=0x0508) at 11.0 irq 9
pci0: unknown card DDM0011 (vendor=0x108d, dev=0x0011) at 11.0 irq 9

I'm not happy with the 3 lines of macro cruft that got added but
I consider it a temporary annoyance as those bits will be moved to
some place where PCI, EISA and ISAPNP code will be able to use them.

(Not surprisingly, this message is longer than the code in question.)

Reviewed by: peter, dfr
1999-07-27 04:28:14 +00:00
Bill Paul
af1c062105 On FreeBSD/i386, when you use the SYS_RES_MEMORY resource to allocate
a PCI memory mapped region, rman_get_bushandle() returns what happens
to be a kernel virtual address pointing to the base of the PCI shared
memory window. However this is not the behavior on all platforms:
the only thing you should do with the bushandle is pass it to the
bus_spare_read()/bus_space_write() routines. If you actually do want
the kernel virtual address of the base of the PCI memory window, you
need to use rman_get_virtual().

The problem is that at the moment, rman_get_virtual() returns a physical
address, which is bad. In order to get the kernel virtual address we
need, we have to play with it a little.

Presumeably this behavior will be changed, but in the meantime the
Tigon driver won't work. So for the moment, I'm adding a kludge to
make things happy on the alpha: the correct kernel virtual address
is calculated from the value returned by rman_get_virtual(). This
should be removed once rman_get_virtual() starts doing the right
thing.

This should make the Tigon actuall work on the alpha now.
1999-07-27 03:54:48 +00:00
Nick Hibma
6d38342e16 Add comments, change variable names to make them consistent (r -> err,
timo_handle -> timeout_handle, p -> pipe, *pipe -> *rpipe, etc.)
1999-07-25 18:54:22 +00:00
Peter Wemm
eda5a3370a Make this compile on the Alpha. I'm not 100% sure about this but I
think it's ok.  ti_bhandle is fetched from newbus on both the Alpha
and x86, the Alpha-only ti_vhandle is gone.
1999-07-25 06:46:19 +00:00
Bill Paul
c9ce464cb7 Remember to clear the IFF_RUNNING and IFF_OACTIVE flags in sf_stop() and
sk_stop().
1999-07-25 05:16:05 +00:00
Bill Paul
691c152864 This commit adds device driver support for Adaptec Duralink PCI fast
ethernet controllers based on the AIC-6915 "Starfire" controller chip.
There are single port, dual port and quad port cards, plus one 100baseFX
card. All are 64-bit PCI devices, except one single port model.

The Starfire would be a very nice chip were it not for the fact that
receive buffers have to be longword aligned. This requires buffer
copying in order to achieve proper payload alignment on the alpha.
Payload alignment is enforced on both the alpha and x86 platforms.
The Starfire has several different DMA descriptor formats and transfer
mechanisms. This driver uses frame descriptors for transmission which
can address up to 14 packet fragments, and a single fragment descriptor
for receive. It also uses the producer/consumer model and completion
queues for both transmit and receive. The transmit ring has 128
descriptors and the receive ring has 256.

This driver supports both FreeBSD/i386 and FreeBSD/alpha, and uses newbus
so that it can be compiled as a loadable kernel module. Support for BPF
and hardware multicast filtering is included.
1999-07-25 04:32:50 +00:00
Tatsumi Hosokawa
6afaf5d480 3C574TX 16bit FastEtherlink PC-card support.
Reviewed by:	HAMADA Naoki <nao@tom-yam.or.jp>
Submitted by:	Osamu MIHARA <mihara@prd.fc.nec.co.jp>
1999-07-25 01:20:37 +00:00
Bill Paul
571a80b261 Clean up the buffer allocation code a bit. Make sure to initialize certain
critical mbuf fields to sane values. Simplify the use of ETHER_ALIGN to
enforce payload alignment, and turn it on on the x86 as well as alpha
since it helps with NFS which wants the payload to be longword aligned
even though the hardware doesn't require it.

This fixes a problem with the ti driver causing an unaligned access trap
on the Alpha due to m_adj() sometimes not setting the alignment correctly
because of incomplete mbuf initialization.
1999-07-23 18:46:24 +00:00
Bill Paul
43a095a5fd Grrr. Return the rman_get_bustag()/rman_get_bushandle() lines to their
proper place in ti_attach(). I'm positive I typed them in there, but
they must have fallen victim to a drive-by cut & pasting.
1999-07-23 16:21:43 +00:00
Bill Paul
09590dc4c1 One last tweak before I turn in for the evening: the driver name in
the driver_t declaration should be "skc" not "sk". Technically, "skc"
is the parent PCI device (the SysKonnect GEnesis controller) and "sk0"
and "sk1" are the network interfaces that get attached to it.
1999-07-23 05:50:35 +00:00
Bill Paul
39d837d4b5 Dangit. Somehow the pmap_kextract hack for alpha snuck back into these
files. Change them back to alpha_XXX_dmamap().

Pointed out by: Andrew Gallatin
1999-07-23 02:18:01 +00:00
Bill Paul
89ca84e6db Convert the Alteon Tigon gigabit ethernet driver to newbus. Also upgrade
to the latest firmware release from Alteon (12.3.12).
1999-07-23 02:10:11 +00:00
Bill Paul
5c9e5de3e3 Some more small newbus cleanups. Remember to free all resources in case
of failures in foo_attach(), simplify iospace/memspace things a little.
1999-07-23 02:06:57 +00:00
Bill Paul
75156903c8 Fix a small mind-o: one instance of SYS_RES_IOPORT should have been
SYS_RES_MEMOTY in sk_detatch().
1999-07-22 14:58:54 +00:00
Greg Lehey
aa30608b44 Modify device numbering method to work with latest -CURRENT. Briefly,
the device numbers are now minor number only, so that we can still
compare them after dev_t has turned into a blob.

Broken-by:	dev_t changes
Reported-by:	Vallo Kallaste <vallo@matti.ee>
		"Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
1999-07-22 08:40:37 +00:00
Bill Paul
e11a2e3d81 Convert the SysKonnect gigabit ethernet driver to newbus. 1999-07-22 04:04:12 +00:00
Joerg Wunsch
409aadb1c9 Hack to work around a NULL pointer dereferencation that can be triggered
by removing a floppy that as being operated on.

The spagghetti is hardly understandable at all anymore, so i can't
100 % ascertain this is really the Right Thing to do, maybe our new
floppy driver maintainer, Jesus Monroy Jr can do this. :-))
1999-07-21 12:19:44 +00:00
Bill Paul
7694cd9368 Correct the alignment of some of the members in the wi_frame structure.
The structure is the right length, but some of the members (notably
wi_q_info) were off a bit. This causes the received signal strength
values to appear bogus.
1999-07-20 20:03:42 +00:00
Poul-Henning Kamp
698bfad7f2 Now a dev_t is a pointer to struct specinfo which is shared by all specdev
vnodes referencing this device.

Details:
        cdevsw->d_parms has been removed, the specinfo is available
        now (== dev_t) and the driver should modify it directly
        when applicable, and the only driver doing so, does so:
        vn.c.  I am not sure the logic in checking for "<" was right
        before, and it looks even less so now.

        An intial pool of 50 struct specinfo are depleted during
        early boot, after that malloc had better work.  It is
        likely that fewer than 50 would do.

        Hashing is done from udev_t to dev_t with a prime number
        remainder hash, experiments show no better hash available
        for decent cost (MD5 is only marginally better)  The prime
        number used should not be close to a power of two, we use
        83 for now.

        Add new checkalias2() to get around the loss of info from
        dev2udev() in bdevvp();

        The aliased vnodes are hung on a list straight of the dev_t,
        and speclisth[SPECSZ] is unused.  The sharing of struct
        specinfo means that the v_specnext moves into the vnode
        which grows by 4 bytes.

        Don't use a VBLK dev_t which doesn't make sense in MFS, now
        we hang a dummy cdevsw on B/Cmaj 253 so that things look sane.

	Storage overhead from all of this is O(50k).

        Bump __FreeBSD_version to 400009

The next step will add the stuff needed so device-drivers can start to
hang things from struct specinfo
1999-07-20 09:47:55 +00:00
Poul-Henning Kamp
82f1cd60df use vp->v_rdev;
OK'ed by:	grog
1999-07-20 07:29:54 +00:00
Poul-Henning Kamp
684adedee4 Use the vn_todev() function, rather than VOP_GETATTR 1999-07-18 14:31:01 +00:00
Kazutaka YOKOTA
f1235db8bd - Clear relevant variables when the keyboard is not available.
- Do not touch the `tty' struct when it's not yet available.
- Initialize correct bits in `fonts_loaded'.
1999-07-18 06:16:53 +00:00
Kazutaka YOKOTA
29e59d7deb - Move the `return' statement the correct place so that the keyboard
won't be initialized if `atkbd?' is disabled.
1999-07-18 06:16:25 +00:00
Poul-Henning Kamp
59c4226d5f Fix 2nd arg to udev2dev() call in ccd.c 1999-07-17 19:58:37 +00:00
Poul-Henning Kamp
835646d6ef slight change in the way we hi-jack the wd drivers cdevsw. 1999-07-17 17:55:53 +00:00
Bill Paul
ab03d8e65f Make a few other cleanups while I'm in the area. Typo in comment, unused
structure members, etc. No functional changes.
1999-07-14 21:53:11 +00:00
Bill Paul
b31b2566e0 Revert some changes I had made to try and cut down on the number of TX EOF
interrupts that were scheduled. Testing shows it didn't really do very much
and it makes the code a little more complicated (which is never a good thing).

Also fix the rambuffer offset initialization for the 512K/64K SRAM case
(512K total using 64K chips). It should be 0. The only case with a
non-standard rambuffer offset address is 1024K/64K according to the
SysKonnect manual. (My card has the 1024/64 configuration and I don't know
which card uses the 512/64 configuration, if any, so I'm not sure that
this was really a problem for anyone.)
1999-07-14 18:57:32 +00:00
Roger Hardiman
4efbc31757 Bug fixes
Change number of VBI lines from 16 to 12 for NTSC formats.
 Juha.Nurmela@quicknet.inet.fi found/fixed bug in VBI_SLEEP.

New features
 MSP3430G DBX initialisation from Matt Brown <matt@dqc.org>
 STB Bt878 card identification.
 Hauppauge Model Number identification.
 Changes to probeCard() for better eeprom identification.
 Experimental TDA9850 initialisation code, from Linux bttv.

Cross Platform Changes
 The driver has been reorgainsed based ideas from Brad Parker's port to Linux
 to seperate OS Dependant and Independant sections.
 I have backends for FreeBSD 2.2.x/3.x and 4.x newbus, BSDI, OpenBSD and NetBSD.

This commit has FreeBSD 2.2.8/2.2-stable/3.x and FreeBSD 4.x newbus backends.

Some code submitted by: Juha.Nurmela@quicknet.inet.fi
                        Matt Brown <matt@dqc.org>
                        Brad Parker <brad@parker.boston.ma.us>

Some code obtained from:        Linux bttv driver
1999-07-12 15:51:50 +00:00
Kazutaka YOKOTA
01533d852e Improve Logitech MouseMan+ protocol support. 1999-07-12 15:16:14 +00:00
Kazutaka YOKOTA
551e01b126 Implement a kludge for some wheeled mice for which infamous "psmintr:
out of sync..." messages is generated and the wheel movement is not
recognized.

The trick is found by Takashi Nishida.
1999-07-12 13:40:21 +00:00
Doug Rabson
ca7036d8cb Add a hook for a bus to detect child devices which didn't find drivers.
This allows the bus to print an informative message about unknown devices.

Submitted by: Matthew N. Dodd <winter@jurai.net>
1999-07-11 13:42:37 +00:00
Peter Wemm
4ae8675cf7 Convert the if_fea (DEC FDDI) driver to newbus since it has been broken
for ages.  This is the EISA wrapper for sys/dev/pdq/*.  The pci bus driver
is in sys/pci/if_fpa.c.

Submitted by:	"Matthew N. Dodd" <winter@jurai.net>
1999-07-10 19:46:08 +00:00
Bill Paul
05919c5b73 if_sk.c: use pci_port_t instead of u_short
if_skreg.h: use alpha_XXX_dmamap() instead of pmap_kextract hackery on
alpha platform
1999-07-09 17:36:23 +00:00
Bill Paul
3ebb090530 This commit adds driver support for the SysKonnect SK-984x series
gigabit ethernet adapters. This includes two single port cards
(single mode and multimode fiber) and two dual port cards (also single
mode and multimode fiber). SysKonnect is currently the only
vendor with a dual port gigabit ethernet NIC.

The ports on dual port adapters are treated as separate network
interfaces. Thus, if you have an SK-9844 dual port SX card, you
should have both sk0 and sk1 interfaces attached. Dual port cards
are implemented using two XMAC II chips connected to a single
SysKonnect GEnesis controller. Hence, dual port cards are really
one PCI device, as opposed to two separate PCI devices connected
through a PCI to PCI bridge. Note that SysKonnect's drivers use
the two ports for failover purposes rather that as two separate
interfaces, plus they don't support jumbo frames. This applies to
their Linux driver too. :)

Support is provided for hardware multicast filtering, BPF and
jumbo frames. The SysKonnect cards support TCP checksum offload
however this feature is not currently enabled (hopefully it will
be once we get checksum offload support).

There are still a few things that need to be implemeted, like
the ability to communicate with the on-board LM80 voltage/temperature
monitor, but I wanted to get the driver under CVS control and into
-current so people could bang on it.

A big thanks for SysKonnect for making all their programming info
for these cards (and for their FDDI and token ring cards) available
without NDA (see www.syskonnect.com).
1999-07-09 04:30:09 +00:00
Kazutaka YOKOTA
c4c9400b69 - Fixed memory leak in sc_alloc_history_buffer().
- Correctly observe the variable `extra_history_size' when changing
  the size of history (scroll back) buffer.
- Added sc_free_history_buffer().

Pointed out by: des
1999-07-07 13:48:50 +00:00
Dag-Erling Smørgrav
6b5ca0d83e Rename bpfilter to bpf. 1999-07-06 19:23:32 +00:00
Peter Wemm
0d50adcacf Don't clobber the smb cdevsw entry that was installed by the driver
framework.
1999-07-06 13:42:43 +00:00
Matt Jacob
ecc94a93d5 add in (controlled by option) 2200 Expanded Lun F/W 1999-07-06 05:38:24 +00:00
Matt Jacob
9ba8673786 add in a boot environment isp_disable flag 1999-07-06 01:24:20 +00:00
Matt Jacob
100f099ba4 Wow- too much breakage..wait until you compile it, buckwheat... 1999-07-05 22:04:08 +00:00
Matt Jacob
86cb5d6b95 Oops- got sense of ifdef wrong 1999-07-05 22:01:48 +00:00
Matt Jacob
3692397b0d add 2200 f/w; fix botched define 1999-07-05 20:42:08 +00:00
Matt Jacob
5542fe4b1a add ISP_DISABLE_2200_SUPPORT defines; Add reference to 2200 F/W 1999-07-05 20:24:46 +00:00
Bill Paul
7f971fc2ca Remove ti_refill_rx_rings() and associated stuff; replace dirty RX buffers
in ti_rxeof() instead. This doesn't really seem to provide much in the
way of a performance boost, and I'm pretty sure it can cause mbuf leakage
in some extreme cases.
1999-07-05 20:19:41 +00:00
Poul-Henning Kamp
03016f421b Remove cmaj and bmaj args from DEV_DRIVER_MODULE. 1999-07-04 14:58:56 +00:00
Bill Paul
f30fba37d7 Patch the WaveLAN/IEEE driver to detect and reject oversized received
frames (or just insane received packet lengths generated due to errors
reading from the NIC's internal buffers). Anything too large to fit
safely into an mbuf cluster buffer is discarded and an error logged.

I have not observed this problem with my own cards, but on user has
reported it and adding the sanity test seems reasonable in any case.

Problem noted and patch provided by: Per Andersson <per@cdg.chalmers.se>
1999-07-04 14:40:22 +00:00
Nick Hibma
2677b5a4db Add the semi-official Bulk protocol id 'P' 1999-07-03 22:19:41 +00:00
Peter Wemm
9929d2a045 Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire
files.  config will leave the whole file out if configured to do so.
1999-07-03 20:17:08 +00:00
Matt Jacob
a02592816a Well, don't try and probe 65535 luns- things just don't really work well
when this happens. Limit to 16 luns for the 2100/2200 for now.
1999-07-03 01:44:05 +00:00
Matt Jacob
222bb54266 Remove pre-CAM code. Add in getenv_int calls for variables isp_mem_map,
isp_io_map, isp_no_fwload, isp_fwload, isp_no_nvram, isp_fcduplex
which are all bitmaps of isp instances that should or shouldn't
map memory space, I/O space, not load f/w, load f/w, ignore nvram,
not ignore nvarm, set full duplex mode. Also have an isp_seed value
that we can use to generate a pseudo seed for a synthetic WWN.
Other minor cosmetic cleanup. Add in support for the Qlogic ISP
2200. Very important change where we actually check now to see
whether we were successful in mapping request and response queues
(and fibre channel scratch space).
1999-07-02 23:18:03 +00:00
Matt Jacob
02ab33795d Remove all pre-CAM code. Fix breakage for SCCLUN when it is in fact
ISP2100_SCCLUN. Make changes for how ISPASYNC_PDB_CHANGE_COMPLETE
is now ISPASYNC_PDB_CHANGED. Add in ISPASYNC_FABRIC_DEV case.
1999-07-02 23:12:58 +00:00
Matt Jacob
b460c5c9a9 Merge defunct isp_freebsd_cam.h into this file. Do some appropriate
changes like rolling minor revision levels and defines where we now
do default WWN seeding in the platform files.
1999-07-02 23:10:34 +00:00
Matt Jacob
83cdc1a2b0 Roll revision levels. Add support for the Qlogic 2200 (warn about
not having SCSI_ISP_SCCLUN config defined if we don't have f/w for
the 2200- it's resident firmware uses SCCLUN (65535 luns)). Change
the way the default LoopID is gathered (it's now a platform specific
define so that some attempt at a synthetic WWN can be made in case
NVRAM isn't readable).

Change initialization of options a bit- don't use ADISC. Set
FullDuplex mode if config options tells us to do so. Do not use
FULL_LOGIN after LIP- it's the right thing to do but it causes too
much loop disruption (Loop Resets). Sanity check some default
values. Redo construction of port and node WWNs based upon what we
have- if we have 2 in the top nibble, we can have distinct port
and node WWNs. Clean up some SCCLUN related code that we obviously
had never compiled (:-(). Audit commands coming int ispscsicmd and
don't throw commands at Fibre devices that do not have Class 3
service parameters TARGET ROLE defined.

Clean up f/w initialization a bit. Add Fabric support (or at least
the first blush of it). Whew - way too much to describe here.
Basically, after a LIP, hang out until we see a Loop Up or a Port
DataBase Change async event, then see if we're on a Fabric
(GET_PORT_NAME of FL_PORT_ID). If we are, try and scan the fabric
controller for fabric devices using the GetAllNext SNS subcommand.
As we find devices, announce them to the outer layer. Try and do
some guard code for broken (Brocade) SNS servers (that get stuck
in loops- gotta maybe do this a different way using the GP_ID3 cmd
instead).  Then do a scan of the lower (local loop) ids using a
GET_PORT_NAME to see if the f/w has logged into anything at that
loop id. If so, then do a GET_PORT_DATABASE command.  Do this scan
into a local database. At this point we can say the loop is 'Ready'.
After this, we merge our local loop port database with our stored
port database- in a as yet to be really fully exercised fashion we
try and follow the logic of something having moved around. The
first time we see something at a Loop ID, we fix it, for the purpose
of this system instance, at that Loop ID. If things shift around
so it ends up somewhere else, we still keep it at this Loop ID (our
'Target') but use the new (moved) Loop ID when we actually throw
commands at it. Check for insane cases of different Loop IDs both
claiming to have the same WWN- if that happens, invalidate both.
Notify the outer layer of devices that have arrived and devices
that have gone away. *Finally*, when this is done, search the
softc's database of Fabric devices and perform logout/login actions.
The Qlogic f/w maintains logout/login for all local loop devices.
We have to maintain logout/login for fabric devices- total PITA.
Expect to see this area undergo more change over time.
1999-07-02 23:06:38 +00:00
Matt Jacob
77d4e8361d Roll revision levels. Move DEFAULT_LOOPID definition to platform files.
Change some fcp parameter structures such that we can get the portid
(24 bit value), get both node and port WWN, know whether we're on a fabric
or not, note whether we've ever seen the loop up, and note the current
state of the loop.

Replace the isp_pdb_t structure in fcparams with a reduced cost structure
that maintains a static relationship to 'Target', but can have the actual
loop ID used change (in case, post LIP, we discover things have moved
around). This also retains portid and node/port WWNs.  This array gets
larger if we have fabric support compiled in.

Note special loop IDs that are invariate for this device- FL_PORT_ID
(0x7e) which tells us if there's a fabric controller present, FC_PORT_ID
and FC_SNS_ID (fabric controller port and fabric SNS server port). We don't
use the latter two for anything. IDs above FC_SNS_ID up through 255 are
available for mapping fabric devices to 'target' ids.

Add in a config define to set FC full duplex mode. Add in a define to
recognize the Qlogic 2200 boards. Add comments about ISPCTL commands.
Add and change some ISPASYNC enumes.
1999-07-02 22:46:31 +00:00
Matt Jacob
fc9961b5dd Add in SNS and Fabric login/logout commands. Clean up ICBOPT defines.
Remove INVALID_PDB_OPTIONS defines. Define generic SNS request and
response structures and the bare minimum GAN and GP3 subcommands.
1999-07-02 22:31:11 +00:00
Matt Jacob
8df9252043 This file is now obsolete. 1999-07-02 22:26:10 +00:00
Matt Jacob
956d0a937a roll firmware for FC 1999-07-02 17:07:39 +00:00
Greg Lehey
126152b05d Add keywords 'mirror' and 'stripe' when not in kernel mode. 1999-07-02 07:58:09 +00:00
Greg Lehey
e65333e92e Allow to unconditionally up subdisks with the -f option.
Change returns for failed state changes from EINVAL to EBUSY.

Suggested-by:  Bernd Walter <ticso@cicely.de>
1999-07-02 07:57:28 +00:00
Greg Lehey
7d6715c52c Change the type of the freelist sectors variable to u_int64_t in
order to ensure that initializers will be of correct type.
1999-07-02 07:56:47 +00:00
Peter Wemm
820f359d7e Change the cast in pci_map_port() from u_short * to pci_port_t * so it
compiles cleanly on the Alpha.  (On the alpha, the port type is an int,
not a short).
Cast a couple of pointers to ints via 'uintptr_t' rather than 'unsigned
int' since uintptr_t is long (64 bit) on Alpha, as are pointers.
1999-07-02 04:17:16 +00:00
Peter Wemm
f078b1e075 #include <machine/md_var.h> to bring the prototype for
alpha_platform_assign_pciintr() into scope (!).
1999-07-01 22:58:03 +00:00
Peter Wemm
4180e07c29 Tidy up a few warnings when used without splash. (things defined but not
used)
1999-07-01 20:43:03 +00:00
Peter Wemm
ea24629773 Fix warnings on the Alpha. 1999-07-01 20:29:25 +00:00
Peter Wemm
e240133cfa Fix printf int/long format problems on the Alpha. 1999-07-01 20:01:03 +00:00
Kazutaka YOKOTA
a6c5d058bc Allocate the port resource when attaching the keyboard controller,
rather than when the individual child device is attached.
1999-06-29 17:35:09 +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
8c76a16644 Fill in tp->t_windowsize AFTER the call to (*linesw[tp->t_line].l_open)(),
rather than BEFORE the call.  Otherwise the structure will be `zero'ed out
by l_open, which actually is ttyopen(), if !TS_OPEN.

PR: kern/12420
1999-06-29 17:30:33 +00:00
Greg Lehey
3252fdcd97 Lock buffer before calling strategy.
Idea-stolen-from:	peter (sys/dev/ccd/ccd.c revision 1.49)
1999-06-29 04:10:05 +00:00
Greg Lehey
839832f8d0 close_drive:
Correct race condition between caller and daemon.

  Tripped-over-by:	Zach Heilig <zach@uffdaonline.net>
			Bernd Walter <ticso@cicely.de>
			Niels Chr. Bank-Pedersen <ncbp@bank-pedersen.dk>
1999-06-29 04:08:51 +00:00
Greg Lehey
7d0e3c6f72 Correct type of intializer for (undocumented) cdevsw.d_parms.
Submitted-by:	peter
1999-06-29 04:07:55 +00:00
Dag-Erling Smørgrav
af5c746a49 Use the correct value for banksize so splash_pcx works in LFB modes. 1999-06-28 13:52:29 +00:00
Peter Wemm
eb7fc512af Don't #include i386/isa/isa_dma.h - it's in isa/isavar.h now. This
driver is probably not far from being MI now anyway.
1999-06-28 09:19:58 +00:00
Nick Hibma
fd7a5fcd8e Add MultiTech Atlas modem 1999-06-27 22:28:02 +00:00
Nick Hibma
616ff839aa Remove superfluous semi-colon 1999-06-27 22:24:20 +00:00
Nick Hibma
178e4460ef Replace usbd_device_set_desc by device_set_desc_copy 1999-06-27 09:42:40 +00:00
Peter Wemm
b52ab6b545 Initialize and hold locks for ccd generated bufs..
Obtained from: Matt Dillon <dillon@backplane.com>
1999-06-27 09:28:43 +00:00
Nick Hibma
25d210e317 Remove unused variable and computation, possibly leading to a
divide by zero fault.

Possible fix for PR12041

PR:		12041
Submitted-By:	J.Hudson@massey.ac.nz
Reviewed-By:	nsouch
1999-06-26 14:42:17 +00:00
Nick Hibma
7678b59a40 Change 'device' to 'self', to be more like the rest of the code 1999-06-26 12:55:25 +00:00
Peter Wemm
81b1c87805 Fix a dev_t/udev_t issue 1999-06-26 11:00:17 +00:00
Peter Wemm
0fc85147a7 #if 0 an unused function since it generates warnings.. (I have not deleted
it in case it's part of a bigger plan.)
1999-06-26 10:52:54 +00:00
Kirk McKusick
67812eacd7 Convert buffer locking from using the B_BUSY and B_WANTED flags to using
lockmgr locks. This commit should be functionally equivalent to the old
semantics. That is, all buffer locking is done with LK_EXCLUSIVE
requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will
be done in future commits.
1999-06-26 02:47:16 +00:00
Søren Schmidt
c4217f94eb Nine'th update to the new ATA/ATAPI driver:
The atapi subsystem has gotten better error handeling and timeouts,
it also tries a REQUEST SENSE command when devices returns errors,
to give a little more info as to what went wrong. It might be a
little verbose for now, but I'm interested in as much feedback on
errors as possible, especially timeouts, as I'm a bit in doubt if
I've chosen resonable default values everywhere.

The disk driver has been changed a bit to prepare for tagged queing,
which is next on my list.

The disk driver has grown a dump routine, I got one implementation
from Darrell Anderson <anderson@cs.duke.edu> which also did
partial dumps (usefull on big memory machines) I left out the
partial stuff for now, and changed the rest alot to fit into the new
ad_request framework.

Some minor cleanups and rearrangements as well.

As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, again you have been warned :)
Notebook owners should be carefull that their machines dont suspend
as this might cause trouble...

But please tell me how it works for you!

Enjoy!

-Søren
1999-06-25 09:03:07 +00:00