| 1 | /****************************************************************************** |
|---|
| 2 | * (c)2008-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_mpod.c $ |
|---|
| 39 | * $brcm_Revision: 20 $ |
|---|
| 40 | * $brcm_Date: 10/31/11 7:47p $ |
|---|
| 41 | * |
|---|
| 42 | * Module Description: |
|---|
| 43 | * |
|---|
| 44 | * Revision History: |
|---|
| 45 | * |
|---|
| 46 | * $brcm_Log: /nexus/modules/transport/7400/src/nexus_mpod.c $ |
|---|
| 47 | * |
|---|
| 48 | * 20 10/31/11 7:47p bandrews |
|---|
| 49 | * SW7231-391: merge to main |
|---|
| 50 | * |
|---|
| 51 | * SW7420-2078/1 10/25/11 5:22p bandrews |
|---|
| 52 | * SW7231-391: update parser band and timebase implementations to use |
|---|
| 53 | * handles everywhere, even for legacy enum usage |
|---|
| 54 | * |
|---|
| 55 | * 19 10/13/11 3:32p erickson |
|---|
| 56 | * SW7420-1120: improve code for platforms without parser bands |
|---|
| 57 | * |
|---|
| 58 | * 18 4/19/11 10:48a erickson |
|---|
| 59 | * SW7125-908: rework mpod clock delay setting |
|---|
| 60 | * |
|---|
| 61 | * 17 12/16/10 6:07p vsilyaev |
|---|
| 62 | * SW7425-39: Added playpump private interface |
|---|
| 63 | * |
|---|
| 64 | * 16 10/28/10 5:09p erickson |
|---|
| 65 | * SW7422-20: adapt to new XPT PI (backward compat using magnum and nexus |
|---|
| 66 | * macros) |
|---|
| 67 | * |
|---|
| 68 | * 15 9/20/10 6:10p mphillip |
|---|
| 69 | * SW7420-1044: Add support for new mpod API |
|---|
| 70 | * |
|---|
| 71 | * 14 12/11/09 3:31p erickson |
|---|
| 72 | * SW7408-1: convert to standard XPT define |
|---|
| 73 | * |
|---|
| 74 | * 13 12/1/09 6:31p randyjew |
|---|
| 75 | * SW7468-6: Add 7468 support |
|---|
| 76 | * |
|---|
| 77 | * 13 12/1/09 6:29p randyjew |
|---|
| 78 | * SW7468-6: Add 7468 support |
|---|
| 79 | * |
|---|
| 80 | * 12 11/19/09 4:25p gmohile |
|---|
| 81 | * SW7408-1 : Add 7408 support |
|---|
| 82 | * |
|---|
| 83 | * 11 10/9/09 10:41a erickson |
|---|
| 84 | * SW7325-605: add NEXUS_MpodOpenSettings.clockNotRunning |
|---|
| 85 | * |
|---|
| 86 | * 10 9/22/09 1:03p erickson |
|---|
| 87 | * SW7325-605: add NEXUS_MpodOpenSettings.outputInvertSync. update |
|---|
| 88 | * comments. |
|---|
| 89 | * |
|---|
| 90 | * 9 7/31/09 2:36p gmohile |
|---|
| 91 | * PR 56512 : Add 7401/03 support |
|---|
| 92 | * |
|---|
| 93 | * 8 7/6/09 10:18a erickson |
|---|
| 94 | * PR56566: fix memory leak in NEXUS_MpodInput_Close |
|---|
| 95 | * |
|---|
| 96 | * 7 2/24/09 5:27p anilmm |
|---|
| 97 | * PR52416: parser band allpass setting not updated in shadow parser band |
|---|
| 98 | * config setting |
|---|
| 99 | * |
|---|
| 100 | * 6 9/23/08 9:16a jgarrett |
|---|
| 101 | * PR 46513: Merging 97459 support to mainline |
|---|
| 102 | * |
|---|
| 103 | * PR44830/2 9/15/08 5:16p anilmm |
|---|
| 104 | * PR44830: Adjust for nexus naming convention |
|---|
| 105 | * |
|---|
| 106 | * PR44830/1 7/28/08 7:35p anilmm |
|---|
| 107 | * PR44830: Add output interface control settings to NEXUS_Mpod_Open |
|---|
| 108 | * |
|---|
| 109 | * 5 8/14/08 5:26p katrep |
|---|
| 110 | * PR45674: Fix compiiler warning in kernel mode non debug builds |
|---|
| 111 | * |
|---|
| 112 | * 4 7/7/08 4:44p erickson |
|---|
| 113 | * PR44486: added NEXUS_MpodOpenSettings.pod2ChipMClkMuxSelect |
|---|
| 114 | * |
|---|
| 115 | * 3 6/18/08 1:28p erickson |
|---|
| 116 | * PR43730: fix warning, remove unneeded handle in GetDefaultSettings |
|---|
| 117 | * |
|---|
| 118 | * 2 5/21/08 3:09p shyam |
|---|
| 119 | * PR 42103 : Make Input handle a Nexus DBG object |
|---|
| 120 | * PR 42103 : Fix the missing PbBand initialization |
|---|
| 121 | * |
|---|
| 122 | * 1 5/20/08 7:46p shyam |
|---|
| 123 | * PR 42103 : Add transport MPOD support |
|---|
| 124 | * |
|---|
| 125 | *****************************************************************************/ |
|---|
| 126 | |
|---|
| 127 | #include "nexus_transport_module.h" |
|---|
| 128 | #include "nexus_mpod.h" |
|---|
| 129 | |
|---|
| 130 | BDBG_MODULE(nexus_mpod); |
|---|
| 131 | |
|---|
| 132 | #if BXPT_HAS_MPOD_SCARD_SUPPORT |
|---|
| 133 | |
|---|
| 134 | #include "bxpt_mpod.h" |
|---|
| 135 | #include "nexus_playpump_impl.h" |
|---|
| 136 | |
|---|
| 137 | BDBG_OBJECT_ID(NEXUS_Mpod); |
|---|
| 138 | BDBG_OBJECT_ID(NEXUS_MpodInput); |
|---|
| 139 | |
|---|
| 140 | /** |
|---|
| 141 | TODO: suggestions on rework: |
|---|
| 142 | - require a NEXUS_MpodInput_Open, even more spod. this would allow us to remove the parserBand/playpump from OpenSettings. |
|---|
| 143 | - remove NEXUS_MpodBandType and unions. just do: if playpump == NULL, use parserBand. |
|---|
| 144 | **/ |
|---|
| 145 | |
|---|
| 146 | struct NEXUS_Mpod |
|---|
| 147 | { |
|---|
| 148 | BDBG_OBJECT(NEXUS_Mpod) |
|---|
| 149 | NEXUS_MpodOpenSettings openSettings; |
|---|
| 150 | } ; |
|---|
| 151 | |
|---|
| 152 | struct NEXUS_MpodInput |
|---|
| 153 | { |
|---|
| 154 | BDBG_OBJECT(NEXUS_MpodInput) |
|---|
| 155 | BXPT_ParserType type; |
|---|
| 156 | unsigned number ; |
|---|
| 157 | NEXUS_MpodInputSettings inputSettings; |
|---|
| 158 | } ; |
|---|
| 159 | |
|---|
| 160 | |
|---|
| 161 | /* Summary : Gets Open Settings */ |
|---|
| 162 | void NEXUS_Mpod_GetDefaultOpenSettings(NEXUS_MpodOpenSettings* pOpenSettings) |
|---|
| 163 | { |
|---|
| 164 | BDBG_ASSERT(pOpenSettings); |
|---|
| 165 | BKNI_Memset(pOpenSettings, 0, sizeof(NEXUS_MpodOpenSettings)); |
|---|
| 166 | } |
|---|
| 167 | |
|---|
| 168 | /* Summary : Opens/inits the device */ |
|---|
| 169 | NEXUS_MpodHandle NEXUS_Mpod_Open( |
|---|
| 170 | unsigned int index, |
|---|
| 171 | const NEXUS_MpodOpenSettings *pOpenSettings |
|---|
| 172 | ) |
|---|
| 173 | { |
|---|
| 174 | BERR_Code rc; |
|---|
| 175 | NEXUS_MpodOpenSettings openSettings; |
|---|
| 176 | NEXUS_MpodHandle mpod; |
|---|
| 177 | BXPT_Mpod_Config config; |
|---|
| 178 | NEXUS_ParserBandHandle parserBand = NULL; |
|---|
| 179 | |
|---|
| 180 | BSTD_UNUSED(index); |
|---|
| 181 | if (!pOpenSettings) { |
|---|
| 182 | NEXUS_Mpod_GetDefaultOpenSettings(&openSettings); |
|---|
| 183 | pOpenSettings = &openSettings; |
|---|
| 184 | } |
|---|
| 185 | |
|---|
| 186 | mpod = (NEXUS_MpodHandle)BKNI_Malloc(sizeof(*mpod)); |
|---|
| 187 | if (!mpod) { |
|---|
| 188 | rc=BERR_TRACE(NEXUS_OUT_OF_SYSTEM_MEMORY); |
|---|
| 189 | return NULL; |
|---|
| 190 | } |
|---|
| 191 | BKNI_Memset(mpod, 0, sizeof(*mpod)); |
|---|
| 192 | BDBG_OBJECT_SET(mpod, NEXUS_Mpod); |
|---|
| 193 | mpod->openSettings = *pOpenSettings; |
|---|
| 194 | BXPT_Mpod_GetDefaultConfig( pTransport->xpt, &config ); |
|---|
| 195 | #if BXPT_HAS_MPOD_SCARD_SUPPORT |
|---|
| 196 | parserBand = NEXUS_ParserBand_Resolve_priv(pOpenSettings->band.parserBand); |
|---|
| 197 | config.SmodeEn = (pOpenSettings->mpodMode==NEXUS_MpodMode_eSpod) ; |
|---|
| 198 | config.BandEn = pOpenSettings->enableBandAssociation; |
|---|
| 199 | config.PbBand = (pOpenSettings->bandType == NEXUS_MpodBandType_ePlaypump) ; |
|---|
| 200 | config.BandNo = (pOpenSettings->bandType == NEXUS_MpodBandType_eParserBand) ? |
|---|
| 201 | (parserBand ? parserBand->hwIndex : (unsigned char)-1) : |
|---|
| 202 | pOpenSettings->band.playpump->index ; |
|---|
| 203 | #endif |
|---|
| 204 | config.ByteSync = pOpenSettings->byteSync; |
|---|
| 205 | if (pOpenSettings->clockDelay) { |
|---|
| 206 | config.NshiftClk = 1; |
|---|
| 207 | config.ClkDelay = pOpenSettings->clockDelay; |
|---|
| 208 | } |
|---|
| 209 | else { |
|---|
| 210 | config.NshiftClk = 0; |
|---|
| 211 | config.ClkDelay = 0; |
|---|
| 212 | } |
|---|
| 213 | config.InvertClk = pOpenSettings->invertClock; |
|---|
| 214 | config.ClkNrun = pOpenSettings->clockNotRunning; |
|---|
| 215 | #if NEXUS_DTV_PLATFORM == 1 |
|---|
| 216 | config.Pod2ChipMClkMuxSelect = pOpenSettings->pod2ChipMClkMuxSelect; |
|---|
| 217 | #endif |
|---|
| 218 | config.OutputInvertSync = pOpenSettings->outputInvertSync; |
|---|
| 219 | rc = BXPT_Mpod_Init( pTransport->xpt, &config ); |
|---|
| 220 | if(rc != BERR_SUCCESS) |
|---|
| 221 | { |
|---|
| 222 | rc=BERR_TRACE(rc); |
|---|
| 223 | goto error; |
|---|
| 224 | } |
|---|
| 225 | |
|---|
| 226 | /* Successful return */ |
|---|
| 227 | return mpod; |
|---|
| 228 | |
|---|
| 229 | error: |
|---|
| 230 | if (mpod) BKNI_Free(mpod); |
|---|
| 231 | return NULL; |
|---|
| 232 | } |
|---|
| 233 | |
|---|
| 234 | void NEXUS_Mpod_Close(NEXUS_MpodHandle mpod) |
|---|
| 235 | { |
|---|
| 236 | BDBG_OBJECT_ASSERT(mpod, NEXUS_Mpod); |
|---|
| 237 | |
|---|
| 238 | BXPT_Mpod_Shutdown(pTransport->xpt); |
|---|
| 239 | BDBG_OBJECT_DESTROY(mpod, NEXUS_Mpod); |
|---|
| 240 | BKNI_Free(mpod); |
|---|
| 241 | } |
|---|
| 242 | |
|---|
| 243 | /** |
|---|
| 244 | Summary: |
|---|
| 245 | Opens an input channel to Mpod |
|---|
| 246 | **/ |
|---|
| 247 | NEXUS_MpodInputHandle NEXUS_MpodInput_Open( |
|---|
| 248 | NEXUS_MpodHandle mpod, |
|---|
| 249 | const NEXUS_MpodInputSettings *pInputSettings |
|---|
| 250 | ) |
|---|
| 251 | { |
|---|
| 252 | BERR_Code brc ; |
|---|
| 253 | NEXUS_MpodInputHandle mpodInput ; |
|---|
| 254 | NEXUS_ParserBandHandle parserBand; |
|---|
| 255 | |
|---|
| 256 | BDBG_OBJECT_ASSERT(mpod, NEXUS_Mpod); |
|---|
| 257 | |
|---|
| 258 | #if !NEXUS_NUM_PARSER_BANDS |
|---|
| 259 | if (pInputSettings->bandType != NEXUS_MpodBandType_ePlaypump) { |
|---|
| 260 | BERR_TRACE(NEXUS_NOT_SUPPORTED); |
|---|
| 261 | return NULL; |
|---|
| 262 | } |
|---|
| 263 | #endif |
|---|
| 264 | |
|---|
| 265 | mpodInput = (NEXUS_MpodInputHandle)BKNI_Malloc(sizeof(*mpodInput)); |
|---|
| 266 | if(NULL == mpodInput) |
|---|
| 267 | { |
|---|
| 268 | brc=BERR_TRACE(NEXUS_OUT_OF_SYSTEM_MEMORY) ; |
|---|
| 269 | return NULL ; |
|---|
| 270 | } |
|---|
| 271 | BKNI_Memset(mpodInput, 0, sizeof(*mpodInput) ) ; |
|---|
| 272 | BDBG_OBJECT_SET(mpodInput, NEXUS_MpodInput); |
|---|
| 273 | |
|---|
| 274 | mpodInput->inputSettings = *pInputSettings ; |
|---|
| 275 | |
|---|
| 276 | parserBand = NEXUS_ParserBand_Resolve_priv(pInputSettings->band.parserBand); |
|---|
| 277 | |
|---|
| 278 | if(pInputSettings->bandType == NEXUS_MpodBandType_ePlaypump) |
|---|
| 279 | { |
|---|
| 280 | mpodInput->type = BXPT_ParserType_ePb; |
|---|
| 281 | mpodInput->number = pInputSettings->band.playpump->index; |
|---|
| 282 | } |
|---|
| 283 | else |
|---|
| 284 | { |
|---|
| 285 | if (!parserBand) |
|---|
| 286 | { |
|---|
| 287 | brc=BERR_TRACE(NEXUS_INVALID_PARAMETER) ; |
|---|
| 288 | return NULL ; |
|---|
| 289 | } |
|---|
| 290 | mpodInput->type = BXPT_ParserType_eIb; |
|---|
| 291 | mpodInput->number = parserBand->hwIndex; |
|---|
| 292 | } |
|---|
| 293 | |
|---|
| 294 | if(BXPT_ParserType_eIb == mpodInput->type) |
|---|
| 295 | { |
|---|
| 296 | brc = BXPT_SetParserEnable(pTransport->xpt,mpodInput->number, true); |
|---|
| 297 | if (brc != BERR_SUCCESS) |
|---|
| 298 | { |
|---|
| 299 | brc=BERR_TRACE(brc); |
|---|
| 300 | goto error_openinput; |
|---|
| 301 | } |
|---|
| 302 | } |
|---|
| 303 | |
|---|
| 304 | if(pInputSettings->mpodPreFilter) |
|---|
| 305 | { |
|---|
| 306 | brc = BXPT_Mpod_RouteToMpodPidFiltered( |
|---|
| 307 | pTransport->xpt, |
|---|
| 308 | mpodInput->type, |
|---|
| 309 | mpodInput->number, |
|---|
| 310 | true, /* bool MpodPidFilter */ |
|---|
| 311 | false, /* bool ContinuityCountCheck */ |
|---|
| 312 | true /* bool Enable */ |
|---|
| 313 | ); |
|---|
| 314 | } |
|---|
| 315 | else |
|---|
| 316 | { |
|---|
| 317 | brc = BXPT_Mpod_RouteToMpod( |
|---|
| 318 | pTransport->xpt, |
|---|
| 319 | mpodInput->type, |
|---|
| 320 | mpodInput->number, |
|---|
| 321 | true); |
|---|
| 322 | } |
|---|
| 323 | |
|---|
| 324 | if(brc != BERR_SUCCESS) |
|---|
| 325 | { |
|---|
| 326 | brc=BERR_TRACE(brc); |
|---|
| 327 | goto error_openinput; |
|---|
| 328 | } |
|---|
| 329 | |
|---|
| 330 | if(pInputSettings->bandType == NEXUS_MpodBandType_ePlaypump) |
|---|
| 331 | { |
|---|
| 332 | pTransport->playpump[mpodInput->number].playpump->settings.allPass = pInputSettings->mpodPreFilter ? false : true; |
|---|
| 333 | } |
|---|
| 334 | else |
|---|
| 335 | { |
|---|
| 336 | #if NEXUS_NUM_PARSER_BANDS |
|---|
| 337 | parserBand->settings.allPass = pInputSettings->mpodPreFilter ? false : true; |
|---|
| 338 | parserBand->settings.cableCard = NEXUS_CableCardType_eMCard; |
|---|
| 339 | #endif |
|---|
| 340 | } |
|---|
| 341 | return mpodInput ; |
|---|
| 342 | |
|---|
| 343 | error_openinput : |
|---|
| 344 | BKNI_Free(mpodInput); |
|---|
| 345 | return NULL ; |
|---|
| 346 | } |
|---|
| 347 | |
|---|
| 348 | void NEXUS_MpodInput_Close( NEXUS_MpodInputHandle mpodInput ) |
|---|
| 349 | { |
|---|
| 350 | BERR_Code brc ; |
|---|
| 351 | |
|---|
| 352 | BDBG_OBJECT_ASSERT(mpodInput, NEXUS_MpodInput); |
|---|
| 353 | |
|---|
| 354 | if(mpodInput->inputSettings.mpodPreFilter) |
|---|
| 355 | { |
|---|
| 356 | brc = BXPT_Mpod_RouteToMpodPidFiltered( |
|---|
| 357 | pTransport->xpt, |
|---|
| 358 | mpodInput->type, |
|---|
| 359 | mpodInput->number, |
|---|
| 360 | false, /* bool MpodPidFilter */ |
|---|
| 361 | true, /* bool ContinuityCountCheck */ |
|---|
| 362 | false /* bool Enable */ |
|---|
| 363 | ); |
|---|
| 364 | } |
|---|
| 365 | else |
|---|
| 366 | { |
|---|
| 367 | brc = BXPT_Mpod_RouteToMpod( |
|---|
| 368 | pTransport->xpt, |
|---|
| 369 | mpodInput->type, |
|---|
| 370 | mpodInput->number, |
|---|
| 371 | false); |
|---|
| 372 | } |
|---|
| 373 | |
|---|
| 374 | if(brc != BERR_SUCCESS) |
|---|
| 375 | { |
|---|
| 376 | brc=BERR_TRACE(brc); |
|---|
| 377 | } |
|---|
| 378 | |
|---|
| 379 | if(mpodInput->type == BXPT_ParserType_ePb) |
|---|
| 380 | { |
|---|
| 381 | pTransport->playpump[mpodInput->number].playpump->settings.allPass = false; |
|---|
| 382 | } |
|---|
| 383 | else |
|---|
| 384 | { |
|---|
| 385 | #if NEXUS_NUM_PARSER_BANDS |
|---|
| 386 | pTransport->parserBand[mpodInput->number].settings.allPass = false; |
|---|
| 387 | pTransport->parserBand[mpodInput->number].settings.cableCard = NEXUS_CableCardType_eNone; |
|---|
| 388 | #endif |
|---|
| 389 | } |
|---|
| 390 | |
|---|
| 391 | BDBG_OBJECT_DESTROY(mpodInput, NEXUS_MpodInput); |
|---|
| 392 | BKNI_Free(mpodInput); |
|---|
| 393 | } |
|---|
| 394 | |
|---|
| 395 | void NEXUS_MpodInput_GetDefaultSettings( |
|---|
| 396 | NEXUS_MpodInputSettings *pMpodDefInputSettings /* [out] */ |
|---|
| 397 | ) |
|---|
| 398 | { |
|---|
| 399 | BDBG_ASSERT(pMpodDefInputSettings); |
|---|
| 400 | BKNI_Memset(pMpodDefInputSettings, 0 , sizeof(*pMpodDefInputSettings)); |
|---|
| 401 | } |
|---|
| 402 | |
|---|
| 403 | void NEXUS_MpodInput_GetSettings( |
|---|
| 404 | NEXUS_MpodInputHandle mpodInput, |
|---|
| 405 | NEXUS_MpodInputSettings *pMpodInputSettings /* [out] */ |
|---|
| 406 | ) |
|---|
| 407 | { |
|---|
| 408 | BDBG_OBJECT_ASSERT(mpodInput, NEXUS_MpodInput); |
|---|
| 409 | *pMpodInputSettings = mpodInput->inputSettings ; |
|---|
| 410 | } |
|---|
| 411 | |
|---|
| 412 | NEXUS_Error NEXUS_MpodInput_SetSettings( |
|---|
| 413 | NEXUS_MpodInputHandle mpodInput, |
|---|
| 414 | const NEXUS_MpodInputSettings *pMpodInputSettings |
|---|
| 415 | ) |
|---|
| 416 | { |
|---|
| 417 | NEXUS_Error rc = NEXUS_SUCCESS ; |
|---|
| 418 | BERR_Code brc ; |
|---|
| 419 | |
|---|
| 420 | BDBG_OBJECT_ASSERT(mpodInput, NEXUS_MpodInput); |
|---|
| 421 | BDBG_ASSERT(pMpodInputSettings); |
|---|
| 422 | |
|---|
| 423 | /* All Pass */ |
|---|
| 424 | if(mpodInput->inputSettings.allPass != pMpodInputSettings->allPass) |
|---|
| 425 | { |
|---|
| 426 | if(pMpodInputSettings->allPass) |
|---|
| 427 | { |
|---|
| 428 | rc = BXPT_ParserAllPassMode( |
|---|
| 429 | pTransport->xpt, |
|---|
| 430 | mpodInput->number, |
|---|
| 431 | pMpodInputSettings->allPass); |
|---|
| 432 | if (rc != BERR_SUCCESS) |
|---|
| 433 | return BERR_TRACE(rc); |
|---|
| 434 | } |
|---|
| 435 | brc = BXPT_Mpod_AllPass( |
|---|
| 436 | pTransport->xpt, |
|---|
| 437 | mpodInput->type, |
|---|
| 438 | mpodInput->number, |
|---|
| 439 | pMpodInputSettings->allPass); |
|---|
| 440 | if(brc != BERR_SUCCESS) |
|---|
| 441 | rc = BERR_TRACE(brc); |
|---|
| 442 | } |
|---|
| 443 | |
|---|
| 444 | mpodInput->inputSettings = *pMpodInputSettings ; |
|---|
| 445 | |
|---|
| 446 | return rc ; |
|---|
| 447 | } |
|---|
| 448 | |
|---|
| 449 | #else |
|---|
| 450 | |
|---|
| 451 | void NEXUS_Mpod_GetDefaultOpenSettings(NEXUS_MpodOpenSettings* pOpenSettings) |
|---|
| 452 | { |
|---|
| 453 | BSTD_UNUSED(pOpenSettings); |
|---|
| 454 | BDBG_WRN(("Mpod not enabled on this chipset")); |
|---|
| 455 | BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 456 | return; |
|---|
| 457 | } |
|---|
| 458 | |
|---|
| 459 | NEXUS_MpodHandle NEXUS_Mpod_Open(unsigned int index, const NEXUS_MpodOpenSettings *pOpenSettings) |
|---|
| 460 | { |
|---|
| 461 | BSTD_UNUSED(index); |
|---|
| 462 | BSTD_UNUSED(pOpenSettings); |
|---|
| 463 | BDBG_WRN(("Mpod not enabled on this chipset")); |
|---|
| 464 | BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 465 | return NULL; |
|---|
| 466 | } |
|---|
| 467 | |
|---|
| 468 | void NEXUS_Mpod_Close(NEXUS_MpodHandle mpod) |
|---|
| 469 | { |
|---|
| 470 | BSTD_UNUSED(mpod); |
|---|
| 471 | BDBG_WRN(("Mpod not enabled on this chipset")); |
|---|
| 472 | BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 473 | return; |
|---|
| 474 | } |
|---|
| 475 | |
|---|
| 476 | NEXUS_MpodInputHandle NEXUS_MpodInput_Open(NEXUS_MpodHandle mpod, const NEXUS_MpodInputSettings *pInputSettings) |
|---|
| 477 | { |
|---|
| 478 | BSTD_UNUSED(mpod); |
|---|
| 479 | BSTD_UNUSED(pInputSettings); |
|---|
| 480 | BDBG_WRN(("Mpod not enabled on this chipset")); |
|---|
| 481 | BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 482 | return NULL; |
|---|
| 483 | } |
|---|
| 484 | |
|---|
| 485 | void NEXUS_MpodInput_Close( NEXUS_MpodInputHandle mpodInput ) |
|---|
| 486 | { |
|---|
| 487 | BSTD_UNUSED(mpodInput); |
|---|
| 488 | BDBG_WRN(("Mpod not enabled on this chipset")); |
|---|
| 489 | BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 490 | return; |
|---|
| 491 | } |
|---|
| 492 | |
|---|
| 493 | void NEXUS_MpodInput_GetDefaultSettings(NEXUS_MpodInputSettings *pMpodDefInputSettings) |
|---|
| 494 | { |
|---|
| 495 | BSTD_UNUSED(pMpodDefInputSettings); |
|---|
| 496 | BDBG_WRN(("Mpod not enabled on this chipset")); |
|---|
| 497 | BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 498 | return; |
|---|
| 499 | } |
|---|
| 500 | |
|---|
| 501 | void NEXUS_MpodInput_GetSettings(NEXUS_MpodInputHandle mpodInput, NEXUS_MpodInputSettings *pMpodInputSettings) |
|---|
| 502 | { |
|---|
| 503 | BSTD_UNUSED(mpodInput); |
|---|
| 504 | BSTD_UNUSED(pMpodInputSettings); |
|---|
| 505 | BDBG_WRN(("Mpod not enabled on this chipset")); |
|---|
| 506 | BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 507 | return; |
|---|
| 508 | } |
|---|
| 509 | |
|---|
| 510 | NEXUS_Error NEXUS_MpodInput_SetSettings(NEXUS_MpodInputHandle mpodInput, const NEXUS_MpodInputSettings *pMpodInputSettings) |
|---|
| 511 | { |
|---|
| 512 | BSTD_UNUSED(mpodInput); |
|---|
| 513 | BSTD_UNUSED(pMpodInputSettings); |
|---|
| 514 | BDBG_WRN(("Mpod not enabled on this chipset")); |
|---|
| 515 | BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 516 | return 0; |
|---|
| 517 | } |
|---|
| 518 | |
|---|
| 519 | #endif |
|---|