- 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:
imker
2006-09-08 19:40:29 +00:00
parent d8b1cf0703
commit 2db0303fdc
6 changed files with 523 additions and 487 deletions
@@ -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"
@@ -16,7 +23,6 @@
#define INQ_PRODUCT_LEN 0x10
#define INQ_REVISION_LEN 0x04
void fake_inquiry_request(usb_device_info *udi, CCB_SCSIIO *ccbio)
{
uint8 *data = ccbio->cam_data_ptr;
@@ -86,3 +92,4 @@ status_t fake_scsi_io(CCB_SCSIIO *ccbio)
}
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_
+18 -17
View File
@@ -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 */
#include "usb_scsi.h"
@@ -109,7 +115,7 @@ struct _settings_key{
loads driver settings from extarnal settings file through BeOS driver
settings API. Called on initialization of the module
*/
void load_module_settings()
void load_module_settings(void)
{
void *sh = load_driver_settings(MODULE_NAME);
if(sh){
@@ -159,8 +165,7 @@ strncpy_value(char *to, driver_parameter *dp, size_t size)
compose a bitmasked value from those settings
*/
static uint32
parse_transport(driver_parameter *dp,
int skkBase, int skkEnd,
parse_transport(driver_parameter *dp, int skkBase, int skkEnd,
uint32 vendor_prop, char *vendor_prop_name)
{
uint32 ret = 0;
@@ -193,8 +198,7 @@ parse_transport(driver_parameter *dp,
parameters of private device settings if available
*/
static bool
lookup_device_info(uint16 product_id,
driver_parameter *dp,
lookup_device_info(uint16 product_id, driver_parameter *dp,
usb_device_settings *uds)
{
bool b_found = false;
@@ -215,14 +219,12 @@ lookup_device_info(uint16 product_id,
if(SK_EQUAL(dp->parameters[prm].name, skkProtocol)){
uds->properties |= parse_transport(&dp->parameters[prm],
skkProtoBegin, skkProtoEnd,
PROTO_VENDOR,
uds->vendor_protocol);
PROTO_VENDOR, uds->vendor_protocol);
} else
if(SK_EQUAL(dp->parameters[prm].name, skkCommandSet)){
uds->properties |= parse_transport(&dp->parameters[prm],
skkCmdSetBegin, skkCmdSetEnd,
CMDSET_VENDOR,
uds->vendor_commandset);
CMDSET_VENDOR, uds->vendor_commandset);
} else
if(SK_EQUAL(dp->parameters[prm].name, skkFakeInq)){
uds->properties |= FIX_NO_INQUIRY;
@@ -270,10 +272,8 @@ lookup_device_info(uint16 product_id,
device information if available
*/
static bool
lookup_vendor_info(uint16 vendor_id,
uint16 product_id,
driver_parameter *dp,
usb_device_settings *uds)
lookup_vendor_info(uint16 vendor_id, uint16 product_id,
driver_parameter *dp, usb_device_settings *uds)
{
bool b_found = false;
if(dp && dp->value_count > 0 && dp->values[0]){
@@ -338,3 +338,4 @@ bool lookup_device_settings(const usb_device_descriptor *udd,
} /* if(descr)*/
return b_found;
}
+12 -5
View File
@@ -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 */
#ifndef _USB_SCSI_SETTINGS_H_
#define _USB_SCSI_SETTINGS_H_
void load_module_settings();
void load_module_settings(void);
typedef struct{
uint16 vendor_id;
@@ -29,3 +35,4 @@ extern bool b_reservation_on;
extern bool b_ignore_sysinit2;
#endif /*_USB_SCSI_SETTINGS_H_*/
+11 -4
View File
@@ -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) */
#include <string.h>
@@ -171,3 +177,4 @@ sg_buffer_len(sg_buffer *sgb, size_t *size)
}
return status;
}
+11 -4
View File
@@ -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) */
#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);
#endif /*_SG_BUFFER_H_*/