summaryrefslogtreecommitdiff
path: root/Acceleration/library/icp_telephony/tdm_io_access/include/icp_hssacc_channel_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'Acceleration/library/icp_telephony/tdm_io_access/include/icp_hssacc_channel_config.h')
-rw-r--r--Acceleration/library/icp_telephony/tdm_io_access/include/icp_hssacc_channel_config.h269
1 files changed, 269 insertions, 0 deletions
diff --git a/Acceleration/library/icp_telephony/tdm_io_access/include/icp_hssacc_channel_config.h b/Acceleration/library/icp_telephony/tdm_io_access/include/icp_hssacc_channel_config.h
new file mode 100644
index 0000000..c355b94
--- /dev/null
+++ b/Acceleration/library/icp_telephony/tdm_io_access/include/icp_hssacc_channel_config.h
@@ -0,0 +1,269 @@
+/*******************************************************************************
+ *
+ * @file icp_hssacc_channel_config.h
+ *
+ * @description Content of this file is the Prototype definition of the API for
+ * the Channel Configuration module and all related Data structures shared
+ * by this module.
+ *
+ * @ingroup icp_HssAcc
+ *
+ * @Revision 1.0
+ *
+ * @par
+ * This file is provided under a dual BSD/GPLv2 license. When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2007,2008,2009 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * The full GNU General Public License is included in this distribution
+ * in the file called LICENSE.GPL.
+ *
+ * Contact Information:
+ * Intel Corporation
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2007,2008,2009 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
+ *
+ *
+ *
+ *
+ ******************************************************************************/
+
+
+#ifndef ICP_HSSACCCHANNELCONFIG_H
+#define ICP_HSSACCCHANNELCONFIG_H
+
+#include "icp.h"
+#include "icp_hssacc.h"
+#include "icp_hssacc_port_config.h"
+
+
+#define BIT_SET(index) (1 << index)
+
+
+/*
+ * ----------------------------------------------------------------------------
+ * Enumerated types
+ * ----------------------------------------------------------------------------
+ */
+
+/* Enum for the various states a channel can be in */
+typedef enum
+{
+ ICP_HSSACC_CHANNEL_UNINITIALISED = 0,
+ ICP_HSSACC_CHANNEL_ALLOCATED,
+ ICP_HSSACC_CHANNEL_CONFIGURED,
+ ICP_HSSACC_CHANNEL_SERVICE_CONFIGURED,
+ ICP_HSSACC_CHANNEL_DOWN,
+ ICP_HSSACC_CHANNEL_ENABLED,
+ ICP_HSSACC_CHANNEL_DOWN_TRANSITION
+} icp_hssacc_channel_state_t;
+
+
+
+/*
+ Definition of the structure containing all Channel
+ configuration Data
+*/
+typedef struct icp_hssacc_channel_config_s
+{
+ icp_hssacc_channel_state_t state; /* Current state of the channel */
+ icp_hssacc_channel_type_t type; /* Voice or data */
+ unsigned size; /* Size of the channel in timeslots */
+ unsigned portId; /* HSS port number for the channel */
+ icp_hssacc_line_t lineId; /* TDM line number for the channel */
+ uint32_t timeslotMap; /* Timeslots reserved for the channel */
+ uint32_t sdcCtrlReg; /* Common channel settings */
+ uint32_t rxCfg; /* HDLC Rx settings */
+ uint32_t txCfg; /* HDLC Tx settings */
+ icp_boolean_t dataPolarity; /* polarity of the data */
+ icp_hssacc_bit_endian_t bitEndian; /* specifies endianness of the chan */
+ icp_boolean_t byteSwap; /* byteSwapping on/off */
+ icp_hssacc_robbed_bit_value_t rBitValue; /* value 0/1 of robbed bit */
+ icp_hssacc_robbed_bit_location_t rBitLocation;
+ /* location of the robbed bit in the byte */
+ icp_hssacc_bit_robbing_t bitRobbing; /* bit robbing used or not */
+
+ /* HDLC specific */
+ icp_hssacc_hdlc_sof_flag_type_t sofFlagType; /* start of frame */
+ icp_hssacc_hdlc_idle_pattern_t hdlcTxIdlePattern; /* idle pattern to Tx */
+ icp_hssacc_hdlc_idle_pattern_t hdlcRxIdlePattern; /* expected idle on rx */
+ icp_hssacc_hdlc_crc_bit_width_t hdlcCrcBitWidth; /* CRC size */
+ uint32_t hdlcMaxFrSize; /* maximum frame size on rx */
+
+ /* VOICE specific */
+ uint32_t voiceSampleSize; /* size of voice samples */
+ uint8_t voiceIdlePattern; /* voice silence pattern */
+ icp_hssacc_channel_voice_tx_idle_action_t txIdleAction;
+ /* tx silence or repeat last frame */
+
+ unsigned numBypasses; /* channel can be involved in up to 2 bypasses,
+ one as source, one as destination */
+} icp_hssacc_channel_config_t;
+
+/* ----------------------------------------------------------------------------
+ * Function declarations
+ * ----------------------------------------------------------------------------
+ */
+/*****************************************************************************
+ * Abstract:
+ * Initialise the Channel Configuration module
+ *
+ *****************************************************************************/
+icp_status_t
+HssAccChannelConfigInit(void);
+
+
+/*****************************************************************************
+ * Abstract:
+ * shutdown the Channel Configuration module
+ *
+ *****************************************************************************/
+icp_status_t
+HssAccChannelConfigShutdown(void);
+
+
+
+/*****************************************************************************
+ * Abstract:
+ * Reset the internal stats gathered by this module
+ *
+ *****************************************************************************/
+void
+HssAccChannelConfigStatsReset (void);
+
+
+
+/*****************************************************************************
+ * Abstract:
+ * display all stats gathered by this module.
+ *
+ *****************************************************************************/
+void
+HssAccChannelConfigStatsShow (void);
+
+
+
+/*****************************************************************************
+ * Abstract:
+ * display the state of the specified channel
+ *
+ *****************************************************************************/
+void
+HssAccChannelConfigStateShow (unsigned channelId);
+
+
+/*****************************************************************************
+ * Abstract:
+ * check whether it is valid to configure a bypass on the specified
+ * channel.
+ *
+ *****************************************************************************/
+icp_boolean_t
+HssAccChannelConfigValidBypass(const unsigned channelId,
+ const unsigned portId);
+
+
+/*****************************************************************************
+ * Abstract:
+ * set the 2 specified channels as part of a bypass
+ *
+ *****************************************************************************/
+void
+HssAccChannelBypassPairSet(unsigned srcChannelId,
+ unsigned destChannelId);
+
+
+/*****************************************************************************
+ * Abstract:
+ * clear the 2 specified channels from any bypass connection
+ *
+ *****************************************************************************/
+void
+HssAccChannelBypassPairClear(unsigned srcChannelId,
+ unsigned destChannelId);
+
+
+/*****************************************************************************
+ * Abstract:
+ * query the service to which the specified channel is associated, Voice
+ * or HDLC.
+ *
+ *****************************************************************************/
+icp_hssacc_channel_type_t
+HssAccChannelConfigTypeQuery (unsigned channelId);
+
+
+
+/*****************************************************************************
+ * Abstract:
+ * query the current state of the specified channel.
+ *
+ *****************************************************************************/
+icp_hssacc_channel_state_t
+HssAccChannelConfigStateQuery (unsigned channelId);
+
+
+
+/*****************************************************************************
+ * Abstract:
+ * notify the Channel Configuration module that all buffers associated
+ * with this channel have been retrieved.
+ *
+ *****************************************************************************/
+void
+HssAccChannelConfigBuffersClearedNotify (unsigned channelId);
+
+
+
+/*****************************************************************************
+ * Abstract:
+ * query whether there are any channels allocated on the specified port.
+ *
+ *****************************************************************************/
+icp_boolean_t
+HssAccChannelConfigUsedChansOnPortFind (const unsigned portId);
+#endif /* ICP_HSSACCCHANNELCONFIG_H */