--- /dev/null
+/*
+ * libhusb_internal.h
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "libhusb.h"
+#include "uref.h"
+#include "common.h"
+#include "log.h"
+#include <libusb-1.0/libusb.h>
+
+#define MAX_NMB_OF_CONFIGS 255
+
+struct libhusb_context {
+ libusb_context *lusb_ctx;
+};
+
+struct libhusb_device {
+ struct uref ref;
+ libusb_device *lusb_dev;
+ int refcnt;
+};
+
+struct libhusb_device_handle {
+ struct libhusb_device *device;
+ struct libusb_device_handle *lusb_dev_handle;
+ /* TODO: replace with bit fields */
+ unsigned char driver_detached[MAX_NMB_OF_CONFIGS];
+};
#include "common.h"
#include "log.h"
-#define MAX_NMB_OF_CONFIGS 255
-
-struct libhusb_context {
- libusb_context *lusb_ctx;
-};
-
-struct libhusb_device {
- struct uref ref;
- libusb_device *lusb_dev;
- int refcnt;
-};
+#include "libhusb_internal.h"
static inline struct libhusb_device *to_libhusb_device(struct uref *_uref)
{
return container_of(_uref, struct libhusb_device, ref);
}
-struct libhusb_device_handle {
- struct libhusb_device *device;
- struct libusb_device_handle *lusb_dev_handle;
- /* TODO: replace with bit fields */
- unsigned char driver_detached[MAX_NMB_OF_CONFIGS];
-};
-
static int translate_error(int error_code)
{
switch (error_code) {