X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tools%2Fcarlu%2Fsrc%2Fusb.h;h=66c674f951bf9ab050a42f064cedb9ba23886e7f;hb=12cc2cc355d1dce3d50c78e0f680b3cda0c73dfe;hp=00e1467b935c76f650f2cbaa7b4446e5bc755351;hpb=2c38313ab59811fc13770d0b6c98044d910c3514;p=carl9170fw.git diff --git a/tools/carlu/src/usb.h b/tools/carlu/src/usb.h index 00e1467..66c674f 100644 --- a/tools/carlu/src/usb.h +++ b/tools/carlu/src/usb.h @@ -1,9 +1,9 @@ /* - * carl9170user - userspace testing utility for ar9170 devices + * carlu - userspace testing utility for ar9170 devices * * USB back-end API declaration * - * Copyright 2009, 2010 Christian Lamparter + * Copyright 2009-2011 Christian Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include "fwcmd.h" #include +#include "carlu.h" #define AR9170_RX_BULK_BUFS 16 #define AR9170_RX_BULK_BUF_SIZE 8192 @@ -44,40 +45,11 @@ #define AR9170_TX_MAX_ACTIVE_URBS 8 -#define CARL9170_FIRMWARE_FILE "/lib/firmware/carl9170-1" -void carlusb_reset_txep(struct carlu *ar); - -struct carlusb { - struct carlu common; - libusb_device_handle *dev; - libusb_context *ctx; - - SDL_Thread *event_thread; - bool stop_event_polling; - - struct libusb_transfer *rx_ring[AR9170_RX_BULK_BUFS]; - - struct libusb_transfer *rx_interrupt; - unsigned char irq_buf[AR9170_RX_BULK_IRQ_SIZE]; +#define CARL9170_FIRMWARE_FILE (CARLU_PATH "/../../carlfw/carl9170.fw") - union { - unsigned char buf[CARL9170_MAX_CMD_LEN]; - struct carl9170_cmd cmd; - struct carl9170_rsp rsp; - } cmd; +struct carlu; - struct list_head tx_queue; - SDL_mutex *tx_queue_lock; - unsigned int tx_queue_len; - - struct list_head dev_list; - unsigned int idx; - - unsigned int miniboot_size; - unsigned int rx_max; - - int event_pipe[2]; -}; +void carlusb_reset_txep(struct carlu *ar); int usb_init(void); void usb_exit(void); @@ -86,7 +58,7 @@ struct carlu *carlusb_probe(void); void carlusb_close(struct carlu *ar); void carlusb_tx(struct carlu *ar, struct frame *frame); -int carlusb_fw_check(struct carlusb *ar); +int carlusb_fw_check(struct carlu *ar); int carlusb_cmd(struct carlu *_ar, uint8_t oid, uint8_t *cmd, size_t clen, uint8_t *rsp, size_t rlen);