Shad Ansari | 2f7f9be | 2017-06-07 13:34:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | <:copyright-BRCM:2016:proprietary:standard |
| 3 | |
| 4 | Broadcom Proprietary and Confidential.(c) 2016 Broadcom |
| 5 | All Rights Reserved |
| 6 | |
| 7 | This program is the proprietary software of Broadcom Corporation and/or its |
| 8 | licensors, and may only be used, duplicated, modified or distributed pursuant |
| 9 | to the terms and conditions of a separate, written license agreement executed |
| 10 | between you and Broadcom (an "Authorized License"). Except as set forth in |
| 11 | an Authorized License, Broadcom grants no license (express or implied), right |
| 12 | to use, or waiver of any kind with respect to the Software, and Broadcom |
| 13 | expressly reserves all rights in and to the Software and all intellectual |
| 14 | property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE |
| 15 | NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY |
| 16 | BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. |
| 17 | |
| 18 | Except as expressly set forth in the Authorized License, |
| 19 | |
| 20 | 1. This program, including its structure, sequence and organization, |
| 21 | constitutes the valuable trade secrets of Broadcom, and you shall use |
| 22 | all reasonable efforts to protect the confidentiality thereof, and to |
| 23 | use this information only in connection with your use of Broadcom |
| 24 | integrated circuit products. |
| 25 | |
| 26 | 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
| 27 | AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR |
| 28 | WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH |
| 29 | RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND |
| 30 | ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, |
| 31 | FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR |
| 32 | COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE |
| 33 | TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF USE OR |
| 34 | PERFORMANCE OF THE SOFTWARE. |
| 35 | |
| 36 | 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR |
| 37 | ITS LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, |
| 38 | INDIRECT, OR EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY |
| 39 | WAY RELATING TO YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN |
| 40 | IF BROADCOM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; |
| 41 | OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE |
| 42 | SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE LIMITATIONS |
| 43 | SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF ANY |
| 44 | LIMITED REMEDY. |
| 45 | :> |
| 46 | */ |
| 47 | #ifndef _BCM_COMMON_GPON_FAST_H_ |
| 48 | #define _BCM_COMMON_GPON_FAST_H_ |
| 49 | |
| 50 | #ifndef SIMULATION_BUILD |
| 51 | #include <bcmtr_pcie_sw_queue.h> |
| 52 | #endif |
| 53 | |
| 54 | #define BCM_COMMON_GPON_FAST_API_LIST_SIZE 1280 |
| 55 | #define BCM_COMMON_GPON_FAST_API_ACCESS_LIST_SIZE 2048 |
| 56 | #define URGENT_CHANNEL BCMTR_SWQ_FIRST_URGENT_CHANNEL |
| 57 | |
| 58 | typedef enum |
| 59 | { |
| 60 | BCM_COMMON_FAST_MSG_TYPE_GET_ALLOC_STATS, |
| 61 | BCM_COMMON_FAST_MSG_TYPE_SET_ALLOCS, |
| 62 | BCM_COMMON_FAST_MSG_TYPE_SET_BW_ALLOCS |
| 63 | } bcm_common_fast_msg_type; |
| 64 | |
| 65 | typedef struct __PACKED_ATTR_START__ |
| 66 | { |
| 67 | uint16_t alloc_id; |
| 68 | uint32_t allocated; |
| 69 | uint32_t used; |
| 70 | uint32_t status_report; |
| 71 | } __PACKED_ATTR_END__ bcm_common_fast_get_alloc_stats; |
| 72 | |
| 73 | typedef struct __PACKED_ATTR_START__ |
| 74 | { |
| 75 | uint8_t pon_ni; |
| 76 | uint32_t cycle_num; |
| 77 | uint32_t available_bw; |
| 78 | uint32_t num_of_allocs; |
| 79 | } __PACKED_ATTR_END__ bcm_common_fast_get_stats_ind_hdr; |
| 80 | |
| 81 | typedef struct __PACKED_ATTR_START__ |
| 82 | { |
| 83 | bcm_common_fast_get_stats_ind_hdr hdr; |
| 84 | bcm_common_fast_get_alloc_stats alloc_stats_list[BCM_COMMON_GPON_FAST_API_LIST_SIZE]; |
| 85 | } __PACKED_ATTR_END__ bcm_common_fast_get_stats_ind; |
| 86 | |
| 87 | typedef struct __PACKED_ATTR_START__ |
| 88 | { |
| 89 | uint16_t alloc_id; |
| 90 | uint32_t allocation_blocks; |
| 91 | /* uint8_t access_num; - Will be added in the 2nd phase */ |
| 92 | } __PACKED_ATTR_END__ bcm_common_fast_set_alloc; |
| 93 | |
| 94 | typedef struct __PACKED_ATTR_START__ |
| 95 | { |
| 96 | uint32_t cycle_num; |
| 97 | uint32_t num_of_allocs; |
| 98 | } __PACKED_ATTR_END__ bcm_common_fast_msg_hdr; |
| 99 | |
| 100 | typedef struct __PACKED_ATTR_START__ |
| 101 | { |
| 102 | bcm_common_fast_msg_hdr hdr; |
| 103 | bcm_common_fast_set_alloc set_alloc_list[BCM_COMMON_GPON_FAST_API_LIST_SIZE]; |
| 104 | } __PACKED_ATTR_END__ bcm_common_fast_set_allocs_msg; |
| 105 | |
| 106 | typedef struct __PACKED_ATTR_START__ |
| 107 | { |
| 108 | uint16_t alloc_id; |
| 109 | uint16_t allocation_size; |
| 110 | uint16_t start_time; |
| 111 | uint8_t burst_profile; |
| 112 | struct __PACKED_ATTR_START__ |
| 113 | { |
| 114 | bcmos_bool ploam_flag :1; |
| 115 | bcmos_bool dbru_flag :1; |
| 116 | bcmos_bool end_of_frame :1; |
| 117 | bcmos_bool end_of_map :1; |
| 118 | bcmos_bool fwi :1; |
| 119 | uint8_t :3; |
| 120 | } __PACKED_ATTR_END__ alloc_flags; |
| 121 | } __PACKED_ATTR_END__ bcm_common_fast_set_access; |
| 122 | |
| 123 | typedef struct __PACKED_ATTR_START__ |
| 124 | { |
| 125 | bcm_common_fast_msg_hdr hdr; |
| 126 | bcm_common_fast_set_access set_access_list[BCM_COMMON_GPON_FAST_API_ACCESS_LIST_SIZE]; |
| 127 | } __PACKED_ATTR_END__ bcm_common_fast_set_accesses_msg; |
| 128 | |
| 129 | #endif |