[asterisk-scf-commits] team/sruffell/dahdi-linux.git branch "octapi3" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Feb 8 10:50:07 CST 2011


branch "octapi3" has been created
        at  e06560e005dc670a35a17ac19892971d39e23a2e (commit)

- Log -----------------------------------------------------------------
commit e06560e005dc670a35a17ac19892971d39e23a2e
Author: Shaun Ruffell <sruffell at digium.com>
Date:   Tue Feb 8 10:30:26 2011 -0600

    wct4xxp: Do not lock interrupts while loading the VPM firmware.
    
    Since the oct6100 API consumes less stack there is no longer a danger of
    overflowing our stack during load.
    
    Signed-off-by: Shaun Ruffell <sruffell at digium.com>

diff --git a/drivers/dahdi/wct4xxp/vpm450m.c b/drivers/dahdi/wct4xxp/vpm450m.c
index a6931fb..b72343b 100644
--- a/drivers/dahdi/wct4xxp/vpm450m.c
+++ b/drivers/dahdi/wct4xxp/vpm450m.c
@@ -425,9 +425,6 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
 	UINT32 ulResult;
 	struct vpm450m *vpm450m;
 	int x,y,law;
-#ifdef CONFIG_4KSTACKS
-	unsigned long flags;
-#endif
 	
 	if (!(vpm450m = kmalloc(sizeof(struct vpm450m), GFP_KERNEL)))
 		return NULL;
@@ -502,20 +499,9 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
 		return NULL;
 	}
 
-	/* I don't know what to curse more in this comment, the problems caused by
-	 * the 4K kernel stack limit change or the octasic API for being so darn
-	 * stack unfriendly.  Stupid, stupid, stupid.  So we disable IRQs so we
-	 * don't run the risk of overflowing the stack while we initialize the
-	 * octasic. */
-#ifdef CONFIG_4KSTACKS
-	local_irq_save(flags);
-#endif
 	ulResult = Oct6100ChipOpen(vpm450m->pApiInstance, ChipOpen);
 	if (ulResult != cOCT6100_ERR_OK) {
 		printk(KERN_NOTICE "Failed to open chip, code %08x!\n", ulResult);
-#ifdef CONFIG_4KSTACKS
-		local_irq_restore(flags);
-#endif
 		vfree(vpm450m->pApiInstance);
 		kfree(vpm450m);
 		kfree(ChipOpen);
@@ -572,9 +558,6 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
 		}
 	}
 
-#ifdef CONFIG_4KSTACKS
-	local_irq_restore(flags);
-#endif
 	kfree(ChipOpen);
 	kfree(ChannelOpen);
 	return vpm450m;

commit 2dd7a926ebe734bb9fa55089e51293fa0425b854
Author: Shaun Ruffell <sruffell at digium.com>
Date:   Mon Feb 7 18:06:12 2011 -0600

    wct4xxp: Reduce stack usage in oct612x API.
    
    Reduce the stack usage by replacing the mOCT6100_RETRIEVE_NLP_CONF_DWORD
    and mOCT6100_SAVE_NLP_CONF_DWORD macros with functions. Some compilers
    do a better job of optimizing the local variables declared in those
    macros than others.
    
    For example, with gcc 4.3.0, running
    
    ]# make stackcheck | grep Oct6100 | head -n 20 | sed -e 's/^0\S* //g' | uniq
    
    Before:
    Oct6100ApiWriteVqeNlpMemory [wct4xxp]:  1112
    Oct6100ApiInvalidateChanPlayoutStructs [wct4xxp]:520
    Oct6100ApiSetChannelLevelControl [wct4xxp]:     392
    Oct6100ApiBridgeEventRemove [wct4xxp]:  344
    Oct6100ApiDebugChannelOpen [wct4xxp]:   312
    Oct6100ApiWriteVqeAfMemory [wct4xxp]:   296
    Oct6100ApiSetChannelTailConfiguration [wct4xxp]:264
    Oct6100ApiRandomMemoryWrite [wct4xxp]:  248
    Oct6100ApiTransferToneEvents [wct4xxp]: 248
    Oct6100ApiModifyChannelStructs [wct4xxp]:       232
    
    After:
    Oct6100ApiBridgeEventRemove [wct4xxp]:  344
    Oct6100ApiDebugChannelOpen [wct4xxp]:   312
    Oct6100ApiRandomMemoryWrite [wct4xxp]:  248
    Oct6100ApiTransferToneEvents [wct4xxp]: 248
    Oct6100ApiInvalidateChanPlayoutStructs [wct4xxp]:248
    Oct6100ApiModifyChannelStructs [wct4xxp]:       232
    Oct6100ApiBridgeRemoveParticipantFromChannel [wct4xxp]:216
    Oct6100ApiWriteVqeNlpMemory [wct4xxp]:  200
    Oct6100ApiInitChannels [wct4xxp]:               168
    Oct6100ApiProgramNLP [wct4xxp]:         168
    
    Signed-off-by: Shaun Ruffell <sruffell at digium.com>

diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
index bcbd18c..c9837ea 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
@@ -8777,6 +8777,73 @@ UINT32 Oct6100ApiWriteVqeMemory(
 }
 #endif
 
+UINT32 oct6100_retrieve_nlp_conf_dword(tPOCT6100_INSTANCE_API f_pApiInst,
+								tPOCT6100_API_CHANNEL f_pChanEntry,
+								UINT32 f_ulAddress,
+								UINT32 *f_pulConfigDword)
+{
+	tOCT6100_READ_PARAMS	_ReadParams;
+	UINT16					_usReadData;
+	UINT32 ulResult = cOCT6100_ERR_FATAL_8E;
+	(*f_pulConfigDword) = cOCT6100_INVALID_VALUE;
+
+	_ReadParams.pProcessContext = f_pApiInst->pProcessContext;
+	mOCT6100_ASSIGN_USER_READ_WRITE_OBJ( f_pApiInst, _ReadParams );
+	_ReadParams.ulUserChipId = f_pApiInst->pSharedInfo->ChipConfig.ulUserChipId;
+	_ReadParams.pusReadData = &_usReadData;
+
+	/* Read the first 16 bits.*/
+	_ReadParams.ulReadAddress = f_ulAddress;
+	mOCT6100_DRIVER_READ_API( _ReadParams, ulResult );
+	if ( ulResult == cOCT6100_ERR_OK )
+	{
+		/* Save data.*/
+		(*f_pulConfigDword) = _usReadData << 16;
+
+		/* Read the last 16 bits .*/
+		_ReadParams.ulReadAddress += 2;
+		mOCT6100_DRIVER_READ_API( _ReadParams, ulResult );
+		if ( ulResult == cOCT6100_ERR_OK )
+		{
+			/* Save data.*/
+			(*f_pulConfigDword) |= _usReadData;
+			ulResult = cOCT6100_ERR_OK;
+		}
+	}
+	return ulResult;
+}
+
+UINT32 oct6100_save_nlp_conf_dword(tPOCT6100_INSTANCE_API f_pApiInst,
+								tPOCT6100_API_CHANNEL f_pChanEntry,
+								UINT32 f_ulAddress,
+								UINT32 f_ulConfigDword)
+{
+	UINT32 ulResult;
+
+	/* Write the config DWORD. */
+	tOCT6100_WRITE_PARAMS	_WriteParams;
+
+	_WriteParams.pProcessContext = f_pApiInst->pProcessContext;
+	mOCT6100_ASSIGN_USER_READ_WRITE_OBJ( f_pApiInst, _WriteParams )
+	_WriteParams.ulUserChipId = f_pApiInst->pSharedInfo->ChipConfig.ulUserChipId;
+
+	/* Write the first 16 bits. */
+	_WriteParams.ulWriteAddress = f_ulAddress;
+	_WriteParams.usWriteData = (UINT16)((f_ulConfigDword >> 16) & 0xFFFF);
+	mOCT6100_DRIVER_WRITE_API( _WriteParams, ulResult );
+
+	if ( ulResult == cOCT6100_ERR_OK )
+	{
+		/* Write the last word. */
+		_WriteParams.ulWriteAddress = f_ulAddress + 2;
+		_WriteParams.usWriteData = (UINT16)(f_ulConfigDword & 0xFFFF);
+		mOCT6100_DRIVER_WRITE_API( _WriteParams, ulResult );
+	}
+	return ulResult;
+}
+
+
+
 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
 Function:		Oct6100ApiWriteVqeNlpMemory
@@ -8814,8 +8881,7 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 	tOCT6100_WRITE_PARAMS			WriteParams;
 	tOCT6100_BUFFER_PLAYOUT_STOP	BufferPlayoutStop;
 	UINT32							ulResult;
-	UINT32							ulTempData;
-	UINT32							ulNlpConfigBaseAddress;
+	UINT32							ulTempData; UINT32							ulNlpConfigBaseAddress;
 	UINT32							ulFeatureBytesOffset;
 	UINT32							ulFeatureBitOffset;
 	UINT32							ulFeatureFieldLength;
@@ -8841,8 +8907,7 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 	ulTempData = 0;
 
 	/* Configure Adaptive Noise Reduction.*/
-	if ( pSharedInfo->ImageInfo.fAdaptiveNoiseReduction == TRUE )
-	{
+	if (pSharedInfo->ImageInfo.fAdaptiveNoiseReduction == TRUE) {
 		/* Check if the configuration has been changed. */
 		if ( ( f_fModifyOnly == FALSE ) 
 			|| ( ( f_fModifyOnly == TRUE ) 
@@ -8854,11 +8919,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.AdaptiveNoiseReductionOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.AdaptiveNoiseReductionOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData, 
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 			
@@ -8874,19 +8938,17 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= ( ( (UINT32)f_pVqeConfig->fSoutNoiseBleaching ) << ulFeatureBitOffset );
 
 			/* First read the DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
 	}
 
 	/* Configure Rout Noise Reduction. */
-	if ( pSharedInfo->ImageInfo.fRoutNoiseReduction == TRUE )
-	{
+	if (pSharedInfo->ImageInfo.fRoutNoiseReduction == TRUE) {
 		/* Check if the configuration has been changed. */
 		if ( ( f_fModifyOnly == FALSE )
 			|| ( ( f_fModifyOnly == TRUE ) 
@@ -8896,11 +8958,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.RinAnrOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.RinAnrOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 			
@@ -8913,15 +8974,15 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= ( ( (UINT32)f_pVqeConfig->fRoutNoiseReduction ) << ulFeatureBitOffset );
 
 			/* Write the new DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
 	}
+
 	if (pSharedInfo->ImageInfo.fRoutNoiseReductionLevel == TRUE)
 	{
 		/* Check if the configuration has been changed. */
@@ -8934,11 +8995,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.RinAnrValOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.RinAnrValOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 			
@@ -8967,11 +9027,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 				ulTempData |= ( 0 << ulFeatureBitOffset );
 
 			/* Write the new DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -8990,11 +9049,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.AnrSnrEnhancementOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.AnrSnrEnhancementOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 			
@@ -9026,11 +9084,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			}
 
 			/* Write the new DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9048,11 +9105,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.AnrVoiceNoiseSegregationOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.AnrVoiceNoiseSegregationOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 			
@@ -9065,11 +9121,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= ( ( (UINT32)f_pVqeConfig->ulAnrVoiceNoiseSegregation ) << ulFeatureBitOffset );
 
 			/* Write the new DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9088,11 +9143,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.ToneDisablerVqeActivationDelayOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.ToneDisablerVqeActivationDelayOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 			
@@ -9109,11 +9163,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 				ulTempData |= ( 0 ) << ulFeatureBitOffset;
 
 			/* Write the new DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9132,11 +9185,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.ConferencingNoiseReductionOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.ConferencingNoiseReductionOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 			
@@ -9152,11 +9204,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= (f_pVqeConfig->fSoutNoiseBleaching << ulFeatureBitOffset );
 
 			/* Save the DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 		}
@@ -9174,11 +9225,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.RinDcOffsetRemovalOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.RinDcOffsetRemovalOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData, 
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9191,11 +9241,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= ( ( (UINT32)f_pVqeConfig->fRinDcOffsetRemoval ) << ulFeatureBitOffset );
 
 			/* The write the new DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9214,11 +9263,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.SinDcOffsetRemovalOfst.byFieldSize;
 
 			/* First read the DWORD where the field is located.*/
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9231,11 +9279,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= ( ( (UINT32)f_pVqeConfig->fSinDcOffsetRemoval ) << ulFeatureBitOffset );
 
 			/* Save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9272,11 +9319,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.ComfortNoiseModeOfst.byFieldSize;
 
 			/* First read the DWORD where the field is located.*/
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9287,11 +9333,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= ( f_pVqeConfig->ulComfortNoiseMode << ulFeatureBitOffset );
 
 			/* Save the new DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9310,11 +9355,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.NlpControlFieldOfst.byFieldSize;
 
 			/* First read the DWORD where the field is located.*/
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9327,11 +9371,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 				ulTempData |= 0x1 << ulFeatureBitOffset;
 
 			/* Save the new DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 		}
@@ -9361,11 +9404,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.DefaultErlFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.DefaultErlFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9392,11 +9434,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= ( usTempData << ulFeatureBitOffset );
 
 			/* Save the new DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9414,11 +9455,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.AecFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.AecFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9429,11 +9469,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= ( ( (UINT32)f_pVqeConfig->fAcousticEcho ) << ulFeatureBitOffset );
 
 			/* Then save the new DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9452,11 +9491,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.AecDefaultErlFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.AecDefaultErlFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9483,11 +9521,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= ( usTempData << ulFeatureBitOffset );
 
 			/* Then save the DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9505,11 +9542,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.ToneRemovalFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.ToneRemovalFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9520,11 +9556,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= ( ( (UINT32)f_pVqeConfig->fDtmfToneRemoval ) << ulFeatureBitOffset );
 
 			/* First read the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9547,11 +9582,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.PcmLeakFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.PcmLeakFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9574,11 +9608,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 				ulTempData |= ( ausLookupTable[ f_pVqeConfig->ulNonLinearityBehaviorA ] << ulFeatureBitOffset );
 
 			/* Then save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 		}
@@ -9628,11 +9661,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 		ulFeatureFieldLength = pSharedInfo->MemoryMap.ToneDisablerControlOfst.byFieldSize;
 
 		/* First read the DWORD where the field is located.*/
-		mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											&ulTempData,
-											ulResult );
+											&ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;
 
@@ -9646,11 +9678,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= 0x1 << ulFeatureBitOffset;
 
 		/* Save the DWORD where the field is located. */
-		mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 										pChanEntry,
 										ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-										ulTempData,
-										ulResult );
+										ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;	
 	}
@@ -9672,11 +9703,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 		ulFeatureFieldLength = pSharedInfo->MemoryMap.NlpTrivialFieldOfst.byFieldSize;
 
 		/* First read the DWORD where the field is located.*/
-		mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											&ulTempData,
-											ulResult );
+											&ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;
 
@@ -9692,11 +9722,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 
 
 		/* Then write the DWORD where the field is located. */
-		mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 										pChanEntry,
 										ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-										ulTempData,
-										ulResult );
+										ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;	
 	}
@@ -9717,11 +9746,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.DoubleTalkBehaviorFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.DoubleTalkBehaviorFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData, 
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9732,11 +9760,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulTempData |= (f_pVqeConfig->ulDoubleTalkBehavior  << ulFeatureBitOffset );
 
 			/* Then save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}			
@@ -9758,11 +9785,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.MusicProtectionFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.MusicProtectionFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData, 
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9774,11 +9800,10 @@ UINT32 Oct6100ApiWriteVqeNlpMemory(
 				ulTempData |= ( 1 << ulFeatureBitOffset );
 
 			/* Then save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9867,11 +9892,10 @@ UINT32 Oct6100ApiWriteVqeAfMemory(
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.ChanMainIoMaxEchoPointOfst.byFieldSize;
 
 			/* First read the DWORD where the field is located.*/
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulAfConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9897,11 +9921,10 @@ UINT32 Oct6100ApiWriteVqeAfMemory(
 			ulTempData |= usTempData << ulFeatureBitOffset;
 
 			/* First read the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulAfConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9922,11 +9945,10 @@ UINT32 Oct6100ApiWriteVqeAfMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.NlpConvCapFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.NlpConvCapFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulAfConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData, 
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -9937,11 +9959,10 @@ UINT32 Oct6100ApiWriteVqeAfMemory(
 			ulTempData |= (f_pVqeConfig->ulNonLinearityBehaviorB  << ulFeatureBitOffset );
 
 			/* Then save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulAfConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -9964,11 +9985,10 @@ UINT32 Oct6100ApiWriteVqeAfMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.AdaptiveAleOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.AdaptiveAleOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulAfConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -10003,11 +10023,10 @@ UINT32 Oct6100ApiWriteVqeAfMemory(
 			}
 
 			/* Now write the DWORD where the field is located containing the new configuration. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulAfConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -10030,11 +10049,10 @@ UINT32 Oct6100ApiWriteVqeAfMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.IdleCodeDetectionFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.IdleCodeDetectionFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulAfConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData, 
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -10046,11 +10064,10 @@ UINT32 Oct6100ApiWriteVqeAfMemory(
 				ulTempData |= ( 1 << ulFeatureBitOffset );
 
 			/* Then save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulAfConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -10071,11 +10088,10 @@ UINT32 Oct6100ApiWriteVqeAfMemory(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.AftControlOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.AftControlOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulAfConfigBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -10096,11 +10112,10 @@ UINT32 Oct6100ApiWriteVqeAfMemory(
 			}
 
 			/* Then save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulAfConfigBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -12670,11 +12685,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 		ulFeatureFieldLength = pSharedInfo->MemoryMap.RinLevelControlOfst.byFieldSize;
 
 		/* First read the DWORD where the field is located.*/
-		mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulBaseAddress + ulFeatureBytesOffset,
-											&ulTempData,
-											ulResult );
+											&ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;
 
@@ -12708,11 +12722,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 		}
 
 		/* Save the DWORD where the field is located.*/
-		mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 										pChanEntry,
 										ulBaseAddress + ulFeatureBytesOffset,
-										ulTempData,
-										ulResult );
+										ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;	
 
@@ -12722,11 +12735,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 		ulFeatureFieldLength = pSharedInfo->MemoryMap.SoutLevelControlOfst.byFieldSize;
 
 		/* First read the DWORD where the field is located.*/
-		mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulBaseAddress + ulFeatureBytesOffset,
-											&ulTempData,
-											ulResult );
+											&ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;
 
@@ -12762,11 +12774,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 		}
 
 		/* Save the DWORD where the field is located.*/
-		mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 										pChanEntry,
 										ulBaseAddress + ulFeatureBytesOffset,
-										ulTempData,
-										ulResult );
+										ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;	
 		
@@ -12791,11 +12802,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 					ulFeatureFieldLength = pSharedInfo->MemoryMap.RinAutoLevelControlTargetOfst.byFieldSize;
 
 					/* First read the DWORD where the field is located.*/
-					mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+					ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 														pChanEntry,
 														ulBaseAddress + ulFeatureBytesOffset,
-														&ulTempData,
-														ulResult );
+														&ulTempData);
 					if ( ulResult != cOCT6100_ERR_OK )
 						return ulResult;
 
@@ -12819,11 +12829,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 					}
 
 					/* Save the DWORD where the field is located.*/
-					mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+					ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 													pChanEntry,
 													ulBaseAddress + ulFeatureBytesOffset,
-													ulTempData,
-													ulResult );
+													ulTempData);
 					if ( ulResult != cOCT6100_ERR_OK )
 						return ulResult;	
 				}
@@ -12838,11 +12847,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 					ulFeatureFieldLength = pSharedInfo->MemoryMap.RinHighLevelCompensationThresholdOfst.byFieldSize;
 
 					/* First read the DWORD where the field is located.*/
-					mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+					ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 														pChanEntry,
 														ulBaseAddress + ulFeatureBytesOffset,
-														&ulTempData,
-														ulResult );
+														&ulTempData);
 					if ( ulResult != cOCT6100_ERR_OK )
 						return ulResult;
 
@@ -12866,11 +12874,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 					}
 
 					/* Save the DWORD where the field is located.*/
-					mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+					ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 													pChanEntry,
 													ulBaseAddress + ulFeatureBytesOffset,
-													ulTempData,
-													ulResult );
+													ulTempData);
 					if ( ulResult != cOCT6100_ERR_OK )
 						return ulResult;	
 				}
@@ -12885,11 +12892,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.SoutAutoLevelControlTargetOfst.byFieldSize;
 
 			/* First read the DWORD where the field is located.*/
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -12913,11 +12919,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 			}
 
 			/* Save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -12930,11 +12935,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.SoutHighLevelCompensationThresholdOfst.byFieldSize;
 
 			/* First read the DWORD where the field is located.*/
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -12947,11 +12951,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 			ulTempData |= ( 0xFFFF << ulFeatureBitOffset ); 
 
 			/* Save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -12967,11 +12970,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.AlcHlcStatusOfst.byFieldSize;
 
 			/* First read the DWORD where the field is located.*/
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -12994,11 +12996,10 @@ UINT32 Oct6100ApiSetChannelLevelControl(
 			ulTempData |= ( byLastStatus << ulFeatureBitOffset ); 
 
 			/* Save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;			
 		}
@@ -13080,11 +13081,10 @@ UINT32 Oct6100ApiSetChannelTailConfiguration(
 				ulFeatureFieldLength = pSharedInfo->MemoryMap.PerChanTailDisplacementFieldOfst.byFieldSize;
 
 				/* First read the DWORD where the field is located.*/
-				mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+				ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 													pChanEntry,
 													ulNlpConfBaseAddress + ulFeatureBytesOffset,
-													&ulTempData,
-													ulResult );
+													&ulTempData);
 				if ( ulResult != cOCT6100_ERR_OK )
 					return ulResult;
 
@@ -13146,11 +13146,10 @@ UINT32 Oct6100ApiSetChannelTailConfiguration(
 				}
 
 				/* Then save the new DWORD where the field is located.*/
-				mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+				ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfBaseAddress + ulFeatureBytesOffset,
-												ulTempData,
-												ulResult );
+												ulTempData);
 				if ( ulResult != cOCT6100_ERR_OK )
 					return ulResult;	
 			}
@@ -13163,11 +13162,10 @@ UINT32 Oct6100ApiSetChannelTailConfiguration(
 				ulFeatureFieldLength = pSharedInfo->MemoryMap.AfTailDisplacementFieldOfst.byFieldSize;
 
 				/* First read the DWORD where the field is located.*/
-				mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+				ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 													pChanEntry,
 													ulAfConfBaseAddress + ulFeatureBytesOffset,
-													&ulTempData,
-													ulResult );
+													&ulTempData);
 				if ( ulResult != cOCT6100_ERR_OK )
 					return ulResult;
 
@@ -13186,11 +13184,10 @@ UINT32 Oct6100ApiSetChannelTailConfiguration(
 				}
 
 				/* Then save the DWORD where the field is located.*/
-				mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+				ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulAfConfBaseAddress + ulFeatureBytesOffset,
-												ulTempData,
-												ulResult );
+												ulTempData);
 				if ( ulResult != cOCT6100_ERR_OK )
 					return ulResult;
 			}
@@ -13200,11 +13197,10 @@ UINT32 Oct6100ApiSetChannelTailConfiguration(
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.TailDisplEnableOfst.byFieldSize;
 
 			/* First read the DWORD where the field is located.*/
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -13215,11 +13211,10 @@ UINT32 Oct6100ApiSetChannelTailConfiguration(
 			ulTempData |= ( ( (UINT32)f_pVqeConfig->fEnableTailDisplacement ) << ulFeatureBitOffset );
 
 			/* Then save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -13237,11 +13232,10 @@ UINT32 Oct6100ApiSetChannelTailConfiguration(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.PerChanTailLengthFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.PerChanTailLengthFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulAfConfBaseAddress + ulFeatureBytesOffset,
-												&ulTempData, 
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -13260,11 +13254,10 @@ UINT32 Oct6100ApiSetChannelTailConfiguration(
 			}
 
 			/* Then save the DWORD where the field is located.*/
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulAfConfBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -13284,11 +13277,10 @@ UINT32 Oct6100ApiSetChannelTailConfiguration(
 			ulFeatureBitOffset	 = pSharedInfo->MemoryMap.AecTailLengthFieldOfst.byBitOffset;
 			ulFeatureFieldLength = pSharedInfo->MemoryMap.AecTailLengthFieldOfst.byFieldSize;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pChanEntry,
 												ulNlpConfBaseAddress + ulFeatureBytesOffset,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 			
@@ -13366,11 +13358,10 @@ UINT32 Oct6100ApiSetChannelTailConfiguration(
 			}
 			
 			/* Write the new DWORD where the field is located. */
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulNlpConfBaseAddress + ulFeatureBytesOffset,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;	
 		}
@@ -13686,11 +13677,10 @@ UINT32 Oct6100ApiMuteSinWithFeatures(
 		ulFeatureBitOffset	 = pSharedInfo->MemoryMap.SinMuteOfst.byBitOffset;
 		ulFeatureFieldLength = pSharedInfo->MemoryMap.SinMuteOfst.byFieldSize;
 
-		mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 											pChanEntry,
 											ulBaseAddress + ulFeatureBytesOffset,
-											&ulTempData,
-											ulResult );
+											&ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;	
 		
@@ -13705,11 +13695,10 @@ UINT32 Oct6100ApiMuteSinWithFeatures(
 			ulTempData |= ( 0x1 << ulFeatureBitOffset );
 
 		/* Write the new DWORD where the field is located. */
-		mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 										pChanEntry,
 										ulBaseAddress + ulFeatureBytesOffset,
-										ulTempData,
-										ulResult );
+										ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;	
 	}
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.c
index 0a51835..162c43e 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.c
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.c
@@ -47,6 +47,7 @@ $Octasic_Revision: 89 $
 #include "oct6100api/oct6100_remote_debug_inst.h"
 #include "oct6100api/oct6100_debug_inst.h"
 #include "oct6100api/oct6100_api_inst.h"
+#include "oct6100api/oct6100_channel_inst.h"
 
 #include "oct6100api/oct6100_interrupts_pub.h"
 #include "oct6100api/oct6100_chip_open_pub.h"
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c
index 63c458a..1fc539e 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c
@@ -2703,11 +2703,10 @@ UINT32 Oct6100ApiBridgeEventAdd(
 				UINT32 ulFeatureBitOffset	 = pSharedInfo->MemoryMap.RinLevelControlOfst.byBitOffset;
 				UINT32 ulFeatureFieldLength = pSharedInfo->MemoryMap.RinLevelControlOfst.byFieldSize;
 
-				mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+				ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 													pEchoChanEntry,
 													ulBaseAddress + ulFeatureBytesOffset,
-													&ulTempData,
-													ulResult );
+													&ulTempData);
 				if ( ulResult != cOCT6100_ERR_OK )
 					return ulResult;
 
@@ -2720,11 +2719,10 @@ UINT32 Oct6100ApiBridgeEventAdd(
 				ulTempData |= ( cOCT6100_PASS_THROUGH_LEVEL_CONTROL << ulFeatureBitOffset );
 
 				/* First read the DWORD where the field is located. */
-				mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+				ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 												pEchoChanEntry,
 												ulBaseAddress + ulFeatureBytesOffset,
-												ulTempData,
-												ulResult );
+												ulTempData);
 				if ( ulResult != cOCT6100_ERR_OK )
 					return ulResult;
 			}
@@ -7583,11 +7581,10 @@ UINT32 Oct6100ApiBridgeSetDominantSpeaker(
 	ulFeatureFieldLength = f_pApiInstance->pSharedInfo->MemoryMap.DominantSpeakerFieldOfst.byFieldSize;
 
 	/* Retrieve the current configuration. */
-	mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+	ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 										pEchoChanEntry,
 										ulBaseAddress + ulFeatureBytesOffset,
-										&ulTempData,
-										ulResult );
+										&ulTempData);
 	if ( ulResult != cOCT6100_ERR_OK )
 		return ulResult;
 
@@ -7598,11 +7595,10 @@ UINT32 Oct6100ApiBridgeSetDominantSpeaker(
 	ulTempData |= ( ( f_usDominantSpeakerIndex ) << ulFeatureBitOffset );
 
 	/* Save the new dominant speaker. */
-	mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+	ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 									pEchoChanEntry,
 									ulBaseAddress + ulFeatureBytesOffset,
-									ulTempData,
-									ulResult );
+									ulTempData);
 	if ( ulResult != cOCT6100_ERR_OK )
 		return ulResult;	
 
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_events.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_events.c
index 7fa36d6..605bb4a 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_events.c
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_events.c
@@ -1241,11 +1241,10 @@ UINT32 Oct6100BufferPlayoutCheckForSpecificEvent(
 	}
 
 	/* Retrieve the current write pointer. */
-	mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance, 
+	ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance, 
 										pEchoChannel, 
 										ulPlayoutBaseAddress + ulWritePtrBytesOfst, 
-										&ulTempData,
-										ulResult );
+										&ulTempData);
 	if ( ulResult != cOCT6100_ERR_OK )
 		return ulResult;
 
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c
index 1a7ebc6..58a7194 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c
@@ -51,6 +51,7 @@ $Octasic_Revision: 81 $
 #include "oct6100api/oct6100_events_pub.h"
 #include "oct6100api/oct6100_channel_pub.h"
 #include "oct6100api/oct6100_interrupts_pub.h"
+#include "oct6100api/oct6100_channel_inst.h"
 
 #include "oct6100_chip_open_priv.h"
 #include "oct6100_miscellaneous_priv.h"
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.c
index 5d27c3c..e8a4199 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.c
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.c
@@ -52,6 +52,7 @@ $Octasic_Revision: 46 $
 #include "oct6100api/oct6100_chip_open_pub.h"
 #include "oct6100api/oct6100_channel_pub.h"
 #include "oct6100api/oct6100_phasing_tsst_pub.h"
+#include "oct6100api/oct6100_channel_inst.h"
 
 #include "oct6100_chip_open_priv.h"
 #include "oct6100_miscellaneous_priv.h"
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.c
index 57fda7c..cf3affa 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.c
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.c
@@ -2398,11 +2398,10 @@ UINT32 Oct6100ApiWriteChanPlayoutStructs(
 			/* Cleared! */
 			ulTempData &= ( ~ulMask );
 
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pEchoChannel,
 											ulAddress,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -2422,11 +2421,10 @@ UINT32 Oct6100ApiWriteChanPlayoutStructs(
 			/* Cleared! */
 			ulTempData &= ( ~ulMask );
 
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pEchoChannel,
 											ulAddress,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 		}
@@ -2471,11 +2469,10 @@ UINT32 Oct6100ApiWriteChanPlayoutStructs(
 		ulTempData &= ( ~ulMask );
 		ulTempData |= *pulSkipPtr << ulSkipPtrBitOfst;
 		
-		mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 										pEchoChannel,
 										ulAddress,
-										ulTempData,
-										ulResult );
+										ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;
 
@@ -2501,11 +2498,10 @@ UINT32 Oct6100ApiWriteChanPlayoutStructs(
 	ulTempData &= ( ~ulMask );
 	ulTempData |= ulWritePtr << ulWritePtrBitOfst;
 	
-	mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+	ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 									pEchoChannel,
 									ulAddress,
-									ulTempData,
-									ulResult );
+									ulTempData);
 	if ( ulResult != cOCT6100_ERR_OK )
 		return ulResult;
 	
@@ -2912,7 +2908,7 @@ UINT32 Oct6100ApiInvalidateChanPlayoutStructs(
 			/* Get the write pointer in the chip. */
 			ulAddress = ulPlayoutBaseAddress + ulWritePtrBytesOfst;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD( f_pApiInstance, pEchoChannel, ulAddress, &ulReadData, ulResult );
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance, pEchoChannel, ulAddress, &ulReadData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
@@ -2984,11 +2980,10 @@ UINT32 Oct6100ApiInvalidateChanPlayoutStructs(
 	{
 		ulAddress = ulPlayoutBaseAddress + ulIgnoreBytesOfst;
 
-		mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 											pEchoChannel,
 											ulAddress,
-											&ulTempData,
-											ulResult );
+											&ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;
 		
@@ -3000,11 +2995,10 @@ UINT32 Oct6100ApiInvalidateChanPlayoutStructs(
 		if ( f_pBufferPlayoutStop->fStopCleanly == FALSE )
 			ulTempData |= 0x1 << ulIgnoreBitOfst;
 		
-		mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+		ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 										pEchoChannel,
 										ulAddress,
-										ulTempData,
-										ulResult );
+										ulTempData);
 		if ( ulResult != cOCT6100_ERR_OK )
 			return ulResult;
 	}
@@ -3017,7 +3011,7 @@ UINT32 Oct6100ApiInvalidateChanPlayoutStructs(
 
 	ulAddress = ulPlayoutBaseAddress + ulWritePtrBytesOfst;
 
-	mOCT6100_RETRIEVE_NLP_CONF_DWORD( f_pApiInstance, pEchoChannel, ulAddress, &ulTempData, ulResult );
+	ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance, pEchoChannel, ulAddress, &ulTempData);
 	if ( ulResult != cOCT6100_ERR_OK )
 		return ulResult;
 	
@@ -3026,11 +3020,10 @@ UINT32 Oct6100ApiInvalidateChanPlayoutStructs(
 	ulTempData &= ( ~ulMask );
 	ulTempData |= ulWritePtr << ulWritePtrBitOfst;
 	
-	mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+	ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 									pEchoChannel,
 									ulAddress,
-									ulTempData,
-									ulResult );
+									ulTempData);
 	if ( ulResult != cOCT6100_ERR_OK )
 		return ulResult;
 	
@@ -3042,11 +3035,10 @@ UINT32 Oct6100ApiInvalidateChanPlayoutStructs(
 
 	ulAddress = ulPlayoutBaseAddress + ulSkipPtrBytesOfst;
 
-	mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+	ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 										pEchoChannel,
 										ulAddress,
-										&ulTempData,
-										ulResult );
+										&ulTempData);
 	if ( ulResult != cOCT6100_ERR_OK )
 		return ulResult;
 	
@@ -3055,11 +3047,10 @@ UINT32 Oct6100ApiInvalidateChanPlayoutStructs(
 	ulTempData &= ( ~ulMask );
 	ulTempData |= ulSkipPtr << ulSkipPtrBitOfst;
 	
-	mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+	ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 									pEchoChannel,
 									ulAddress,
-									ulTempData,
-									ulResult );
+									ulTempData);
 	if ( ulResult != cOCT6100_ERR_OK )
 		return ulResult;
 	
@@ -3076,11 +3067,10 @@ UINT32 Oct6100ApiInvalidateChanPlayoutStructs(
 		{
 			ulAddress = ulPlayoutBaseAddress + ulHardSkipBytesOfst;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pEchoChannel,
 												ulAddress,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 			
@@ -3092,22 +3082,20 @@ UINT32 Oct6100ApiInvalidateChanPlayoutStructs(
 			if ( f_pBufferPlayoutStop->fStopCleanly == FALSE )
 				ulTempData |= 0x1 << ulHardSkipBitOfst;
 			
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pEchoChannel,
 											ulAddress,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 
 			/* Now is the appropriate time to skip! */
 			ulAddress = ulPlayoutBaseAddress + ulIgnoreBytesOfst;
 
-			mOCT6100_RETRIEVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_retrieve_nlp_conf_dword(f_pApiInstance,
 												pEchoChannel,
 												ulAddress,
-												&ulTempData,
-												ulResult );
+												&ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 			
@@ -3118,11 +3106,10 @@ UINT32 Oct6100ApiInvalidateChanPlayoutStructs(
 			/* Set the skip bit. */
 			ulTempData |= 0x1 << ulIgnoreBitOfst;
 			
-			mOCT6100_SAVE_NLP_CONF_DWORD(	f_pApiInstance,
+			ulResult = oct6100_save_nlp_conf_dword(f_pApiInstance,
 											pEchoChannel,
 											ulAddress,
-											ulTempData,
-											ulResult );
+											ulTempData);
 			if ( ulResult != cOCT6100_ERR_OK )
 				return ulResult;
 		}
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.c
index 7f3182b..ab2dd70 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.c
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.c
@@ -51,6 +51,7 @@ $Octasic_Revision: 113 $
 
 #include "oct6100api/oct6100_channel_pub.h"
 #include "oct6100api/oct6100_chip_open_pub.h"
+#include "oct6100api/oct6100_channel_inst.h"
 
 #include "oct6100_chip_open_priv.h"
 #include "oct6100_miscellaneous_priv.h"
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_miscellaneous_priv.h b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_miscellaneous_priv.h
index 21cdb67..c0381f4 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_miscellaneous_priv.h
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_miscellaneous_priv.h
@@ -208,104 +208,6 @@ $Octasic_Revision: 20 $
 
 #define mOCT6100_ASSIGN_USER_READ_WRITE_OBJ( f_pApiInst, Params )
 
-
-/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
-
-Function:		mOCT6100_RETRIEVE_NLP_CONF_DWORD
-
-Description:    This function is used by the API to store on a per channel basis
-				the various confguration DWORD from the device. The API performs 
-				less read to the chip that way since it is always in synch 
-				with the chip.
-
--------------------------------------------------------------------------------
-|	Argument		|	Description
--------------------------------------------------------------------------------
-
-IN	f_pApiInst				Pointer to API instance. This memory is used to keep
-							the present state of the chip and all its resources.
-IN	f_pChanEntry			Pointer to an API channel structure..
-IN	f_ulAddress				Address that needs to be modified..
-IN	f_pulConfigDword		Pointer to the content stored in the API located at the
-							desired address.
-
-\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
-#define mOCT6100_RETRIEVE_NLP_CONF_DWORD( f_pApiInst, f_pChanEntry, f_ulAddress, f_pulConfigDword, f_ulResult )	\
-{																										\
-	tOCT6100_READ_PARAMS	_ReadParams;																\
-	UINT16					_usReadData;																\
-	f_ulResult = cOCT6100_ERR_FATAL_8E;																	\
-	(*f_pulConfigDword) = cOCT6100_INVALID_VALUE;														\
-																										\
-	_ReadParams.pProcessContext = f_pApiInst->pProcessContext;											\
-	mOCT6100_ASSIGN_USER_READ_WRITE_OBJ( f_pApiInst, _ReadParams );										\
-	_ReadParams.ulUserChipId = f_pApiInst->pSharedInfo->ChipConfig.ulUserChipId;						\
-	_ReadParams.pusReadData = &_usReadData;																\
-																										\
-	/* Read the first 16 bits.*/																		\
-	_ReadParams.ulReadAddress = f_ulAddress;															\
-	mOCT6100_DRIVER_READ_API( _ReadParams, f_ulResult );												\
-	if ( f_ulResult == cOCT6100_ERR_OK )																\
-	{																									\
-		/* Save data.*/																					\
-		(*f_pulConfigDword) = _usReadData << 16;														\
-																										\
-		/* Read the last 16 bits .*/																	\
-		_ReadParams.ulReadAddress += 2;																	\
-		mOCT6100_DRIVER_READ_API( _ReadParams, f_ulResult );											\
-		if ( f_ulResult == cOCT6100_ERR_OK )															\
-		{																								\
-			/* Save data.*/																				\
-			(*f_pulConfigDword) |= _usReadData;															\
-			f_ulResult = cOCT6100_ERR_OK;																\
-		}																								\
-	}																									\
-}																										\
-
-
-/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
-
-Function:		mOCT6100_SAVE_NLP_CONF_DWORD
-
-Description:    This function stores a configuration Dword within an API channel
-				structure and then writes it into the chip.
-
--------------------------------------------------------------------------------
-|	Argument		|	Description
--------------------------------------------------------------------------------
-
-IN	f_pApiInst				Pointer to API instance. This memory is used to keep
-							the present state of the chip and all its resources.
-IN	f_pChanEntry			Pointer to an API channel structure..
-IN	f_ulAddress				Address that needs to be modified..
-IN	f_pulConfigDword		content to be stored in the API located at the
-							desired address.
-
-\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
-#define mOCT6100_SAVE_NLP_CONF_DWORD( f_pApiInst, f_pChanEntry, f_ulAddress, f_ulConfigDword, f_ulResult )	\
-{																										\
-	/* Write the config DWORD. */																		\
-	tOCT6100_WRITE_PARAMS	_WriteParams;																\
-																										\
-	_WriteParams.pProcessContext = f_pApiInst->pProcessContext;											\
-	mOCT6100_ASSIGN_USER_READ_WRITE_OBJ( f_pApiInst, _WriteParams )										\
-	_WriteParams.ulUserChipId = f_pApiInst->pSharedInfo->ChipConfig.ulUserChipId;						\
-																										\
-	/* Write the first 16 bits. */																		\
-	_WriteParams.ulWriteAddress = f_ulAddress;															\
-	_WriteParams.usWriteData = (UINT16)((f_ulConfigDword >> 16) & 0xFFFF);								\
-	mOCT6100_DRIVER_WRITE_API( _WriteParams, f_ulResult );												\
-																										\
-	if ( f_ulResult == cOCT6100_ERR_OK )																\
-	{																									\
-		/* Write the last word. */																		\
-		_WriteParams.ulWriteAddress = f_ulAddress + 2;													\
-		_WriteParams.usWriteData = (UINT16)(f_ulConfigDword & 0xFFFF);									\
-		mOCT6100_DRIVER_WRITE_API( _WriteParams, f_ulResult );											\
-	}																									\
-}
-
-
 #define mOCT6100_CREATE_FEATURE_MASK( f_ulFieldSize, f_ulFieldBitOffset, f_pulFieldMask )					\
 {																											\
 	(*f_pulFieldMask) = ( 1 << f_ulFieldSize );																\
@@ -364,4 +266,14 @@ UINT8 Oct6100ApiHexToAscii(
 UINT32 Oct6100ApiRand( 
 				IN		UINT32						f_ulRange );
 
+UINT32 oct6100_retrieve_nlp_conf_dword(tPOCT6100_INSTANCE_API f_pApiInst,
+								tPOCT6100_API_CHANNEL f_pChanEntry,
+								UINT32 f_ulAddress,
+								UINT32 *f_pulConfigDword);
+
+UINT32 oct6100_save_nlp_conf_dword(tPOCT6100_INSTANCE_API f_pApiInst,
+								tPOCT6100_API_CHANNEL f_pChanEntry,
+								UINT32 f_ulAddress,
+								UINT32 f_ulConfigDword);
+
 #endif /* __OCT6100_MISCELLANEOUS_PRIV_H__ */

commit 4bce476743e936f42d81a9892c08551aebc32f9c
Author: Shaun Ruffell <sruffell at digium.com>
Date:   Mon Feb 7 15:51:38 2011 -0600

    wct4xxp: Reduce the memory footprint of the hardware echocanceler.
    
    This saves ~300K of kernel memory for each quad or dual span VPM.  Due
    to the fact that this change disables caching of the NLP words (among
    other things), the time to disable the echocans appears to have
    increased by ~1ms.
    
    Before this change:
    =======================================================================
    0) ! 356.498 us  |  vpm450m_setecmode(); <--- disable
    0) ! 387.762 us  |  vpm450m_setecmode(); <--- enable
    0) ! 429.839 us  |  vpm450m_setecmode(); <--- disable
    
    ]# echo 1 > /proc/sys/vm/drop_caches && free -k
    total       used       free     shared    buffers     cached
    Mem:       2005352     228368    1776984          0        132
    5540
    -/+ buffers/cache:     222696    1782656
    Swap:       983036          0     983036
    
    After this change:
    =======================================================================
    0) ! 1109.515 us |  vpm450m_setecmode(); <--- disable
    0) ! 339.017 us  |  vpm450m_setecmode(); <--- enable
    0) ! 1431.460 us |  vpm450m_setecmode(); <--- disable
    
    ]# echo 1 > /proc/sys/vm/drop_caches && free -k
    total       used       free     shared    buffers     cached
    Mem:       2005352     228080    1777272          0        112
    5484
    -/+ buffers/cache:     222484    1782868
    Swap:       983036          0     983036
    
    Signed-off-by: Shaun Ruffell <sruffell at digium.com>

diff --git a/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h b/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h
index b329a49..6f0d974 100644
--- a/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h
+++ b/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h
@@ -43,10 +43,15 @@ $Octasic_Revision: 90 $
 typedef struct _OCT6100_API_CHANNEL_TDM_
 {
 	/* Laws. */
-	UINT8	byRinPcmLaw;
-	UINT8	bySinPcmLaw;
-	UINT8	byRoutPcmLaw;
-	UINT8	bySoutPcmLaw;
+	UINT8	byRinPcmLaw:1;
+	UINT8	bySinPcmLaw:1;
+	UINT8	byRoutPcmLaw:1;
+	UINT8	bySoutPcmLaw:1;
+
+	UINT8	byRinNumTssts:1;
+	UINT8	bySinNumTssts:1;
+	UINT8	byRoutNumTssts:1;
+	UINT8	bySoutNumTssts:1;
 
 	/* RIN port. */
 	UINT16	usRinTimeslot;
@@ -72,86 +77,71 @@ typedef struct _OCT6100_API_CHANNEL_TDM_
 	UINT16	usSoutBrdcastTsstFirstEntry;
 	UINT16	usSoutBrdcastTsstNumEntry;
 
-	UINT8	byRinNumTssts;
-	UINT8	bySinNumTssts;
-	UINT8	byRoutNumTssts;
-	UINT8	bySoutNumTssts;
-
 } tOCT6100_API_CHANNEL_TDM, *tPOCT6100_API_CHANNEL_TDM;
 
 typedef struct _OCT6100_API_CHANNEL_VQE_
 {
-	UINT8	fEnableNlp;
-	UINT8	fEnableTailDisplacement;
-	UINT16	usTailDisplacement;
-	UINT16	usTailLength;
+	UINT8	fEnableNlp:1;
+	UINT8	fEnableTailDisplacement:1;
+	UINT8	fSinDcOffsetRemoval:1;
+	UINT8	fRinDcOffsetRemoval:1;
+	UINT8	fRinLevelControl:1;
+	UINT8	fSoutLevelControl:1;
+	UINT8	fRinAutomaticLevelControl:1;
+	UINT8	fSoutAutomaticLevelControl:1;
+	UINT8	fRinHighLevelCompensation:1;
+	UINT8	fSoutAdaptiveNoiseReduction:1;
+	UINT8	fDtmfToneRemoval:1;
+	UINT8	fAcousticEcho:1;
+	UINT8	byComfortNoiseMode:1;
+	UINT8	fSoutNaturalListenerEnhancement:1;
+	UINT8	fRoutNoiseReduction:1;
+	UINT8	fEnableMusicProtection:1;
+	UINT8	fIdleCodeDetection:1;
+	UINT8	byAnrVoiceNoiseSegregation:1;
+	UINT8	byDoubleTalkBehavior:1;
+	UINT8	fSoutNoiseBleaching:1;
+	UINT8	fSoutConferencingNoiseReduction:1;
+	UINT8	bySoutAutomaticListenerEnhancementGainDb:1;
+	UINT8	byNonLinearityBehaviorA:1;
+	UINT8	byNonLinearityBehaviorB:1;
+	UINT8	bySoutNaturalListenerEnhancementGainDb:1;
 
-	UINT8	fSinDcOffsetRemoval;
-	UINT8	fRinDcOffsetRemoval;
-	UINT8	fRinLevelControl;
-	UINT8	fSoutLevelControl;
-	
-	UINT8	fRinAutomaticLevelControl;
-	UINT8	fSoutAutomaticLevelControl;
 	OCT_INT8	chRinAutomaticLevelControlTargetDb;
 	OCT_INT8	chSoutAutomaticLevelControlTargetDb;
 	
-	UINT8	fRinHighLevelCompensation;
 	OCT_INT8	chRinHighLevelCompensationThresholdDb;
 	
-	UINT8	bySoutAutomaticListenerEnhancementGainDb;
-	UINT8	fSoutNaturalListenerEnhancement;
-
-	UINT8	fSoutAdaptiveNoiseReduction;
-	UINT8	fDtmfToneRemoval;
-	UINT8	fAcousticEcho;
-	UINT8	byComfortNoiseMode;
-
-	UINT8	byNonLinearityBehaviorA;
-	UINT8	byNonLinearityBehaviorB;
 	OCT_INT8	chRinLevelControlGainDb;
 	OCT_INT8	chSoutLevelControlGainDb;
 
 	OCT_INT8	chDefaultErlDb;
 	OCT_INT8	chAecDefaultErlDb;
 
-	UINT8	fRoutNoiseReduction;
 	OCT_INT8	chRoutNoiseReductionLevelGainDb;
 	OCT_INT8	chAnrSnrEnhancementDb;
 
-	UINT8	fEnableMusicProtection;
-	UINT8	fIdleCodeDetection;
-
-	UINT8	byAnrVoiceNoiseSegregation;
-	UINT8	bySoutNaturalListenerEnhancementGainDb;
-	
 	UINT16	usToneDisablerVqeActivationDelay;
 	UINT16	usAecTailLength;
 
-	UINT8	byDoubleTalkBehavior;
-	UINT8	fSoutNoiseBleaching;
-	
-
-
-	UINT8	fSoutConferencingNoiseReduction;
-
-
+	UINT16	usTailDisplacement;
+	UINT16	usTailLength;
 
 } tOCT6100_API_CHANNEL_VQE, *tPOCT6100_API_CHANNEL_VQE;
 
 typedef struct _OCT6100_API_CHANNEL_CODEC_
 {
-	UINT8	byAdpcmNibblePosition;
-	UINT8	fEnableSilenceSuppression;
+	UINT8	byAdpcmNibblePosition:1;
+	UINT8	fEnableSilenceSuppression:1;
 
-	UINT8	byEncoderPort;
-	UINT8	byEncodingRate;
+	UINT8	byEncoderPort:1;
+	UINT8	byEncodingRate:1;
 
-	UINT8	byDecoderPort;
-	UINT8	byDecodingRate;
+	UINT8	byDecoderPort:1;
+	UINT8	byDecodingRate:1;
 	
-	UINT8	byPhase;
-	UINT8	byPhasingType;
+	UINT8	byPhase:1;
+	UINT8	byPhasingType:1;
 
 } tOCT6100_API_CHANNEL_CODEC, *tPOCT6100_API_CHANNEL_CODEC;
 
@@ -161,17 +151,55 @@ typedef struct _OCT6100_API_CHANNEL_
 	/* Channel configuration. */
 
 	/* Flag specifying whether the entry is used or not. */
-	UINT8	fReserved;
+	UINT8	fReserved:1;
 
 	/* Count used to manage entry handles allocated to user. */
-	UINT8	byEntryOpenCnt;
+	UINT8	byEntryOpenCnt:1;
 
 	/* Is this a bidirectionnal channel? */
-	UINT8	fBiDirChannel;
+	UINT8	fBiDirChannel:1;
 
 	/* Enable tone disabler? */
-	UINT8	fEnableToneDisabler;
+	UINT8	fEnableToneDisabler:1;
+
+	/* Current echo operation mode. */
+	UINT8	byEchoOperationMode:1;
 
+	UINT8	byToneDisablerStatus:1;
+
+	UINT8	fMute:1;
+	UINT8	fTap:1;
+	UINT8	fBeingTapped:1;
+	UINT8	fCopyEventCreated:1;
+
+	UINT8	fSoutBufPlaying:1;
+	UINT8	fRinBufPlaying:1;
+	
+	UINT8	fRinBufPlayoutNotifyOnStop:1;
+	UINT8	fRinBufPlayoutRepeatUsed:1;
+
+
+	UINT8	fSoutBufPlayoutNotifyOnStop:1;
+	UINT8	fSoutBufPlayoutRepeatUsed:1;
+
+	UINT8	fRinHardStop:1;
+	UINT8	fSoutHardStop:1;
+
+	UINT8	byRinPlayoutStopEventType:1;
+	UINT8	bySoutPlayoutStopEventType:1;
+	
+	UINT8	fRinBufAdded:1;
+	UINT8	fSoutBufAdded:1;
+	
+	UINT8	fBufPlayoutActive:1;
+
+	/* Enable extended tone detection. */
+	UINT8	fEnableExtToneDetection:1;
+
+	/* State of the codec structure associated to this channel. */
+	UINT8	fSinSoutCodecActive:1;
+	UINT8	fRinRoutCodecActive:1;
+	
 	/* TSI chariot memory entry for the Rin/Rout stream. */
 	UINT16	usRinRoutTsiMemIndex;
 
@@ -202,9 +230,6 @@ typedef struct _OCT6100_API_CHANNEL_
 	/* Active mixer events count to test for last event. */
 	UINT16	usMixerEventCnt;
 
-	/* User channel ID, transparently passed to the user. */
-	UINT32	ulUserChanId;
-
 	/* Copy events. */
 	UINT16	usSinCopyEventIndex;
 	UINT16	usSoutCopyEventIndex;
@@ -219,15 +244,11 @@ typedef struct _OCT6100_API_CHANNEL_
 	/* VQE configuration. */
 	tOCT6100_API_CHANNEL_VQE	VqeConfig;
 
-	/* Current echo operation mode. */
-	UINT8	byEchoOperationMode;
-
 	/* Currently muted ports. */
 	UINT16	usMutedPorts;
 
 	/*=======================================================================*/
 
-	
 	/*=======================================================================*/
... 613 lines suppressed ...


-- 
team/sruffell/dahdi-linux.git



More information about the asterisk-scf-commits mailing list