Commit Graph

1266 Commits

Author SHA1 Message Date
drochner
983ec2783f split device/softc for sd (tested with a USB stick) 2008-07-16 18:54:09 +00:00
drochner
a3df0dfc03 split device/softc for scsibus 2008-07-16 18:50:58 +00:00
drochner
cc7bfbe664 set the buffer's "resid" if a raw SCSI command fails, otherwise a
diagnostic check in kern_physio is set up
2008-07-14 12:36:44 +00:00
hannken
773658bf7e The Intel SCA backplane "ESG-SHV" does not support logical units. 2008-07-03 13:22:31 +00:00
cegger
708f88d69f use device_lookup_private to get softc 2008-06-12 23:06:14 +00:00
tsutsui
887a89aa5c Use device_lookup_private() rather than using cd_devs[] directly to get softc.
XXX maybe we should change a type of cd_devs[] in struct cfdriver
    from (void *) to device_t.
2008-06-08 18:18:33 +00:00
jnemeth
c93b478e9f add support for drvctl properties 2008-05-12 21:39:56 +00:00
tron
4f712549a9 Fix SSP kernel builds. 2008-05-12 09:41:02 +00:00
mlelstv
42e9b7252f Reintroduce the NODOORLOCK quirk. Helps with PR kern/23875. 2008-05-11 05:17:23 +00:00
reinoud
ffc24fca06 Implement write support for the MMC framework. This consists of a setting
up of write parameters call and a call to perform a series of operations on
these devices.

Note that the MMC framework interface is still not exposed to userland
unless the expose_mmc flag is set. This is to prevent applications to build
on a possibly still moving target. This flag will eventually be removed.
2008-05-08 12:57:19 +00:00
yamt
c331e3e5e9 getiobuf(false, NULL) -> getiobuf(NULL, false) 2008-05-06 11:08:19 +00:00
reinoud
62c4a64698 Extend the MMC framework to also create sensible reports on audio discs. 2008-05-02 16:06:38 +00:00
reinoud
f83002a905 Add definitions for the close track/session, reserve track and repair
track SCSI commands.
2008-05-02 15:56:25 +00:00
reinoud
87bf4ab915 Fixup CD and DVD drives that appear to be on crack when reporting features.
They state f.e. that a recordable CD-R is rewritable or completely forget
that the fixed packet size formatted CD-RW is strict overwrite rewritable
and not randomly rewritable.
2008-05-02 15:53:10 +00:00
reinoud
8d14ab3bcb Make the SCSI sense code "Logical Unit Not Ready, Operation In Progress"
(Sense code 0x04, 0x07) not a fatal error anymore but retry command later.
This sense code can be returned on a CD-MRW write that encounters a bad
block resulting in the drive being busy relocating it. During that time it
can return this sense code to indicate its busy for a while.

Also reduce waiting time for the other "Logical Unix Not Ready, Long Write
In Progress" to half a second.
2008-05-02 15:34:16 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
cegger
13783bfd7e use aprint_*_dev and device_xname 2008-04-05 15:47:00 +00:00
cube
58f7b5e1f3 Split device_t for cd(4). 2008-03-24 18:27:06 +00:00
cube
b1be269fbd Split device_t and softc for atapibus(4). 2008-03-24 14:44:26 +00:00
cube
7aa6248cdf Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
2008-03-18 20:46:35 +00:00
yamt
ed28705cce fix a double-free bug introduced by the following change. PR/38179.
revision 1.75
    date: 2008/01/29 17:26:57;  author: dyoung;  state: Exp;  lines: +34 -15
    Use device_t.  Add a handler for child detachment.  Now I can detach
    cd0 at atapibus0 without getting a panic when atapibus0 detaches,
    later.
2008-03-08 10:31:52 +00:00
rmind
c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
dyoung
f612df5fb6 Use PMF_FN_ARGS, PMF_FN_PROTO. 2008-02-29 06:38:28 +00:00
drochner
e4b37a874e put back the old shutdown handlers to flush the disk cache,
the pmf API can't deal with all the different suspend/resume/reboot
cases well yet, so better keep suspend/resume and reboot/halt/poweroff
clearly seperated
2008-02-21 21:52:06 +00:00
dyoung
534869a24d Use device_t. Add a handler for child detachment. Now I can detach
cd0 at atapibus0 without getting a panic when atapibus0 detaches,
later.
2008-01-29 17:26:57 +00:00
ad
0664a0459b Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
2008-01-04 21:17:40 +00:00
ad
4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
perry
b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
dyoung
6f3852fab4 Constify struct ifnet->if_sadl and every use throughout the tree.
Add if_set_sadl() that both sets the link-layer address length and
replaces the current link-layer address with a new one, and use it
throughout the tree.
2007-12-20 21:08:17 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
pooka
4e38160d4d Do not "return 1" from kqfilter for errors. That value is passed
directly to the userland caller and results in a mysterious EPERM.
Instead, return EINVAL or something else sensible depending on the
case.
2007-12-05 17:19:46 +00:00
jmcneill
b276edd821 aprintify 2007-12-01 14:46:04 +00:00
reinoud
9c2e200bb1 Pullup fixes from UDF write development project. This patch fixes a
conceptional bug in mmc_discinfo, improves DVD+R feature detection and
prevents corruption of mmc_trackinfo readout on some devices that return
short trackinfo structures.
2007-11-27 18:06:37 +00:00
ad
a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
christos
b96c4fd9a6 PR/37108: Pauly Goyette: Compute the timeout value, before immediate is
changed for atapi tape drives.
2007-10-11 16:42:52 +00:00
ad
2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
bouyer
975e5c30a0 Move check for b_resid value to the right place. Should definitively fix
kern/36690.
2007-10-06 12:52:43 +00:00
bouyer
511e912cd0 When checking for invalid b_resid valyes, also check negative ones.
Should fix kern/36690.
2007-10-01 18:43:30 +00:00
bouyer
8d743383a3 Properly initialize xs_callout in sddump(). We're using a static scsipi_xfer
here which didn't get through scsipi_get_xs().
Pointed out by Greg Oster.
2007-10-01 18:16:05 +00:00
bouyer
adc1896a31 Properly set b_resid in an error case.
Clamp b_resid to b_bcount in case the info field is larger. Fix a KASSERT
in physio() when a media error occurs on my SDLT320 drive (maybe this drive
is bogus for not setting the highter bits to 0 in the INFO field in this
case).
2007-09-29 11:04:51 +00:00
dyoung
2cb874eb67 Remark that the data-length argument passed to se_scsipi_cmd() is
questionable.
2007-09-01 17:59:45 +00:00
dyoung
0c66a9f0cf Create a temporary, non-const copy of a sockaddr. Pass that to
se_set_multi() or se_remove_multi(), because neither is easily
constified.  Thanks jmmv@ for reporting the issue.
2007-09-01 17:57:02 +00:00
dyoung
dcd8923429 Change a bazillion occurrences of code resembling this,
error = (cmd == SIOCADDMULTI) ?
	    ether_addmulti(ifr, &sc->sc_ec) :
	    ether_delmulti(ifr, &sc->sc_ec);

	if (error == ENETRESET) {

to this,

	if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number.  This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
2007-09-01 07:32:22 +00:00
rumble
fbb550b94d Be sure not to make requests over MAXPHYS when employing bounce buffers.
It was previously possible to round up one sector length if the start block
were not properly aligned.

Resolves PR kern/36716. This may also fix the following reported issues
on port-sgimips:
    http://mail-index.netbsd.org/port-sgimips/2005/09/12/0000.html
    http://mail-index.netbsd.org/port-sgimips/2005/09/14/0000.html

While here, be sure to put back allocated bufs, which previously appear
to have been leaked. Further, remove the dead write bounce code which never
got executed anyway.

No complaints on tech-kern.
2007-08-04 02:58:59 +00:00
tsutsui
92b50ccb27 Don't allocate data buffer on stack in sd_read_capacity().
If data buffer is allocated on stack at the end of CPU cacheline,
the same cacheline region might be accessed via kernel stack even
after bus_dmamap_sync(9) against the data buffer in lower scsi drivers
so that read data via DMA could be lost.

Fixes occasional readdisklabel(9) failure at boot on ews4800mips
with osiop(4) driver and 128byte cacheline.

XXX: Other functions/drivers might have the similar problem.
2007-08-03 13:56:37 +00:00
ad
eb171eaaa7 It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:50:17 +00:00
ad
b5a9ff06f1 Replace some uses of lockmgr(). 2007-07-21 19:51:47 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
tsutsui
be8757ef61 Add __attribute__((__packed__)) to all command structures. 2007-07-01 05:17:28 +00:00
dsl
716dbe1abc The cd ioctl definitions are not condusive to being called from within
the kernel (eg from withthe linux compat code).
Add CDIOCREADSUBCHANNEL_BUF and CDIOREADTOCENTRIES_BUF which are like the
  existing ioctls withoutthe _BUF, except that the data area immediately
  follows the control structure (and is fixed length).
Modify scsipi/cd.c so that it only ever has one 'struct cd_formatted_toc'
  allocated on the stack (maybe this info ought to be in the softc)
  structure since even one 800 byte on-stack buffer isn't overly friendly.
cdplay(1) still seems able to read the track-list of an ATAPI cd.
2007-06-30 22:16:38 +00:00