2 * carl9170user - userspace testing utility for ar9170 devices
4 * common API declaration
6 * Copyright 2009, 2010 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_H
24 #define __CARL9170USER_H
27 #include "SDL_thread.h"
36 #include "ieee80211.h"
48 void (*tx_cb)(struct carlu *, struct frame *);
49 void (*tx_fb_cb)(struct carlu *, struct frame *);
50 void (*rx_cb)(struct carlu *, void *, unsigned int);
51 int (*cmd_cb)(struct carlu *, struct carl9170_rsp *,
52 void *, unsigned int);
56 struct ar9170_eeprom eeprom;
58 struct frame_queue tx_sent_queue[__AR9170_NUM_TXQ];
61 unsigned int dma_chunks;
62 unsigned int dma_chunk_size;
63 unsigned int used_dma_chunks;
65 unsigned int extra_headroom;
73 unsigned long tx_octets;
74 unsigned long rx_octets;
83 struct carlu_tx_info_tx {
87 struct carlu_tx_info {
90 struct carlu_rate rates[CARL9170_TX_MAX_RATES];
93 struct carlu_tx_info_tx tx;
97 static inline struct carlu_tx_info *get_tx_info(struct frame *frame)
99 return (void *) frame->cb;
102 void *carlu_alloc_driver(size_t size);
103 void carlu_free_driver(struct carlu *ar);
105 int carlu_fw_check(struct carlu *ar);
106 void carlu_fw_info(struct carlu *ar);
108 void carlu_rx(struct carlu *ar, struct frame *frame);
109 int carlu_tx(struct carlu *ar, struct frame *frame);
110 void carlu_tx_feedback(struct carlu *ar,
111 struct carl9170_rsp *cmd);
112 void carlu_handle_command(struct carlu *ar, void *buf, size_t len);
114 struct frame *carlu_alloc_frame(struct carlu *ar, unsigned int size);
115 void carlu_free_frame(struct carlu *ar, struct frame *frame);
117 int carlu_cmd_echo(struct carlu *ar, const uint32_t message);
118 int carlu_cmd_reboot(struct carlu *ar);
119 int carlu_cmd_read_eeprom(struct carlu *ar);
120 int carlu_cmd_mem_dump(struct carlu *ar, const uint32_t start,
121 const unsigned int len, void *_buf);
122 int carlu_cmd_write_mem(struct carlu *ar, const uint32_t addr,
125 #endif /* __CARL9170USER_H */