1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * This file is part of wl18xx
5 * Copyright (C) 2011 Texas Instruments Inc.
8 #ifndef __WL18XX_PRIV_H__
9 #define __WL18XX_PRIV_H__
13 /* minimum FW required for driver */
14 #define WL18XX_CHIP_VER 8
15 #define WL18XX_IFTYPE_VER 9
16 #define WL18XX_MAJOR_VER WLCORE_FW_VER_IGNORE
17 #define WL18XX_SUBTYPE_VER WLCORE_FW_VER_IGNORE
18 #define WL18XX_MINOR_VER 58
20 #define WL18XX_CMD_MAX_SIZE 740
22 #define WL18XX_AGGR_BUFFER_SIZE (13 * PAGE_SIZE)
24 #define WL18XX_NUM_TX_DESCRIPTORS 32
25 #define WL18XX_NUM_RX_DESCRIPTORS 32
27 #define WL18XX_NUM_MAC_ADDRESSES 2
29 #define WL18XX_RX_BA_MAX_SESSIONS 13
31 #define WL18XX_MAX_AP_STATIONS 10
32 #define WL18XX_MAX_LINKS 16
35 /* buffer for sending commands to FW */
36 u8 cmd_buf
[WL18XX_CMD_MAX_SIZE
];
38 struct wl18xx_priv_conf conf
;
40 /* Index of last released Tx desc in FW */
43 /* number of keys requiring extra spare mem-blocks */
44 int extra_spare_key_count
;
47 #define WL18XX_FW_MAX_TX_STATUS_DESC 33
49 struct wl18xx_fw_status_priv
{
51 * Index in released_tx_desc for first byte that holds
52 * released tx host desc
57 * Array of host Tx descriptors, where fw_release_idx
58 * indicated the first released idx.
60 u8 released_tx_desc
[WL18XX_FW_MAX_TX_STATUS_DESC
];
62 /* A bitmap representing the currently suspended links. The suspend
63 * is short lived, for multi-channel Tx requirements.
65 __le32 link_suspend_bitmap
;
67 /* packet threshold for an "almost empty" AC,
68 * for Tx schedulng purposes
72 /* number of packets to queue up for a link in PS */
75 /* number of packet to queue up for a suspended link */
76 u8 tx_suspend_threshold
;
78 /* Should have less than this number of packets in queue of a slow
79 * link to qualify as high priority link
81 u8 tx_slow_link_prio_threshold
;
83 /* Should have less than this number of packets in queue of a fast
84 * link to qualify as high priority link
86 u8 tx_fast_link_prio_threshold
;
88 /* Should have less than this number of packets in queue of a slow
89 * link before we stop queuing up packets for it.
91 u8 tx_slow_stop_threshold
;
93 /* Should have less than this number of packets in queue of a fast
94 * link before we stop queuing up packets for it.
96 u8 tx_fast_stop_threshold
;
101 struct wl18xx_fw_packet_counters
{
102 /* Cumulative counter of released packets per AC */
103 u8 tx_released_pkts
[NUM_TX_QUEUES
];
105 /* Cumulative counter of freed packets per HLID */
106 u8 tx_lnk_free_pkts
[WL18XX_MAX_LINKS
];
108 /* Cumulative counter of released Voice memory blocks */
109 u8 tx_voice_released_blks
;
111 /* Tx rate of the last transmitted packet */
114 /* Tx rate or Tx rate estimate pre-calculated by fw in mbps units */
115 u8 tx_last_rate_mbps
;
117 /* hlid for which the rates were reported */
121 /* FW status registers */
122 struct wl18xx_fw_status
{
127 u8 tx_results_counter
;
128 __le32 rx_pkt_descs
[WL18XX_NUM_RX_DESCRIPTORS
];
133 * A bitmap (where each bit represents a single HLID)
134 * to indicate if the station is in PS mode.
136 __le32 link_ps_bitmap
;
139 * A bitmap (where each bit represents a single HLID) to indicate
140 * if the station is in Fast mode
142 __le32 link_fast_bitmap
;
144 /* Cumulative counter of total released mem blocks since FW-reset */
145 __le32 total_released_blks
;
147 /* Size (in Memory Blocks) of TX pool */
150 struct wl18xx_fw_packet_counters counters
;
152 __le32 log_start_addr
;
154 /* Private status to be used by the lower drivers */
155 struct wl18xx_fw_status_priv priv
;
158 #define WL18XX_PHY_VERSION_MAX_LEN 20
160 struct wl18xx_static_data_priv
{
161 char phy_version
[WL18XX_PHY_VERSION_MAX_LEN
];
164 struct wl18xx_clk_cfg
{
173 CLOCK_CONFIG_16_2_M
= 1,
174 CLOCK_CONFIG_16_368_M
,
178 CLOCK_CONFIG_32_736_M
,
180 CLOCK_CONFIG_38_468_M
,
186 #endif /* __WL18XX_PRIV_H__ */