* Added a TODO about reporting partial transfers.

* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36985 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-06-01 11:59:23 +00:00
parent 36f016ddbe
commit 266ee1f290
@@ -1,10 +1,11 @@
/* /*
* Copyright 2004-2008, Haiku, Inc. All Rights Reserved. * Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
* Copyright 2002/03, Thomas Kurschel. All rights reserved. * Copyright 2002/03, Thomas Kurschel. All rights reserved.
* *
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
//! Everything doing the real input/output stuff. //! Everything doing the real input/output stuff.
@@ -46,8 +47,7 @@ prevent_allow(scsi_periph_device_info *device, bool prevent)
} }
/** !!!keep this in sync with scsi_raw driver!!! */ /*! Keep this in sync with scsi_raw driver!!! */
static status_t static status_t
raw_command(scsi_periph_device_info *device, raw_device_command *cmd) raw_command(scsi_periph_device_info *device, raw_device_command *cmd)
{ {
@@ -142,10 +142,9 @@ periph_ioctl(scsi_periph_handle_info *handle, int op, void *buffer,
} }
/*! kernel daemon /*! Kernel daemon - once in a minute, it sets a flag so that the next command
once in a minute, it sets a flag so that the next command is executed is executed ordered; this way, we avoid starvation of SCSI commands inside
ordered; this way, we avoid starvation of SCSI commands inside the the SCSI queuing system - the ordered command waits for all previous
SCSI queuing system - the ordered command waits for all previous
commands and thus no command can starve longer then a minute commands and thus no command can starve longer then a minute
*/ */
void void
@@ -265,6 +264,7 @@ periph_io(scsi_periph_device_info *device, io_operation *operation,
// ask generic peripheral layer what to do now // ask generic peripheral layer what to do now
res = periph_check_error(device, request); res = periph_check_error(device, request);
// TODO: bytes might have been transferred even in the error case!
switch (res.action) { switch (res.action) {
case err_act_ok: case err_act_ok:
*_bytesTransferred = numBytes - request->data_resid; *_bytesTransferred = numBytes - request->data_resid;