From 445ec75d9d880c9d5a559abd180dc0abc6c3325c Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Thu, 9 May 2024 15:43:59 -0500 Subject: [PATCH] replace linux's usb defines Signed-off-by: Bjorn Andersson --- Makefile | 4 ++-- usb.c | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index a0c4fb6..2289897 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ QDL := qdl RAMDUMP := qdl-ramdump -CFLAGS := -O2 -Wall -g `pkg-config --cflags libxml-2.0` -LDFLAGS := `pkg-config --libs libxml-2.0` -lusb-1.0 +CFLAGS := -O2 -Wall -g `pkg-config --cflags libxml-2.0 libusb-1.0` +LDFLAGS := `pkg-config --libs libxml-2.0 libusb-1.0` prefix := /usr/local QDL_SRCS := firehose.c qdl.c sahara.c util.c patch.c program.c ufs.c usb.c diff --git a/usb.c b/usb.c index 324bc6b..35a1c1e 100644 --- a/usb.c +++ b/usb.c @@ -1,5 +1,3 @@ -#include -#include #include #include #include @@ -8,7 +6,7 @@ #include #include #include -#include +#include #include "qdl.h" @@ -82,11 +80,11 @@ static int qdl_try_open(libusb_device *dev, struct qdl_device *qdl, const char * for (l = 0; l < ifc->bNumEndpoints; l++) { endpoint = &ifc->endpoint[l]; - type = endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; - if (type != USB_ENDPOINT_XFER_BULK) + type = endpoint->bmAttributes & LIBUSB_TRANSFER_TYPE_MASK; + if (type != LIBUSB_ENDPOINT_TRANSFER_TYPE_BULK) continue; - if (endpoint->bEndpointAddress & USB_DIR_IN) { + if (endpoint->bEndpointAddress & LIBUSB_ENDPOINT_IN) { in = endpoint->bEndpointAddress; in_size = endpoint->wMaxPacketSize; } else {