VSF Documented
vsf_usbh_wifi_rt2x00_priv.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_USBH_WIFI_RT2X00_PRIV_H__
19#define __VSF_USBH_WIFI_RT2X00_PRIV_H__
20
21/*============================ INCLUDES ======================================*/
23#include "../../vsf_usbh.h"
25
26#if VSF_USE_USB_HOST == ENABLED && VSF_USBH_USE_RT2X00 == ENABLED && VSF_USE_WIFI == ENABLED
27
29
30/*============================ MACROS ========================================*/
31
32#ifndef VSF_USBH_WIFI_CFG_RX_NUM
33# define VSF_USBH_WIFI_CFG_RX_NUM 4
34#endif
35#ifndef VSF_USBH_WIFI_CFG_TX_NUM
36# define VSF_USBH_WIFI_CFG_TX_NUM 4
37#endif
38#ifndef VSF_USBH_WIFI_CFG_URB_BUFSIZE
39# define VSF_USBH_WIFI_CFG_URB_BUFSIZE 4096
40#endif
41#ifndef VSF_USBH_WIFI_CFG_TX_USE_LOCAL_BUFFER
42# define VSF_USBH_WIFI_CFG_TX_USE_LOCAL_BUFFER ENABLED
43#endif
44
45/*
46 * Per-chunk size for firmware blob upload via reg_block_write.
47 * Each chunk becomes one ep0 vendor 0x01 OUT transfer.
48 */
49#ifndef VSF_USBH_WIFI_CFG_FW_CHUNK_SIZE
50# define VSF_USBH_WIFI_CFG_FW_CHUNK_SIZE 64
51#endif
52
53/*============================ TYPES =========================================*/
54
61
62/*
63 * Bus operation in-flight state. At most one reg_bus call is active at a
64 * time (the generic layer's script_busy flag guarantees serialisation).
65 */
73
75 /* Generic wifi state (embedded; use vk_usbh_wifi_get_wifi to expose). */
77
78 /* USB host bindings */
84
85 /* Bus-op in-flight state */
87 vsf_wifi_done_t bus_done; /* completion callback */
88 uint32_t *bus_read_out; /* output pointer for reg_read */
89 bool bus_pending_first; /* waiting for ep0 crit */
90
91 /* Block-write multi-chunk state */
97
98 /* Vendor-request (USB_DEVICE_MODE etc.) state: bRequest/wValue/wIndex,
99 * no data stage (wLength=0). */
103
104 /* Bulk RX/TX iocb pool */
105 union {
106 struct {
109 };
112 };
113};
114
115/*============================ HELPER MACRO ==================================*/
116
117#define __this_wifi(__eda) vsf_container_of(__eda, vk_usbh_wifi_t, eda)
118
119#endif // VSF_USE_USB_HOST && VSF_USBH_USE_RT2X00 && VSF_USE_WIFI
120#endif // __VSF_USBH_WIFI_RT2X00_PRIV_H__
Definition vsf_usbh.h:478
Definition vsf_usbh.h:523
Definition vsf_usbh.h:450
Definition vsf_eda.h:769
unsigned short uint16_t
Definition stdint.h:7
unsigned uint32_t
Definition stdint.h:9
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_usbh.h:188
Definition vsf_usbh.h:179
Definition vsf_usbh_wifi_rt2x00_priv.h:55
uint8_t is_supported
Definition vsf_usbh_wifi_rt2x00_priv.h:58
uint8_t is_rx
Definition vsf_usbh_wifi_rt2x00_priv.h:57
uint8_t is_busy
Definition vsf_usbh_wifi_rt2x00_priv.h:59
vk_usbh_urb_t urb
Definition vsf_usbh_wifi_rt2x00_priv.h:56
Definition vsf_usbh_wifi_rt2x00_priv.h:74
vk_usbh_dev_t * dev
Definition vsf_usbh_wifi_rt2x00_priv.h:80
uint16_t bus_vendor_index
Definition vsf_usbh_wifi_rt2x00_priv.h:102
const uint8_t * bus_block_data
Definition vsf_usbh_wifi_rt2x00_priv.h:92
uint8_t bus_vendor_request
Definition vsf_usbh_wifi_rt2x00_priv.h:100
vsf_eda_t eda
Definition vsf_usbh_wifi_rt2x00_priv.h:83
vsf_wifi_done_t bus_done
Definition vsf_usbh_wifi_rt2x00_priv.h:87
vk_usbh_wifi_iocb_t rx_icb[VSF_USBH_WIFI_CFG_RX_NUM]
Definition vsf_usbh_wifi_rt2x00_priv.h:107
uint16_t bus_block_base
Definition vsf_usbh_wifi_rt2x00_priv.h:95
vsf_wifi_t wifi
Definition vsf_usbh_wifi_rt2x00_priv.h:76
uint16_t bus_block_chunk
Definition vsf_usbh_wifi_rt2x00_priv.h:96
vk_usbh_ifs_t * ifs
Definition vsf_usbh_wifi_rt2x00_priv.h:81
vk_usbh_t * usbh
Definition vsf_usbh_wifi_rt2x00_priv.h:79
vk_usbh_wifi_iocb_t tx_ocb[VSF_USBH_WIFI_CFG_TX_NUM]
Definition vsf_usbh_wifi_rt2x00_priv.h:108
vk_usbh_dev_id_t id
Definition vsf_usbh_wifi_rt2x00_priv.h:82
uint32_t * bus_read_out
Definition vsf_usbh_wifi_rt2x00_priv.h:88
uint32_t bus_block_offset
Definition vsf_usbh_wifi_rt2x00_priv.h:94
vk_usbh_wifi_iocb_t iocb[VSF_USBH_WIFI_CFG_RX_NUM+VSF_USBH_WIFI_CFG_TX_NUM]
Definition vsf_usbh_wifi_rt2x00_priv.h:111
bool bus_pending_first
Definition vsf_usbh_wifi_rt2x00_priv.h:89
uint16_t bus_vendor_value
Definition vsf_usbh_wifi_rt2x00_priv.h:101
uint32_t bus_block_len
Definition vsf_usbh_wifi_rt2x00_priv.h:93
vk_usbh_wifi_bus_state_t bus_state
Definition vsf_usbh_wifi_rt2x00_priv.h:86
Definition vsf_wifi_priv.h:36
vk_usbh_wifi_bus_state_t
Definition vsf_usbh_wifi_rt2x00_priv.h:66
@ VK_USBH_WIFI_BUS_BLOCK_WRITE
Definition vsf_usbh_wifi_rt2x00_priv.h:70
@ VK_USBH_WIFI_BUS_REG_WRITE
Definition vsf_usbh_wifi_rt2x00_priv.h:68
@ VK_USBH_WIFI_BUS_REG_READ
Definition vsf_usbh_wifi_rt2x00_priv.h:69
@ VK_USBH_WIFI_BUS_VENDOR
Definition vsf_usbh_wifi_rt2x00_priv.h:71
@ VK_USBH_WIFI_BUS_IDLE
Definition vsf_usbh_wifi_rt2x00_priv.h:67
struct vk_usbh_wifi_iocb_t vk_usbh_wifi_iocb_t
#define VSF_USBH_WIFI_CFG_TX_NUM
Definition vsf_usbh_wifi_rt2x00_priv.h:36
#define VSF_USBH_WIFI_CFG_RX_NUM
Definition vsf_usbh_wifi_rt2x00_priv.h:33
void(* vsf_wifi_done_t)(vsf_wifi_t *wifi, vsf_err_t err)
Definition vsf_wifi.h:120
Generated from commit: vsfteam/vsf@d3b40b2