Commit Graph

495 Commits

Author SHA1 Message Date
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
186f2b9e04 Add missing <sys/module.h> includes currently relying on nested include
in <sys/kernel.h>
2004-06-03 06:10:02 +00:00
Nate Lawson
51e2355882 Store the target handles in a separate list from normal commands. Add a
CTIO fast post routine to handle CTIO completions.

Submitted by:	mjacob
2004-05-24 07:02:25 +00:00
Thomas Moestl
eb01b42587 Correct the boundary parameter to the bus_dma_tag_create() calls (it was
(1 << 24) - 2 instead of 1 << 24, which it was obviously intended to
be). This fixes SBus isp(4)s on sparc64 machines.

Report and testing:  Marius Strobl <marius@alchemy.franken.de>
2004-03-23 23:41:39 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Tom Rhodes
a122cca953 These are changes to allow to use the Intel C/C++ compiler (lang/icc)
to build the kernel. It doesn't affect the operation if gcc.

Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as
icc v8 may define __GNUC__ some parts may look strange but are
necessary.

Additional changes:
 - in_cksum.[ch]:
   * use a generic C version instead of the assembly version in the !gcc
     case (ASM code breaks with the optimizations icc does)
     -> no bad checksums with an icc compiled kernel
     Help from:		andre, grehan, das
     Stolen from: 	alpha version via ppc version
     The entire checksum code should IMHO be replaced with the DragonFly
     version (because it isn't guaranteed future revisions of gcc will
     include similar optimizations) as in:
        ---snip---
          Revision  Changes    Path
          1.12      +1 -0      src/sys/conf/files.i386
          1.4       +142 -558  src/sys/i386/i386/in_cksum.c
          1.5       +33 -69    src/sys/i386/include/in_cksum.h
          1.5       +2 -0      src/sys/netinet/igmp.c
          1.6       +0 -1      src/sys/netinet/in.h
          1.6       +2 -0      src/sys/netinet/ip_icmp.c

          1.4       +3 -4      src/contrib/ipfilter/ip_compat.h
          1.3       +1 -2      src/sbin/natd/icmp.c
          1.4       +0 -1      src/sbin/natd/natd.c
          1.48      +1 -0      src/sys/conf/files
          1.2       +0 -1      src/sys/conf/files.amd64
          1.13      +0 -1      src/sys/conf/files.i386
          1.5       +0 -1      src/sys/conf/files.pc98
          1.7       +1 -1      src/sys/contrib/ipfilter/netinet/fil.c
          1.10      +2 -3      src/sys/contrib/ipfilter/netinet/ip_compat.h
          1.10      +1 -1      src/sys/contrib/ipfilter/netinet/ip_fil.c
          1.7       +1 -1      src/sys/dev/netif/txp/if_txp.c
          1.7       +1 -1      src/sys/net/ip_mroute/ip_mroute.c
          1.7       +1 -2      src/sys/net/ipfw/ip_fw2.c
          1.6       +1 -2      src/sys/netinet/igmp.c
          1.4       +158 -116  src/sys/netinet/in_cksum.c
          1.6       +1 -1      src/sys/netinet/ip_gre.c
          1.7       +1 -2      src/sys/netinet/ip_icmp.c
          1.10      +1 -1      src/sys/netinet/ip_input.c
          1.10      +1 -2      src/sys/netinet/ip_output.c
          1.13      +1 -2      src/sys/netinet/tcp_input.c
          1.9       +1 -2      src/sys/netinet/tcp_output.c
          1.10      +1 -1      src/sys/netinet/tcp_subr.c
          1.10      +1 -1      src/sys/netinet/tcp_syncache.c
          1.9       +1 -2      src/sys/netinet/udp_usrreq.c

          1.5       +1 -2      src/sys/netinet6/ipsec.c
          1.5       +1 -2      src/sys/netproto/ipsec/ipsec.c
          1.5       +1 -1      src/sys/netproto/ipsec/ipsec_input.c
          1.4       +1 -2      src/sys/netproto/ipsec/ipsec_output.c

          and finally remove
            sys/i386/i386        in_cksum.c
            sys/i386/include     in_cksum.h
        ---snip---
 - endian.h:
   * DTRT in C++ mode
 - quad.h:
   * we don't use gcc v1 anymore, remove support for it
   Suggested by:	bde (long ago)
 - assym.h:
   * avoid zero-length arrays (remove dependency on a gcc specific
     feature)
     This change changes the contents of the object file, but as it's
     only used to generate some values for a header, and the generator
     knows how to handle this, there's no impact in the gcc case.
   Explained by:	bde
   Submitted by:	Marius Strobl <marius@alchemy.franken.de>
 - aicasm.c:
   * minor change to teach it about the way icc spells "-nostdinc"
   Not approved by:	gibbs (no reply to my mail)
 - bump __FreeBSD_version (lang/icc needs to know about the changes)

Incarnations of this patch survive gcc compiles since a loooong time,
I use it on my desktop. An icc compiled kernel works since Nov. 2003
(exceptions: snd_* if used as modules), it survives a build of the
entire ports collection with icc.

Parts of this commit contains suggestions or submissions from
Marius Strobl <marius@alchemy.franken.de>.

Reviewed by:	-arch
Submitted by:	netchild
2004-03-12 21:45:33 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Matt Jacob
9b81514d7d We aren't D_TAPE. We aren't anything. The reasons why this was ever set
at all is lost in the mists of time.
2004-02-16 17:43:57 +00:00
Matt Jacob
67ff51f150 Remove condition variables and status associated with target mode
enabling. Instead, go to an interrupt/polled model.

Fix get_lun_statep so we don't panic if there are no wildcard luns enabled.

MFC after:	6 days
2004-02-08 19:17:56 +00:00
Matt Jacob
c98d7aa472 Remove condition variables and status associated with target mode
enabling. Instead, go to an interrupt/polled model.

MFC after:	6 days
2004-02-08 19:16:01 +00:00
Matt Jacob
746e9c8540 Checkpoint of work in progress in cleaning up target mode. It actually
seems to work well in RELENG_4. However, 5.X locking foo means that I'll
have to do some quick redesign.

Add ioctl handlers for ISP_GETROLE and ISP_SETROLE ioctls.
2004-02-07 03:47:33 +00:00
Matt Jacob
2cd44270e5 add a count for inotifies as well as atios.
MFC after:	1 week
2004-02-07 03:44:43 +00:00
Matt Jacob
4e8a2b48a7 Reverse role defines for initiator and target mode to better match the
class 3 service parameters we'd get.

Steal 8 bits out of the portid u_int32_t for role information (port ids
are 24 bits anyway).

MFC after:	1 week
2004-02-07 03:43:27 +00:00
Matt Jacob
cc330eadff Add case to handle ISPCTL_GET_PDB.
MFC after:	1 week
2004-02-07 03:42:17 +00:00
Matt Jacob
87ab7d39a4 If we're defined to have a default role for target mode, make it
just ISP_ROLE_TARGET- not both.

MFC after:	1 week
2004-02-07 03:39:42 +00:00
Matt Jacob
e0d3cfb7be Change role defines so that they better match class 3 service parameters.
Add ISPCTL_GET_PDB isp_control operation.

MFC after:	1 week
2004-02-07 03:38:39 +00:00
Matt Jacob
eedb2dfec3 Fix a bug where we never managed to include the sense data we wanted to send. 2004-01-29 06:36:30 +00:00
Matt Jacob
ac9d0a02cf Fix longstanding buglet- for centrally handled CTIO2s we were checking the wrong
bit for this being the  last CTIO2.  It didn't matter since it really was the
last CTIO2 and the resources recycled, but still....

Add in CTIO3 define for future DAC work.
2004-01-29 02:40:43 +00:00
Matt Jacob
e23df011da If we have ISP_ROLE_INITIATOR set, make sure that we clear ICBOPT_INI_DISABLE
from the fwoptions. Likewise, we *set* ICBOPT_INI_DISABLE if we don't have
initiator role.
2004-01-23 23:23:31 +00:00
Matt Jacob
520b6299ac add MAKE_WWN_FROM_NODE_NAME macro 2004-01-23 23:22:35 +00:00
Matt Jacob
a556b68e3a Add firmware major, minor and micro revsions to the ISP_FC_GETHINFO ioctl
structure.
2004-01-23 23:22:11 +00:00
Matt Jacob
1484f178c4 fix broken _IOR usage 2003-11-14 05:13:00 +00:00
Matt Jacob
081a1c2536 Turn off ISP_SMPLOCK- not to be turned on again.
Until we can have perfect knowledge that all callers above us think it's okay
for us to sleep, releasing *our* locks of course, we don't dare try and sleep.
2003-10-21 21:52:23 +00:00
Poul-Henning Kamp
70cd771337 The present defaults for the open and close for device drivers which
provide no methods does not make any sense, and is not used by any
driver.

It is a pretty hard to come up with even a theoretical concept of
a device driver which would always fail open and close with ENODEV.

Change the defaults to be nullopen() and nullclose() which simply
does nothing.

Remove explicit initializations to these from the drivers which
already used them.
2003-09-27 12:01:01 +00:00
Mark Murray
56c5b842f0 Add a module dependancy. Now CAM will autoload when you load this.
OK'ed by:	mdodd
2003-09-15 06:41:33 +00:00
Matt Jacob
4b39f27d17 NetBSD'er with time on their hands (dma->DMA) 2003-09-13 01:59:14 +00:00
Matt Jacob
799cbab17e Bland synchronization of common source with no effect on FreeBSD whatsomever. 2003-09-13 01:58:51 +00:00
Matt Jacob
2f9e7606fe Some ridiculous target mode botches- like having the wrong definitions
for messages. Some spelling fixes. Some target mode structure cleanups
to reflect reality.
2003-09-13 01:58:26 +00:00
Matt Jacob
5c1596a04a Some canonicalization function cleanups based upon some target mode
structure cleanups.
2003-09-13 01:57:31 +00:00
Matt Jacob
4578084aa3 No time like the present to turn back on SMP locking. 2003-09-13 01:56:45 +00:00
Matt Jacob
fd6eb9f769 Report correct active vs. nvram node/port WWNs in an ioctl. 2003-09-13 01:56:24 +00:00
Matt Jacob
28f0575cf1 On reset, make sure that we have some parameters set correctly. This
fixes a longstanding issue WRT resetting the chip after startup- it
would fail if we were connected as an F-port to a switch. If we
were connected as an F-port, we got assigned a hard loop ID of 255,
which is really a bogus loop id. Then when we turned around to
reset ourselves, the firmware would reject the ICB_INIT request
because the loop id was bogus. *sputter*

Minor fixlet from somebody in NetBSD with too much time on their
hands (dma -> DMA).
2003-09-13 01:55:44 +00:00
Marcel Moolenaar
e43e17a2e6 Move the inclusion of <machine/ofw_machdep.h> after the inclusion of
<dev/ofw/openfirm.h> to allow the former to contain prototypes that
use types defined in the latter.

Reviewed by: mjacob@
2003-09-02 19:52:31 +00:00
Matt Jacob
65ff1249a0 Revert previous commit. Violates Maintainer (O'Brien knows how to
reach me directly), but more importantly, breaks compiles on
non-FreeBSD platforms.
2003-08-25 17:58:23 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Warner Losh
3d11ce04c6 s=include <ofw/=include <dev/ofw/= to reflect removal of -I$S/dev 2003-08-23 00:11:16 +00:00
Warner Losh
77e6a3b2dd Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 06:00:27 +00:00
Scott Long
f6b1c44d1f Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma.  At the moment, this is used for the
asynchronous busdma_swi and callback mechanism.  Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg.  dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create().  The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms.  The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by:	tmm, gibbs
2003-07-01 15:52:06 +00:00
Nate Lawson
2813692cc2 Merge common XPT_CALC_GEOMETRY functions into a single convenience function.
Devices below may experience a change in geometry.

* Due to a bug, aic(4) never used extended geometry.  Changes all drives
  >1G to now use extended translation.
* sbp(4) drives exactly 1 GB in size now no longer use extended geometry.
* umass(4) drives exactly 1 GB in size now no longer use extended geometry.

For all other controllers in this commit, this should be a no-op.

Looked over by:	scottl
2003-06-14 22:17:41 +00:00
Matt Jacob
d8f9e010d2 Restore parentheses removed inappropriately in last commit. 2003-06-01 19:01:01 +00:00
Poul-Henning Kamp
a0fb4cf18d Remove unused variables
Add /* FALLTHROUGH */

Found by:       FlexeLint
2003-05-31 19:49:49 +00:00
Matt Jacob
3aa9119309 Add an explanatory comment about what operational modes in xfwopt are. 2003-03-25 07:02:45 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Matt Jacob
e5824c5d33 Pointy hat- bad commit. 2003-02-16 14:26:23 +00:00
Matt Jacob
03cf2fba38 Make sure we propagate rxid && iid in isp_target_put_atio 2003-02-16 01:37:51 +00:00
Matt Jacob
7369ae168f Pick up some compilation warning fixes from NetBSD.
If we don't have ISP_FW_CRASH_DUMP defined, we have to do
a isp_reinit in the core code- not the platform code- so
fix the ISP_CONN_FATAL case.
2003-02-16 01:32:52 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Matt Jacob
76514802bd Make compiles (LINT and/or ISP_TARGET_MODE options) happier by making sure
printf type format args and actual args match.

Reviewed by:	Sam Leffler <sam@errno.com>
2003-01-02 04:21:52 +00:00