1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Datapath interface for ST-Ericsson CW1200 mac80211 drivers
5 * Copyright (c) 2010, ST-Ericsson
6 * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
12 #include <linux/list.h>
14 /* extern */ struct ieee80211_hw
;
15 /* extern */ struct sk_buff
;
16 /* extern */ struct wsm_tx
;
17 /* extern */ struct wsm_rx
;
18 /* extern */ struct wsm_tx_confirm
;
19 /* extern */ struct cw1200_txpriv
;
32 struct tx_policy_cache_entry
{
33 struct tx_policy policy
;
34 struct list_head link
;
37 #define TX_POLICY_CACHE_SIZE (8)
38 struct tx_policy_cache
{
39 struct tx_policy_cache_entry cache
[TX_POLICY_CACHE_SIZE
];
40 struct list_head used
;
41 struct list_head free
;
42 spinlock_t lock
; /* Protect policy cache */
45 /* ******************************************************************** */
47 /* Intention of TX policy cache is an overcomplicated WSM API.
48 * Device does not accept per-PDU tx retry sequence.
49 * It uses "tx retry policy id" instead, so driver code has to sync
50 * linux tx retry sequences with a retry policy table in the device.
52 void tx_policy_init(struct cw1200_common
*priv
);
53 void tx_policy_upload_work(struct work_struct
*work
);
54 void tx_policy_clean(struct cw1200_common
*priv
);
56 /* ******************************************************************** */
57 /* TX implementation */
59 u32
cw1200_rate_mask_to_wsm(struct cw1200_common
*priv
,
61 void cw1200_tx(struct ieee80211_hw
*dev
,
62 struct ieee80211_tx_control
*control
,
64 void cw1200_skb_dtor(struct cw1200_common
*priv
,
66 const struct cw1200_txpriv
*txpriv
);
68 /* ******************************************************************** */
71 void cw1200_tx_confirm_cb(struct cw1200_common
*priv
,
73 struct wsm_tx_confirm
*arg
);
74 void cw1200_rx_cb(struct cw1200_common
*priv
,
77 struct sk_buff
**skb_p
);
79 /* ******************************************************************** */
82 void cw1200_tx_timeout(struct work_struct
*work
);
84 /* ******************************************************************** */
86 int cw1200_alloc_key(struct cw1200_common
*priv
);
87 void cw1200_free_key(struct cw1200_common
*priv
, int idx
);
88 void cw1200_free_keys(struct cw1200_common
*priv
);
89 int cw1200_upload_keys(struct cw1200_common
*priv
);
91 /* ******************************************************************** */
92 /* Workaround for WFD test case 6.1.10 */
93 void cw1200_link_id_reset(struct work_struct
*work
);
95 #define CW1200_LINK_ID_GC_TIMEOUT ((unsigned long)(10 * HZ))
97 int cw1200_find_link_id(struct cw1200_common
*priv
, const u8
*mac
);
98 int cw1200_alloc_link_id(struct cw1200_common
*priv
, const u8
*mac
);
99 void cw1200_link_id_work(struct work_struct
*work
);
100 void cw1200_link_id_gc_work(struct work_struct
*work
);
103 #endif /* CW1200_TXRX_H */