- fixed warnings, produced by Haiku version of gcc;
- space-based indentations replaced with tab-based; - a bit of cleanup; git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18782 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
/*
|
/**
|
||||||
* 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]>
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "usb_scsi.h"
|
#include "usb_scsi.h"
|
||||||
@@ -16,7 +23,6 @@
|
|||||||
#define INQ_PRODUCT_LEN 0x10
|
#define INQ_PRODUCT_LEN 0x10
|
||||||
#define INQ_REVISION_LEN 0x04
|
#define INQ_REVISION_LEN 0x04
|
||||||
|
|
||||||
|
|
||||||
void fake_inquiry_request(usb_device_info *udi, CCB_SCSIIO *ccbio)
|
void fake_inquiry_request(usb_device_info *udi, CCB_SCSIIO *ccbio)
|
||||||
{
|
{
|
||||||
uint8 *data = ccbio->cam_data_ptr;
|
uint8 *data = ccbio->cam_data_ptr;
|
||||||
@@ -86,3 +92,4 @@ status_t fake_scsi_io(CCB_SCSIIO *ccbio)
|
|||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
/*
|
/**
|
||||||
* 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]>
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _FAKE_DEVICE_H_
|
#ifndef _FAKE_DEVICE_H_
|
||||||
|
|||||||
@@ -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]>
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** driver settings support implementation */
|
/** driver settings support implementation */
|
||||||
|
|
||||||
#include "usb_scsi.h"
|
#include "usb_scsi.h"
|
||||||
@@ -109,7 +115,7 @@ struct _settings_key{
|
|||||||
loads driver settings from extarnal settings file through BeOS driver
|
loads driver settings from extarnal settings file through BeOS driver
|
||||||
settings API. Called on initialization of the module
|
settings API. Called on initialization of the module
|
||||||
*/
|
*/
|
||||||
void load_module_settings()
|
void load_module_settings(void)
|
||||||
{
|
{
|
||||||
void *sh = load_driver_settings(MODULE_NAME);
|
void *sh = load_driver_settings(MODULE_NAME);
|
||||||
if(sh){
|
if(sh){
|
||||||
@@ -159,8 +165,7 @@ strncpy_value(char *to, driver_parameter *dp, size_t size)
|
|||||||
compose a bitmasked value from those settings
|
compose a bitmasked value from those settings
|
||||||
*/
|
*/
|
||||||
static uint32
|
static uint32
|
||||||
parse_transport(driver_parameter *dp,
|
parse_transport(driver_parameter *dp, int skkBase, int skkEnd,
|
||||||
int skkBase, int skkEnd,
|
|
||||||
uint32 vendor_prop, char *vendor_prop_name)
|
uint32 vendor_prop, char *vendor_prop_name)
|
||||||
{
|
{
|
||||||
uint32 ret = 0;
|
uint32 ret = 0;
|
||||||
@@ -193,8 +198,7 @@ parse_transport(driver_parameter *dp,
|
|||||||
parameters of private device settings if available
|
parameters of private device settings if available
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
lookup_device_info(uint16 product_id,
|
lookup_device_info(uint16 product_id, driver_parameter *dp,
|
||||||
driver_parameter *dp,
|
|
||||||
usb_device_settings *uds)
|
usb_device_settings *uds)
|
||||||
{
|
{
|
||||||
bool b_found = false;
|
bool b_found = false;
|
||||||
@@ -215,14 +219,12 @@ lookup_device_info(uint16 product_id,
|
|||||||
if(SK_EQUAL(dp->parameters[prm].name, skkProtocol)){
|
if(SK_EQUAL(dp->parameters[prm].name, skkProtocol)){
|
||||||
uds->properties |= parse_transport(&dp->parameters[prm],
|
uds->properties |= parse_transport(&dp->parameters[prm],
|
||||||
skkProtoBegin, skkProtoEnd,
|
skkProtoBegin, skkProtoEnd,
|
||||||
PROTO_VENDOR,
|
PROTO_VENDOR, uds->vendor_protocol);
|
||||||
uds->vendor_protocol);
|
|
||||||
} else
|
} else
|
||||||
if(SK_EQUAL(dp->parameters[prm].name, skkCommandSet)){
|
if(SK_EQUAL(dp->parameters[prm].name, skkCommandSet)){
|
||||||
uds->properties |= parse_transport(&dp->parameters[prm],
|
uds->properties |= parse_transport(&dp->parameters[prm],
|
||||||
skkCmdSetBegin, skkCmdSetEnd,
|
skkCmdSetBegin, skkCmdSetEnd,
|
||||||
CMDSET_VENDOR,
|
CMDSET_VENDOR, uds->vendor_commandset);
|
||||||
uds->vendor_commandset);
|
|
||||||
} else
|
} else
|
||||||
if(SK_EQUAL(dp->parameters[prm].name, skkFakeInq)){
|
if(SK_EQUAL(dp->parameters[prm].name, skkFakeInq)){
|
||||||
uds->properties |= FIX_NO_INQUIRY;
|
uds->properties |= FIX_NO_INQUIRY;
|
||||||
@@ -270,10 +272,8 @@ lookup_device_info(uint16 product_id,
|
|||||||
device information if available
|
device information if available
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
lookup_vendor_info(uint16 vendor_id,
|
lookup_vendor_info(uint16 vendor_id, uint16 product_id,
|
||||||
uint16 product_id,
|
driver_parameter *dp, usb_device_settings *uds)
|
||||||
driver_parameter *dp,
|
|
||||||
usb_device_settings *uds)
|
|
||||||
{
|
{
|
||||||
bool b_found = false;
|
bool b_found = false;
|
||||||
if(dp && dp->value_count > 0 && dp->values[0]){
|
if(dp && dp->value_count > 0 && dp->values[0]){
|
||||||
@@ -338,3 +338,4 @@ bool lookup_device_settings(const usb_device_descriptor *udd,
|
|||||||
} /* if(descr)*/
|
} /* if(descr)*/
|
||||||
return b_found;
|
return b_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,21 @@
|
|||||||
/*
|
/**
|
||||||
* 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]>
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** driver settings support definitions */
|
/** driver settings support definitions */
|
||||||
|
|
||||||
#ifndef _USB_SCSI_SETTINGS_H_
|
#ifndef _USB_SCSI_SETTINGS_H_
|
||||||
#define _USB_SCSI_SETTINGS_H_
|
#define _USB_SCSI_SETTINGS_H_
|
||||||
|
|
||||||
void load_module_settings();
|
void load_module_settings(void);
|
||||||
|
|
||||||
typedef struct{
|
typedef struct{
|
||||||
uint16 vendor_id;
|
uint16 vendor_id;
|
||||||
@@ -29,3 +35,4 @@ extern bool b_reservation_on;
|
|||||||
extern bool b_ignore_sysinit2;
|
extern bool b_ignore_sysinit2;
|
||||||
|
|
||||||
#endif /*_USB_SCSI_SETTINGS_H_*/
|
#endif /*_USB_SCSI_SETTINGS_H_*/
|
||||||
|
|
||||||
|
|||||||
@@ -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]>
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** handling SCSI data-buffer (both usual "plain" and scatter/gather ones) */
|
/** handling SCSI data-buffer (both usual "plain" and scatter/gather ones) */
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -171,3 +177,4 @@ sg_buffer_len(sg_buffer *sgb, size_t *size)
|
|||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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]>
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** handling SCSI data-buffer (both usual "plain" and scatter/gather ones) */
|
/** handling SCSI data-buffer (both usual "plain" and scatter/gather ones) */
|
||||||
|
|
||||||
#ifndef _SG_BUFFER_H_
|
#ifndef _SG_BUFFER_H_
|
||||||
@@ -35,3 +41,4 @@ status_t sg_memcpy(sg_buffer *dest_sgb, off_t dest_offset,
|
|||||||
void free_sg_buffer(sg_buffer *sgb);
|
void free_sg_buffer(sg_buffer *sgb);
|
||||||
|
|
||||||
#endif /*_SG_BUFFER_H_*/
|
#endif /*_SG_BUFFER_H_*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user