- fixed warnings, produced by Haiku version of gcc;
- space-based indentations replaced with tab-based ones; - a bit of cleanup; git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18785 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,9 +1,15 @@
|
|||||||
/*
|
/**
|
||||||
* Copyright (c) 2003-2005 by Siarzhuk Zharski <[email protected]>
|
*
|
||||||
* Distributed under the terms of the BSD License.
|
* TODO: description
|
||||||
|
*
|
||||||
|
* This file is a part of USB SCSI CAM for Haiku OS.
|
||||||
|
* May be used under terms of the MIT License
|
||||||
|
*
|
||||||
|
* Author(s):
|
||||||
|
* Siarzhuk Zharski <[email protected]>
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** SCSI commands transformations support */
|
/** SCSI commands transformations support */
|
||||||
|
|
||||||
#include "usb_scsi.h"
|
#include "usb_scsi.h"
|
||||||
@@ -14,10 +20,22 @@
|
|||||||
#include "scsi_commands.h"
|
#include "scsi_commands.h"
|
||||||
//#include "proto_common.h"
|
//#include "proto_common.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
#include "strings.h"
|
||||||
|
|
||||||
#define UFI_COMMAND_LEN 12
|
#define UFI_COMMAND_LEN 12
|
||||||
#define ATAPI_COMMAND_LEN 12
|
#define ATAPI_COMMAND_LEN 12
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
scsi_transform(usb_device_info *udi, uint8 *cmd,
|
||||||
|
uint8 len, uint8 **rcmd, uint8 *rlen);
|
||||||
|
static status_t rbc_transform(usb_device_info *udi, uint8 *cmd,
|
||||||
|
uint8 len, uint8 **rcmd, uint8 *rlen);
|
||||||
|
static status_t ufi_transform(usb_device_info *udi, uint8 *cmd,
|
||||||
|
uint8 len, uint8 **rcmd, uint8 *rlen);
|
||||||
|
static status_t atapi_transform(usb_device_info *udi, uint8 *cmd,
|
||||||
|
uint8 len, uint8 **rcmd, uint8 *rlen);
|
||||||
|
static status_t qic157_transform(usb_device_info *udi, uint8 *cmd,
|
||||||
|
uint8 len, uint8 **rcmd, uint8 *rlen);
|
||||||
/**
|
/**
|
||||||
\fn:transform_6_to_10
|
\fn:transform_6_to_10
|
||||||
\param cmd: SCSI command buffer to be transformed
|
\param cmd: SCSI command buffer to be transformed
|
||||||
@@ -29,10 +47,8 @@
|
|||||||
returned in rcmd parameter. In case if no transformation was performed the return
|
returned in rcmd parameter. In case if no transformation was performed the return
|
||||||
buffer is untouched.
|
buffer is untouched.
|
||||||
*/
|
*/
|
||||||
static bool transform_6_to_10(uint8 *cmd,
|
static bool transform_6_to_10(uint8 *cmd, uint8 len,
|
||||||
uint8 len,
|
uint8 **rcmd, uint8 *rlen)
|
||||||
uint8 **rcmd,
|
|
||||||
uint8 *rlen)
|
|
||||||
{
|
{
|
||||||
bool transformed = true;
|
bool transformed = true;
|
||||||
scsi_cmd_generic_6 *from = (scsi_cmd_generic_6 *)cmd;
|
scsi_cmd_generic_6 *from = (scsi_cmd_generic_6 *)cmd;
|
||||||
@@ -82,11 +98,8 @@ static bool transform_6_to_10(uint8 *cmd,
|
|||||||
transforms a 6-byte command to 10-byte depending on information provided with
|
transforms a 6-byte command to 10-byte depending on information provided with
|
||||||
udi object.
|
udi object.
|
||||||
*/
|
*/
|
||||||
static bool transform_cmd_6_to_10(usb_device_info *udi,
|
static bool transform_cmd_6_to_10(usb_device_info *udi, uint8 *cmd,
|
||||||
uint8 *cmd,
|
uint8 len, uint8 **rcmd, uint8 *rlen)
|
||||||
uint8 len,
|
|
||||||
uint8 **rcmd,
|
|
||||||
uint8 *rlen)
|
|
||||||
{
|
{
|
||||||
bool transformed = true;
|
bool transformed = true;
|
||||||
scsi_cmd_generic_6 *from = (scsi_cmd_generic_6 *)cmd;
|
scsi_cmd_generic_6 *from = (scsi_cmd_generic_6 *)cmd;
|
||||||
@@ -124,10 +137,8 @@ static bool transform_cmd_6_to_10(usb_device_info *udi,
|
|||||||
on properties provided with udi object.
|
on properties provided with udi object.
|
||||||
*/
|
*/
|
||||||
static bool transform_cmd_test_unit_ready(usb_device_info *udi,
|
static bool transform_cmd_test_unit_ready(usb_device_info *udi,
|
||||||
uint8 *cmd,
|
uint8 *cmd, uint8 len,
|
||||||
uint8 len,
|
uint8 **rcmd, uint8 *rlen)
|
||||||
uint8 **rcmd,
|
|
||||||
uint8 *rlen)
|
|
||||||
{
|
{
|
||||||
bool transformed = false;
|
bool transformed = false;
|
||||||
if(HAS_FIXES(udi->properties, FIX_TRANS_TEST_UNIT)){
|
if(HAS_FIXES(udi->properties, FIX_TRANS_TEST_UNIT)){
|
||||||
@@ -154,11 +165,8 @@ static bool transform_cmd_test_unit_ready(usb_device_info *udi,
|
|||||||
was performed resulting command buffer points to original one.
|
was performed resulting command buffer points to original one.
|
||||||
*/
|
*/
|
||||||
status_t
|
status_t
|
||||||
scsi_transform(usb_device_info *udi,
|
scsi_transform(usb_device_info *udi, uint8 *cmd,
|
||||||
uint8 *cmd,
|
uint8 len, uint8 **rcmd, uint8 *rlen)
|
||||||
uint8 len,
|
|
||||||
uint8 **rcmd,
|
|
||||||
uint8 *rlen)
|
|
||||||
{
|
{
|
||||||
status_t status = B_OK;
|
status_t status = B_OK;
|
||||||
bool transformed = false;
|
bool transformed = false;
|
||||||
@@ -196,11 +204,8 @@ scsi_transform(usb_device_info *udi,
|
|||||||
it tries to make some workarounds for "brocken" USB devices. If no transformation
|
it tries to make some workarounds for "brocken" USB devices. If no transformation
|
||||||
was performed resulting command buffer points to original one.
|
was performed resulting command buffer points to original one.
|
||||||
*/
|
*/
|
||||||
status_t rbc_transform(usb_device_info *udi,
|
status_t rbc_transform(usb_device_info *udi, uint8 *cmd,
|
||||||
uint8 *cmd,
|
uint8 len, uint8 **rcmd, uint8 *rlen)
|
||||||
uint8 len,
|
|
||||||
uint8 **rcmd,
|
|
||||||
uint8 *rlen)
|
|
||||||
{
|
{
|
||||||
status_t status = B_OK;
|
status_t status = B_OK;
|
||||||
bool transformed = false;
|
bool transformed = false;
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
/*
|
/**
|
||||||
* Copyright (c) 2003-2005 by Siarzhuk Zharski <[email protected]>
|
*
|
||||||
* Distributed under the terms of the BSD License.
|
* TODO: description
|
||||||
|
*
|
||||||
|
* This file is a part of USB SCSI CAM for Haiku OS.
|
||||||
|
* May be used under terms of the MIT License
|
||||||
|
*
|
||||||
|
* Author(s):
|
||||||
|
* Siarzhuk Zharski <[email protected]>
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** decalration of SCSI commands transformation procedures */
|
/** decalration of SCSI commands transformation procedures */
|
||||||
|
|
||||||
#ifndef _TRANSFORM_PROCS_H_
|
#ifndef _TRANSFORM_PROCS_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user