|
| 1 | +/* |
| 2 | + * Copyright (c) 2018, Arm Limited and affiliates. |
| 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 | +#ifndef WS_LLC_H_ |
| 19 | +#define WS_LLC_H_ |
| 20 | + |
| 21 | +struct protocol_interface_info_entry; |
| 22 | +struct mcps_data_ind_s; |
| 23 | +struct mcps_data_ie_list; |
| 24 | +struct channel_list_s; |
| 25 | +struct ws_pan_information_s; |
| 26 | + |
| 27 | + |
| 28 | +/** |
| 29 | + * @brief ws_asynch_ind ws asynch data indication |
| 30 | + * @param interface Interface pointer |
| 31 | + * @param data MCPS-DATA.indication specific values |
| 32 | + * @param ie_ext Information element list |
| 33 | + */ |
| 34 | +typedef void ws_asynch_ind(struct protocol_interface_info_entry *interface, const struct mcps_data_ind_s *data, const struct mcps_data_ie_list *ie_ext, uint8_t message_type); |
| 35 | + |
| 36 | +/** |
| 37 | + * @brief ws_asynch_confirm ws asynch data confirmation to asynch message request |
| 38 | + * @param api The API which handled the response |
| 39 | + * @param data MCPS-DATA.confirm specific values |
| 40 | + * @param user_id MPX user ID |
| 41 | + */ |
| 42 | +typedef void ws_asynch_confirm(struct protocol_interface_info_entry *interface, uint8_t asynch_message); |
| 43 | + |
| 44 | +/** |
| 45 | + * @brief ws_llc_create ws LLC module create |
| 46 | + * @param interface Interface pointer |
| 47 | + * @param data MCPS-DATA.indication specific values |
| 48 | + * @param ie_ext Information element list |
| 49 | + * |
| 50 | + * Function allocate and init LLC class and init it 2 supported 2 API: ws asynch and MPX user are internally registered. |
| 51 | + */ |
| 52 | +int8_t ws_llc_create(struct protocol_interface_info_entry *interface, ws_asynch_ind *asynch_ind_cb, ws_asynch_confirm *asynch_cnf_cb); |
| 53 | + |
| 54 | +/** |
| 55 | + * @brief ws_llc_reset Reset ws LLC parametrs and clean messages |
| 56 | + * @param interface Interface pointer |
| 57 | + * |
| 58 | + */ |
| 59 | +void ws_llc_reset(struct protocol_interface_info_entry *interface); |
| 60 | + |
| 61 | +/** |
| 62 | + * @brief ws_llc_asynch_request ws asynch message request to all giving channels |
| 63 | + * @param interface Interface pointer |
| 64 | + * @param asynch_message Asynch message type: WS_FT_PAN_ADVERT, WS_FT_PAN_ADVERT_SOL, WS_FT_PAN_CONF or WS_FT_PAN_CONF_SOL |
| 65 | + * @param channel_list Channel list where message is pushed |
| 66 | + * |
| 67 | + * @return 0 Asynch message pushed to MAC |
| 68 | + * @return -1 memory allocate problem |
| 69 | + * @return -2 Parameter problem |
| 70 | + * LLC allocate message spesific IE element itself how it is configured |
| 71 | + * |
| 72 | + */ |
| 73 | +int8_t ws_llc_asynch_request(struct protocol_interface_info_entry *interface, uint8_t asynch_message, struct channel_list_s channel_list); |
| 74 | + |
| 75 | + |
| 76 | +/** |
| 77 | + * @brief ws_llc_set_vendor_header_data Configure WS vendor Header data information (Data of WH_IE_VH_TYPE IE element) |
| 78 | + * @param interface Interface pointer |
| 79 | + * @param vendor_header_length configured vendor header length |
| 80 | + * @param vendor_header pointer to vendor header this pointer must keep alive when it is configured to LLC |
| 81 | + * |
| 82 | + */ |
| 83 | +void ws_llc_set_vendor_header_data(struct protocol_interface_info_entry *interface, uint8_t vendor_header_length, uint8_t *vendor_header); |
| 84 | + |
| 85 | +/** |
| 86 | + * @brief ws_llc_set_vendor_payload_data Configure WS vendor payload data information (Data of WP_PAYLOAD_IE_VP_TYPE IE element) |
| 87 | + * @param interface Interface pointer |
| 88 | + * @param vendor_payload_length configured vendor payload length |
| 89 | + * @param vendor_payload pointer to vendor payload this pointer must keep alive when it is configured to LLC |
| 90 | + * |
| 91 | + */ |
| 92 | +void ws_llc_set_vendor_payload_data(struct protocol_interface_info_entry *interface, uint8_t vendor_payload_length, uint8_t *vendor_payload); |
| 93 | + |
| 94 | +/** |
| 95 | + * @brief ws_llc_set_network_name Configure WS Network name (Data of WP_PAYLOAD_IE_NETNAME_TYPE IE element) |
| 96 | + * @param interface Interface pointer |
| 97 | + * @param name_length configured network name length |
| 98 | + * @param net_name pointer to network name this pointer must keep alive when it is configured to LLC |
| 99 | + * |
| 100 | + */ |
| 101 | +void ws_llc_set_network_name(struct protocol_interface_info_entry *interface, uint8_t name_length, uint8_t *net_name); |
| 102 | + |
| 103 | +/** |
| 104 | + * @brief ws_llc_set_gtkhash Configure WS GTK hash information (Data of WP_PAYLOAD_IE_GTKHASH_TYPE IE element) |
| 105 | + * @param interface Interface pointer |
| 106 | + * @param gtkhash pointer to GTK hash which length is 32 bytes this pointer must keep alive when it is configured to LLC |
| 107 | + * |
| 108 | + */ |
| 109 | +void ws_llc_set_gtkhash(struct protocol_interface_info_entry *interface, uint8_t *gtkhash); |
| 110 | + |
| 111 | +/** |
| 112 | + * @brief ws_llc_set_pan_information_pointer Configure WS PAN information (Data of WP_PAYLOAD_IE_PAN_TYPE IE element) |
| 113 | + * @param interface Interface pointer |
| 114 | + * @param pan_information_pointer pointer to Pan information this pointer must keep alive when it is configured to LLC |
| 115 | + * |
| 116 | + */ |
| 117 | +void ws_llc_set_pan_information_pointer(struct protocol_interface_info_entry *interface, struct ws_pan_information_s *pan_information_pointer); |
| 118 | + |
| 119 | + |
| 120 | +#endif /* WS_LLC_H_ */ |
0 commit comments