| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2004-2011 Broadcom Corporation |
|---|
| 3 | * |
|---|
| 4 | * This program is the proprietary software of Broadcom Corporation and/or its licensors, |
|---|
| 5 | * and may only be used, duplicated, modified or distributed pursuant to the terms and |
|---|
| 6 | * conditions of a separate, written license agreement executed between you and Broadcom |
|---|
| 7 | * (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants |
|---|
| 8 | * no license (express or implied), right to use, or waiver of any kind with respect to the |
|---|
| 9 | * Software, and Broadcom expressly reserves all rights in and to the Software and all |
|---|
| 10 | * intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU |
|---|
| 11 | * HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY |
|---|
| 12 | * NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. |
|---|
| 13 | * |
|---|
| 14 | * Except as expressly set forth in the Authorized License, |
|---|
| 15 | * |
|---|
| 16 | * 1. This program, including its structure, sequence and organization, constitutes the valuable trade |
|---|
| 17 | * secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof, |
|---|
| 18 | * and to use this information only in connection with your use of Broadcom integrated circuit products. |
|---|
| 19 | * |
|---|
| 20 | * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
|---|
| 21 | * AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR |
|---|
| 22 | * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO |
|---|
| 23 | * THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES |
|---|
| 24 | * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, |
|---|
| 25 | * LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION |
|---|
| 26 | * OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF |
|---|
| 27 | * USE OR PERFORMANCE OF THE SOFTWARE. |
|---|
| 28 | * |
|---|
| 29 | * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS |
|---|
| 30 | * LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR |
|---|
| 31 | * EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR |
|---|
| 32 | * USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF |
|---|
| 33 | * THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT |
|---|
| 34 | * ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE |
|---|
| 35 | * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF |
|---|
| 36 | * ANY LIMITED REMEDY. |
|---|
| 37 | * |
|---|
| 38 | * $brcm_Workfile: nexus_frontend_card.h $ |
|---|
| 39 | * $brcm_Revision: 6 $ |
|---|
| 40 | * $brcm_Date: 3/4/11 3:04p $ |
|---|
| 41 | * |
|---|
| 42 | * API Description: |
|---|
| 43 | * API name: Frontend Card |
|---|
| 44 | * APIs to detect, open, and close removable frontend cards. |
|---|
| 45 | * |
|---|
| 46 | * Revision History: |
|---|
| 47 | * |
|---|
| 48 | * $brcm_Log: /nexus/modules/frontend/common/include/nexus_frontend_card.h $ |
|---|
| 49 | * |
|---|
| 50 | * 6 3/4/11 3:04p jgarrett |
|---|
| 51 | * SW7422-171: SW7422-179: Adding GPIO to nexus frontend cards and |
|---|
| 52 | * extending for OOB/US |
|---|
| 53 | * |
|---|
| 54 | * 5 8/20/09 1:58p erickson |
|---|
| 55 | * PR56791: added NEXUS_FrontendCardSettings.bitWideSync option |
|---|
| 56 | * |
|---|
| 57 | * 4 12/18/08 6:37p jgarrett |
|---|
| 58 | * PR 49983: Removing 73xx from cards |
|---|
| 59 | * |
|---|
| 60 | * 3 5/9/08 2:45p agin |
|---|
| 61 | * PR42336: Fixed name. |
|---|
| 62 | * |
|---|
| 63 | * 2 5/9/08 12:55p agin |
|---|
| 64 | * PR42336: Initialize disecq. |
|---|
| 65 | * |
|---|
| 66 | * 1 2/8/08 6:37p jgarrett |
|---|
| 67 | * PR 39408: Adding daughtercard support |
|---|
| 68 | * |
|---|
| 69 | ***************************************************************************/ |
|---|
| 70 | #ifndef NEXUS_FRONTEND_CARD_H__ |
|---|
| 71 | #define NEXUS_FRONTEND_CARD_H__ |
|---|
| 72 | |
|---|
| 73 | #ifdef __cplusplus |
|---|
| 74 | extern "C" { |
|---|
| 75 | #endif |
|---|
| 76 | |
|---|
| 77 | #include "nexus_frontend.h" |
|---|
| 78 | #include "nexus_i2c.h" |
|---|
| 79 | #include "nexus_gpio.h" |
|---|
| 80 | |
|---|
| 81 | /*************************************************************************** |
|---|
| 82 | Summary: |
|---|
| 83 | Handle for a frontend card |
|---|
| 84 | ***************************************************************************/ |
|---|
| 85 | typedef struct NEXUS_FrontendCard *NEXUS_FrontendCardHandle; |
|---|
| 86 | |
|---|
| 87 | /*************************************************************************** |
|---|
| 88 | Summary: |
|---|
| 89 | Settings for a frontend card |
|---|
| 90 | ***************************************************************************/ |
|---|
| 91 | typedef struct NEXUS_FrontendCardSettings |
|---|
| 92 | { |
|---|
| 93 | NEXUS_I2cHandle i2cDevice; /* I2C device to use */ |
|---|
| 94 | unsigned isrNumber; /* L1 interrupt number (typically 0..63)*/ |
|---|
| 95 | unsigned numChannels; /* Number of downstream channels supported */ |
|---|
| 96 | unsigned numOutOfBandChannels; /* Number of out of band channels supported (1 or 2 typically) */ |
|---|
| 97 | unsigned numUpstreamChannels; /* Number of upstream channels supported (1 or 2 typically) */ |
|---|
| 98 | bool bitWideSync; |
|---|
| 99 | NEXUS_GpioHandle gpioInterrupt; /* GPIO pin for interrupt. If not NULL, isrNumber is ignored. If NULL, isrNumber is used. */ |
|---|
| 100 | } NEXUS_FrontendCardSettings; |
|---|
| 101 | |
|---|
| 102 | /*************************************************************************** |
|---|
| 103 | Summary: |
|---|
| 104 | Get the default settings for a frontend card |
|---|
| 105 | ***************************************************************************/ |
|---|
| 106 | void NEXUS_FrontendCard_GetDefaultSettings( |
|---|
| 107 | NEXUS_FrontendCardSettings *pSettings /* [out] */ |
|---|
| 108 | ); |
|---|
| 109 | |
|---|
| 110 | /*************************************************************************** |
|---|
| 111 | Summary: |
|---|
| 112 | Open a frontend card. |
|---|
| 113 | |
|---|
| 114 | Description: |
|---|
| 115 | This routine will probe a frontend card slot for all known card types. |
|---|
| 116 | If a recognized card is found, a valid handle will be returned. |
|---|
| 117 | Otherwise, NULL handle will be returned. |
|---|
| 118 | |
|---|
| 119 | See Also: |
|---|
| 120 | NEXUS_FrontendCard_Close |
|---|
| 121 | ***************************************************************************/ |
|---|
| 122 | NEXUS_FrontendCardHandle NEXUS_FrontendCard_Open( /* attr{destructor=NEXUS_FrontendCard_Close} */ |
|---|
| 123 | const NEXUS_FrontendCardSettings *pSettings |
|---|
| 124 | ); |
|---|
| 125 | |
|---|
| 126 | /*************************************************************************** |
|---|
| 127 | Summary: |
|---|
| 128 | Close a frontend card. |
|---|
| 129 | ***************************************************************************/ |
|---|
| 130 | void NEXUS_FrontendCard_Close( |
|---|
| 131 | NEXUS_FrontendCardHandle handle |
|---|
| 132 | ); |
|---|
| 133 | |
|---|
| 134 | /*************************************************************************** |
|---|
| 135 | Summary: |
|---|
| 136 | Get the number of channels present on this frontend card |
|---|
| 137 | |
|---|
| 138 | Description: |
|---|
| 139 | Frontend cards may have multiple channels. This API allows the caller |
|---|
| 140 | to determine the number of channels available. |
|---|
| 141 | |
|---|
| 142 | See Also: |
|---|
| 143 | NEXUS_FrontendCard_GetChannel |
|---|
| 144 | ***************************************************************************/ |
|---|
| 145 | NEXUS_Error NEXUS_FrontendCard_GetNumChannels( |
|---|
| 146 | NEXUS_FrontendCardHandle handle, |
|---|
| 147 | unsigned *pNumChannels |
|---|
| 148 | ); |
|---|
| 149 | |
|---|
| 150 | /*************************************************************************** |
|---|
| 151 | Summary: |
|---|
| 152 | Get a frontend channel handle for this card |
|---|
| 153 | |
|---|
| 154 | Description: |
|---|
| 155 | Frontend cards may have multiple channels. This API allows the caller |
|---|
| 156 | to retrieve each channel using an index. |
|---|
| 157 | |
|---|
| 158 | See Also: |
|---|
| 159 | NEXUS_FrontendCard_GetNumChannels |
|---|
| 160 | ***************************************************************************/ |
|---|
| 161 | NEXUS_FrontendHandle NEXUS_FrontendCard_GetChannel( |
|---|
| 162 | NEXUS_FrontendCardHandle handle, |
|---|
| 163 | unsigned index |
|---|
| 164 | ); |
|---|
| 165 | |
|---|
| 166 | /*************************************************************************** |
|---|
| 167 | Summary: |
|---|
| 168 | Get the number of out of band channels present on this frontend card |
|---|
| 169 | |
|---|
| 170 | Description: |
|---|
| 171 | Frontend cards may have multiple out of band channels. This API allows the caller |
|---|
| 172 | to determine the number of out of band channels available. |
|---|
| 173 | |
|---|
| 174 | See Also: |
|---|
| 175 | NEXUS_FrontendCard_GetChannel |
|---|
| 176 | ***************************************************************************/ |
|---|
| 177 | NEXUS_Error NEXUS_FrontendCard_GetNumOutOfBandChannels( |
|---|
| 178 | NEXUS_FrontendCardHandle handle, |
|---|
| 179 | unsigned *pNumOutOfBandChannels |
|---|
| 180 | ); |
|---|
| 181 | |
|---|
| 182 | /*************************************************************************** |
|---|
| 183 | Summary: |
|---|
| 184 | Get a frontend out of band channel handle for this card |
|---|
| 185 | |
|---|
| 186 | Description: |
|---|
| 187 | Frontend cards may have multiple out of band channels. This API allows the caller |
|---|
| 188 | to retrieve each out of band channel using an index. |
|---|
| 189 | |
|---|
| 190 | See Also: |
|---|
| 191 | NEXUS_FrontendCard_GetNumChannels |
|---|
| 192 | ***************************************************************************/ |
|---|
| 193 | NEXUS_FrontendHandle NEXUS_FrontendCard_GetOutOfBandChannel( |
|---|
| 194 | NEXUS_FrontendCardHandle handle, |
|---|
| 195 | unsigned index |
|---|
| 196 | ); |
|---|
| 197 | |
|---|
| 198 | /*************************************************************************** |
|---|
| 199 | Summary: |
|---|
| 200 | Get the number of upstream channels present on this frontend card |
|---|
| 201 | |
|---|
| 202 | Description: |
|---|
| 203 | Frontend cards may have upstream multiple channels. This API allows the caller |
|---|
| 204 | to determine the number of upstream channels available. |
|---|
| 205 | |
|---|
| 206 | See Also: |
|---|
| 207 | NEXUS_FrontendCard_GetChannel |
|---|
| 208 | ***************************************************************************/ |
|---|
| 209 | NEXUS_Error NEXUS_FrontendCard_GetNumUpstreamChannels( |
|---|
| 210 | NEXUS_FrontendCardHandle handle, |
|---|
| 211 | unsigned *pNumUpstreamChannels |
|---|
| 212 | ); |
|---|
| 213 | |
|---|
| 214 | /*************************************************************************** |
|---|
| 215 | Summary: |
|---|
| 216 | Get a frontend upstream channel handle for this card |
|---|
| 217 | |
|---|
| 218 | Description: |
|---|
| 219 | Frontend cards may have multiple upstream channels. This API allows the caller |
|---|
| 220 | to retrieve each upstream channel using an index. |
|---|
| 221 | |
|---|
| 222 | See Also: |
|---|
| 223 | NEXUS_FrontendCard_GetNumChannels |
|---|
| 224 | ***************************************************************************/ |
|---|
| 225 | NEXUS_FrontendHandle NEXUS_FrontendCard_GetUpstreamChannel( |
|---|
| 226 | NEXUS_FrontendCardHandle handle, |
|---|
| 227 | unsigned index |
|---|
| 228 | ); |
|---|
| 229 | |
|---|
| 230 | #ifdef __cplusplus |
|---|
| 231 | } |
|---|
| 232 | #endif |
|---|
| 233 | |
|---|
| 234 | #endif |
|---|
| 235 | |
|---|