Commit Graph

151 Commits

Author SHA1 Message Date
christos
f0f1731b24 Acting as Elad's keyboard:
Place the securelevel checks in their logical locations.
This will be clearer in the future when code changes to use kauth(9) calls.

input and okay ad@
2006-08-23 15:44:29 +00:00
christos
e35ee08ce3 Coverity CID 1532: Off-by-one array overrun. 2006-04-14 20:17:34 +00:00
christos
31535ad130 Coverity CID 1081: Avoid NULL deref. 2006-04-14 20:16:02 +00:00
thorpej
8fc3572573 Use device_private(). 2006-03-29 06:41:24 +00:00
thorpej
39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
bouyer
7837fbef28 A device that has just been detached can't be reconfigured. Coverity ID 2674.
Note: this was not a problem right now because there's no drivers with both
a detach and a ii_reconfig callback.
2006-03-27 21:50:45 +00:00
thorpej
246504f91c Use device_parent(). 2006-03-25 22:55:55 +00:00
dsl
6f0f9f8763 Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
2006-01-29 21:42:40 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
fredb
c3ec7554f8 Initialize "mapped" before any of the "goto"'s, so we're not testing an
uninitialized variable at "bad:".
2005-11-24 13:34:55 +00:00
drochner
e6a178f21f kill a number of autoconf submatch functions which follow the
standard scheme:
if (<configured> != <wildcard> && <configured> != <real>)
	then fail
else
	ask device match function

This is handled by config_stdsubmatch() now.
2005-08-25 22:33:18 +00:00
drochner
fa3cb84d62 replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
2005-08-25 18:35:38 +00:00
christos
b3c5e8037b add const 2005-05-30 04:37:57 +00:00
christos
06059a46a3 avoid variable shadowing. 2005-05-30 04:36:52 +00:00
yamt
330cc0a11e split IFCAP_CSUM_xxx to IFCAP_CSUM_xxx_Rx and IFCAP_CSUM_xxx_Tx. 2005-05-02 15:34:31 +00:00
perry
f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
simonb
c1530b6999 Remove an erroneous semicolon. 2005-02-26 12:03:15 +00:00
thorpej
a0c36aaebd Eliminate use of M_HASFCS. 2005-01-31 02:51:17 +00:00
thorpej
e9818f5b5e When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
2004-10-30 18:08:34 +00:00
yamt
05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
drochner
5f7699c047 oops, another typo, should fix report by taya 2004-09-15 15:49:10 +00:00
drochner
f3872a35ff actually pass the locators,
should fix panic reported by Shin'ichiro TAYA
2004-09-15 09:10:42 +00:00
drochner
96b589fc18 a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
 config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
 on "locators.h"
2004-09-13 12:55:47 +00:00
simonb
9bc855a931 s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
2004-04-23 02:58:27 +00:00
itojun
aca4c091d3 sprintf -> snprintf 2004-04-22 00:17:10 +00:00
wiz
3f9411f688 Spell removable with only two es. Inspired by jmc@openbsd. 2004-04-19 12:44:09 +00:00
ad
243b868f65 Grab the configuration lock when handling I2ORESCANCMD. 2003-12-09 19:51:23 +00:00
ad
ee5a33f5aa Match Promise controllers. 2003-12-09 19:43:53 +00:00
wiz
c0177219fe Fix some typos. From Tom Cosgrove via jmc@openbsd. 2003-11-02 09:52:33 +00:00
simonb
b6abb6ab1d Remove some assigned-to but otherwise unused variables. 2003-10-30 01:58:17 +00:00
mycroft
e0e9384a8e Reorder, eliminating a bogus initializer. 2003-10-29 02:13:09 +00:00
mycroft
4f4b36f2f3 Fix the previous differently. 2003-10-25 20:26:25 +00:00
christos
8bfd5e3292 Fix uninitialized variable warnings 2003-10-25 18:34:14 +00:00
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
thorpej
434a4243a1 Fix the way the scsipi adapter openings are adjusted when the array
controller adjusts our queue length.
2003-06-13 02:33:09 +00:00
wiz
1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
thorpej
22475c164d __'ify MACHINE_ARCH names. 2003-02-14 18:29:05 +00:00
simonb
6af195bf29 Remove variable that is only assigned too but not referenced. 2003-01-20 04:25:46 +00:00
thorpej
41978f782e Merge the nathanw_sa branch. 2003-01-18 21:21:28 +00:00
thorpej
72a7af27b0 Use aprint_normal() in cfprint routines. 2003-01-01 00:10:15 +00:00
ad
42c8a17c80 Fix typo. 2002-12-11 13:02:31 +00:00
ad
59773dea2e Implement the DPT EATA ioctl() interface. 2002-12-07 19:48:30 +00:00
ad
57d787eeac - Handle DPT ioctls from native NetBSD binaries.
- SCSI targets could disapper mid-way through autoconfig if the board
  notifed us of a changed LCT at the wrong time. Fix that.
2002-12-06 11:22:25 +00:00
ad
122b0bd68f Cosmetic changes. 2002-11-15 13:51:29 +00:00
msaitoh
f321ab1a02 Add support for Adaptec 200[05]S
reviewed by Andrew Doran
2002-11-08 05:47:35 +00:00
jdolecek
e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
ad
0d6011b266 PR 18760: don't issue I2O_EXEC_IOP_CLEAR to AMI boards, since some
firmware revisions can't handle it.
2002-10-22 13:42:33 +00:00
thorpej
c9b3657ce9 Add trailing ; to CFATTACH_DECL. 2002-10-02 16:33:28 +00:00
thorpej
9d4a640785 Use CFATTACH_DECL(). 2002-09-30 21:04:24 +00:00
thorpej
f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
provos
0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej
6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00
gehenna
77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
thorpej
c49ac7a5a6 Use __mips__ instead of mips. 2002-05-31 21:43:49 +00:00
ad
df9895c1cb Bump IOPL_MAX_SEGS to 16 in line with other Ethernet drivers, and in one
spot replace it with the capped value learned from the board.
2002-05-04 16:43:26 +00:00
bouyer
e5727031fb Implement mstohz() as discussed on tech-kern, and use it in SCSI drivers
to convert xs->timeout to callout() parameter.
2002-04-05 18:27:45 +00:00
ad
dbd8140c1f PR 15552: don't explode if the board fails to respond during initalization. 2002-03-08 11:37:04 +00:00
tsutsui
c12b5c180d Call malloc(9) with M_ZERO flag instead of memset() after malloc(). 2002-01-12 16:41:02 +00:00
ad
215ddc9ef7 Set sc_framesize to a reasonable value early on so that DEBUG code
doesn't choke before we discern the real value.
2002-01-02 19:04:17 +00:00
lukem
ecb81c3f6d - convert usage of "defopt" to "defflag" where the relevant option does
not support a value (e.g., it's to be used as "options FOO" instead of
  "options FOO=xxx"). options that take a value were converted to
  defparam recently.
- minor whitespace & formatting cleanups
2001-11-28 10:21:10 +00:00
lukem
05b019ba0f add RCSID 2001-11-13 12:24:11 +00:00
ad
404706846e Make firmware updates work with dpti. 2001-09-27 18:43:37 +00:00
ad
fcf00dcc00 Add `dpti', which is an I2O vendor extension implementing the DPT/Adaptec
control interface. This makes it possible to run the Linux versions of
dptmgr, raidutil, dptelog and other tools under NetBSD.
2001-09-21 23:44:19 +00:00
wiz
9fa0b17629 Give initiali[sz]e all the "i"s it deserves. 2001-09-18 18:15:49 +00:00
ad
a0fdfb54e0 Implement/fix FDDI, receive checksums, media selection and a ton of other
stuff.
2001-08-22 09:43:15 +00:00
ad
1d6329bb04 Parameter group changes:
- Do FIELD_SET correctly for scalar types.
- Add some basic table ops.
- Push error reporting back into iop.c.
- Add some field index and (yet more) LAN defs to i2o.h.
2001-08-22 09:42:05 +00:00
ad
c1856b0940 Add more LAN defs. 2001-08-06 13:33:49 +00:00
ad
5b470dcd5f Add iopl. 2001-08-06 13:25:10 +00:00
ad
8cd802fef0 Thinko. 2001-08-06 12:17:09 +00:00
ad
6e8802596a Rough I2O LAN interface driver. Needs a bit of work. 2001-08-06 12:12:36 +00:00
ad
87f451b1a0 This isn't relevant any more. 2001-08-04 16:55:07 +00:00
ad
03e46dc80b Some changes from OpenBSD, and some of my own:
- More SCSI port defs.
- Nuke vtophys().
- Release resources in iop_init() upon failure.
- Don't use a message wrapper when initalising the outbound FIFO.
- A couple of field size/endian fixes.
- Just use iop_post() when we don't need special handling.
- IM_DISCARD is now pointless, since we don't queue at the driver level.
- Map data transfers from/to userspace directly.
- A few comment and stylistic changes.
2001-08-04 16:54:18 +00:00
bouyer
f47d097cf5 Make it compile with SCSIPI_DEBUG 2001-06-26 12:46:56 +00:00
wiz
0a600be867 receive, not recieve 2001-06-12 15:17:10 +00:00
ad
bfac43a1c8 Centralise the geometry fudge. 2001-06-10 10:48:42 +00:00
bouyer
937a7a3ed9 Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
  ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
  to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
  peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
  recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
  scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
  (no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
  set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
  the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
  will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
2001-04-25 17:53:04 +00:00
jdolecek
372e5956ef Only install headers which are actually used by our userland. This
saves about 2.2MB under /usr/include/dev/. Discussed on tech-kern@
recently.

I HOPE to get the list right. The headers I left in are ones
used for MI tools and those whose usage I discovered by grep over tree sources.
Feel free to put needed includes back in if you encounter anything which
should not be removed from lists.
2001-04-11 07:42:31 +00:00
ad
99187cdd56 - Allocate any private space that's requested.
- Fix a few bogons with the last update.
- Add some more LAN defs.
2001-04-01 15:02:08 +00:00
ad
fad8449663 Decrease the timeouts on QUEIESCE and CLEAR lest the adapter doesn't reply. 2001-03-21 14:27:05 +00:00
ad
ef80e73a4e Split limits and ioctl defs out of iopvar.h. 2001-03-20 13:02:25 +00:00
ad
ebf5110997 Major update; basically, improve performance somewhat and play nicer with
Intel and AMI IOPs. There still exists one nasty problem with Intel adapters
when under load, which I'm working on.
2001-03-20 13:01:48 +00:00
lukem
3aeb5f2f29 whitespace police 2001-02-24 01:59:46 +00:00
ad
fc919d3e61 FC peripherals on DPT/Adaptec boards only respond to private class messages. 2001-02-07 17:05:46 +00:00
ad
d606f3d65c Sync with ld.c. 2001-02-06 12:22:24 +00:00
ad
a06fc2bf4b Fix thinko in previous. 2001-01-03 21:17:05 +00:00
ad
5fcbd5f722 - Fix a number of bugs with the configuration stuff.
- Bash the passthrough interface into working order.
- Add an ioctl to retrieve the `tidmap'.
2001-01-03 21:04:01 +00:00
ad
8494f44b67 Make dumps work, and put the first part of detach into ld.c. 2001-01-03 21:01:28 +00:00
ad
c29358e0f9 Don't try to configure `uninteresting' devices. 2001-01-01 19:03:30 +00:00
ad
e931ce9485 Oops. 2000-12-03 15:51:53 +00:00
ad
433cc4cf9e Nit. 2000-12-03 15:51:36 +00:00
ad
3bcc9b9f3a Fix a comment. 2000-12-03 13:34:37 +00:00
ad
af9d4c4fa4 - Only configure un-claimed devices. Implement re-configuration.
- Adhere to the spec better in some places. Also, work around some quirks
  noted in the Linux I2O code.
- Register event handlers for the executive and RBS devices.
- Fix a number of buglets and tidy a little.
- Implement a message pass-through interface and some other useful ioctls.
2000-12-03 13:17:03 +00:00
ad
04a83acaf7 lsu -> ld 2000-11-26 19:24:24 +00:00
ad
57ea462da2 lsu -> ld, by popular request. 2000-11-26 17:44:02 +00:00
thorpej
cfe0892ed3 NBPG -> PAGE_SIZE 2000-11-14 18:42:55 +00:00
itojun
611c77c7df unused variable 2000-11-09 17:20:24 +00:00
ad
01dc7ef4f3 TODO 2000-11-09 15:04:55 +00:00
ad
0129c52c7d - A few minor changes (typos and the like).
- Use SPLs in iop_msg_send() and not the interrupt mask - it accesses
  shared resources lower down.
2000-11-09 12:51:36 +00:00
ad
9a41c41bed Install only headers that are useful to userspace (ioctl interface is not
finished, but will be here soon).
2000-11-09 12:34:05 +00:00