Commit graph

8399 commits

Author SHA1 Message Date
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
Warner Losh 637f9a2e17 Add a third aic-based bustoaster. 2002-11-14 05:06:25 +00:00
Scott Long 9fb92b64ad When parsing the CIS, if a BAR tuple is encountered, enable the corresponding
bit in the PCI command register for the device.  Otherwise, device drivers
that look at this register to see which types of BARs are usable will think
that none of them are.
This allows my Adaptec 1480A cardbus card to finally work.

Reviewed by:	imp
2002-11-13 22:53:48 +00:00
Maxime Henrion 7617255f4a Remove a bunch of #include "opt_pci.h". 2002-11-13 17:40:15 +00:00
Maxime Henrion d541eb80c6 Unbreak kernel build.
Submitted by:	Hiten Pandya <hiten@angelica.unixdaemons.com>
2002-11-13 17:34:12 +00:00
Matthew N. Dodd 1c54ff3315 Convert kernel compile option PCI_ALLOW_UNSUPPORTED_IO_RANGE to
a loader tunable hw.pci.allow_unsupported_io_range.

Submitted by:	 Hiten Pandya <hiten@angelica.unixdaemons.com>
Approved by:	 re (murray)
2002-11-13 09:42:25 +00:00
Matthew N. Dodd 04211a9bcc Staticize local variable.
Submitted by:	 Hiten Pandya <hiten@angelica.unixdaemons.com>
Obtained from:	 re (murray)
2002-11-13 09:40:09 +00:00
Hidetoshi Shimokawa d6ec58858c - Add fwmem_xfer_req() and use this in other functions. 2002-11-12 17:19:21 +00:00
Hidetoshi Shimokawa 8687c4fbcd - Remove unused code.
- Fix style.
2002-11-12 17:16:20 +00:00
Hidetoshi Shimokawa c57d646f99 fix wording. 2002-11-12 17:11:32 +00:00
Hidetoshi Shimokawa 17821895ee Split userland services to fwdev.c. 2002-11-12 15:22:19 +00:00
Hidetoshi Shimokawa f90ce7b125 Use struct fw_device in fwmem.c
- specify fwmem target by EUI64.
- fw_noderesolve returns struct fw_device rather than dst.
- include struct firewire_comm in struct fw_device.
2002-11-12 13:49:17 +00:00
Hidetoshi Shimokawa 5e2a411f2d Add a prototype for suspend/resume. 2002-11-12 13:46:09 +00:00
Hidetoshi Shimokawa 98e6731b51 Change interface of fwmem_read_*() functions to be usable from other part
of the module.
2002-11-12 11:15:01 +00:00
Hidetoshi Shimokawa c3b0952272 Change interface of fwmem_read_*() functions to be usable from other part
of the module.
2002-11-12 11:08:50 +00:00
Scott Long 2de8725950 Use better return types and a couple of casts to eliminate warnings on
alpha.  This will take the file out of sync with the private version
that we maintain, but alpha tinderbox has been broken for too long.

Tested on: i386, sparc64, alpha
2002-11-12 10:22:49 +00:00
Hidetoshi Shimokawa 8da326fd37 - clean up 2002-11-12 10:02:50 +00:00
Scott Long 1e06ae9969 Fix two typos from the previous commit. This code is definitely infectious. 2002-11-12 09:45:59 +00:00
Scott Long e6e272b905 Step one of cleaning and fixing cardbus:
- Fix some especially bad style in the CIS BAR tuple parsing code.
 - activate Option ROMS correctly.
 - de-obfuscate the Option ROM image selection code.
 - Fix mis-interpretation of the PCI spec that prevented Option ROMs whose
   CIS section wasn't in the first image from working.
 - Fix mis-interpretation of the PCI spec that prevented CIS's mapped into
   MEMIO space from working at all.
 - Reject invalid CIS pointers.

Reviewed by:	imp
2002-11-12 08:23:27 +00:00
Hidetoshi Shimokawa c572b81055 - Remove unused code.
- Style fixes.
2002-11-12 05:52:01 +00:00
Hidetoshi Shimokawa 783058fa0d Restrict process count in fwohci_arcv() and fwohci_ircv(). 2002-11-12 04:54:30 +00:00
Maxime Henrion 2ac8c61ac4 Capitalize the first letter of device descriptions
for consistency with the rest of the drivers.
2002-11-11 15:26:08 +00:00
Thomas Moestl 20207b60a8 Declare the snp ioctl()s to work on udev_t, since that is what they
really do and dev_t is defined differently in kernel and userland.
Return a correctly formed udev from SNPGTTY.

Reviewed by:	dd
2002-11-11 10:45:31 +00:00
Maxime Henrion aa26768242 Warning fixes. 2002-11-11 10:28:44 +00:00
Maxime Henrion 97be736aca Warning fix. 2002-11-11 10:17:01 +00:00
Matthew N. Dodd f5464126bb Replace {disable,enable}_intr() with critical_{enter,exit}(). 2002-11-10 03:45:49 +00:00
Alfred Perlstein 29f194457c Fix instances of macros with improperly parenthasized arguments.
Verified by: md5
2002-11-09 12:55:07 +00:00
John Baldwin 4ed3ce72b0 Fix some sizeof(int) != sizeof(void *) warnings. 2002-11-08 21:30:26 +00:00
John Baldwin e068a87835 - Move opt_fb.h earlier so it covers included headers.
- Update cdevsw.  Block majors are out, kqfilters are in.
- No need to bzero softc's that we get from new-bus.  They come that way to
  begin with.
2002-11-08 21:10:53 +00:00
John Baldwin 7b3ac8969c Move include of opt_fb.h earlier so that FB_INSTALL_CDEV is defined in
included headers.
2002-11-08 21:04:44 +00:00
John Baldwin 3f57c87ebf Fix printf warnings with %j and uintmax_t. 2002-11-08 20:59:23 +00:00
John Baldwin 108a50d232 Use critical_enter/exit instead of disable/enable_intr to make this
driver more portable.
2002-11-08 18:32:57 +00:00
John Baldwin 672cc99ed3 - Change the ATM stack functions to use intptr_t instead of int for opaque
arguments.
- Fix a few other places that assumed that sizeof(int) == sizeof(void *).

Reviewed by:	mdodd
2002-11-08 18:27:30 +00:00
Prafulla Deuskar 1d966d27b1 - Set RS (Report Status) bit on all descriptors of a packet instead of just the last one.
- Set RDTR to zero by default instead of 28.
- Fixed a problem with TX hangs with jumbo frames when number of fragments in the mbuf chain
is large.
- Added support for 82540EP based cards.

MFC after:	3 days
2002-11-08 18:14:17 +00:00
John Baldwin f47789c828 Use %z to print a size_t value. 2002-11-08 14:58:35 +00:00
Michael Reifenberger ad59e7ecbd Reviewed by: n_hibma
MFC after:	2 weeks
fix XPT_CALC_GEOMETRY to fill in some reasonable values.
Inspired by aic/sbp.
2002-11-08 07:57:42 +00:00
John Baldwin f544691671 - Use %p to print pointers instead of casting pointers to an int and using
0x%x.
- Add a cast to quiet a warning.
2002-11-07 22:25:13 +00:00
John Baldwin 482a5259ac Use [u]intmax_t and %j instead of long long and %ll to better fix warnings
I fixed earlier.

Requested by:	mux, jake
2002-11-07 22:23:46 +00:00
John Baldwin 7399a5ddd0 Make 'rclk' a uintptr_t to quiet warnings. 2002-11-07 22:22:10 +00:00
John Baldwin d0ffe397df Use %z and %j to quiet warnings. 2002-11-07 22:21:38 +00:00
John Baldwin 2fc606e29c Cast a pointer to a uintptr_t instead of a u_int. 2002-11-07 22:21:10 +00:00
John Baldwin 148aade5cb Fix the rest of the 64-bit warnings for the sr(4) driver. 2002-11-07 22:20:22 +00:00
John Baldwin 50be24a116 Explicitly cast daddr_t's to long long's when printing them since daddr_t
is not long long on all archs.  (They happen to be long's on 64-bit arch's
and gcc considers that significant enough to warn about it.)  These should
probably be uintmax_t but I didn't feel like adding all the extra includes.
2002-11-07 21:52:51 +00:00
John Baldwin 9cbe11ea18 Cast a ptrdiff_t value to an int to quiet a warning since we don't support
%t in the kernel printf yet.
2002-11-07 21:34:21 +00:00
John Baldwin 34c7d76e45 Quiet some DIAGNOSTIC printf warnings with band-aid casts. 2002-11-07 21:25:49 +00:00
John Baldwin 40e8bd8c76 Print pointers with %p instead of casting them to an unsigned int and
then printing them with 0x%x which doesn't work when sizeof(void *) >
sizeof(int).
2002-11-07 21:19:47 +00:00
John Baldwin 1a8fc7d6a0 Fix lots of places that assume sizeof(int) == sizeof(void *). Most of
these were cosmetic.  However, at least two of these changes fix bugs
where a (fake) pointer to a RX descriptor was added to the physical
memory start address with the cast in the wrong place resulting in
rxdesc[pmem_start] instead of (uintptr_t)rxdesc + pmem_start.
2002-11-07 21:13:15 +00:00
John Baldwin 551d543a17 Cast a pointer to uintptr_t instead ot u_int. 2002-11-07 19:56:21 +00:00
John Baldwin 8d667a42c4 d_read_t functions return an int, not a ssize_t. (Considering the fact
that read(2) returns a ssize_t perhaps this is a bug in d_read_t?)
2002-11-07 17:26:38 +00:00
John Baldwin a885bb6007 Warning fixes for sizeof(int) != sizeof(void *). 2002-11-07 17:25:33 +00:00
John Baldwin 9e14a48a03 - Make 'irq' intptr_t instead of uintptr_t so it handles a value of -1
properly.
- Add a cast to quiet a printf warning.
2002-11-07 17:20:58 +00:00
Ian Dowse 947e381597 Properly fix the occassional random crash issue that revision 1.142
just limited to the DEVICE_POLLING case. This removes the FXP_RFA_RNRMARK
hack, and replaces it with a softc flag that is used to record when
the handling of a no-resource condition was deferred due to running
out of DEVICE_POLLING cycles. This was tested on -stable, but the
code is essentially the same as in -current. It should only affect
the case where DEVICE_POLLING is defined.

The details of the mechanism behind the crashes are still uncertain
but the most likely cause seems to be some kind of hardware confusion
when the no-resource recovery code is accidentally invoked while
the receiver is still active. This could have happened if the
hardware left the 0x4000 bit of the RFA status word set. The comments
in the commit log for revision 1.142 stating that the driver could
clash with the hardware writing to this status word were not correct.

Tested by:	Guy Helmer <ghelmer@palisadesys.com>
2002-11-07 16:04:07 +00:00
Hidetoshi Shimokawa 70ce30b573 - Fix printf warnings on 64bit plathome.
- Disable fw_vmaccess() because it's not used and unuseful 64bit plathome.
2002-11-07 02:13:40 +00:00
John Baldwin f77f866d28 Adjust some casts to quiet warnings.
Reviewed by:	mdodd
2002-11-06 22:58:55 +00:00
John Baldwin 34fa34334e Use long long to print out a bus_addr_t again. 2002-11-06 22:42:45 +00:00
John Baldwin b1e014fc3a Cast a bus_addr_t to a long long to make printf happy. 2002-11-06 22:40:01 +00:00
Josef Karthauser 8ecdcb3ff3 Packed structures are defined differently in older gcc's, like the one
currently in -stable.  Put the exception into usb.h instead of having it
hard coded in the sound code.
2002-11-06 21:37:21 +00:00
John Baldwin a1571cd12f Use bus_addr_t instead of u_int32_t in functions to convert between
physical and virtual addresses.
2002-11-06 21:19:17 +00:00
John Baldwin 02ccdce8db Use the explicit value 0xffffffff instead of assuming that is what ~0UL
equals.

Approved by:	imp
2002-11-06 20:40:29 +00:00
John Baldwin f37f15337d Add some band-aid casts to quiet warnings. This driver still assumes
that sizeof(int) == sizeof(void *) == 4.  However, it also seems that the
hardware assumes this.
2002-11-06 20:34:38 +00:00
John Baldwin cb27d4c7cd More int != pointer stuff. 2002-11-06 20:16:39 +00:00
John Baldwin a7a1238911 Repeat after me: sizeof(int) != sizeof(void *). 2002-11-06 20:04:41 +00:00
John Baldwin 929791c8cc Use some long long casts to quiet warnings in debug printf's on alpha. 2002-11-06 19:52:13 +00:00
John Baldwin ba76c5a2c1 Use a bandaid to fix a warning. However, this driver is very, very far
from being MI in any fashion.  It currently "assumes" that it can get
a kernel virtual address for a phyiscal address by adding KERNBASE to the
physical address.  It also tries to read values out of a the PC BIOS on
all archs.  It also uses "manual" inb() and outb()'s to talk to the mcclock
device which just happens to be at that location on both i386 and alpha.
This driver should likely be i386-only.
2002-11-06 19:42:59 +00:00
John Baldwin fee174cd9c Fix warning where sizeof(size_t) != sizeof(int). 2002-11-06 18:55:24 +00:00
Hidetoshi Shimokawa 196c0df6ca Add support for DEVICE_POLLING.
PR: kern/44772
Submitted by: Takashi Oono <takashi@yha.att.ne.jp>
MFC after: 1 week
2002-11-06 15:50:32 +00:00
Hidetoshi Shimokawa 1d3e59b1d3 Minor clean up on cdb handling. 2002-11-06 15:34:52 +00:00
Josef Karthauser cfccb34a24 There's no need for a locally defined usb_proc_t when we've got
usb_proc_ptr that does the same thing.
2002-11-06 14:29:27 +00:00
Matthew N. Dodd 99af1d6f76 Whitespace, style fixes. 2002-11-06 08:08:55 +00:00
Hidetoshi Shimokawa aeeb228712 - Let the PCI code try to route interrupt in -current
- Print warning in -stable.
2002-11-06 04:07:05 +00:00
Matthew N. Dodd 791e59f673 Remove undefined variable.
Somehow this didn't make it in the last commits.
2002-11-05 10:56:14 +00:00
Matthew N. Dodd 71c5ce8d59 Style/whitespace changes. 2002-11-05 10:12:03 +00:00
Matthew N. Dodd ec5de1cce2 Fix for GEOM.
Tested on:	 i386
2002-11-05 09:50:15 +00:00
Matthew N. Dodd 6fe8789d6d - Convert to newbus, bus_space etc.
- Move to MI space.

Tested on:	 i386
2002-11-05 09:37:32 +00:00
Hidetoshi Shimokawa 851c3ad031 Sony CXD3222 OHCI i.LINK chips needs more DELAY before starting SCLK
when no devices are connected.
2002-11-05 02:42:28 +00:00
Olivier Houchard e33bee0756 Call pcm_chn_destroy() in pcm_killchan() so that channel mutexes are destroyed and struct pcm_channel freed.
Reviewed by:	cg
MFC after:	3 days
2002-11-04 19:12:02 +00:00
Warner Losh 518792d85c Detach the pccard bus children when we eject a 16-bit card, not the
32-bit ones.  This was introduced in the last commit.
2002-11-04 03:01:56 +00:00
Mitsuru IWASAKI 9bb04eb483 Add status initialization code for acpi_cmbat and acpi_acad,
acpi_cmbat_init_battery() and acpi_cmbat_init_acline() respectively.
Call acpi_cmbat_init_battery() from acpi_cmbat_resume() too just in
case.
This is a workaround for embedded controller operations which is
unstable for about a minute (typically 30 or 40 sec.) at boot time.
2002-11-03 10:49:24 +00:00
Warner Losh bcaa6b0541 MFp4:
o Always release the resources on device detach.
o Attach resources the same with driver added as we do we do in the insert
  case (maybe this should be a routine).
o signal the wakeup of the thread on resume instead of trying to force an
  interrupt.
o Minor debug hacks.
o use 0xffffffff instead of -1 for uint32_t items.
o Don't complain when we're asked to detach no cards.  This is normal.
o Eliminate the now worthless second parameter to card_detach_card.
o minor style(9)isms

Some of these patches may be from: iwasaki-san, jhb, iadowse
2002-11-02 23:00:28 +00:00
Matthew N. Dodd 30201b6cef Merge PC98 changes. 2002-11-02 04:18:10 +00:00
Ian Dowse 9ce4f7a0f0 Specify the correct protocol for the Olympus C-1 camera. It appears
that this entry was accidentally given the wrong protocol in revision
1.61.

PR:		kern/42417
Submitted by:	"Moriki, Toshiomi" <toshiomi@whi.m-net.ne.jp>
2002-11-01 01:13:20 +00:00
Mitsuru IWASAKI 21ac81ad19 Don't examine ACPI_STA_ENABLE bit of device's_STA object on initial
state.  Instead, use ACPI_STA_PRESENT and ACPI_STA_FUNCTIONAL for it.
In some ACPI BIOS implementations, boot disabled devices don't have
ACPI_STA_ENABLE bit in _STA object.
Also it is not fatal if getting current IRQ of boot disabled devices
is failed in initial state.

And minor fixes.
2002-10-31 20:43:02 +00:00
Mitsuru IWASAKI 498d464fe9 Interpret new loader tunable "hw.acpi.verbose" to turn
verbose mode on at boot time.
2002-10-31 20:23:41 +00:00
Mitsuru IWASAKI 91da7c40b2 Invoke 3 ACPI task threads as default if option ACPI_MAX_THREADS is
not defined.
To make previous default behavior (ACPI_MAX_THREADS undefined), define
option ACPI_MAX_THREADS as 0.
2002-10-31 17:58:39 +00:00
Eric Moore f462788495 Incorrect typecast. 2002-10-31 14:10:00 +00:00
Peter Wemm 700f053192 Add tunable "hw.eisa_slots" to allow overriding the default number
of slots (10).
2002-10-31 00:45:49 +00:00
Eric Moore e8b5e74b61 amr.c,
amr_cam.c,
amrreg.h,
amrvar.h:
- added support for 12/16 byte cdb's, effecting CAM branch only ( non-disk support )

amrreg.h:
- increased number of scatter gather elements from 16 to 26.

amr_pci.c:
- amr_pci_free(), incorrect bus tag meant for 'amr_mailbox_dmat' was being freed

all:
- copyright change requested by scottl

Reviewed by:	ps,scottl
MFC after:	1 week
2002-10-30 22:00:11 +00:00
Ian Dowse 58164331e3 Save and restore the interrupt Edge/Level Control Registers (ELCR)
across system suspends on the Intel 82371AB PCI-ISA bridge. On a
Sony Vaio C1XD that I have, these registers are not set correctly
after an ACPI resume. The result is that after resuming, a shared
IRQ is left in edge-triggered mode so the interrupt can later become
jammed in a state where the line remains asserted, but the handler
is never called.

Reviewed by:	jhb
2002-10-30 19:55:06 +00:00
Ian Dowse cb0d1e061b Revision 1.136 introduced two features that may cause undefined
behaviour of the hardware: a possibly reserved bit of the receive
descriptor (RFA) `status' field is borrowed to record no-resource
(RNR) events, and the same status field is read and written to at
a time that may clash with the hardware updating this field.

There is no hardware documentation available to determine if these
things are safe to do; the second issue almost certainly isn't, and
the first is only safe if there is documentation saying that this
bit is free to be used by the driver. The PR referenced below
provides extremely convincing evidence that the changes cause random
crashes on some (unusual) hardware.

Since these features are only required by the DEVICE_POLLING case,
this commit makes their use conditional on that option. It does not
change the DEVICE_POLLING case, but at least people with the rare
hardware on which this code causes problems can now avoid the crashes
by not enabling DEVICE_POLLING.

PR:		kern/42260
Reviewed by:	luigi
Problem revision found by: Pawel Malachowski <pawmal@unia.3lo.lublin.pl>
Tested by:	Pawel Malachowski <pawmal@unia.3lo.lublin.pl>
MFC after:	1 week
2002-10-30 19:08:56 +00:00
Ian Dowse 8a7562d079 Check for errors and zero-length transfers in the ulpt_input() input
pipe callback function, and just return if these cases are detected.
Without these checks, the ulpt driver may cause an infinite loop
of failing USB transfers that can hang the whole machine. This makes
printing work for me on a HP DJ950C printer.
2002-10-30 01:18:58 +00:00
John Baldwin ebc4ae3b74 Add a missing newline to the end of a device_printf().
Reported by:	Michael G. Petry <petry@NetMasters.Com>
2002-10-29 19:08:55 +00:00
Semen Ustimenko 07971c4102 Remove unnecessary <sys/malloc.h> include.
Submitted by:	marius@alchemy.franken.de
MFC after:	1 week
2002-10-29 00:20:47 +00:00
Scott Long 3754626f78 Reduce namespace pollution to userland.
Spotted-by:	bde
2002-10-28 17:08:07 +00:00
Matthew N. Dodd c7f718ec6a Handle hints for the atspeaker device.
Document same.
2002-10-28 02:00:09 +00:00
Maxime Henrion 4caad4e81d Fix a bunch of warnings on 64 bit platforms in the
CISS_DEBUG case by appropriately using %z and %j.
2002-10-27 12:27:04 +00:00
Maxime Henrion e6fccf7adf Fix a warning when CISS_DEBUG is defined. 2002-10-27 12:05:11 +00:00
Maxime Henrion a8cdde69c2 Add a missing destroy_dev(). 2002-10-26 18:09:30 +00:00
Thomas Moestl 08e0fdeb39 Call bpf_mtap() on outgoing packets. 2002-10-26 12:32:07 +00:00
Sam Leffler 57b6353534 o m_adj rx buffer so IP header is 32-bit aligned
o replace EPIC_MGETCLUSER with m_getcl

MFC after:	1 week
2002-10-25 22:06:03 +00:00
John Baldwin fbc9740955 Cast si_drv2 to intptr_t instead of int to quiet warnings.
Tested on:	alpha
Reported by:	marcel (on an ia64)
2002-10-25 20:49:24 +00:00
Mitsuru IWASAKI 4690674e12 Add new loader tunable hw.acpi.ec.event_driven so that we control
EcWaitEventIntr()'s behavior.
Some EC controllers require this for working properly (including
sleep/wakeup).
2002-10-24 10:56:33 +00:00
John Baldwin 599c57a971 - New-bussify the rc(4) device driver.
- Add detach support to the driver so that you can kldunload the module.
  Note that currently rc_detach() fails to detach a unit if any of its
  child devices are open, thus a kldunload will fail if any of the tty
  devices are currently open.
- sys/i386/isa/ic/cd180.h was moved to sys/dev/ic/cd180.h as part of
  this change.

Requested by:	rwatson
Tested by:	rwatson
2002-10-23 15:53:09 +00:00
Hidetoshi Shimokawa 06a93bac4f - Dequeue OCBs more safely in sbp_abort_all_ocbs(). 2002-10-23 13:04:02 +00:00
Mark Murray 64f82235d8 Very minor whitespace/style nit. 2002-10-23 10:14:30 +00:00
Thomas Quinot e937fdbdcd Fill in missing parts of the ATAPI/CAM XPT: implement XPT_RESET_BUS
and XPT_RESET_DEV.

In order to properly handle reset requests whether they originate in the
ATA layer (atacontrol reinit) or from the CAM layer (camcontrol reset)
ata_reinit does not cause the SIM to be deallocated anymore. The SIM
is now unconditionnally created for each ATAPI bus.

This change may cause existing bus ids to change on some setups.

Reviewed by:	roberto
Approved by:	sos
2002-10-22 20:18:51 +00:00
Semen Ustimenko 52d0ed1d0d Remove the OpenBSD comatibility stuff. Many changes to be more style(9)
compilant. Split two pieces if code into separate functions to do not
exceed line length due to indentation.
2002-10-22 00:57:51 +00:00
Poul-Henning Kamp 8689acc48c We want /dev/md0 for ramdisk roots, not /dev/md0c.
Sponsored by:	DARPA & NAI Labs
2002-10-21 20:08:28 +00:00
Hidetoshi Shimokawa 8e484a62c8 - Abort all OCBs for timeout.
- Improve warning message.
2002-10-21 15:36:59 +00:00
Hidetoshi Shimokawa 481df042ff fix prototype of asyreqq(). 2002-10-21 10:21:49 +00:00
Hidetoshi Shimokawa 41d45c5235 These (userland) files shouldn't be here. 2002-10-21 10:14:26 +00:00
Robert Drehmel 47e40520dd Do not try to work around ``poor (un)sign extension code''
creation by GCC-2.6.3.  Casting pointers to unsigned char
to volatile pointers to unsigned char seemed to produce
better results on the ia32 architecture with old versions
of GCC.
The current FreeBSD system compiler GCC-3.2.1 emits
better sign extension code for non-volatile variables:

volatile char c;
int i = c;

is compiled to:
...
movb	-1(%ebp), %al
movbsl	%al, %eax
movl	%eax, -8(%ebp)
...

char c;
int i = c;

is compiled to:
...
movbsl	-1(%ebp), %eax
movl	%eax, -8(%ebp)
...

The same holds for zero-extension of dereferenced pointers
to volatile unsigned char.
When compiled on alpha or sparc64, the code produced for the
two examples above does not differ.
2002-10-20 22:50:13 +00:00
Poul-Henning Kamp 975b628f27 Use ENOSPC error return, not ENOMEM.
Use %jd rather than %lld.
2002-10-20 20:50:31 +00:00
Poul-Henning Kamp 858b84f550 '&' is not needed to pointerize functions.
Spotted by:	FlexeLint
2002-10-20 20:42:25 +00:00
Tor Egge 0a676b7eb6 Fix data corruption caused by last byte in oddly sized transfers being read
to wrong location in RxBuf and written from wrong location in TxBuf.
2002-10-20 18:43:11 +00:00
Poul-Henning Kamp 4294d700d6 Fix mis-indentation.
Approved by:	scottl
2002-10-20 16:00:43 +00:00
Poul-Henning Kamp 18a084cf21 Fix mis-indentation.
Spotted by:	FlexeLint
2002-10-20 08:46:56 +00:00
Scott Long f9d186edc8 After much delay and anticipation, welcome RAIDFrame into the FreeBSD
world.  This should be considered highly experimental.

Approved-by:	re
2002-10-20 08:17:39 +00:00
Alexander Kabaev 87e89c7595 Whitespace fixes per style(9)
Approved by:	obrien
2002-10-19 21:58:11 +00:00
Nate Lawson 76ba4ecdad * Add CDRIOC{READ,WRITE}SPEED ioctls to cd(4). Units are in KB/sec.
* Change atapi-cd ioctls to use the same units.
* Change burncd, cdcontrol to convert CDROM speed to KB/sec before
calling the ioctl.  Add a "max" speed option for their command lines.

This change does not break ABI but does change the units passed through
the ioctl so 3rd party software that uses cdrio.h will have to convert
(most likely by multiplying CDROM speed by 177 to get KB/s).

PR:		kern/36845
Submitted by:	Philipp Mergenthaler <p@i609a.hadiko.de> (CAM ioctls)
Reviewed by:	sos, ken
MFC after:	1 month
2002-10-18 22:03:39 +00:00
Eric Moore 1a6b414672 (1) added LSI Logic copyright, and legal line 3 in license, and string
changes for "LSILogic"
(2) enabled non-disk support through CAM interface
(3) HA_INQ (a) enabled tagged queuing (b) disable reset during
	driver loading (b) renamed BSDi string to LSI
(4) disabled detecting disk devices during SCSI INQUIRY
(5) changed dcdb single element sglist to send one entire buffer chunk
(6) nsgelem not set in sglist
(7) ap_data_transfer_length not set for dcdb
(8) changed "struct thread" to "d_thread_t" for compatibliity { xxx_open,
	xxx_close, xxx_ioctl }
(9) miscellaneous compatiblity fixes
(10) bug fix for 0x0409/0x1000 card
(11) added compiling amr_cam.c in sys/conf/files
(12) added compiling amr_cam.c in sys/modules/amr/Makefile

Reviewed by:ps
MFC after:1 week
1 week
2002-10-18 21:29:14 +00:00
Thomas Moestl de540622df Add a pseudo device which allows to access the OpenFirmware device tree
via ioctl()s. This was ported from NetBSD and adapted a bit to better
match our OpenFirmware support code.
2002-10-18 15:23:43 +00:00
Thomas Moestl 89492ca471 Add an #ifdef _KERNEL to make it possible to include this file from
userland (to get the typedefs).
2002-10-18 15:21:09 +00:00
Yoshihiro Takahashi 0399c2578e typo.
Submitted by:	SAWADA Hodaka <hoda@tail.gr.jp>
MFC after:	1 day
2002-10-18 12:06:01 +00:00
Kelly Yancey 30c0d52181 Make kqueue(2) work for virtual terminals.
PR:		40486
Submitted by:	Jilles Tjoelker <jilles+fbsd-bugs@stack.nl>
2002-10-17 05:48:56 +00:00
Marcel Moolenaar e9be79d69c Suppress the uninitialized variable warning on ia64 introduced by
the previous commit by initializing i and j. These initializations
will normally be eliminated by the compiler.
2002-10-17 03:45:34 +00:00
John Baldwin f371d460e6 Whitespace. 2002-10-16 19:11:59 +00:00
John Baldwin fc0ea94a7d Catch up to changes in acpivar.h to add support for using ACPI on
4-stable systems.

Sponsored by:	The Weather Channel
2002-10-16 17:28:53 +00:00
John Baldwin 3a65df0084 struct timecounter is defined in sys/time.h on 4-stable.
Sponsored by:	The Weather Channel
2002-10-16 17:27:40 +00:00
John Baldwin 0b1d1f1afb - Include lock headers on current in this header instead of putting
#if's in all the other ACPI source files.
- Use splhigh() for the ACPI subsystem lock on 4-stable.

Sponsored by:	The Weather Channel
2002-10-16 17:27:11 +00:00
John Baldwin 680717ff9e - In AcpiOsGetThreadId(), allow for curproc to be NULL on 4-stable systems.
In that case use proc0's pid to return the thread ID.
- For 4-stable, use the generic swi taskqueue for ACPI events rather than
  implementing our own.

Sponsored by:	The Weather Channel
2002-10-16 17:25:29 +00:00
John Baldwin b60bd0c129 Implement the internal locks of an ACPI semaphore with splhigh() on
4-stable.  -current uses a mutex for this purpose.

Sponsored by:	The Weather Channel
2002-10-16 17:23:34 +00:00
Sam Leffler 0f0d411b6c whitespace/indentation fix from phk 2002-10-16 17:07:41 +00:00
Mitsuru IWASAKI 93569b6b3a Fix a possible bug about freeing non-malloc'ed pointer.
Suggested by:	jhb (in -current ML)
2002-10-16 15:42:27 +00:00
Mark Murray f544a52873 Module-ize the 'core' crypto stuff. This may still need to be compiled
into the kernel by default (if required), but other modules can now
depend() on this.

Fix inter-module dependancy.

Earlier version OK'ed by:	sam
2002-10-16 14:31:34 +00:00
Robert Drehmel 4bcea0f89c Cast the first argument to bzero() to `void *' after casting it to
`uintptr_t' to pass it as the type bzero() expects.
2002-10-16 11:15:35 +00:00
Poul-Henning Kamp 3412120f03 Be consistent about funtions being static.
Spotte by:	FlexeLint.
2002-10-16 10:16:17 +00:00
Poul-Henning Kamp 88647b6de5 Be consistent about functions being static.
Properly put macro args in ().

Spotted by:	FlexeLint.
2002-10-16 09:14:59 +00:00
Poul-Henning Kamp 2c876e15c8 Be consistent about functions being static.
Spotted by:	FlexeLint.
2002-10-16 09:04:52 +00:00
Poul-Henning Kamp 031fd299d7 Be consistent about functions being static.
Spotted by:	FlexeLint.
2002-10-16 08:48:39 +00:00
Poul-Henning Kamp 4d8d520f17 Fix misindentation.
Spotted by:	FlexeLint
2002-10-16 08:45:34 +00:00