2 * ITP code for ST-Ericsson CW1200 mac80211 driver
4 * Copyright (c) 2011, ST-Ericsson
5 * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #ifndef CW1200_ITP_H_INCLUDED
13 #define CW1200_ITP_H_INCLUDED
16 struct wsm_tx_confirm
;
19 #ifdef CONFIG_CW1200_ITP
21 /*extern*/ struct ieee80211_channel
;
23 #define TEST_MODE_NO_TEST (0)
24 #define TEST_MODE_RX_TEST (1)
25 #define TEST_MODE_TX_TEST (2)
26 #define ITP_DEFAULT_DA_ADDR {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
27 #define ITP_MIN_DATA_SIZE 6
28 #define ITP_MAX_DATA_SIZE 1600
29 #define ITP_TIME_THRES_US 10000
30 #define ITP_US_TO_MS(x) ((x)/1000)
31 #define ITP_MS_TO_US(x) ((x)*1000)
32 #define ITP_BUF_SIZE 255
35 enum cw1200_itp_data_modes
{
43 enum cw1200_itp_version_type
{
48 enum cw1200_itp_preamble_type
{
53 ITP_PREAMBLE_GREENFIELD
,
59 struct cw1200_common
*priv
;
61 atomic_t awaiting_confirm
;
62 struct sk_buff_head log_queue
;
63 wait_queue_head_t read_wait
;
64 wait_queue_head_t write_wait
;
65 wait_queue_head_t close_wait
;
66 struct ieee80211_channel
*saved_channel
;
68 struct delayed_work tx_work
;
69 struct delayed_work tx_finish
;
71 struct timespec last_sent
;
90 int cw1200_itp_init(struct cw1200_common
*priv
);
91 void cw1200_itp_release(struct cw1200_common
*priv
);
93 bool cw1200_is_itp(struct cw1200_common
*priv
);
94 bool cw1200_itp_rxed(struct cw1200_common
*priv
, struct sk_buff
*skb
);
95 void cw1200_itp_wake_up_tx(struct cw1200_common
*priv
);
96 int cw1200_itp_get_tx(struct cw1200_common
*priv
, u8
**data
,
97 size_t *tx_len
, int *burst
);
98 bool cw1200_itp_tx_running(struct cw1200_common
*priv
);
100 #else /* CONFIG_CW1200_ITP */
102 static inline int cw1200_itp_init(struct cw1200_common
*priv
)
107 static inline void cw1200_itp_release(struct cw1200_common
*priv
)
111 static inline bool cw1200_is_itp(struct cw1200_common
*priv
)
116 static inline bool cw1200_itp_rxed(struct cw1200_common
*priv
,
123 static inline void cw1200_itp_consume_txed(struct cw1200_common
*priv
)
127 static inline void cw1200_itp_wake_up_tx(struct cw1200_common
*priv
)
131 static inline int cw1200_itp_get_tx(struct cw1200_common
*priv
, u8
**data
,
132 size_t *tx_len
, int *burst
)
137 static inline bool cw1200_itp_tx_running(struct cw1200_common
*priv
)
142 #endif /* CONFIG_CW1200_ITP */
144 #endif /* CW1200_ITP_H_INCLUDED */