Mistake on this page?
Report an issue in GitHub or email us
whd_int.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 Cypress Semiconductor Corporation
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /** @file
19  * Header for whd_driver structure
20  */
21 
22 #ifndef INCLUDED_WHD_INT_H
23 #define INCLUDED_WHD_INT_H
24 
25 #include "whd_thread.h"
26 #include "whd_sdpcm.h"
27 #include "whd_cdc_bdc.h"
28 #include "whd_chip.h"
29 #include "whd_ap.h"
30 #include "whd_debug.h"
31 
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37 typedef struct
38 {
39  uint32_t tx_total; /* Total number of TX packets sent from WHD */
40  uint32_t rx_total; /* Total number of RX packets received at WHD */
41  uint32_t tx_no_mem; /* Number of times WHD could not send due to no buffer */
42  uint32_t rx_no_mem; /* Number of times WHD could not receive due to no buffer */
43  uint32_t tx_fail; /* Number of times TX packet failed */
44  uint32_t no_credit; /* Number of times WHD could not send due to no credit */
45  uint32_t flow_control; /* Number of times WHD Flow control is enabled */
46  uint32_t internal_host_buffer_fail_with_timeout; /* Internal host buffer get failed after timeout */
47 } whd_stats_t;
48 
49 #define WHD_INTERFACE_MAX 3
50 typedef enum
51 {
52  WHD_INVALID_ROLE = 0,
53  WHD_STA_ROLE = 1, /**< STA or Client Interface */
54  WHD_AP_ROLE = 2, /**< softAP Interface */
55  WHD_P2P_ROLE = 3, /**< P2P Interface */
57 
58 
60 {
62  uint8_t ifidx;
63  uint8_t bsscfgidx;
64 
65  char if_name[WHD_MSG_IFNAME_MAX];
67  whd_mac_t mac_addr;
68  uint8_t event_reg_list[WHD_EVENT_ENTRY_MAX];
69  whd_bool_t state;
70 };
71 
72 struct whd_driver
73 {
74  whd_interface_t iflist[WHD_INTERFACE_MAX];
75  uint8_t if2ifp[WHD_INTERFACE_MAX];
76 
77  /* Bus variables */
78  struct whd_bus_info *bus_if;
79  struct whd_bus_priv *bus_priv;
80  struct whd_bus_common_info *bus_common_info;
81  whd_buffer_funcs_t *buffer_if;
82  whd_netif_funcs_t *network_if;
83  whd_resource_source_t *resource_if;
84 
85  whd_bool_t bus_gspi_32bit;
86 
87  whd_thread_info_t thread_info;
88  whd_cdc_bdc_info_t cdc_bdc_info;
89  whd_sdpcm_info_t sdpcm_info;
90  whd_internal_info_t internal_info;
91  whd_ap_int_info_t ap_info;
92  whd_chip_info_t chip_info;
93 
94  whd_stats_t whd_stats;
95  whd_country_code_t country;
96 
97  whd_ioctl_log_t whd_ioctl_log[WHD_IOCTL_LOG_SIZE];
98  int whd_ioctl_log_index;
99 };
100 
101 whd_result_t whd_add_interface(whd_driver_t whd_driver, uint8_t bsscfgidx, uint8_t ifidx,
102  const char *name, whd_mac_t *mac_addr, whd_interface_t *ifpp);
103 
104 whd_result_t whd_add_primary_interface(whd_driver_t whd_driver, whd_interface_t *ifpp);
105 
106 whd_interface_t whd_get_primary_interface(whd_driver_t whd_driver);
107 
108 
109 #ifdef __cplusplus
110 } /* extern "C" */
111 #endif
112 #endif /* INCLUDED_WHD_INT_H */
113 
Contains functions which allows WHD to pass received data to the network stack, to send an ethernet f...
whd_country_code_t
Enumerated list of country codes.
Definition: whd_types.h:434
Provides whd with function prototypes for IOCTL commands, and for communicating with the SDPCM module...
P2P Interface.
Definition: whd_int.h:55
whd_bool_t
Boolean values.
Definition: whd_types.h:162
Provides prototypes / declarations for APSTA functionality.
The whd Thread allows thread safe access to the whd hardware bus This is an whd internal file and sho...
Structure for storing a MAC address (Wi-Fi Media Access Control address).
Definition: whd_types.h:385
uint32_t whd_result_t
WHD result is specified as uint32_t value.
Definition: whd_types.h:776
STA or Client Interface.
Definition: whd_int.h:53
Allows WHD to perform buffer related operations like, allocating, releasing, retrieving the current p...
#define WHD_MSG_IFNAME_MAX
Max length of Interface name.
Definition: whd_events.h:119
whd_interface_role_t
Definition: whd_int.h:50
softAP Interface
Definition: whd_int.h:54
Interface to a data source that provides external resources to the radio driver.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.