h2generic: Stop using btDebug + style fixes

This commit is contained in:
Alexander von Gluck IV
2016-04-10 01:01:07 -05:00
parent c58e1d7feb
commit 05e1165520
9 changed files with 52 additions and 23 deletions
@@ -0,0 +1,24 @@
/*
* Copyright 2015-2016 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#ifndef _H2DEBUG_H
#define _H2DEBUG_H
#include <KernelExport.h>
#define DEBUG
#ifdef DEBUG
# define TRACE(x...) dprintf("h2generic: " x)
#else
# define TRACE(x...) ;
#endif
#define ERROR(x...) dprintf("h2generic: " x)
#define CALLED(x...) TRACE("h2generic: CALLED %s\n", __PRETTY_FUNCTION__)
#endif /* _H2DEBUG_H */
@@ -5,6 +5,7 @@
*
*/
#include "h2generic.h"
#include <kernel.h>
@@ -16,16 +17,14 @@
#include <ByteOrder.h>
#include <Drivers.h>
#include "snet_buffer.h"
#include <btDebug.h>
#include <btModules.h>
#include "snet_buffer.h"
#include "h2cfg.h"
#include "h2debug.h"
#include "h2transactions.h"
#include "h2util.h"
#include "h2cfg.h"
int32 api_version = B_CUR_DRIVER_API_VERSION;
@@ -7,6 +7,7 @@
#ifndef _H2GENERIC_H_
#define _H2GENERIC_H_
#include <net_buffer.h>
#include <net_device.h>
@@ -26,6 +27,7 @@
#include "snet_buffer.h"
// USB definitions for the generic device move to h2cfg
#define UDCLASS_WIRELESS 0xe0
#define UDSUBCLASS_RF 0x01
@@ -4,25 +4,25 @@
* All rights reserved. Distributed under the terms of the MIT License.
*/
#include "h2generic.h"
#include "h2transactions.h"
#include "h2upper.h"
#include "h2util.h"
#include <bluetooth/HCI/btHCI.h>
#include <bluetooth/HCI/btHCI_event.h>
#include <bluetooth/HCI/btHCI_acl.h>
#include <ByteOrder.h>
#include <kernel.h>
#include <string.h>
//#define DUMP_BUFFERS
#define BT_DEBUG_THIS_MODULE
#include <btDebug.h>
#include "h2debug.h"
#include "h2generic.h"
#include "h2upper.h"
#include "h2util.h"
//#define DUMP_BUFFERS
/* Forward declaration */
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
@@ -2,12 +2,13 @@
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
* All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef _H2TRANSACTION_H_
#define _H2TRANSACTION_H_
#include "h2generic.h"
status_t submit_rx_event(bt_usb_dev* bdev);
status_t submit_rx_acl(bt_usb_dev* bdev);
status_t submit_rx_sco(bt_usb_dev* bdev);
@@ -4,20 +4,20 @@
* All rights reserved. Distributed under the terms of the MIT License.
*/
#include "h2upper.h"
#include <string.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/HCI/btHCI_transport.h>
#include <kernel.h>
#include "h2debug.h"
#include "h2generic.h"
#include "h2upper.h"
#include "h2transactions.h"
#include "snet_buffer.h"
#define BT_DEBUG_THIS_MODULE
#include <btDebug.h>
// TODO: split for commands and comunication (ACL & SCO)
void
@@ -5,10 +5,12 @@
#ifndef _H2UPPER_H_
#define _H2UPPER_H_
#include <util/list.h>
#include "h2generic.h"
status_t post_packet_up(bt_usb_dev* bdev, bt_packet_t type, void* buf);
status_t send_packet(hci_id hid, bt_packet_t type, net_buffer* nbuf);
status_t send_command(hci_id hid, snet_buffer* snbuf);
@@ -4,19 +4,19 @@
* All rights reserved. Distributed under the terms of the MIT License.
*/
#include <malloc.h>
#include "h2upper.h"
#include "h2util.h"
#include "h2transactions.h"
#include <malloc.h>
#include <bluetooth/HCI/btHCI_acl.h>
#include <bluetooth/HCI/btHCI_command.h>
#include <bluetooth/HCI/btHCI_event.h>
#include <bluetooth/HCI/btHCI_sco.h>
#define BT_DEBUG_THIS_MODULE
#include <btDebug.h>
#include "h2debug.h"
#include "h2upper.h"
#include "h2transactions.h"
void*
@@ -5,12 +5,14 @@
*
*/
#include "snet_buffer.h"
#include <malloc.h>
#include <string.h>
#include <KernelExport.h>
struct snet_buffer {
struct list_link link;
@@ -22,7 +24,6 @@ struct snet_buffer {
uint16 pullingSize;
void* cookie;
};