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 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  * 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 packet_transmit_sequence_number;
63  uint8_t last_bus_data_credit;
64  uint8_t credit_diff;
65  uint8_t largest_credit_diff;
66 
67  /* Packet send queue variables */
68  cy_semaphore_t send_queue_mutex;
69  whd_buffer_t send_queue_head;
70  whd_buffer_t send_queue_tail;
71 
73 
74 typedef struct
75 {
76  whd_buffer_header_t buffer_header;
77  uint8_t bus_header[BUS_HEADER_LEN];
79 
80 #pragma pack(1)
81 typedef struct
82 {
83  bus_common_header_t common;
84  cdc_header_t cdc_header;
86 
87 typedef struct
88 {
89  bus_common_header_t common;
90  uint8_t _padding[2];
91  bdc_header_t bdc_header;
93 #pragma pack()
94 
95 /******************************************************
96 * Function declarations
97 ******************************************************/
98 
99 extern void whd_sdpcm_process_rx_packet(whd_driver_t whd_driver, whd_buffer_t buffer);
100 extern whd_result_t whd_sdpcm_init(whd_driver_t whd_driver);
101 extern void whd_sdpcm_quit(whd_driver_t whd_driver);
102 extern void whd_sdpcm_bus_vars_init(whd_driver_t whd_driver);
103 extern void whd_sdpcm_quit(whd_driver_t whd_driver);
104 extern whd_bool_t whd_sdpcm_has_tx_packet(whd_driver_t whd_driver);
105 
106 extern whd_result_t whd_sdpcm_get_packet_to_send(whd_driver_t whd_driver, whd_buffer_t *buffer);
107 extern void whd_sdpcm_update_credit(whd_driver_t whd_driver, uint8_t *data);
108 extern uint8_t whd_sdpcm_get_available_credits(whd_driver_t whd_driver);
109 extern void whd_update_host_interface_to_bss_index_mapping(whd_driver_t whd_driver, whd_interface_t interface,
110  uint32_t bssid_index);
111 
112 extern void whd_send_to_bus(whd_driver_t whd_driver, whd_buffer_t buffer,
113  sdpcm_header_type_t header_type);
114 
115 /******************************************************
116 * Global variables
117 ******************************************************/
118 
119 #ifdef __cplusplus
120 } /* extern "C" */
121 #endif
122 
123 #endif /* ifndef INCLUDED_WHD_SDPCM_H */
124 
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.