Applying style to remaining classes. No functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17624 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2006-05-28 23:29:06 +00:00
parent 64312bc94c
commit 96da8285b0
11 changed files with 801 additions and 810 deletions
+57 -71
View File
@@ -1,109 +1,95 @@
//------------------------------------------------------------------------------
// Copyright (c) 2003-2004, Niels S. Reedijk
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*
* Copyright 2003-2006, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Niels S. Reedijk
*/
#include <USB.h>
#include <util/kernel_cpp.h>
#include "usb_p.h"
#define USB_DEBUG
#ifdef USB_DEBUG
#define TRACE dprintf
#define TRACE_USB
#ifdef TRACE_USB
#define TRACE(x) dprintf x
#else
#define TRACE silent
void silent( const char * , ... ) {}
#define TRACE(x) /* nothing */
#endif
/* ++++++++++
Loading/unloading the module
++++++++++ */
static int32
bus_std_ops(int32 op, ...)
{
Stack *stack;
switch(op) {
case B_MODULE_INIT:
#ifdef USB_DEBUG
set_dprintf_enabled( true );
load_driver_symbols( "usb" );
#endif
switch (op) {
case B_MODULE_INIT: {
#ifdef TRACE_USB
set_dprintf_enabled(true);
load_driver_symbols("usb");
#endif
TRACE(("usb_nielx: bus module: init\n"));
stack = new Stack();
if( stack->InitCheck() != B_OK )
{
Stack *stack = new Stack();
if (stack->InitCheck() != B_OK) {
delete stack;
return ENODEV;
}
break;
}
case B_MODULE_UNINIT:
TRACE(("usb_nielx: bus module: uninit\n"));
delete data;
delete usb_stack;
break;
default:
return EINVAL;
}
return B_OK;
}
/* ++++++++++
This module exports the USB API
++++++++++ */
struct usb_module_info m_module_info =
{
/*
This module exports the USB API
*/
struct usb_module_info gModuleInfo = {
// First the bus_manager_info:
{
//module_info
{
"bus_managers/usb/nielx" ,
B_KEEP_LOADED , // Keep loaded, even if no driver requires it
"bus_managers/usb/nielx",
B_KEEP_LOADED, // Keep loaded, even if no driver requires it
bus_std_ops
} ,
},
NULL // the rescan function
} ,
NULL , // register_driver
NULL , // install_notify
NULL , // uninstall_notify
NULL , // get_device_descriptor
NULL , // get_nth_configuration_info
NULL , // get_configuration
NULL , // set_configuration
NULL , // set_alt_interface
NULL , // set_feature
NULL , // clear_feature
NULL , // get_status
NULL , // get_descriptor
NULL , // send_request
NULL , // queue_interrupt
NULL , // queue_bulk
NULL , // queue_isochronous
NULL , // queue_request
NULL , // set_pipe_policy
NULL , // cancel_queued_transfers
},
NULL, // register_driver
NULL, // install_notify
NULL, // uninstall_notify
NULL, // get_device_descriptor
NULL, // get_nth_configuration_info
NULL, // get_configuration
NULL, // set_configuration
NULL, // set_alt_interface
NULL, // set_feature
NULL, // clear_feature
NULL, // get_status
NULL, // get_descriptor
NULL, // send_request
NULL, // queue_interrupt
NULL, // queue_bulk
NULL, // queue_isochronous
NULL, // queue_request
NULL, // set_pipe_policy
NULL, // cancel_queued_transfers
NULL // usb_ioctl
};
module_info *modules[] = {
(module_info *)&m_module_info ,
(module_info *)&gModuleInfo,
NULL
};