Commit Graph

8638 Commits

Author SHA1 Message Date
Martin Blapp
e808cf6260 When reading PHY regs over the i2c bus, the turnaround ACK bit
is read one clock edge too late. This bit is driven low by
slave (as any other input data bits from slave) when the clock
is LOW. The current code did read the bit after the clock was
driven high again.

Reviewed by:	luoqi
MFC after:	2 weeks
2003-01-10 08:09:58 +00:00
Warner Losh
948c244d94 Add preliminary support for the Hawking PN672TX CardBus cards.
# Preliminary because there are some subtle things the NetBSD driver does
# that we don't do yet.  My card works for me w/o them.
2003-01-10 05:37:15 +00:00
Eric Moore
d163d5b8c8 Fix for DELL PERC firmware. Driver was hanging
during load time; this attributed to the mailbox
busy byte not being set prior to issuing a
polling command.

Approved by: ps
MFC: 7 days
2003-01-09 21:02:28 +00:00
Tom Rhodes
38deb45fc3 Add support for the Davicom DM9009 chipset.
PR:		46859
Submitted by:	Boaz Haberman <boaz@ool-182f8b09.dyn.optonline.net>
Approved by:	rwatson
2003-01-09 20:51:39 +00:00
Søren Schmidt
610e02649a Dont probe PnP devices.
Submitted by: Takahashi Yoshihiro <nyan@FreeBSD.org>
2003-01-09 14:00:07 +00:00
Søren Schmidt
2768d40bf1 Fix typo
PR: 45375
2003-01-09 13:54:07 +00:00
Hidetoshi Shimokawa
435dd29b27 - Add error messages for bulkxfer.
- Reduce register access.
2003-01-09 10:25:07 +00:00
Warner Losh
52b019b3ed Merge from NetBSD and arrange for FreeBSD's slight differences in
ucom.

This gets my Sanyo SCP-4900 working.

Approved by: joe
2003-01-09 04:24:28 +00:00
Thomas Moestl
a0de7a9e73 Add detach, shutdown, suspend and resume methods.
Tested by:	jake
2003-01-09 00:45:10 +00:00
Jake Burkholder
6bfa8a2ef2 Split this into bus specific front end(s), so that it can be used by ppc.
This abstracts out all the differences I could see between the netbsd
sparc64 and macppc zs drivers.   In particular the offsets of the csr and
data registers are different, so we use a separate bus handle for each and
use bus_space_subregion to add the bus specific offsets.

Requested by:	benno
2003-01-08 23:36:16 +00:00
Thomas Moestl
cbbdf2367e Add detach, shutdown, suspend and resume methods. The latter two are
not really tested, but are derived from the original NetBSD version.
2003-01-08 20:12:45 +00:00
David E. O'Brien
ae5c9e57b8 Fix module dependancy name.
PR:		46871
Submitted by:	Hartmut Brandt <brandt@fokus.gmd.de>
2003-01-08 18:53:38 +00:00
Søren Schmidt
fb02f8eeb8 Dont attach a Promise chip located behind a i960 bridge/chip.
This makes it possible to run a Promise SuperTrak SX6000 with
OS type set to "Other" as well as "Linux".
2003-01-08 17:44:36 +00:00
Søren Schmidt
4b4f97ae4c Add support for the nVidia nForce2 ATA part.
Fix support for the nForce1 as well, registers are offset 0x10
against the AMD/VIA parts.
2003-01-08 16:51:41 +00:00
Søren Schmidt
837832bc18 Add code that works around the problem that the older Promise
controllers (ultra/fasttrak-66/100) fails on 48bit accesses.
2003-01-08 10:03:31 +00:00
Scott Long
adb0a47475 Destroy the management device when detaching the driver. 2003-01-08 06:30:34 +00:00
Matthew N. Dodd
dd815daba5 - Add acpi module binding.
- Restore speed and format settings on resume for CS423x and
  CS423x-PCI devices.
2003-01-08 06:24:25 +00:00
David Xu
ce5c58974a Retry to get full device descriptor, this let my slow CD Tower device work. 2003-01-08 05:03:35 +00:00
Jake Burkholder
a6517875d0 Use bus_space_subregion to add offsets to bus handles instead of doing
it manually.
2003-01-08 04:30:30 +00:00
Prafulla Deuskar
bddfcc8792 The README refers to a LICENSE file, so add that file too.
BTW the license is also embedded in the source files.

MFC after:	1 day
2003-01-07 19:36:00 +00:00
Hidetoshi Shimokawa
9a7d0adfaa - Fix print format for FreeBSD-4
- Reduce debug message.
2003-01-07 12:58:08 +00:00
Hidetoshi Shimokawa
64666ed6e7 Don't call fw_bus_probe() twice when successive self-id packets received.
This change should stabilize SBP-II device probing.
2003-01-07 04:26:45 +00:00
John Polstra
029e2ee3ee Put the ASIC revision into the device description string so it appears
in the dmesg output.

MFC after:	3 days
2003-01-07 01:33:03 +00:00
John Polstra
671116122b Don't reference the maxlen and flags fields in the ring control blocks
as separate 16-bit entities.  Some of the ring control blocks are
in NIC memory, so they must be referenced using 32-bit accesses.
Smaller accesses have been observed to fail under some conditions.
This caused the rings to be set up wrong, leading to writes by the
card outside of the intended bounds of the rings.  This problem was
diagnosed by Michael Barthelow.  Don Bowman submitted a patch which
fixed the problem using a slightly different approach.

Reference ring control blocks in NIC memory using a pointer to
volatile.

Parenthesize the BGE_HOSTADDR macro definition properly.

MFC after:	3 days
2003-01-06 23:46:47 +00:00
Thomas Moestl
195530b9dd Convert to use bus_dmamap_load_mbuf(); decouple software TX descriptors
from the hardware descriptors to avoid the overhead of having a DMA
map for each of them. Bump the number of hardware descriptors to 128,
and use half as many software descriptors for now.
Some minor cleanups.
2003-01-06 22:12:57 +00:00
Thomas Moestl
305f2c0632 - Convert to use bus_dmamap_load_mbuf().
- remove DPRINTF(), there is a CTR*() for any of them, and KTR is
  far more useful to debug this driver.
- some cleanups; remove some unused code and definitions.
2003-01-06 22:09:01 +00:00
Sam Leffler
45a0c8fe56 fix memory allocation problems and collateral damage:
o create a separate tag for each object allocated with bus_dmamem_alloc so
  the tag's maxsize is setup appropriately; this reduces memory allocation
  for the queue descriptors from 16M to what it should be and also fixes
  memory allocation for public key operands
o release bus dma resources on detach so module usage doesn't leak
o remove public key op disable now that bus dma memory allocation is fixed
o collect attach error handling in one place

Sponsored by:	Vernier Networks
2003-01-06 21:23:06 +00:00
Hidetoshi Shimokawa
17faeefca6 Use device_printf() and s/fc->dev/fc->bdev/. 2003-01-06 08:07:20 +00:00
Hidetoshi Shimokawa
9bfd777adb Fix fc->dev to fc->bdev. 2003-01-06 05:57:48 +00:00
Mike Barcroft
51afc2ad43 Avoid casting pointers to int and using %x to print them.
Noticed by:	alpha tinderbox
2003-01-05 16:23:49 +00:00
Hidetoshi Shimokawa
a423957600 Reduce diff to RELENG_4. 2003-01-05 14:58:45 +00:00
Hidetoshi Shimokawa
bda19384a1 Syntax fix in fwohci_pci_suspend(). 2003-01-05 09:12:47 +00:00
Brian Feldman
a8be3e63ce Fix the duplicate unlock of the pcm read channel in certain cases.
Reviewed by:	cg
2003-01-05 07:32:33 +00:00
Hidetoshi Shimokawa
94b6f028fd - Change definition of fc->maxrec same as fwdev->maxrec.
- 'spec' and 'ver' are attributes of a unit rather than a node.
- Report Phy and Link info separatelly.
- Reorder intialization step in fwohci_reset().
2003-01-05 06:21:30 +00:00
Jake Burkholder
a720ae1bbe Sync with zs.
- Fix some bogosity with mixing unit numbers and channels, which would only
  work for one instance of the device.
- Use a simpler scheme for input and output queueing.
- Use db_alt_break.
2003-01-05 04:07:31 +00:00
Hidetoshi Shimokawa
bce5729a9d - Remove speed_map API because speed_map is obsoleted by 1394a.
- Add definition of OHCI_HCC_BIBIV in fwohcireg.h.
2003-01-04 16:03:50 +00:00
Hidetoshi Shimokawa
7ddbf617b1 - Handle zero sized directory right way.
- Staticize.
2003-01-04 10:32:31 +00:00
Hidetoshi Shimokawa
d6105b602c - Replace printf() with device_printf().
- Separate fc->dev (i.e. fwohci0) and fc->bdev (i.e. firewire0).
- Remove unused firewirebusreg.h.
- Reduce size of descriptor block for asynchronous transmit and
	check the number of descriptor when copying from mbuf.
- Skip mbuf whose length is zero. NFS seems passing such mbuf and
	some chips generates unrecoverable error.
2003-01-04 10:21:11 +00:00
Hidetoshi Shimokawa
9339321d89 - Propagate suspend/resume to child devices.
- Restore pci config registers after resume.
- Reinitialize and start rx buffers after resume.
- Don't reallocate memory in fwohci_db_init() if the dbch is
	already initialized.
- Fix typo.
- Some clean up.
2003-01-04 06:40:57 +00:00
Poul-Henning Kamp
f05f44f0f2 Remove CCDF_SWAP and CCDF_PARITY, they have never been implemented. 2003-01-03 08:57:40 +00:00
Poul-Henning Kamp
e2a3ea1c45 Remove unused second argument from DEV_STRATEGY(). 2003-01-03 05:57:35 +00:00
Poul-Henning Kamp
d616ee081f Remove unused second argument from BIO_STRATEGY() 2003-01-03 05:51:11 +00:00
Jake Burkholder
777cc88b9d - This damnable chip only has 1 status register for both ports, so the bit
positions for the status bits of port a and port b are different.  To
  avoid needing to know which channel the interrupt handler is working on,
  shift the status bits for port a into the port b bit positions, and always
  check the port b status bits.  This fixes using port b, which I neglected
  to test before.
- Remember to update the channel's tty structure from the passed in termios
  in the param routine.
- Minor style.
2003-01-02 19:04:35 +00:00
Warner Losh
3225a9881d Update to correct NetBSD Id 2003-01-02 04:22:44 +00:00
Matt Jacob
76514802bd Make compiles (LINT and/or ISP_TARGET_MODE options) happier by making sure
printf type format args and actual args match.

Reviewed by:	Sam Leffler <sam@errno.com>
2003-01-02 04:21:52 +00:00
Warner Losh
d77b690ff6 Sync to 1.104 of usbdevs 2003-01-02 04:21:38 +00:00
Warner Losh
cb33fc95b9 Add NEODIO TURBOCONNECT (from NetBSD) 2003-01-02 04:21:04 +00:00
Warner Losh
1732632481 MFNetBSD through 1.42 (to be committed in a moment by me).
o Whitespace nits
o NEODIO added
2003-01-02 04:15:55 +00:00
Alexander Kabaev
851d388443 Do not print the value of sc pointer before is has been ininialized. 2003-01-02 02:46:13 +00:00
Alexander Kabaev
64fe778489 Create debug sysctl nodes if USB_DEBUG is defined.
UBSA_DEBUG is inconsistent with other drivers.
2003-01-02 02:38:57 +00:00
Warner Losh
82e10e2428 It appears that the SANYO SCP-4900 needs similar quirks to the
Metricom Ricochet GS modem.  Add them here.

# A new umodem appears to be needed to make the sanyo phone work, but that's
# more extensive and will come after coordination.
2003-01-01 20:21:48 +00:00
Warner Losh
4dac02c8db Sync to usbdevs 1.103 2003-01-01 20:18:58 +00:00
Warner Losh
4cce0eba8d Add Sanyo SCP-4900 phone. It needs quirks. 2003-01-01 20:18:15 +00:00
Warner Losh
f56d03c008 Now that we've 'branched' 5.0, desupport FreeBSD 3.x in this driver. It
appears that NetBSD has already done this in their tree.
2003-01-01 20:15:42 +00:00
Jake Burkholder
75db2b5e27 Add a driver for the Zilog 8530 dual uart found in Ultra 1s and Ultra 2s.
With a 1 byte transmit fifo, 3 byte receive fifo, and wierd multiplexed I/O
designed for a Z80 cpu, this chip redefines suckage.

Based on the openbsd and netbsd drivers.  Only really works as a console,
modem support is not complete since I can't test it.
2003-01-01 19:49:30 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Hidetoshi Shimokawa
d0fd7bc6b5 Experimental support for suspend/resume, not finished yet. 2003-01-01 08:25:32 +00:00
Hidetoshi Shimokawa
6faac3ac96 Reduce debug message. 2003-01-01 08:22:29 +00:00
Hidetoshi Shimokawa
1f2361f8f8 - Retry phy access when the wait-loop count is exhausted.
- Free allocated memory when detaching.
- Detect contigmalloc failure.
2003-01-01 04:23:54 +00:00
Alfred Perlstein
13438f6823 When compiling the kernel do not implicitly include filedesc.h from proc.h,
this was causing filedesc work to be very painful.
In order to make this work split out sigio definitions to thier own header
(sigio.h) which is included from proc.h for the time being.
2003-01-01 01:56:19 +00:00
Hidetoshi Shimokawa
7895313547 Fix and add several device IDs. 2002-12-31 13:43:44 +00:00
Hidetoshi Shimokawa
b018dcd1b8 - Implement primal Configuration ROM parser.
- Support multiple LUNs for SBP-II.
2002-12-31 10:28:49 +00:00
Hidetoshi Shimokawa
e4b13179f6 Improve error checking of phy access and retry when error occurs. 2002-12-31 10:00:36 +00:00
Robert Watson
07ca1fdb84 Use UID_ and GID_ constants for uid and gid arguments to make_dev()
for the raidctl device.

Select a more conservative default for the permissions for /dev/raidctl
since the operations are performed using ioctl() not read() and write().

Submitted by:	kris
Reviewed by:	scottl
2002-12-31 06:13:47 +00:00
Scott Long
1c75404899 Convert the use of MAXBSIZE in the dma tag to more appropriate values.
Use BUS_SPACE_MAXSIZE_32BIT for the parent dma tags, and
(NSEGS - 1) * PAGE_SIZE for the data buffer tags.  FreeBSD/sparc64 is
more strict about checking these values that other arches.
2002-12-31 04:22:36 +00:00
Sam Leffler
ac4f28eb7b MFS 1.6.2.3: fixup statistics; turn off batching by default; add max
aggregation tunable and set it to 1 to minimize latency

Sponsored by:	Vernier Networks
2002-12-30 22:16:45 +00:00
Jens Schweikhardt
d64ada501a Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
Sam Leffler
9967cafc49 Correct mbuf packet header propagation. Previously, packet headers
were sometimes propagated using M_COPY_PKTHDR which actually did
something between a "move" and a  "copy" operation.  This is replaced
by M_MOVE_PKTHDR (which copies the pkthdr contents and "removes" it
from the source mbuf) and m_dup_pkthdr which copies the packet
header contents including any m_tag chain.  This corrects numerous
problems whereby mbuf tags could be lost during packet manipulations.

These changes also introduce arguments to m_tag_copy and m_tag_copy_chain
to specify if the tag copy work should potentially block.  This
introduces an incompatibility with openbsd which we may want to revisit.

Note that move/dup of packet headers does not handle target mbufs
that have a cluster bound to them.  We may want to support this;
for now we watch for it with an assert.

Finally, M_COPYFLAGS was updated to include M_FIRSTFRAG|M_LASTFRAG.

Supported by:	Vernier Networks
Reviewed by:	Robert Watson <rwatson@FreeBSD.org>
2002-12-30 20:22:40 +00:00
Sam Leffler
28788ed563 fix build (make LINT) 2002-12-30 19:45:30 +00:00
Jake Burkholder
591871e5cb Fix compiling without DDB and ALT_BREAK_TO_DEBUGGER.
Submitted by:	marius@alchemy.franken.de
2002-12-30 18:18:22 +00:00
Hidetoshi Shimokawa
e238f68de5 - Add more CSR related definitions (IEEE-1212).
- Fix struct csrtext's spec fields.
- Add prototypes of upcoming configuration ROM related functions.
2002-12-30 09:41:32 +00:00
Doug Ambrisko
6cafe2646a Add support for MPI-350 the mini-pci Cisco Aironet card. This needs more
work.  The interface was gleaned from the Linux driver.  Currently only
one RX & one TX buffer are used.  Firmware support is not tested so for the
MPI-350 so it is disabled.  Signal cache and monitor mode are not supported
yet.  Signal cache is not supported since in encapsulation mode ethernet
frames are returned by the chip.  LAN monitor mode support will be added
shortly.  Thanks to Warner for the MPI-350 card he sent me.

Add support for RSSI map from PR kern/32880 which was incomplete.  Enhanced
with the ability to select the cache mode of raw, dbm or per-cent.

Clean up Signal/Noise/Quality structures and units with help from
Marco Molteni.

Change flash to use a malloc'ed buffer when needed.

PR:		kern/32880
Submitted by:	Douglas S. J. De Couto decouto@pdos.lcs.mit.edu,
		Marco Molteni
MFC:		3 weeks
2002-12-29 19:22:07 +00:00
Poul-Henning Kamp
2b64426519 Remove calls to cdevsw_add(), they are dreprecated on this branch now. 2002-12-28 21:39:04 +00:00
Maxim Sobolev
638d2f4fe8 Add support for IC Book Labs Dreadnought x16 Lite.
Approved by:	re
2002-12-28 15:45:38 +00:00
Robert Watson
2a4689e84a Change ACPI make_dev() calls to use UID_ and GID_ constants rather
than hard-coded uids and gids.

Switch the device to a group of wheel instead of operator.

Narrow down the permissions on the device to require root privilege
to manipulate the system power state.  It may be that we can broaden
access to the device after review of the access control in ACPI.

Submitted by:	kris
Reviewed by:	takawata
2002-12-28 14:58:50 +00:00
Robert Watson
9e9466baf3 Use OPERATOR instead of WHEEL for make_dev(), use 0640 instead of 0644
for disk devices to be consistent with other storage devices.

Submitted by:	kris
Reviewed by:	scottl
2002-12-27 17:52:16 +00:00
Robert Watson
5083ed18af Use UID_ and GID_ constants instead of hard-coded numeric values
with make_dev().  Use OPERATOR instead of implicit WHEEL to match
other storage devices.  Use a mode of 0640 to be consistent
with other storage devices.

Submitted by:	kris
Reviewed by:	scottl
2002-12-27 17:50:39 +00:00
Robert Watson
0c5716be39 Use UID_ROOT and GID_WHEEL for uid/gid argments to make_dev().
Remove the setgid bit from the tga device (?).
Synchronize mode with modes used for related frame buffer devices
in MAKEDEV (tga doesn't appear in MAKEDEV).

Submitted by:	kris
2002-12-27 16:44:11 +00:00
Robert Watson
adbc548002 Make use of UID_ROOT, GID_WHEEL for make_dev() arguments.
Remove the setgid bit from the 3dfx device (?).
Synchronize permissions with the values in MAKEDEV for consistency.

Submitted by:	kris
2002-12-27 16:40:54 +00:00
Robert Watson
2066d8e707 Synchronize mode for ppsX devices to that found previously in MAKEDEV
for consistency.

Submitted by:	kris
2002-12-27 16:34:12 +00:00
Robert Watson
805229eb77 Synchronize make_dev() for pcfclock devices to the values in MAKEDEV
for consistency.

Submitted by:	kris
2002-12-27 16:32:10 +00:00
Robert Watson
3055da59a9 Remove S_IROTH from the make_dev() lines for iir-related devices. This
improves protection consistency with other storage devices (generally
root:operator,660).  This driver appears not to have an active
maintainer.

Submitted by:	kris
2002-12-27 16:28:31 +00:00
Ian Dowse
326b4d74c4 When resuming after a system suspend, re-issue the UHCI_CMD_MAXP
command in case this setting was not saved. Since bandwidth reclamation
(-current only) often results in bus activity continuing to the end
of every frame, most transfers would fail with IOERROR if this
setting is missed.

Reviewed by:	n_hibma
MFC after:	1 week
2002-12-26 13:25:57 +00:00
Hidetoshi Shimokawa
ee126d67f7 Cosmetic change. s/Firewire/FireWire/. 2002-12-26 06:50:09 +00:00
Hidetoshi Shimokawa
f3abec2274 Replace ntohl() with ntohs() because orb_hi is u_int16_t. 2002-12-26 06:41:37 +00:00
Hidetoshi Shimokawa
ac9f66922b firewire.c
- Fix permission of device node.

fwochi.c, fwohcireg.h
- Detect phy access failure correct way.
- Set root hold-off bit before initiating bus reset.
	This should fix the problem with VIA6306.

fwohcivar.h
- Fix over-allocation of array. (fwohcivar.h)

sbp.c
- Return CAM_DEV_NOT_THERE rather than CAM_TID_INVALID to prevent retry.
2002-12-26 03:17:59 +00:00
Robert Watson
dcce7232ef Require privilege to flush the signal cache on if_an and if_wi 802.11
cards.

Reviewed by:	imp (if_wi)
2002-12-24 14:46:01 +00:00
Alan Cox
e7863f186a - Hold the page queues lock around vm_page_wakeup(). 2002-12-23 21:47:46 +00:00
Poul-Henning Kamp
6ce9c72c30 s/sokqfilter/soo_kqfilter/ for consistency with the naming of all
other socket/file operations.
2002-12-23 21:37:28 +00:00
Prafulla Deuskar
a58e485d36 - Move to array based indexing for TX/RX descriptor/buffer management
- Added support for ITR (interrupt throttle register). This feature is available on
adapters based on 82545 and above
- Fixed problem with vlan support when traffic has priority bits set. (kern/45907)

PR:			kern/45907
MFC after:		1 week
2002-12-23 19:11:23 +00:00
Marcel Moolenaar
991fcff585 Fix a De Morgan bug: If we only expect a memory range OR an
I/O port range, then we should ignore a resource if it's NOT
a memory range AND NOT an I/O port range.
The OR in the condition caused us to ignore perfectly valid
memory addresses.

While here, remove redundant parenthesis and reindent the
debug print to avoid long lines.
2002-12-23 03:48:59 +00:00
Matthew Dillon
6c82636572 Revert part of the last commit. Do not fake-up the cylinders to make
the sectors fit (at least, don't fake them up any more then they are
already faked up).
2002-12-22 04:46:44 +00:00
Warner Losh
d36644f2d9 Be nice. There are evidentally a number of different cards that
identify themselves as serial cards that it would be desirable to
attach a different driver than sio to.  Since we are claiming all
serial cards, this is not possible.  Instead, return -100 to indicate
that we're willing to take the card, but still allow other drivers to
attach.

Pointed out by: Maksim Yevmenkin
2002-12-21 22:37:54 +00:00
Matthew Dillon
cc7bab9032 Modify the fake cylinders calculation so it is >= the size of the device,
not < the size of the device.  This avoids geom complaints.

Fix a serious bug in the handling of the RS_NO_CLEAR_UA quirk.  When we
go and insert the test-unit-ready command the umass_cam_quirk_cb() function
sets the status as if the READ_CAPACITY command suceeded when, in fact, it
did not.  This leads to the CAM layer trying to use garbage in the return
buffer and panicing the system (or doing other bad things).

Add a quirk entry for MSYSTEMS DISK-ON-KEY, which is sold under the Sony
brand as a solid state disk-on-key usb device.  This device requires
several quirks to work properly.

Note that the disk-on-key device will not work properly until CAM also
gets a quirk entry for it, which has been submitted to the CAM maintainer,
and you may have to temporarily uncomment the DELAY() as well.  -current
does not properly wait for devices to power up so you may also have
to temporarily uncomment the DELAY(300000) to make your device work.
A solution must be found to that issue.

MFC after:	3 days
X-MFC note:	the quirk support must MFCd before this patch can be
2002-12-20 18:56:55 +00:00
Matthew Dillon
698df1f738 Fix two bugs in the DMA chaining code for OHCI. The first bug is that
the dataphysend calculation could only possibly work if the virtual buffer
is also physically contiguous.  Calculate dataphysend by calculating the
ending virtual address first, then converting to a physical address.

The second bug applies only to NetBSD and OpenBSD and involves the curlen
calculation in the two-contiguous-physical-pages case (which we don't support).

Also cleanup the use of the OHIC_PAGE() macro on dataphysend and add a panic
if len goes negative (meaning we lost the physical page translation
representing the end of the buffer).

IMHO the dataphysend is still bokered since it might be misrepresented
by shared userland page mappings.  The whole section needs to be rewritten
to use the virtual address range.

MFC after:	3 days
2002-12-20 18:47:39 +00:00
Søren Schmidt
01ed335875 Fxi support for the Promise SuperTrak 100, the PCI id was wrong. 2002-12-20 12:15:38 +00:00
Semen Ustimenko
83190e29d3 Do not return(foo()) in void function.
Submitted by:	marius@alchemy.franken.de
MFC after:	3 days
2002-12-18 22:53:24 +00:00
Semen Ustimenko
0f953c65d1 Fix the missspelt letter in DC_CTYPE_PUP_AUTOSENSe define.
Submitted by:	marius@alchemy.franken.de
MFC after:	3 days
2002-12-18 22:45:43 +00:00
Greg Lehey
c6990de670 Back out revision 1.38. disklabel now understands vinum volumes again. 2002-12-18 00:18:54 +00:00
Søren Schmidt
4d08a40b15 Try to fix the problem with burncd blank not seeing the end of
the blank operation.
2002-12-17 16:27:45 +00:00
Søren Schmidt
5dd009808a This should be the way PC98 ATA disks are seen geometry wise.
Should go into 5_0_RELEASE as well.
2002-12-17 16:26:22 +00:00
Dag-Erling Smørgrav
f0d91fb7ea Ignore IEEE1284 descriptors when looking for bidirectional mode. We don't
really know how to talk IEEE1284, so attaching to that interface makes the
printer unusable.

Approved by:	joe
2002-12-16 14:22:59 +00:00
Dag-Erling Smørgrav
6ed6884063 MFNetBSD: 1.52-1.55
Mostly OpenBSD-related changes.  Remove newline from panic string.  Remove
an unreachable break statement.
2002-12-16 14:20:26 +00:00
Olivier Houchard
1dbb2b5ac0 Fix the panic that occurs when kldunloading trm by using the correct
prototype for trm_detach and freeing all resources.
While I'm there, handle better errors in trm_attach and remove the
PCI_BASE_ADDR0 definition, since it's what PCIR_MAPS is used for.

MFC after:	3 days
2002-12-16 13:38:22 +00:00
Scott Long
2c6a3591f9 Convert the use of vtophys() for doing autosense to use busdma. Also correct
some error codes that get returned to CAM.
2002-12-14 19:20:57 +00:00
Alfred Perlstein
d1e405c5ce SCARGS removal take II. 2002-12-14 01:56:26 +00:00
Scott Long
1f380ae506 Move the amd(4) driver to it's own directory in preparation for it growing
an sbus front-end.
2002-12-13 22:59:18 +00:00
Alfred Perlstein
bc9e75d7ca Backout removal SCARGS, the code freeze is only "selectively" over. 2002-12-13 22:41:47 +00:00
Alfred Perlstein
0bbe7292e1 Remove SCARGS.
Reviewed by: md5
2002-12-13 22:27:25 +00:00
Eric Moore
c664b80dbc Problem: Hang while bootup on Perc2/SC.
Fix: Error handling wasn't implemented
in newly implemented polling code for quartz
controllers.

Approved by: re@
2002-12-13 17:27:44 +00:00
Greg Lehey
0538c676cc Create raw plexes and subdisks, not the old volume-related ones. This
crept in in the transition to devfs, and caused a number of "device
not configured" errors.

Approved by:	re (rwatson)
2002-12-13 00:27:32 +00:00
Scott Long
a9f3d2c756 sable the CAM interface on some more cards. It seemed to be confusing and
upsetting the firmware there.

Thanks to imp@freebsd.org for suffering through testing with this.

Approved by:	re
2002-12-12 22:23:06 +00:00
Bernd Walter
765187cac7 The uftdi driver runs with multiple instances.
Remove a comment claiming the opposite.

Approved by: re (rwatson)
             gallatin (Mentor)
MFC after: 1 week
2002-12-12 19:03:43 +00:00
Mark Murray
340a8a91c3 Fix a buffer overrun in /dev/random which, due to the nature of the
kernel memory allocator, is harmless. This could be a problem for
other systems, though. I've modified Darren's patch a little.

Original patch by: Darren Schack, Isilon Systems, Inc <darrens@isilon.com>
Also analysed by:  SGI, and in particular Divy Le Ray of SGI
OK'ed by:          re(rwatson)
2002-12-12 17:38:45 +00:00
Greg Lehey
d54f0880cb revive_block: If we have an I/O error, don't forget to drop the stripe lock.
Approved by:	re (jhb)
2002-12-12 01:03:45 +00:00
Eric Moore
d6b32def6c (1) Problem: PANIC when loading/unloading driver
as module. This also fix's issue kern/45713.
Fix - polling was implemented incorrectly for
adapter enquiry and adapter flush.
(2) Problem: PANIC when unloading driver
as module.
Fix - device nodes are not destroyed for amr0,
and amrd* when driver is unloaded
(3) Problem: PANIC from loading driver when
3ware adapter present, error message "Warning
"amrd is usurping twed's bmaj"
Fix - put #idef freebsd version < 500000 for
bmaj -1 -> amrd_cdevsw
(4) Problem: warnings in driver when compiling
with DAMR_DEBUG param enabled in Makefile
Fix - fix the warnings so driver can compile
when -Werror is present in Makefile.

Approved by: jhb
MFC: 7 days
2002-12-11 20:59:46 +00:00
Takanori Watanabe
c6a78e9840 Add sysctl knob to stop disabling acpi on shutdown.
Approved by: re(jhb)
2002-12-11 18:48:50 +00:00
Scott Long
749142ecbf Play nice with GEOM and use the appropriate ioctls for getting the
partition size and sector size.  The old way of groveling through the
disklabel doesn't work anymore.

Noticed by:	anholt
Approved by:	re
2002-12-10 15:52:56 +00:00
Roger Hardiman
2cfff6e8ef Fix a panic unloading the bktr driver when devfs is in use.
PR:	kern/36413
2002-12-09 09:04:09 +00:00
Josef Karthauser
85105890c2 MFNetBSD: (partial 1.133)
- In ohci_close_pipe, wait 1ms after removing an ED to avoid possible race
  condition.

Approved by:	re (rwatson)
2002-12-09 01:41:24 +00:00
Josef Karthauser
2c123d54ee MFNetBSD:
date: 2002/09/29 20:59:30;  author: augustss;  state: Exp;  lines: +2 -7
    Remove extra call to ohci_rem_ed().  From kern/18448, Takeshi Nakayama.

Approved by:	re (rwatson)
2002-12-09 01:39:32 +00:00
Josef Karthauser
317cca359c Don't corrupt the ED list whilst removing an entry.
Submitted by:	Bernd Walter <ticso@cicely8.cicely.de>
Approved by:	re (rwatson)
2002-12-09 00:55:50 +00:00
Roger Hardiman
1f3e23743d Fix a bug which caused signals on YUV images to fail.
PR: i386/45678  (this also allowed kern/21305 and kern/33715 to be closed)
Submitted by: Tommy Johnson <tjohnson@bobdbob.com>
2002-12-07 09:00:19 +00:00
Søren Schmidt
9dec0f3de0 Fix linking problem when atadisk is not use in ata-all.c
Add dummy intr_func and lock_func to ata-card.c

Dont call ad_print if the driver decided there is no disk.
2002-12-06 19:29:53 +00:00
Hidetoshi Shimokawa
17c3d42c9e Reduce and improve debug messages.
Approved by: re
2002-12-06 02:17:30 +00:00
Scott Long
8528a71202 The sequencer downloading code assumes that all jump
labels are acurate in relation to a fully compiled
sequencer program (all patches downloaded).  Correct
a few occurances of a relative jump across a macro
that ended up jumping us into the last instruction
of the macro.

Spproved by:	re (bmah)
2002-12-05 00:47:27 +00:00
Eric Anholt
a94332b247 Remove an unused variable that snuck in the last commit.
Submitted by:	Christian Brueffer <chris@unixpages.org>
Approved by:	re (rwatson)
2002-12-04 23:39:05 +00:00
Scott Long
97cae63d7f Last minute fixes to ahc and ahd:
ahd_pci.c:
	Retrieve the allow_memio hint from the resource manager to
	determine whether or not to try PCI MEMIO.

aic79xx_osm.h:
aic7xxx_osm.h:
	Don't wrongly abuse the callout_reset() interface when trying
	to abuse timeouts generated from the CAM layer.  This fixes the
	console freeze and lost timeout problem that many have reported,
	especially on SMP systems.

aic79xx_pci.c
aic7xxx_pci.c
	Rewrite the MEMIO test routine to prevent certain broken chipsets
	from trying to burst multiple DWORDs to the registers.  Also make
	the routine better detect byte merging by the host bridge and
	deal with it.

aic79xx.reg:
	Correct an incorrect register definition.

Approved by:	re (rwatson, jhb)
2002-12-04 22:51:29 +00:00
Eric Anholt
91f6016a96 Fix witness warning in DRM memory info sysctl by making a temporary copy of the
data under the lock and outputting it to the sysctl later.

Reviewed by:	scottl
Approved by:	re
2002-12-04 18:27:45 +00:00
Søren Schmidt
8ba4488cea Add support for the PC98 platform to the ATA driver.
This mostly consists of functionality to serialize accesses to
the two ATA channels (which can also be used to "fix" certain
PCI based controllers).
Add support for Acard controllers.
Enable the ATA driver in PC98 GENERIC, and add device hints.
Update man page with latest support.

The PC98 core team has kindly provided me with a PC98
machine that made this all possible, thanks to all that
contributed to that effort, without that this would
probably newer have been possible..

Approved by: re@
2002-12-03 20:20:44 +00:00
Warner Losh
a8b354a809 Properly account for prefetchable memory when a request is being made.
We allow the request to go through if it matches either a prefetchable
or a non-prefetchable part of the bridge.  We do not check to make
sure it is the right kind of memory because most drivers to not yet
properly set RF_PREFETCHABLE (only cardbus seems to do so, and I'm not
entirely sure it does it right).  RF_PREFETCHABLE was invented for
cardbus, so hasn't been properly documented yet.

This is still overridable by hw.pci.allow_unsupported_io_ranges, but
the need for that is greatly reduced, especially for the nvida driver.

Approved by: re
Reviewed by: jhb and many testers
Submitted by: Matt Emmerton (although this has been reworked somewhat)
2002-12-03 08:34:20 +00:00
Greg Lehey
b9742d01f4 Implement DIOCGDINFO for volumes. newfs will no longer build a file
system on a volume without a disk label.

Approved by: re (rwatson)
2002-12-02 23:56:59 +00:00
Greg Lehey
ad3507f645 Don't blindly call make_dev when configuring an object: the device
could already exist, and this triggers a booby trap panic in make_dev.

remove_plex_entry: Don't remove the stripe mutex here, it gets done in
free_plex.

Approved by: re (rwatson)
2002-12-02 23:53:32 +00:00
Thomas Quinot
9e3a06e150 In ata_reinit, when ata_getparam fails for a new device (indicating that
the device is not actually present), clear the corresponding bit in
the ch->devices bitmap. This resolves a panic that occurred with ATAPI/CAM
after an APM suspend/resume, when the ATA hardware would erroneously
report an extra ATAPI device.

Approved by:	re, sos
Reviewed by:	roberto
MFC after:	7 days
2002-12-01 14:20:08 +00:00
Scott Long
0c5aa4c57b Major update to the ahd driver to fix many bugs found in the previous
version, plus add support for the new features found in the Rev B
version of the chip.  The changelog is quite long and can be provided
on request.  Major features include vastly improved protocol violation
handling, full support for the 7902 Rev B, better parity error
handling, and better packetized overrun handling, to name a few.

Approved by:	re (blanket)
2002-12-01 08:13:37 +00:00
Scott Long
454bf1693a Implement workaround for broken busfree-rev in the A4.
HP -> CPQ

Rearrange IDs to better match which chips they use.

Convert to uniform product description strings.

Simplify 7901A setup function.

Add the NONPACKFIFO_BUG and PACED_NEGTABLE_BUG entries
for the A.

Add rev B bugs and features.

The double write workaround for CURRSCB is only required if
abort pending is set.  Remove this work around and set the
abort pending bug bit on the B at least until we have better
confirmation that the double write is always safe.

Add updated H2B identifiers

Move IOCell paramters into softc and add a hook for the
OSM to modify these as well as other settings prior to
committing them to the chip.

SLEW -> SLEWRATE

PREQDIS in DEVCONFIG1 went away after the A2.
Remove all code that references this bit.  This
is especially important since this bit was reused
in the B for a different HW fix workaround.

Properly set the AHD_NEW_IOCELL_OPTS and
AHD_NEW_DFCNTRL_OPTS features for the B.

Remove stray/random extra 7901A generic PCI
table entry.  Also switch the correct 7901A
generic entry to use ID_ALL_MASK since we
can only differentiate the 7901A from the
7902 by checking for a "type field" of 0xE.

Set AHD_INTCOLLISIONT_BUG for the Rev B.

Set the PREQDIS bit in DEVCONFIG1 for the B.  The
bit is misnamed, but seems to disable a work-around
that breaks on the B on PCI busses.

Add a routine for testing memory mapped register access.
This will hopefully detect things like buggy via chipsets
so that the OSM can fallback to using I/O mapped access
when memory mapped I/O simply will not work.

Approved by:	re (blanket)
2002-12-01 07:59:01 +00:00
Scott Long
fc2aa1d1b8 Add our controller name to the front of our
diagnostic "Setting Mode" messages.

Use a read of HCNTRL to flush our write to CLRCMDCMPLT
on the RevB.  This allows us to check to see if the sequencer
is paused and to initiate the interrupt collision workaround
without incuring an extra read.

Approved by:	re (blanket)
2002-12-01 07:54:53 +00:00
Scott Long
add6879424 Remove redundant check for chip type being PCI-X.
PCI-X only workarounds are automatically masked out
if we are operating in PCI mode.

Make use of ahd_pci_test_register_access()

Approved by:	re (blanket)
2002-12-01 07:52:35 +00:00
Scott Long
481a41742f Update to include new ahd_scb_timer_reset API
Move IOCell paramters into softc and add a hook for the
OSM to modify these as well as other settings prior to
committing them to the chip.

Approved by:	re (blanket)
2002-12-01 07:50:56 +00:00
Ian Dowse
e176446dc8 Move the check for the MD_SHUTDOWN flag to before the tsleep() call
in the per-device kthread. This ensures that synchronisation with
mddestroy() succeeds even if the kthread was not waiting in tsleep()
at the time of the wakeup(). Among other things, this fixes the
problem of mdconfig getting stuck when an attempt is made to use a
zero-length file as a vnode-type backing store.

Approved by:	re
2002-11-30 22:03:53 +00:00
Scott Long
de5305d5b6 Synchronize perforce Id tags
Approved by:	re (blanket)
2002-11-30 20:04:10 +00:00
Scott Long
4d22994e96 Bring in many bugfixes and changes obtained from formal testing:
aic7xxx.c:
        aic7xxx.h:
        aic7xxx.reg:
        aic7xxx.seq:
                Bring in the protocol violation handler from the U320
                driver and replace the NO_IDENT sequencer interrupt code
                with the PROTO_VIOLATION code.  Support for this code
                required the following changes:

                SEQ_FLAGS:
                        IDENTIFY_SEEN -> NOT_IDENTIFIED
                        Added NO_CDB_SENT

                SCB_CONTROL:
                        TARGET_SCB == STATUS_RCVD for initiator mode

                scb->flags:
                        Added SCB_TARGET_SCB since we cannot rely on
                        TARGET_SCB as a target/initiator differentiator
                        due to it being overloaded in initiator mode to
                        indicate that status has been received.

        aic7xxx.seq:
                Move data fifo CLRCHN to mesgin_rdptrs which is a safer
                location for doing this operation.  This also saves a
                sequencer instruction.

        aic7xxx.c:
        aic7xxx.h:
                Change ahc/ahd_upate_neg_request() to take a "negotiation
                type" enum that allows us to negotiate:
                        o only if the goal and current parameters differ.
                        o only if the goal is non-async
                        o always - even if the negotiation will be for async.
        aic7xxx.seq:
                Reset the FIFO whenever a short CDB transfer occurs
                so that the FIFO contents do not corrupt a future CDB
                transfer retry.

                Add support for catching the various protocol violations
                handled by ahc_handle_protocol_violation.

                Reformat some comments.

        aic7xxx.c:
        aic7xxx.h:
                Just for safety, have the aic7xxx driver probe
                the stack depth.

        aic7xxx.c:
        aic7xxx.h:
                Save and restore stack contents during diagnostics.
                Some chip variants overwrite stale entries on a
                stack "pop".

                Don't use 0 to probe the stack depth.  0 is the typical
                value used to backfill the stack if entries are overwritten
                on a "pop".

        aic7xxx.h:
                Add a missing typedef.

                Collapse SCB flag entries so they are bit contiguous.

                Add AHD_ULTRA2_XFER_PERIOD for narrow fallback calculations

        aic7xxx.c:
                Don't panic (as a diagnostic to catch bugs) if we decided to
                force the renegotiation of async even if we believe we are
                already async.  This should allow us to negotiate async instead
                of the full user goal rate during startup if bus resets are
                disabled.

                Add a space to the end of the ahc/ahd_print_devinfo routines
                so that it behaves as expected by the code that uses it.

                Only force a renegotiation on a selection timeout
                if the SCB was valid.  Doing otherwise may be dangerous
                as the connection was not valid for an unknown reason.

                Add additional diagnostic output to ahc_dump_card_state(),
                and have it use the register pretty printing functions.

                Update ahc_reg_print() to handle a NULL cur_col.

                Add a newline to ahc_dump_card_state() output.

                Bring back "use_ppr".  We need to use_ppr anytime
                doppr is true or we have non-zero protocol options.
                The later case was not handled in the recent removal
                of use_ppr.

                Move a comment and remove a useless clearing of use_ppr.

                Don't disable ENBUSFREE when single stepping on
                a DT capable controller.  We cannot re-enable unexpected
                busfree detection, so we must clear BUSFREE on each
                step instead.

                Correct the lookup of the SCB ID in ahc_handle_proto_error.

                Remove a diagnostic printf.
                Remove unecessary restoration of the STACK for older
                chips.

Approved by:	re (blanket)
2002-11-30 19:30:09 +00:00
Scott Long
dc67dad8b1 Add a routine for testing memory mapped register access.
This will hopefully detect things like buggy via chipsets
so that the OSM can fallback to using I/O mapped access
when memory mapped I/O simply will not work.

Approved by:	re (blanket)
2002-11-30 19:13:55 +00:00
Scott Long
24dd01c695 Always compile in the AHC_ALLOW_MEMIO code, but only try MEMIO if
AHC_ALLOW_MEMIO is set, or the hint hint.ahc.N.allow_memio=1 is
set in the bootloader.

Make use of ah?_pci_test_register_access().

Approved by:	re (blanket)
2002-11-30 19:11:44 +00:00
Scott Long
a3a33a2bcb Handle changes to SCB_CONTROL, scb->flags and SEQ_FLAGS
Approved by:	re (blanket)
2002-11-30 19:08:58 +00:00
Scott Long
3cb8be933d Use the new ahc_scb_timer_reset API
Remove AHC_ALLOW_MEMIO

Approved by:	re (blanket)
2002-11-30 19:06:24 +00:00
Scott Long
b8e89ffabc Add support for the Olivetti branded EISA boards.
Approved by:	re (blanket)
2002-11-30 18:00:43 +00:00
Scott Long
29dcbe8760 Revisit the printf format fixes for alpha. intmax_t doesn't exist in
RELENG_4, so cast to u_long in order to stay compatible.

Approved by: re	(blanket)
2002-11-28 04:09:29 +00:00
Noriaki Mitsunaga
3e4be4cbf1 o Changes to support NEWCARD.
o Add needed headers.
        o Add stg_products[] product data and stg_match() function.
        o Change stg_pccard_method[] to support both OLDCARD and NEWCARD.

Approved by:	re
2002-11-28 01:15:01 +00:00
Noriaki Mitsunaga
4a42958a2b o Changes to support NEWCARD.
o Add needed headers.
        o Add ncv_products[] product data and ncv_match() function.
        o Change ncv_pccard_method[] to support both OLDCARD and NEWCARD.

Suggestion for REX-5572 matching part by imp.

Approved by:	re
2002-11-28 01:13:58 +00:00
Noriaki Mitsunaga
922019c24b o Changes to support NEWCARD.
o Add needed headers.
	o Add nsp_producs[] product data and nsp_match() function.
	o Change nsp_pccard_method[] to support both OLDCARD and NEWCARD.
	o Add warning to fall back to PIO mode when it cannot use SMIT mode.
	  This is needed because memories are not allocated with NEWCARD now.

Submitted by:	takawata
Approved by:	re
2002-11-28 01:09:29 +00:00
Noriaki Mitsunaga
a11d8d7097 regen to 1.38
Reviewed by:	imp
Approved by:	re
2002-11-28 01:00:40 +00:00
Noriaki Mitsunaga
3c3dc1cf2e o Add PC-Cards' ID or CIS strings which are supported by ncv, nsp,
or stg driver. They are,

Macnica mPS110, PANASONIC(KME) KXLC004, Qlogic Fast SCSI,
Workbit Ultra Ninja-16, (ID based)

Future Domain SCSI2GO, IBM SCSI PCMCIA card, I-O DATA CBSC16,
Macnica mPS100, Newmedia BASICS-SCSI, RATOC REX-5536, RATOC REX-5536AM,
RATOC REX-5536M, RATOC REX5572, Workbit NinjaSCSI-3
(CIS based)

  Note: We need vendor IDs WORKBIT2 and IODATA3 which is -1, since some
        cards does not have IDs in the CIS and fails to be probed without
	this fake vendor IDs.

o Change the strings of RATOC REX_R280 from REX-R280 to REX-R280/REX-9530.
  This reminds us that REX-R280 and REX-R9530 have same ID (same product).

Reviewed by:	imp
Approved by:	re
Obtained from:	/etc/defaults/pccard.conf,
		List of CIS tupples by Toshihiko ARAI and PAO project:
			http://www.linkclub.or.jp/~clover/cis/
Change suggestion by:	HASEGAWA Tomoki <thasegawa@mta.biglobe.ne.jp>
			for I-O DATA CBSC16 entry
2002-11-28 00:57:47 +00:00
Mitsuru IWASAKI
21b5fd3cfd Resolve conflicts arising from the ACPI CA 20021118 import. 2002-11-27 18:09:20 +00:00
Warner Losh
3a28284461 Need more parens here.
Approved by: re (blanket)
2002-11-27 17:30:41 +00:00
Mitsuru IWASAKI
3fd2b0260e Disable debug output from acpi_pci_link.
There were no serious problem reports on this in spite of my concern.

To get debug output from acpi_pci_link, just enable bootverbose flag
in usual manner (boot -v).

Approved by:	re
2002-11-27 09:32:24 +00:00
Scott Long
7fc23fe669 Minor updates to the aicasm:
aicasm_gram.y:
	Use a direct move from allzeros to emulate a
	mvi of 0.

aicasm_insformat.h:
	sync $Id$

aicasm_symbol.c:
	Minor header change.

Approved by:	re (blanket)
2002-11-27 07:06:43 +00:00
Warner Losh
e7b01d0727 Xircom cards store the MAC address in the CIS, so get it from the new
pci_get_ether accesor, which gets it from the CIS for cardbus cards
(and from other pci-like buses via whatever mechanism is used there).

Submitted by: sam
Approved by: re (blanket)
2002-11-27 07:04:10 +00:00
Warner Losh
fbe9cff112 Implement PCI_IVAR_ETHADDR. Cardbus has the MAC addr in the CIS,
sometimes, so return it when requested and it does.  Also a little
more infrastructure for a few other things.

Submitted by: sam
Approved by: re (blanket for NEWCARD)
2002-11-27 06:56:29 +00:00
Warner Losh
ba5fc4eed2 Add a new cardbus specific ivar: PCI_IVAR_ETHADDR. Some pci-like
buses support querying the MAC address in a standard-for-that-bus way.
The base pci bus returns NULL for this IVAR always.

Submitted by: sam
Approved by: re (blanket for NEWCARD)
2002-11-27 06:41:28 +00:00
Cameron Grant
00acb1337e (hopefully) fix build breakage some people are seeing
Approved by:	re
2002-11-26 18:16:27 +00:00
John Baldwin
8745ec57d0 - Assume a bus number of zero if evaluating _BBN fails, not if it succeeds.
This was effectively rendering _BBN useless.
- Cleanup handling of the busok variable a bit.

Submitted by:	marcel (1)
Approved by:	re (rwatson)
2002-11-25 21:55:04 +00:00
John Baldwin
1bbf246462 Fix a couple of bugs in host_pcib_get_busno():
- If a PCI device is not present, then a 32-bit read_config() is going to
  return 0xffffffff not 0xffff.
- For the 82454NX chipset, the MIOC that we read the bus numbers of the
  various host-PCI bridges from is at function (slot) 0x10 not 0x0.

Approved by:	re (rwatson)
2002-11-25 21:53:14 +00:00
Luigi Rizzo
1efbdcd10f Fix IFF_ALLMULTI handling.
Reviewed by: pdeuskar (maintainer)
Approved by: re
2002-11-25 20:00:13 +00:00
Luigi Rizzo
d535facffe Add polling support to the "em" driver.
Reviewed by: pdeuskar (maintainer)
Approved by: re
2002-11-25 19:56:16 +00:00
Luigi Rizzo
5d6dfbbb5e Fix handling of IFF_ALLMULTI. The same bug in various forms affects
the following drivers:

    dc mn sf sk ste ti tl xl an bge em gem gx ie lge sr aue cue kue wi xe

Approved by: re
2002-11-25 19:28:01 +00:00
Cameron Grant
67beb5a5c8 various fixes to eliminate locking warnings
Approved by:	re
Reviewed by:	orion
2002-11-25 17:17:43 +00:00
Cameron Grant
68f4e7f1d3 various fixes to eliminate locking warnings
Approved by:	re
Reviewed by:	orion
2002-11-25 17:07:33 +00:00
Cameron Grant
0586ff0d84 if the list of supported formats is empty, fail the attach instead of
panicing later.  this is a band-aid pending further investigation.

MFC After:	7 days
Approved by:	re
2002-11-25 17:03:39 +00:00
Mike Silbersack
c7c3f58e12 Import some relevant changes from Via's if_fet driver:
1.  Detect the revision of the Rhine chip we're using.
2.  Use the force reset command on revisions which support
    it whenever the normal reset command fails.

This should solve a wide range of "my vr0 locks up with reset
failed messages" problems.  (Although the root causes should
be eventually tracked down.)

Tested by:	grenville armitage <garmitage@swin.edu.au>
Obtained from:	Via's if_fet driver
MFC after:	3 days
Approved by:	re
2002-11-25 05:15:27 +00:00
Scott Long
bde9cfc2b0 Fix make_dev() to use 0644 instead of 0x644 for default permissions
Spotted by: 	kris
Approved by:	re
2002-11-25 04:55:09 +00:00
Scott Long
cec762959b Fix printf format problems that were stopping LINT on alpha
Submitted by:	jmallett, many others
Approved by:	re
2002-11-25 04:53:12 +00:00
Mitsuru IWASAKI
87b45ed576 Add `if (!cold)' checkings for functions which is called via SYSINIT.
Loading acpi.ko with kldload is disallowed, however some
functions were executed unexpectedly.

Approved by:	re
2002-11-24 02:27:07 +00:00
Warner Losh
e961d904ac Remove a comple of bogus debug printfs that snuck in during some
debugging I was doing 3 months ago :-(.

Noticed by: scottl
Aproved by: the re blanket (different than the security blanket).
2002-11-23 23:09:45 +00:00
Nate Lawson
c3bf92aa58 Allow acd(4) and cd(4) to support old behavior for CDRIOC*SPEED ioctls.
If the value from the user is less than 177, assume it is a multiple of
a single speed CDROM and convert to KB/sec.

No complaints from:	sos
Reviewed by:	ken
Approved by:	re
MFC after:	1 day
2002-11-23 22:51:50 +00:00
John Baldwin
9debb53220 According to the ACPI spec, the bus number of the child PCI bus of a host
to PCI bridge can be read be evaluating the _BBN method of the host to PCI
device.  Unfortunately, there appear to be some lazy/ignorant/moronic/
whatever BIOS writers that return 0 for _BBN for all host to PCI bridges in
the system.  On a system with a single host to PCI bridge this is not a
problem as the child bus of that single bridge will be bus 0 anyway.
However, on systems with multiple host to PCI bridges and l/i/m/w BIOS
writers this is a major problem resulting in all but the first host to
PCI bridge failing to attach.  So, this adds a workaround.

If the _BBN of a host to PCI bridge is zero and pcib0 already exists
and is not us, the we use _ADR to look up our PCI function and slot
(we currently assume we are on bus 0) and use that to call
host_pcib_get_busno() to try and extract our bus number from config
registers on the host to PCI bridge device.  If that fails, then we make
an evil assumption that ACPI's _SB_ namespace lays out the host to PCI
bridges in ascending order and use our pcib unit number as our bus
number.

Approved by:	re
2002-11-22 18:11:13 +00:00
John Baldwin
b173edafc7 Add a function host_pcib_get_bnsno() that attempts to determine the bus
number of the child bus of a host to PCI bridge by reading from proprietary
configuration registers in the host to PCI bridge devices.

Approved by:	re
2002-11-22 17:50:47 +00:00
Eric Moore
ca4722f57e Added support for DELL Perc4/DI.
Reviewed by: ps
Approved by: jhb
MFC after: 5 days
2002-11-21 16:06:10 +00:00
Jake Burkholder
a121cb6a7f Create the ofwcons device at SI_SUB_CONFIGURE instead of SI_SUB_DRIVERS,
after configure() has run.  Only create the device if ofwcons is the
highest priority console.  Make a dev alias with the same name as the
firmware output-device property.
2002-11-18 06:19:12 +00:00
Jake Burkholder
e2815d20d9 Setup a default tty mode even if the device is not the console. Don't
reset the chip on open if we're not the console.

This fixes running a getty on ttya or ttyb if console input and output
devices are screen.
2002-11-18 05:56:43 +00:00
Jake Burkholder
4ce7e0f43a Remove some unnecessary code. Make the device description nicer. Add a
delay in the right place to flush output before switching consoles.
2002-11-18 04:02:42 +00:00
Jake Burkholder
810c82e6c2 - Add support for ALT_BREAK_TO_DEBUGGER; this is the only reliable way to
trigger a breakpoint with this chip.
- Fiddle the right bits in the cn input and output routines to disable port
  interrupts and enable visibility of the masked interrupt status bits.
- Register a shutdown final event handler to put the chip back in the mode
  that the prom expects.
2002-11-17 16:00:51 +00:00
Josef Karthauser
11f314d4cb Apply some fixups in the driver_t's.
Submitted by:	akiyama
MFC after:	3 days
2002-11-17 14:22:37 +00:00
Josef Karthauser
97764f126a Use a sysctl for controlling the debugging output.
Submitted by:	akiyama
2002-11-17 14:08:48 +00:00
Josef Karthauser
263de9cd60 Fix a typo in a console message.
Submitted by:	akiyama
MFC after:	3 days
2002-11-17 13:33:55 +00:00
Warner Losh
c04a433aa9 DETACH_FORCE was removed recently. Remove it here, even though this
isn't supported.
2002-11-17 04:52:37 +00:00
Maxime Henrion
6c9ecf447f Catch up with sam's changes to network interfaces. 2002-11-15 14:36:33 +00:00
Sam Leffler
673d91916d network interface driver changes:
o don't strip the Ethernet header from inbound packets; pass packets
  up the stack intact (required significant changes to some drivers)
o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN)
o track ether_ifattach/ether_ifdetach API changes
o track bpf changes (use BPF_TAP and BPF_MTAP)
o track vlan changes (ifnet capabilities, revised processing scheme, etc.)
o use if_input to pass packets "up"
o call ether_ioctl for default handling of ioctls

Reviewed by:	many
Approved by:	re
2002-11-14 23:54:55 +00:00
Sam Leffler
9ef8b52020 o track either_ifattach/ether_ifdetach API changes
o use if_input for input packet processing
o don't strip the Ethernet header for input packets
o use BPF_* macros bpf tapping
o call ether_ioctl to handle default ioctl case
o track vlan changes

Reviewed by:	many
Approved by:	re
2002-11-14 23:49:09 +00:00
Olivier Houchard
26532c3696 Remove the remaining calls to free(), they are not needed anymore now
device_get_softc() is used.
2002-11-14 19:54:33 +00:00
Maxime Henrion
b2423a5f88 Fix printf() format errors.
Reviewed by:	imp
2002-11-14 14:02:32 +00:00
Maxime Henrion
cb25d85fc7 Pass correct parameters to bus_space_barrier() instead of 0
so that this code compiles on alpha.
2002-11-14 13:25:53 +00:00
Warner Losh
b20360c8e6 MFp4:
o Add support for bus_child_present call by implementing that method for cbb.
2002-11-14 05:20:39 +00:00
Warner Losh
dfe5056e80 MFp4:
o Make this code a little easier to understand by using simpler if
  statements, but nesting them.
2002-11-14 05:18:53 +00:00
Warner Losh
f02993557a MFp4:
o Use 32-bit unsigned types for things that really are 32-bit quantities,
  not bus_addr_t.  These are not the same as a bus_addr_t, so don't use
  that here.  Harmless on i386, introduced problems on sparc64.

Submitted by: jhb
2002-11-14 05:15:50 +00:00
Warner Losh
41e6d507ba Remove an impossible condition. pf->dev is always non-null here. 2002-11-14 05:13:52 +00:00
Warner Losh
d0c36f94f7 MFp4:
o Add a diagnostic for an 'impossible' condition.
o Collapse common code.
2002-11-14 05:12:02 +00:00
Warner Losh
01f2fb65c3 minor correction to comment 2002-11-14 05:10:16 +00:00
Warner Losh
21ac1e0615 Add second and thrid bus-toaster IDs 2002-11-14 05:08:22 +00:00
Warner Losh
c4d9c284e2 regen to 1.37 2002-11-14 05:07:20 +00:00