X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tools%2Fcarlu%2Fsrc%2Fcarlu.h;h=5e2c6bb58c28110d0cab1e52e2519acc03a222dd;hb=12cc2cc355d1dce3d50c78e0f680b3cda0c73dfe;hp=08fca20f1c1f2f62148c05690dd6f6a5fdda1cec;hpb=13859edfa20c4b84b575f8e872636fd8cdd81d7f;p=carl9170fw.git diff --git a/tools/carlu/src/carlu.h b/tools/carlu/src/carlu.h index 08fca20..5e2c6bb 100644 --- a/tools/carlu/src/carlu.h +++ b/tools/carlu/src/carlu.h @@ -1,9 +1,9 @@ /* - * carl9170user - userspace testing utility for ar9170 devices + * carlu - userspace testing utility for ar9170 devices * * common 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 @@ -35,8 +35,39 @@ #include "eeprom.h" #include "ieee80211.h" #include "wlan.h" +#include "usb.h" struct carlu { + 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]; + + union { + unsigned char buf[CARL9170_MAX_CMD_LEN]; + uint32_t buf4[CARL9170_MAX_CMD_LEN / sizeof(uint32_t)]; + struct carl9170_cmd cmd; + struct carl9170_rsp rsp; + } cmd; + + 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]; + SDL_cond *resp_pend; SDL_mutex *resp_lock; uint8_t *resp_buf; @@ -109,7 +140,7 @@ void carlu_rx(struct carlu *ar, struct frame *frame); int carlu_tx(struct carlu *ar, struct frame *frame); void carlu_tx_feedback(struct carlu *ar, struct carl9170_rsp *cmd); -void carlu_handle_command(struct carlu *ar, void *buf, size_t len); +void carlu_handle_command(struct carlu *ar, void *buf, unsigned int len); struct frame *carlu_alloc_frame(struct carlu *ar, unsigned int size); void carlu_free_frame(struct carlu *ar, struct frame *frame);