Skip to content

Commit

Permalink
replace linux's usb defines
Browse files Browse the repository at this point in the history
Signed-off-by: Bjorn Andersson <[email protected]>
  • Loading branch information
quic-bjorande committed May 9, 2024
1 parent d88f684 commit 445ec75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 4 additions & 6 deletions usb.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <linux/usbdevice_fs.h>
#include <linux/usb/ch9.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <err.h>
Expand All @@ -8,7 +6,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <libusb-1.0/libusb.h>
#include <libusb.h>

#include "qdl.h"

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 445ec75

Please sign in to comment.