Commit Graph

8253 Commits

Author SHA1 Message Date
Poul-Henning Kamp
88647b6de5 Be consistent about functions being static.
Properly put macro args in ().

Spotted by:	FlexeLint.
2002-10-16 09:14:59 +00:00
Poul-Henning Kamp
2c876e15c8 Be consistent about functions being static.
Spotted by:	FlexeLint.
2002-10-16 09:04:52 +00:00
Poul-Henning Kamp
031fd299d7 Be consistent about functions being static.
Spotted by:	FlexeLint.
2002-10-16 08:48:39 +00:00
Poul-Henning Kamp
4d8d520f17 Fix misindentation.
Spotted by:	FlexeLint
2002-10-16 08:45:34 +00:00
Justin T. Gibbs
ccbe423c8f Never allow memory mapped I/O in PCI-X mode on controllers that
do not support that configuration.  This should fix problems with
embedded 7902 controllers running in PCI-X mode.
2002-10-16 02:59:03 +00:00
Sam Leffler
5d84645305 Replace aux mbufs with packet tags:
o instead of a list of mbufs use a list of m_tag structures a la openbsd
o for netgraph et. al. extend the stock openbsd m_tag to include a 32-bit
  ABI/module number cookie
o for openbsd compatibility define a well-known cookie MTAG_ABI_COMPAT and
  use this in defining openbsd-compatible m_tag_find and m_tag_get routines
o rewrite KAME use of aux mbufs in terms of packet tags
o eliminate the most heavily used aux mbufs by adding an additional struct
  inpcb parameter to ip_output and ip6_output to allow the IPsec code to
  locate the security policy to apply to outbound packets
o bump __FreeBSD_version so code can be conditionalized
o fixup ipfilter's call to ip_output based on __FreeBSD_version

Reviewed by:	julian, luigi (silent), -arch, -net, darren
Approved by:	julian, silence from everyone else
Obtained from:	openbsd (mostly)
MFC after:	1 month
2002-10-16 01:54:46 +00:00
Sam Leffler
87cb581aa4 missed additional callout that can run w/o Giant locked 2002-10-15 23:25:56 +00:00
Poul-Henning Kamp
fb9da1ef43 Include "opt_kbd.h" since certain structures size depend on the value
of KBDIO_DEBUG which may be defined in the kernel config (as it is in NOTES).

This kind of bug is a _really_ horribly thing as we end up with one bit
of code thinking a particular structure is 136 bytes and another that it
is only 112 bytes.

Ideally all places would remember to #include the right "opt_foo.h" file,
but I think in practice file containing the variable sized struct should
#include it explicitly as a precaution.

Detected by:	FlexeLint
2002-10-15 21:35:01 +00:00
Marcel Moolenaar
18e0cd7dde Fix previous commit: Don't cast integral types to pointers to
print them with %p. Cast to unsigned long and print with %#lx.

Discussed with: bde
2002-10-15 01:50:09 +00:00
Alfred Perlstein
9c1c2e9924 Put function return types on a line by themselves.
Cleanup my earlier de-__P sweep and remove whitespace between function
names and paramters.
2002-10-14 22:31:52 +00:00
Matt Jacob
413f5a8add LINT related fixes (as noticed by bde) 2002-10-14 22:13:51 +00:00
John Baldwin
83a20b6e3e This file doesn't need opt_bus.h. 2002-10-14 19:11:19 +00:00
Olivier Houchard
89ca562efb Fix support for the ALi M5451 (rev 0.2) chip.
Reviewed by:	orion, mux
Approved by:	mux (mentor)
MFC after:	1 week
2002-10-14 11:47:37 +00:00
Warner Losh
aa23e9c476 o Comment out the symbol download code for 4.x.
o Add hooks for doing power management of the output signal.
o Minor hacks to make flexlint happy wrt staticness of functions.
2002-10-14 01:59:57 +00:00
Olivier Houchard
d6ca3de751 Import of the trm(4) driver (for Tekram DC395U/UW/F and DC315U SCSI adapters).
Reviewed by:	mux, scottl
Approved by:	mux, scottl
2002-10-13 18:32:39 +00:00
Jake Burkholder
81bb0b95b1 MODINFO_SIZE metadata has type size_t, not unsigned. This makes preloaded
md root work on sparc64.
2002-10-13 18:19:22 +00:00
Marcel Moolenaar
a9945062b7 Make this compile on 64-bit architectures (e.g. ia64) by not assuming
pointers (but more precisely vm_offset_t) can be printed with %x. Use
%p instead and cast the argument to caddr_t.
2002-10-12 20:40:36 +00:00
Matt Jacob
2e6d3b4614 Know that a 10160 is the same as a 12160.
MFC after:	0 days
2002-10-12 00:12:31 +00:00
Warner Losh
41a0c1eedd s/modunload/kldunload 2002-10-11 20:22:20 +00:00
Sam Leffler
526dee0415 No need to hold Giant will harvesting RNG data; change callout_init so
this no longer happens for callbacks.
2002-10-11 17:34:00 +00:00
Matt Jacob
f556e83b61 This should enable 10160 support. As best as I can tell, the same
f/w as 12160 is used, and otherwise, this is just a single channel
variant of the 10160.

MFC after:	0 days
2002-10-11 17:28:01 +00:00
Matt Jacob
306a209024 Fix the code so that it no longer on alpha refers to the now nonexistent
pci_cvt_to_bwx.

This doesn't necessarily make bge(4) now actually *work* on an alpha.
It loads, configures, and then about 30 seconds later, my XP1000 hard
freezes. But, hey, it's a start.

Obtained from:	gallatin@freebsd.org
2002-10-11 17:18:54 +00:00
Warner Losh
43924d99c2 add some devices from NetBSD 2002-10-11 07:03:09 +00:00
Warner Losh
5c71502dad Some renamings from pccarddevs
Add Linksys WCF11
Bay eMobility 11B
2002-10-11 07:02:31 +00:00
Warner Losh
7cb84123d4 sync to 1.36 of pccarddevs 2002-10-11 07:00:53 +00:00
Warner Losh
1ac1b586c1 Merge from NetBSD plus diff reduction to netbsd's pcmciadevs 1.177 file:
o NETGEAR2 -> NETGEAR_2
o PLANEX2 -> PLANEX_2
o ACTIONTEC HWC01170 -> ACTIONTEC PRISM
o linksys iwn2 -> iwn3
o Add: Ositech, DLINK_3, BAY emobility, buffalo lpc3_clt, netgear fa410TX.
  dynalink accton EN2216, corega ether II PCC TD, dlink dfe670TXD,
  dynalink l10c

Obtained from: NetBSD
2002-10-11 07:00:30 +00:00
Warner Losh
82ddfdef07 Add Planex GWNS11H
Submitted by: hanai-san
2002-10-11 05:43:38 +00:00
Warner Losh
26bb14c4bb sync to 1.35 of pccarddevs 2002-10-11 05:40:45 +00:00
Warner Losh
5a702a282b Add a new NewMedia BUSTOASTER that I bought on ebay (sadly w/o scsi dongle).
Add PLANEX GWNS11H submitted by hanai-san.
2002-10-11 05:40:13 +00:00
Warner Losh
93642ba9bf o Set CBB_CARD_OK just before CARD_ATTACH_CARD. If ATTACH_CARD fails, then
clear the bit.  This allows ata driver to attach its children because
  it needs the interrupts enabled to succeed.

Submitted by: iwasaki-san

o Spell CardBus as CardBus, not Cardbus or CardBUS while I'm here.
2002-10-11 04:30:59 +00:00
Matt Jacob
63872bc9c5 Get the most recent 2300 f/w that's on the QLogic intranet- fixes lots
of buglets and quite a few bugs.

MFC after:	1 day
2002-10-10 17:30:06 +00:00
Matt Jacob
41ed683e13 From PHK's flex tool- we can get -1 returned from xpt_path_target_id,
so don't index off of it.

MFC after:	1 day
2002-10-10 17:29:05 +00:00
John Baldwin
6b4d1b08a2 Use d_thread_t for cdevsw functions instead of struct thread * so that it
is easier to share this code with 4-stable.
2002-10-09 20:39:26 +00:00
John Baldwin
87e5d36101 Include <dev/acpica/acpivar.h> instead of <acpica/acpivar.h> like all the
other sys/dev/acpica files.
2002-10-09 20:38:21 +00:00
Peter Wemm
ba3d594ddc Fix build on alpha. It used to case an int to a pointer in order to do
pointer arithmetic.  Detour via uintptr_t, since we're generating an
offset not dereferencing them.
2002-10-09 09:30:57 +00:00
Peter Wemm
16c1138c89 Change BUS_SPACE_UNRESTRICTED (~0ul) to plain ~0 when used in the
'int nsegments' argument to bus_dma_tag_create().  ~0ul does not fit in
an int on machines with 64 bit longs.
2002-10-09 08:54:32 +00:00
Peter Wemm
bf579f2321 Change BUS_SPACE_UNRESTRICTED (~0ul) to plain ~0 when used in the
'int nsegments' argument to bus_dma_tag_create().  ~0ul does not fit in
an int.
2002-10-09 08:50:26 +00:00
Søren Schmidt
c13beb0171 Fix for the panic when using a Promise TX2.
The problem is that the code does a check for the granparent of
the Promise chip, if this is a bridge of the right type, we have
a TX4 on our hands, and need to handle that ones "issues".
Now the grandparent check cause subtle bugs in the newbus system,
mainly that pci_get_devid doesn't return an error value.
This patch works around the issue by using BUS_READ_IVAR() instead.
2002-10-08 18:25:10 +00:00
John Baldwin
422971d7d9 Don't panic for a bad ivar request, just return ENOENT. 2002-10-08 15:44:35 +00:00
Warner Losh
c4598a8916 Make kldunload cbb work:
o Implement the thread killing interlock as described by jhb in arch@
  while talking to markm.
o Hold Giant around cbb_insert()/cbb_remove().  Deep in the belly of
  the vm code we panic if we don't hold this when we activate the memory
  for reading the CIS.
o If we had to do the kludge alloc, then do a kludge free.
2002-10-08 03:53:52 +00:00
Alexander Kabaev
7d59efa9a8 Add device driver for Belkin F5U103 and compatible USB-to-serial adapters.
Reviewed by:	n_hibma
Approved by:	obrien
2002-10-08 03:09:57 +00:00
Alexander Kabaev
139b2d67cd Regen after usbdevs rev. 1.102.
Reviewed by:	n_hibma
Approved by:	obrien
2002-10-08 03:04:14 +00:00
Alexander Kabaev
469f01ba8c Add entries for:
Belkin F5U103
	Belkin F5U120-PC Hub
	GoHubs GoCOM232
	Peracom single port
USB-to-serial adapters.

Reviewed by:	n_hibma
Approved by:	obrien
2002-10-08 03:00:37 +00:00
Warner Losh
01d8ff4dfd MFp4:
o Better resume code.  Move the comments around.  Force the socket state to
  be querried.  Ack the interrupts properly.
o Intercept the interrupt requests and keep a list of interrupts to service
  ourselves.  When the card attaches, set its OK bit.  When we get a card
  status change interrupt for that card, clear the OK bit.  Don't call the
  ISR if the OK bit is cleared.  Iwasaki-san and yamamoto-san have both
  sent me patches that fix the same problem this fixes, but at the pccard
  level.
o Try to get the signalling of the thread to actually die.  This might not be
  100% right, but it is less wrong than before.
o Add a SIC next to a TI type that looks like it could be wrong, but isn't.
2002-10-07 23:11:29 +00:00
Warner Losh
3688a119c4 o Add a nomatch routine so we whine when we don't know what to attach to
the card.
o Add comments about how we're doing the CIS activation.
o Add location and pnp info functions.
o Add better code to hopefully deal with ata cards better (and other drivers
  that allocate resources that we didn't preallocate from the CIS).  OLDCARD
  used to allow it, but NEWCARD was pickier.  I'm not 100% sure this works,
  but it doesn't break anything.
2002-10-07 23:05:33 +00:00
Warner Losh
a95bed74b3 Merge changes from NetBSD through version 1.17 of this file. These
give us slightly better error checking than before and interpret what
default bits mean better.  See the NetBSD CVS tree for the authors of
these changes (revs 1.10 .. 1.17).
2002-10-07 23:03:17 +00:00
Warner Losh
aa7bc3b3fc o Add routines to return the location and pnpinfo for this card.
Note, we return the PCI pnp info, but in fact that's wrong to do
  since that data is not defined for CardBus cards.  CardBus says that
  these registers are undefined and one should use the CIS to do
  device matching.  To date, all CardBus cards have had these
  registered defined, no doubt because they are using common silicon
  to produce both the PCI cards and the CardBus cards.  However, it isn't
  any worse than the rest of the system, so just note it in passing and
  move on.
o Also sort prototypes while I'm here.
2002-10-07 23:00:51 +00:00
Warner Losh
0a9e69cc6f Don't abuse the fact that -a == ~a + 1. Signed vs unsigned checkers
complain when a is a unsigned type.  So instead use the latter here
and be on our way.

Spotted by: flexlint by way of phk
2002-10-07 22:58:24 +00:00
Warner Losh
c5d5c855b7 Add extra set of parens around the barbit macro to make it clear what
we're intending to shift.

Spotted by: flexlint by way of phk (should fix about 40 messages)
2002-10-07 22:57:07 +00:00
Sam Leffler
f96d19da13 Track openbsd changes that don't affect us yet (PK supoprt is
currently disabled):

o Don't use constants for the output parameter, use the iparam count as a
  pointer to the first result location.
o Fix bits vs bytes counting problems.
o Split out the hardware and software normalization versions of modexp.
o Enable hardware normalization for chips that support it.
o On reset, disable hardware normalization for 582x and make sure the
  chip is in little endian mode.
o Since sw normalization is now the only option, simplify normalization
  handling.

Also fix RNG harvesting: disabling PK support (for the moment) had disabled
the MCR2 interrupt; consider both KEY support and RNG support when deciding
whether or not to enable it.

Obtained from:	openbsd
2002-10-07 20:02:34 +00:00
Warner Losh
ca407d8777 MFp4:
o Return the right string for CIS4_STR
	o kill obsolete comment about not doing something that we now do.
2002-10-07 07:18:32 +00:00
Warner Losh
c6a6193f79 Better comment for the product ID thing. 2002-10-07 06:35:04 +00:00
Warner Losh
db8c52408d Update comments to remind me about power bugs in oldcard. 2002-10-07 06:18:50 +00:00
Warner Losh
7efff076f4 Ooops. Need to free dc_srom on detach to not leak memory.
Pointy Hat to: The Mad Redhead of Niwot
2002-10-07 05:29:13 +00:00
Warner Losh
3097aa70be Dynamically configure the width of the srom. This code comes from
OpenBSD who got the code (or the idea) from the NetBSD tlp driver.

This gets some cardbus dc cards working (either completely or nearly
so).  It also appears to get additional pci cards working, without
breaking working ones.

# Maybe some additional work is needed here.  Also, the cardbus attachment
# might need to match on the CIS rather than on the vendor/device so we have
# a finer level of detail as to what the card is.  Technically, the
# vendor/device fields are undefined for CardBus (even though most cards are
# using common silicon with pci models).
2002-10-07 05:26:35 +00:00
Bruce Evans
c32049aa33 INclude <sys/mutex.h>'s prerequisite <sys/lock.h> instead of depending on
namespace pollution 2 layers deep in <sys/eventhandler.h>.
2002-10-06 03:18:14 +00:00
Matthew N. Dodd
e6e85c5b17 Make this work under GEOM. 2002-10-06 00:19:38 +00:00
Poul-Henning Kamp
3bd6561289 NB: This commit does *NOT* make GEOM the default in FreeBSD
NB: But it will enable it in all kernels not having options "NO_GEOM"

Put the GEOM related options into the intended order.

Add "options NO_GEOM" to all kernel configs apart from NOTES.

In some order of controlled fashion, the NO_GEOM options will be
removed, architecture by architecture in the coming days.

There are currently three known issues which may force people to
need the NO_GEOM option:

boot0cfg/fdisk:
        Tries to update the MBR while it is being used to control
        slices.  GEOM does not allow this as a direct operation.

SCSI floppy drives:
        Appearantly the scsi-da driver return "EBUSY" if no media
        is inserted.  This is wrong, it should return ENXIO.

PC98:
        It is unclear if GEOM correctly recognizes all variants of
        PC98 disklabels.  (Help Wanted!  I have neither docs nor HW)

These issues are all being worked.

Sponsored by:	DARPA & NAI Labs.
2002-10-05 16:35:33 +00:00
Robert Watson
6d4d944e33 Get Vinum up and running with GEOM:
(1) Use namei() and devfs to discover devices rather than a hard-coded
    MAKEDEV implementation.  Once rootfs is in place, this will allow
    Vinum to be used for the root file system partition.

(2) Pass FREAD to device opens so that GEOM will return sector size
    rather than an error on attempts to read label data.

(3) Avoid clobbering return values from close_drive() and masking this
    failure, resulting in a later divide by zero due to not having
    updated the Vinum-cached sector size.

(4) Ignore failures from DIOCWLABEL as that appears not to be required
    in the GEOM environment.

We've done testing in simple Vinum environments, but those with more
complex environments might want to give this a spin in DP2 and make
sure everything is up to speed.

Fixes in collaboration with:	iedowse
Reviewed by:			grog
2002-10-05 03:44:00 +00:00
Robert Watson
0c0d4e17e4 Refinement on previous fix for mutex destruction: make sure we don't
release the mutex multiple times for multi-plex volumes.

Following further consultation with:	grog
2002-10-05 03:33:38 +00:00
Robert Watson
96364d6806 Remove a panic on vinum module unload: make sure to destroy all mutexes
before freeing so that WITNESS doesn't dereference mutex data pointers
and page fault.  It's now possible to unload vinum.ko with a GENERIC
kernel on 5.0-CURRENT without panic.

Debugged/fixed with the aid of:	jake, grog
2002-10-05 03:07:23 +00:00
Mitsuru IWASAKI
5e0ca5771b Make sure that ACPI PCI driver probe routine call pci_cfgregopen()
before start accessing PCI config space.

Reviewed by:	jhb
2002-10-05 02:16:49 +00:00
Mitsuru IWASAKI
9063802340 Oops, forgot to add main file for my previous commit :-) 2002-10-05 02:06:00 +00:00
Mitsuru IWASAKI
ba835e3fe6 Add code for ACPI PCI link object manipulation.
This allocate the best IRQ to boot-disable devices (have IRQ 0).
Allocated IRQ will be used for PCI interrupt routing when ACPI is
enabled.

Note that verbose messaging enabled for the time being so that
people can easily notice the strange behavior if it happened.
2002-10-05 02:01:05 +00:00
Sam Leffler
107c3eaaac Crypto device driver for Broadcom-based cards. Known to work with 582x-based
cards.  Supposed to work with several others.

Obtained from:	openbsd
2002-10-04 20:33:20 +00:00
Sam Leffler
6d161891fe Crypto device driver for hifn-based cards. Tested with 7951-, and 7811-based
cards.  Claimed to support many others.

Obtained from:	 openbsd
2002-10-04 20:32:37 +00:00
Matthew N. Dodd
bafe85a4ad Remove duplicate make_dev() calls. 2002-10-04 08:33:10 +00:00
Matthew N. Dodd
3ae5b53264 newbus & bus_space the mcd(4) driver. 2002-10-04 07:14:19 +00:00
Matthew N. Dodd
efe66a4be9 Minor style(9) changes. 2002-10-04 02:21:26 +00:00
Matthew N. Dodd
4c7a1919f6 Remove duplicate calls to make_dev(). 2002-10-04 01:58:55 +00:00
Peter Wemm
f5e283f206 Oops, missed this one. Fix a printf format error on 64 bit systems
where sizes are long instead of int.
2002-10-04 00:35:22 +00:00
Peter Wemm
0b57bf8a75 Fix printf format errors on 64 bit systems where sizes are long
instead of just int.
2002-10-04 00:33:46 +00:00
Peter Wemm
f144391b8f Display the name of the acpi node that we do not find the pci interrupt
routing table for.
2002-10-04 00:32:09 +00:00
Alfred Perlstein
780c174bca Static'ify a variable.
Submitted by: Matt Emmerton <matt@gsicomp.on.ca>
2002-10-03 06:44:01 +00:00
Eric Anholt
d5157cd692 Correct an indentation.
Noticed by:	phk
2002-10-03 06:10:54 +00:00
Don Lewis
91e97a8266 In an SMP environment post-Giant it is no longer safe to blindly
dereference the struct sigio pointer without any locking.  Change
fgetown() to take a reference to the pointer instead of a copy of the
pointer and call SIGIO_LOCK() before copying the pointer and
dereferencing it.

Reviewed by:	rwatson
2002-10-03 02:13:00 +00:00
Poul-Henning Kamp
8311f05a45 Fix rare and probably inconsequential memory leak.
Spotted by:	FlexeLint
2002-10-02 20:34:23 +00:00
Poul-Henning Kamp
42117b6c4d Fix a probably rare and inconsequential memory leak.
Spotted by:	FlexeLint
2002-10-02 20:29:54 +00:00
Poul-Henning Kamp
8c5d013757 Fix mis-indentation.
Spotted by:	FlexeLint
2002-10-02 09:09:25 +00:00
Scott Long
316ec49abd Some kernel threads try to do significant work, and the default KSTACK_PAGES
doesn't give them enough stack to do much before blowing away the pcb.
This adds MI and MD code to allow the allocation of an alternate kstack
who's size can be speficied when calling kthread_create.  Passing the
value 0 prevents the alternate kstack from being created.  Note that the
ia64 MD code is missing for now, and PowerPC was only partially written
due to the pmap.c being incomplete there.
Though this patch does not modify anything to make use of the alternate
kstack, acpi and usb are good candidates.

Reviewed by:	jake, peter, jhb
2002-10-02 07:44:29 +00:00
Matthew N. Dodd
945a11211b Use more standard variable names for modevent functions. 2002-10-02 04:47:52 +00:00
Matthew N. Dodd
c12ef98f27 Create/destroy memory zones on module load/unload, not on device
attach/detach.
2002-10-02 04:42:24 +00:00
Jake Burkholder
17cc43149a Fix a typo in BGE_BIGENDIAN_INIT. 2002-10-01 22:33:40 +00:00
Matthew N. Dodd
f72e17e233 Add a field to struct cmn_unit to hold a pointer to the driver's softc. 2002-10-01 22:04:31 +00:00
Søren Schmidt
94ec75ef27 Misc cleanups.
Pointed out by: phk/flexelint
2002-10-01 15:21:57 +00:00
Søren Schmidt
26cc243d90 Add yet another Promise PCI id. 2002-10-01 15:21:09 +00:00
Bruce Evans
7e3998a3de Removed the only PCI_DEBUG ifdef in the kernel. PCI_DEBUG was not a
supported option and it disabled a whole 2 lines of bootverbose messages.
I wanted to see 1 of the messages (about the latency timers).  This
is a wrong place to decode pci configurations, but the code is already
here and handles more details than pciconf(8).
2002-10-01 13:28:24 +00:00
Poul-Henning Kamp
b13866404a The bus number is unsigned, it cannot be less than zero.
Found by:	FlexeLint
2002-10-01 10:18:22 +00:00
Brooks Davis
13d4f45b18 Use if_printf(ifp, "foo") instead of printf("xe%d: foo", ifp->it_unit). 2002-10-01 01:03:02 +00:00
Brooks Davis
deffb46b90 Use if_printf(ifp, "blah") instead of printf("vx%d: blah", ifp->if_unit). 2002-10-01 00:59:40 +00:00
Brooks Davis
091f3945cb Use if_printf(ifp, "blah") instead of printf("sr%d: blah", ifp->if_unit). 2002-10-01 00:58:16 +00:00
Brooks Davis
421f55825b Use if_printf(ifp, "blah") instead of printf("sn%d: blah", ifp->if_unit). 2002-10-01 00:56:39 +00:00
Brooks Davis
c10b63ba8d Use if_printf() instead of printf() to print "sbni#: blah". 2002-10-01 00:55:22 +00:00
Brooks Davis
af98feb19c Use if_printf(ifp, "blah") instead of printf("fe%d: blah", ifp->if_unit).
A number of functions in this driver still use the unit number in their
printouts because they pass the unit directly as a function argument
instead of passing a softc or struct ifnet pointer.  This should be
resolved at a future date.
2002-10-01 00:52:58 +00:00
Brooks Davis
38d8969122 Use if_printf() instead of printf() to print "ed#: blah". 2002-10-01 00:49:28 +00:00
Brooks Davis
3a6ceb1592 Use if_printf(ifp, "blah") instead of
printf(CS_NAME"%d: blah", ifp->if_unit);
2002-10-01 00:46:41 +00:00
Brooks Davis
ed1e614af3 Use if_printf(ifp, "blah") instead of
printf("%s%d: blah", ifp->if_name, ifp->if_unit);
2002-10-01 00:44:31 +00:00
Brooks Davis
a5d0e57adc Use if_printf(ifp, "blah") instead of printf("ar%d: blah", ifp->if_unit). 2002-10-01 00:42:51 +00:00
Justin T. Gibbs
655a5ce411 Remove a left over '&' from the conversion to using our
softc referenced seeprom store.

MFC after:	1 day
2002-09-30 19:55:42 +00:00
Josef Karthauser
854add2319 Gremlins ate my comment!
Submitted by:	Clive Lin <clive@tongi.org>
2002-09-30 19:12:43 +00:00
Josef Karthauser
fe74650816 In rev 1.51 of usb_port.h I switched over to using the USB_USE_SOFTINTR
code path to fix a bug in the non USB_USE_SOFTINTR path that caused
the usb bus to hang and generally misbehave when devices were unplugged.
In the process though it also reduced the throughput of usb devices because
of a less than optimal implementation under FreeBSD.

This commit fixes the non USB_USE_SOFTINTR code in uhci and ohci
so that it works again, and switches back to using this code path.

The uhci code has been tested, but the ohci code hasn't.  It's
essentially the same anyway and so I don't envisage any difficulties.

Code for uhci submitted by:	Maksim Yevmenkin <myevmenk@exodus.net>
2002-09-30 17:50:18 +00:00
Poul-Henning Kamp
c91a63aa2c Add support for DIOCGMEDIASIZE and DIOCGSECTORSIZE.
Remove all traces of disklabel.

Sponsored by:	DARPA & NAI Labs.
2002-09-30 13:53:22 +00:00
Poul-Henning Kamp
150b2bdfb2 If GEOM is in the kernel, take these three out. I have no way of
testing any modifications to them, they shouldn't even bother with
disklabels in the first place and they are just plain obsolete old
hardware which should be axed entirely before 5.0-R IMO.

Sponsored by:	DARPA & NAI Labs.
2002-09-30 13:49:20 +00:00
Poul-Henning Kamp
419f39ce0f Prefix private BIO commands with "FD" so people get a hint that they
are in fact private.

Sponsored by:	DARPA & NAI Labs.
2002-09-30 13:42:06 +00:00
Matthew N. Dodd
0e0e9411f2 HARP driver for the IDT77201/211 NICStAR ATM Adapter (Including Fore LE155).
Obtained from:	 Richard Hodges <rh@matriplex.com>
2002-09-30 05:12:39 +00:00
David E. O'Brien
940f2da74e Use fcntl.h from inside /sys.
Reviewd by:	scottl
2002-09-30 02:47:23 +00:00
Warner Losh
0d9ad27e7e mbuf leak in the error case has been fixed. When we have
an error, go ahead and m_freem the buffer.

PR: 32666
Submitted by: Chi-Fung Fan
2002-09-30 00:18:12 +00:00
Warner Losh
d909f3e20c Fix comment 2002-09-29 18:42:14 +00:00
Warner Losh
7f2907fd70 Limit the TX key to a valid range
PR: 39960, 39961 (patches here pointed out problem, but didn't quite fix it)
2002-09-29 18:40:35 +00:00
Warner Losh
214c0b3da4 Don't leak the bar list for each thing we allocate.
# This code really needs a rewrite

Spotted by the eagle eyes of: phk
2002-09-29 18:07:29 +00:00
Poul-Henning Kamp
61ddb5c9d7 Rename "struct device" to "struct midway_device" to avoid clashing
with newbus.
2002-09-28 21:59:59 +00:00
Poul-Henning Kamp
b9b7876d2b This driver doesn't need to include <sys/bus_private.h> either.
Spotted by:	FlexeLint
2002-09-28 20:59:59 +00:00
Poul-Henning Kamp
a3ae595729 Disabuse this driver of the notion that it needs to include
<sys/bus_private.h> to find the unit from a device_t.

Spotted by:	FlexeLint
2002-09-28 20:56:32 +00:00
Mitsuru IWASAKI
01598b8d4a Add support for the BCM5702x chips.
Reviewed by:	jdp
MFC after:	1 week
2002-09-28 18:04:12 +00:00
Poul-Henning Kamp
b28a0fe196 Don't use GCC shorthand for ?: unless it really matters. 2002-09-28 17:47:51 +00:00
Poul-Henning Kamp
024cb40078 Fix an indentation problem. 2002-09-28 17:34:31 +00:00
Poul-Henning Kamp
37c841831f Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by:    FlexeLint warning #512
2002-09-28 17:15:38 +00:00
Poul-Henning Kamp
1cff889a46 Put the casts on the right hand side of =. 2002-09-28 14:17:24 +00:00
Justin T. Gibbs
2eaa80698f Add a missing pair of curly braces to a conditional debug
statement.  This ensures that debug code doesn't trigger if
it isn't enabled. <blush>
2002-09-27 23:00:35 +00:00
Poul-Henning Kamp
6cfbfac6d4 Add "missing scratch-pad register" to the first of the two ports
on the Argosy SP-320 dual-port async PCcard.

An amazing piece of hardware seen from an ISO9000 point of view.
2002-09-27 22:02:46 +00:00
Poul-Henning Kamp
32bc35fdb6 Add a field so we can specify flags per port to the underlying device driver. 2002-09-27 22:01:32 +00:00
Poul-Henning Kamp
97c6f4f976 Add yet a quick flag to sio: 0x100000 "Scratch pad register missing".
The advanced stage of computer assisted hardware design and
verification is aptly illustrated by the fact that this is necessary
because only the first ports in a single-chip, dual-port async
PC-Card product lacks this register.
2002-09-27 22:00:23 +00:00
Søren Schmidt
595ecc67ab Fix so it compiles with the new disklabel stuff. 2002-09-27 21:56:35 +00:00
Josef Karthauser
0fbf938869 MFNetBSD: Increasre the reset recovery time. (rev 1.69) 2002-09-27 19:55:37 +00:00
Josef Karthauser
33e8332333 MFNetBSD: Update class codes. (rev 1.68) 2002-09-27 19:52:42 +00:00
Josef Karthauser
8bca50af6b MFNetBSD: Add Bluetooth related classes etc. (rev 1.67) 2002-09-27 19:45:37 +00:00
Josef Karthauser
fef80c2cba MFNetBSD: revision 1.66
Get rid of trailing white space.
2002-09-27 19:42:29 +00:00
Justin T. Gibbs
99ddedd8d3 Remove redundant inclusion of inttypes.h in aicasm_gram.y
and properly sort inttypes.h into list of includes.

Noticed by:	Mike Barcroft <mike@freebsd.org>
2002-09-27 03:23:02 +00:00
Justin T. Gibbs
c59c8a72cf Upgrade to version 1.1 of the aic79xx U320 driver.
aic79xx.c:
	o Remove redundant ahd_update_modes() call.
	o Correct panic in diagnostic should state corruption cause
	  the SCB Id to be invalid during a selection timeout.
	o Add workaround for missing BUSFREEREV feature in Rev A silicon.
	o Corect formatting nits.
	o Use register pretty printing in more places.
	o Save and restore our SCB pointer when updating the waiting queue
	  list for an "expected" LQ-out busfree.
	o In ahd_clear_intstat, deal with the missing autoclear in the
	  CLRLQO* registers.
	o BE fixup in a diagnostic printf.
	o Make sure that we are in the proper mode before disabling
	  selections in ahd_update_pending_scbs.
	o Add more diagnostics.
	o task_attribute_nonpkt_tag -> task_attribute: we don't need a
	  nonpkt_tag field anymore for allowing all 512 SCBs to be
	  used in non-packetized connections.
	o Negotiate HOLD_MCS to U320 devices.
	o Add a few additional mode assertions.
	o Restore the chip mode after clearing out the qinfifo so that
	  code using ahd_abort_scbs sees a consistent mode.
	o Simplify the DMA engine shutdown routine prior to performing
	  a bus reset.
	o Perform the sequencer restart after a chip reset prior to
	  setting up our timer to poll for the reset to be complete.
	  On some OSes, the timer could actually pre-empt us and order
	  is important here.
	o Have our "reset poller" set the expected mode since there is
	  no guarantee of what mode will be in force when we are called
	  from the OS timer.
	o Save and restore the SCB pointer in ahd_dump_card_state().  This
	  routine must not modify card state.
	o Ditto for ahd_dump_scbs().

aic79xx.h:
	o Add a few more chip bug definitions.
	o Align our tag on a 32bit boundary.

aic79xx.reg:
aic79xx.seq:
	o Start work on removing workarounds for Rev B.
	o Use a special location in scratch from for stroring
	  our SCBPTR during legacy FIFO allocations.  This corrects
	  problems in mixed packetized/non-packetized configurations
	  where calling into a FIFO task corrupted our SCBPTR.
	o Don't rely on DMA priority to guarantee that all data in
	  our FIFOs will flush prior to a command completion notification
	  going out of the command channel.  We've never seen this assumption
	  fail, but better safe than sorry.
	o Deal with missing BUSFREEREV feature in H2A.
	o Simplify disconnect list code now that the list will always
	  have only a single entry.
	o Implement the AHD_REG_SLOW_SETTLE_BUG workaround.
	o Swith to using "REG_ISR" for local mode scratch during
	  our ISR.
	o Add a missing jmp to the data_group_dma_loop after our
	  data pointers have been re-initialized by the kernel.
	o Correct test in the bitbucket code so that we actually
	  wait for the bitbucket to complete before signaling the
	  kernel of the overrun condition.
	o Reposition pkt_saveptrs to avoid a jmp instruction.
	o Update a comment to reflect that the code now waits for
	  a FIFO to drain prior to issuing a CLRCHN.

aic79xx_inline.h:
	o Remove unused untagged queue handling code.
	o Don't attempt to htole64 what could be a 32bit value.

aic79xx_pci.c:
	o Set additional bug flags for rev A chips.
2002-09-26 22:54:00 +00:00
Justin T. Gibbs
0889fb1da5 Expand vendor ID. 2002-09-26 21:50:27 +00:00
Justin T. Gibbs
a614405340 Correct a spelling error. 2002-09-26 21:50:03 +00:00
Justin T. Gibbs
09f07b3a22 Sync perforce IDs for changes first committed to FreeBSD and then
to the Adaptec driver repository.
2002-09-26 21:48:17 +00:00
Justin T. Gibbs
4ff10146c3 Use inttypes.h
Upgrade assembler to allow a move immediate of 0.
This is helpful in certain macros where we can't know the value of the
immediate in advance.
2002-09-26 21:46:19 +00:00
John Baldwin
c1e309b38b Argh, isa(4), eisa(4) and mca(4) now attach to legacy(4) instead of
nexus(4) in the case of machines w/o equivalent bridges on a PCI bus.

Reported by:	winter
Pointy hat to:	jhb
2002-09-26 18:40:06 +00:00
Scott Long
7419815d60 The AAC_COMPAT_LINUX option was really annoying, since it made the
aac driver dependent on the linux emulation module.  This was
especially bad for the release engineers who tried to move the
aac driver from the kernel onto the drivers floppy.  The linux
compat bits for this driver are now in their own driver, aac_linux.
It can be loaded as a module or compiled into the kernel.  For
the latter case, the AAC_COMPAT_LINUX option is needed, along with
the COMPAT_LINUX option.

I've tested this in every configuration I can think of.  This is an
MFC candidate for 4.7.

Idea from:	rwatson
MFC after:	3 days
2002-09-25 05:00:25 +00:00
Jeff Roberson
37ab0e0d81 - Use vrefcnt() instead of v_usecount. 2002-09-25 02:42:43 +00:00
Paul Saab
a7d681929a Add some PCI id's for fxp. I've only tested 0x103B, but the Intel
Linux driver defines 0x103[B-E] so add those as well.

Obtained from:	Intel Linux e100 driver
MFC:		Immediately if re@ allows it, otherwise after 4.7-RELEASE
2002-09-24 23:13:38 +00:00
Matt Jacob
301472c20b Code cleanup: use mpt_prt instead of device_printf. 2002-09-24 21:33:43 +00:00
Prafulla Deuskar
587edcdc95 Corrected license in the source files. It should say "MUST" instead of "MAY".
MFC after:	2 days
2002-09-24 16:27:59 +00:00
Yoshihiro Takahashi
9601a29654 Move the com_emr register definition to sioreg.h. 2002-09-24 02:35:57 +00:00
Matt Jacob
7dec90bcf9 Parameterize MPT_MAX_REQUESTS based upon device type (FC has Global Credits
of 1024- Ultra4 256). Rename 'requests' tag to 'request_pool' for clarity.
Make sure we do correct xpt_freeze_simq/CAM_RELEASE_SIMQ if we run out
of chip resources.

MFC after:	6 days
2002-09-23 19:41:10 +00:00
Alfred Perlstein
4f492bfab5 use __packed. 2002-09-23 18:54:32 +00:00
John Baldwin
b8581e0d56 Now that we only probe host-PCI bridges once, we no longer have to check to
see if we have been probed before by checking for a pciX bus device.
2002-09-23 18:14:31 +00:00
Alfred Perlstein
744ae3e66a use __packed/__aligned rather than GCC-specific __attribute__. 2002-09-23 06:35:33 +00:00
Alfred Perlstein
ebc82cbbf0 s/__attribute__((__packed__))/__packed/g 2002-09-23 06:25:08 +00:00
Matt Jacob
77e22cb706 Wads more cleanup...
In mpttimeout, call mpt_intr just on the offchance that we missed
an interrupt. We can check to see whether or not the command that
is timing out got completed.

When we *do* decide to timeout a command, set the command state to
REQ_TIMEOUT and then invoke another timeout (hz/10)- mpttimeout2.
This allows us to catch a couple cases we've seen where the command
we timed out on in fact is ready to be completed by the firmware.
In any case, it's only after mpttimeout2 is called that we actually
take down the private state and free the request itself. CAM has
been notified in mpttimeout anyway. This whole area should be redone,
but that will take 105% of my available game time for this month.

Fix a couple of missing (and not useful, at presnet) CAMLOCK_2_MPTLOCK
and MPTLOCK_2_CAMLOCK locations.

Split mpt_notify into mpt_ctlop, which handles all reply completions
that have 0x800000000 or'd into the ContextID. This function can, in
fact, call mpt_event_notify_reply, which handles the traditional
async event notifications. While we're at it, put in the extremely
important (but currently untested) code that send back an Ack to
an Event Notification (if the Event Notification is marked with
AckRequired). Note that an Ack also generates another ctlop completion,
tra la.

Fix up mpt_done substantially to try and get how we plug into CAM
correctly done. Remove bogus CAM_RELEASE_SIMQ settings.

Do some cleanups in mpt_action that are related to speed negotiation
for Ultra4 cards. This is an area that is still quite fragile and
worrisome as config data being read back often doesn't make sense or
jibe with the documentation.

At any rate, after these changes were done, I was finally able to
get Lars Eggert's dual 320M disk system to stay up under load all
weekend- hopefully we're in good enough for now shape.

MFC after:	1 week
2002-09-23 05:25:59 +00:00
Matt Jacob
aca01e3897 Recognize the single channel 2Gb card (FC919)- thanks to LSI Logic for
pointing this out.

In mpt_intr, don't try and pop a reply queue element out *unless*
the interrupt status says you might have one.

MFC after:	1 week
2002-09-23 05:16:00 +00:00
Matt Jacob
daa46fadd9 We do not need to expose mpt_notify outside of mpt_freebsd.c.
MFC after:	1 week
2002-09-23 05:14:38 +00:00
Matt Jacob
0424fb537e When freeing a request, zero out the sequence number.
Define the CFG_DAGA_OFF offset as 128 bytes instead of 40- gives us
a more reasonable headroom.

When reading a config page, zero out the entire request area- not just
the length of the request. This is because we cleverly (cheezily) return
configuration data back into the allocated request area, so it's nice
to make sure we start with a clean area to write on.

MFC after:	1 week
2002-09-23 05:14:02 +00:00
Matt Jacob
66cbe912a9 Remove ISP_DMA_ADDR_T definition.
Instead, based upon whether ISP_DAC_SUPPORTED is defined, typedef
isp_dma_addr_t appropriately.

If ISP_DAC_SUPPORTRED is defined, the DMA_WD2/DMA_WD3 macros do something
useful, else they define to '0'.
2002-09-23 05:09:23 +00:00