mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-09 23:53:28 -04:00
rbutil: define USE_LIBUSBAPI for Linux builds
Resolves "DFU not working at all" under rbutil on Linux And fix some related warnings Change-Id: Ie44ebc960cfc0c5d0121e8ceb24576ed427746a8
This commit is contained in:
parent
9e6135ecd2
commit
96f1b19149
3 changed files with 7 additions and 4 deletions
|
|
@ -67,6 +67,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
pkg_check_modules(libusb QUIET REQUIRED IMPORTED_TARGET libusb-1.0)
|
pkg_check_modules(libusb QUIET REQUIRED IMPORTED_TARGET libusb-1.0)
|
||||||
message("-- Found libusb: ${libusb_LINK_LIBRARIES}")
|
message("-- Found libusb: ${libusb_LINK_LIBRARIES}")
|
||||||
|
add_compile_definitions(USE_LIBUSBAPI)
|
||||||
|
|
||||||
# optional system libs.
|
# optional system libs.
|
||||||
pkg_check_modules(speex QUIET IMPORTED_TARGET speex speexdsp)
|
pkg_check_modules(speex QUIET IMPORTED_TARGET speex speexdsp)
|
||||||
|
|
|
||||||
|
|
@ -245,6 +245,7 @@ struct dfuAPI {
|
||||||
/*
|
/*
|
||||||
* DFU API low-level (specific) functions
|
* DFU API low-level (specific) functions
|
||||||
*/
|
*/
|
||||||
|
#if defined(WIN32) || defined(USE_LIBUSBAPI) || defined(__APPLE__)
|
||||||
static bool dfu_check_id(int vid, int pid, int *pid_list)
|
static bool dfu_check_id(int vid, int pid, int *pid_list)
|
||||||
{
|
{
|
||||||
int *p;
|
int *p;
|
||||||
|
|
@ -263,6 +264,7 @@ static void dfu_add_reqerrstr(struct dfuDev *dfuh, struct usbControlSetup *cs)
|
||||||
sizeof(dfuh->err) - strlen(dfuh->err), " (cs=%02x/%d/%d/%d/%d)",
|
sizeof(dfuh->err) - strlen(dfuh->err), " (cs=%02x/%d/%d/%d/%d)",
|
||||||
cs->bmRequestType, cs->bRequest, cs->wValue, cs->wIndex, cs->wLength);
|
cs->bmRequestType, cs->bRequest, cs->wValue, cs->wIndex, cs->wLength);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
static bool dfu_winapi_chkrc(struct dfuDev *dfuh, char *str, bool success)
|
static bool dfu_winapi_chkrc(struct dfuDev *dfuh, char *str, bool success)
|
||||||
|
|
@ -695,7 +697,7 @@ static struct dfuAPI api_list[] =
|
||||||
*/
|
*/
|
||||||
static int DEBUG_DFUREQ = 0;
|
static int DEBUG_DFUREQ = 0;
|
||||||
|
|
||||||
static dfuAPIResult dfuapi_request(struct dfuDev *dfuh,
|
static __attribute__ ((noinline)) dfuAPIResult dfuapi_request(struct dfuDev *dfuh,
|
||||||
struct usbControlSetup *cs, void *data)
|
struct usbControlSetup *cs, void *data)
|
||||||
{
|
{
|
||||||
if (!DEBUG_DFUREQ)
|
if (!DEBUG_DFUREQ)
|
||||||
|
|
@ -902,7 +904,7 @@ static int ipoddfu_download_file(struct dfuDev* dfuh,
|
||||||
{
|
{
|
||||||
unsigned int blknum, len, remaining;
|
unsigned int blknum, len, remaining;
|
||||||
int poll_tmo;
|
int poll_tmo;
|
||||||
DFUStatus status;
|
DFUStatus status = errNONE;
|
||||||
DFUState state;
|
DFUState state;
|
||||||
|
|
||||||
if (dfuapi_req_getstate(dfuh, &state) != DFUAPISuccess)
|
if (dfuapi_req_getstate(dfuh, &state) != DFUAPISuccess)
|
||||||
|
|
|
||||||
|
|
@ -191,9 +191,9 @@ unsigned char *mkdfu(int dfu_type, char *dfu_arg, int* dfu_size,
|
||||||
{
|
{
|
||||||
const struct ipod_models *model = NULL;
|
const struct ipod_models *model = NULL;
|
||||||
unsigned char *dfu_buf = NULL;
|
unsigned char *dfu_buf = NULL;
|
||||||
unsigned char *f_buf;
|
unsigned char *f_buf = NULL;
|
||||||
int f_size;
|
int f_size;
|
||||||
uint32_t padded_bl_size;
|
uint32_t padded_bl_size = 0;
|
||||||
uint32_t cert_off, cert_sz;
|
uint32_t cert_off, cert_sz;
|
||||||
off_t cur_off;
|
off_t cur_off;
|
||||||
char *dfu_desc;
|
char *dfu_desc;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue