Mistake on this page?
Report an issue in GitHub or email us
whd_sdpcm.h
Go to the documentation of this file.
1 /*
2  * Copyright 2021, Cypress Semiconductor Corporation (an Infineon company)
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  * Provides whd with function prototypes for IOCTL commands,
20  * and for communicating with the SDPCM module
21  *
22  */
23 
24 #ifndef INCLUDED_WHD_SDPCM_H
25 #define INCLUDED_WHD_SDPCM_H
26 
27 #include "whd.h"
28 #include "whd_events_int.h"
29 #include "cyabs_rtos.h"
30 #include "whd_network_types.h"
31 #include "whd_types_int.h"
32 #include "whd_cdc_bdc.h"
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 /******************************************************
40 * Constants
41 ******************************************************/
42 typedef enum
43 {
44  DATA_HEADER = 2,
45  ASYNCEVENT_HEADER = 1,
46  CONTROL_HEADER = 0
47 } sdpcm_header_type_t;
48 
49 /******************************************************
50 * Macros
51 ******************************************************/
52 
53 #define BUS_HEADER_LEN (12)
54 #define IOCTL_OFFSET (sizeof(whd_buffer_header_t) + 12 + 16)
55 
56 /******************************************************
57 * Structures
58 ******************************************************/
59 typedef struct whd_sdpcm_info
60 {
61  /* Bus data credit variables */
62  uint8_t tx_seq;
63  uint8_t tx_max;
64 
65 
66  /* Packet send queue variables */
67  cy_semaphore_t send_queue_mutex;
68  whd_buffer_t send_queue_head;
69  whd_buffer_t send_queue_tail;
70 
72 
73 typedef struct
74 {
75  whd_buffer_header_t buffer_header;
76  uint8_t bus_header[BUS_HEADER_LEN];
78 
79 #pragma pack(1)
80 typedef struct
81 {
82  bus_common_header_t common;
83  cdc_header_t cdc_header;
85 
86 typedef struct
87 {
88  bus_common_header_t common;
89  uint8_t _padding[2];
90  bdc_header_t bdc_header;
92 #pragma pack()
93 
94 /******************************************************
95 * Function declarations
96 ******************************************************/
97 
98 extern void whd_sdpcm_process_rx_packet(whd_driver_t whd_driver, whd_buffer_t buffer);
99 extern whd_result_t whd_sdpcm_init(whd_driver_t whd_driver);
100 extern void whd_sdpcm_quit(whd_driver_t whd_driver);
101 extern void whd_sdpcm_bus_vars_init(whd_driver_t whd_driver);
102 extern void whd_sdpcm_quit(whd_driver_t whd_driver);
103 extern whd_bool_t whd_sdpcm_has_tx_packet(whd_driver_t whd_driver);
104 
105 extern whd_result_t whd_sdpcm_get_packet_to_send(whd_driver_t whd_driver, whd_buffer_t *buffer);
106 extern void whd_sdpcm_update_credit(whd_driver_t whd_driver, uint8_t *data);
107 extern uint8_t whd_sdpcm_get_available_credits(whd_driver_t whd_driver);
108 extern void whd_update_host_interface_to_bss_index_mapping(whd_driver_t whd_driver, whd_interface_t interface,
109  uint32_t bssid_index);
110 
111 extern void whd_send_to_bus(whd_driver_t whd_driver, whd_buffer_t buffer,
112  sdpcm_header_type_t header_type);
113 
114 /******************************************************
115 * Global variables
116 ******************************************************/
117 
118 #ifdef __cplusplus
119 } /* extern "C" */
120 #endif
121 
122 #endif /* ifndef INCLUDED_WHD_SDPCM_H */
123 
Provides abstract pointer type to act as instance for: driver, interface, buffer funcs, network funcs, resource funcs and bus funcs.
whd_bool_t
Boolean values.
Definition: whd_types.h:162
uint32_t whd_result_t
WHD result is specified as uint32_t value.
Definition: whd_types.h:776
Defines common constants used with WHD within src folder.
Prototypes of functions corresponding to Buffer and Network Interface.
Header for Event detection.
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.