Commit Graph

51 Commits

Author SHA1 Message Date
thorpej abcd16ecc6 Fix up the TWEIO_COMMAND code to actually work. The 3ware management API
library can now communicate with the card.
2003-09-25 22:26:40 +00:00
thorpej 4fa7c2c48b - Fix a bug I introduced in a previous commit (oops).
- Add the twe_drivecommand ioctl structure.
2003-09-25 01:35:25 +00:00
thorpej 544359b9a2 - Make CCB allocation slightly more efficient by changing how the
CCB is returned to the caller.
- Make code paths that can use twe_ccb_alloc_wait() use it, and assert
  that a CCB is always returned from that function.
- Assert that a CCB is always returned when allocating the reserved CCB
  for an AEN fetch.
2003-09-23 23:50:04 +00:00
thorpej 765ddabe83 Add a comment clarifying why we clear TWEF_AEN in twe_reset() now. 2003-09-23 23:10:53 +00:00
thorpej 1cad401c12 Separate the AEN fetching path into its own special path that uses the
reserved CCB.  This means that all remaining callers of twe_param_get*()
are called from a valid thread context, and thus have no need to use a
reserved CCB.  This will allow for further cleanup in a future commit.
2003-09-23 23:08:54 +00:00
thorpej ddfcdc4f1f Add support for dynamically attaching and detaching RAID array units. 2003-09-22 18:31:10 +00:00
thorpej 0448a55234 Improve AEN handling:
- Make AENs use the generic code table stuff.
- Add a few more AEN codes (from FreeBSD).
- Correct the context of a few AEN codes (some were listed as
  "unit context" when they're really "port context").
- Add a queue of AENs that management tools in userspace can poll
  (from FreeBSD).
2003-09-22 01:13:02 +00:00
thorpej 4431e5d2ea Fetch info about the drives during attach, and inject that info
into the msgbuf using aprint_verbose().
2003-09-21 19:46:44 +00:00
thorpej 21809f0c30 Expose the "param get" functions. 2003-09-21 19:27:27 +00:00
thorpej 291d256789 - Record more information about the array unit, including array
type and stripe depth.
- Report array type and stripe depth when attaching the logical drive.
2003-09-21 19:20:18 +00:00
thorpej 4cf2e784e2 Add some helper routines to fetch 1, 2, and 4 byte parameter values.
Modeled after code in FreeBSD.
2003-09-21 19:01:05 +00:00
thorpej 6c5904f215 Add some additional code -> description tables, and add a generic
routine to translate code -> description.  AENs will be converted
to this mechanism in a future commit.

Partially from FreeBSD.
2003-09-21 18:35:31 +00:00
jdolecek d2041674e6 tweioctl(): store the result of twe_param_get() directly to the right
variable rather than using (void *) temporary
should fix strict aliasing warning of gcc 3.3
2003-08-03 18:45:46 +00:00
jdolecek 4ba1407d10 print some additional information about the controller on boot (from FreeBSD)
use aprint_* as appropriate
change some debug #ifdef DIAGNOSTIC messages into #ifdef DEBUG
make aenfmt[] more const
change twe_param_get() signature to take (struct twe_param **) last arg, and
  remove now unnecessary casts
2003-07-25 11:49:19 +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 72a7af27b0 Use aprint_normal() in cfprint routines. 2003-01-01 00:10:15 +00:00
fvdl f11e75d5f6 Remove comparison of u_int8_t value to (512 - a few bytes), since it's
always false. As found by gcc-current.
2002-12-16 18:27:20 +00:00
christos fa65bb7322 Add /dev/twex support. To be used with FreeBSD's 3dmd.
Initial port from Masaru OKI <oki@netbsd.org>, with KNF, memory leak fixes,
denial of service problems, and null pointer fixes from me.
2002-12-13 23:31:32 +00:00
thorpej d94a4ac49e Avoid strict-alias warnings. 2002-11-25 07:47:53 +00:00
thorpej b75a007d9f Add trailing ; to CFATTACH_DECL. 2002-10-02 16:51:16 +00:00
thorpej 387fc6dc87 Use CFATTACH_DECL(). 2002-09-30 20:37:04 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +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
kim 462f87e7fd Missing comma in aenfmt array initialization. 2002-08-06 20:47:44 +00:00
christos bdd3768afd Add missing messages from FreeBSD's driver. Re-organize a bit how the
message is formatted and printed.
2002-07-10 15:37:30 +00:00
lukem 06de426449 SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field).  whilst it's O(n),
  this mirrors the functionality of SLIST_REMOVE() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
  this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
2002-06-01 23:50:52 +00:00
christos 7db182d94d NBPG is not constant on the sparc, so don't use CPP tricks. 2002-05-24 18:10:06 +00:00
christos 0c5fed7eec Deal with the NBPG problem in a better way. 2002-05-24 15:58:06 +00:00
ad d7e512df18 - Use write barriers.
- NBPG -> PAGE_SIZE.
2002-05-18 20:59:20 +00:00
lukem 9048aaae21 add RCSID 2001-11-13 07:48:40 +00:00
ad 08632b145a Back out previous - it causes panics. 2001-10-10 09:33:36 +00:00
ad ec1f68e931 Use bus_dma to get temporary I/O buffers. 2001-09-20 22:09:44 +00:00
wiz 456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00
chs 64c6d1d2dc a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps.  this is
   required now, since I've removed the globals that expose the address range.
   pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
   no longer any need to special-case it.
 - eliminate struct uvm_vnode by moving its fields into struct vnode.
 - rewrite the pageout path.  the pager is now responsible for handling the
   high-level requests instead of only getting control after a bunch of work
   has already been done on its behalf.  this will allow us to UBCify LFS,
   which needs tighter control over its pages than other filesystems do.
   writing a page to disk no longer requires making it read-only, which
   allows us to write wired pages without causing all kinds of havoc.
 - use a new PG_PAGEOUT flag to indicate that a page should be freed
   on behalf of the pagedaemon when it's unlocked.  this flag is very similar
   to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
   pageout fails due to eg. an indirect-block buffer being locked.
   this allows us to remove the "version" field from struct vm_page,
   and together with shrinking "loan_count" from 32 bits to 16,
   struct vm_page is now 4 bytes smaller.
 - no longer use PG_RELEASED for swap-backed pages.  if the page is busy
   because it's being paged out, we can't release the swap slot to be
   reallocated until that write is complete, but unlike with vnodes we
   don't keep a count of in-progress writes so there's no good way to
   know when the write is done.  instead, when we need to free a busy
   swap-backed page, just sleep until we can get it busy ourselves.
 - implement a fast-path for extending writes which allows us to avoid
   zeroing new pages.  this substantially reduces cpu usage.
 - encapsulate the data used by the genfs code in a struct genfs_node,
   which must be the first element of the filesystem-specific vnode data
   for filesystems which use genfs_{get,put}pages().
 - eliminate many of the UVM pagerops, since they aren't needed anymore
   now that the pager "put" operation is a higher-level operation.
 - enhance the genfs code to allow NFS to use the genfs_{get,put}pages
   instead of a modified copy.
 - clean up struct vnode by removing all the fields that used to be used by
   the vfs_cluster.c code (which we don't use anymore with UBC).
 - remove kmem_object and mb_object since they were useless.
   instead of allocating pages to these objects, we now just allocate
   pages with no object.  such pages are mapped in the kernel until they
   are freed, so we can use the mapping to find the page to free it.
   this allows us to remove splvm() protection in several places.

The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-15 20:36:31 +00:00
thorpej 44e529fecc Use BUS_DMA_READ and BUS_DMA_WRITE in some obvious places. 2001-07-19 16:36:14 +00:00
ad f4afeda420 Reduce the delay when polling so that dumps go faster. 2001-05-31 11:31:43 +00:00
ad 30b7c151f0 AEN 0x000c appears to mean `init started'. From lukem. 2001-03-30 16:48:57 +00:00
thorpej fd7ed72be1 Add BUS_DMA_STREAMING to data transfer maps. 2001-03-07 23:07:12 +00:00
ad fc04a38b9a Don't choke when we get lots of AENs all at once. 2001-03-04 17:50:51 +00:00
ad 811e2b490b Wait 10x longer for status bits. 2001-02-25 17:46:42 +00:00
ad b0eba3a40d Match an upcoming product. 2001-02-11 15:37:13 +00:00
ad c5fe587d24 Oops, be sure to clear the ATTN interrupt on error. 2001-01-23 20:47:02 +00:00
ad 03463e18f1 opt_twe.h isn't needed any more. 2001-01-22 17:40:14 +00:00
ad 9c7e523b64 - Complain if interrupt-driven retrieval of AENs fails somehow.
- Clamp the number of outstanding commands to 129.
- Other tweaks.
2001-01-22 17:32:11 +00:00
thorpej 4d81dcf9c1 splimp() -> splvm() 2001-01-14 21:28:16 +00:00
sommerfeld 851de295eb Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
2000-12-28 22:59:06 +00:00
thorpej cfe0892ed3 NBPG -> PAGE_SIZE 2000-11-14 18:42:55 +00:00
ad 891c4efd74 - Pull in some updates from FreeBSD - mainly clarifications. Thanks to
Mike Smith <msmith@freebsd.org> for pointing these out.
- Ensure that we get AENs: reserve one CCB/command block for parameter
  retrieval, and chain AEN retrievals that are the result of an interrupt.
2000-11-08 19:23:50 +00:00
ad 833dea96d1 - tsleep()/wakeup_one() will hurt when under load, so use a queue instead.
- Don't copy to or from the aligned buffer unless there's a need to.
2000-10-20 15:14:25 +00:00