Commit Graph

7496 Commits

Author SHA1 Message Date
Josef Karthauser
b47a67cb20 Merge from NetBSD:
revision 1.81
    date: 2000/10/24 15:01:26;  author: augustss;  lines: +36 -10
    Add a hack to try and figure out if the TI UTUSB41 hub is bus
    powered despite claiming to be self powered (it's important to
    know so that the power budget can be met).
2002-04-01 18:22:31 +00:00
Warner Losh
c92b317966 Add more ID's from the PRISM family. from wi.c 1.61 and wireg.h 1.26 by
ichiro@netbsd.org

Obtained from: NetBSD
2002-04-01 18:07:05 +00:00
Josef Karthauser
8d6c171c25 Merge from NetBSD: revision 1.72
Part of this got merged in a previous commit, but not all.

    revision 1.72
    date: 2000/04/14 14:13:56;  author: augustss;  state: Exp;  lines: +34 -27
    Make attach of ugen work as it should so product&vendor locators
    can be used.
2002-04-01 18:03:00 +00:00
Josef Karthauser
84aa7f035a Update $NetBSD$ idents to reflect reality. 2002-04-01 17:54:07 +00:00
Josef Karthauser
cf39046c9d Merge from NetBSD: Removed unnecessary variable declaration. 2002-04-01 17:49:12 +00:00
Josef Karthauser
44b382cbc0 Synchronise with the NetBSD version of this header file for formatting. 2002-04-01 17:43:28 +00:00
Josef Karthauser
d262a59fb2 Merge from NetBSD: usbdi.c rev 1.77, usbdi.h rev 1.44
date: 2000/09/23 21:02:04;  author: augustss;
    Add a way to do control transfers on other pipes than the default pipe.
2002-04-01 17:30:24 +00:00
Josef Karthauser
b588f0eca0 Use ANSI prototypes and declarations. 2002-04-01 17:24:49 +00:00
Josef Karthauser
7b51deb455 Merge from NetBSD: Make it compile with USB_DEBUG. 2002-04-01 17:05:55 +00:00
Josef Karthauser
167145ddc0 Merge from NetBSD:
usb.c rev 1.43, usb_port.h rev 1.26, usb_subr.c rev 1.71

Some OpenBSD portability fixes.
2002-04-01 16:53:29 +00:00
Josef Karthauser
0f657c164b Merge from NetBSD:
usb.c 1.40:
    revision 1.40
    date: 2000/03/14 23:13:12;  author: augustss;  state: Exp;  lines: +4 -1
    Make sure the USB event thread discovers all devices first time
    it call usb_discover().  It should now be possible to have the
    root NFS mounted over a USB Ethernet Adapter.
2002-04-01 16:29:24 +00:00
Josef Karthauser
c0fdce4463 Merge from NetBSD:
usb_port.h (1.33), usbdi_util.c (1.32), usbdi_util.h (1.22):

    ----------------------------
    date: 2000/06/01 14:37:51;  author: augustss;
    Improve some portability items.
    ----------------------------
2002-04-01 16:09:43 +00:00
Josef Karthauser
85b64f4cea Tidy up the formatting so that it's in the style of NetBSD's copy of
this file.
2002-04-01 15:37:00 +00:00
Josef Karthauser
dd78396c46 Use ANSI prototypes and declarations. 2002-04-01 15:01:29 +00:00
Josef Karthauser
981149d059 Merge from NetBSD:
----------------------------
    revision 1.26
    date: 1999/11/28 22:49:53;  author: augustss;  state: Exp;  lines: +12 -8
    More USB_DEBUG and DIAGNOSTIC output.
    ----------------------------
2002-04-01 13:50:42 +00:00
Josef Karthauser
21034e3fc8 Merge from NetBSD:
----------------------------
    revision 1.73
    date: 2000/05/31 16:14:42;  author: augustss;  state: Exp;  lines: +19 -6
    Be more careful when setting the alternate interface so we don't
    end up with nothing set at all if it fails.
    ----------------------------
2002-04-01 13:43:02 +00:00
Josef Karthauser
04b496f565 Merge from NetBSD:
----------------------------
	revision 1.117
	date: 2000/05/30 09:26:06;  author: augustss;  lines: +7 -1
	As a safety, check that the controller is not suspended when we get
	an interrupt.
	----------------------------
2002-04-01 13:36:09 +00:00
John Hay
a4c6b91603 Add an entry for "PCCOM dual port RS232/422/485".
Submitted by:	Daniel O'Connor <doconnor@gsoft.com.au>
MFC after:	1 week
2002-04-01 13:33:43 +00:00
Josef Karthauser
55b7d12d51 Merge from NetBSD:
----------------------------
	revision 1.90
	date: 2000/05/08 18:28:46;  author: thorpej;  lines: +8 -3
	Quiet some uninitialized variable warnings that do in fact
	look legitimate.
	----------------------------
2002-04-01 13:28:49 +00:00
Josef Karthauser
3b53380927 Add a clarifying comment (from NetBSD).
Update the $NetBSD$ ident to reflect reality.
2002-04-01 13:26:27 +00:00
Josef Karthauser
a5450efd66 Merge from NetBSD:
ohci.c (1.85), ohcireg.h (1.17):

	----------------------------
	date: 2000/04/01 09:27:35;  author: augustss;
	Add a delay before reading the number of ports from the controller to
	avoid getting 0 from it.
	----------------------------
2002-04-01 13:21:43 +00:00
Josef Karthauser
6688a3fdbe Merge from NetBSD:
ohci.c (1.83), ohcireg.h (1.16), ohcivar.h (1.21)

	===================================================================
	date: 2000/03/29 01:46:26;  author: augustss;
	A first stab at support for isochronous transfers.
	===================================================================
2002-04-01 13:18:11 +00:00
Alfred Perlstein
5da99a94e8 Remove erronious destroy_dev. Not sure what the author's intent was here
but this makes the driver not panic my -current box.

Approved by: scottl
2002-04-01 06:09:17 +00:00
Poul-Henning Kamp
81661c94b6 Here follows the new kernel dumping infrastructure.
Caveats:

The new savecore program is not complete in the sense that it emulates
enough of the old savecores features to do the job, but implements none
of the options yet.

I would appreciate if a userland hacker could help me out getting savecore
to do what we want it to do from a users point of view, compression,
email-notification, space reservation etc etc.  (send me email if
you are interested).

Currently, savecore will scan all devices marked as "swap" or "dump" in
/etc/fstab _or_ any devices specified on the command-line.

All architectures but i386 lack an implementation of dumpsys(), but
looking at the i386 version it should be trivial for anybody familiar
with the platform(s) to provide this function.

Documentation is quite sparse at this time, more to come.

Details:

ATA and SCSI drivers should work as the dump formatting code has been
removed.  The IDA, TWE and AAC have not yet been converted.

Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set
the device as dumpdev.  To implement the "off" argument, /dev/null
is used as the device.

Savecore will fail if handed any options since they are not (yet)
implemented.  All devices marked "dump" or "swap" in /etc/fstab
will be scanned and dumps found will be saved to diskfiles
named from the MD5 hash of the header record.  The header record
is dumped in readable format in the .info file.  The kernel
is not saved.  Only complete dumps will be saved.

All maintainer rights for this code are disclaimed: feel free to
improve and extend.

Sponsored by:   DARPA, NAI Labs
2002-03-31 22:37:00 +00:00
Poul-Henning Kamp
67cd130e59 The AAC, TWE and IDA diskdrivers cannot dump until I and msmith
have ripped all the i386 specific formatting code from their
dump routines.  Due to the potential for trashing disks, I did
not want to do this "blind".
2002-03-31 22:29:52 +00:00
Josef Karthauser
d1c9105874 Regen. 2002-03-31 21:38:38 +00:00
Josef Karthauser
b730bb6d61 Add more usb adapters, from NetBSD. 2002-03-31 21:38:05 +00:00
Søren Schmidt
db9df6ae8f ATA100 is allowed on the HPT chips rev >= 3 2002-03-31 13:33:55 +00:00
Bruce Evans
8fdb202d85 Support more than 32 sio unit numbers. The maximum unit number is now
(65536 * 32 - 1), but MAKEDEV only supports up to (32 * 32 -1).  Device
names use the unit number in base 32 for all "digits".

This required fixing an old bug in MAKEDEV:ttyminor().  Its arg was the
global $unit instead of $1.

Reminded by:	Valentin K. Ponomarenko <valka@krog.ukrtel.net>
MFC-after:	1 week
2002-03-31 09:15:43 +00:00
Bruce Evans
e968c4ef3c Hacks for measuring interrupt latency. Interrupt latency can be
measured accurately for periodic interrupts provided the interrupts
don't need to be serviced very quickly to keep their period almost
constant.  sio output interrupts have this property (interrupt service
can be delayed for up to 1 character time without the period changing).

This is non-optional and undocumented so that it can be added and
removed easily.  It has no significant effect unless it is enabled by
hacking on a variable using a debugger.  Hardclock and statclock interrupts
would work even better for this, at least on i386's, provided their
interrupt handlers are fast (as they are in -current but not in -stable
or in my version of -current).
2002-03-31 06:49:38 +00:00
Søren Schmidt
60378464bb Remove debug output in last commit. 2002-03-30 16:51:47 +00:00
Søren Schmidt
4486f609fc Add support for getting status (fan, temp, 5V and 12V levels) from
Promise Superswap enclosures.

Sponsored by: Advanis
2002-03-30 16:36:41 +00:00
Søren Schmidt
7e2437190c Use the raid lun not the magic when writing Promise config. 2002-03-30 11:15:46 +00:00
Poul-Henning Kamp
572a089e74 Remove bogus vinumdump(), if you can't dump, say so with nodump(). 2002-03-29 21:14:34 +00:00
Poul-Henning Kamp
6ede0acccc Remove bogus ccddump() function in favour of the standard nodump. 2002-03-29 21:12:11 +00:00
Matthew N. Dodd
0e93a9b535 - Merge the pdq driver (if_fpa and if_fea) from NetBSD.
Among other things this gets us ifmedia support.
- Update fddi_ifattach() to take an additional argument.
2002-03-29 11:22:22 +00:00
Warner Losh
4e4b1656c2 Improve support of MFC cards (Multi-function cards). This commit
allows us to properly parse cards with attribute memory based CIS that
before wouldn't parse correctly, sometimes with a panic.  This allows
me to get my 3C562 modem/ethernet card to fail to attach due to
problems in the ep and sio drivers rather than due to problems in the
CIS parsing code :-).

We weren't setting the address to jump to for the function entries.
This caused us to only work when the addional entries were after the
first ones.  On the 3C562/3C563 card this was not the case.

We were also mapping Attribute memory when common memory was asked for
in the target of the LONGLINK_{A,C} or LONGLINK_MFC.

My IBM Home And Away Modem/LAN card still fails for reasons unknown.
2002-03-29 08:05:39 +00:00
Warner Losh
4f453a6c89 Identify PRISM 2.5 with ISL37300P
Obtained from: OpenBSD
2002-03-29 00:32:32 +00:00
Warner Losh
8cf3aa5fce Integrate the air-tools 0.2 from dachb0den labs.
o This moves the common.h file into if_wavelan_ieee.h

Submitted by: h1kari@dachb0den.com
2002-03-29 00:26:23 +00:00
Josef Karthauser
990e9fea48 Use usb_lookup instead of rolling our own.
Suggested by:	Lennart Augustsson <lennart@augustsson.net>
2002-03-28 12:22:58 +00:00
Josef Karthauser
fed2df0509 Remove some surplus whites. 2002-03-28 12:06:29 +00:00
Søren Schmidt
5847590d42 Fix a braino, only update LED's when a device is present. 2002-03-28 11:48:36 +00:00
Murray Stokely
07bd43d600 Add an entry for Decision Computer Inc, PCCOM 4-port serial cards.
PR:		kern/36302
Submitted by:	Thomas Zenker <thz@Lennartz-electronic.de>
MFC after:	1 week
2002-03-28 11:17:20 +00:00
Søren Schmidt
5f3950daa4 OK, the old HighPoint BIOS's are braindead, they have
a really warped way of things. Anyway deal with it,
and luckily the newer HighPoint BIOS's doesn't mind..

No brownies to HighPoint for that...
2002-03-27 22:05:38 +00:00
Søren Schmidt
fe4f5b97e0 Fix support for multi CD changers, it was as broken as my old NEC :)
MFC: ASAP

:
2002-03-27 19:47:52 +00:00
Josef Karthauser
c465d35466 Move some includes around to make it more *BSD compliant.
Suggested by:	Lennart Augustsson <augustss@netbsd.org>
2002-03-27 13:32:42 +00:00
Murray Stokely
93c30e2e4d Fix spelling and grammar bogons in a comment.
PR:		kern/30540
Submitted by:	Tony Finch <dot@dotat.at>
MFC after:	3 days
2002-03-27 13:16:11 +00:00
Søren Schmidt
85db7089ec Add support for creating/deleting ATA RAID's.
This completes the ATA RAID support, since all functions to manipulate
the RAID are accessible from FreeBSD, the BIOS on the ATA RAID cards
are only nessesary for booting.

I decided to allow for creation of ATA RAID's on any ATA controller, but
please keep in mind the restrictions on that. Due to the BIOS not
knowing what to do you can only boot from a RAID1 or the first disk
in a SPAN, if its not located on a "real" ATA RAID controller like
the Promise or Highpoint controllers.

Sponsored by: Advanis
2002-03-27 10:58:59 +00:00
Poul-Henning Kamp
d306122d60 Push BIO_FORMAT into a local hack inside the floppy drivers where
it belongs.
2002-03-26 19:16:37 +00:00
John Baldwin
c145dd8340 Use suser() instead of checking cr_uid against 0 directly. 2002-03-26 18:01:38 +00:00
Søren Schmidt
d42c4a3ba6 Misc little cleanups. 2002-03-26 09:31:22 +00:00
Nicolas Souchu
ea4122d2bf Fix bktr and pcf compilation with LINT 2002-03-25 21:22:35 +00:00
Mike Barcroft
08f8120ab2 Include <machine/limits.h> for definition of ULONG_MAX. Remove a
duplicate include.
2002-03-25 09:23:41 +00:00
Mike Barcroft
e48fdcb37b Include <machine/limits.h> for definition of ULONG_MAX. 2002-03-25 09:21:45 +00:00
Brooks Davis
c86556de7f Remote newly unused variable to unbreak LINT.
Pointy hat to:	amorita
2002-03-25 02:55:34 +00:00
Søren Schmidt
38009ef247 Add AMD 768 support. 2002-03-24 12:44:23 +00:00
Poul-Henning Kamp
116caf7cf7 Hide the ACPI counter probing printf behind bootverbose.
The conclusion is that this method really can tell the perfect from the
less than perfect ACPI counters.

It is in fact probably a bit more discriminative than that, but we
will rather condemn some otherwise perfect counters to the slightly
slower "-safe" version, than certify a counter as perfect which
will let us down later.

Many thanks to all the people who sent email reports!
2002-03-24 11:33:52 +00:00
Thomas Moestl
0d80b9bd88 In some cases, RX descriptors that are signalled to have been completed
by the hardware are still marked as owned. Handle this by installing a
timeout handler to collect this descriptor to avoid having received
packets remain unhandled until the next one arrives.
2002-03-23 19:43:15 +00:00
Thomas Moestl
7ee69ef245 Assorted fixes:
- remove some useless code from the status change handler that was intended
  to enable the the MII drivers for external phys; this is already done
  during interface initialization, and the deleted code made some
  assumptions about phy addresses that do not seem to hold true on newer
  cards. This should get at least one of the two hmes of newer Netra t1
  machines working.
- correct the interrupt resource allocation
- bump the number of RX descriptors, lower values cause promblems on some
  machines
2002-03-23 19:37:11 +00:00
Bruce Evans
ea1499bf8f Fixed some style bugs in the removal of __P(()). The main ones were
not removing tabs before "__P((", and not outdenting continuation lines
to preserve non-KNF lining up of code with parentheses.  Switch to KNF
formatting and/or rewrap the whole prototype in some cases.
2002-03-23 16:01:49 +00:00
Nicolas Souchu
c17d43407f Major rework of the iicbus/smbus framework:
- VIA chipset SMBus controllers added
	- alpm driver updated
	- Support for dynamic modules added
	- bktr FreeBSD smbus updated but not tested
	- cleanup
2002-03-23 15:49:15 +00:00
Nicolas Souchu
ddd22fb7fb Restore the original copyright 2002-03-23 15:36:13 +00:00
Akio Morita
81b60c7395 Add new graphical screen saver (dragon_saver).
Add support for NEC PC-9821 PEGC screen (fire/logo/rain/warp_saver).
2002-03-23 12:36:19 +00:00
Bruce Evans
359052dbcc Fixed some style bugs in the removal of __P(()). The main ones were
not removing tabs before "__P((", and not outdenting continuation lines
to preserve non-KNF lining up of code with parentheses.  Switch to KNF
formatting and/or rewrap the whole prototype in some cases.
2002-03-23 12:13:34 +00:00
Bill Paul
98b28ee5b4 Teach the bge driver about the BCM5701 (specifically, the 3Com
3c996B-T, with the 5701 rev B5 ASIC). One thing that confuses me
still is that the 'link state change' bit in the status block seems
to change state an awful lot. I have a workaround for this in place
now, but it needs more investigation. For the moment though, this
is enough to get the driver to work with this card.
2002-03-22 06:45:40 +00:00
Bill Paul
6577eb9103 regenerate 2002-03-22 06:39:13 +00:00
Bill Paul
15f962ed42 Teach the brgphy driver about the BCM5701's internal copper PHY. 2002-03-22 06:38:52 +00:00
Matt Jacob
371777b161 Limit fabric search to a default 256 entries. This will all go away
soon because it's just getting harder and harder to find switches
that correctly implement the GET ALL NEXT subcommands for the SNS
protocol.

Latch up result out pointer and set a busy flag when we're looking
at the response queue. This allows for a cleaner way to make sure
we don't get multiple CPUs trying to read the same response queue
entries.

Change how isp_handle_other_response returns values (clarity).

Make PORT UNAVAILABLE the same as PORT LOGOUT (force a LIP).

Do some formatting changes.

MFC after:	0 days
2002-03-21 21:10:16 +00:00
Mike Smith
0a702a9b3a Fix error introduced in the 20020217 update, where GetPossibleResources
was spammed with GetCurrentResources.

Submitted by:	Munehiro Matsuda <haro@h4.dion.ne.jp>
2002-03-21 02:02:31 +00:00
John Baldwin
565f27f116 Add PCI ID for the SeaLevel Ultra 530.PCI single port card.
Sponsored by:	The Weather Channel
2002-03-20 19:38:26 +00:00
Warner Losh
c38b6719e5 No need to conditionalize on pci being in the kernel for this 2002-03-20 19:13:13 +00:00
David E. O'Brien
06989891ed Fix warnings on 64-bit hosts. 2002-03-20 18:04:11 +00:00
Jeff Roberson
421e6a659e Remove unused include. 2002-03-20 09:55:07 +00:00
Alfred Perlstein
15fe306743 Remove __P. 2002-03-20 08:56:31 +00:00
Alfred Perlstein
89c9a48352 Remove __P. 2002-03-20 07:51:46 +00:00
Alfred Perlstein
e57574233a Remove __P. 2002-03-20 06:48:11 +00:00
Alfred Perlstein
14e10f9952 Remove __P. 2002-03-20 05:14:42 +00:00
Alfred Perlstein
e51a25f850 Remove __P. 2002-03-20 02:08:01 +00:00
Peter Wemm
1a8f253b64 Cast pointers to uintptr_t rather than u_int32_t. This doesn't work too
well on machines with 64 bit pointers.
2002-03-19 23:28:35 +00:00
Peter Wemm
0d87e7d007 Fix some gcc-3.1+ warnings:
warning: deprecated use of label at end of compound statement
umass.c:2626:46: multi-line string literals are deprecated
2002-03-19 23:20:21 +00:00
Josef Karthauser
2d4ac0e834 Sync the uhci_dump_foo routines with NetBSD, and remove an errant additional
uhci_dump_ii function that landed there, probably during a recent merge.

Spotted by:	alfred
2002-03-19 22:14:08 +00:00
Alfred Perlstein
67b362072d add missing semicolon. 2002-03-19 21:44:49 +00:00
Alfred Perlstein
be1673823f Fix bio->bio_blkno format warning. 2002-03-19 20:12:08 +00:00
Peter Wemm
bcb6ef7c82 Add some break's after default: in the end of switch statements to
keep gcc-3.1+ happy:
ata-all.c:410: warning: deprecated use of label at end of compound statement
ata-all.c:587: warning: deprecated use of label at end of compound statement
ata-raid.c:99: warning: deprecated use of label at end of compound statement
ata-raid.c:151: warning: deprecated use of label at end of compound statement
2002-03-19 12:14:14 +00:00
Peter Wemm
30171114b3 Fix a gcc-3.1+ warning.
warning: deprecated use of label at end of compound statement

ie: you cannot do this anymore:
switch(foo) {
....

default:
}
2002-03-19 11:02:06 +00:00
Peter Wemm
9a8fa41c6f Regen; post SMC id's and also pick up a previously forgotten regen(?). 2002-03-19 10:55:39 +00:00
Peter Wemm
58b0048916 Add another SMC device ID and the hub ID that it went with. 2002-03-19 10:54:40 +00:00
Peter Wemm
5f4a0f788b Add the ia64 bus space tag for the IO ports (!).
Add a #else and #error so that this doesn't go unnoticed again.
2002-03-19 10:53:33 +00:00
Jeff Roberson
1274438838 Initialize variables before use. This was needed to pass -Werror.
Reviewed by:	jake
2002-03-19 05:14:23 +00:00
Bruce Evans
1ab0b5f920 The previous commit missed fixing 2 old printf format errors and
introduced a format printf error.
2002-03-19 04:07:29 +00:00
Andrew Gallatin
54ed0c3221 Fix printf warning caused by recent changes in bio_pblkno's type. 2002-03-19 01:45:04 +00:00
Bruce Evans
07e929da1c Fixed printf format errors in previous commit. %llu is no more suitable
than %u for printing signed 64-bit types.  It fails on different machines,
and has the wrong signdness.

Fixed old printf format error on the same line.  %u is not suitable for
printing 32-bit types on all machines.

"Fixed" format printf error in previous commit.  This file is not
formatted in KNF.  Partially restore bug for bug compatibility: indent
the printf args too much, but don't format them for 160-column terminals.
2002-03-18 23:38:16 +00:00
Bruce Evans
1b7fb13116 Fixed printf format errors in previous commit. %llu is no more suitable
than %u for printing signed 64-bit types.  It fails on different machines,
and has the wrong signdness.

Fixed old printf format error on the same line.  %u is not suitable for
printing 32-bit types on all machines.
2002-03-18 23:24:00 +00:00
Warner Losh
8321855307 Formats that print the block number need to be changed from %u to
%llu due to recent changes in bio_pblkno's type.
2002-03-18 20:50:04 +00:00
Josef Karthauser
916e6e02e5 Add a USB comm driver.
Ported from NetBSD by:	akiyama
2002-03-18 18:23:42 +00:00
Søren Schmidt
a86fb2a588 Cleanup the chipset setup a bit.
Add some (for all I know unneeded) setup code for the rosb4.
2002-03-18 13:56:44 +00:00
Søren Schmidt
2c66127540 Add support for the ServerWorks CSB5 chips 2002-03-18 12:13:13 +00:00
Warner Losh
fb33cfa8f5 Regen for 1.28 of pccarddevs 2002-03-17 05:06:37 +00:00
Warner Losh
a5a492981c Add support for the home Wireless Network airway wireless pcmcia card.
I cannot find where I got these patches, but I think it was from the
bsd-nomads mailing list.  Please contact me if you posted them there.
2002-03-17 05:05:42 +00:00
Bruce Evans
eabfc7877d Work around a PLX9050 bug that causes system lockup in certain systems,
depending on the MMIO addresses allocated to the board.

PR:		30965, 20845 (maybe)
Submitted by:	Daniela Squassoni <daniela@cyclades.com>
Tested by:	Arjan Knepper <arjan@jak.nl>
		Scott Klement <klemscot@klements.com>
2002-03-17 04:10:38 +00:00
Maxim Sobolev
95bd81d145 Extend CONS_GETINFO ioctl to provide information about size of the currently
displayed font.

MFC after:	2 weeks
2002-03-16 23:31:15 +00:00
Warner Losh
048d9f99d1 o Rework the identify routine a little, merging it with NetBSD's wi.
o Add exerpimental support for identifying lucent cards.  All of mine
  come back with ID of 1, but NetBSD committed code for 5.  So accept
  both.
o rename wi_prism2_ver to wi_firmware_ver so that we could, if necessary,
  do special things for lucent cards too.
o Bring in a small part of the changes from airtools: The wi_cmd function
  now takes two additional arguments.  I didn't bring in their ioctls yet.
o eliminate the use of LE16TOH, and remove its define.
o Print the firmware as if there were 100 versions instead of 10.  This means
  that 6.1 and 6.10 aren't confusing to people.  We now print 6.01 in the
  former case.

# A good junior hacker project would be to merge the NetBSD, FreeBSD, and
# OpenBSD drivers into one source base.
2002-03-16 22:59:15 +00:00
Søren Schmidt
4e887e1915 Add more functionality to the CDIOCREADSUBCHANNEL ioctl.
PR: 26644
2002-03-16 15:56:54 +00:00
Søren Schmidt
698d5a2c84 Fix 64bit arch problems. 2002-03-16 15:55:20 +00:00
Søren Schmidt
e1a86e393c Remove useless splXXX set. 2002-03-16 15:54:41 +00:00
Josef Karthauser
3ede2e88ea Merge from NetBSD:
ohcivar.h (1.22), uhcivar.h (1.29):
	============================================================
	date: 2000/04/25 09:20:55;  author: augustss;
	Move the size of the mapped bus_space region into the bus
	independent softc.
	============================================================

ohci.c (1.88), uhci.c (1.112):
	============================================================
	date: 2000/04/25 14:28:13;  author: augustss;
	Insert (very conservative!) bus_space_barrier() calls at
	all register accesses.
	The bus_space(9) man page says you've gotta have them...
	============================================================
2002-03-16 12:44:21 +00:00
Josef Karthauser
cdd493aa00 Bump some $NetBSD$ idents for patches that have already been previously
ported.
2002-03-16 12:24:00 +00:00
Josef Karthauser
5a11d73afa Huge merge from NetBSD:
usbdi.c (1.61):
	===================================================================
	revision 1.61
	date: 2000/01/31 20:13:07;  author: augustss;  lines: +20 -4
	Change the way the HC done method is invoked a little.
	===================================================================

usbdi.c (1.65):
	===================================================================
	revision 1.65
	date: 2000/03/08 15:34:10;  author: augustss;  lines: +4 -2
	Get the status right when a polled transfer times out.
	===================================================================

ohci.c (1.79), uhci.c (1.89), uhcivar.h (1.24), usb_port.h (1.22),
usbdivar.h (1.48):
	===================================================================
	date: 2000/03/23 07:01:46;  author: thorpej;
	New callout mechanism with two major improvements over the old
	timeout()/untimeout() API:
	- Clients supply callout handle storage, thus eliminating problems of
	  resource allocation.
	- Insertion and removal of callouts is constant time, important as
	  this facility is used quite a lot in the kernel.

	The old timeout()/untimeout() API has been removed from the kernel.
	===================================================================

uhci.c (1.80), usbdi.c (1.66):
	===================================================================
	date: 2000/03/23 18:59:10;  author: thorpej;
	Shake out some bugs from the callout changes.
	===================================================================

ohci.c (1.80), uhci.c (1.91), uhcivar.h (1.25), usb_port.h (1.23),
usbdi.c (1.67), usbdivar.h (1.49):
	===================================================================
	date: 2000/03/24 22:03:30;  author: augustss;
	Some cleanup and renaming of the callouts used in USB drivers.
	===================================================================

uhci.c (1.92), uhcivar.h (1.26):
	===================================================================
	date: 2000/03/24 22:57:58;  author: augustss;
	Two major changes:

	  Make each xfer have its own intr_info.  This is necessary if we want
	  to queue multiple xfers on an endpoint.  This should get rid of the
	  (mostly harmless) DIAGNOSTICs about intr_infos (not) being done.

	  Change (again!) how xfers are aborted.  Aborting a TD is a nightmare
	  on the braindead UHCI controller.  (Unless you stop the HC, thereby
	  losing isoc traffic.)  Hopefully I got it right this time.
	===================================================================

usbdivar.h (1.50):
	===================================================================
	revision 1.50
	date: 2000/03/25 00:10:19;  author: augustss;  lines: +4 -2
	GC an unsued field and add some DIAGNOSTIC in xfer.
	===================================================================

ums.c: Use the callout functions instead of the timeout ones.

uhci.c (1.93):
	===================================================================
	revision 1.93
	date: 2000/03/25 00:11:21;  author: augustss;
	lines: +26 -1
	Add more DIAGNOSTIC when aborting isoc.
	===================================================================

uhci.c (1.94), usbdivar.h (1.51):
	===================================================================
	date: 2000/03/25 07:13:05;  author: augustss;
	More DIAGNOSTIC.
	Initialize a callout handle I forgot.
	===================================================================

uhci.c (1.95):
	===================================================================
	revision 1.95
	date: 2000/03/25 07:23:12;  author: augustss;
	Exp;  lines: +24 -7
	Improve uhci_dump_ii().
	===================================================================

ohci.c (1.81), uhci.c (1.96), uhcivar.h (1.27), usb_subr.c (1.68),
usbdi.c (1.68), usbdivar.h (1.52):
	===================================================================
	date: 2000/03/25 18:02:33;  author: augustss;
	Rename and move around callout handles to make it more sane.
	Add some DIAGNOSTIC.
	Fix buglet in isoc abort on UHCI.
	===================================================================

uhci.c (1.98):
	===================================================================
	revision 1.98
	date: 2000/03/27 07:39:48;  author: augustss;  lines: +12 -4
	Make it compile without DIAGNOSTIC.
	===================================================================

uhci.c (1.99):
	===================================================================
	revision 1.99
	date: 2000/03/27 08:01:09;  author: augustss;  lines: +1 -5
	Remove some debug nonsense.
	===================================================================

uhci.c (1.100):
	===================================================================
	revision 1.100
	date: 2000/03/27 09:41:36;  author: augustss;  lines: +13 -3
	Don't mess with QH in bulk abort for the moment.
	===================================================================

uhci.c (1.102):
	===================================================================
	revision 1.102
	date: 2000/03/27 22:42:57;  author: augustss;  lines: +66 -26
	Be a little more careful when aborting.
	Preallocate some TDs for large buffers.
	===================================================================

uhci.c (1.103):
	===================================================================
	date: 2000/03/28 09:47:10;  author: augustss;  lines: +11 -1
	Another patch for xfer abort...
	XXX The current xfer queueing and aborting semantics should really
	XXX be changed.  It cannot be implemented in a sane way on UHCI.
	XXX One day when I have lots of time I'll redesign it...
	===================================================================

uhci.c (1.104): Correct a debug message.
uhci.c (1.105): Be more defensive in a DIAGNOSTIC test.

uhci.c (1.106):
	===================================================================
	revision 1.106
	date: 2000/03/29 01:49:13;  author: augustss;  lines: +14 -309
	*SIGH*  Revert back to the old method of aborting xfers.
	I had tested the new stuff for two months now, but as soon as I commited
	it the problems started to appear.  Murphy, no doubt...
	===================================================================

usb_subr.c (1.70), usbdi.c (1.71), usbdivar.h (1.53):
	===================================================================
	revision 1.70
	date: 2000/03/29 01:45:20;  author: augustss;  lines: +2 -1
	Do not accept new xfers for queuing while a pipe is aborting.
	===================================================================
2002-03-16 12:06:01 +00:00
Warner Losh
e181db22a4 Add device ID for Xircom modem. Also add work around from gwk@sgi.com
to put the device into 8 bit mode a second time.  This appears to have
no ill effects on other devices, and appears to be necessary for the
xircom modem.

Submitted by: gwk@sgi.com, many others that found his patch in the archives.
2002-03-16 04:26:46 +00:00
Luoqi Chen
6774c4e510 Support for LG GM82C700, an AIC6360 clone. 2002-03-15 21:30:41 +00:00
Kirk McKusick
0d2af52141 Introduce the new 64-bit size disk block, daddr64_t. Change
the bio and buffer structures to have daddr64_t bio_pblkno,
b_blkno, and b_lblkno fields which allows access to disks
larger than a Terabyte in size. This change also requires
that the VOP_BMAP vnode operation accept and return daddr64_t
blocks. This delta should not affect system operation in
any way. It merely sets up the necessary interfaces to allow
the development of disk drivers that work with these larger
disk block addresses. It also allows for the development of
UFS2 which will use 64-bit block addresses.
2002-03-15 18:49:47 +00:00
Søren Schmidt
7bdca10c47 Update to the RAID1 rebuild code.
Run rebuild as a background process.

Sponsored by: Advanis
2002-03-15 15:39:54 +00:00
Warner Losh
21677473c6 Revert most of the recent PCI merge. This has proven to be too
unstable for the coming DP1 release.  Instead, I'll develop that on
the IMP_CB_MERGE branch until it is more stable.
2002-03-15 06:41:01 +00:00
Søren Schmidt
733c2fbdd3 Unbreak the probing of some CDROM drives. 2002-03-14 21:35:55 +00:00
Doug Ambrisko
4359c3e645 Only allow super user to perform the Linux compatible ioctls since some
of the things they do, shouldn't be done by normal users.

MFC after:	2 days
2002-03-14 20:56:41 +00:00
Alfred Perlstein
85f190e4d1 Fixes to make select/poll mpsafe.
Problem:
  selwakeup required calling pfind which would cause lock order
  reversals with the allproc_lock and the per-process filedesc lock.
Solution:
  Instead of recording the pid of the select()'ing process into the
  selinfo structure, actually record a pointer to the thread.  To
  avoid dereferencing a bad address all the selinfo structures that
  are in use by a thread are kept in a list hung off the thread
  (protected by sellock).  When a selwakeup occurs the selinfo is
  removed from that threads list, it is also removed on the way out
  of select or poll where the thread will traverse its list removing
  all the selinfos from its own list.

Problem:
  Previously the PROC_LOCK was used to provide the mutual exclusion
  needed to ensure proper locking, this couldn't work because there
  was a single condvar used for select and poll and condvars can
  only be used with a single mutex.
Solution:
  Introduce a global mutex 'sellock' which is used to provide mutual
  exclusion when recording events to wait on as well as performing
  notification when an event occurs.

Interesting note:
  schedlock is required to manipulate the per-thread TDF_SELECT
  flag, however if given its own field it would not need schedlock,
  also because TDF_SELECT is only manipulated under sellock one
  doesn't actually use schedlock for syncronization, only to protect
  against corruption.

Proc locks are no longer used in select/poll.

Portions contributed by: davidc
2002-03-14 01:32:30 +00:00
Warner Losh
20fe00734b Add 5th parameter to pci_read_device specifying the size of the object
to create.
2002-03-13 16:32:11 +00:00
Warner Losh
86d1f89423 Cleanup the recent cardbus cleanups. This fixes some of the panics
that I introduced with -v.  However, other problems still remain (including
the loss of interrupts).
2002-03-13 05:38:19 +00:00
Doug Rabson
c19da1c7af Only i386 has wbinvd(). 2002-03-12 09:45:17 +00:00
Peter Wemm
8b79649b5b Do not concatenate __func__ with strings, because it is not a string.
Later gcc's blow up on this.
2002-03-12 00:15:06 +00:00
Peter Wemm
4d3523e298 Do not do string concatenation with __func__ (which is not a string) 2002-03-12 00:12:59 +00:00
Peter Wemm
75a3a26d2a Recent acpica imports have changed the lengths from UINT32 to ACPI_SIZE,
which is 64 bit on ia64.  Fix it.
2002-03-12 00:10:40 +00:00
Brooks Davis
d174b27395 Add support for 3Com Airconnect PCI cards.
MFC after:	3 days
2002-03-11 23:29:59 +00:00
Søren Schmidt
fe86c44885 Add new support for locking an ATA channel and use that throughout
the ATA/ATAPI driver. This solves the concurrency problem with
the new GEOM code, and also cuts a good deal of the patch size
in the upcoming MFC.
2002-03-11 21:04:32 +00:00
Warner Losh
a2df0b493e On FreeBSD make usb_proc_t the same as d_thred_t always. 2002-03-11 16:38:53 +00:00
Josef Karthauser
be036866cf Be more specific about when block major numbers disappeared from
the cdev switch.
2002-03-11 16:22:15 +00:00
David E. O'Brien
77d49b3cf4 Due to changes in the handling of the #line directive by GCC(cpp) 3.1,
we must now explicitly list the source directory with -I.
2002-03-11 06:45:31 +00:00
Dima Dorfman
cdd530ca19 Make the diagnostics printfs less ugly. 2002-03-11 03:48:32 +00:00
Thomas Moestl
49921f1e25 Use the pci_enable_* functions instead of manually fiddling with the
command register.

Pointed out by:	msmith
2002-03-11 02:37:19 +00:00
Søren Schmidt
835d29c0cd Silence a warning when compile without atapi devices. 2002-03-10 21:03:04 +00:00
Seigo Tanimura
01d901fff3 Do not call a synthesizer with a sequencer lock held. 2002-03-10 16:56:38 +00:00
Takanori Watanabe
03b8237df8 Add SONY VAIO psm controller ISA-PnP ID. 2002-03-10 12:22:17 +00:00
Luigi Rizzo
7c1e1cf188 Fix one genuine bug and a potential one:
-#if defined(__FreeBSD__) && __FreeBSD_version__ >= 500023
  +#if defined(__FreeBSD__) && __FreeBSD_version >= 500023

is a genuine bug -- __FreeBSD_version__ does not exist.
The other one:

  -#if (__FreeBSD__ < 5)
  +#if (__FreeBSD_version < 500000)

pops out when you cross-compile the code:

  __FreeBSD__			is a compiler predefine,
  __FreeBSD_version		is defined in <sys/param.h> .

Given that in this case (and all others in sys/dev/usb and sys/i4b)
the goal is to adapt to a different kernel interface, and not to
a compiler feature, I believe the correct form is the second one
(in the best case the two are synonyms so the change does not break
anything anyways).
2002-03-10 08:29:53 +00:00
Thomas Moestl
e64a9d374a Set the busmaster enable bit in the PCI command register, as the firmware
of sparc64 machines will not do this for us if the interface is not used
for booting over the network.
2002-03-09 21:52:31 +00:00
Thomas Moestl
47792f8bb9 Fix some bugs in the handling of the case of not enough tx descriptors
being free to send a packet.
2002-03-09 21:50:25 +00:00
Søren Schmidt
fefe430118 Even more Highpoint RAID support.
Fix the 80pin cable detection system.
2002-03-08 21:36:49 +00:00
John Hay
db78e578e3 Remove the #if __FreeBSD_version glue now that the puc driver is part of
-stable.
2002-03-08 17:41:22 +00:00
Yoshihiro Takahashi
959168ab57 Add pc98 support. 2002-03-08 12:41:32 +00:00
Søren Schmidt
84409b36ca Support newer Highpoint BIOS's extended config. 2002-03-08 11:33:52 +00:00
Søren Schmidt
b8ad1eb270 cosmetics 2002-03-08 11:31:37 +00:00
Søren Schmidt
c1d33c30e9 Oops I mixed up the patch for -current & -stable, sorry .... 2002-03-07 19:20:23 +00:00
Matt Jacob
70e9673917 Disable RIO (reduced interrupt operation) for 2200 boards- it seemed like
it worked- but I ran into a case with a 2204 where commands were being lost
right and left. Best be safe.

For target mode, or things called if we call isp_handle_other response- note
that we might have dropped locks by changing the output pointer so we bail
from the loop. It's the responsibility of the entity dropping the lock to
make sure that we let the f/w know we've read thus far into the response
queue (else we begin processing the same entries again- blech!).

MFC after:	1 day
2002-03-07 17:32:45 +00:00
Søren Schmidt
216cc529d5 Minor cosmetic changes to minimise diffs for MFC. 2002-03-07 16:34:19 +00:00
Søren Schmidt
5ba86f4c8a Fix a couble of bugs in the rebuild code, return errors properly. 2002-03-07 16:32:21 +00:00
Mike Smith
3f1166f04c Update for the 6.9 firmware family (6xxx controllers), as well as for
the upcoming 7.4 family (7xxx controllers).

 - improved error reporting and handling
 - more diagnostic output
 - add extra command packet definitions
 - merge sources again with -stable
2002-03-07 09:55:41 +00:00
Warner Losh
a268f9dbeb Don't use __FBSDID yet. Looks like most (all?) of the rest of the kernel
doesn't do that.
2002-03-07 08:12:40 +00:00
Warner Losh
b3889b6815 Implement hw.cardbus.debug and hw.cardbus.cis_debug to help debug some
of the cardbus problems that people may start seeing.
2002-03-07 08:10:42 +00:00
Warner Losh
7cdb5c5ec4 Make hw.pccard.debug and hw.pccard.cis_debug tunable/sysctl. Setting to 1
will enable more verbose debugging output from the pccard system.
2002-03-07 08:03:53 +00:00
Warner Losh
a3133b5897 Two style(9) fixes:
- return(foo);	(note parens)
- use __FBSDID()
2002-03-07 00:11:42 +00:00
Warner Losh
8e635fb764 Check for NULL on resource allocation. For the moment, punt, but we should
be smarter about a) cleanup and b) fallback.
2002-03-07 00:05:26 +00:00
John Hay
b72c70af4c Add the "Avlab Technology, PCI IO 2S" card.
Submitted by:	Terry Glanfield <Terry.Glanfield@program-products.co.uk>
2002-03-06 17:37:27 +00:00
Ruslan Ermilov
97b6284457 Fixed compilation warnings. 2002-03-06 08:55:34 +00:00
Bruce Evans
d4621eac57 Fixed a printf format error again. Rev.127 was clobbered in rev.1.128
by removing parentheses.  The main bug is in gcc: on machines with
64-bit longs and 64-bit long longs,

    (unsigned long long)rdp->total_sectors / ((1024L * 1024L) / DEV_BSIZE))

has type plain unsigned long instead of the correctly promoted type
unsigned long long, so it can not be printfed using %llu format.  Even
1ULL / 1L is mispromoted.  Anyway, casting the correct operand
automatically avoids the problem.  We do not want to to pessimize the
division; we just want to convert to a common maximal type for printing.
2002-03-06 06:33:33 +00:00
Warner Losh
f1bdbc6674 Add roaming and microwave oven support. Some minor formatting nits.
Some buggy firmware workarounds.  Fix some endian bugs.

These reduce the diffs from NetBSD, but NetBSD does have more changes since
my last manual merge.
2002-03-05 16:18:14 +00:00
Warner Losh
a90b09d20a Remove __P to reduce diffs with NetBSD and my private tree. 2002-03-05 16:12:41 +00:00
Warner Losh
0e4c175bb9 Merge a little from NetBSD. 2002-03-05 16:06:54 +00:00
Søren Schmidt
11de413756 Misc little cleanups:
Link if only ATAPI device in kernel config
Remove unused #includes
Rearrange a bit in ata-raid to make diff against -stable smaller
Enable wc as default again, dunne how this happend...
2002-03-05 09:24:19 +00:00
Mitsuru IWASAKI
899ccf541a Add generalized power profile code.
This makes other power-management system (APM for now) to be able to
generate power profile change events (ie. AC-line status changes), and
other kernel components, not only the ACPI components, can be notified
the events.

 - move subroutines in acpi_powerprofile.c (removed) to kern/subr_power.c
 - call power_profile_set_state() also from APM driver when AC-line
   status changes
 - add call-back function for Crusoe LongRun controlling on power
   profile changes for a example
2002-03-04 18:46:13 +00:00
Alfred Perlstein
63c6b757ab Support for USB fm radio.
Submitted by: David Yeske <dyeske@yahoo.com>
2002-03-04 03:51:21 +00:00
Warner Losh
dc4ec1188e Add a bunch of cards from NetBSD and maybe other places.
Ericsson Wireless Lan
Simple Tech Spectrum 24 Alt
Socket LP WLAN CF
Symbol LA4100
2002-03-04 02:59:20 +00:00
Orion Hodson
38c81beede Suspend and resume related patches from Toshikazu Ichinoseki <t.ichinoseki@nifty.com>.
PR's: kern/35484, kern/35230.
2002-03-04 00:36:04 +00:00
Mark Murray
4a7cdfd7b9 Provide infrastructure for harvesting SWI entropy. 2002-03-03 20:09:42 +00:00
Mark Murray
e119960112 Massive lint-inspired cleanup.
Remove unneeded includes.
Deal with unused function arguments.
Resolve a boatload of signed/unsigned imcompatabilities.
Etc.
2002-03-03 19:44:22 +00:00
Søren Schmidt
0f0e725b18 Forgot this litte patch, scale the individual disk size from the
arrays total size depending on width of the array.
2002-03-03 16:36:19 +00:00
Søren Schmidt
6f87be981b Major update of the ATA RAID code, part 3:
Add code to properly detach/attach disks that are part of a RAID.

Mark a disk that is attached on an ATA channel belonging to a
RAID as a spare disk that can be used for rebuilding failed RAID1's.

Add support for rebuilding failed RAID1's.

Several fixes to the detach/attach code.

For replacing a disk in a failed RAID1 do the following:

Find the controller channel# of the failed disk.

Exec 'atacontrol detach <channel#>' to free the disk from the system.

Replace the failed disk with a new one of at least the same size.
If your have your disks in drawers/enclosures this can be done with
the system still running.

Exec 'atacontrol attach <channel#>' to add the disk to the system and
mark it as a valid spare for rebuild.

Exec 'atacontrol rebuild <array#>'

The system will rebuild the array on the fly, the array can still
be used during this, although with slower performance.

Please let me know of any problems with this!

Sponsored by: Advanis Inc.

MFC after: 2 weeks
2002-03-03 15:36:21 +00:00
Takanori Watanabe
54f737c3a6 Add two IrDA controller ID: IBM TP240(Probably NSC compatible), and SMC IrCC
controller.
2002-03-03 13:26:59 +00:00
Bruce Evans
b980740327 Fixed a printf format error. 2002-03-02 10:54:33 +00:00
Brooks Davis
16555f3a03 Make 128-bit WEP (aka 104-bit WEP) work with Prism based cards.
Submitted by:	Thomas Skibo <skibo@pacbell.net>
MFC after:	3 days
2002-03-02 00:06:23 +00:00
Orion Hodson
b3aeda3f1f Add support for VT8233. 2002-03-01 20:30:13 +00:00
Peter Wemm
e51c24920f Fix debug printf formats 2002-02-28 00:06:59 +00:00
Peter Wemm
d62e201b7b Fix some unused warnings. One function is only used if
TWE_SHUTDOWN_NOTIFICATION is defined, the other two are never used.
2002-02-27 23:59:35 +00:00
Peter Wemm
98d0a7f844 Fix warnings (comment out unused tables that are taking space in the
kernel)
2002-02-27 23:57:18 +00:00
Peter Wemm
e542f1d7b7 Fix warnings 2002-02-27 23:53:02 +00:00
Peter Wemm
f7afd87572 Fix warnings. The driver would be more useful with a DRIVER_MODULE()
entry so that it actually can do something.
2002-02-27 23:47:45 +00:00
Peter Wemm
10d3660bd2 Repair some warnings. These are accessing idle portions of shared memory
buffers.
2002-02-27 23:43:19 +00:00
Warner Losh
e84e28dee1 Remove support for FreeBSD 2.x from this driver. 2002-02-27 23:34:02 +00:00
Peter Wemm
cd23fe0f58 Fix warning (passing wrong arg to arp_ifinit())
Submitted by:	LINT, -Werror
2002-02-27 23:28:57 +00:00
Julian Elischer
ca9d2dbac9 Add a comment explaining a code change.. 2002-02-27 19:24:55 +00:00
John Baldwin
a854ed9893 Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
2002-02-27 18:32:23 +00:00
Thomas Moestl
42c1b001f7 Add a driver for the Sun GEM (Gigabit) and ERI (100 Mb/s) PCI ethernet
adaptors, ported from NetBSD.
2002-02-27 17:41:06 +00:00
Thomas Moestl
52381bfae4 Add a driver for the Sun HME PCI/SBus ethernet adaptor, which is onboard
in most machines of the Sun Ultra series. This is a port of the NetBSD
driver which I enhanced to make use of the gather functionality and the
configurable RX buffer offset to avoid copying all received/sent packet
(instead, packets will be directly DMAd from mbuf chains and into mbuf
clusters now).
2002-02-27 17:35:48 +00:00
Thomas Moestl
90ce56c287 Add the following functions/macros to support byte order conversions and
device drivers for bus system with other endinesses than the CPU (using
interfaces compatible to NetBSD):

- bwap16() and bswap32(). These have optimized implementations on some
  architectures; for those that don't, there exist generic implementations.
- macros to convert from a certain byte order to host byte order and vice
  versa, using a naming scheme like le16toh(), htole16().
  These are implemented using the bswap functions.
- stream bus space access functions, which do not perform a byte order
  conversion (while the normal access functions would if the bus endianess
  differs from the CPU endianess).

htons(), htonl(), ntohs() and ntohl() are implemented using the new
functions above for kernel usage. None of the above interfaces is currently
exported to user land.

Make use of the new functions in a few places where local implementations
of the same functionality existed.

Reviewed by:	mike, bde
Tested on alpha by:	mike
2002-02-27 17:16:18 +00:00
Julian Elischer
13b33111fe Fix warnings that have become fatal
1/ conditionalise (#if 0) function that is not used.
 Unused code left in place for netBSD compatibility.
2/ Recode loop to convince gcc that it does initialise a variable
 (use do-while instead of for() so gcc knows that we always go through
 at least once.  Feel free to check my logic.
2002-02-27 09:16:00 +00:00
Warner Losh
7ba175ac23 Use the pci.c code wherever possible, rather than copying all the pci
code into cardbus and s/pci/cardbus.  This exposes a few pci_*
functions that are now static.

This work is similar to work Justin posted to the mobile list about a
year or two ago, which I have neglected since then.

This is a subset of his current work with the multiple inheritance
newbus architecutre.  When completed, that will eliminate the need for
pci/pci_private.h.

Similar work is needed for the cardbus_cis and pccard_cis code as well.
2002-02-27 05:09:14 +00:00
Julian Elischer
3ffc8ab1ac Remove errors in LINT (now that they are fatal) 2002-02-27 02:21:43 +00:00
Daniel O'Callaghan
3c3c45471c Remove problematic PHY_WRITE so that autoneg to 10 Mbps
actually works.

Submitted by: Dennis <TD790@aol.com>
Reviewed by:	Bill Paul <wpaul@freebsd.org>
MFC after:	7 days
2002-02-27 02:11:34 +00:00
Brooks Davis
240b1323c3 Set ifp->if_name to "awi" instead of device_get_name(dev) to avoid
casting away a const qualifier so the awi driver compiles.
2002-02-26 20:09:19 +00:00
Brooks Davis
521393ea56 Add a missing field to the end of array marker in the pci_ids array.
Submitted by:	sumikawa
2002-02-26 17:35:21 +00:00
Bruce Evans
fbd7573929 Initialize a variable bogusly to avoid a gcc bug that causes a spurious
warning.
2002-02-26 17:04:29 +00:00
Josef Karthauser
dae0af0c83 Revert part of the last commit. A couple of defines were removed
by NetBSD because they don't use them (they've no usbd), but we do.
2002-02-26 10:00:32 +00:00
Doug Ambrisko
c9977aaadf In ad-hoc mode, the "associate" bit is valid to check to see if it is
part of an ad-hoc network.  This means another station needs to be
around so they can both associate.

MFC after:	1 week
2002-02-26 05:43:05 +00:00
Warner Losh
476f923056 Until I can figure out how to live without the volatile qualifier on
comdefaultrate, comment out the support for machdep.conspeed for now.
2002-02-26 03:46:14 +00:00
Warner Losh
375b025257 Remove an unused variable. 2002-02-26 03:37:35 +00:00
Warner Losh
1efefb2d4d Fix warnings introduced in the PCI_ALLOW_UNSUPPORTED_IO_RANGE case. 2002-02-26 03:31:35 +00:00
Warner Losh
47f9536259 If we're going to ifdef out the only reference to asr_drvinit, then
go ahead and ifdef out the function too.
2002-02-26 03:22:44 +00:00
Warner Losh
96fc5a062e Add an experimental tunable: machdep.conspeed.
# I'm not sure where to document this.
2002-02-26 03:13:30 +00:00
Alfred Perlstein
6f65a2bd46 in ulpt_reset() req.bmRequestType was unitialized, fix it. 2002-02-26 01:19:56 +00:00
Josef Karthauser
648b06a6ed Merge from NetBSD:
usb.h (rev 1.61):

    date: 2002/01/01 14:23:37;  author: augustss;
    Add a missing subclass definition.

usb.h (rev 1.63) and usb_port.h (rev 1.52):

    date: 2002/02/25 00:46:37;  author: augustss;
    Some portability improvement.
    Add define for usb.h version.
2002-02-26 01:15:08 +00:00
Poul-Henning Kamp
cb877d0050 Add a new test_counter() function which tries to determine the width of
the inter-value histogram for 2000 samples.  If the width is 3 or less
for 10 consequtive samples, we trust the counter to be good, otherwise
we use the *_safe() method.

This method may be too strict, but the worst which can happen is that
we take the performance hit of the *_safe() method when we should not.

Make the *_safe() method more discriminating by mandating that the three
samples do not span more than 15 ticks on the counter.

Disable the PCI-ident based probing as a means to recognize good
counters.

Inspiration from:	dillon and msmith
2002-02-25 09:51:17 +00:00
Mike Smith
5da19f398a The thermal thread needs to take Giant before it does anything with the
interpreter.

Submitted by:	Magnus B{ckstr|m <b@etek.chalmers.se>
2002-02-25 02:21:22 +00:00
Matthew Dillon
d32e27a9f4 Tests by numerous people have shown that many chipsets do not properly
latch the acpi timer, resulting in weird deltas.  The problem is severe
enough to adversely effect the timecounter code.

Default to the 'safe' version of the get-timecount function.  The probe
will override it if a known-good chipset is found.  This is temporary
until a more complete solution is found.

Reviewed by:	phk
2002-02-24 22:58:15 +00:00
Søren Schmidt
acf7db1110 Finish phk's previous removal of BIO_ORDERED, all code that
depended on ATA_FLUSHCACHE_ON is now useless.
2002-02-24 12:28:24 +00:00
Dag-Erling Smørgrav
a0eed7bc1c Add a sysctl, sysctl hw.snd.report_soft_formats, that controls whether the
AIOGCAP ioctl reports software-emulated formats.  It defaults to on.  People
who use performance-sensitive audio software and do not want it to pick a
software-emulated audio format instead of one supported by their hardware
should turn it off.

This unbreaks isdnphone(1) on systems with PCM-only sound cards.

Approved by:	cg
2002-02-24 00:49:43 +00:00
Seigo Tanimura
f591779bb5 Lock struct pgrp, session and sigio.
New locks are:

- pgrpsess_lock which locks the whole pgrps and sessions,
- pg_mtx which protects the pgrp members, and
- s_mtx which protects the session members.

Please refer to sys/proc.h for the coverage of these locks.

Changes on the pgrp/session interface:

- pgfind() needs the pgrpsess_lock held.

- The caller of enterpgrp() is responsible to allocate a new pgrp and
  session.

- Call enterthispgrp() in order to enter an existing pgrp.

- pgsignal() requires a pgrp lock held.

Reviewed by:	jhb, alfred
Tested on:	cvsup.jp.FreeBSD.org
		(which is a quad-CPU machine running -current)
2002-02-23 11:12:57 +00:00
Mike Smith
222c49a4c7 AcpiOsPrintf and AcpiOsVprintf now return void. 2002-02-23 05:32:51 +00:00
Mike Smith
9232a543e6 AcpiOsCallocate is no longer required. 2002-02-23 05:32:10 +00:00
Mike Smith
72e5754cfb Match namespace cleanup changes in ACPI CA 20020217 update. 2002-02-23 05:31:38 +00:00
Mike Smith
dd5d65087b Add our own private defines for driver debug layers.
Obsolete the acpi_GetInto* interfaces.

Fix a typo to be less appropriate.
2002-02-23 05:30:54 +00:00
Mike Smith
1a6f2d2ab3 Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.

Convert to using a kthread rather than timeout() to avoid problems
with the interpreter sleeping.
2002-02-23 05:29:23 +00:00
Mike Smith
741ef403c2 Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.
2002-02-23 05:28:22 +00:00
Mike Smith
c1b1f7874c Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.

Use _ADR as well as _BBN to get our bus number.
2002-02-23 05:27:49 +00:00
Mike Smith
9127281c88 Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
2002-02-23 05:26:45 +00:00
Mike Smith
dbd0058a4e Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.

The ACPI global lock acquire takes a timeout value.  I'm not sure what
we should do about timeouts on it; a deadlock against this lock is
catastrophic.
2002-02-23 05:26:31 +00:00
Mike Smith
595a08978c Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.

Kill off the timeouts that used to read _BIF and _BST.  These are
invoked when the battery is actually read.  timeout() is dangerous
in combination with ACPI, as the interpreter can block.

This driver still needs more work.
2002-02-23 05:24:14 +00:00
Mike Smith
b53f277167 Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.

Add AcpiBatteryIsPresent helper to determine whether a battery device
is inserted.

Add ACPI_ALL_DRIVERS to the list of debug layers, now that we own the
namespace for this.

Pr:
2002-02-23 05:21:56 +00:00
Poul-Henning Kamp
6e47a4f646 Allow PCI_ALLOW_UNSUPPORTED_IO_RANGE to leave broken setups broken enough
to work.
2002-02-22 11:21:02 +00:00
Poul-Henning Kamp
af91f4fa16 GC: BIO_ORDERED going away. 2002-02-22 09:18:46 +00:00
Poul-Henning Kamp
817988be19 Disksort will not "munge" requests, BIO_ORDERED or not, so remove
use of BIO_ORDERED.
2002-02-22 09:14:06 +00:00
Matt Jacob
f553351ed2 Reorder some of the ioctls and add a few new ones.
MFC after:	1 day
2002-02-21 23:30:05 +00:00
Matt Jacob
014e78d18c Fix a problem where a local loop disk logs out- and we get a PORT LOGGED
OUT status. We are, apparently, required to force the f/w to log back in
if we want to try and talk to that disk again. This means either issuing
a LOGIN LOCAL LOOP PORT mailbox command, or by issuing a LIP. I've elected
to issue a LIP because this has a better chance of waking up the disk which
clearly just crashed and burned.

These should not occur at all. If they do, they should be darned rare.

MFC after:	1 week
2002-02-21 01:56:08 +00:00
Alfred Perlstein
5bcd0580d7 Prefix structure members to protect them against clashes with eg.
c++ keywords.

This keeps us in sync with NetBSD because they actually committed
my delta first.

Ok'd by: lennard
2002-02-20 20:47:21 +00:00
Julian Elischer
9308b7002c Cleanup of nmdm device 2002-02-20 20:13:13 +00:00
Brooks Davis
d24991caa8 Add missing m_free() so we actually drain the send buffer in monitor mode.
Submitted by:	Kenjiro Cho <kjc@csl.sony.co.jp>
2002-02-20 18:23:59 +00:00
Warner Losh
4d8f4de40e Check the status of the card bridge first thing, rather than last in
the loop.  This fixes the "my card is in the laptop on boot, but
doesn't attach" problem.
2002-02-20 16:20:27 +00:00
Takeshi Shibagaki
57ffbd6e54 Add u_int16 prodext value in CISTPL_MANF_ID. This gets a fifth byte
when manufacturer id tuple length is 5. This change is for xe driver.
This is a dirty hack. But there is no better idea.

Reviewd by: imp
2002-02-20 14:30:46 +00:00
Takeshi Shibagaki
16f27fa757 Update xe driver to probe and attach in a NEWCARD kernel.
And separate probe and attach routine for PC Card from if_xe.c
to if_xe_pccard.c.

Reviewed by: imp
2002-02-20 14:23:58 +00:00
Yoshihiro Takahashi
5aa967d922 Release allocated memory and bus_space_handle on an error.
Reviewed by:	jhay
2002-02-19 14:58:11 +00:00
Nick Hibma
dfe6efdcae Clean up some debugging output.
Add function to display the CBI command block.
2002-02-19 10:53:25 +00:00
Warner Losh
12b8c86eee Put the stard/end adjustments back. They are needed. Also make start
== 0 a special case.  I hope this fixes the real problem that phk and
others were seeing.
2002-02-19 07:05:22 +00:00
Warner Losh
b0fc3f6b1b o Count the number of mem and io spaces we allocate. If none work, bail out
o Add some better debugging code.
o Minor style(9) fixes.
2002-02-19 05:04:37 +00:00
Warner Losh
ab246934dc Do the cast away of unsignedness in a way that is more commprehensible. 2002-02-19 05:01:43 +00:00
Josef Karthauser
6f72be8e18 Merge from NetBSD:
* rev 1.47: Update a URL
* rev 1.56: Keep track of device speed for USB 2.0.
2002-02-19 02:00:27 +00:00
Alfred Perlstein
472cd8b5ef Add play (but not record) support for the Sis 7012.
Submitted by: Mike Meyer <mwm@mired.org>
2002-02-19 00:59:23 +00:00
Søren Schmidt
e6f71b525d Add support for the Highpoint HPT372 based cards (rocketraid 133).
HW Sponsored by: Mike Tancsa
2002-02-18 11:57:56 +00:00
Søren Schmidt
dc9395ae1f Fix the problem that some (in my book broken) disks reports
to be able to use 48bit addressing mode, but says the 48bit
size of the disk is 0, which according to spec means it can
address zero sectors in 48bit mode, why then say it supports
48bit mode at all..
2002-02-18 11:52:51 +00:00
Matt Jacob
d134aa0b20 More for f/w crash dumps (bug fixing and adding ioctl entry points
and hints to enable for specific units)

MFC after:	1 week
2002-02-18 00:00:34 +00:00
Josef Karthauser
a10b07e4ec Fix a formatting error. 2002-02-17 12:41:50 +00:00
Josef Karthauser
97e5881fe1 KNF style the code, ready for an MFC. 2002-02-17 12:29:39 +00:00
Josef Karthauser
1b262fd0c5 KNF style the code, ready for an MFC. 2002-02-17 11:58:58 +00:00
Yoshihiro Takahashi
9f67ccb7e5 Move the bus_space_subregion function from the puc driver to the bus_space
sutff.

Reviewed by:	jhay
2002-02-17 09:41:23 +00:00
Matt Jacob
b894188248 Support for f/w crash dumps (2200 && 23XX).
If you want QLogic to look at a potential f/w problem for FC cards, you really
have to provide them info in the format they expect. This involves dumping
a lot of hardware registers (> 300 16 bit registers) and a lot of SRAM
(> 128KB minimum). Thus all of this code is #ifdef protected which will
become an option so that the memory allocation of where to dump the crash
image is pretty expensive. It's worth it if you have a reproducible problem
because they have some tools that can tell them, given the f/w version,
the precise state of everything.

MFC after:	1 week
2002-02-17 06:38:22 +00:00
Matt Jacob
3f02619fb8 Hints for WWN are now WWNN and/or WWPN.
MFC after:	1 week
2002-02-17 06:34:21 +00:00
Matt Jacob
01ff579d86 Add in support firmware crash dumps. Change CFG options to split
WWN into WWNN and WWPN.

MFC after:	1 week
2002-02-17 06:32:58 +00:00
Warner Losh
c92e45e4a1 Bulk changes made during the BSDcon kernel summit and travel afterwards.
Appologies for making this one bulk commit, but I have tested all these
changes together and don't want to break anything by trying to disentangle
it.

o Make debugging a sysctl/tunable
o Remove flags word from yenta chip info, it is unused
o Make 16-bit card I/O range and 32-bit card I/O range tunables
o Start the rename of pccbb to cbb to match NetBSD by misc renames.
o Kill the now bogus list of softcs to create kthread.  Instead, just
  create the kthread in the attach routine.
o Remove sc_ from some structure names.  It isn't needed.
o Refine chipset lookup code.
o Match generic PCI <-> CardBus bridges.  We specifically don't generically
  match PCI PCMCIA bridges because they are not, with one exception, yenta
  devices.
o Add some comments about the why we need to have a function table ala
  OLDCARD
o The PCI interrupt routing by using the ExCA registers is needed for
  for all bridges, per the spec, not just TI ones.
o Collapse TOPIC95 and TOPIC95B.
o Using the ToPIC 97 and 100 datasheets, try to support these bridges better,
  but more work is needed.
o Generally clarify some XXX comments and add them in a few places where
  things didn't look right to me.
o Move interrupt generating register access until after we establish an ISR.
o Add support for YV and XV cards.  X and Y are numbers to be determined
  later (but maybe never).
o factor powerup code for 16-bit and 32-bit cards.
o When a card supports more than one voltage, prefer the lowest supported
  volage.  Windows does this, and MS's design guides imply this is the
  right thing to do.
o Document race between kthread_exit(0) and kldunload's unmapping of pages
  that John Baldwin and I discovered.
o Debounce the CSC interrupt a little better.
o When a 16-bit card is inserted when we don't have a pccard child,
  warn about it better.  Ditto for 32-bit card.
o Ack ALL the interrupt bits that we get, not just 0x1.
o maybe a couple minor style nits corrected.
2002-02-17 03:11:11 +00:00
Dag-Erling Smørgrav
7d8aca49fc I am sick of being told that "cstsevent occures". 2002-02-16 23:00:27 +00:00
John Hay
9c564b6c92 Add the puc (PCI "Universal" Communications) driver. The idea and some of
the structure definitions come from NetBSD to make it easier to share card
definitions. The driver only acts as a shim between the pci bus and the
sio driver. Later pci parallel ports could also be supported through this
driver. Support for most single and multiport pci serial cards should be
as simple as adding its definition to pucdata.c

Tested with the following pci cards:
Moxa Industio CP-114, 4 port RS-232,RS-422/485
Syba Tech Ltd. PCI-4S2P-550-ECP, 4 port RS-232 + 2 parallel ports
Netmos NM9835 PCI-2S-550, 2 port RS-232
2002-02-16 15:12:14 +00:00
Søren Schmidt
72afad5ba4 Dont try to attach ATA RAID's if none found. 2002-02-16 08:10:24 +00:00
Josef Karthauser
4d0649fbad Merge from NetBSD:
Pave the way for USB2, by replacing 'lowspeed' with 'speed', so
that it can take the values USB_SPEED_LOW, USB_SPEED_FULL or in
time USB_SPEED_HIGH.
2002-02-16 00:51:26 +00:00
Josef Karthauser
c67fd26e98 Re-add bmaj to the cdevsw's, but don't compile it in on -current.
This makes the code more portable between -current, -stable and the
other BSDs.
2002-02-15 22:54:10 +00:00
Bruce Evans
89f37afac5 #include "opt_compat.h" so that the support for old ioctls can actually
be compiled.  Old tty ioctls are still used (possibly ifdef'ed) in at
least the following programs in the src tree:
  atc des ee fontedit gdb gdbserver lock ntp perl5 tcsh telnet top vttest

rp.c:
Unremoved used variables so that the support for old ioctls actually
compiles.

Not tested at runtime by:	bde
2002-02-15 08:28:34 +00:00
Bruce Evans
1e9ea774c0 Added undocumented options AAC_DEBUG, ACD_DEBUG, ACPI_MAX_THREADS,
ACPI_NO_SEMAPHORES, ASR_MEASURE_PERFORMANCE, AST_DEBUG, ATAPI_DEBUG,
ATA_DEBUG, BKTR_ALLOC_PAGES, BROOKTREE_ALLOC_PAGES, CAPABILITIES,
COMPAT_SUNOS, CV_DEBUG, MAXFILES, METEOR_TEST_VIDEO, NDEVFSINO,
NDEVFSOVERFLOW, NETGRAPH_BRIDGE, NETSMB, NETSMBCRYPTO, PFIL_HOOKS,
SIMOS, SMBFS, VESA_DEBUG, VGA_DEBUG.

Start using #! to comment out negative options and ## to comment out
broken options.

atapi-all.c:
Fixed rotted bits that were hiding under ATAPI_DEBUG.

atapi-cd.c:
#include "opt_ata.h" so that ACD_DEBUG is actually visible.

ata/atapi-tape.c
#include "opt_ata.h" so that AST_DEBUG is actually visible.
2002-02-15 07:08:44 +00:00
Andrew Gallatin
9ffbfb248b Spell #if 0 correctly 2002-02-14 22:29:03 +00:00
Brian Feldman
d515a5410b Fix a bug introduced in rev.1.40 which can cause systems to crash when
detaching USB devices.  Specifically, a variable which was not meant
to be reused was, in fact, being reused.
2002-02-14 08:22:37 +00:00
Josef Karthauser
c0af27c95f Regenerate. 2002-02-14 03:03:08 +00:00
Josef Karthauser
09ecaa66fc Support the HP 5400C scanner.
PR:		kern/34783
2002-02-14 02:51:12 +00:00
Josef Karthauser
7dcd88f85f Rework revision 1.12, and wrap the bmaj entry with an #if doesn't
compile it in on FreeBSD-current, but does in all other cases
(-stable, NetBSD, OpenBSD, etc).
2002-02-14 00:35:03 +00:00
Josef Karthauser
d0d80d05a6 Reinstate revision 1.14. The empty uscannerioctl() was accidently
re-added during a recent NetBSD merge.
2002-02-14 00:32:03 +00:00
Prafulla Deuskar
a59716d2d8 - Added support for receive in multiple
descriptors. This simplifies code for jumbo frames.
- Cleaned up coding conventions to make code more unix-like.
- Cleaned up code in if_em_fxhw.c and if_em_phy.c.
  Added relevant comments.

MFC after:	1 week
2002-02-13 18:19:27 +00:00
Scott Long
0e6020f359 Add ID's for a couple of upcoming cards.
MFC after:	1 day
2002-02-13 07:44:43 +00:00
Brooks Davis
e2119ba50b Add support for the Linksys WMP-11, Prism 2.5, PCI adaptor.
Submitted by:	Thomas Skibo <skibo@pacbell.net>
MFC after:	2 weeks
2002-02-12 17:52:11 +00:00
Søren Schmidt
d99689e95c Add support for the Cenatek Rocket Drive. 2002-02-12 16:59:28 +00:00
Søren Schmidt
2c028bf06a Fix buglets in the ATAPI resume code.
This also fixes an old bug where some ATAPI devices went into
funny mode on an 'atacontrol reinit' command.
2002-02-12 13:21:51 +00:00
Søren Schmidt
e1605c6270 Major update of the ATA RAID code, part 2:
More cleanups of the RAID1 failure mode code.

Add functionality that writes the changed RAID config setup
back to the disks (in controller BIOS specific format), so
that a reboot will make the BIOS pick up the changed config.
2002-02-12 11:35:15 +00:00
Warner Losh
3fe83829bf Two fixes from Jonathan Hanna:
1) We shouldn't continue when we get a RX complete because we ack it
	   and the TX complete.
	2) Fix a couple of spl leaks
(why splbio is needed in ISR, I cannot understand).

MFC after: 3 days
2002-02-12 05:32:58 +00:00
Mike Smith
8046c4b998 Don't claim to have routed an interrupt when the method actually returned an
error.
2002-02-12 01:28:49 +00:00
Mike Silbersack
27d5f39f68 Remove mbuf exhaustion warning messages; these are handled by the
mbuf system in a rate-limited fashion now.

MFC after:	3 days
2002-02-11 23:38:30 +00:00
Mike Silbersack
a9e6a9792e Remove mbuf exhaustion warning messages; these are handled by the
mbuf system in a rate-limited fashion now.

MFC:	Already performed due to sloppiness.
2002-02-11 23:29:15 +00:00
Søren Schmidt
15641a2f41 Add support for the HighPoint HPT374 4 channel ATA chip.
Sponsored by: Isilon Systems.
2002-02-11 15:48:04 +00:00
Josef Karthauser
d740688b87 Fix some bugs in the ohci driver with respect to irq setup failure.
Submitted by:	nyan
2002-02-11 14:39:57 +00:00
Josef Karthauser
d41fcbf0d0 Merge from NetBSD: revs 1.89 and 1.90.
Also, add some 'const's to supress warnings. (Submitted back to NetBSD).

The original logs from NetBSD:

	----------------------------
	revision 1.90
	date: 2001/12/03 01:47:12;  author: augustss;  lines: +4 -4
	Handle vendor/product lookup with a common routine.
	----------------------------
	revision 1.89
	date: 2001/12/02 23:25:25;  author: augustss;  lines: +18 -2
	Add a subroutine to search for a vendor/product pair.
	----------------------------
2002-02-11 10:09:29 +00:00
Josef Karthauser
f2671fcf9f Regenerate. 2002-02-11 03:36:13 +00:00
Josef Karthauser
2097055fac Merge from NetBSD.
Add lots of new scanner devices:

	AGFA SNAPSCAN1236U
	AGFA SNAPSCANE40
	AGFA SNAPSCANE50
	AGFA SNAPSCANE20
	AGFA SNAPSCANE25
	AGFA SNAPSCANE26
	AGFA SNAPSCANE52
	CANON N656U
	HP 3400CSE
	SCANLOGIC 336CX
	MUSTEK BEARPAW1200F
	MUSTEK 600USB
	MUSTEK 1200USBPLUS
	NATIONAL BEARPAW2400
	EPSON 640U
	EPSON 1650
	EPSON GT9700F
	UMAX ASTRA3400
	ULTIMA 1200UBPLUS
2002-02-11 03:35:53 +00:00
Josef Karthauser
4f26a426ab Quiet a qualifier warning. 2002-02-11 03:29:35 +00:00
Josef Karthauser
ce3eae9093 Merge from NetBSD: revs 1.55 and 1.56
Original NetBSD logs:

	----------------------------
	revision 1.56
	date: 2001/12/03 01:47:12;  author: augustss;  lines: +5 -3
	Handle vendor/product lookup with a common routine.
	----------------------------
	revision 1.55
	date: 2001/12/02 23:25:25;  author: augustss;  lines: +8 -1
	Add a subroutine to search for a vendor/product pair.
	----------------------------
2002-02-11 03:15:08 +00:00
Josef Karthauser
50a56fbebd Merge from NetBSD: revs 1.12 and 1.21 - 1.23
Original NetBSD log messages are:

	----------------------------
	revision 1.23
	date: 2001/12/12 15:48:18;  author: augustss;  lines: +132 -114
	Add a scanner quirk for keeping the pipes open between device opening.
	Idea from Enami.
	----------------------------
	revision 1.22
	date: 2001/12/03 01:47:13;  author: augustss;  lines: +8 -16
	Handle vendor/product lookup with a common routine.
	----------------------------
	revision 1.21
	date: 2001/12/01 09:42:39;  author: enami;  lines: +4 -4
	Shorten wmesg so that they can be distinguished in ps/top output.
	----------------------------
	revision 1.12
	date: 2001/01/23 14:04:14;  author: augustss;  lines: +7 -1
	Make sure driver attach/detach events are generated in a
	consistent manner.
	----------------------------

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
2002-02-11 02:57:50 +00:00
Josef Karthauser
2c0634eab6 ANSIfy the function declarations, in line with NetBSD. 2002-02-11 02:25:47 +00:00
Josef Karthauser
d7b35d44a1 Merge from NetBSD: revs 1.43 + 1.45
From the NetBSD logs:

    revision 1.45
    date: 2001/11/29 11:07:12;  author: augustss;  state: Exp;  lines: +12 -2
    Plug a memory leak in an error case.
    ----------------------------
    revision 1.43
    date: 2001/10/19 15:30:25;  author: nathanw;  state: Exp;  lines: +5 -3
    Match printers that report their interface as IEEE 1284 in addition to
    bidirectional.
2002-02-11 01:04:46 +00:00
Poul-Henning Kamp
e087ce2dd2 Staticize the malloc definitions.
Obtained from:	~bde/sys.dif.gz
2002-02-10 21:42:44 +00:00
Josef Karthauser
f512ee4052 Fill in the uhci_dump_ii function (from NetBSD). 2002-02-10 15:38:47 +00:00
Warner Losh
fbf6f7f1d6 Null interrupt handlers should be OK, so if we don't have a function,
just return.
2002-02-10 05:04:20 +00:00
Warner Losh
27d4dd7420 o Use bus_generic_setup_intr instead of bus_setup_intr.
o Call bus_generic_setup_intr and check its return value.  Don't setup
  func until we successfully get the interrupt from our parent.
o Add comments about some maybe questionable stuff so I can check later
  to make sure that it really is that way.
2002-02-10 03:34:44 +00:00
Warner Losh
cebd67fba3 o Use INTR_TYPE_AV (the highest possible) rather than INTR_TYPE_BIO
o Don't allow INTR_TYPE_FAST.  Since we are sharing the interrupt between
  CSC and the functions, they can't be FAST because fast interrupts can't
  be shared.
o Add the same workaround for resume that we have in OLDCARD.
o Also, return the error from bus_generic_resume rather than ignoring it.
2002-02-10 03:28:37 +00:00
Warner Losh
5e0cb3e9d3 Boot verbosify printing the CIS, since we don't normally need to do that. 2002-02-09 21:34:06 +00:00
Warner Losh
344284854e Make unsupported memory range message bootverbose only 2002-02-09 21:32:02 +00:00
Warner Losh
d0036d6ebc Remove bogus range restrictions that attempted to restrict the range
of I/O in 1.5.  It looks like I got it right only for some of the
cases.  Instead, allow ISA addresses as a special case.  Most PCI
bridges decode this range.  I need to investigate PCI bridges better
to know if this is always true or not, but for now assume that it is
since that seems to be the most common case.

# We need to allocate addresses better for the pccard stuff...

Submitted by: phk, mitsunaga-san
2002-02-08 07:31:02 +00:00
Warner Losh
fd173deae3 Remove DETACH_NOWARN 2002-02-07 06:43:29 +00:00
Warner Losh
3799207059 Get rid of the bogus DETACH_NOWARN and don't warn when asked to detach
a card that isn't there unless we're booting verbose.  It serves no
purpose.
2002-02-07 06:43:02 +00:00
Julian Elischer
4ad88f2ca4 Make LINT compile after fruitless attempts to get the authors
to fix their code.

ata stuff:
Change name of ar_attach to not colide with existing ar_attach in if_ar.c.
usb stuff:
Create a dummy function to satisfy a call to it when in DEBUG mode.
2002-02-06 19:35:37 +00:00
Scott Long
fe94b852b3 Don't attach to Dell PERC2/QC cards that have a firmware rev of 1.x. This
check is complicated by the fact that the Adaptec 5400S cards claim to use
1.x firmware also.  PERC2/QC 1.x firmware is not compatible with this driver
and will cause a system hang.

MFC after:	3 days
2002-02-06 01:34:09 +00:00
Benno Rice
64eecf3a43 Correctly identify the Intel 82830 AGP bridge. 2002-02-05 23:13:25 +00:00
Thomas Gellekum
cc9f4eb939 Add support for the Aztech 2320 chip.
Reviewed by:	cg
Obtained from:	NetBSD (partly)
2002-02-05 12:09:23 +00:00
Seigo Tanimura
38b968c3a5 - Do not hang if the resource allocation fails.
- Add another quirk entry of SB AWE64.

PR:		kern/32530
Submitted by:	Magnus Backstrom <b@etek.chalmers.se>
2002-02-05 06:52:56 +00:00
Matthew Dillon
ecde8f7c29 Get rid of the twisted MFREE() macro entirely.
Reviewed by:	dg, bmilekic
MFC after:	3 days
2002-02-05 02:00:56 +00:00
Matt Jacob
75c1e828c0 + A variety of 23XX changes:
disable MWI on 2300

	based on function code, set an 'isp_port' for the 2312- it's a
	separate instance, but the NVRAM is shared, and the second port's
	NVRAM is at offset 256.

+ Enable RIO operation for LVD SCSI cards. This makes a *big* difference
as even under reasonable load we get batched completions of about 30
commands at a time on, say, an ISP1080.

+ Do 'continuation' mailbox commands- this allows us to specify a work
area within the softc and 'continue' repeated mailbox commands. This is
more or less on an ad hoc basis and is currently only used for firmware
loading (which f/w now loads substantially faster becuase the calling
thread is only woken when all the f/w words are loaded- not for each
one of the 40000 f/w words that gets loaded).

+ If we're about to return from isp_intr with a 'bogus interrupt' indication,
and we're not a 23XX card, check to see whether the semaphore register is
currently *2* (not *1* as it should be) and whether there's an async completion
sitting in outgoing mailbox0. This seems to capture cases of lost fast posting
and RIO interrupts that the 12160 && 1080 have been known to pump out under
extreme load (extreme, as in > 250 active commands).

+ FC_SCRATCH_ACQUIRE/FC_SCRATCH_RELEASE macros.

+ Endian correct swizzle/unswizzle of an ATIO2 that has a WWPN in it.

MFC after:	1 week
2002-02-04 21:04:25 +00:00
Søren Schmidt
6ddce9039b Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.

A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.

Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.

Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.

Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.

If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.

Misc fixes that I had lying around for various minor bugs.

Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
Warner Losh
a0e457a620 Default debugging to OFF now. 2002-02-04 15:55:21 +00:00
Yoshihiro Takahashi
8c84db8edd Supported C-NET(98)P2 PnP mode.
Submitted by:	"Hirokazu WATANABE" <gwna@geocities.co.jp>
MFC after:	3 days
2002-02-04 14:01:27 +00:00
Mike Silbersack
c9fbdd0fa4 Remove mbuf exhaustion warning messages; these are handled by the
mbuf system in a rate-limited fashion now.

Reviewed by:	luigi
MFC after:	1 week
2002-02-04 03:15:27 +00:00
Josef Karthauser
0a7fe9cc0b Follow NetBSD and ANSIfy the function definitions.
Remove trailing whitespaces (submitted to NetBSD).
2002-02-03 17:03:34 +00:00
Josef Karthauser
f353db9f9a Regenerate. 2002-02-02 21:12:22 +00:00
Josef Karthauser
8df3da9acc Update comments and product identifiers so that they're the same
as NetBSD's definitions.
2002-02-02 21:09:54 +00:00
Josef Karthauser
a342523198 Add some missing usb vendors (from NetBSD). 2002-02-02 21:02:13 +00:00
Josef Karthauser
c910612aa9 Sync with NetBSD's version, dropping all the 'ltd', 'corp', etc.
It's more important to keep this file easily syncable across the
BSDs, and NetBSD have stated a preference for not adding them to
theirs.
2002-02-02 20:59:43 +00:00
Bruce Evans
3230a24cb4 Merged cy_pcireg.h into the one file that uses it (cy_pci.c). 2002-02-02 02:22:51 +00:00
Bruce Evans
7e8c3cecdf Fixed breakage of interrupt setup in previous commit. It used an
uninitialized variable in the !CY_PCI_FASTINTR case (*blush*).
2002-02-02 02:05:44 +00:00
Alfred Perlstein
7b9214f0b0 identify GLPRISM2 PCI WaveLAN/IEEE 802.11
Submitted by: Toni Andjelkovic <toni@soth.at>
2002-01-31 16:55:13 +00:00
Maxim Sobolev
e6f56180e3 Add support of PhotoClip USB Camera (http://www.myphotoclip.com):
- Vendor&Device IDs for USB product,
- quirk for SCSI CAM.

PR:		34481
Submitted by:	Olexander Kunytsa <kunia@x-telecom.net>
MFC in:		3 days
2002-01-31 11:39:17 +00:00
Takanori Watanabe
85dff349f4 Fix irq/drq handling. IRQ and DRQ resource information can be get
in one object for one resource. Array of values in a object means
possible values for the object.
2002-01-31 09:18:27 +00:00
Yoshihiro Takahashi
9fdd7481ef Add pc98 support. 2002-01-31 08:24:36 +00:00
Yoshihiro Takahashi
c34cc16d46 Remove obsolete COMBRD* definitions. 2002-01-31 08:23:30 +00:00
Takanori Watanabe
f8372ade81 Fix error handling.
PR:30665
Submitted by:TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp>
2002-01-31 01:23:22 +00:00
John Hay
57019e6041 Add support for different serial clock frequencies and not just the
standard one of 1.8432MHz. This will be used by the puc (PCI
"universal" communication card) device driver.

Reviewed by:	bde
2002-01-30 17:22:04 +00:00
Warner Losh
a91e00697e Move cardaddr to memory structure.
Forgotten by: imp
Reminded by: Dave Cornejo
2002-01-29 16:57:50 +00:00
Warner Losh
2781c18f63 Add EDIMAX ethernet card for NEWCARD from NetBSD 2002-01-29 07:08:56 +00:00
Warner Losh
473a3d8520 Migrate towards using the new exca module for 16bit stuff. This is a
WIP, but works for me.

Also do some minor code factoring and code cleanup while I'm here.
2002-01-29 06:50:18 +00:00
Warner Losh
c3ee5891b9 First draft of common code between pccbb and pcic drivers for talking
to ExCA register sets.  These registers exist in both ISA and PCI
devices in a couple different ways, and this will provide a common
base for future building.  This code is a rehash of the pccbb 16-bit
code, which was a rehash of the pcic code, which was a rehash of the
netbsd i82365 code.  More hashing to come.
2002-01-29 06:48:38 +00:00
Warner Losh
fa3433e1db Minor sorting orders 2002-01-29 06:15:07 +00:00
Warner Losh
dadd95dbbe Sync to 1.27 of pccarddevs 2002-01-29 06:10:15 +00:00
Warner Losh
a3cc3a9e83 MFNetBSD:
1.159: sorting (not relevant to us, since I'd done thie before)
	1.158: joda; Ericsson PRISM2 WIRELEASS LAN CARD.
	1.157: aymeric Edimax Technology ethernet card
2002-01-29 06:09:39 +00:00
Greg Lehey
93bbd4c8da Grr. The last commit contained update conflicts. It just goes to
show that you should check the code even for a forced commit.

Spotted by:	dd
2002-01-29 02:49:15 +00:00
Greg Lehey
60fc37994f Forced commit. The previous commit log was garbled and didn't even
apply to this file.  The correct message is:

throw_rude_remark: Make sure we're holding the config lock before
                   proceeding.  There's no reason to assume that this
                   has ever happened, but the alternative might be a
                   double fault.
2002-01-29 02:14:51 +00:00
Søren Schmidt
684c972cd6 Add support for the Promise TX4.
Rearrange the support for the VIA chips, and add experimental
support for ATA133 on the newest chips.
2002-01-28 13:17:10 +00:00
Søren Schmidt
d2e812582d Add support for pccard.
submitted by: imp
2002-01-28 13:12:16 +00:00
Josef Karthauser
a07e9d4af3 Merge from NetBSD.
uhub.c:     revision 1.37
    usb.4:      revision 1.30
    usb.c:      revision 1.38
    usb.h:      revision 1.40
    usb_port.h: revision 1.21
    usb_subr.c: revision 1.65
    usbdi.h:    revision 1.40

Split the attach/detach events up into device, driver and controller
attach and detach events.

The commit message from NetBSD was:
        date: 2000/02/02 07:34:00;  author: augustss;  state: Exp;
        Change the USB event mechanism to include more information
        about devices and drivers.  Partly from FreeBSD.

Also rework usbd to take these new event types into account.
2002-01-28 01:03:19 +00:00
Scott Long
60d1d6861b Recent changes to newpcm require that the CHANNEL_SETFORMAT op return 0
for success, non-zero otherwise.  The maestro and maestro3 drivers were
returning the format code, which was being interpreted as a failure code.
Fixed.  No one seems to have noticed that the maestro driver was broken,
but I'll fix it anyways.

MFC after:	2 weeks
2002-01-27 23:09:41 +00:00
Greg Lehey
98912ee8cc vinumioctl: Fix a double fault caused by calling setjmp() without holding the config lock. The call was in fact superfluous. 2002-01-27 04:20:52 +00:00
John Polstra
586d7c2ef0 Add support for the Netgear GA302T 10/100/1000 adapter. Given that
it's a 32-bit card, it's quite nice for $75.

MFC after:	3 days
2002-01-27 01:00:16 +00:00
Cameron Grant
b8a3639565 * improve error handling
* be more specific in verbose boot messages
* allow the feeder subsystem to veto pcm* attaching if there is an error
  initialising the root feeder
* don't free/malloc a new tmpbuf when resizing a snd_dbuf to the same size as
  it currently is
* store the feeder description in the feeder structure instead of mallocing
  space for it
2002-01-26 22:13:24 +00:00
Josef Karthauser
67a2e47022 Rearrange the code in USB_DETACH, so that it's like NetBSD's. No
functional change.
2002-01-26 14:00:25 +00:00
Josef Karthauser
eb92aa3c3e Back out the last commit. I committed the wrong file by accident.
The commit message wasn't relevant to that change.  This code will
be committed later.
2002-01-26 13:57:08 +00:00
Josef Karthauser
7fac607b74 Rearrange the code in USB_DETACH, so that it's like NetBSD's.
No functional change.
2002-01-26 13:52:53 +00:00
Josef Karthauser
3d21044dd1 Update the $NetBSD$ ident. 2002-01-26 13:09:52 +00:00
Josef Karthauser
baf3f0817e Reduce the diffs between NetBSD and our version where appropriate
(comments, etc.)
2002-01-26 13:08:57 +00:00
Josef Karthauser
31c1f0005b Merge from NetBSD:
usb.c:	revision 1.39

	revision 1.39
	date: 2000/02/22 11:30:56;  author: augustss;  lines: +7 -1
	Prepare a little for having USB interrupt processing done
	outside the hard interrupt level (in a thread or a softintr).
	No real soft processing done yet.
2002-01-26 12:48:57 +00:00
Josef Karthauser
29ac7b3190 Merge from NetBSD:
usb.c:	revision 1.41

	revision 1.41
	date: 2000/03/16 00:46:38;  author: augustss;  lines: +2 -2
	Make the USB event queue longer.  Mine overflows before the
	(user-land) event handler has started.  But then I have
	about 25 devices connected. :)
2002-01-26 12:40:03 +00:00
Josef Karthauser
c2e0959f73 Update the $NetBSD$ ident to show that some patches have been applied
in the past.
2002-01-26 12:25:32 +00:00
Josef Karthauser
b7e4eb198d Merge from NetBSD:
ohci.c:	revision 1.72 and 1.73
    ohcivar.h:	revision 1.19 and 1.20
    uhci.c:	revision 1.85
    usbdi.h:	a small part of revision 1.40
    usbdivar.h:	revision 1.47

Relevant commit messages from NetBSD are:

	date: 2000/02/22 11:30:54;  author: augustss;  state: Exp;
	Prepare a little for having USB interrupt processing done
	outside the hard interrupt level (in a thread or a softintr).
	No real soft processing done yet.
	----------------------------
	date: 2000/02/01 05:42:53;  author: augustss;  state: Exp;
	Put some #ifdefs around power and shutdown hooks.
2002-01-26 12:04:22 +00:00
Scott Long
436c9b651a Fix code that had rotted behind debugging macros.
Approved by:	cg (in principle)
MFC after:	2 weeks
2002-01-25 04:14:12 +00:00
Cameron Grant
be27d718c0 a buffer offset equal to the buffer size is illegal too, fix assertion in
sndbuf_getbufofs()
2002-01-25 02:39:34 +00:00
Cameron Grant
f8db81f347 cosmetic change, free b instead of c->bufhard for consistency within
chn_kill()
2002-01-25 02:36:22 +00:00
Josef Karthauser
46d0cbc2cd Merge from NetBSD:
usb.c:	-r1.35 - 1.37
    usb_port.h:	tiny bit of -r1.26 + an extra bit in the FreeBSD config section.

	revision 1.37
	date: 2000/01/24 18:35:51;  author: thorpej;  state: Exp;  lines: +7 -1
	Use config_pending.
	----------------------------
	revision 1.36
	date: 1999/12/22 23:54:09;  author: augustss;  state: Exp;  lines: +2 -2
	Use the flags `locator' to govern if devices are detected early or
	late during cold boot.
	----------------------------
	revision 1.35
	date: 1999/12/20 02:12:23;  author: augustss;  state: Exp;  lines: +8 -5
	Make sure tsleep() is not called during cold boot.
2002-01-24 20:21:17 +00:00
Guido van Rooij
a3e5380a47 1) Fix a debug statement by filling in its data before the printf in
stead of after
2) Honour NO_TEST_UNIT_READY quirk for atapi devices as well
3) Actually support FujiFilm FinePix 6800 camera's. Will very likely also
work for other FinePix models.

Based on a debug session about half a year ago with Nik Hibma.
MFC after:	2 weeks
2002-01-24 15:10:53 +00:00
Matt Jacob
d9f1ea7b2b Roll to latest production level firmware.
MFC after:	1 day
2002-01-23 06:42:54 +00:00
Cameron Grant
4c68642adb improve sndstat output of feederchains so it can be understood without
reading the feeder sourcecode
2002-01-23 06:02:15 +00:00
Cameron Grant
4e60be3473 print warnings if a pcm*.buffersize hint is out of range or a non-power-of-2 2002-01-23 05:49:41 +00:00
Cameron Grant
23bc171b29 fix some comments accidentally hit by search/replace several revisions ago 2002-01-23 05:41:35 +00:00
Cameron Grant
0dd4f3508e set the speeds the right way round for recording using the rate feeder 2002-01-23 05:35:12 +00:00
Cameron Grant
1e59d53c22 add more error checking in chn_init() and chn_reset() 2002-01-23 05:21:27 +00:00
Cameron Grant
79e6a82b48 make the feederchain builder work for recording. this has not been tested
extensively as none of my testboxes have speakers or an audio source at
present, but the chains built look correct and reading /dev/audio (ulaw,
translated from signed 16 bit little-endian) gives values within the
expected range for silence.
2002-01-23 05:10:56 +00:00
Cameron Grant
f6126456ef don't bother checking if an unsigned parameter is less than 0 in a KASSERT 2002-01-23 04:50:51 +00:00
Cameron Grant
095159ecd1 add more error checking to open of /dev/dsp* and /dev/audio* - if the
default format for the chosen subdevice cannot be obtained return an error
instead of returning success with an indeteterminate format selected.

note that this should never happen once the feederchain builder works for
recording.
2002-01-23 04:44:03 +00:00
Cameron Grant
1c72c53f4e don't allow mmap beyond the end of the buffer
Submitted by:	Philippe Anel <philippe.anel@noos.fr> (partially)
2002-01-23 04:32:18 +00:00
Wes Peters
ce6d929bb5 Add missing destroy_dev().
Submitted by:	Maxime Henrion <mux@sneakerz.org>
Reviewed by:	msmith@
MFC after:	3 weeks
2002-01-23 01:11:52 +00:00
Jonathan Lemon
a1a9c8f7e6 Initialize the sysctl_ctx list early, which avoids a panic in case other
allocatiosn fail and fxp_release() is called.
2002-01-22 17:51:44 +00:00
Poul-Henning Kamp
3ca627fefa Gah! last commit botched indentation, fix indentation and some other
white-space nits while at it.
2002-01-21 20:57:03 +00:00
Poul-Henning Kamp
b4a4f93c5e Restructure slightly, eliminating some repetitive source lines and
making GEOM patches simpler and more readable at the same time.
2002-01-21 20:50:06 +00:00
Josef Karthauser
c3da78970e Merge from NetBSD:
ohci.c:	-r1.69 to 1.71
    ohcireg.h:	-r1.14

Some of these deltas are based upon patches that we submitted back to
NetBSD.  They got manifested slightly differently though, so I've brought
back those differences to bring our code bases closer together.

The logs from the NetBSD version of ohci.c:

	revision 1.71
	date: 2000/02/01 05:42:52;  author: augustss;  state: Exp;  lines: +13 -2
	Put some #ifdefs around power and shutdown hooks.
	----------------------------
	revision 1.70
	date: 2000/01/31 22:35:13;  author: augustss;  state: Exp;  lines: +7 -7
	Rename TAILMASK to HEADMASK, since it really masks the head pointer.
	From FreeBSD.
	----------------------------
	revision 1.69
	date: 2000/01/31 22:09:13;  author: augustss;  state: Exp;  lines: +18 -14
	Change where the has table for physical-to-virtual address translation
	is handled.  Partly from FreeBSD.
2002-01-21 05:02:21 +00:00
Josef Karthauser
851522be27 Merge from NetBSD:
ohci.c:	-r1.68
    ohcireg.h:	-r1.13

	date: 2000/01/31 20:17:25;  author: augustss;  state: Exp;
	Fiddle with over-current protect when turning on port power to make
	things work for some OHCI controllers.
2002-01-21 04:24:33 +00:00
Josef Karthauser
3bedcae34f Merge from NetBSD:
revision 1.65
	date: 2000/01/25 12:06:21;  author: augustss;  state: Exp;  lines: +10 -2
	Add done method for root control transfers.
2002-01-21 04:15:39 +00:00
Josef Karthauser
4cd5d8f292 Merge from NetBSD:
revision 1.84
	date: 2000/01/28 00:44:27;  author: augustss;  state: Exp;  lines: +9 -2
	Add uhci_root_ctrl_done() method.
2002-01-21 03:44:00 +00:00
Josef Karthauser
ed98caba5f Merge from NetBSD:
uhci.c:	-r1.82
    uhcivar.h:	-r1.22

	date: 2000/01/26 10:04:39;  author: augustss;  state: Exp;
	Try to avoid accessing the HC if it is dead.  Suggested by mycroft.
2002-01-21 03:35:55 +00:00
Brooks Davis
01b8b9e983 Add support for Linksys WDT11 PCI adaptors.
Submitted by:	Eric Liedtke <eliedtke@apogeetelecom.com>
2002-01-21 00:59:59 +00:00
Josef Karthauser
a87935da55 Remove some unused code, in line with NetBSD's version. 2002-01-20 23:56:46 +00:00
Josef Karthauser
aeab0647e8 Merge from NetBSD:
revision 1.125
	date: 2000/09/23 21:00:10;  author: augustss;  state: Exp;  lines: +19 -3
	Avoid "bandwidth reclamation" for control transfers.  The kue device chokes
	on it.
2002-01-20 23:48:43 +00:00
Josef Karthauser
519461f843 Merge from NetBSD:
uhci.c:	-r1.124
    uhcireg.h:	-r1.13

	date: 2000/08/13 18:20:14;  author: augustss;  state: Exp;
	Fix race condition when unlinking xfers.  Thanks to IWAMOTO Toshihiro
	<iwamoto@sat.t.u-tokyo.ac.jp> for analyzing the problem and suggesting a fix.
	Fixes PR 10662.
2002-01-20 23:38:33 +00:00
Josef Karthauser
8e65c31988 Merge from NetBSD:
uhci.c:	-r1.123 (and a tiny bit of -r1.92)
    uhcivar.h:	-r1.32

	date: 2000/08/13 16:18:09;  author: augustss;  state: Exp;
	Implement what in Intel-speech is known as "bandwidth
	reclamation".  It means that we continously poll USB devices
	that have a pending transfer instead of polling just once
	every ms.  This speeds up some transfers at the expense of
	using more PCI bandwidth.
2002-01-20 20:12:25 +00:00
Josef Karthauser
a353e14e75 Merge from NetBSD:
uchireg.h:	-r1.12
    uchi.c:	-r1.121

    date: 2000/07/23 19:43:38;  author: augustss;  state: Exp;
    Be a little more explicit and careful about setting links in TDs and QHs.
2002-01-20 12:08:09 +00:00
Mike Smith
a245737c51 Add the 'iir' driver, for the Intel Integrated RAID controllers and
prior ICP Vortex models.  This driver was developed by Achim Leubner
of Intel (previously with ICP Vortex) and Boji Kannanthanam of Intel.

Submitted by:	"Kannanthanam, Boji T" <boji.t.kannanthanam@intel.com>
MFC after:	2 weeks
2002-01-20 08:51:08 +00:00
Orion Hodson
bd8e0aee01 Change ich_calibrate to busy wait on buffer fill level and use a more
likely looking rate calculation.

Install interrupt handler before calling ich_init as the initialization
occasionally generates spurious interrupts.

These changes are derived from cg's work in progress version of this
driver.
2002-01-18 18:44:41 +00:00
Joerg Wunsch
31f639ecdf Back out the hack from rev 1.13 that was done to initiate a bus rescan
at insert time.  When asking gibbs for approval for an MFC, this was
his reply:

1) It leaks memory if it can't allocate a path.

2) It defers allocation of aic->path until the call to scan the
   bus.  This means the path may be NULL when an interrupt occurs
   prior to the call to scan the bus (stray bus reset for instance),
   which will lead to a panic.

3) The driver in current doesn't recover from the failure to allocate
   aic->path.  The driver doesn't check during normal operation if
   the path is NULL, so again a panic will result.

4) aic_cam_rescan calls malloc with M_WAITOK.  aic_cam_rescan is called
   from attach where it isn't necessarily safe to sleep.

5) And most importantly, it co-opts the xpt_periph from the driver level.
   This was never part of the design (xpt_periph used to be static).  Making
   a call of this type may completely confuse the XPT if other XPT operations
   are ongoing.

In the long term, Justin and Warner agreed to implement solution where
CAM itself will initiate the bus rescan if a new bus is added.  For
the time being (and in particular in light of the upcoming 4.5
release), we now have camcontrol available on the boot floppy, and can
have pccardd initiate the rescan through it.
2002-01-17 20:34:58 +00:00
Bruce A. Mah
7f04152a10 Cosmetic fix: Not every machine that uses the sio driver has a BIOS.
Pointed out by:	imp
2002-01-17 20:05:47 +00:00
Warner Losh
ba24c8d971 While I'm not sure that I like the wording of the BIOS message in the
previous commit, it should always print due to lack of {} around the
second line in the if statement.  The message should likely say
something more like "There's no hardware responding at this IRQ.
Device not present (or disbaled)," but that is too long.  We generally
don't give elementary advise in device driver messages anyway.  Be
that as it may, the problem with it printing all the time should be
corrected.
2002-01-17 16:16:51 +00:00
Bruce A. Mah
ea9e3e8f9b Make sio device probe messages less misleading, for the case that
a port is either disabled or not responding.

PR:		33963
Submitted by:	Kevin Oberman <oberman@es.net>
MFC after:	2 weeks
2002-01-17 06:21:45 +00:00
Doug Ambrisko
45fe21a0a2 Forgot one part of the VLAN support for the dc(4) driver.
Pointed out by: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
2002-01-16 21:34:11 +00:00
Doug Ambrisko
db40c1aef4 Add VLAN for the dc(4) driver (ie long frame). The patch is 2 parts.
One to notify the system that the MTU for VLAN can be 1500 so the vlan
will automatically be configured with a 1500 MTU the other is to ignore
the error case if the received frame is to long.

The frame size notification came from code in the SIS driver, and
the support for long frames derived from the NetBSD Tulip driver.

Tested on:	4 port D-Link adapter DFE-570TX 4 Intel 21143
		Netgear card with 82c169 PNIC 10/100BaseTX

Reviewed by:	ru (manpage), wpaul (not objected to), archie
Approved by:	imp
Obtained from:	NetBSD
2002-01-16 16:33:58 +00:00
Warner Losh
5d4be85d55 better namespsace of static functions 2002-01-15 20:41:39 +00:00
Warner Losh
2bef11b863 o Sync the device list with OLDCARD.
o Remove bogus flags that aren't used (if we need them in the future, we can
  add them back).
o Add support for the TI-1031.  This is the only YENTA compatible PCI-PCMCIA
  bridge that I'm aware of (all the others are PCIC on a PCI bus, which is
  different).
2002-01-15 20:21:43 +00:00
Warner Losh
7a852c22ce Make PCI_ALLOW_UNSUPPORTED_IO_RANGE an option until the ISA address
problem is fixed at the bridge level.  This is needed for some newer
laptops that have the cardbus bridge not on pci0.
2002-01-15 06:46:59 +00:00
Warner Losh
6015f06948 use bus_space(9) rather than the memory mapped register set. This is
the first step towrads merging pcic and pccbb for 16-bit cards.
2002-01-14 02:59:06 +00:00
Alfred Perlstein
a4db49537b Replace ffind_* with fget calls.
Make fget MPsafe.

Make fgetvp and fgetsock use the fget subsystem to reduce code bloat.

Push giant down in fpathconf().
2002-01-14 00:13:45 +00:00
Alfred Perlstein
9e209b124a Include sys/_lock.h and sys/_mutex.h to reduce namespace pollution.
Requested by: jhb
2002-01-13 21:37:49 +00:00
Alfred Perlstein
426da3bcfb SMP Lock struct file, filedesc and the global file list.
Seigo Tanimura (tanimura) posted the initial delta.

I've polished it quite a bit reducing the need for locking and
adapting it for KSE.

Locks:

1 mutex in each filedesc
   protects all the fields.
   protects "struct file" initialization, while a struct file
     is being changed from &badfileops -> &pipeops or something
     the filedesc should be locked.

1 mutex in each struct file
   protects the refcount fields.
   doesn't protect anything else.
   the flags used for garbage collection have been moved to
     f_gcflag which was the FILLER short, this doesn't need
     locking because the garbage collection is a single threaded
     container.
  could likely be made to use a pool mutex.

1 sx lock for the global filelist.

struct file *	fhold(struct file *fp);
        /* increments reference count on a file */

struct file *	fhold_locked(struct file *fp);
        /* like fhold but expects file to locked */

struct file *	ffind_hold(struct thread *, int fd);
        /* finds the struct file in thread, adds one reference and
                returns it unlocked */

struct file *	ffind_lock(struct thread *, int fd);
        /* ffind_hold, but returns file locked */

I still have to smp-safe the fget cruft, I'll get to that asap.
2002-01-13 11:58:06 +00:00
Matt Jacob
975284da32 Add missing move of relative offset for CTIO2 updates. 2002-01-11 23:48:25 +00:00
Archie Cobbs
4fc53c229d Fix reversed definitions for the bits that select half vs. full duplex.
Submitted by:	Darren Croke <djc@packetdesign.com>
2002-01-10 18:06:41 +00:00
Matthew N. Dodd
ced8202c20 Implement 2 small helper functions:
pci_find_bsf() - Find a device_t by bus/slot/function.
	pci_find_device() - Find a device_t by vendor/device ID.
2002-01-10 00:56:02 +00:00
Mike Smith
5390e1bc8f Staticise the random_state array.
Reviewed by:	markm
2002-01-10 00:09:21 +00:00
Jake Burkholder
47a1c91514 Move the make_dev call from the cn_probe to a sysinit that runs at
SI_SUB_DRIVERS.  cnprobe is too early.
2002-01-09 04:03:55 +00:00
Mike Smith
e45bef2aa9 Staticise the aac devclass. 2002-01-09 03:32:40 +00:00
Warner Losh
7be18016b5 Regenerate from 1.26 pccarddevs 2002-01-08 20:52:57 +00:00
Warner Losh
e5c51b0548 Catch up to NetBSD:
1.156 pooka; Socket Low-Power CF WLAN
	1.155 ichiro; IBM Smart Capture Card II
	1.152-154 ichiro; Fujitsu CF EtherCard and FMV-181,182,182A
	1.151 christos; Symbol Spectrum24
2002-01-08 20:52:23 +00:00
Max Khon
eda6ecb22a - generic Arcnet framework
- device driver for SMC COM90cx6 Arcnet network adapters

Obtained from:	NetBSD
2002-01-08 20:03:13 +00:00
Mike Smith
1dd003ecf4 Staticise a couple of debugging variables. 2002-01-08 19:37:12 +00:00
Mike Smith
8265abbd64 Rename a variable that might accidentally be duplicated elsewhere. 2002-01-08 19:36:54 +00:00
Mike Smith
b6b6d662bc find_devclass -> devclass_find. 2002-01-08 19:14:59 +00:00
Warner Losh
94663a748c Revert change that breaks the joy module. joydevclass must not be static. 2002-01-08 18:27:49 +00:00
Josef Karthauser
46c8c4207d Staticise a couple of things that shouldn't be leaked into the
kernel namespace.

Submitted by:	msmith
2002-01-08 10:32:33 +00:00
Mike Smith
fe5d4a9fac Staticise the flash buffer, since it isn't needed anywhere else. 2002-01-08 10:25:12 +00:00
Mike Smith
172f13eb36 Staticise the con_bios and digi_devclass variables, since they aren't needed
by anything else.
2002-01-08 10:24:34 +00:00
Mike Smith
5b48f71694 Staticise the device node pointers. 2002-01-08 06:50:17 +00:00
Mike Smith
489da1e76a Staticise the joy devclass. 2002-01-08 06:49:06 +00:00