VSF Documented
vsf_wifi_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_WIFI_PRIV_H__
19#define __VSF_WIFI_PRIV_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "./vsf_wifi.h"
24
25#if VSF_USE_WIFI == ENABLED
26
27/*============================ TYPES =========================================*/
28
29/*
30 * The wifi layer is intentionally bus-agnostic, so vsf_wifi_t holds NO
31 * USB / SDIO / SPI specifics. The bus driver embeds vsf_wifi_t inside a
32 * larger struct (e.g. vk_usbh_wifi_t) and recovers its outer instance via
33 * vsf_container_of() inside the bus_ops implementations.
34 */
35struct vsf_wifi_t {
40
43 bool disconnecting; /* set in fini() to gate stale callbacks */
44
45 /* ---- Scan state (wifi-driven hop scheduler) ---- */
51#if VSF_KERNEL_CFG_SUPPORT_CALLBACK_TIMER == ENABLED
53#endif
54
55 /* ---- Script / blob dispatcher state ----
56 *
57 * Only one outstanding script or blob is allowed per wifi (the bus_ops
58 * concurrency contract enforces the same limit at the bus level). The
59 * dispatcher walks the op array via the chained __script_step_done /
60 * __blob_step_done callbacks, each of which feeds the next op to
61 * bus_ops.
62 */
66 union {
67 struct {
72 struct {
73 const uint8_t *data;
75 uint32_t offset; /* used by the reg_write fallback path */
79 } s;
80
81 /*
82 * Backend-level chain slot. When a chip op needs to issue several
83 * scripts back-to-back (firmware_load = run_blob + post-fw script),
84 * it stashes the *outer* `done` here, then internally chains via local
85 * helpers. Only one chain may be in flight at a time — same constraint
86 * as the script dispatcher itself.
87 */
89
91};
92
93#endif // VSF_USE_WIFI
94#endif // __VSF_WIFI_PRIV_H__
Definition vsf_eda.h:851
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_wifi.h:165
Definition vsf_wifi.h:217
Definition vsf_wifi.h:128
Definition vsf_wifi_priv.h:35
vsf_callback_timer_t scan_timer
Definition vsf_wifi_priv.h:52
bool scanning
Definition vsf_wifi_priv.h:46
const vsf_wifi_chip_drv_t * drv
Definition vsf_wifi_priv.h:36
uint8_t scan_channel_idx
Definition vsf_wifi_priv.h:47
uint32_t len
Definition vsf_wifi_priv.h:74
const vsf_wifi_bus_ops_t * bus_ops
Definition vsf_wifi_priv.h:37
struct vsf_wifi_t::@328::@329 script
uint8_t scan_channels[VSF_WIFI_CFG_SCAN_MAX_CHANNELS]
Definition vsf_wifi_priv.h:49
uint8_t scan_num_channels
Definition vsf_wifi_priv.h:48
bool script_busy
Definition vsf_wifi_priv.h:63
union vsf_wifi_t::@328 s
bool script_is_blob
Definition vsf_wifi_priv.h:64
const vsf_wifi_op_t * ops
Definition vsf_wifi_priv.h:68
uint16_t idx
Definition vsf_wifi_priv.h:70
bool disconnecting
Definition vsf_wifi_priv.h:43
uint8_t channel
Definition vsf_wifi_priv.h:41
uint16_t chunk_size
Definition vsf_wifi_priv.h:77
uint16_t count
Definition vsf_wifi_priv.h:69
vsf_wifi_attach_fail_t attach_fail
Definition vsf_wifi_priv.h:39
uint16_t base_reg
Definition vsf_wifi_priv.h:76
vsf_wifi_done_t script_done
Definition vsf_wifi_priv.h:65
vsf_wifi_done_t backend_chain_done
Definition vsf_wifi_priv.h:88
uint16_t scan_dwell_ms
Definition vsf_wifi_priv.h:50
struct vsf_wifi_t::@328::@330 blob
vsf_eda_t * post_eda
Definition vsf_wifi_priv.h:38
const uint8_t * data
Definition vsf_wifi_priv.h:73
vsf_wifi_op_t scratch_ops[VSF_WIFI_CFG_SCRATCH_OPS]
Definition vsf_wifi_priv.h:90
bool is_ready
Definition vsf_wifi_priv.h:42
uint32_t offset
Definition vsf_wifi_priv.h:75
#define VSF_WIFI_CFG_SCRATCH_OPS
Definition vsf_wifi.h:74
#define VSF_WIFI_CFG_SCAN_MAX_CHANNELS
Definition vsf_wifi.h:79
void(* vsf_wifi_done_t)(vsf_wifi_t *wifi, vsf_err_t err)
Definition vsf_wifi.h:92
void(* vsf_wifi_attach_fail_t)(vsf_wifi_t *wifi, vsf_err_t err)
Definition vsf_wifi.h:355
Generated from commit: vsfteam/vsf@3b461d0