wanpipe-3.5.28.tgz

This commit is contained in:
Harald Welte 2021-12-29 18:54:03 +01:00
parent 5abe876a0b
commit bf747b8d9b
37 changed files with 725 additions and 132 deletions

View File

@ -1,2 +1,2 @@
wanpipe_linux: git ver 3a68096
wanpipe_common: git ver f6335be
wanpipe_linux: git ver e54457c
wanpipe_common: git ver 39dfbc6

View File

@ -1 +1 @@
wanpipe-3.5.27
wanpipe-3.5.28

View File

@ -8,6 +8,12 @@ Copyright (c) 1995-2012 Sangoma Technologies Inc.
For more info visit: http://wiki.sangoma.com
------------------------------------------------------------------------------
* Thu Aug 10 2012 Nenad Corbic <ncorbic@sangoma.com> - 3.5.28
==================================================================
- Added A116 card support
- Minor fixes for R2 CAS for NBE
* Thu May 6 2012 Nenad Corbic <ncorbic@sangoma.com> - 3.5.27
==================================================================

42
Setup
View File

@ -96,6 +96,12 @@ check_gcc ()
return 0;
fi
if [ "$GCC_CHECK" = "INIT" ]; then
GCC_CHECK=DONE
else
return 0
fi
GCC_VER=3
eval "gcc --version 2> /dev/null > /dev/null"
@ -642,6 +648,15 @@ prepare()
missing_packages=$missing_packages"flex "
fi
is_distr_fedora16
if [ $? -eq 1 ]; then
flx=`rpm -qa | grep flex-static`
if [ "$flx" = "" ]; then
echo "Failed!"
missing_packages=$missing_packages"flex-static "
fi
fi
echo -n "Checking for Patch ..."
eval "patch --version 2> /dev/null > /dev/null"
if [ $? -eq 0 ]; then
@ -729,6 +744,11 @@ prepare()
echo -e " Required for Wancfg configuration utility."
echo -e " Install flex package (e.g yum install flex)."
;;
flex-static)
echo -e "\n flex-static package ."
echo -e " Required for Wancfg configuration utility."
echo -e " Install flex package (e.g yum install flex-static)."
;;
bison)
echo -e "\n Bison."
echo -e " Required for Wanpipe Utilities."
@ -2255,6 +2275,24 @@ function is_distr_fedora2()
return 1
}
function is_distr_fedora16()
{
local distr
if [ ! -f /etc/issue ]; then
return 0
fi
distr=`cat /etc/issue | grep "(Verne)"`
#If release is not Fedora2 then
#get out
if [ "$distr" = "" ]; then
return 0
fi
return 1
}
function update_redhat_as()
@ -7333,7 +7371,7 @@ KERNEL_UNAME=`uname -r`
PKG_NAME=wanpipe
DISTR_NAME="WANPIPE"
PROD=wanrouter
PROD_VER=3.5.27
PROD_VER=3.5.28
PROD_HOME=`pwd`
META_CONF=$PROD_HOME/$PROD.rc
WAN_INTR_DIR=$PROD_HOME/interfaces
@ -7525,6 +7563,8 @@ API_PROTOCOLS="SS7-BISYNC-BSCSTRM-BITSTRM-POS-EDU-SDLC-MPAPI-ADCCP-TDM-XDLC-ASYH
CC=gcc
USR_CC=
GCC_VER=3
GCC_CHECK="INIT"
KBUILD_VERBOSE=0
REGPARM_DISABLE=0
KBUILD_DISABLE=0

View File

@ -1,5 +1,5 @@
Package: wanpipe
Version: 3.5.27-0
Version: 3.5.28-0
Section: networking
Priority: optional
Architecture: all

View File

@ -773,6 +773,7 @@ typedef struct sdla_hw_type_cnt
unsigned char aft_x_adapters;
unsigned char usb_adapters;
unsigned char aft_w400_adapters;
unsigned char aft116_adapters;
}sdla_hw_type_cnt_t;
typedef struct sdladrv_callback_ {

View File

@ -78,6 +78,7 @@
#define AFT_8TE1_SHARK_SUBSYS_VENDOR 0xA114 /* A108-SHARK T1/E1 8 lines */
#define A300_UTE3_SHARK_SUBSYS_VENDOR 0xA115 /* A300-SHARK with T3/E3 (unchannelized) */
#define A305_CTE3_SHARK_SUBSYS_VENDOR 0xA116 /* A305-SHARK with T3 (channelized) */
#define AFT_16TE1_SHARK_SUBSYS_VENDOR 0xA117 /* A116-SHARK T1/E1 16 lines */
#define A200_REMORA_SHARK_SUBSYS_VENDOR 0xA200 /* AFT-REMORA SHARK analog board */
#define A400_REMORA_SHARK_SUBSYS_VENDOR 0xA400 /* AFT-REMORA SHARK analog board */
@ -128,6 +129,7 @@
#define AFT_CHIP_X300 0x0030
#define AFT_CHIP_X400 0x0040
#define AFT_CHIP_X1000 0x0100
#define AFT_CHIP_X1600 0x0160
#define AFT_PCI_MEM_SIZE 0x002FF
#define XILINX_PCI_LATENCY 0x0000FF00

View File

@ -151,6 +151,7 @@ enum {
AFT_ADPTR_B500, /* AFT B500 BRI board */
AFT_ADPTR_W400, /* AFT-W400 (GSM) */
AFT_ADPTR_B610, /* AFT-B610 Single FXS board */
A116_ADPTR_16TE1, /* 16 Channels T1/E1 */
AFT_ADPTR_LAST /* NOTE: Keep it as a last line */
};
#define MAX_ADPTRS AFT_ADPTR_LAST
@ -295,6 +296,7 @@ enum {
(adapter_type == A101_ADPTR_2TE1) ? "AFT-A102" : \
(adapter_type == A104_ADPTR_4TE1) ? "AFT-A104" : \
(adapter_type == A108_ADPTR_8TE1) ? "AFT-A108" : \
(adapter_type == A116_ADPTR_16TE1) ? "AFT-A116" : \
(adapter_type == A300_ADPTR_U_1TE3) ? "AFT-A301" : \
(adapter_type == A200_ADPTR_ANALOG) ? "AFT-A200" : \
(adapter_type == A400_ADPTR_ANALOG) ? "AFT-A400" : \
@ -358,6 +360,7 @@ enum {
(card_sub_type == A104_4TE1_SUBSYS_VENDOR) ? "A104" : \
(card_sub_type == AFT_4TE1_SHARK_SUBSYS_VENDOR) ? "A104D" : \
(card_sub_type == AFT_8TE1_SHARK_SUBSYS_VENDOR) ? "A108D" : \
(card_sub_type == AFT_16TE1_SHARK_SUBSYS_VENDOR) ? "A116D" : \
(card_sub_type == AFT_ADPTR_FLEXBRI) ? "B700" : \
(card_sub_type == A200_REMORA_SHARK_SUBSYS_VENDOR)? "A200" : "Unknown"

View File

@ -154,9 +154,10 @@ enum {
(card_type == WANOPT_AFT101 || \
card_type == WANOPT_AFT102 || \
card_type == WANOPT_AFT104 || \
card_type == WANOPT_AFT108) ? "A101/1D/A102/2D/4/4D/8" : \
card_type == WANOPT_AFT108 || \
card_type == WANOPT_AFT116) ? "A101/1D/2/2D/4/4D/8/8D/16/16D" : \
(card_type == WANOPT_AFT300) ? "A300" : \
(card_type == WANOPT_AFT_ANALOG) ? "A200/A400/B600/B700/B800" : \
(card_type == WANOPT_AFT_ANALOG) ? "A200/A400/B600/B700/B800/B610" : \
(card_type == WANOPT_AFT_GSM) ? "W400" : \
(card_type == WANOPT_AFT_ISDN) ? "A500/B700/B500" : \
(card_type == WANOPT_AFT_56K) ? "A056" : \

View File

@ -106,6 +106,7 @@ enum {
#define WANOPT_AFT601 17
#define WANOPT_AFT_GSM 18
#define WANOPT_AFT610 19
#define WANOPT_AFT116 20
/*
* Configuration options defines.

View File

@ -10,14 +10,14 @@
#define WANPIPE_COMPANY "Sangoma Technologies Inc"
/********** LINUX **********/
#define WANPIPE_VERSION "3.5.27"
#define WANPIPE_VERSION "3.5.28"
#define WANPIPE_SUB_VERSION "0"
#define WANPIPE_LITE_VERSION "1.1.1"
#if defined(__LINUX__)
#define WANPIPE_VERSION_MAJOR 3
#define WANPIPE_VERSION_MINOR 5
#define WANPIPE_VERSION_MINOR1 27
#define WANPIPE_VERSION_MINOR1 28
#define WANPIPE_VERSION_MINOR2 0
#endif

View File

@ -899,6 +899,7 @@ int wp_aft_te1_init (sdla_t* card, wandev_conf_t* conf)
case A104_ADPTR_4TE1: /* Quad line T1/E1 */
case A104_ADPTR_4TE1_PCIX: /* Quad line T1/E1 PCI Express */
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
case AFT_ADPTR_B601:
break;
default:
@ -1416,6 +1417,10 @@ static int wan_aft_init (sdla_t *card, wandev_conf_t* conf)
wan_set_bit(AFT_TDM_FE_SYNC_CNT,&card->u.aft.chip_cfg_status);
}
if (card->adptr_type == A116_ADPTR_16TE1) {
wan_set_bit(AFT_TDM_GLOBAL_ISR,&card->u.aft.chip_cfg_status);
wan_set_bit(AFT_TDM_RING_BUF,&card->u.aft.chip_cfg_status);
}
} else {
if ((card->adptr_type == A104_ADPTR_4TE1 &&
@ -1991,7 +1996,12 @@ static int new_if_private (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t*
if (IS_B601_CARD(card) && chan->mtu > 16) {
chan->mtu=8;
}
/* Analog only supports 8 & 16 bytes hw chunk size */
if (card->wandev.config_id == WANCONFIG_AFT_ANALOG && chan->mtu > 16) {
chan->mtu=8;
}
if (chan->mtu % 8 != 0) {
DEBUG_ERROR("%s:%s: Error: MTU %d is not 8 byte aligned!\n",
card->devname, chan->if_name, chan->mtu);
@ -2049,7 +2059,11 @@ static int new_if_private (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t*
if (chan->cfg.seven_bit_hdlc || IS_B601_CARD(card) || chan->cfg.sw_hdlc) {
chan->sw_hdlc_mode=1;
}
if (card->wandev.config_id == WANCONFIG_AFT_ANALOG && chan->mtu > 16) {
chan->mtu=8;
}
} else {
@ -6885,6 +6899,8 @@ static u32 aft_master_dev=0xF;
static int gdma_cnt=0;
#endif
static int aft_spurrious=0;
#define EC_IRQ_TIMEOUT (HZ/32)
static WAN_IRQ_RETVAL wp_aft_global_isr (sdla_t* card)
@ -7112,6 +7128,7 @@ if (1){
}
}
aft_spurrious=0;
/* Pass Through */
} else {
@ -7119,9 +7136,19 @@ if (1){
AFT_PERF_STAT_INC(card,isr,non_aft);
}
if (IS_SERIAL_CARD(card)) {
aft_spurrious++;
if (aft_spurrious > 1000) {
aft_spurrious=0;
DEBUG_ERROR("%s: Error: Wanpipe serial card acking spurrious interrtup\n",card->devname);
WAN_IRQ_RETVAL_SET(irq_ret, WAN_IRQ_HANDLED);
}
}
/* No more interrupts for us */
goto aft_global_isr_exit;
}
aft_spurrious=0;
if (IS_GSM_CARD(card)) {
/* All ports within the card share the same port */

View File

@ -2477,21 +2477,18 @@ static int sdla_ds_te1_rbs_ctrl(sdla_fe_t* fe, u_int32_t ch_map, int enable)
u_int8_t value;
unsigned int ch, bit, off;
value = READ_REG(REG_TCR1);
if (IS_T1_FEMEDIA(fe)){
value = READ_REG(REG_TCR1);
if (enable == WAN_TRUE){
value |= BIT_TCR1_T1_TSSE;
}else{
value &= ~BIT_TCR1_T1_TSSE;
}
WRITE_REG(REG_TCR1, value);
}else{
if (enable == WAN_TRUE){
value |= BIT_TCR1_E1_T16S;
}else{
value &= ~BIT_TCR1_E1_T16S;
}
WAN_TE1_SIG_MODE(fe) = WAN_TE1_SIG_CAS;
sdla_ds_e1_set_sig_mode(fe,1);
}
WRITE_REG(REG_TCR1, value);
for(ch = 1; ch <= fe->te_param.max_channels; ch++){
if (!wan_test_bit(ch, &ch_map)){
@ -2515,6 +2512,7 @@ static int sdla_ds_te1_rbs_ctrl(sdla_fe_t* fe, u_int32_t ch_map, int enable)
fe->name, ch, REG_SSIE1+off, value);
WRITE_REG(REG_SSIE1+off, value);
}
return 0;
}

View File

@ -499,6 +499,9 @@ static int wp_tdmv_create(void* pcard, wan_tdmv_conf_t *tdmv_conf)
case A108_ADPTR_8TE1:
WP_DAHDI_SET_STR_INFO(wp,devicetype, "A108");
break;
case A116_ADPTR_16TE1:
WP_DAHDI_SET_STR_INFO(wp,devicetype, "A116");
break;
case AFT_ADPTR_B601:
WP_DAHDI_SET_STR_INFO(wp,devicetype, "B601");
break;
@ -1024,7 +1027,7 @@ static void wp_tdmv_report_alarms(void* pcard, uint32_t te_alarm)
/*
** if (wp->alarmtimer)
** alarms |= ZT_ALARM_RECOVER; */
if (te_alarm & WAN_TE_BIT_ALARM_YEL)
if (te_alarm & WAN_TE_BIT_ALARM_YEL || te_alarm & WAN_TE_BIT_ALARM_RAI)
alarms |= ZT_ALARM_YELLOW;
wp->span.alarms = alarms;

View File

@ -985,7 +985,8 @@ sdla_save_hw_probe (sdlahw_t* hw, int port)
break;
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
if (hwcpu->hwcard->adptr_subtype == AFT_SUBTYPE_SHARK){
SDLA_PROBE_SPRINT(hwprobe->hw_info,
sizeof(hwprobe->hw_info),
@ -2405,7 +2406,8 @@ int sdla_get_hw_info(sdlahw_t* hw)
case A101_ADPTR_1TE1:
case A101_ADPTR_2TE1:
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
/* Enable memory access */
sdla_bus_read_4(hw, SDLA_REG_OFF(hwcard, SDLA_REG_OFF(hwcard, AFT_CHIP_CFG_REG)), &reg1);
reg = reg1;
@ -2951,7 +2953,7 @@ static int sdla_aft_hw_select (sdlahw_card_t* hwcard, int cpu_no, int irq, void*
hwcard->u_pci.bus_no, hwcard->u_pci.slot_no, irq);
break;
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
hwcard->cfg_type = WANOPT_AFT108;
sdla_adapter_cnt.aft108_adapters++;
if ((hwcpu = sdla_hwcpu_register(hwcard, cpu_no, irq, dev)) == NULL){
@ -2972,6 +2974,27 @@ static int sdla_aft_hw_select (sdlahw_card_t* hwcard, int cpu_no, int irq, void*
hwcard->u_pci.bus_no, hwcard->u_pci.slot_no, irq);
break;
case A116_ADPTR_16TE1:
hwcard->cfg_type = WANOPT_AFT108;
sdla_adapter_cnt.aft116_adapters++;
if ((hwcpu = sdla_hwcpu_register(hwcard, cpu_no, irq, dev)) == NULL){
return 0;
}
if ((hw = sdla_hwdev_te1_register(hwcpu, 0, 8)) == NULL){
sdla_hwcpu_unregister(hwcpu);
return 0;
}
number_of_cards += 8;
DEBUG_EVENT(
"%s: %s %s T1/E1 card found (%s rev.%X), cpu(s) 1, line(s) 8, bus #%d, slot #%d, irq #%d\n",
wan_drvname,
hwcard->adptr_name,
AFT_PCITYPE_DECODE(hwcard),
AFT_CORE_ID_DECODE(hwcard->core_id),
hwcard->core_rev,
hwcard->u_pci.bus_no, hwcard->u_pci.slot_no, irq);
break;
case A300_ADPTR_U_1TE3:
hwcard->cfg_type = WANOPT_AFT300;
sdla_adapter_cnt.aft300_adapters++;
@ -3470,6 +3493,10 @@ sdla_pci_probe_aft(sdlahw_t *hw, int bus_no, int slot_no, int irq)
hwcard->adptr_type = A108_ADPTR_8TE1;
hwcard->adptr_subtype = AFT_SUBTYPE_SHARK;
break;
case AFT_16TE1_SHARK_SUBSYS_VENDOR:
hwcard->adptr_type = A116_ADPTR_16TE1;
hwcard->adptr_subtype = AFT_SUBTYPE_SHARK;
break;
case A300_UTE3_SHARK_SUBSYS_VENDOR:
hwcard->adptr_type = A300_ADPTR_U_1TE3;
hwcard->adptr_subtype = AFT_SUBTYPE_SHARK;
@ -3559,6 +3586,7 @@ sdla_pci_probe_aft(sdlahw_t *hw, int bus_no, int slot_no, int irq)
case AFT_2TE1_SHARK_SUBSYS_VENDOR:
case AFT_4TE1_SHARK_SUBSYS_VENDOR:
case AFT_8TE1_SHARK_SUBSYS_VENDOR:
case AFT_16TE1_SHARK_SUBSYS_VENDOR:
case AFT_ISDN_BRI_SHARK_SUBSYS_VENDOR:
case B500_SHARK_SUBSYS_VENDOR:
case AFT_56K_SHARK_SUBSYS_VENDOR:
@ -5148,7 +5176,8 @@ void* sdla_register(sdlahw_iface_t* hw_iface, wandev_conf_t* conf, char* devname
}
break;
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
hw_iface->fe_read = sdla_shark_te1_read_fe;
hw_iface->__fe_read = __sdla_shark_te1_read_fe;
hw_iface->fe_write = sdla_shark_te1_write_fe;
@ -5238,7 +5267,8 @@ void* sdla_register(sdlahw_iface_t* hw_iface, wandev_conf_t* conf, char* devname
case A101_ADPTR_1TE1:
case A101_ADPTR_2TE1:
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
case A200_ADPTR_ANALOG:
case A400_ADPTR_ANALOG:
case AFT_ADPTR_ISDN:
@ -5743,7 +5773,8 @@ static int sdla_setup (void* phw, wandev_conf_t* conf)
case A101_ADPTR_1TE1:
case A101_ADPTR_2TE1:
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
case A200_ADPTR_ANALOG:
case A400_ADPTR_ANALOG:
case AFT_ADPTR_ISDN:
@ -6440,7 +6471,8 @@ static int sdla_down (void* phw)
case A101_ADPTR_1TE1:
case A101_ADPTR_2TE1:
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
case A200_ADPTR_ANALOG:
case A400_ADPTR_ANALOG:
case AFT_ADPTR_ISDN:
@ -8277,7 +8309,8 @@ static int sdla_memory_map(sdlahw_t* hw)
case AFT_ADPTR_4SERIAL_V35X21:
case AFT_ADPTR_2SERIAL_RS232:
case AFT_ADPTR_4SERIAL_RS232:
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
hwcpu->memory = AFT8_PCI_MEM_SIZE;
break;
case AFT_ADPTR_56K:
@ -8908,7 +8941,8 @@ adapter_found:
conf->fe_cfg.line_no--;
conf->comm_port = 0;
break;
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
if (conf->fe_cfg.line_no < 1 || conf->fe_cfg.line_no > 8){
DEBUG_ERROR("%s: Error, Invalid T1/E1 port selected %d (Min=1 Max=8)\n",
devname, conf->fe_cfg.line_no);
@ -8991,7 +9025,8 @@ adapter_found:
}
break;
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
DEBUG_EVENT(
"%s: Error, %s resources busy: (bus #%d, slot #%d, cpu %c, line %d)\n",
devname,
@ -9204,7 +9239,8 @@ static int sdla_is_te1(void* phw)
case A101_ADPTR_1TE1:
case A101_ADPTR_2TE1:
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
return 0;
}
return -EINVAL;
@ -11219,7 +11255,8 @@ static int sdla_hw_read_cpld(void *phw, u16 off, u8 *data)
case A101_ADPTR_1TE1:
case A101_ADPTR_2TE1:
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
off &= ~AFT8_BIT_DEV_ADDR_CLEAR;
off |= AFT8_BIT_DEV_ADDR_CPLD;
@ -11384,8 +11421,9 @@ static int sdla_hw_write_cpld(void *phw, u16 off, u8 data)
switch(hwcard->adptr_type){
case A101_ADPTR_1TE1:
case A101_ADPTR_2TE1:
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
off &= ~AFT8_BIT_DEV_ADDR_CLEAR;
off |= AFT8_BIT_DEV_ADDR_CPLD;
/* Save current original address */

View File

@ -874,12 +874,15 @@ static int probe_get_info(char* buf, char** start, off_t offs, int len, int dumm
if (hw_cnt->aft_b610_adapters){
PROC_ADD_LINE(m, "B610=%d ", hw_cnt->aft_b610_adapters);
}
if (hw_cnt->aft_b800_adapters){
PROC_ADD_LINE(m, "B800=%d ", hw_cnt->aft_b800_adapters);
}
if (hw_cnt->aft_w400_adapters){
PROC_ADD_LINE(m, "W400=%d ", hw_cnt->aft_w400_adapters);
}
if (hw_cnt->aft_b800_adapters){
PROC_ADD_LINE(m, "B800=%d ", hw_cnt->aft_b800_adapters);
}
if (hw_cnt->aft_w400_adapters){
PROC_ADD_LINE(m, "W400=%d ", hw_cnt->aft_w400_adapters);
}
if (hw_cnt->aft116_adapters){
PROC_ADD_LINE(m, "A116=%d ", hw_cnt->aft116_adapters);
}
PROC_ADD_LINE(m, "\n");
PROC_ADD_RET(m);
@ -921,7 +924,7 @@ static int probe_get_info_legacy(char* buf, char** start, off_t offs, int len, i
hw_cnt=(sdla_hw_type_cnt_t*)sdla_get_hw_adptr_cnt();
PROC_ADD_LINE(m,
"\nCard Cnt: S508=%d S514X=%d S518=%d A101-2=%d A104=%d A300=%d A200=%d A108=%d A056=%d\n A500=%d A14x=%d A600=%d B601=%d\n",
"\nCard Cnt: S508=%d S514X=%d S518=%d A101-2=%d A104=%d A300=%d A200=%d A108=%d A056=%d\n A500=%d A14x=%d A600=%d B601=%d A116=%d\n",
hw_cnt->s508_adapters,
hw_cnt->s514x_adapters,
hw_cnt->s518_adapters,
@ -934,7 +937,8 @@ static int probe_get_info_legacy(char* buf, char** start, off_t offs, int len, i
hw_cnt->aft_isdn_adapters,
hw_cnt->aft_serial_adapters,
hw_cnt->aft_a600_adapters,
hw_cnt->aft_b601_adapters
hw_cnt->aft_b601_adapters,
hw_cnt->aft116_adapters
);
PROC_ADD_RET(m);
@ -1043,12 +1047,15 @@ static int probe_get_info_verbose(char* buf, char** start, off_t offs, int len,
if (hw_cnt->aft_b601_adapters){
PROC_ADD_LINE(m, "B601=%d ", hw_cnt->aft_b601_adapters);
}
if (hw_cnt->aft_b800_adapters){
PROC_ADD_LINE(m, "B800=%d ", hw_cnt->aft_b800_adapters);
}
if (hw_cnt->aft_w400_adapters){
PROC_ADD_LINE(m, "W400=%d ", hw_cnt->aft_w400_adapters);
}
if (hw_cnt->aft_b800_adapters){
PROC_ADD_LINE(m, "B800=%d ", hw_cnt->aft_b800_adapters);
}
if (hw_cnt->aft_w400_adapters){
PROC_ADD_LINE(m, "W400=%d ", hw_cnt->aft_w400_adapters);
}
if (hw_cnt->aft116_adapters){
PROC_ADD_LINE(m, "A116=%d ", hw_cnt->aft116_adapters);
}
PROC_ADD_LINE(m, "\n");
PROC_ADD_RET(m);
@ -1102,7 +1109,7 @@ static int probe_get_info_dump(char* buf, char** start, off_t offs, int len, int
hw_cnt=(sdla_hw_type_cnt_t*)sdla_get_hw_adptr_cnt();
PROC_ADD_LINE(m,
"|Card Cnt|S508=%d|S514X=%d|S518=%d|A101-2=%d|A104=%d|A300=%d|A200=%d|A108=%d|A056=%d|A500=%d|B700=%d|B600=%d|B601=%d|A14x=%d\n",
"|Card Cnt|S508=%d|S514X=%d|S518=%d|A101-2=%d|A104=%d|A300=%d|A200=%d|A108=%d|A056=%d|A500=%d|B700=%d|B600=%d|B601=%d|A14x=%d|A116=%d|W400=%d|\n",
hw_cnt->s508_adapters,
hw_cnt->s514x_adapters,
hw_cnt->s518_adapters,
@ -1116,8 +1123,9 @@ static int probe_get_info_dump(char* buf, char** start, off_t offs, int len, int
hw_cnt->aft_a700_adapters,
hw_cnt->aft_a600_adapters,
hw_cnt->aft_b601_adapters,
hw_cnt->aft_serial_adapters
);
hw_cnt->aft_serial_adapters,
hw_cnt->aft116_adapters,
hw_cnt->aft_w400_adapters);
PROC_ADD_RET(m);
}

View File

@ -1,6 +1,6 @@
%define WANPIPE_VER wanpipe-modules
%define name %{WANPIPE_VER}
%define version 3.5.27
%define version 3.5.28
%define release 0
%define serial 1
%define MODULES_DIR /lib/modules
@ -59,6 +59,12 @@ fi
%changelog
* Thu Aug 10 2012 Nenad Corbic <ncorbic@sangoma.com> - 3.5.28
==================================================================
- Added A116 card support
- Minor fixes for R2 CAS for NBE
* Thu May 6 2012 Nenad Corbic <ncorbic@sangoma.com> - 3.5.27
==================================================================

View File

@ -1,6 +1,6 @@
%define WANPIPE_VER wanpipe-util
%define name %{WANPIPE_VER}
%define version 3.5.27
%define version 3.5.28
%define release 0
%define serial 1
%define UTILS_DIR /usr/sbin
@ -229,6 +229,12 @@ chmod 755 /usr/local/sbin/setup-sangoma
%changelog
* Thu Aug 10 2012 Nenad Corbic <ncorbic@sangoma.com> - 3.5.28
==================================================================
- Added A116 card support
- Minor fixes for R2 CAS for NBE
* Thu May 6 2012 Nenad Corbic <ncorbic@sangoma.com> - 3.5.27
==================================================================

View File

@ -1,7 +1,7 @@
%define KERNEL_VERSION %{?kern_ver}
%define WANPIPE_VER wanpipe
%define name %{WANPIPE_VER}
%define version 3.5.27
%define version 3.5.28
%define release 0
%define serial 1
%define UTILS_DIR /usr/sbin
@ -246,6 +246,12 @@ chmod 755 /usr/local/sbin/setup-sangoma
%changelog
* Thu Aug 10 2012 Nenad Corbic <ncorbic@sangoma.com> - 3.5.28
==================================================================
- Added A116 card support
- Minor fixes for R2 CAS for NBE
* Thu May 6 2012 Nenad Corbic <ncorbic@sangoma.com> - 3.5.27
==================================================================

View File

@ -2228,7 +2228,7 @@ init_global_params()
{
if [ $OSYSTEM = "Linux" ]; then
ROUTER_VERSION=3.5.27
ROUTER_VERSION=3.5.28
IFCONFIG_LIST=ifconfig
MODULE_STAT=lsmod
WAN_DRIVERS="wanpipe"

View File

@ -36,7 +36,7 @@ all: ncurses \
lxdialog: $(OBJS)
ncurses:
@x=`find $(ASTBROOT)/lib/ /lib/ /usr/lib/ /usr/lib64/ /usr/local/lib/ -maxdepth 1 -name 'libncurses.*' 2> /dev/null` ;\
@x=`find $(ASTBROOT)/lib/ /lib/ /usr/lib/ /usr/lib64/ /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu /usr/local/lib/ -maxdepth 1 -name 'libncurses.*' 2> /dev/null` ;\
if [ ! "$$x" ]; then \
echo -e "\007" ;\
echo ">> Unable to find the Ncurses libraries." ;\

Binary file not shown.

View File

@ -34,10 +34,11 @@ ifndef WANINCDIR
endif
# Tools options.
SRCS = wan_aftup.c wan_aft_prg.c wan_aft_flash.c wan_aft_flash_shark.c wan_aft_flash_shark_ds.c
SRCS = wan_aftup.c wan_aft_prg.c wan_aft_flash.c wan_aft_flash_shark.c wan_aft_flash_shark_116.c
#wan_aft_flash_shark_ds.c wan_aft_flash_shark_116.c
SRCS += wan_pcie_ctrl.c wan_pcie_ctrl_plx.c wan_pcie_ctrl_tundra.c wan_aft_flash_a600.c
SRC2 += wan_usb_fwupdate.cpp mem.cpp
CFLAGS = -Wall -O2 -D$(OS_TYPE) -D_DEBUG_=$(DEBUG)
CFLAGS = -Wall -O0 -D$(OS_TYPE) -D_DEBUG_=$(DEBUG)
CFLAGS += $(EXTRA_FLAGS)
CFLAGS += -I/usr/include -I$(WANINCDIR) -I$(SYSINC)
@ -82,3 +83,4 @@ uninstall:
clean:
rm -f $(PROD)
rm -f *.o

View File

@ -0,0 +1,11 @@
VENDOR_ID:0x10B5
DEVICE_ID:0x8111
FORMAT:0x01
[0x0048] 0x000E2C11
[0x100C] 0x0BFE8010
[0x0010] 0x00000008
[0x000C] 0x0001FE00
[0x1048] 0x00050020
[0x000C] 0x0001FE00

View File

@ -96,9 +96,6 @@ aftup_flash_iface_t aftup_flash_iface =
aft_erase_flash_sector
};
aftup_flash_t aft_flash = { 0x014F, AFT_CORE_SIZE };
aftup_flash_t aft4_flash = { 0x2053, AFT_CORE_SIZE };
struct {
unsigned long start_addr;
unsigned long start_off;

View File

@ -0,0 +1,427 @@
#include <stdlib.h>
#include <stdio.h>
#if !defined(__WINDOWS__)
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <netinet/in.h>
#endif
#if defined(__LINUX__)
# include <linux/if.h>
# include <linux/types.h>
# include <linux/if_packet.h>
# include <linux/wanpipe_defines.h>
# include <linux/sdlasfm.h>
# include <linux/wanpipe_cfg.h>
#elif defined(__WINDOWS__)
# include <windows.h>
# include <winioctl.h>
# include <conio.h>
# include <stddef.h> /* offsetof() */
# include <string.h>
# include "wanpipe_includes.h"
# include "wanpipe_common.h"
# include "wanpipe_time.h" /* wp_usleep() */
# include "sdlasfm.h"
# include "sdlapci.h"
#else
# include <net/if.h>
# include <wanpipe_defines.h>
# include <sdlasfm.h>
# include <wanpipe_cfg.h>
#endif
#include "wan_aft_prg.h"
#define MASK_DEF_SECTOR_FLASH 0x00
#define MASK_USER_SECTOR_FLASH 0x08
/* Manufacturer code */
#define MCODE_ST 0x20
/* Device code */
#define DCODE_M29W040B 0xE3
#define DCODE_M29W800DT 0xD7
#define DCODE_M29W800DB 0x5B
#define M29W800DT_FID 0
#define M29W800DB_FID 1
struct {
unsigned long start_addr;
unsigned long start_off;
unsigned long len;
unsigned int sector_type;
} aft_shark_flash_spec_116 [2][19] =
{
{
{ 0x00000, 0x00000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x10000, 0x10000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x20000, 0x20000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x30000, 0x30000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x40000, 0x40000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x50000, 0x50000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x60000, 0x60000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x70000, 0x70000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x80000, 0x00000, 0xFFFF, USER_SECTOR_FLASH },
{ 0x90000, 0x10000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xA0000, 0x20000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xB0000, 0x30000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xC0000, 0x40000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xD0000, 0x50000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xE0000, 0x60000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xF0000, 0x70000, 0x7FFF, USER_SECTOR_FLASH },
{ 0xF8000, 0x78000, 0x1FFF, USER_SECTOR_FLASH },
{ 0xFA000, 0x7A000, 0x1FFF, USER_SECTOR_FLASH },
{ 0xFC000, 0x7C000, 0x3FFF, USER_SECTOR_FLASH },
},
{
{ 0x00000, 0x00000, 0x3FFF, DEF_SECTOR_FLASH },
{ 0x04000, 0x40000, 0x1FFF, DEF_SECTOR_FLASH },
{ 0x06000, 0x60000, 0x1FFF, DEF_SECTOR_FLASH },
{ 0x08000, 0x80000, 0x7FFF, DEF_SECTOR_FLASH },
{ 0x10000, 0x10000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x20000, 0x20000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x30000, 0x30000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x40000, 0x40000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x50000, 0x50000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x60000, 0x60000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x70000, 0x70000, 0xFFFF, DEF_SECTOR_FLASH },
{ 0x80000, 0x00000, 0xFFFF, USER_SECTOR_FLASH },
{ 0x90000, 0x10000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xA0000, 0x20000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xB0000, 0x30000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xC0000, 0x40000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xD0000, 0x50000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xE0000, 0x60000, 0xFFFF, USER_SECTOR_FLASH },
{ 0xF0000, 0x70000, 0xFFFF, USER_SECTOR_FLASH },
}
};
aftup_flash_t aft_shark_flash_116 = { 0x014F, AFT_CORE_X1600_SIZE };
extern int verbose;
extern int progress_bar(char*,int,int);
/*
******************************************************************************
FUNCTION PROTOTYPES
******************************************************************************
*/
extern int exec_read_cmd(void*,unsigned int, unsigned int, unsigned int*);
extern int exec_write_cmd(void*,unsigned int, unsigned int, unsigned int);
extern void hit_any_key(void);
static int aft_reset_flash_shark(wan_aft_cpld_t *cpld);
static int aft_is_protected_shark(wan_aft_cpld_t *cpld, int stype);
static int aft_flash_id_shark(wan_aft_cpld_t *cpld, int mtype, int stype, int *flash_id);
static int aft_reload_flash_shark(wan_aft_cpld_t *cpld, int sector_type);
static int aft_write_flash_shark(wan_aft_cpld_t*,int, unsigned long,unsigned char*);
static int aft_read_flash_shark(wan_aft_cpld_t*,int,int,unsigned long, unsigned char**);
static unsigned char aft_read_flash_byte_shark(wan_aft_cpld_t*,int,int,unsigned long);
static int aft_erase_flash_shark(wan_aft_cpld_t*,int,int);
aftup_flash_iface_t aftup_shark_flash_116_iface =
{
aft_reset_flash_shark,
aft_is_protected_shark,
aft_flash_id_shark,
aft_reload_flash_shark,
aft_write_flash_shark,
aft_read_flash_shark,
aft_erase_flash_shark
};
/******************************************************************************
* FUNCTION DEFINITION
******************************************************************************/
static unsigned short get_cpld_off(int adptr_type, unsigned short cpld_off)
{
switch(adptr_type){
case A300_ADPTR_U_1TE3:
cpld_off &= ~AFT_BIT_DEV_ADDR_CLEAR;
cpld_off |= AFT_BIT_DEV_ADDR_CPLD;
break;
case AFT_ADPTR_56K:
cpld_off &= ~AFT8_BIT_DEV_ADDR_CLEAR;
cpld_off |= AFT8_BIT_DEV_ADDR_CPLD;
break;
default:
cpld_off |= AFT4_BIT_DEV_ADDR_CPLD;
break;
}
return cpld_off;
}
static unsigned int
write_cpld(wan_aft_cpld_t *cpld, unsigned short cpld_off,unsigned short cpld_data)
{
cpld_off = get_cpld_off(cpld->adptr_type, cpld_off);
exec_write_cmd(cpld->private, 0x46, 2, cpld_off);
exec_write_cmd(cpld->private, 0x44, 2, cpld_data);
return 0;
}
static unsigned int
read_cpld(wan_aft_cpld_t *cpld, unsigned short cpld_off)
{
unsigned int cpld_data;
cpld_off = get_cpld_off(cpld->adptr_type, cpld_off);
exec_write_cmd(cpld->private, 0x46, 2, cpld_off);
if (exec_read_cmd(cpld->private, 0x44, 4, &cpld_data) == 0){
return cpld_data;
}else{
return 0;
}
}
static unsigned int
__aft_write_flash_shark_byte(wan_aft_cpld_t *cpld, int stype, int mtype, unsigned long off,unsigned char data)
{
unsigned char offset;
//Writing flash address to cpld
offset = off & 0xFF;
write_cpld(cpld, 0x05, offset);
offset = (off >> 8) & 0xFF;
write_cpld(cpld, 0x06, offset);
offset = (off >> 16) & 0xF;
write_cpld(cpld, 0x07, offset);
write_cpld(cpld, 0x04, data);
write_cpld(cpld, 0x07, 0x00); // disable CS signal for the Boot FLASH/SRAM
return 0;
}
static unsigned int
aft_write_flash_shark_byte(wan_aft_cpld_t *cpld, int stype, int mtype, unsigned long off,unsigned char data)
{
unsigned long sec_off = 0x00;
return __aft_write_flash_shark_byte(cpld, stype, mtype, sec_off + off, data);
}
static unsigned char
__aft_read_flash_byte_shark(wan_aft_cpld_t *cpld, int stype, int mtype, unsigned long off)
{
unsigned char offset;
unsigned char data;
//Writing flash address to cpld
offset = off & 0xFF;
write_cpld(cpld, 0x05, offset);
offset = (off >> 8) & 0xFF;
write_cpld(cpld, 0x06, offset);
offset = (off >> 16) & 0xF;
offset |= MASK_MEMORY_TYPE_FLASH;
write_cpld(cpld, 0x07, offset);
data = read_cpld(cpld, 0x04);
write_cpld(cpld, 0x07, 0x00); // Disable CS for the Boot FLASH/SRAM
return data;
}
static unsigned char
aft_read_flash_byte_shark(wan_aft_cpld_t *cpld, int stype, int mtype, unsigned long off)
{
unsigned long sec_off = 0x00;
return __aft_read_flash_byte_shark(cpld, stype, mtype, sec_off + off);
}
static int
aft_erase_flash_shark(wan_aft_cpld_t *cpld, int stype, int verify)
{
unsigned long offset = 0x00;
unsigned char data = 0x00;
int sector_no = 0;
for(sector_no = 0; sector_no < 19; sector_no++){
offset = aft_shark_flash_spec_116[cpld->flash_index][sector_no].start_addr;
__aft_write_flash_shark_byte(cpld, stype, MEMORY_TYPE_FLASH, 0xAAA, 0xAA);
__aft_write_flash_shark_byte(cpld, stype, MEMORY_TYPE_FLASH, 0x555, 0x55);
__aft_write_flash_shark_byte(cpld, stype, MEMORY_TYPE_FLASH, 0xAAA, 0x80);
__aft_write_flash_shark_byte(cpld, stype, MEMORY_TYPE_FLASH, 0xAAA, 0xAA);
__aft_write_flash_shark_byte(cpld, stype, MEMORY_TYPE_FLASH, 0x555, 0x55);
aft_write_flash_shark_byte(cpld, stype, MEMORY_TYPE_FLASH, offset, 0x30);
do{
data = aft_read_flash_byte_shark(
cpld, stype,
MEMORY_TYPE_FLASH,
offset);
if (data & 0x80){
break;
}else if (data & 0x20){
data = aft_read_flash_byte_shark(
cpld, stype,
MEMORY_TYPE_FLASH,
offset);
if (data & 0x80){
break;
}else{
printf("%s: Failed!\n", __FUNCTION__);
printf("%s: Sector=%d!\n",
__FUNCTION__,
(stype == USER_SECTOR_FLASH) ?
sector_no+4:sector_no);
return -EINVAL;
}
}
} while(1);
progress_bar("\tErasing sectors\t\t\t\t",
sector_no, 19);
}
printf("\r\tErasing sectors\t\t\t\tPassed\n");
if (!verify) return 0;
// Verify that flash is 0xFF
for(offset = 0; offset < 0x100000; offset++){
// for(i=0;i<1000;i++);
data = aft_read_flash_byte_shark(cpld, stype, MEMORY_TYPE_FLASH, offset);
if (data != 0xFF){
printf(" Failed to compare! %05lx -> %02x \n",
offset,data);
return -EINVAL;
}
if ((offset & 0x3FFF) == 0x2000){
progress_bar("\tErasing sectors (verification)\t\t",
offset, 0x100000);
}
}
printf("\r\tErasing sectors (verification)\t\tPassed\n");
return 0;
}
static int
aft_write_flash_shark(wan_aft_cpld_t *cpld, int stype, unsigned long off32, unsigned char* pdata)
{
unsigned char data;
unsigned char data1 = 0x00;
int num_bytes = 1;
int i;
data = *pdata;
__aft_write_flash_shark_byte(cpld, stype, MEMORY_TYPE_FLASH, 0xAAA, 0xAA);
__aft_write_flash_shark_byte(cpld, stype, MEMORY_TYPE_FLASH, 0x555, 0x55);
__aft_write_flash_shark_byte(cpld, stype, MEMORY_TYPE_FLASH, 0xAAA, 0xA0);
aft_write_flash_shark_byte(cpld, stype, MEMORY_TYPE_FLASH, off32, data);
do{
for(i=0;i<1000;i++);
data1 = aft_read_flash_byte_shark(cpld, stype, MEMORY_TYPE_FLASH, off32);
if ((data1 & 0x80) == (data & 0x80)){
break;
}else if (data1 & 0x20){
data1 = aft_read_flash_byte_shark(
cpld, stype,
MEMORY_TYPE_FLASH,
off32);
if ((data1 & 0x80) == (data & 0x80)){
break;
}else{
printf("prg_flash_byte: Failed Addr=(%lX)!\n",
off32);
return -EINVAL;
}
}
} while(1);
return num_bytes;
}
static int
aft_read_flash_shark(wan_aft_cpld_t *cpld, int stype, int mtype, unsigned long off, unsigned char** ppdata)
{
int num_bytes = 1;
unsigned char* pdata = NULL;
unsigned long sec_off = 0x00;
pdata = malloc(num_bytes);
if (pdata == NULL) {
printf("Failed to allocate memory (%s:%d)\n",
__FUNCTION__,__LINE__);
return -ENOMEM;
}
memset(pdata, 0, num_bytes);
*pdata = __aft_read_flash_byte_shark(cpld, stype, mtype, sec_off + off);
*ppdata = pdata;
return num_bytes;
}
static int aft_reset_flash_shark(wan_aft_cpld_t *cpld)
{
__aft_write_flash_shark_byte(cpld, DEF_SECTOR_FLASH, MEMORY_TYPE_FLASH, 0x00, 0xF0);
return 0;
}
static int aft_is_protected_shark(wan_aft_cpld_t *cpld, int stype)
{
return 0;
}
static int aft_flash_id_shark(wan_aft_cpld_t *cpld, int mtype, int stype, int *flash_id)
{
unsigned char man_code, device_code;
aft_reset_flash_shark(cpld);
__aft_write_flash_shark_byte(cpld, stype, mtype, 0xAAA, 0xAA);
__aft_write_flash_shark_byte(cpld, stype, mtype, 0x555, 0x55);
__aft_write_flash_shark_byte(cpld, stype, mtype, 0xAAA, 0x90);
man_code = aft_read_flash_byte_shark(cpld, stype, mtype, 0x00);
if (man_code != MCODE_ST){
printf("The current shark flash is not supported (man id %02X)!\n",
man_code);
return -EINVAL;
}
*flash_id = man_code << 8;
device_code = aft_read_flash_byte_shark(cpld, stype, mtype, 0x02);
switch(device_code){
case DCODE_M29W800DT:
cpld->flash_index = M29W800DT_FID;
break;
case DCODE_M29W800DB:
cpld->flash_index = M29W800DB_FID;
break;
default:
printf("The current flash is not supported (dev id %02X)!\n",
device_code);
return -EINVAL;
break;
}
*flash_id |= device_code;
aft_reset_flash_shark(cpld);
return 0;
}
static int aft_reload_flash_shark(wan_aft_cpld_t *cpld, int sector_type)
{
/* Reload new code in to Xilinx from
** Flash Default sector */
write_cpld(cpld, 0x07,0x80);
return 0;
}

View File

@ -574,6 +574,7 @@ int board_reset(wan_aft_cpld_t *cpld, int clear)
switch(cpld->adptr_type){
case A104_ADPTR_4TE1:
case A108_ADPTR_8TE1:
case A116_ADPTR_16TE1:
if (clear) data &= ~0x06;
else data |= 0x06;
break;
@ -594,6 +595,7 @@ int board_reset(wan_aft_cpld_t *cpld, int clear)
case AFT_2TE1_SHARK_SUBSYS_VENDOR:
case AFT_4TE1_SHARK_SUBSYS_VENDOR:
case AFT_8TE1_SHARK_SUBSYS_VENDOR:
case AFT_16TE1_SHARK_SUBSYS_VENDOR:
switch(cpld->core_info->core_id){
case AFT_PMC_FE_CORE_ID:
switch(cpld->adptr_type){
@ -645,6 +647,7 @@ int board_reset(wan_aft_cpld_t *cpld, int clear)
break;
case AFT_A600_SUBSYS_VENDOR:
case AFT_B601_SUBSYS_VENDOR:
case AFT_B610_SUBSYS_VENDOR:
case AFT_W400_SUBSYS_VENDOR:
if (clear) data &= ~0x06;
else data |= 0x06;

View File

@ -34,6 +34,7 @@
# define AFT_CHIP_X300 0x0030
# define AFT_CHIP_X400 0x0040
# define AFT_CHIP_X1000 0x0100
# define AFT_CHIP_X1600 0x0160
#endif
//#define AFT_CORE_SIZE 234456
@ -45,6 +46,7 @@
#define AFT_CORE_X250_SIZE 169216
#define AFT_CORE_X400_SIZE 212392
#define AFT_CORE_X1000_SIZE 402936
#define AFT_CORE_X1600_SIZE 746212
#define A600_EEPROM_PAGE_SIZE 0x04

View File

@ -119,15 +119,10 @@ int options = 0x00;
static char aft_firmware_force[MAXPATHLEN];
extern aftup_flash_iface_t aftup_flash_iface;
extern aftup_flash_iface_t aftup_shark_flash_116_iface;
extern aftup_flash_iface_t aftup_shark_flash_iface;
extern aftup_flash_iface_t aftup_a600_flash_iface;
extern aftup_flash_t aft_flash;
extern aftup_flash_t aft4_flash;
extern aftup_flash_t aft_shark_flash;
extern aftup_flash_t aft_shark_flash_ds;
extern aftup_flash_t aft_a600_flash;
extern pcie_bridge_iface_t aft_pci_bridge_iface_tundra;
extern pcie_bridge_iface_t aft_pci_bridge_iface_plx;
@ -157,6 +152,8 @@ aft_core_info_t aft_core_table[] = {
"A104dm_0100_V", "A104dm_0100_V*.BIN", AFT_CORE_X1000_SIZE },
{ AFT_8TE1_SHARK_SUBSYS_VENDOR, AFT_CHIP_X1000, AFT_DS_FE_CORE_ID, 0x20, 0x5B,
"A108dm_0100_V", "A108dm_0100_V*.BIN", AFT_CORE_X1000_SIZE },
{ AFT_16TE1_SHARK_SUBSYS_VENDOR, AFT_CHIP_X1600, AFT_DS_FE_CORE_ID, 0x20, 0x5B,
"A116dm_0160_V", "A116dm_0160_V*.BIN", AFT_CORE_X1600_SIZE },
{ A200_REMORA_SHARK_SUBSYS_VENDOR, AFT_CHIP_X400, AFT_ANALOG_FE_CORE_ID, 0x01, 0x4F,
"A200_0040_V", "A200_0040_V*.BIN", AFT_CORE_X400_SIZE },
{ AFT_B800_SUBSYS_VENDOR, AFT_CHIP_X400, AFT_ANALOG_FE_CORE_ID, 0x01, 0x4F,
@ -425,6 +422,9 @@ static int wan_aftup_gettype(wan_aftup_t *aft, char *type)
case A300_ADPTR_U_1TE3:
aft->cpld.iface = &aftup_flash_iface;
break;
case A116_ADPTR_16TE1:
aft->cpld.iface = &aftup_shark_flash_116_iface;
break;
case A200_ADPTR_ANALOG:
case AFT_ADPTR_B800:
case A400_ADPTR_ANALOG:
@ -462,6 +462,10 @@ static int wan_aftup_gettype(wan_aftup_t *aft, char *type)
//strcpy(aft->prefix_fw, "A104");
aft->cpld.adptr_type = A108_ADPTR_8TE1;
aft->cpld.iface = &aftup_flash_iface;
}else if (strncmp(type,"AFT-A116",8) == 0){
//strcpy(aft->prefix_fw, "A104");
aft->cpld.adptr_type = A116_ADPTR_16TE1;
aft->cpld.iface = &aftup_shark_flash_116_iface;
}else if (strncmp(type,"AFT-A300",8) == 0){
//strcpy(aft->prefix_fw, "A301");
aft->cpld.adptr_type = A300_ADPTR_U_1TE3;
@ -506,6 +510,7 @@ static int wan_aftup_gettype(wan_aftup_t *aft, char *type)
aft->cpld.adptr_type = AFT_ADPTR_4SERIAL_RS232;
aft->cpld.iface = &aftup_shark_flash_iface;
}else if (strncmp(type,"AFT-A600",8) == 0 ||
strncmp(type,"AFT-B610",8) == 0 ||
strncmp(type,"AFT-B600",8) == 0){
aft->cpld.adptr_type = AFT_ADPTR_A600;
aft->cpld.iface = &aftup_a600_flash_iface;
@ -892,7 +897,6 @@ static int wan_aftup_update_card(wan_aftup_t *aft)
aft->core_rev = AFT_CORE_REV(tmp);
aft->core_id = AFT_CORE_ID(tmp);
#if 1
err=aft_a200_a400_warning(aft);
if (err) {
goto program_done;
@ -968,6 +972,9 @@ static int wan_aftup_update_card(wan_aftup_t *aft)
case AFT_8TE1_SHARK_SUBSYS_VENDOR:
aft->cpld.iface = &aftup_shark_flash_iface;
break;
case AFT_16TE1_SHARK_SUBSYS_VENDOR:
aft->cpld.iface = &aftup_shark_flash_116_iface;
break;
case A200_REMORA_SHARK_SUBSYS_VENDOR:
aft->cpld.iface = &aftup_shark_flash_iface;
break;
@ -996,6 +1003,7 @@ static int wan_aftup_update_card(wan_aftup_t *aft)
break;
case AFT_A600_SUBSYS_VENDOR:
case AFT_B601_SUBSYS_VENDOR:
case AFT_B610_SUBSYS_VENDOR:
case AFT_W400_SUBSYS_VENDOR:
aft->cpld.iface = &aftup_a600_flash_iface;
break;
@ -1008,60 +1016,6 @@ static int wan_aftup_update_card(wan_aftup_t *aft)
break;
}
#else
switch(aft->cpld.board_id){
case A101_1TE1_SUBSYS_VENDOR:
case A101_2TE1_SUBSYS_VENDOR:
aft->cpld.chip_id = AFT_CHIP_X300;
/* Read revision ID */
exec_read_cmd(aft,
0x08, 1, (unsigned int*)&aft->cpld.adptr_subtype);
if (aft->cpld.adptr_subtype == 0x01){
/* A101/A102 new cards */
strncpy(aft->prefix_fw, "A101N", 5);
aft->cpld.chip_id = AFT_CHIP_X400;
}
aft->cpld.flash = &aft_shark_flash;
break;
case A104_4TE1_SUBSYS_VENDOR:
aft->cpld.chip_id = AFT_CHIP_X400;
aft->cpld.flash = &aft4_flash;
break;
case A300_UTE3_SUBSYS_VENDOR:
case A305_CT3_SUBSYS_VENDOR:
aft->cpld.chip_id = AFT_CHIP_X300;
aft->cpld.flash = &aft_shark_flash;
break;
case AFT_4TE1_SHARK_SUBSYS_VENDOR:
aft->cpld.chip_id = AFT_CHIP_X1000;
aft->cpld.flash = &aft_shark_flash;
break;
case A200_REMORA_SHARK_SUBSYS_VENDOR:
case A400_REMORA_SHARK_SUBSYS_VENDOR:
case AFT_B800_SUBSYS_VENDOR:
aft->cpld.chip_id = AFT_CHIP_X1000;
aft->cpld.flash = &aft_shark_flash;
break;
case AFT_A600_SUBSYS_VENDOR:
case AFT_B601_SUBSYS_VENDOR:
case AFT_W400_SUBSYS_VENDOR:
aft->cpld.chip_id = AFT_CHIP_X250;
aft->cpld.flash = &aft_a600_flash;
break;
case AFT_1TE1_SHARK_SUBSYS_VENDOR:
case AFT_2TE1_SHARK_SUBSYS_VENDOR:
case AFT_8TE1_SHARK_SUBSYS_VENDOR:
case A300_UTE3_SHARK_SUBSYS_VENDOR:
case A305_CTE3_SHARK_SUBSYS_VENDOR:
printf("\n%s: These board are not supported (subvendor_id=%04X)!\n",
aft->if_name,
aft->cpld.board_id);
goto program_done;
break;
}
#endif
if (wan_aftup_program_card(aft)){
printf("\n%s: Failed to re-program flash!\n",
aft->if_name);
@ -1115,6 +1069,7 @@ static int wan_pcie_ctrl(struct wan_aftup_head_t *head)
case AFT_2TE1_SHARK_SUBSYS_VENDOR:
case AFT_4TE1_SHARK_SUBSYS_VENDOR:
case AFT_8TE1_SHARK_SUBSYS_VENDOR:
case AFT_16TE1_SHARK_SUBSYS_VENDOR:
break;
case A200_REMORA_SHARK_SUBSYS_VENDOR:
case A400_REMORA_SHARK_SUBSYS_VENDOR:

View File

@ -42,7 +42,10 @@ CFLAGS = -Wall -O2 -D$(OS_TYPE) -D_DEBUG_=$(DEBUG) -D_GNUC_ -I. -D__LINUX__ -I$
CFLAGS += $(EXTRA_FLAGS)
CFLAGS += -lstdc++
CFLAGS += -lncurses
CFLAGS += -lncurses
#For gcc 4.6 to be added later
#-Wno-write-strings -Wno-unused-but-set-variable -Wno-int-to-pointer-cast
ifeq "${ENABLE_ZAPTEL_PARSER}" "YES"
CFLAGS += -DZAPTEL_PARSER -I$(ZAPINC)

View File

@ -42,7 +42,10 @@ CFLAGS = -Wall -O2 -D$(OS_TYPE) -D_DEBUG_=$(DEBUG) -D_GNUC_ -I. -D__LINUX__ -I$
CFLAGS += $(EXTRA_FLAGS)
CFLAGS += -lstdc++
CFLAGS += -lncurses
CFLAGS += -lncurses
#For gcc 4.6 to be added later
#-Wno-write-strings -Wno-unused-but-set-variable -Wno-int-to-pointer-cast
ifeq "${ENABLE_ZAPTEL_PARSER}" "YES"
CFLAGS += -DZAPTEL_PARSER -I$(ZAPINC)

View File

@ -523,6 +523,7 @@ int menu_hardware_probe::parse_selected_card_line(char *selected_card_line,
//August 11, 2006: added A101/A102 Shark
if( strstr(selected_card_line, "AFT-A104") != NULL ||
strstr(selected_card_line, "AFT-A108") != NULL ||
strstr(selected_card_line, "AFT-A116") != NULL ||
strstr(selected_card_line, "AFT-A101-SH") != NULL ||
strstr(selected_card_line, "AFT-A102-SH") != NULL){

View File

@ -2,7 +2,7 @@
# config-zaptel.pl
# Sangoma Dahdi/Zaptel/TDM API/SMG Configuration Script.
#
# Copyright (c) 2009, Sangoma Technologies Inc.
# Copyright (c) 2009-2012, Sangoma Technologies Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -2864,7 +2864,7 @@ sub config_t1e1{
system('clear');
}
print "---------------------------------------------\n";
print "Configuring T1/E1 cards [A101/A102/A104/A108]\n";
print "Configuring T1/E1 cards [A101/A102/A104/A108/A116]\n";
print "---------------------------------------------\n";
foreach my $dev (@hwprobe) {
@ -2916,6 +2916,7 @@ sub config_t1e1{
$card->card_model eq '102' |
$card->card_model eq '104' |
$card->card_model eq '108' |
$card->card_model eq '116' |
($card->card_model eq '601' && $port eq '2') ){
if (!$first_cfg && $silent==$FALSE) {
system('clear');

View File

@ -301,6 +301,31 @@ static void modem( void )
#endif
}; /* modem */
static int set_bri_loopback(int enable)
{
/*! API command structure used to execute API commands.
This command structure is used with libsangoma library */
wanpipe_api_t wp_api;
int err;
if (tdmv_chan != 1 && tdmv_chan != 2) {
printf("Error: Please specify the channel using -chan option. eg -chan 1 or -chan 2\n");
return -1;
}
if (enable) {
err=sangoma_enable_bri_bchan_loopback(sangoma_fd, &wp_api, tdmv_chan);
} else {
err=sangoma_disable_bri_bchan_loopback(sangoma_fd, &wp_api, tdmv_chan);
}
printf ("BRI Loopback Channel=%i %s: %s\n",tdmv_chan, enable?"Enabled":"Disabled",err?"Failed":"Ok");
return err;
}
int get_if_operational_stats(void)
{
/*! API command structure used to execute API commands.
@ -1397,7 +1422,7 @@ static int aft_gsm_uart_debug(int enable)
return 0;
}
static int aft_gsm_audio_debug()
static int aft_gsm_audio_debug(void)
{
wan_udp.wan_udphdr_command = WAN_GSM_AUDIO_DEBUG;
wan_udp.wan_udphdr_return_code = 0xaa;
@ -1415,7 +1440,7 @@ static int aft_gsm_audio_debug()
return 0;
}
static int aft_gsm_pll_reset()
static int aft_gsm_pll_reset(void)
{
wan_udp.wan_udphdr_command = WAN_GSM_PLL_RESET;
wan_udp.wan_udphdr_return_code = 0xaa;
@ -1433,7 +1458,7 @@ static int aft_gsm_pll_reset()
return 0;
}
static int aft_gsm_power_toggle()
static int aft_gsm_power_toggle(void)
{
wan_udp.wan_udphdr_command = WAN_GSM_POWER_TOGGLE;
wan_udp.wan_udphdr_return_code = 0xaa;
@ -1667,6 +1692,10 @@ int AFTUsage(void)
printf("\t T txd Disable TX (AFT card only)\n");
printf("\t T tx_ais_on Enable AIS Alarm - Maintenance On (AFT card only)\n");
printf("\t T tx_ais_off Disable AIS Alarm - Maintenance Off (AFT card only)\n");
printf("\n");
printf("\t T bri_loop_on Enable BRI Remote Loopback (BRI card only, -chan option to specify bchan 1 or 2\n");
printf("\t T bri_loop_off Disable BRI Remote Loopback (BRI card only, -chan option to specify bchan 1 or 2\n");
printf("\n");
printf("\tFlush Statistics\n");
@ -1692,6 +1721,9 @@ int AFTUsage(void)
printf("\t g adt Toggle (enable/disable) audio debugging (play demo-congrats at the kernel level ignoring audio from user space)\n");
printf("\t g uss Update GSM SIM status\n");
printf("\t g plt Toggle the PCM audio loopback\n");
printf("\tAFT BRI\n");
printf("\t b aloop Enable BRI b-channel loop\n");
printf("\t b dloop Disable BRI b-channel loop\n");
printf("\tAFT Debugging\n");
printf("\t d err Enable RX RBS debugging\n");
printf("\t d drr Disable RX RBS debugging\n");
@ -2162,6 +2194,10 @@ int AFTMain(char *command,int argc, char* argv[])
read_te1_56k_stat(0);
}else if (!strcmp(opt,"af")){
read_te1_56k_stat(1);
}else if (!strcmp(opt,"bri_loop_on")){
set_bri_loopback(1);
}else if (!strcmp(opt,"bri_loop_off")){
set_bri_loopback(0);
}else if (!strcmp(opt,"txe")){
set_fe_tx_mode(WAN_FE_TXMODE_ENABLE);
}else if (!strcmp(opt,"txd")){

View File

@ -972,8 +972,7 @@ static int init(int argc, char *argv[], char* command)
dahdi_monitor=1;
wan_protocol = WANCONFIG_ZAP;
}else if (!strcmp(argv[i],"-tdmvchan")){
#ifdef WANPIPEMON_ZAP
}else if (!strcmp(argv[i],"-tdmvchan") || !strcmp(argv[i],"-chan")){
if (i+1 > argc-1){
printf("ERROR: No Zap channel specified! i.e. '-zapchan 1'\n");
return WAN_FALSE;
@ -983,7 +982,6 @@ static int init(int argc, char *argv[], char* command)
argv[i+1]);
return WAN_FALSE;
}
#endif
}else if (!strcmp(argv[i],"-u")){
if (i+1 > argc-1){

View File

@ -139,6 +139,8 @@ extern char pcap_output_file_name[];
extern int trace_binary;
extern FILE * trace_bin_in;
extern FILE * trace_bin_out;
extern int tdmv_chan;
#define MAX_CMD_ARG 10

View File

@ -25,7 +25,7 @@
#
%define NAME wanpipe
%define VERSION 3.5.27
%define VERSION 3.5.28
%define RELEASE 0
%define KVERSION %{?kernel}
%define KSRC %{?ksrc}
@ -259,6 +259,12 @@ fi
%changelog
* Thu Aug 10 2012 Nenad Corbic <ncorbic@sangoma.com> - 3.5.28
==================================================================
- Added A116 card support
- Minor fixes for R2 CAS for NBE
* Thu May 6 2012 Nenad Corbic <ncorbic@sangoma.com> - 3.5.27
==================================================================