BA / Mbed OS BaBoRo1
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sw_mac_internal.h Source File

sw_mac_internal.h

00001 /*
00002  * Copyright (c) 2016-2017, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef SW_MAC_INTERNAL_H
00019 #define SW_MAC_INTERNAL_H
00020 
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 typedef enum {
00026     STAT_MAC_TX_QUEUE,
00027     STAT_MAC_RX_COUNT,
00028     STAT_MAC_TX_COUNT,
00029     STAT_MAC_BC_RX_COUNT,
00030     STAT_MAC_BC_TX_COUNT,
00031     STAT_MAC_BEA_RX_COUNT,
00032     STAT_MAC_BEA_TX_COUNT,
00033     STAT_MAC_RX_DROP,
00034     STAT_MAC_TX_FAIL,
00035     STAT_MAC_TX_RETRY,
00036     STAT_MAC_TX_CCA_ATT,
00037     STAT_MAC_TX_CCA_FAIL,
00038 } mac_stats_type_t;
00039 
00040 typedef enum arm_nwk_timer_id {
00041     ARM_NWK_MAC_TIMER = 0,
00042     ARM_NWK_IFS_TIMER = 1,
00043     ARM_NWK_MLME_TIMER = 2,
00044     ARM_NWK_CCA_TIMER = 3,
00045     ARM_NWK_BC_TIMER = 4,
00046     ARM_MCPS_TIMER = 5,
00047 } arm_nwk_timer_id_e;
00048 
00049 struct mac_api_s;
00050 struct fhss_api;
00051 struct protocol_interface_rf_mac_setup;
00052 
00053 struct mac_api_s *get_sw_mac_api(struct protocol_interface_rf_mac_setup *setup);
00054 struct protocol_interface_rf_mac_setup *get_sw_mac_ptr_by_mac_api(struct mac_api_s *api);
00055 struct protocol_interface_rf_mac_setup *get_sw_mac_ptr_by_fhss_api(const struct fhss_api *api);
00056 struct protocol_interface_rf_mac_setup *get_sw_mac_ptr_by_timer(int8_t id, enum arm_nwk_timer_id type);
00057 struct protocol_interface_rf_mac_setup *get_sw_mac_ptr_by_driver_id(int8_t id);
00058 void sw_mac_stats_update(struct protocol_interface_rf_mac_setup *setup, mac_stats_type_t type, uint32_t update_val);
00059 
00060 #ifdef __cplusplus
00061 }
00062 #endif
00063 
00064 #endif // SW_MAC_INTERNAL_H