Integrate the USBKit into libdevice and make it public. I left the USBKit.h

name, as it in fact is like a kit in the kit. It combines the different BUSB*
classes as compared to SerialPort.h where there really is a 1:1 relationship
between the header and the (one) class. If someone has a better fitting name
please shout.
Separated the usb_raw.h into usb_raw.h which defines the protocol and
usb_raw_private.h which holds the internal device structure for usb_raw. This
reduces the header dependencies.
Hopefully cought all occurencies of USBKit.a usage (in usb_dev_info and
the usb_webcam media add-on) but might have missed something that is not in
the image.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24858 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2008-04-07 19:24:16 +00:00
parent d4f7b8428a
commit d419b482ad
14 changed files with 43 additions and 47 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2006, Haiku Inc. All rights reserved.
* Copyright 2006-2008, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -12,6 +12,7 @@
#include <stdio.h>
#include <string.h>
#include "usb_raw.h"
#include "usb_raw_private.h"
#include "BeOSCompatibility.h"
+1 -18
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006, Haiku Inc. All rights reserved.
* Copyright 2006-2008, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -9,11 +9,8 @@
#ifndef _USB_RAW_H_
#define _USB_RAW_H_
#include <lock.h>
#include <USB3.h>
typedef enum {
RAW_COMMAND_GET_VERSION = 0x1000,
@@ -152,18 +149,4 @@ typedef union {
} isochronous;
} raw_command;
typedef struct {
usb_device device;
benaphore lock;
uint32 reference_count;
char name[32];
void *link;
sem_id notify;
status_t status;
size_t actual_length;
} raw_device;
#endif // _USB_RAW_H_
@@ -0,0 +1,28 @@
/*
* Copyright 2008, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Michael Lotz <[email protected]>
*/
#ifndef _USB_RAW_PRIVATE_H_
#define _USB_RAW_PRIVATE_H_
#include <lock.h>
#include <USB3.h>
typedef struct {
usb_device device;
benaphore lock;
uint32 reference_count;
char name[32];
void *link;
sem_id notify;
status_t status;
size_t actual_length;
} raw_device;
#endif // _USB_RAW_PRIVATE_H_
@@ -2,12 +2,9 @@ SubDir HAIKU_TOP src add-ons media media-add-ons usb_webcam ;
SetSubDirSupportedPlatformsBeOSCompatible ;
# for USBKit.h
UseLibraryHeaders usb ;
# Zeta has a libusb.so, we have a USBKit.a
# Zeta has a libusb.so, we have it in libdevice.so
if $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
usbKitLibraryName = USBKit.a ;
usbKitLibraryName = libdevice.so ;
} else {
usbKitLibraryName = usb ;
}
+2 -2
View File
@@ -143,10 +143,10 @@ StdBinCommands
mail.cpp
: be libmail.so : $(haiku-utils_rsrc) ;
# standard commands that need libbe.so, and the USB Kit
# standard commands that need libbe.so, libdevice.so
StdBinCommands
usb_dev_info.cpp
: be USBKit.a : $(haiku-utils_rsrc) ;
: be libdevice.so : $(haiku-utils_rsrc) ;
# standard commands that need libbe.so, libtracker.so
StdBinCommands
+8
View File
@@ -1,10 +1,18 @@
SubDir HAIKU_TOP src kits device ;
# for usb_raw.h that defines the ioctl protocol used by the USB classes
UseHeaders [ FDirName $(HAIKU_TOP) src add-ons kernel drivers bus usb ] : true ;
SharedLibrary libdevice.so :
A2D.cpp
D2A.cpp
DigitalPort.cpp
Joystick.cpp
SerialPort.cpp
USBConfiguration.cpp
USBDevice.cpp
USBEndpoint.cpp
USBInterface.cpp
USBRoster.cpp
: be
;
-1
View File
@@ -18,6 +18,5 @@ SubInclude HAIKU_TOP src libs pdflib ;
SubInclude HAIKU_TOP src libs png ;
SubInclude HAIKU_TOP src libs stdc++ ;
SubInclude HAIKU_TOP src libs termcap ;
SubInclude HAIKU_TOP src libs usb ;
SubInclude HAIKU_TOP src libs util ;
SubInclude HAIKU_TOP src libs zlib ;
-20
View File
@@ -1,20 +0,0 @@
SubDir HAIKU_TOP src libs usb ;
SetSubDirSupportedPlatformsBeOSCompatible ;
# for USBKit.h, usb_raw.h and lock.h
UseLibraryHeaders usb ;
UseHeaders [ FDirName $(HAIKU_TOP) src add-ons kernel drivers bus usb ] : true ;
UsePrivateHeaders kernel ;
if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders [ FDirName drivers ] ;
}
StaticLibrary USBKit.a :
USBRoster.cpp
USBDevice.cpp
USBConfiguration.cpp
USBInterface.cpp
USBEndpoint.cpp
;