New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual device #41

Merged
merged 122 commits into from Oct 2, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+49 −15
Diff settings

Always

Just for now

Viewing a subset of changes. View all

ctlra: rework and split out usb header

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
  • Loading branch information...
harryhaaren committed Sep 24, 2017
commit a3e2f26de8e46bba0672b2b2b47e35d48746b6ed
View
@@ -5,20 +5,8 @@
#include "ctlra.h"
#include "impl.h"
#include "usb.h"
/* For USB initialization */
int ctlra_dev_impl_usb_init(struct ctlra_t *ctlra);
/* For polling hotplug / other events */
void ctlra_impl_usb_idle_iter(struct ctlra_t *);
/* For cleaning up the USB subsystem */
void ctlra_impl_usb_shutdown(struct ctlra_t *ctlra);
/* TODO: Cleanup this registration method to be in the .c files of each
* implementation, instead of centrally located here. This allows drivers
* to be "dropped in" to the source, and then automatically register up
* without library code changes */
CTLRA_DEVICE_DECL(akai_apc);
CTLRA_DEVICE_DECL(avtka);
#define CTLRA_MAX_DEVICES 64
struct ctlra_dev_connect_func_t __ctlra_devices[CTLRA_MAX_DEVICES];
@@ -113,6 +101,9 @@ ctlra_dev_virtualize(struct ctlra_t *c, const char *vendor,
}
#ifdef HAVE_AVTKA
/* TODO: find better solution to this hack */
CTLRA_DEVICE_DECL(avtka);
/* call into AVTKA and virtualize the device, passing info through
* the future (void *) to the AVTKA backend. */
CTLRA_INFO(c, "virtualizing dev with info %p\n", info);
@@ -380,5 +371,3 @@ void ctlra_exit(struct ctlra_t *ctlra)
free(ctlra);
}
View
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2017, OpenAV Productions,
* Harry van Haaren <harryhaaren@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CTLRA_USB_H
#define CTLRA_USB_H
struct ctlra_t;
/* For USB initialization */
int ctlra_dev_impl_usb_init(struct ctlra_t *ctlra);
/* For polling hotplug / other events */
void ctlra_impl_usb_idle_iter(struct ctlra_t *ctlra);
/* For cleaning up the USB subsystem */
void ctlra_impl_usb_shutdown(struct ctlra_t *ctlra);
#endif /* CTLRA_USB_H */
ProTip! Use n and p to navigate between commits in a pull request.