/*
 * Copyright (c) 2003 Linuxant inc.
 * Copyright (c) 2001-2003 Conexant Systems, Inc.
 * 
 * 1.   Permitted use. Redistribution and use in source and binary forms,
 * without modification, are permitted under the terms set forth herein.
 * 
 * 2.   Disclaimer of Warranties. LINUXANT, ITS SUPPLIERS, AND OTHER CONTRIBUTORS
 * MAKE NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE.
 * IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTIES OF ANY KIND.
 * LINUXANT AND OTHER CONTRIBUTORS DISCLAIMS ALL WARRANTIES WITH REGARD
 * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE, GOOD TITLE AND AGAINST INFRINGEMENT.
 * 
 * This software has not been formally tested, and there is no guarantee that
 * it is free of errors including, but not limited to, bugs, defects,
 * interrupted operation, or unexpected results. Any use of this software is
 * at user's own risk.
 * 
 * 3.   No Liability.
 * 
 * (a) Linuxant, its suppliers, or contributors shall not be responsible for
 * any loss or damage to users, customers, or any third parties for any reason
 * whatsoever, and LINUXANT, ITS SUPPLIERS OR CONTRIBUTORS SHALL NOT BE LIABLE
 * FOR ANY ACTUAL, DIRECT, INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL, OR
 * CONSEQUENTIAL (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED, WHETHER IN CONTRACT, STRICT OR OTHER LEGAL THEORY OF
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
 * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
 * OF SUCH DAMAGE.
 * 
 * (b) User agrees to hold Linuxant, its suppliers, and contributors harmless
 * from any liability, loss, cost, damage or expense, including attorney's fees,
 * as a result of any claims which may be made by any person, including
 * but not limited to User, its agents and employees, its customers, or
 * any third parties that arise out of or result from the manufacture,
 * delivery, actual or alleged ownership, performance, use, operation
 * or possession of the software furnished hereunder, whether such claims
 * are based on negligence, breach of contract, absolute liability or any
 * other legal theory.
 * 
 * 4.   Notices. User hereby agrees not to remove, alter or destroy any
 * copyright, trademark, credits, other proprietary notices or confidential
 * legends placed upon, contained within or associated with the Software,
 * and shall include all such unaltered copyright, trademark, credits,
 * other proprietary notices or confidential legends on or in every copy of
 * the Software.
 * 
 * 5.   Reverse-engineering. User hereby agrees not to reverse engineer,
 * decompile, or disassemble the portions of this software provided solely
 * in object form, nor attempt in any manner to obtain their source-code.
 * 
 * 6.   Redistribution. Redistribution of this software is permitted only
 * for non-beta, officially released versions. Redistribution of versions
 * marked "beta" or "lnxtbeta" requires explicit written approval from
 * Linuxant.
 * 
 */

/*----------------------------------------------------------------------------
 *
 * File: DpalOem.h
 *
 *----------------------------------------------------------------------------
 */
 
#ifndef __DPALOEM_H__
#define __DPALOEM_H__



 
 
//
// Struct to hold Caesar params
// 

#if (USE_PRAGMA_PACK == 1)
#pragma pack(push,1)   // Packing compatible with WinAC
#endif

#define DEFAULT_DC_LOOP_POINTS	5
#define DEFAULT_DC_LOOP_ENTRIES	5
#define IMPEDANCE_VALUES_NUM	4
#define NUM_OF_RESISTANCES		5	

typedef struct PACKED_ATTRIB CAESAR_PARAMS_TAG
{
	DWORD	R6;
	DWORD	R26;
	DWORD	R28;
	DWORD	R30_C1;	// for Caesar1 (20434)
	DWORD	R30_C2;	// for Caesar2 (20463)
	DWORD	R38;

	DWORD	PQac;
	DWORD	PQdc;

	BYTE	ImpedanceValues[IMPEDANCE_VALUES_NUM];

	BYTE	DCLoopVoltagePoint[DEFAULT_DC_LOOP_ENTRIES][DEFAULT_DC_LOOP_POINTS];
	BYTE	DCLoopCurrenPoint[DEFAULT_DC_LOOP_ENTRIES][DEFAULT_DC_LOOP_POINTS];
	BYTE	DCDACInitPoint[DEFAULT_DC_LOOP_ENTRIES];  //LKS28may99: 5 init point for 5 DCloops (1 value each)

	DWORD	Flags;
	WORD	RingThresh;
	WORD	CIDThresh;
} CAESAR_PARAMS, *PCAESAR_PARAMS;

typedef struct PACKED_ATTRIB HW_DATA_TAG
{
	WORD	VoiceCodecPresent	:   1; //0
	WORD	ModemMicGain		:   3; //1-3
	WORD	ModemMicAttenuation	:   1; //4
	WORD	DACInputSource		:   3; //5-7
	WORD	ModemSpkDriver		:   1; //8
	WORD	OSCOff				:   1; //9
	WORD	Riptide				:   1; //10
	WORD	WakeUpAfterClose	:   1; //11
	WORD	EnableInterrupts	:   1; //12
	WORD	CharlemagneHandset	:   1; //13
	WORD	PDC_ADPInput		:   1; //14
	WORD	PME_with_FET		:   1; //15
	WORD	DC_Adjust			:   1; //16
	WORD	MuteByAnalogSpeaker	:   1; //17
	WORD	NT4OpenPortPatch	:   1; //18
	WORD	ExternalFilter		:   1; //19	use Churchill External filter for ring detect
	WORD	Churchill			:   1; //20 True only for Churchill
	WORD	UpdateConfigSpace	:   1; //21
	WORD	ExternalIA      	:   1; //22
	WORD	EnableAudioGPI  	:   1; //23
	WORD	MoonWOR				:   1; //24
	WORD	SonyVioThrottle		:   1; //25
	WORD	MoonDmaWatchdog		:   1; //26
	WORD	DisableSpeedStep	:   1; //27
	WORD	HadsetExlusive		:   1; //28
	WORD    DisableWaveGenerator:   1; //29
	WORD	DspAtIrql			:	2; /*30-31  0-Always run Dsp at Dpc; 
                                                1-Run Dsp at Irql during retrain;
                                                2-Run Dsp at Irql during retrain and when significant
                                                  Dpc latency is detected;
                                                3-Always run Dsp at Irql
                                     */
    WORD    BanisterWorkaroundDisable:   1; //32
    WORD    VIA8233                  :   1; //33
    WORD    Yukon                    :   1; //34      
    WORD    SpkpDir					 :   2; //35-36
    WORD    Reserved1                :  11; //37-47
    WORD    Reserved2                :  16; //48-63
} HW_DATA, *PHW_DATA;
 
// added for dlg support
typedef struct PACKED_ATTRIB DLG_PARAMS_Tag {
	BYTE Enabled;
	BYTE Polarity;
	BYTE PinIndex;
	WORD Debounce;
} DLG_PARAMS, *PDLG_PARAMS; 
 
typedef struct PACKED_ATTRIB HandSet_PARAMS_Tag
{
	BYTE Enabled;
	BYTE Polarity;
	BYTE GpioNumber;
	WORD Lcs_Debounce_Time;
} HandSet_PARAMS, *PHandSet_PARAMS; 
//
// struct to hold board related papameters
//
typedef struct PACKED_ATTRIB BOARD_PARAMS_TAG
{
	BOOL			f3VoltsIA;			// TRUE when it's 3.3 volt (should add 4 dB)
	BOOL			fSpkMuteHWPresent;	// speaker can be muted
	BOOL			fSpkMuteHWPolarity;	// spekar mute polarity. 
										// when true - we should set a GPIO to mute
	DWORD			OEMSpkrMuteDelay;	// in ms

	WORD			wDAAType;			// what DAA is it ? ( soft,smart...)
	CAESAR_PARAMS	CaesarParams;		// Specific parameters for Caesar
	CAESAR_PARAMS	CaesarParamsK3;		// Specific parameters for Caesar on Kublai3 (Endurance)

	BOOL			fPmeWithInt;		// Generate PME with/without interrupt.
	BYTE			VoiceCodecMicGain;
	BOOL			fClearPME;			// Always clear PME status bit.
	
	HW_DATA			HwData;

	DLG_PARAMS		DlgParams;			// Parameters for activation of digital line detection
	HandSet_PARAMS	HandSetParams;
 
#ifdef WINTEST
	DWORD			DeviceId;		// for ModemHelper uses.
	DWORD			VendorId;
	DWORD			HwType;
#endif

} BOARD_PARAMS, *PBOARD_PARAMS;


typedef struct PACKED_ATTRIB CAESAR_CONTROL_PARAMS_TAG
{
	WORD	OH		:	1;
	WORD	TXM		:	1;
	WORD	EICO	:	1;
	WORD	RD_CID	:	1;
	WORD	HS		:	1;
	WORD	GPIO	:	3;
	WORD	RMake	:	2;
	WORD	DCLoop	:	3;
	WORD	IMP		:	2;
	WORD	EXT		:	1;
} CAESAR_CONTROL_PARAMS, *PCAESAR_CONTROL_PARAMS;

#define SIMPLE_DAA		0
#define CAESAR			1
#define SOFT_DAA		2

#if (USE_PRAGMA_PACK == 1)
#pragma pack(pop)   // Packing compatible with our VXDs
#endif
 
#endif /* __DPALOEM_H__ */

