2 * carlu - userspace testing utility for ar9170 devices
4 * USB back-end API declaration
6 * Copyright 2009-2011 Christian Lamparter <chunkeey@googlemail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __CARL9170USER_USB_H
24 #define __CARL9170USER_USB_H
27 #include "SDL_thread.h"
36 #define AR9170_RX_BULK_BUFS 16
37 #define AR9170_RX_BULK_BUF_SIZE 8192
38 #define AR9170_RX_BULK_IRQ_SIZE 64
41 #define AR9170_EP_TX (LIBUSB_ENDPOINT_OUT | AR9170_USB_EP_TX)
42 #define AR9170_EP_RX (LIBUSB_ENDPOINT_IN | AR9170_USB_EP_RX)
43 #define AR9170_EP_IRQ (LIBUSB_ENDPOINT_IN | AR9170_USB_EP_IRQ)
44 #define AR9170_EP_CMD (LIBUSB_ENDPOINT_OUT | AR9170_USB_EP_CMD)
46 #define AR9170_TX_MAX_ACTIVE_URBS 8
48 #define CARL9170_FIRMWARE_FILE (CARLU_PATH "/../../carlfw/carl9170.fw")
52 void carlusb_reset_txep(struct carlu *ar);
57 struct carlu *carlusb_probe(void);
58 void carlusb_close(struct carlu *ar);
60 void carlusb_tx(struct carlu *ar, struct frame *frame);
61 int carlusb_fw_check(struct carlu *ar);
63 int carlusb_cmd(struct carlu *_ar, uint8_t oid, uint8_t *cmd, size_t clen,
64 uint8_t *rsp, size_t rlen);
66 int carlusb_print_known_devices(void);
68 #endif /* __CARL9170USER_USB_H */