| 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_oob.c $ |
|---|
| 39 | * $brcm_Revision: 7 $ |
|---|
| 40 | * $brcm_Date: 4/15/11 4:39p $ |
|---|
| 41 | * |
|---|
| 42 | * API Description: |
|---|
| 43 | * API name: Frontend OutOfBand |
|---|
| 44 | * Generic APIs for Out-of-band tuning. |
|---|
| 45 | * |
|---|
| 46 | * Revision History: |
|---|
| 47 | * |
|---|
| 48 | * $brcm_Log: X:/win_views/7425_latest/nexus/modules/frontend/common/src/nexus_frontend_oob.c $ |
|---|
| 49 | * |
|---|
| 50 | * 7 4/15/11 4:39p vishk |
|---|
| 51 | * SW7422-413: Nexus support for the 3128 OOB core for 7422 board |
|---|
| 52 | * |
|---|
| 53 | * 6 10/28/10 4:31p VISHK |
|---|
| 54 | * SW7420-1020: Request for non-blocking call support in Nexus frontend |
|---|
| 55 | * |
|---|
| 56 | * 5 6/26/09 1:44p vishk |
|---|
| 57 | * PR 56288: Add support to set OOB AGC pin mode for 3117 |
|---|
| 58 | * |
|---|
| 59 | * 4 1/23/09 3:32p jgarrett |
|---|
| 60 | * PR 51457: Adding frontend extension hooks for tuners and |
|---|
| 61 | * frontends/demods |
|---|
| 62 | * |
|---|
| 63 | * 3 9/23/08 9:16a jgarrett |
|---|
| 64 | * PR 46513: Merging 97459 support to mainline |
|---|
| 65 | * |
|---|
| 66 | * 2 7/11/08 5:06p jtna |
|---|
| 67 | * PR42924: Add channel change measurements functionality |
|---|
| 68 | * |
|---|
| 69 | * PR44830/1 7/22/08 8:10p anilmm |
|---|
| 70 | * PR44830: Set OOB mode and spectrum |
|---|
| 71 | * |
|---|
| 72 | * 1 1/18/08 2:19p jgarrett |
|---|
| 73 | * PR 38808: Merging to main branch |
|---|
| 74 | * |
|---|
| 75 | * Nexus_Devel/1 10/5/07 5:52p jgarrett |
|---|
| 76 | * PR 35551: Adding initial version |
|---|
| 77 | * |
|---|
| 78 | ***************************************************************************/ |
|---|
| 79 | |
|---|
| 80 | #include "nexus_frontend_module.h" |
|---|
| 81 | |
|---|
| 82 | BDBG_MODULE(nexus_frontend_oob); |
|---|
| 83 | |
|---|
| 84 | BTRC_MODULE_DECLARE(ChnChange_Tune); |
|---|
| 85 | |
|---|
| 86 | /*************************************************************************** |
|---|
| 87 | Summary: |
|---|
| 88 | Initialize an out-of-band settings structure to defaults |
|---|
| 89 | See Also: |
|---|
| 90 | NEXUS_Frontend_TuneOutOfBand |
|---|
| 91 | ***************************************************************************/ |
|---|
| 92 | void NEXUS_Frontend_GetDefaultOutOfBandSettings( |
|---|
| 93 | NEXUS_FrontendOutOfBandSettings *pSettings |
|---|
| 94 | ) |
|---|
| 95 | { |
|---|
| 96 | BKNI_Memset(pSettings, 0, sizeof(*pSettings)); |
|---|
| 97 | pSettings->mode = NEXUS_FrontendOutOfBandMode_ePod_Dvs178Qpsk; |
|---|
| 98 | pSettings->spectrum = NEXUS_FrontendOutOfBandSpectrum_eAuto; |
|---|
| 99 | pSettings->openDrain = true; |
|---|
| 100 | pSettings->bertSource = NEXUS_FrontendOutOfBandBertSource_eFecOutput; |
|---|
| 101 | } |
|---|
| 102 | |
|---|
| 103 | /*************************************************************************** |
|---|
| 104 | Summary: |
|---|
| 105 | Tune a frontend to an out-of-band channel |
|---|
| 106 | See Also: |
|---|
| 107 | NEXUS_Frontend_InitOutOfBandSettings |
|---|
| 108 | ***************************************************************************/ |
|---|
| 109 | NEXUS_Error NEXUS_Frontend_TuneOutOfBand( |
|---|
| 110 | NEXUS_FrontendHandle handle, |
|---|
| 111 | const NEXUS_FrontendOutOfBandSettings *pSettings |
|---|
| 112 | ) |
|---|
| 113 | { |
|---|
| 114 | BDBG_ASSERT(NULL != handle); |
|---|
| 115 | BDBG_ASSERT(NULL != pSettings); |
|---|
| 116 | BTRC_TRACE(ChnChange_Tune, START); |
|---|
| 117 | |
|---|
| 118 | if ( NULL == handle->tuneOutOfBand ) |
|---|
| 119 | { |
|---|
| 120 | if ( handle->pParentFrontend ) |
|---|
| 121 | { |
|---|
| 122 | return NEXUS_Frontend_TuneOutOfBand(handle->pParentFrontend, pSettings); |
|---|
| 123 | } |
|---|
| 124 | else |
|---|
| 125 | { |
|---|
| 126 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 127 | } |
|---|
| 128 | } |
|---|
| 129 | else |
|---|
| 130 | { |
|---|
| 131 | return handle->tuneOutOfBand(handle->pDeviceHandle, pSettings); |
|---|
| 132 | } |
|---|
| 133 | } |
|---|
| 134 | |
|---|
| 135 | /*************************************************************************** |
|---|
| 136 | Summary: |
|---|
| 137 | Get the out-of-band status synchronouslyof a frontend |
|---|
| 138 | See Also: |
|---|
| 139 | NEXUS_Frontend_TuneOutOfBand |
|---|
| 140 | ***************************************************************************/ |
|---|
| 141 | NEXUS_Error NEXUS_Frontend_GetOutOfBandStatus( |
|---|
| 142 | NEXUS_FrontendHandle handle, |
|---|
| 143 | NEXUS_FrontendOutOfBandStatus *pStatus /* [out] */ |
|---|
| 144 | ) |
|---|
| 145 | { |
|---|
| 146 | BDBG_ASSERT(NULL != handle); |
|---|
| 147 | BDBG_ASSERT(NULL != pStatus); |
|---|
| 148 | |
|---|
| 149 | if ( NULL == handle->getOutOfBandStatus ) |
|---|
| 150 | { |
|---|
| 151 | if ( handle->pParentFrontend ) |
|---|
| 152 | { |
|---|
| 153 | return NEXUS_Frontend_GetOutOfBandStatus(handle->pParentFrontend, pStatus); |
|---|
| 154 | } |
|---|
| 155 | else |
|---|
| 156 | { |
|---|
| 157 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 158 | } |
|---|
| 159 | } |
|---|
| 160 | else |
|---|
| 161 | { |
|---|
| 162 | return handle->getOutOfBandStatus(handle->pDeviceHandle, pStatus); |
|---|
| 163 | } |
|---|
| 164 | } |
|---|
| 165 | |
|---|
| 166 | /*************************************************************************** |
|---|
| 167 | Summary: |
|---|
| 168 | Get the out-of-band status asynchronously of a frontend |
|---|
| 169 | See Also: |
|---|
| 170 | NEXUS_Frontend_TuneOutOfBand |
|---|
| 171 | ***************************************************************************/ |
|---|
| 172 | NEXUS_Error NEXUS_Frontend_GetOutOfBandAsyncStatus( |
|---|
| 173 | NEXUS_FrontendHandle handle, |
|---|
| 174 | NEXUS_FrontendOutOfBandStatus *pStatus /* [out] */ |
|---|
| 175 | ) |
|---|
| 176 | { |
|---|
| 177 | BDBG_ASSERT(NULL != handle); |
|---|
| 178 | BDBG_ASSERT(NULL != pStatus); |
|---|
| 179 | |
|---|
| 180 | if ( NULL == handle->getOutOfBandStatus ) |
|---|
| 181 | { |
|---|
| 182 | if ( handle->pParentFrontend ) |
|---|
| 183 | { |
|---|
| 184 | return NEXUS_Frontend_GetOutOfBandAsyncStatus(handle->pParentFrontend, pStatus); |
|---|
| 185 | } |
|---|
| 186 | else |
|---|
| 187 | { |
|---|
| 188 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 189 | } |
|---|
| 190 | } |
|---|
| 191 | else |
|---|
| 192 | { |
|---|
| 193 | return handle->getOutOfBandAsyncStatus(handle->pDeviceHandle, pStatus); |
|---|
| 194 | } |
|---|
| 195 | } |
|---|
| 196 | |
|---|
| 197 | |
|---|
| 198 | NEXUS_Error NEXUS_Frontend_RequestOutOfBandAsyncStatus( |
|---|
| 199 | NEXUS_FrontendHandle handle |
|---|
| 200 | ) |
|---|
| 201 | { |
|---|
| 202 | BDBG_ASSERT(NULL != handle); |
|---|
| 203 | |
|---|
| 204 | if ( NULL == handle->requestOutOfBandAsyncStatus ) |
|---|
| 205 | { |
|---|
| 206 | if ( handle->pParentFrontend ) |
|---|
| 207 | { |
|---|
| 208 | return NEXUS_Frontend_RequestOutOfBandAsyncStatus(handle->pParentFrontend); |
|---|
| 209 | } |
|---|
| 210 | else |
|---|
| 211 | { |
|---|
| 212 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 213 | } |
|---|
| 214 | } |
|---|
| 215 | else |
|---|
| 216 | { |
|---|
| 217 | return handle->requestOutOfBandAsyncStatus(handle->pDeviceHandle); |
|---|
| 218 | } |
|---|
| 219 | } |
|---|
| 220 | |
|---|