/*
- * carl9170user - userspace testing utility for ar9170 devices
+ * carlu - userspace testing utility for ar9170 devices
*
* common API declaration
*
- * Copyright 2009, 2010 Christian Lamparter <chunkeey@googlemail.com>
+ * Copyright 2009-2011 Christian Lamparter <chunkeey@googlemail.com>
*
* 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
#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;
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);