diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/ChangeLog.stable wanpipe-3.2.4.p6/ChangeLog.stable --- wanpipe-3.2.2/ChangeLog.stable 2008-01-18 17:54:49.000000000 -0500 +++ wanpipe-3.2.4.p6/ChangeLog.stable 2008-02-07 18:16:15.000000000 -0500 @@ -7,6 +7,38 @@ Copyright (c) 1995-2008 Sangoma Technologies Inc. ------------------------------------------------------------------------------ + +* Thu Feb 1 2008 Nenad Corbic - Stable - 3.2.4 +======================================================================== + +- AFT IRQ Throttling feature + This feature is use to protect the server from + terrible lines. In some cases a bad hdlc line can + cause thousands of interrupts per sec. Rx errors are now + throttled so that system does not get compromized. + +- AFT RTP TAP Feature + RTP TAP Feature allows user to tap voice channels during + Asterisk-Zaptel/TMD API operation at the driver/kernel level. + Each voice stream is encapsulated in UDP/RTP header and transmitted over + neghbouring ethernet address directly from kenrel space. + Tapping 4E1s worth of voice channels adds estra 2% system load :) + http://wiki.sangoma.com/wanpipe-voice-rtp-tap + +- AFT Software Ring Buffers on A200/A400 Analog Cards + This feature improves analog preformance under Asterisk/TDM API + mode. In particualr it improves faxing reliability and + minimizes frame slippage due to system load or bad incoming + clock from the line. + Note: All AFT T1/E1 cards have this feature in hardare :) + + +* Thu Jan 18 2008 Nenad Corbic - Stable - 3.2.3 +======================================================================== + +- No changes from 3.2.2 + Version updated for versioning sake. + * Thu Jan 18 2008 Nenad Corbic - Stable - 3.2.2 ======================================================================== diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/deb_control/wanpipe.deb wanpipe-3.2.4.p6/deb_control/wanpipe.deb --- wanpipe-3.2.2/deb_control/wanpipe.deb 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/deb_control/wanpipe.deb 2008-02-15 16:51:33.000000000 -0500 @@ -1,5 +1,5 @@ Package: wanpipe -Version: 3.2.2-0 +Version: 3.2.4.p6-0 Section: networking Priority: optional Architecture: all Only in wanpipe-3.2.4.p6/firmware: wan_aftup diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/sdla_adsl.h wanpipe-3.2.4.p6/patches/kdrivers/include/sdla_adsl.h --- wanpipe-3.2.2/patches/kdrivers/include/sdla_adsl.h 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/sdla_adsl.h 2008-01-22 16:20:40.000000000 -0500 @@ -84,7 +84,7 @@ unsigned char remote_eth_addr[6]; unsigned long router_start_time; unsigned long router_up_time; - unsigned int trace_timeout; + unsigned long trace_timeout; #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) struct ifmedia media; /* media information */ #endif @@ -95,7 +95,7 @@ { unsigned long tracing_enabled; wan_skb_queue_t trace_queue; - unsigned int trace_timeout; + unsigned long trace_timeout; unsigned int max_trace_queue; } adsl_trace_info_t; diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/sdla_aft_te1.h wanpipe-3.2.4.p6/patches/kdrivers/include/sdla_aft_te1.h --- wanpipe-3.2.2/patches/kdrivers/include/sdla_aft_te1.h 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/sdla_aft_te1.h 2008-02-08 12:12:57.000000000 -0500 @@ -1374,6 +1374,9 @@ #define AFT_MIN_ANALOG_FRMW_VER 0x05 + + + typedef struct aft_dma_chain { unsigned long init; @@ -1408,6 +1411,21 @@ #define AFT_DMA_INDEX_OFFSET 0x200 +typedef struct aft_dma_ring +{ + unsigned char rxdata[128]; + unsigned char txdata[128]; +}aft_dma_ring_t; + +#define AFT_DMA_RING_MAX 4 + +typedef struct aft_dma_swring { + int tx_toggle; + int rx_toggle; + aft_dma_ring_t rbuf[AFT_DMA_RING_MAX]; +}aft_dma_swring_t; + + typedef struct private_area { wanpipe_common_t common; @@ -1541,10 +1559,114 @@ netskb_t *tx_rtp_skb; u32 tdm_call_status; struct private_area *next; - + + aft_dma_swring_t swring; + }private_area_t; +static __inline int aft_decode_dma_status(sdla_t *card, private_area_t *chan, u32 reg) +{ + u32 dma_status=aft_rxdma_hi_get_dma_status(reg); + u32 data_error=0; + + if (dma_status){ + + if (wan_test_bit(AFT_RXDMA_HIDMASTATUS_PCI_M_ABRT,&dma_status)){ + if (WAN_NET_RATELIMIT()){ + DEBUG_EVENT("%s:%s: Rx Error: Abort from Master: pci fatal error 0x%X!\n", + card->devname,chan->if_name,reg); + } + } + if (wan_test_bit(AFT_RXDMA_HIDMASTATUS_PCI_T_ABRT,&dma_status)){ + if (WAN_NET_RATELIMIT()){ + DEBUG_EVENT("%s:%s: Rx Error: Abort from Target: pci fatal error 0x%X!\n", + card->devname,chan->if_name,reg); + } + } + if (wan_test_bit(AFT_RXDMA_HIDMASTATUS_PCI_DS_TOUT,&dma_status)){ + if (WAN_NET_RATELIMIT()){ + DEBUG_EVENT("%s:%s: Rx Error: No 'DeviceSelect' from target: pci fatal error 0x%X!\n", + card->devname,chan->if_name,reg); + } + } + if (wan_test_bit(AFT_RXDMA_HIDMASTATUS_PCI_RETRY,&dma_status)){ + if (WAN_NET_RATELIMIT()){ + DEBUG_EVENT("%s:%s: Rx Error: 'Retry' exceeds maximum (64k): pci fatal error 0x%X!\n", + card->devname,chan->if_name,reg); + } + } + + chan->errstats.Rx_pci_errors++; + chan->if_stats.rx_errors++; + card->wandev.stats.rx_errors++; + return 1; + } + + if (chan->hdlc_eng){ + + /* Checking Rx DMA Frame start bit. (information for api) */ + if (!wan_test_bit(AFT_RXDMA_HI_START_BIT,®)){ + DEBUG_TEST("%s:%s RxDMA Intr: Start flag missing: MTU Mismatch! Reg=0x%X\n", + card->devname,chan->if_name,reg); + chan->if_stats.rx_frame_errors++; + chan->opstats.Rx_Data_discard_long_count++; + chan->errstats.Rx_hdlc_corrupiton++; + card->wandev.stats.rx_errors++; + return 1; + } + + /* Checking Rx DMA Frame end bit. (information for api) */ + if (!wan_test_bit(AFT_RXDMA_HI_EOF_BIT,®)){ + DEBUG_TEST("%s:%s: RxDMA Intr: End flag missing: MTU Mismatch! Reg=0x%X\n", + card->devname,chan->if_name,reg); + chan->if_stats.rx_frame_errors++; + chan->opstats.Rx_Data_discard_long_count++; + chan->errstats.Rx_hdlc_corrupiton++; + card->wandev.stats.rx_errors++; + return 1; + + } else { /* Check CRC error flag only if this is the end of Frame */ + + if (wan_test_bit(AFT_RXDMA_HI_FCS_ERR_BIT,®)){ + DEBUG_TEST("%s:%s: RxDMA Intr: CRC Error! Reg=0x%X Len=%d\n", + card->devname,chan->if_name,reg, + (reg&AFT_RXDMA_HI_DMA_LENGTH_MASK)>>2); + chan->if_stats.rx_frame_errors++; + chan->errstats.Rx_crc_err_count++; + card->wandev.stats.rx_crc_errors++; + data_error = 1; + } + + /* Check if this frame is an abort, if it is + * drop it and continue receiving */ + if (wan_test_bit(AFT_RXDMA_HI_FRM_ABORT_BIT,®)){ + DEBUG_TEST("%s:%s: RxDMA Intr: Abort! Reg=0x%X\n", + card->devname,chan->if_name,reg); + chan->if_stats.rx_frame_errors++; + chan->errstats.Rx_hdlc_corrupiton++; + card->wandev.stats.rx_frame_errors++; + data_error = 1; + } + +#if 0 + if (chan->common.usedby != API && data_error){ + return 1; + } +#else + if (data_error) { + return 1; + } +#endif + + } + } + + return 0; +} + + + void aft_free_logical_channel_num (sdla_t *card, int logic_ch); void aft_dma_max_logic_ch(sdla_t *card); void aft_fe_intr_ctrl(sdla_t *card, int status); @@ -1553,6 +1675,7 @@ void aft_wdt_reset(sdla_t *card); + #endif Only in wanpipe-3.2.2/patches/kdrivers/include: sdla_atm.orig.h diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/sdla_front_end.h wanpipe-3.2.4.p6/patches/kdrivers/include/sdla_front_end.h --- wanpipe-3.2.2/patches/kdrivers/include/sdla_front_end.h 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/sdla_front_end.h 2008-02-05 14:11:34.000000000 -0500 @@ -185,6 +185,7 @@ unsigned int line_no; unsigned char tx_tristate_mode; unsigned int tdmv_law; + unsigned char poll_mode; /* enable fe poll driven arch */ union { sdla_te_cfg_t te_cfg; sdla_te3_cfg_t te3_cfg; @@ -521,7 +522,7 @@ /* Transmit DTMF number */ int (*set_dtmf)(sdla_fe_t*, int, unsigned char); /* Enable/Disable FE interrupt */ - int (*intr_ctrl)(sdla_fe_t*, int, int, int, unsigned int); + int (*intr_ctrl)(sdla_fe_t*, int, u_int8_t, u_int8_t, unsigned int); /* Event Control */ int (*event_ctrl)(sdla_fe_t*, wan_event_ctrl_t*); /* Front-End watchdog */ diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/sdla_te1_ds.h wanpipe-3.2.4.p6/patches/kdrivers/include/sdla_te1_ds.h --- wanpipe-3.2.2/patches/kdrivers/include/sdla_te1_ds.h 2008-01-17 08:44:07.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/sdla_te1_ds.h 2008-02-06 13:30:50.000000000 -0500 @@ -660,6 +660,8 @@ #define BIT_LRISMR_RSMS1 0x02 #define BIT_LRISMR_RSMS0 0x01 +#define REG_LTXLAE 0x100C + /* BERT Register Definitions */ #define REG_BLSR 0x110E #define BIT_BLSR_BBED 0x40 diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/sdla_te1.h wanpipe-3.2.4.p6/patches/kdrivers/include/sdla_te1.h --- wanpipe-3.2.2/patches/kdrivers/include/sdla_te1.h 2008-01-15 12:22:40.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/sdla_te1.h 2008-02-06 13:32:17.000000000 -0500 @@ -277,6 +277,7 @@ #define TE_POLL_READ 0x0C #define TE_POLL_WRITE 0x0D #define TE_LINKCRIT_TIMER 0x0F +#define WAN_TE_POLL_LINKREADY 0x10 /* TE1 T1/E1 interrupt setting delay */ #define INTR_TE1_TIMER 150 /* 50 ms */ @@ -563,6 +564,10 @@ u_int16_t status_cnt; + int reg_dbg_busy; + int reg_dbg_ready; + unsigned char reg_dbg_value; + wan_ticks_t crit_alarm_start; unsigned int lb_mode; } sdla_te_param_t; Only in wanpipe-3.2.4.p6/patches/kdrivers/include: .sdla_te1.h.swp diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/wanpipe_cfg.h wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe_cfg.h --- wanpipe-3.2.2/patches/kdrivers/include/wanpipe_cfg.h 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe_cfg.h 2008-02-14 16:11:29.000000000 -0500 @@ -549,6 +549,19 @@ unsigned char type; } wan_fr_dlci_t; + +typedef struct wan_rtp_conf +{ + unsigned int rtp_ip; + unsigned int rtp_local_ip; + unsigned short rtp_port; + unsigned short rtp_sample; + unsigned char rtp_devname[WAN_IFNAME_SZ+1]; + unsigned char rtp_mac[WAN_IFNAME_SZ+1]; + unsigned char rtp_local_mac[WAN_IFNAME_SZ+1]; +}wan_rtp_conf_t; + + typedef struct wan_xilinx_conf { unsigned short dma_per_ch; /* DMA buffers per logic channel */ @@ -563,10 +576,16 @@ // unsigned int ec_persist_disable; /* HW EC Persist */ +#if 0 unsigned int rtp_ip; unsigned short rtp_port; unsigned short rtp_sample; char rtp_devname[WAN_IFNAME_SZ+1]; +#endif + unsigned int err_throttle_period; + unsigned int err_throttle_timeout; + + } wan_xilinx_conf_t; typedef struct wan_xilinx_conf_if @@ -958,6 +977,8 @@ wan_tdmv_conf_t tdmv_conf; wan_hwec_conf_t hwec_conf; + wan_rtp_conf_t rtp_conf; + unsigned char line_idle; /* IDLE FLAG/ IDLE MARK */ unsigned char ignore_front_end_status; diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/wanpipe_common.h wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe_common.h --- wanpipe-3.2.2/patches/kdrivers/include/wanpipe_common.h 2008-01-16 14:50:00.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe_common.h 2008-01-24 19:18:01.000000000 -0500 @@ -1418,7 +1418,7 @@ struct sk_buff* sk = (struct sk_buff*)skb; unsigned char* data = NULL; if (off == wan_skb_len(skb)){ - if (len > wan_skb_tailroom(sk)){ + if (wan_skb_tail_pointer(sk) + len > wan_skb_end_pointer(sk)){ DEBUG_EVENT("wan_skb_copyback: Internal Error (off=%d,len=%d,skb_len=%d)!\n", off, len, wan_skb_len(skb)); return; @@ -1459,7 +1459,7 @@ struct sk_buff* sk = (struct sk_buff*)skb; unsigned char* data = NULL; if (off == wan_skb_len(skb)){ - if (len > wan_skb_tailroom(sk)) { + if (wan_skb_tail_pointer(sk) + len > wan_skb_end_pointer(sk)){ DEBUG_EVENT("wan_skb_copyback_user: Internal Error (off=%d,len=%d,skb_len=%d)!\n", off, len, wan_skb_len(skb)); return -EINVAL; diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/wanpipe.h wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe.h --- wanpipe-3.2.2/patches/kdrivers/include/wanpipe.h 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe.h 2008-02-07 17:38:09.000000000 -0500 @@ -731,13 +731,26 @@ unsigned short tdm_tx_dma_toggle; unsigned int tdm_logic_ch_map; - void *rtp_dev; - int rtp_len; - netskb_t *rx_rtp_skb; - netskb_t *tx_rtp_skb; unsigned long sec_chk_cnt; + + wan_skb_queue_t rtp_tap_list; + unsigned int rx_errors_hist; + unsigned int rx_errors_over_cnt; + unsigned long rx_errors_timeout; + unsigned long rx_errors_down_timeout; + } sdla_xilinx_t; + +enum { + AFT_CHIP_CONFIGURED, + AFT_FRONT_END_UP, + AFT_TDM_GLOBAL_ISR, + AFT_TDM_RING_BUF, + AFT_TDM_FAST_ISR, + AFT_TDM_SW_RING_BUF +}; + typedef struct { unsigned long current_offset; @@ -849,6 +862,7 @@ unsigned long update_comms_stats; sdla_fe_t fe; /* front end structures */ + u8 fe_no_intr; /* do not enable global fe intr */ unsigned int rCount; @@ -874,6 +888,7 @@ #endif wan_hwec_conf_t hwec_conf; + wan_rtp_conf_t rtp_conf; #if defined(CONFIG_PRODUCT_WANPIPE_GENERIC) struct sdla* same_card; @@ -972,7 +987,9 @@ //extern int wan_reply_udp( unsigned char *data, unsigned int mbox_len, int trace_opt); //extern int wan_udp_pkt_type(sdla_t* card,unsigned char *data); -extern int wan_ip_udp_setup(void* card_id, u32 ip, u32 udp_port, +extern int wan_ip_udp_setup(void* card_id, + wan_rtp_conf_t *rtp_conf, + u32 chan, unsigned char *data, unsigned int mbox_len); extern int wanpipe_sdlc_unregister(netdevice_t *dev); Only in wanpipe-3.2.4.p6/patches/kdrivers/include: .wanpipe.h.swp diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/wanpipe_kernel.h wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe_kernel.h --- wanpipe-3.2.2/patches/kdrivers/include/wanpipe_kernel.h 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe_kernel.h 2008-01-24 19:07:02.000000000 -0500 @@ -33,6 +33,7 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) #define wan_skb_reset_mac_header(skb) skb_reset_mac_header(skb) #define wan_skb_reset_network_header(skb) skb_reset_network_header(skb) +#define wan_skb_end_pointer(skb) skb_end_pointer(skb) #define wan_skb_tail_pointer(skb) skb_tail_pointer(skb) #define wan_skb_reset_tail_pointer(skb) skb_reset_tail_pointer(skb) #define wan_skb_set_tail_pointer(skb,offset) skb_set_tail_pointer(skb,offset) @@ -40,6 +41,7 @@ #define wan_skb_reset_mac_header(skb) ((skb)->mac.raw = (skb)->data) #define wan_skb_reset_network_header(skb) ((skb)->nh.raw = (skb)->data) #define wan_skb_tail_pointer(skb) ((skb)->tail) +#define wan_skb_end_pointer(skb) ((skb)->end) #define wan_skb_reset_tail_pointer(skb) ((skb)->tail = (skb)->data) #define wan_skb_set_tail_pointer(skb,offset) ((skb)->tail = ((skb)->data + offset)) #endif diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/wanpipe_tdm_api.h wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe_tdm_api.h --- wanpipe-3.2.2/patches/kdrivers/include/wanpipe_tdm_api.h 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe_tdm_api.h 2008-01-29 16:14:41.000000000 -0500 @@ -300,7 +300,8 @@ #ifdef WAN_KERNEL -#define WP_TDM_API_MAX_LEN 1024 +/* Maximum API Len = 200ms = 1600 */ +#define WP_TDM_API_MAX_LEN 8*200 #define WP_TDM_API_CHUNK_SZ 8 enum { diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/wanpipe_version.h wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe_version.h --- wanpipe-3.2.2/patches/kdrivers/include/wanpipe_version.h 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/wanpipe_version.h 2008-02-15 16:51:10.000000000 -0500 @@ -6,8 +6,8 @@ #define WANPIPE_COMPANY "Sangoma Technologies Inc" /********** LINUX **********/ -#define WANPIPE_VERSION "3.2.2" -#define WANPIPE_SUB_VERSION "0" +#define WANPIPE_VERSION "3.2.4" +#define WANPIPE_SUB_VERSION "p6" #define WANPIPE_VERSION_BETA 0 #define WANPIPE_LITE_VERSION "1.1.1" diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/include/wanrouter.h wanpipe-3.2.4.p6/patches/kdrivers/include/wanrouter.h --- wanpipe-3.2.2/patches/kdrivers/include/wanrouter.h 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/include/wanrouter.h 2008-01-24 19:49:36.000000000 -0500 @@ -248,6 +248,17 @@ /*---------------------------------------------------------------------------- * WAN device data space. */ + +typedef struct wan_rtp_chan +{ + netskb_t *rx_skb; + netskb_t *tx_skb; + u32 rx_ts; + u32 tx_ts; +}wan_rtp_chan_t; + + + struct wan_dev_le { WAN_LIST_ENTRY(wan_dev_le) dev_link; netdevice_t *dev; @@ -404,6 +415,13 @@ int (*hwec_enable)(void* card_id, int, int); void (*critical_event) (void *, int); + + unsigned long rtp_tap_call_map; + unsigned long rtp_tap_call_status; + wan_rtp_chan_t rtp_chan[32]; + void *rtp_dev; + int rtp_len; + void (*rtp_tap)(void *card, u8 chan, u8* rx, u8* tx, u32 len); } wan_device_t; WAN_LIST_HEAD(wan_devlist_, wan_device); @@ -454,6 +472,8 @@ extern void wan_skb_destructor (struct sk_buff *skb); #endif +extern unsigned long wan_get_ip_address (netdevice_t *dev, int option); + void *wanpipe_ec_register(void*, int); int wanpipe_ec_unregister(void*,void*); int wanpipe_ec_isr(void*,void*); diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/src/net/aft_a104.c wanpipe-3.2.4.p6/patches/kdrivers/src/net/aft_a104.c --- wanpipe-3.2.2/patches/kdrivers/src/net/aft_a104.c 2008-01-11 14:15:41.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/src/net/aft_a104.c 2008-02-15 17:04:35.000000000 -0500 @@ -668,6 +668,31 @@ return 0; } +static void aft_set_hwec_clock_src(sdla_t *card) +{ + wan_smp_flag_t smp_flags, flags; + + if (card->adptr_subtype == AFT_SUBTYPE_SHARK && card->hwec_conf.clk_src){ + + u32 cfg_reg; + card->hwec_conf.clk_src = WAN_FE_LINENO(&card->fe); + + DEBUG_EVENT("%s: Global EC Clock Port = %d\n", + card->devname, + card->hwec_conf.clk_src+1); + + + card->hw_iface.hw_lock(card->hw,&smp_flags); + wan_spin_lock_irq(&card->wandev.lock,&flags); + + card->hw_iface.bus_read_4(card->hw,AFT_CHIP_CFG_REG, &cfg_reg); + aft_chipcfg_set_oct_clk_src(&cfg_reg,card->hwec_conf.clk_src); + card->hw_iface.bus_write_4(card->hw,AFT_CHIP_CFG_REG, cfg_reg); + + wan_spin_unlock_irq(&card->wandev.lock,&flags); + card->hw_iface.hw_unlock(card->hw,&smp_flags); + } +} int a104_chip_config(sdla_t *card) { @@ -689,25 +714,6 @@ card->devname, card->wandev.comm_port+1); return -EBUSY; } - -#if 0 - if (card->adptr_subtype == AFT_SUBTYPE_SHARK){ - - /* FIXME: Do not hardcode port numbers */ - if ((int)card->hwec_conf.clk_src < 0 || - card->hwec_conf.clk_src > 7) { - DEBUG_EVENT("%s: ERROR: Invalid SHARK Octasic Clock Source %d\n", - card->devname,card->hwec_conf.clk_src); - return -EINVAL; - } - - DEBUG_EVENT("%s: Global EC Clock Port = %d\n", - card->devname, - card->hwec_conf.clk_src+1); - - aft_chipcfg_set_oct_clk_src(®,card->hwec_conf.clk_src); - } -#endif /* On A108 Cards the T1/E1 will be configured per PORT * not per CARD */ @@ -894,6 +900,7 @@ card->hw_iface.getcfg(card->hw, SDLA_HWEC_NO, &max_ec_chans); + card->hw_iface.bus_read_4(card->hw,AFT_CHIP_CFG_REG, &cfg_reg); if (max_ec_chans > aft_chipcfg_get_ec_channels(cfg_reg)){ DEBUG_EVENT("%s: Critical Error: Exceeded Maximum Available Echo Channels!\n", @@ -913,6 +920,8 @@ if (!card->wandev.ec_dev) { return -EINVAL; } + + aft_set_hwec_clock_src(card); #else DEBUG_EVENT("%s: Wanpipe HW Echo Canceller module is not compiled!\n", diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/src/net/Module.symvers wanpipe-3.2.4.p6/patches/kdrivers/src/net/Module.symvers --- wanpipe-3.2.2/patches/kdrivers/src/net/Module.symvers 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/src/net/Module.symvers 2008-02-07 18:13:56.000000000 -0500 @@ -1,36 +1,36 @@ 0xf7567a8a wanpipe_api_buf_check /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0xf27fa082 wanpipe_lip_connect /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0xc8a15fa6 sdla_register /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL -0xf7b65505 wp_sppp_input /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL -0xf08131ff wanpipe_api_sock_rx /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0xeb489e63 wanrouter_proc_add_interface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x4f9dbcb5 sdla_register /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL +0xc0ef42f1 wp_sppp_input /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL +0x57e6ed60 wanpipe_api_sock_rx /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x5ed5993e wanrouter_proc_add_interface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x59fb2682 sdla_hw_probe /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL 0x9a7a6658 wanpipe_lip_rx /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0x580596c4 proc_router /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x8f31cdeb proc_router /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x94be524d register_wanec_iface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0xde2890ff bind_api_listen_to_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x1036a1ab bind_api_listen_to_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x524e2f20 register_wanpipe_fw_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0x6eee717c register_wan_device net/wanrouter/wanrouter EXPORT_SYMBOL -0xd3eaa2bd wanrouter_proc_add_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0x43891608 wp_sppp_attach /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL -0xf03004fc wp_sppp_detach /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL +0xc4453714 register_wan_device net/wanrouter/wanrouter EXPORT_SYMBOL +0x4afc8a38 wanrouter_proc_add_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0xc9b2c3fb wp_sppp_attach /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL +0x90a9f616 wp_sppp_detach /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL 0x56712648 wanpipe_ec_event_ctrl /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x7cd3c2bc wanpipe_ec_poll /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0xf8093f70 wanrouter_proc_delete_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x892d37d3 wanrouter_proc_delete_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0xdfd0f6c6 sdla_get_hw_adptr_cnt /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL 0x10723cdb wanpipe_ec_register /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0xa49dc980 wp_sppp_change_mtu /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL -0xd981a1fc wanrouter_encapsulate net/wanrouter/wanrouter EXPORT_SYMBOL -0xecdb7fad wan_skb_destructor /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0x563e1e4c register_wanpipe_api_socket /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x1e82f485 wp_sppp_change_mtu /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL +0x02364d27 wanrouter_encapsulate net/wanrouter/wanrouter EXPORT_SYMBOL +0x136b2537 wan_skb_destructor /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0xfa083e32 register_wanpipe_api_socket /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0xade2d0d7 sdla_get_hw_probe /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL -0x53c87809 proc_add_line /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0xef48df91 proc_add_line /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x22a2999f sdla_unregister /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL -0xd6fdd720 wanrouter_type_trans net/wanrouter/wanrouter EXPORT_SYMBOL -0x8506b552 wan_get_ip_address /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0x5de7fb30 wan_set_ip_address /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x85c05713 wanrouter_type_trans net/wanrouter/wanrouter EXPORT_SYMBOL +0xc98aebe6 wan_get_ip_address /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0xfd74fadb wan_set_ip_address /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x7d68ed07 protocol_disconnected /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0xfabc999d bind_api_to_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0xc5224c15 bind_api_to_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x38eb6851 unregister_wanpipe_api_socket /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0xaac011d2 wanpipe_lip_kick /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x3b604364 unbind_api_listen_from_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL @@ -39,18 +39,18 @@ 0x04df932b unregister_wanec_iface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x19823ac0 wanpipe_ec_isr /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x13405f6b unregister_wanpipe_fw_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0x85e65535 wanpipe_api_listen_rx /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0x2bcba8b7 wp_sppp_open /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL -0x656c1338 wp_sppp_reopen /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL -0xd6eb126f wp_sppp_do_ioctl /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL +0xe72f44cb wanpipe_api_listen_rx /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0xe6bc2d6d wp_sppp_open /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL +0x238f240b wp_sppp_reopen /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL +0x72ddd010 wp_sppp_do_ioctl /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL 0x5b7efb57 wanpipe_api_poll_wake /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0x02fd3230 wan_add_gateway /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0x03229b9c wp_sppp_close /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL -0x77bcb76a wanrouter_proc_delete_interface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x651a840a wan_add_gateway /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x805cbe1e wp_sppp_close /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL +0xc8b83615 wanrouter_proc_delete_interface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x2f21a326 unregister_wanpipe_lip_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x0ebe03d1 unregister_wan_device net/wanrouter/wanrouter EXPORT_SYMBOL 0x22317d82 wanpipe_lip_disconnect /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0x0af8ffa5 protocol_connected /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0xed6a48f7 protocol_connected /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL 0x53350bd4 wanpipe_ec_unregister /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0xab182e38 register_wanpipe_lip_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL -0xd9baedd9 protocol_connecting /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x49a433d4 register_wanpipe_lip_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL +0x00525339 protocol_connecting /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/src/net/sdla_8te1.c wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_8te1.c --- wanpipe-3.2.2/patches/kdrivers/src/net/sdla_8te1.c 2008-01-16 13:27:03.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_8te1.c 2008-02-06 13:26:29.000000000 -0500 @@ -257,7 +257,7 @@ static int sdla_ds_te1_TxChanCtrl(sdla_fe_t* fe, int channel, int enable); static int sdla_ds_te1_RxChanCtrl(sdla_fe_t* fe, int channel, int enable); static int sdla_ds_te1_disable_irq(void* pfe); /* Change to static */ -static int sdla_ds_te1_intr_ctrl(sdla_fe_t*, int, int, int, unsigned int); +static int sdla_ds_te1_intr_ctrl(sdla_fe_t*, int, u_int8_t, u_int8_t, unsigned int); static int sdla_ds_te1_check_intr(sdla_fe_t *fe); static int sdla_ds_te1_intr(sdla_fe_t *fe); static int sdla_ds_te1_udp(sdla_fe_t *fe, void* p_udp_cmd, unsigned char* data); @@ -899,6 +899,7 @@ break; case WAN_T1_399_533: case WAN_T1_330_440: + case WAN_T1_440_550: value = BIT_LTITSR_L1 | BIT_LTITSR_L0; break; case WAN_T1_533_655: @@ -977,13 +978,19 @@ if (IS_T1_FEMEDIA(fe)){ WRITE_REG(REG_LRISMR, value | BIT_LRISMR_RIMPM0); }else{ - value |= BIT_LRISMR_RIMPOFF; + //value |= BIT_LRISMR_RIMPOFF; if (WAN_TE1_LBO(fe) == WAN_E1_120){ value |= BIT_LRISMR_RIMPM1 | BIT_LRISMR_RIMPM0; } WRITE_REG(REG_LRISMR, value); } + if (IS_E1_FEMEDIA(fe) && WAN_TE1_LBO(fe) == WAN_E1_120){ + /* Feb 7, 2008 + ** Adjust DAC gain (-4.88%) */ + WRITE_REG(REG_LTXLAE, 0x09); + } + /* Additional front-end settings */ value = READ_REG(REG_ERCNT); if (WAN_FE_LCODE(fe) == WAN_LCODE_AMI){ @@ -1104,7 +1111,12 @@ fe->name, WAN_TE1_SIG_DECODE(fe)); } - + if (fe->fe_cfg.poll_mode == WANOPT_YES){ + sdla_t *card = (sdla_t*)fe->card; + DEBUG_EVENT("%s: FE Poll driven\n", + fe->name); + card->fe_no_intr = 1; + } if (sdla_ds_te1_chip_config(fe)){ return -EINVAL; } @@ -1119,10 +1131,13 @@ wan_set_bit(TE_CONFIGURED,(void*)&fe->te_param.critical); +#if 0 +/* Do not enable it here */ /* Enable interrupts */ sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_GLOBAL, WAN_FE_INTR_ENABLE, 0x00); /* Enable manual update pmon counter */ sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_PMON, WAN_FE_INTR_MASK, 0x00); +#endif return 0; } @@ -1243,11 +1258,13 @@ { sdla_fe_t *fe = (sdla_fe_t*)pfe; - /* FIXME: Alex to disable interrupts here */ - sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_GLOBAL, WAN_FE_INTR_MASK, 0x00); - sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_BASIC, WAN_FE_INTR_MASK, 0x00); - sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_PMON, WAN_FE_INTR_MASK, 0x00); - + if (fe->fe_cfg.poll_mode == WANOPT_NO){ + /* Disable interrupts here */ + sdla_ds_te1_intr_ctrl( + fe, 0, + (WAN_TE_INTR_GLOBAL|WAN_TE_INTR_BASIC|WAN_TE_INTR_PMON), + WAN_FE_INTR_MASK, 0x00); + } return 0; } @@ -2175,7 +2192,7 @@ ****************************************************************************** */ static int -sdla_ds_te1_intr_ctrl(sdla_fe_t *fe, int dummy, int type, int mode, unsigned int ts_map) +sdla_ds_te1_intr_ctrl(sdla_fe_t *fe, int dummy, u_int8_t type, u_int8_t mode, unsigned int ts_map) { unsigned char mask, value; unsigned char rscse; @@ -2183,12 +2200,12 @@ WAN_ASSERT(fe->write_fe_reg == NULL); WAN_ASSERT(fe->read_fe_reg == NULL); + WAN_ASSERT(fe->fe_cfg.poll_mode == WANOPT_YES); if (!wan_test_bit(TE_CONFIGURED,(void*)&fe->te_param.critical)){ return 0; } - switch(type){ - case WAN_TE_INTR_GLOBAL: + if (type & WAN_TE_INTR_GLOBAL){ mask = READ_REG(REG_GFIMR); if (mode == WAN_FE_INTR_ENABLE){ //mask |= (1<te_param.max_channels; ch++){ if (!wan_test_bit(ch, &ts_map)){ continue; @@ -2285,9 +2302,9 @@ value &= ~BIT_RIM4_RSCOS; } WRITE_REG(REG_RIM4, value); - break; + } - case WAN_TE_INTR_PMON: + if (type & WAN_TE_INTR_PMON){ value = READ_REG(REG_ERCNT); if (mode == WAN_FE_INTR_ENABLE){ value &= ~BIT_ERCNT_EAMS; @@ -2295,12 +2312,6 @@ value |= BIT_ERCNT_EAMS; } WRITE_REG(REG_ERCNT, value); - break; - - default: - DEBUG_EVENT("%s: Unsupported interrupt type %X!\n", - fe->name, type); - return -EINVAL; } return 0; @@ -2672,6 +2683,7 @@ WAN_ASSERT(fe->write_fe_reg == NULL); WAN_ASSERT(fe->read_fe_reg == NULL); + WAN_ASSERT(fe->fe_cfg.poll_mode == WANOPT_YES); framer_istatus = __READ_REG(REG_GFISR); liu_istatus = __READ_REG(REG_GLISR); @@ -2755,12 +2767,13 @@ #if 1 if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC){ sdla_fe_timer_event_t event; - /* AL: March 1, 2006: Mask global FE intr */ - sdla_ds_te1_intr_ctrl( - fe, 0, WAN_TE_INTR_BASIC, WAN_FE_INTR_MASK, 0x00); - /* Disable automatic update */ + /* AL: March 1, 2006 + ** Mask global FE intr + ** Disable automatic update */ sdla_ds_te1_intr_ctrl( - fe, 0, WAN_TE_INTR_PMON, WAN_FE_INTR_MASK, 0x00); + fe, 0, + (WAN_TE_INTR_GLOBAL|WAN_TE_INTR_BASIC|WAN_TE_INTR_PMON), + WAN_FE_INTR_MASK, 0x00); /* Start LINKDOWN poll */ event.type = TE_LINKCRIT_TIMER; event.delay = POLLING_TE1_TIMER*5; @@ -2777,18 +2790,13 @@ if (status != fe->fe_status){ if (fe->fe_status != FE_CONNECTED){ sdla_fe_timer_event_t event; - /* AL: March 1, 2006: Mask global FE intr */ - sdla_ds_te1_intr_ctrl( - fe, 0, - WAN_TE_INTR_BASIC, - WAN_FE_INTR_MASK, - 0x00); - /* Disable automatic update */ + /* AL: March 1, 2006 + ** Mask global FE intr + ** Disable automatic update */ sdla_ds_te1_intr_ctrl( - fe, 0, - WAN_TE_INTR_PMON, - WAN_FE_INTR_MASK, - 0x00); + fe, 0, + (WAN_TE_INTR_GLOBAL|WAN_TE_INTR_BASIC|WAN_TE_INTR_PMON), + WAN_FE_INTR_MASK, 0x00); /* Start LINKDOWN poll */ event.type = TE_LINKDOWN_TIMER; event.delay = POLLING_TE1_TIMER*5; @@ -3049,16 +3057,19 @@ ** because it cause to stay longer in interrupt handler ** (critical for XILINX code) */ if (fe->fe_status == FE_CONNECTED){ - /* Enable Basic Interrupt */ - sdla_ds_te1_intr_ctrl( fe, 0, - WAN_TE_INTR_BASIC, - WAN_FE_INTR_ENABLE, - 0x00); - /* Enable automatic update pmon counters */ - sdla_ds_te1_intr_ctrl( fe, 0, - WAN_TE_INTR_PMON, - WAN_FE_INTR_ENABLE, - 0x00); + if (fe->fe_cfg.poll_mode == WANOPT_YES){ + event->type = WAN_TE_POLL_LINKREADY; + event->delay = POLLING_TE1_TIMER; + pending = 1; + }else{ + /* Enable Basic Interrupt */ + /* Enable automatic update pmon counters */ + sdla_ds_te1_intr_ctrl( + fe, 0, + (WAN_TE_INTR_GLOBAL|WAN_TE_INTR_BASIC|WAN_TE_INTR_PMON), + WAN_FE_INTR_ENABLE, + 0x00); + } if (card->wandev.te_link_state){ card->wandev.te_link_state(card); } @@ -3069,6 +3080,28 @@ } break; + + case WAN_TE_POLL_LINKREADY: + /* Only used in no interrupt driven front-end mode */ + sdla_ds_te1_read_alarms(fe, WAN_FE_ALARM_READ|WAN_FE_ALARM_UPDATE); + if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC){ + /* Short circuit detected, go to LINKCRIT state */ + event->type = TE_LINKCRIT_TIMER; + event->delay = POLLING_TE1_TIMER; + pending = 1; + break; + } + sdla_ds_te1_set_status(fe, fe->fe_alarm); + if (fe->fe_status == FE_CONNECTED){ + pending = 1; + }else{ + event->type = TE_LINKDOWN_TIMER; + event->delay = POLLING_TE1_TIMER; + pending = 1; + break; + } + break; + case TE_RBS_READ: /* Physically read RBS status and print */ sdla_ds_te1_rbs_print(fe, 0); @@ -3139,24 +3172,22 @@ fe->name); return -EINVAL; } - /* Enable interrupts */ - sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_BASIC, WAN_FE_INTR_ENABLE, 0x00); - /* Enable manual update pmon counter */ - sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_PMON, WAN_FE_INTR_ENABLE, 0x00); event->type = TE_LINKDOWN_TIMER; event->delay = POLLING_TE1_TIMER; pending = 1; break; case TE_POLL_READ: - DEBUG_EVENT("%s: Reading %s Front-End register: Reg[%04X]=%02X\n", + fe->te_param.reg_dbg_value = READ_REG(event->te_event.reg); + DEBUG_TE1("%s: Read %s Front-End Reg:%04X=%02X\n", fe->name, FE_MEDIA_DECODE(fe), event->te_event.reg, - READ_REG(event->te_event.reg)); + fe->te_param.reg_dbg_value); + fe->te_param.reg_dbg_ready = 1; break; case TE_POLL_WRITE: - DEBUG_EVENT("%s: Writting %s Front-End register: Reg[%04X]=%02X\n", + DEBUG_EVENT("%s: Write %s Front-End Reg:%04X=%02X\n", fe->name, FE_MEDIA_DECODE(fe), event->te_event.reg, event->te_event.value); @@ -3665,11 +3696,24 @@ udp_cmd->wan_cmd_return_code = WAN_CMD_OK; break; case WAN_FE_DEBUG_REG: + if (fe->te_param.reg_dbg_busy){ + if (fe_debug->fe_debug_reg.read == 2 && fe->te_param.reg_dbg_ready){ + /* Poll the register value */ + fe_debug->fe_debug_reg.value = fe->te_param.reg_dbg_value; + udp_cmd->wan_cmd_return_code = WAN_CMD_OK; + fe->te_param.reg_dbg_busy = 0; + } + break; + } event.type = (fe_debug->fe_debug_reg.read) ? TE_POLL_READ : TE_POLL_WRITE; - event.te_event.reg = fe_debug->fe_debug_reg.reg; + event.te_event.reg = (u_int16_t)fe_debug->fe_debug_reg.reg; event.te_event.value = fe_debug->fe_debug_reg.value; event.delay = POLLING_TE1_TIMER; + if (fe_debug->fe_debug_reg.read){ + fe->te_param.reg_dbg_busy = 1; + fe->te_param.reg_dbg_ready = 0; + } sdla_ds_te1_add_event(fe, &event); udp_cmd->wan_cmd_return_code = WAN_CMD_OK; break; diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/src/net/sdla_aft_te1.c wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_aft_te1.c --- wanpipe-3.2.2/patches/kdrivers/src/net/sdla_aft_te1.c 2008-01-17 11:33:32.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_aft_te1.c 2008-02-14 16:25:54.000000000 -0500 @@ -114,6 +114,8 @@ #if 0 # warning "IRQ STAT DEBUGGIN ON" # define AFT_IRQ_STAT_DEBUG 1 +# define AFT_IRQ_STAT_TIMEOUT 5 +static unsigned long stat_timeout; #else # undef AFT_IRQ_STAT_DEBUG #endif @@ -140,8 +142,10 @@ #if defined(__LINUX__) #define AFT_TDM_API_SUPPORT 1 +#define AFT_RTP_SUPPORT 1 #else #undef AFT_TDM_API_SUPPORT +#undef AFT_RTP_SUPPORT #endif #if defined(__LINUX__) @@ -151,6 +155,8 @@ #endif + + /* Trigger on Number of transactions * 1= 1x8 byte transactions * 2= 2x8 byte transactions @@ -193,14 +199,6 @@ }; enum { - AFT_CHIP_CONFIGURED, - AFT_FRONT_END_UP, - AFT_TDM_GLOBAL_ISR, - AFT_TDM_RING_BUF, - AFT_TDM_FAST_ISR -}; - -enum { TX_DMA_BUSY, TX_HANDLER_BUSY, TX_INTR_PENDING, @@ -218,7 +216,8 @@ AFT_FE_TDM_RBS, AFT_FE_LED, AFT_FE_EC_POLL, - AFT_FE_RESTART + AFT_FE_RESTART, + AFT_RTP_TAP_Q }; #define MAX_IP_ERRORS 10 @@ -380,14 +379,14 @@ static void aft_port_task (void * card_ptr, int arg); #endif -#if defined(__LINUX__) -static void aft_rtp_config(sdla_t *card); + +#if defined(AFT_RTP_SUPPORT) +static int aft_rtp_config(sdla_t *card); static void aft_rtp_unconfig(sdla_t *card); -#if 0 -static void aft_rtp_tap(sdla_t *card, private_area_t *chan, u8* rx, u8* tx, u32 len); -#endif +static void aft_rtp_tap(void *card_ptr, u8 chan, u8* rx, u8* tx, u32 len); #endif + static int aft_devel_ioctl(sdla_t *card,struct ifreq *ifr); static int aft_write_bios(sdla_t *card, wan_cmd_api_t *api_cmd); static int aft_write(sdla_t *card, wan_cmd_api_t *api_cmd); @@ -643,6 +642,7 @@ return -EINVAL; } + card->u.aft.chip_cfg_status=0; ASSERT_AFT_HWDEV(card->wandev.card_type); card->hw_iface.getcfg(card->hw, SDLA_COREREV, &card->u.aft.firm_ver); @@ -680,6 +680,9 @@ conf->clocking = WANOPT_EXTERNAL; } + /* Use software RING buffer by default on Analog */ + wan_set_bit(AFT_TDM_SW_RING_BUF,&card->u.aft.chip_cfg_status); + card->wandev.comm_port=card->fe.fe_cfg.line_no; if (card->wandev.comm_port != 0){ DEBUG_EVENT("%s: Error: Invalid port selected %d (Port 1)\n", @@ -699,6 +702,7 @@ AFT_FUNC_DEBUG(); + wan_set_bit(CARD_DOWN,&card->wandev.critical); /* Verify configuration ID */ @@ -707,7 +711,7 @@ card->devname, card->wandev.config_id); return -EINVAL; } - + card->u.aft.chip_cfg_status=0; card->hw_iface.getcfg(card->hw, SDLA_COREREV, &card->u.aft.firm_ver); card->hw_iface.getcfg(card->hw, SDLA_COREID, &card->u.aft.firm_id); @@ -797,6 +801,7 @@ AFT_FUNC_DEBUG(); + wan_set_bit(CARD_DOWN,&card->wandev.critical); /* Verify configuration ID */ @@ -806,6 +811,7 @@ return -EINVAL; } + card->u.aft.chip_cfg_status=0; card->hw_iface.getcfg(card->hw, SDLA_COREREV, &card->u.aft.firm_ver); card->hw_iface.getcfg(card->hw, SDLA_COREID, &card->u.aft.firm_id); @@ -863,7 +869,7 @@ card->wandev.ec_enable_timer = enable_ec_timer; card->wandev.te_link_state = handle_front_end_state; - card->wandev.comm_port=1; + card->wandev.comm_port=0; card->u.aft.num_of_time_slots=1; @@ -897,12 +903,24 @@ memset(card->u.aft.dev_to_ch_map,0,sizeof(card->u.aft.dev_to_ch_map)); memcpy(&card->tdmv_conf,&conf->tdmv_conf,sizeof(wan_tdmv_conf_t)); memcpy(&card->hwec_conf,&conf->hwec_conf,sizeof(wan_hwec_conf_t)); + memcpy(&card->rtp_conf,&conf->rtp_conf,sizeof(conf->rtp_conf)); + + if (card->u.aft.cfg.err_throttle_period == 0) { + card->u.aft.cfg.err_throttle_period=1; + } + + if (card->u.aft.cfg.err_throttle_timeout == 0) { + card->u.aft.cfg.err_throttle_timeout=10; + } + + card->u.aft.cfg.dma_per_ch = MAX_RX_BUF; card->u.aft.tdmv_api_rx = NULL; card->u.aft.tdmv_api_tx = NULL; card->u.aft.tdmv_dchan=0; wan_skb_queue_init(&card->u.aft.tdmv_api_tx_list); + wan_skb_queue_init(&card->u.aft.rtp_tap_list); if (card->wandev.ignore_front_end_status == WANOPT_NO){ DEBUG_EVENT( @@ -985,8 +1003,8 @@ AFT_FUNC_DEBUG(); WAN_TASKQ_INIT((&card->u.aft.port_task),0,aft_port_task,card); - - card->u.aft.chip_cfg_status=0; + + card->hw_iface.getcfg(card->hw, SDLA_USEDCNT, &used_cnt); wan_clear_bit(CARD_DOWN,&card->wandev.critical); @@ -1110,6 +1128,12 @@ (card->u.aft.tdmv_hw_dtmf == WANOPT_YES) ? "Enabled" : "Disabled"); + + DEBUG_EVENT("%s: IRQ Throttle Period=%i Timeout=%i\n", + card->devname, + card->u.aft.cfg.err_throttle_period, + card->u.aft.cfg.err_throttle_timeout); + err=aft_tdmv_init(card,conf); if (err){ disable_comm(card); @@ -1118,8 +1142,13 @@ card->disable_comm = &disable_comm; - aft_rtp_config(card); - +#if defined(AFT_RTP_SUPPORT) + err=aft_rtp_config(card); + DEBUG_EVENT("%s: RTP TAP = %s\n", + card->devname, + err == 0 ? "Enabled" : "Disabled"); +#endif + card->wandev.read_ec = aft_read_ec; card->wandev.write_ec = aft_write_ec; @@ -1187,6 +1216,17 @@ return -EAGAIN; } +#if 0 +#warning "NENAD RTP TAP DEBUGGING" + if (card->wandev.rtp_tap_call_map) { + DEBUG_EVENT("%s: DISABLING RTP TAP\n",card->devname); + card->wandev.rtp_tap_call_map=0; + } else { + DEBUG_EVENT("%s: ENABLING RTP TAP\n",card->devname); + card->wandev.rtp_tap_call_map=0xFFFFFFFF; + } +#endif + DEBUG_TEST("%s: Chain Dma Status=0x%lX, TxCur=%d, TxPend=%d RxCur=%d RxPend=%d\n", chan->if_name, chan->dma_chain_status, @@ -2426,7 +2466,7 @@ aft_fifo_intr_ctrl(card, 0); /* Disable RTP Tap */ - card->u.aft.rtp_len=0; + card->wandev.rtp_len=0; #if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE) if (card->wan_tdmv.sc) { @@ -2743,8 +2783,10 @@ * core reset. Otherwise, we will receive * rx fifo errors on subsequent resetart. */ disable_data_error_intr(card,DEVICE_DOWN); - + +#if defined(AFT_RTP_SUPPORT) aft_rtp_unconfig(card); +#endif wan_spin_unlock_irq(&card->wandev.lock,&flags); @@ -3137,8 +3179,8 @@ #if !defined(AFT_IRQ_DEBUG) if (card) { #if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE) - if (card->wan_tdmv.sc && - !card->u.aft.rtp_len && + if (card->wan_tdmv.sc && + card->wandev.state == WAN_CONNECTED && card->wandev.config_id != WANCONFIG_AFT_ANALOG && chan->common.usedby == TDM_VOICE) { chan->if_stats.rx_packets = card->wandev.stats.rx_packets; @@ -3899,10 +3941,9 @@ unsigned char *pkt_error) { - unsigned int len,data_error = 0; + unsigned int len; unsigned char *buf; wp_rx_element_t *rx_el; - u32 dma_status; rx_el=(wp_rx_element_t *)wan_skb_data(skb); DEBUG_RX("%s:%s: RX HI=0x%X LO=0x%X\n DMA=0x%X", @@ -3921,8 +3962,6 @@ *pkt_error=0; *new_skb=NULL; - dma_status=aft_rxdma_hi_get_dma_status(rx_el->reg); - /* Checking Rx DMA Go bit. Has to be '0' */ if (wan_test_bit(AFT_RXDMA_HI_GO_BIT,&rx_el->reg)){ DEBUG_TEST("%s:%s: Error: RxDMA Intr: GO bit set on Rx intr\n", @@ -3931,96 +3970,12 @@ chan->errstats.Rx_dma_descr_err++; goto rx_comp_error; } - - /* Checking Rx DMA PCI error status. Has to be '0's */ - if (dma_status){ - - if (wan_test_bit(AFT_RXDMA_HIDMASTATUS_PCI_M_ABRT,&dma_status)){ - if (WAN_NET_RATELIMIT()){ - DEBUG_EVENT("%s:%s: Rx Error: Abort from Master: pci fatal error 0x%X!\n", - card->devname,chan->if_name,rx_el->reg); - } - } - if (wan_test_bit(AFT_RXDMA_HIDMASTATUS_PCI_T_ABRT,&dma_status)){ - if (WAN_NET_RATELIMIT()){ - DEBUG_EVENT("%s:%s: Rx Error: Abort from Target: pci fatal error 0x%X!\n", - card->devname,chan->if_name,rx_el->reg); - } - } - if (wan_test_bit(AFT_RXDMA_HIDMASTATUS_PCI_DS_TOUT,&dma_status)){ - if (WAN_NET_RATELIMIT()){ - DEBUG_EVENT("%s:%s: Rx Error: No 'DeviceSelect' from target: pci fatal error 0x%X!\n", - card->devname,chan->if_name,rx_el->reg); - } - } - if (wan_test_bit(AFT_RXDMA_HIDMASTATUS_PCI_RETRY,&dma_status)){ - if (WAN_NET_RATELIMIT()){ - DEBUG_EVENT("%s:%s: Rx Error: 'Retry' exceeds maximum (64k): pci fatal error 0x%X!\n", - card->devname,chan->if_name,rx_el->reg); - } - } - chan->errstats.Rx_pci_errors++; - chan->if_stats.rx_errors++; - card->wandev.stats.rx_errors++; + /* This is just a sanity check, it should have been caught by isr */ + if (aft_decode_dma_status(card,chan,rx_el->reg)) { goto rx_comp_error; } - - if (chan->hdlc_eng){ - - /* Checking Rx DMA Frame start bit. (information for api) */ - if (!wan_test_bit(AFT_RXDMA_HI_START_BIT,&rx_el->reg)){ - DEBUG_TEST("%s:%s RxDMA Intr: Start flag missing: MTU Mismatch! Reg=0x%X\n", - card->devname,chan->if_name,rx_el->reg); - chan->if_stats.rx_frame_errors++; - chan->opstats.Rx_Data_discard_long_count++; - chan->errstats.Rx_hdlc_corrupiton++; - card->wandev.stats.rx_errors++; - goto rx_comp_error; - } - /* Checking Rx DMA Frame end bit. (information for api) */ - if (!wan_test_bit(AFT_RXDMA_HI_EOF_BIT,&rx_el->reg)){ - DEBUG_TEST("%s:%s: RxDMA Intr: End flag missing: MTU Mismatch! Reg=0x%X\n", - card->devname,chan->if_name,rx_el->reg); - chan->if_stats.rx_frame_errors++; - chan->opstats.Rx_Data_discard_long_count++; - chan->errstats.Rx_hdlc_corrupiton++; - card->wandev.stats.rx_errors++; - goto rx_comp_error; - - } else { /* Check CRC error flag only if this is the end of Frame */ - - if (wan_test_bit(AFT_RXDMA_HI_FCS_ERR_BIT,&rx_el->reg)){ - DEBUG_TEST("%s:%s: RxDMA Intr: CRC Error! Reg=0x%X Len=%d\n", - card->devname,chan->if_name,rx_el->reg, - (rx_el->reg&AFT_RXDMA_HI_DMA_LENGTH_MASK)>>2); - chan->if_stats.rx_frame_errors++; - chan->errstats.Rx_crc_err_count++; - card->wandev.stats.rx_crc_errors++; - wan_set_bit(WP_CRC_ERROR_BIT,&rx_el->pkt_error); - data_error = 1; - } - - /* Check if this frame is an abort, if it is - * drop it and continue receiving */ - if (wan_test_bit(AFT_RXDMA_HI_FRM_ABORT_BIT,&rx_el->reg)){ - DEBUG_TEST("%s:%s: RxDMA Intr: Abort! Reg=0x%X\n", - card->devname,chan->if_name,rx_el->reg); - chan->if_stats.rx_frame_errors++; - chan->errstats.Rx_hdlc_corrupiton++; - card->wandev.stats.rx_frame_errors++; - wan_set_bit(WP_ABORT_ERROR_BIT,&rx_el->pkt_error); - data_error = 1; - } - - if (chan->common.usedby != API && data_error){ - goto rx_comp_error; - } - - } - } - len=rx_el->reg&AFT_RXDMA_HI_DMA_LENGTH_MASK; if (chan->hdlc_eng){ @@ -5042,8 +4997,7 @@ } #if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE) - if (tmp_card->wan_tdmv.sc && - !tmp_card->u.aft.rtp_len) { + if (tmp_card->wan_tdmv.sc) { aft_voice_span_rx_tx(tmp_card, ring_buf_enabled); }else @@ -5078,7 +5032,7 @@ #endif #if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE) if (card->wan_tdmv.sc && - !card->u.aft.rtp_len && + !card->wandev.rtp_len && card->wandev.config_id != WANCONFIG_AFT_ANALOG) { u32 dmareg; aft_voice_span_rx_tx(card, 0); @@ -5179,6 +5133,69 @@ DEBUG_TEST("---- ISR end.-------------------\n"); aft_global_isr_exit: + + + +#ifdef AFT_IRQ_STAT_DEBUG + if (SYSTEM_TICKS - stat_timeout > (AFT_IRQ_STAT_TIMEOUT*HZ) ) { + stat_timeout=SYSTEM_TICKS; + DEBUG_EVENT("%s: T=%is ISR=%li FE=%li DMA=%li TDM=%li FIFO=%li WDTi=%li WDTp=%li BH=%li TASK=%li\n", + card->devname, + AFT_IRQ_STAT_TIMEOUT, + card->wandev.stats.rx_errors, /*ISR*/ + card->wandev.stats.tx_dropped, /*FE*/ + card->wandev.stats.rx_length_errors, /*DMA*/ + card->wandev.stats.rx_crc_errors, /* TDM */ + card->wandev.stats.multicast, /*FIFO*/ + card->wandev.stats.rx_fifo_errors, /* WDTi */ + card->wandev.stats.tx_aborted_errors, /* WDTp */ + card->wandev.stats.collisions, /* BH */ + card->wandev.stats.rx_missed_errors /* TASK */ + ); + card->wandev.stats.rx_errors=0; + card->wandev.stats.tx_dropped=0; + card->wandev.stats.rx_length_errors=0; + card->wandev.stats.rx_crc_errors=0; + card->wandev.stats.multicast=0; + card->wandev.stats.rx_fifo_errors=0; + card->wandev.stats.tx_aborted_errors=0; + card->wandev.stats.collisions=0; + card->wandev.stats.rx_missed_errors=0; + } +#endif + + if ((SYSTEM_TICKS - card->u.aft.rx_errors_timeout) > card->u.aft.cfg.err_throttle_period*HZ) { + + if (card->u.aft.rx_errors_down_timeout) { + if (SYSTEM_TICKS - card->u.aft.rx_errors_down_timeout > card->u.aft.cfg.err_throttle_timeout*HZ) { + card->u.aft.rx_errors_down_timeout=0; + DEBUG_EVENT("%s: Restarting Device after excessive rx errors!\n", + card->devname); + wan_set_bit(AFT_FE_RESTART,&card->u.aft.port_task_cmd); + WAN_TASKQ_SCHEDULE((&card->u.aft.port_task)); + } + } else { + if (card->u.aft.rx_errors_hist > 5000) { + card->u.aft.rx_errors_over_cnt++; + DEBUG_EVENT("%s: Excessive Rx Errors ... %i (errs/s=%i)!\n", + card->devname,card->u.aft.rx_errors_over_cnt,card->u.aft.rx_errors_hist); + if (card->u.aft.rx_errors_over_cnt >= 2) { + DEBUG_EVENT("%s: Excessive Rx Errors ... stopping device!\n",card->devname); + card->u.aft.rx_errors_over_cnt=0; + disable_data_error_intr(card,LINK_DOWN); + aft_wdt_reset(card); + aft_wdt_set(card,AFT_WDTCTRL_TIMEOUT); + card->u.aft.rx_errors_down_timeout = SYSTEM_TICKS; + } + } else { + card->u.aft.rx_errors_over_cnt=0; + card->u.aft.rx_errors_down_timeout=0; + } + } + card->u.aft.rx_errors_hist=0; + card->u.aft.rx_errors_timeout=SYSTEM_TICKS; + } + wan_clear_bit(0,&card->in_isr); WAN_IRQ_RETURN(irq_ret); @@ -5379,7 +5396,7 @@ if (SYSTEM_TICKS - card->rsync_timeout > 3*HZ) { card->rsync_timeout=0; if (card->fe.fe_status == FE_CONNECTED) { - DEBUG_EVENT("%s: TDM IRQ Timeout \n", + DEBUG_EVENT("%s: WAN IRQ Timeout \n", card->devname); wan_set_bit(AFT_FE_RESTART,&card->u.aft.port_task_cmd); WAN_TASKQ_SCHEDULE((&card->u.aft.port_task)); @@ -5389,6 +5406,11 @@ return; } + if (card->u.aft.rx_errors_down_timeout) { + aft_wdt_set(card,timeout); + return; + } + for (i=0; iu.aft.num_of_time_slots;i++){ private_area_t *chan; @@ -6529,6 +6551,10 @@ continue; } + if (wan_test_bit(AFT_TDM_SW_RING_BUF,&card->u.aft.chip_cfg_status)) { + memset(&chan->swring,0,sizeof(chan->swring)); + } + if (!chan->hdlc_eng){ aft_reset_tx_chain_cnt(chan); aft_dma_tx(card,chan); @@ -6629,7 +6655,12 @@ wan_set_bit(AFT_DMACTRL_TDMV_TX_TOGGLE,®); card->hw_iface.bus_write_4(card->hw, AFT_PORT_REG(card,AFT_DMA_CTRL_REG),reg); - DEBUG_EVENT("%s: AFT Per Port TDM Intr\n",card->devname); + + if (wan_test_bit(AFT_TDM_SW_RING_BUF,&card->u.aft.chip_cfg_status)) { + DEBUG_EVENT("%s: AFT Per Port TDM Intr (swring)\n",card->devname); + } else { + DEBUG_EVENT("%s: AFT Per Port TDM Intr\n",card->devname); + } } #endif @@ -8276,6 +8307,14 @@ rx_el->pkt_error= dma_chain->pkt_error; rx_el->dma_addr = dma_chain->dma_addr; + /* Check for crc/abort here to prevent crc/abort storm */ + if (aft_decode_dma_status(card,chan,rx_el->reg)) { + aft_init_requeue_free_skb(chan, dma_chain->skb); + ++chan->if_stats.rx_errors; + card->u.aft.rx_errors_hist++; + goto rx_hndlr_skip_rx; + } + wan_skb_queue_tail(&chan->wp_rx_complete_list,dma_chain->skb); rx_data_available=1; @@ -9015,7 +9054,7 @@ if (wan_test_bit(AFT_FE_RESTART,&card->u.aft.port_task_cmd)){ wan_clear_bit(AFT_FE_RESTART,&card->u.aft.port_task_cmd); if (card->fe.fe_status == FE_CONNECTED) { - DEBUG_EVENT("%s: TDM IRQ Restart\n", + DEBUG_EVENT("%s: WAN IRQ Restart\n", card->devname); wan_spin_lock_irq(&card->wandev.lock,&smp_flags); card->fe.fe_status = FE_DISCONNECTED; @@ -9025,20 +9064,31 @@ wan_spin_unlock_irq(&card->wandev.lock,&smp_flags); } } + +#if defined(AFT_RTP_SUPPORT) + if (wan_test_bit(AFT_RTP_TAP_Q,&card->u.aft.port_task_cmd)){ + netskb_t *skb; + wan_clear_bit(AFT_FE_RESTART,&card->u.aft.port_task_cmd); + while ((skb=wan_skb_dequeue(&card->u.aft.rtp_tap_list))) { + dev_queue_xmit(skb); + } + } +#endif } void __aft_fe_intr_ctrl(sdla_t *card, int status) { u32 reg; - card->hw_iface.bus_read_4(card->hw,AFT_CHIP_CFG_REG,®); - if (status){ - wan_set_bit(AFT_CHIPCFG_FE_INTR_CFG_BIT,®); - }else{ - wan_clear_bit(AFT_CHIPCFG_FE_INTR_CFG_BIT,®); + if (!card->fe_no_intr || !status){ + card->hw_iface.bus_read_4(card->hw,AFT_CHIP_CFG_REG,®); + if (status){ + wan_set_bit(AFT_CHIPCFG_FE_INTR_CFG_BIT,®); + }else{ + wan_clear_bit(AFT_CHIPCFG_FE_INTR_CFG_BIT,®); + } + card->hw_iface.bus_write_4(card->hw,AFT_CHIP_CFG_REG,reg); } - card->hw_iface.bus_write_4(card->hw,AFT_CHIP_CFG_REG,reg); - } void aft_fe_intr_ctrl(sdla_t *card, int status) @@ -9519,6 +9569,7 @@ int err; u32 rx_offset=0; u32 tx_offset=0; + u8 *txbuf, *rxbuf; aft_dma_chain_t *tx_dma_chain; aft_dma_chain_t *rx_dma_chain; @@ -9526,14 +9577,6 @@ tx_dma_chain = &chan->tx_dma_chain_table[0]; rx_dma_chain = &chan->rx_dma_chain_table[0]; - - if (wan_test_bit(AFT_TDM_RING_BUF,&card->u.aft.chip_cfg_status)) { - rx_offset= AFT_TDMV_CIRC_BUF * card->u.aft.tdm_rx_dma_toggle; - tx_offset= AFT_TDMV_CIRC_BUF * card->u.aft.tdm_tx_dma_toggle; - } - - err=0; - if (!tx_dma_chain || !rx_dma_chain){ DEBUG_EVENT("%s: %s:%d ASSERT ERROR TxDma=%p RxDma=%p\n", card->devname,__FUNCTION__,__LINE__, @@ -9548,6 +9591,36 @@ return -EINVAL; } + rxbuf = (unsigned char*)rx_dma_chain->dma_virt+rx_offset; + txbuf = (unsigned char*)tx_dma_chain->dma_virt+tx_offset; + + + if (wan_test_bit(AFT_TDM_RING_BUF,&card->u.aft.chip_cfg_status)) { + rx_offset= AFT_TDMV_CIRC_BUF * card->u.aft.tdm_rx_dma_toggle; + tx_offset= AFT_TDMV_CIRC_BUF * card->u.aft.tdm_tx_dma_toggle; + + rxbuf = (unsigned char*)rx_dma_chain->dma_virt+rx_offset; + txbuf = (unsigned char*)tx_dma_chain->dma_virt+tx_offset; + + } else if (wan_test_bit(AFT_TDM_SW_RING_BUF,&card->u.aft.chip_cfg_status)) { + + chan->swring.rx_toggle = (chan->swring.rx_toggle + 1) % AFT_DMA_RING_MAX; + memcpy(chan->swring.rbuf[chan->swring.rx_toggle].rxdata, + rxbuf, + chan->mtu); + rxbuf= chan->swring.rbuf[chan->swring.rx_toggle].rxdata; + + + memcpy(txbuf, chan->swring.rbuf[chan->swring.tx_toggle].txdata, + chan->mtu); + chan->swring.tx_toggle = (chan->swring.tx_toggle + 1) % AFT_DMA_RING_MAX; + txbuf = chan->swring.rbuf[chan->swring.tx_toggle].txdata; + } + + err=0; + + + #if 0 /*Measure the round trip delay*/ if (!chan->tdmv_rx_delay_cfg){ @@ -9571,88 +9644,26 @@ #ifdef CONFIG_PRODUCT_WANPIPE_TDM_VOICE if (card->wan_tdmv.sc){ -#if 0 -defined(AFT_TDMV_BH_ENABLE) - aft_dma_chain_t *tx_bh_dma_chain = &chan->tx_dma_chain_table[1]; - aft_dma_chain_t *rx_bh_dma_chain = &chan->rx_dma_chain_table[1]; - - if (!rx_bh_dma_chain->skb){ - rx_bh_dma_chain->skb=wan_skb_dequeue(&chan->wp_rx_free_list); - if (!rx_bh_dma_chain->skb){ - if (WAN_NET_RATELIMIT()){ - DEBUG_EVENT("%s: Critical TDM BH no free skb\n", - chan->if_name); - goto aft_tdm_bh_skip; - } - } - wan_skb_init(rx_bh_dma_chain->skb,16); - wan_skb_trim(rx_bh_dma_chain->skb,0); - } - - if (!tx_bh_dma_chain->skb){ - tx_bh_dma_chain->skb=wan_skb_dequeue(&chan->wp_rx_free_list); - if (!tx_bh_dma_chain->skb){ - if (WAN_NET_RATELIMIT()){ - DEBUG_EVENT("%s: Critical TDM BH no free skb\n", - chan->if_name); - goto aft_tdm_bh_skip; - } - } - wan_skb_init(tx_bh_dma_chain->skb,16); - wan_skb_trim(tx_bh_dma_chain->skb,0); - } - - memcpy(wan_skb_data(rx_bh_dma_chain->skb), - wan_skb_data(rx_dma_chain->skb),8); - - memcpy(wan_skb_data(tx_dma_chain->skb), - wan_skb_data(tx_bh_dma_chain->skb),8); - - rx_dma_chain=rx_bh_dma_chain; - tx_dma_chain=tx_bh_dma_chain; -aft_tdm_bh_skip: -#endif - DEBUG_TEST ("%s: Calling Rx Chan=%i TdmvChan=%i\n", card->devname,chan->logic_ch_num, chan->tdmv_chan); -#if 1 -#if 0 -#warning "RTP TAP ENABLED Not Finished" - if (card->u.aft.rtp_len) { - aft_rtp_tap(card,chan, - rx_dma_chain->dma_virt+rx_offset, - tx_dma_chain->dma_virt+tx_offset, - chan->mtu); - } -#endif + + if (card->wandev.rtp_len && card->wandev.rtp_tap) { + card->wandev.rtp_tap(card, + IS_E1_CARD(card) ? chan->first_time_slot-1 : + chan->first_time_slot, + rxbuf, + txbuf, + chan->mtu); + } + WAN_TDMV_CALL(rx_chan, (&card->wan_tdmv,chan->tdmv_chan, - rx_dma_chain->dma_virt+rx_offset, - tx_dma_chain->dma_virt+tx_offset), + rxbuf, + txbuf), err); -#else -#warning "NCDEBUG rx_chan disabled irq" -#endif - -#if 0 - if (((u8*)(rx_dma_chain->dma_virt+offset))[0] != 0xFF && - ((u8*)(rx_dma_chain->dma_virt+offset))[0] != 0x7F && - tx_debug_cnt < 100){ - DEBUG_EVENT("%s: %02X %02X %02X %02X %02X %02X %02X %02X\n", - card->devname, - ((u8*)(rx_dma_chain->dma_virt+offset))[0], - ((u8*)(rx_dma_chain->dma_virt+offset))[1], - ((u8*)(rx_dma_chain->dma_virt+offset))[2], - ((u8*)(rx_dma_chain->dma_virt+offset))[3], - ((u8*)(rx_dma_chain->dma_virt+offset))[4], - ((u8*)(rx_dma_chain->dma_virt+offset))[5], - ((u8*)(rx_dma_chain->dma_virt+offset))[6], - ((u8*)(rx_dma_chain->dma_virt+offset))[7]); - tx_debug_cnt++; - } -#endif + }else{ return 1; } @@ -9664,11 +9675,12 @@ if (card->wandev.fe_iface.watchdog){ err = card->wandev.fe_iface.watchdog(&card->fe); } - + wanpipe_tdm_api_rx_tx(&chan->wp_tdm_api_dev, - rx_dma_chain->dma_virt+rx_offset, - tx_dma_chain->dma_virt+tx_offset, + rxbuf, + txbuf, chan->mtu); + #endif } @@ -9680,40 +9692,28 @@ if (chan->tdmv_zaptel_cfg){ DEBUG_TEST ("%s: Calling Master Rx Tx Chan=%i\n", card->devname,chan->logic_ch_num); -#if 0 -defined(AFT_TDMV_BH_ENABLE) -#warning "AFT A104: TDM Driver compiled in BH mode!" - - if (WAN_TASKLET_RUNNING((&chan->common.bh_task))){ - if (WAN_NET_RATELIMIT()){ - DEBUG_EVENT("%s: Critical Error: TDMV BH Overrun!\n", - card->devname); + + + if (wan_test_bit(AFT_TDM_SW_RING_BUF,&card->u.aft.chip_cfg_status)) { + if (!wan_test_bit(AFT_TDM_GLOBAL_ISR,&card->u.aft.chip_cfg_status)) { + card->hw_iface.bus_read_4(card->hw,AFT_PORT_REG(card,AFT_DMA_CTRL_REG),®); + wan_set_bit(AFT_DMACTRL_TDMV_RX_TOGGLE,®); + wan_set_bit(AFT_DMACTRL_TDMV_TX_TOGGLE,®); + card->hw_iface.bus_write_4(card->hw,AFT_PORT_REG(card,AFT_DMA_CTRL_REG),reg); } } - - WAN_WP_TASKLET_SCHEDULE_PER_CPU((&chan->common.bh_task), - card->tdmv_conf.span_no); - card->hw_iface.bus_read_4(card->hw,AFT_PORT_REG(card,AFT_DMA_CTRL_REG),®); - wan_set_bit(AFT_DMACTRL_TDMV_RX_TOGGLE,®); - wan_set_bit(AFT_DMACTRL_TDMV_TX_TOGGLE,®); - card->hw_iface.bus_write_4(card->hw,AFT_PORT_REG(card,AFT_DMA_CTRL_REG),reg); - -#else -#if 1 WAN_TDMV_CALL(rx_tx_span, (card), err); -#else -#warning "NCDEBUG: rx_tx_span disabled irq" -#endif - - if (!wan_test_bit(AFT_TDM_GLOBAL_ISR,&card->u.aft.chip_cfg_status)) { + + if (!wan_test_bit(AFT_TDM_SW_RING_BUF,&card->u.aft.chip_cfg_status) && + !wan_test_bit(AFT_TDM_GLOBAL_ISR,&card->u.aft.chip_cfg_status)) { card->hw_iface.bus_read_4(card->hw,AFT_PORT_REG(card,AFT_DMA_CTRL_REG),®); wan_set_bit(AFT_DMACTRL_TDMV_RX_TOGGLE,®); wan_set_bit(AFT_DMACTRL_TDMV_TX_TOGGLE,®); card->hw_iface.bus_write_4(card->hw,AFT_PORT_REG(card,AFT_DMA_CTRL_REG),reg); } - + if (card->wan_tdmv.sc){ WAN_TDMV_CALL(is_rbsbits, (&card->wan_tdmv), err); if (err == 1){ @@ -9721,8 +9721,7 @@ WAN_TASKQ_SCHEDULE((&card->u.aft.port_task)); } } -#endif - }else{ + } else { #else if (!chan->tdmv_zaptel_cfg){ @@ -10618,12 +10617,6 @@ aft_hwdev[card->wandev.card_type].aft_led_ctrl(card, WAN_AFT_GREEN, 0, WAN_AFT_OFF); } -enum { - WAN_TDM_RTP_NO_CHANGE, - WAN_TDM_RTP_CALL_START, - WAN_TDM_RTP_CALL_STOP -}; - static int aft_hwec_config (sdla_t *card, private_area_t *chan, wanif_conf_t *conf, int ctrl) { @@ -10671,123 +10664,131 @@ } -#if defined(__LINUX__) + +#if defined(AFT_RTP_SUPPORT) +enum { + WAN_TDM_RTP_NO_CHANGE, + WAN_TDM_RTP_CALL_START, + WAN_TDM_RTP_CALL_STOP +}; static void aft_rtp_unconfig(sdla_t *card) { - netskb_t *skb; + wan_rtp_chan_t *rtp_chan; + netskb_t *skb; + int i; - card->u.aft.cfg.rtp_ip=0; - card->u.aft.cfg.rtp_sample=0; - card->u.aft.rtp_len=0; - if (card->u.aft.rtp_dev) { - dev_put(card->u.aft.rtp_dev); - card->u.aft.rtp_dev=NULL; + card->wandev.rtp_len=0; + + card->rtp_conf.rtp_ip=0; + card->rtp_conf.rtp_sample=0; + + if (card->wandev.rtp_dev) { + dev_put(card->wandev.rtp_dev); + card->wandev.rtp_dev=NULL; } - if ((skb=card->u.aft.rx_rtp_skb)) { - card->u.aft.rx_rtp_skb=NULL; - wan_skb_free(skb); + for (i=0;i<32;i++) { + rtp_chan=&card->wandev.rtp_chan[i]; + if (rtp_chan->rx_skb) { + wan_skb_free(rtp_chan->rx_skb); + rtp_chan->rx_skb=NULL; + } + if (rtp_chan->tx_skb) { + wan_skb_free(rtp_chan->tx_skb); + rtp_chan->rx_skb=NULL; + } } + while ((skb=wan_skb_dequeue(&card->u.aft.rtp_tap_list))) { + wan_skb_free(skb); + } + } +#endif -static void aft_rtp_config(sdla_t *card) -{ -/* RTP TAP Not finished yet */ - return; +#if defined(AFT_RTP_SUPPORT) +static int aft_rtp_config(sdla_t *card) +{ + netdevice_t *dev; + card->wandev.rtp_tap=NULL; - -#if 0 - if (!card->u.aft.cfg.rtp_ip || !card->u.aft.cfg.rtp_sample) { - goto aft_rtp_init_exit; + if (!card->rtp_conf.rtp_ip || !card->rtp_conf.rtp_sample) { + return 1; } - switch (card->u.aft.cfg.rtp_sample) { - case 10: - case 20: - case 30: - case 40: - /* Supported Sample Sizes */ - break; - default: - goto aft_rtp_init_exit; + if (card->rtp_conf.rtp_sample < 10 || card->rtp_conf.rtp_sample > 150) { + DEBUG_EVENT("%s: Error: Invalid RTP Sample %d [Min=10 Max=150ms]\n", + card->devname,card->rtp_conf.rtp_sample); + goto aft_rtp_init_exit; } -#endif - card->u.aft.cfg.rtp_port=9000; - card->u.aft.cfg.rtp_ip=0x0100007F; - card->u.aft.cfg.rtp_sample=100; - card->u.aft.rtp_len = (card->u.aft.cfg.rtp_sample * 8) + sizeof(wan_rtp_pkt_t); - sprintf(card->u.aft.cfg.rtp_devname,"lo"); + DEBUG_EVENT("%s: RTP TAP [ %d.%d.%d.%d:%d %dms %s %02X:%02X:%02X:%02X:%02X:%02X ]\n", + card->devname, + NIPQUAD(card->rtp_conf.rtp_ip), + card->rtp_conf.rtp_port, + card->rtp_conf.rtp_sample, + card->rtp_conf.rtp_devname, + card->rtp_conf.rtp_mac[0], + card->rtp_conf.rtp_mac[1], + card->rtp_conf.rtp_mac[2], + card->rtp_conf.rtp_mac[3], + card->rtp_conf.rtp_mac[4], + card->rtp_conf.rtp_mac[5]); + + card->wandev.rtp_len = (card->rtp_conf.rtp_sample * 8) + sizeof(wan_rtp_pkt_t); - if ((card->u.aft.rtp_dev=dev_get_by_name(card->u.aft.cfg.rtp_devname)) == NULL){ + if ((card->wandev.rtp_dev=dev_get_by_name(card->rtp_conf.rtp_devname)) == NULL){ DEBUG_EVENT("%s: Failed to open rtp tx device %s\n", card->devname, - card->u.aft.cfg.rtp_devname); + card->rtp_conf.rtp_devname); goto aft_rtp_init_exit; } - DEBUG_EVENT("%s: Configured rtp tap!\n",card->devname); - return; + dev=(netdevice_t*)card->wandev.rtp_dev; + + memcpy(card->rtp_conf.rtp_local_mac,dev->dev_addr,dev->addr_len); + card->rtp_conf.rtp_local_ip=wan_get_ip_address(card->wandev.rtp_dev,WAN_LOCAL_IP); + if (card->rtp_conf.rtp_local_ip == 0) { + goto aft_rtp_init_exit; + } + + card->wandev.rtp_tap=&aft_rtp_tap; + + memset(card->wandev.rtp_chan,0,sizeof(card->wandev.rtp_chan)); + + return 0; aft_rtp_init_exit: + aft_rtp_unconfig(card); DEBUG_EVENT("%s: Failed to configure rtp tap!\n",card->devname); - return; + + return -1; } -#if 0 -static void aft_rtp_tap(sdla_t *card, private_area_t *chan, u8* rx, u8* tx, u32 len) +static __inline void aft_rtp_tap_chan(sdla_t *card, u8 *data, u32 len, + netskb_t **skb_q, + u32 *timestamp, + u8 call_status, + u32 chan) { wan_rtp_pkt_t *pkt; u8 *buf; netskb_t *skb; - u32 ecmap, call_status=WAN_TDM_RTP_NO_CHANGE; - - if (!card->u.aft.cfg.rtp_ip || - !card->u.aft.cfg.rtp_sample || - !card->u.aft.rtp_len || - !card->u.aft.rtp_dev) { - return; - } - - if (IS_T1_CARD(card)) { - ecmap=card->wandev.ec_map; - } else { - ecmap=card->wandev.ec_map << 1; - } - - if (1) { //wan_test_bit(chan->first_time_slot,&ecmap)) { - if (!wan_test_and_set_bit(0,&chan->tdm_call_status)) { - /* Start of the call */ - call_status=WAN_TDM_RTP_CALL_START; - DEBUG_TEST("%s: CALL Start on ch %i\n", - chan->if_name,chan->first_time_slot); - } - } else { - if (!wan_test_bit(0,&chan->tdm_call_status)) { - /* Call not up */ - return; - } - call_status=WAN_TDM_RTP_CALL_STOP; - DEBUG_TEST("%s: CALL Stop on ch %i\n", - chan->if_name,chan->first_time_slot); - } + u32 ts; - - if (!(skb=chan->rx_rtp_skb)) { - card->u.aft.rtp_len = (card->u.aft.cfg.rtp_sample * 8) + sizeof(wan_rtp_pkt_t); - chan->rx_rtp_skb=wan_skb_alloc(card->u.aft.rtp_len+128); - if (!chan->rx_rtp_skb) { + if ((skb=*skb_q) == NULL) { + *skb_q=wan_skb_alloc(card->wandev.rtp_len+128); + if (!*skb_q) { return; } - skb=chan->rx_rtp_skb; + skb=*skb_q; pkt = (wan_rtp_pkt_t*)wan_skb_put(skb,sizeof(wan_rtp_pkt_t)); memset(pkt,0,sizeof(wan_rtp_pkt_t)); pkt->rtp_hdr.version=2; @@ -10796,6 +10797,8 @@ } else { pkt->rtp_hdr.pt=1; } + DEBUG_TEST("%s: RTP(%d) SKB Allocated Len=%i \n", + card->devname,chan,card->wandev.rtp_len); } pkt = (wan_rtp_pkt_t*)wan_skb_data(skb); @@ -10803,41 +10806,125 @@ if (call_status == WAN_TDM_RTP_CALL_START) { pkt->rtp_hdr.seq=0; pkt->rtp_hdr.ts=0; + *timestamp=0; } buf=wan_skb_put(skb,len); - memcpy(buf,rx,len); - pkt->rtp_hdr.ts++; + memcpy(buf,data,len); - if (wan_skb_len(skb) >= card->u.aft.rtp_len || + ts=htonl(pkt->rtp_hdr.ts); + ts+=len; + pkt->rtp_hdr.ts = htonl(ts); + + if (wan_skb_len(skb) >= card->wandev.rtp_len || call_status==WAN_TDM_RTP_CALL_STOP) { netskb_t *nskb; + u16 seq; + + pkt->rtp_hdr.ts = *timestamp; + wan_ip_udp_setup(card, - card->u.aft.cfg.rtp_ip, - card->u.aft.cfg.rtp_port+chan->first_time_slot, + &card->rtp_conf, + chan, wan_skb_data(skb), wan_skb_len(skb)-sizeof(wan_rtp_pkt_t)); + + nskb=wan_skb_clone(skb); if (nskb) { nskb->next = nskb->prev = NULL; - nskb->dev = card->u.aft.rtp_dev; + nskb->dev = card->wandev.rtp_dev; nskb->protocol = htons(ETH_P_802_2); wan_skb_reset_mac_header(nskb); - //wan_skb_reset_network_header(nskb); - dev_queue_xmit(nskb); + wan_skb_reset_network_header(nskb); + + wan_skb_queue_tail(&card->u.aft.rtp_tap_list,nskb); + wan_set_bit(AFT_RTP_TAP_Q,&card->u.aft.port_task_cmd); + WAN_TASKQ_SCHEDULE((&card->u.aft.port_task)); + + DEBUG_TEST("%s: RTP(%d) SKB Tx on dev %s \n", + card->devname,chan,nskb->dev->name); } + wan_skb_trim(skb,sizeof(wan_rtp_pkt_t)); - pkt->rtp_hdr.seq++; - #if 0 - /* Disable rtp (debugging) */ - card->u.aft.rtp_len=0; - #endif + pkt = (wan_rtp_pkt_t*)wan_skb_data(skb); + + seq=htons(pkt->rtp_hdr.seq); + seq++; + pkt->rtp_hdr.seq=htons(seq); + *timestamp = htonl(ts); + DEBUG_TEST("Chan=%i Seq=%i TS=%i\n",chan,seq,ts); + pkt->rtp_hdr.ts = htonl(ts); } } -#endif -#endif + + + +static void aft_rtp_tap(void *card_ptr, u8 chan, u8* rx, u8* tx, u32 len) +{ + sdla_t *card = (sdla_t *)card_ptr; + u8 call_status=WAN_TDM_RTP_NO_CHANGE; + wan_rtp_chan_t *rtp_chan; + u32 span; + + if (!card || !rx || !tx ) { + if (WAN_NET_RATELIMIT()) { + DEBUG_EVENT("%s: Internal Error: rtp tap invalid pointers chan %i\n", + __FUNCTION__,chan); + } + return; + } + + if (!card->rtp_conf.rtp_ip || + !card->rtp_conf.rtp_sample || + !card->wandev.rtp_len || + !card->wandev.rtp_dev) { + if (WAN_NET_RATELIMIT()) { + DEBUG_EVENT("%s: RTP Tap Not configured %i\n", + card->devname,chan); + } + return; + } + + if (chan >= 32) { + if (WAN_NET_RATELIMIT()) { + DEBUG_EVENT("%s: Internal Error: rtp tap chan out of range %i\n", + card->devname,chan); + } + return; + } + + span = card->tdmv_conf.span_no-1; + rtp_chan = &card->wandev.rtp_chan[chan]; + + if (wan_test_bit(chan,&card->wandev.rtp_tap_call_map)) { + if (!wan_test_and_set_bit(chan,&card->wandev.rtp_tap_call_status)) { + /* Start of the call */ + call_status=WAN_TDM_RTP_CALL_START; + DEBUG_TEST("%s: CALL Start on ch %i\n", + card->devname,chan); + } + } else { + if (!wan_test_bit(chan,&card->wandev.rtp_tap_call_status)) { + /* Call not up */ + return; + } + wan_clear_bit(chan,&card->wandev.rtp_tap_call_status); + call_status=WAN_TDM_RTP_CALL_STOP; + DEBUG_TEST("%s: CALL Stop on ch %i\n", + card->devname,chan); + } + + + aft_rtp_tap_chan(card, rx, len, &rtp_chan->rx_skb, &rtp_chan->rx_ts, + call_status, (span<<4|(chan+1))); + aft_rtp_tap_chan(card, tx, len, &rtp_chan->tx_skb, &rtp_chan->tx_ts, + call_status, (span<<4|(chan+1))+2000); + +} +#endif static int aft_find_master_if_and_dchan(sdla_t *card, int *master_if, u32 active_ch) @@ -10965,4 +11052,9 @@ return 0; } + + + + + /****** End ****************************************************************/ diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/src/net/sdla_remora.c wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_remora.c --- wanpipe-3.2.2/patches/kdrivers/src/net/sdla_remora.c 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_remora.c 2008-02-05 14:14:02.000000000 -0500 @@ -367,7 +367,7 @@ static unsigned int wp_remora_active_map(sdla_fe_t* fe); static unsigned char wp_remora_fe_media(sdla_fe_t *fe); static int wp_remora_set_dtmf(sdla_fe_t*, int, unsigned char); -static int wp_remora_intr_ctrl(sdla_fe_t*, int, int, int, unsigned int); +static int wp_remora_intr_ctrl(sdla_fe_t*, int, u_int8_t, u_int8_t, unsigned int); static int wp_remora_event_ctrl(sdla_fe_t*, wan_event_ctrl_t*); static int sdla_rm_add_timer(sdla_fe_t*, unsigned long); @@ -2965,7 +2965,7 @@ * Returns: ******************************************************************************/ static int -wp_remora_intr_ctrl(sdla_fe_t *fe, int mod_no, int type, int mode, unsigned int ts_map) +wp_remora_intr_ctrl(sdla_fe_t *fe, int mod_no, u_int8_t type, u_int8_t mode, unsigned int ts_map) { int err = 0; @@ -2982,8 +2982,7 @@ } if (fe->rm_param.mod[mod_no].type == MOD_TYPE_FXS){ - switch(type){ - case WAN_RM_INTR_GLOBAL: + if (type & WAN_RM_INTR_GLOBAL){ if (mode == WAN_FE_INTR_ENABLE){ WRITE_RM_REG(mod_no, 21, fe->rm_param.mod[mod_no].u.fxs.imask1); WRITE_RM_REG(mod_no, 22, fe->rm_param.mod[mod_no].u.fxs.imask2); @@ -2993,30 +2992,16 @@ WRITE_RM_REG(mod_no, 22, 0x00); WRITE_RM_REG(mod_no, 23, 0x00); } - break; - default: - DEBUG_EVENT( - "%s: Module %d: Unsupported FXS interrupt type (%X)!\n", - fe->name, mod_no, type); - err = -EINVAL; - break; } }else if (fe->rm_param.mod[mod_no].type == MOD_TYPE_FXO){ - switch(type){ - case WAN_RM_INTR_GLOBAL: + + if (type & WAN_RM_INTR_GLOBAL){ if (mode == WAN_FE_INTR_ENABLE){ WRITE_RM_REG(mod_no, 3, fe->rm_param.mod[mod_no].u.fxo.imask); }else{ WRITE_RM_REG(mod_no, 3, 0x00); } - break; - default: - DEBUG_EVENT( - "%s: Module %d: Unsupported FXO interrupt type (%X)!\n", - fe->name, mod_no, type); - err = -EINVAL; - break; } } return err; diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/src/net/sdla_remora_tdmv.c wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_remora_tdmv.c --- wanpipe-3.2.2/patches/kdrivers/src/net/sdla_remora_tdmv.c 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_remora_tdmv.c 2008-02-05 14:44:21.000000000 -0500 @@ -1412,6 +1412,7 @@ #ifdef CONFIG_PRODUCT_WANPIPE_TDM_VOICE_ECHOMASTER wan_tdmv_rxtx_pwr_t *pwr_rxtx = NULL; #endif + sdla_t *card; WAN_ASSERT2(wr == NULL, -EINVAL); WAN_ASSERT2(channo < 0, -EINVAL); @@ -1420,6 +1421,7 @@ if (!IS_TDMV_UP(wr)){ return -EINVAL; } + card = wr->card; #ifdef CONFIG_PRODUCT_WANPIPE_TDM_VOICE_ECHOMASTER pwr_rxtx = &wan_tdmv->chan_pwr[channo]; @@ -1445,22 +1447,23 @@ wp_tdmv_echo_check(wan_tdmv, &wr->chans[channo], channo); #endif - if (!wan_test_bit(channo, &wr->echo_off_map)){ + if ((!card->wandev.ec_enable || card->wandev.ec_enable_map == 0) && + !wan_test_bit(channo, &wr->echo_off_map)) { + /*Echo spike starts at 25bytes*/ #ifdef CONFIG_PRODUCT_WANPIPE_TDM_VOICE_ECHOMASTER if(pwr_rxtx->current_state != ECHO_ABSENT){ #endif -#if 0 -/* Echo spike starts at 16 bytes */ - + + if (wan_test_bit(AFT_TDM_SW_RING_BUF,&card->u.aft.chip_cfg_status)) { + /* Updated for SWRING buffer + * Sets up the spike at 3 bytes */ zt_ec_chunk( &wr->chans[channo], wr->chans[channo].readchunk, wr->chans[channo].writechunk); -#endif - -#if 1 -/*Echo spike starts at 9 bytes*/ + } else { + /* This should be used without SWRING Echo spike starts at 9 bytes*/ zt_ec_chunk( &wr->chans[channo], wr->chans[channo].readchunk, @@ -1469,7 +1472,7 @@ wr->ec_chunk1[channo], wr->chans[channo].writechunk, ZT_CHUNKSIZE); -#endif + } #if 0 /*Echo spike starts at bytes*/ diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/src/net/sdla_tdmv.c wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_tdmv.c --- wanpipe-3.2.2/patches/kdrivers/src/net/sdla_tdmv.c 2008-01-16 16:53:59.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_tdmv.c 2008-01-22 18:26:25.000000000 -0500 @@ -1880,6 +1880,13 @@ WAN_ASSERT2(wp->card == NULL, -ENODEV); card = wp->card; + if (enable) { + wan_set_bit(channel,&card->wandev.rtp_tap_call_map); + } else { + wan_clear_bit(channel,&card->wandev.rtp_tap_call_map); + } + + if (card->wandev.ec_enable){ DEBUG_TDMV("[TDMV]: %s: %s HW echo canceller on channel %d\n", wp->devname, @@ -2337,6 +2344,12 @@ prefetch(wp->chans[x].writechunk); #endif + if (card->wandev.rtp_len && card->wandev.rtp_tap) { + card->wandev.rtp_tap(card,x, + wp->chans[x].readchunk, + wp->chans[x].writechunk, + ZT_CHUNKSIZE); + } } } diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/src/net/sdla_xilinx.c wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_xilinx.c --- wanpipe-3.2.2/patches/kdrivers/src/net/sdla_xilinx.c 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/src/net/sdla_xilinx.c 2008-02-05 14:34:14.000000000 -0500 @@ -53,10 +53,6 @@ DEVICE_DOWN }; -enum { - AFT_CHIP_CONFIGURED, - AFT_FRONT_END_UP, -}; enum { AFT_FE_CFG_ERR, diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/src/net/wanpipe_tdm_api.c wanpipe-3.2.4.p6/patches/kdrivers/src/net/wanpipe_tdm_api.c --- wanpipe-3.2.2/patches/kdrivers/src/net/wanpipe_tdm_api.c 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/src/net/wanpipe_tdm_api.c 2008-01-29 16:15:34.000000000 -0500 @@ -750,7 +750,13 @@ return -EINVAL; } #endif - skb_len=WP_TDM_API_MAX_LEN; + if (count > (WP_TDM_API_MAX_LEN+sizeof(wp_tdm_api_tx_hdr_t))) { + DEBUG_TEST("%s: Error: TDM API Tx packet too big %d\n", + tdm_api->name,count); + return -EFBIG; + } + + skb_len=WP_TDM_API_MAX_LEN+sizeof(wp_tdm_api_tx_hdr_t); } if (wan_skb_queue_len(&tdm_api->wp_tx_list) > tdm_api->tx_q_len){ diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/patches/kdrivers/src/net/wanpipe_utils.c wanpipe-3.2.4.p6/patches/kdrivers/src/net/wanpipe_utils.c --- wanpipe-3.2.2/patches/kdrivers/src/net/wanpipe_utils.c 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/patches/kdrivers/src/net/wanpipe_utils.c 2008-01-24 19:52:58.000000000 -0500 @@ -363,6 +363,8 @@ + +#if defined(__LINUX__) /* * =========================================================================== * Reply to UDP Management system. @@ -370,7 +372,9 @@ * mbox_len - includes data length and trace_info_t (chdlc and dsl). * Return length of reply. */ -int wan_ip_udp_setup(void* card_id, u32 ip, u32 udp_port, unsigned char *data, unsigned int mbox_len) +int wan_ip_udp_setup(void* card_id, wan_rtp_conf_t *rtp_conf, + u32 chan, + unsigned char *data, unsigned int mbox_len) { wan_rtp_pkt_t* rtp_pkt = (wan_rtp_pkt_t*)data; unsigned short len, @@ -394,19 +398,21 @@ #endif /* put it on an even boundary */ +#if 1 if (udp_length & 0x0001){ udp_length += 1; data[sizeof(ethhdr_t)+sizeof(iphdr_t)+udp_length]=0; len += 1; even_bound = 1; } +#endif temp = (udp_length<<8)|(udp_length>>8); rtp_pkt->wan_udp_len = temp; temp = rtp_pkt->wan_udp_sport; - rtp_pkt->wan_udp_sport = 0; - rtp_pkt->wan_udp_dport = udp_port; + rtp_pkt->wan_udp_sport = htons(rtp_conf->rtp_port+chan); + rtp_pkt->wan_udp_dport = htons(rtp_conf->rtp_port+chan); /* calculate UDP checksum */ rtp_pkt->wan_udp_sum = 0; @@ -422,16 +428,17 @@ rtp_pkt->wan_ip_len = temp; /* IP addresses */ - rtp_pkt->wan_ip_src = 0; - rtp_pkt->wan_ip_dst = ip; + rtp_pkt->wan_ip_src = rtp_conf->rtp_local_ip; + rtp_pkt->wan_ip_dst = rtp_conf->rtp_ip; rtp_pkt->wan_ip_v = 4; rtp_pkt->wan_ip_hl = 5; + rtp_pkt->wan_ip_len = htons(ip_length); rtp_pkt->wan_ip_tos = 1; rtp_pkt->wan_ip_ttl = 255; rtp_pkt->wan_ip_p = IPPROTO_UDP; - memset(rtp_pkt->wan_eth_dest,0xFF,ETH_ALEN); - memset(rtp_pkt->wan_eth_src,0xFF,ETH_ALEN); + memcpy(rtp_pkt->wan_eth_dest,rtp_conf->rtp_mac,ETH_ALEN); + memcpy(rtp_pkt->wan_eth_src,rtp_conf->rtp_local_mac,ETH_ALEN); rtp_pkt->wan_eth_proto=0x0008; /* fill in IP checksum */ @@ -440,7 +447,7 @@ return len+sizeof(ethhdr_t); } /* wan_ip_udp_setup */ - +#endif /* ***************************************************************************** Binary files wanpipe-3.2.2/patches/kdrivers/src/wan_aften/wan_aften_src.o and wanpipe-3.2.4.p6/patches/kdrivers/src/wan_aften/wan_aften_src.o differ Binary files wanpipe-3.2.2/patches/kdrivers/src/wan_aften/wanpipe_linux_iface.o and wanpipe-3.2.4.p6/patches/kdrivers/src/wan_aften/wanpipe_linux_iface.o differ Binary files wanpipe-3.2.2/patches/kdrivers/src/wanrouter/af_wanpipe_datascope.o and wanpipe-3.2.4.p6/patches/kdrivers/src/wanrouter/af_wanpipe_datascope.o differ Binary files wanpipe-3.2.2/patches/kdrivers/src/wanrouter/af_wanpipe_src.o and wanpipe-3.2.4.p6/patches/kdrivers/src/wanrouter/af_wanpipe_src.o differ Binary files wanpipe-3.2.2/patches/kdrivers/src/wanrouter/waniface.o and wanpipe-3.2.4.p6/patches/kdrivers/src/wanrouter/waniface.o differ Binary files wanpipe-3.2.2/patches/kdrivers/src/wanrouter/wanmain.o and wanpipe-3.2.4.p6/patches/kdrivers/src/wanrouter/wanmain.o differ Binary files wanpipe-3.2.2/patches/kdrivers/src/wanrouter/wanproc.o and wanpipe-3.2.4.p6/patches/kdrivers/src/wanrouter/wanproc.o differ diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/README.changes wanpipe-3.2.4.p6/README.changes --- wanpipe-3.2.2/README.changes 2008-01-18 17:54:49.000000000 -0500 +++ wanpipe-3.2.4.p6/README.changes 2008-02-07 18:16:15.000000000 -0500 @@ -7,6 +7,38 @@ Copyright (c) 1995-2008 Sangoma Technologies Inc. ------------------------------------------------------------------------------ + +* Thu Feb 1 2008 Nenad Corbic - Stable - 3.2.4 +======================================================================== + +- AFT IRQ Throttling feature + This feature is use to protect the server from + terrible lines. In some cases a bad hdlc line can + cause thousands of interrupts per sec. Rx errors are now + throttled so that system does not get compromized. + +- AFT RTP TAP Feature + RTP TAP Feature allows user to tap voice channels during + Asterisk-Zaptel/TMD API operation at the driver/kernel level. + Each voice stream is encapsulated in UDP/RTP header and transmitted over + neghbouring ethernet address directly from kenrel space. + Tapping 4E1s worth of voice channels adds estra 2% system load :) + http://wiki.sangoma.com/wanpipe-voice-rtp-tap + +- AFT Software Ring Buffers on A200/A400 Analog Cards + This feature improves analog preformance under Asterisk/TDM API + mode. In particualr it improves faxing reliability and + minimizes frame slippage due to system load or bad incoming + clock from the line. + Note: All AFT T1/E1 cards have this feature in hardare :) + + +* Thu Jan 18 2008 Nenad Corbic - Stable - 3.2.3 +======================================================================== + +- No changes from 3.2.2 + Version updated for versioning sake. + * Thu Jan 18 2008 Nenad Corbic - Stable - 3.2.2 ======================================================================== diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/rpmspec/wanpipe-mod.spec wanpipe-3.2.4.p6/rpmspec/wanpipe-mod.spec --- wanpipe-3.2.2/rpmspec/wanpipe-mod.spec 2008-01-18 18:23:33.000000000 -0500 +++ wanpipe-3.2.4.p6/rpmspec/wanpipe-mod.spec 2008-02-15 17:47:08.000000000 -0500 @@ -1,6 +1,6 @@ %define WANPIPE_VER wanpipe-modules %define name %{WANPIPE_VER} -%define version 3.2.2 +%define version 3.2.4.p6 %define release 0 %define serial 1 %define MODULES_DIR /lib/modules @@ -50,6 +50,38 @@ %changelog + +* Thu Feb 1 2008 Nenad Corbic - Stable - 3.2.4 +======================================================================== + +- AFT IRQ Throttling feature + This feature is use to protect the server from + terrible lines. In some cases a bad hdlc line can + cause thousands of interrupts per sec. Rx errors are now + throttled so that system does not get compromized. + +- AFT RTP TAP Feature + RTP TAP Feature allows user to tap voice channels during + Asterisk-Zaptel/TMD API operation at the driver/kernel level. + Each voice stream is encapsulated in UDP/RTP header and transmitted over + neghbouring ethernet address directly from kenrel space. + Tapping 4E1s worth of voice channels adds estra 2% system load :) + http://wiki.sangoma.com/wanpipe-voice-rtp-tap + +- AFT Software Ring Buffers on A200/A400 Analog Cards + This feature improves analog preformance under Asterisk/TDM API + mode. In particualr it improves faxing reliability and + minimizes frame slippage due to system load or bad incoming + clock from the line. + Note: All AFT T1/E1 cards have this feature in hardare :) + + +* Thu Jan 18 2008 Nenad Corbic - Stable - 3.2.3 +======================================================================== + +- No changes from 3.2.2 + Version updated for versioning sake. + * Thu Jan 18 2008 Nenad Corbic - Stable - 3.2.2 ======================================================================== diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/rpmspec/wanpipe.spec wanpipe-3.2.4.p6/rpmspec/wanpipe.spec --- wanpipe-3.2.2/rpmspec/wanpipe.spec 2008-01-18 18:23:33.000000000 -0500 +++ wanpipe-3.2.4.p6/rpmspec/wanpipe.spec 2008-02-15 17:47:08.000000000 -0500 @@ -1,7 +1,7 @@ %define KERNEL_VERSION %{?kern_ver} %define WANPIPE_VER wanpipe %define name %{WANPIPE_VER} -%define version 3.2.2 +%define version 3.2.4.p6 %define release 0 %define serial 1 %define UTILS_DIR /usr/sbin @@ -254,6 +254,38 @@ %changelog + +* Thu Feb 1 2008 Nenad Corbic - Stable - 3.2.4 +======================================================================== + +- AFT IRQ Throttling feature + This feature is use to protect the server from + terrible lines. In some cases a bad hdlc line can + cause thousands of interrupts per sec. Rx errors are now + throttled so that system does not get compromized. + +- AFT RTP TAP Feature + RTP TAP Feature allows user to tap voice channels during + Asterisk-Zaptel/TMD API operation at the driver/kernel level. + Each voice stream is encapsulated in UDP/RTP header and transmitted over + neghbouring ethernet address directly from kenrel space. + Tapping 4E1s worth of voice channels adds estra 2% system load :) + http://wiki.sangoma.com/wanpipe-voice-rtp-tap + +- AFT Software Ring Buffers on A200/A400 Analog Cards + This feature improves analog preformance under Asterisk/TDM API + mode. In particualr it improves faxing reliability and + minimizes frame slippage due to system load or bad incoming + clock from the line. + Note: All AFT T1/E1 cards have this feature in hardare :) + + +* Thu Jan 18 2008 Nenad Corbic - Stable - 3.2.3 +======================================================================== + +- No changes from 3.2.2 + Version updated for versioning sake. + * Thu Jan 18 2008 Nenad Corbic - Stable - 3.2.2 ======================================================================== diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/rpmspec/wanpipe-util.spec wanpipe-3.2.4.p6/rpmspec/wanpipe-util.spec --- wanpipe-3.2.2/rpmspec/wanpipe-util.spec 2008-01-18 18:23:33.000000000 -0500 +++ wanpipe-3.2.4.p6/rpmspec/wanpipe-util.spec 2008-02-15 17:47:08.000000000 -0500 @@ -1,7 +1,7 @@ %define KERNEL_VERSION %{?kern_ver} %define WANPIPE_VER wanpipe-util %define name %{WANPIPE_VER} -%define version 3.2.2 +%define version 3.2.4.p6 %define release 0 %define serial 1 %define ETC_DIR /etc @@ -246,6 +246,38 @@ %changelog + +* Thu Feb 1 2008 Nenad Corbic - Stable - 3.2.4 +======================================================================== + +- AFT IRQ Throttling feature + This feature is use to protect the server from + terrible lines. In some cases a bad hdlc line can + cause thousands of interrupts per sec. Rx errors are now + throttled so that system does not get compromized. + +- AFT RTP TAP Feature + RTP TAP Feature allows user to tap voice channels during + Asterisk-Zaptel/TMD API operation at the driver/kernel level. + Each voice stream is encapsulated in UDP/RTP header and transmitted over + neghbouring ethernet address directly from kenrel space. + Tapping 4E1s worth of voice channels adds estra 2% system load :) + http://wiki.sangoma.com/wanpipe-voice-rtp-tap + +- AFT Software Ring Buffers on A200/A400 Analog Cards + This feature improves analog preformance under Asterisk/TDM API + mode. In particualr it improves faxing reliability and + minimizes frame slippage due to system load or bad incoming + clock from the line. + Note: All AFT T1/E1 cards have this feature in hardare :) + + +* Thu Jan 18 2008 Nenad Corbic - Stable - 3.2.3 +======================================================================== + +- No changes from 3.2.2 + Version updated for versioning sake. + * Thu Jan 18 2008 Nenad Corbic - Stable - 3.2.2 ======================================================================== diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/samples/wanrouter wanpipe-3.2.4.p6/samples/wanrouter --- wanpipe-3.2.2/samples/wanrouter 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/samples/wanrouter 2008-02-15 16:51:33.000000000 -0500 @@ -2106,7 +2106,7 @@ RUGGEDCOM=No if [ $OSYSTEM = "Linux" ]; then - ROUTER_VERSION=3.2.2 + ROUTER_VERSION=3.2.4.p6 IFCONFIG_LIST=ifconfig MODULE_STAT=lsmod WAN_DRIVERS="wanpipe" diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/Setup wanpipe-3.2.4.p6/Setup --- wanpipe-3.2.2/Setup 2008-01-17 12:37:07.000000000 -0500 +++ wanpipe-3.2.4.p6/Setup 2008-02-15 16:51:33.000000000 -0500 @@ -539,13 +539,13 @@ missing_packages=$missing_packages"libtermcap-devel " fi - echo -n "Checking for yacc..." - eval "type yacc 2> /dev/null > /dev/null" + echo -n "Checking for bison..." + eval "type bison 2> /dev/null > /dev/null" if [ $? -eq 0 ]; then echo "OK" - else - echo "Failed!" - missing_packages=$missing_packages"yacc " + else + echo "Failed!" + missing_packages=$missing_packages"bison " fi echo @@ -600,10 +600,10 @@ echo -e " Required for Wancfg configuration utility." echo -e " Install flex package (e.g yum install flex)." ;; - yacc) - echo -e "\n Yacc." + bison) + echo -e "\n Bison." echo -e " Required for Wanpipe Utilities." - echo -e " Install byacc package (e.g yum install byacc)." + echo -e " Install bison package (e.g yum install bison)." ;; esac @@ -1274,7 +1274,7 @@ - defines interfaces, hardware and protocol information. - this file can be created using the 'wancfg' GUI utility or manually based on sample files located - in /etc/wanpipe/samples. + in $WAN_CONF_DIR/samples. Please read the WanpipeInstallation.(pdf/txt) manual for further information. @@ -1297,7 +1297,7 @@ #banner if test -z $NONINTERACTIVE; then echo -e "\nPlease specify a desired location for ${DISTR_NAME} configuration files." - echo -e "\n\t(Press Enter for Default: /etc/wanpipe)\n" + echo -e "\n\t(Press Enter for Default: $WAN_CONF_DIR)\n" echo -n "" read response @@ -1333,17 +1333,17 @@ #banner if test -z $NONINTERACTIVE; then echo -e "\nPlease specify a location for WANPIPE binary, firmware files." - echo -e "\n\t(Press Enter for Default: /etc/wanpipe/firmware)\n" + echo -e "\n\t(Press Enter for Default: $WAN_CONF_DIR/firmware)\n" echo -n "" read response if [ $response ]; then WAN_FIRMWARE_DIR=$response else - WAN_FIRMWARE_DIR=/etc/wanpipe/firmware + WAN_FIRMWARE_DIR=$WAN_CONF_DIR/firmware fi else - WAN_FIRMWARE_DIR=/etc/wanpipe/firmware + WAN_FIRMWARE_DIR=$WAN_CONF_DIR/firmware fi if [ ! -d $WAN_FIRMWARE_DIR ]; then @@ -1354,7 +1354,7 @@ echo -e "\nERROR: Directory $WAN_FIRMWARE_DIR not found !\n" getyn "Would you like to try again?" if [ $? -ne 0 ]; then - WAN_FIRMWARE_DIR=/etc/wanpipe/firmware + WAN_FIRMWARE_DIR=$WAN_CONF_DIR/firmware else get_bin_dir fi @@ -1367,7 +1367,7 @@ local response=no local response1 - WAN_INTR_DIR=/etc/wanpipe/interfaces + WAN_INTR_DIR=$WAN_CONF_DIR/interfaces if [ ! -d $WAN_INTR_DIR ]; then \mkdir -p $WAN_INTR_DIR @@ -1403,7 +1403,7 @@ echo -n "" read response1 - WAN_INTR_DIR=/etc/wanpipe/interfaces + WAN_INTR_DIR=$WAN_CONF_DIR/interfaces if [ $response1 ]; then WAN_INTR_DIR=$response1 @@ -1417,7 +1417,7 @@ echo -e "\nERROR: Directory $WAN_INTR_DIR not found !\n" getyn "Would you like to try again?" if [ $? -ne 0 ]; then - WAN_INTR_DIR=/etc/wanpipe/interfaces + WAN_INTR_DIR=$WAN_CONF_DIR/interfaces else get_intr_dir fi @@ -1439,7 +1439,7 @@ elif [ -d /var/adm wanpipe1]; then LOG_FILE=/var/adm/$PROD else - LOG_FILE=/etc/wanpipe/$PROD.log + LOG_FILE=$WAN_CONF_DIR/$PROD.log fi # Select directory for the lock file. @@ -1450,20 +1450,20 @@ LOCK_FILE=/var/lock/$PROD LOCK_DIR=/var/lock else - LOCK_FILE=/etc/wanpipe/$PROD.lck - LOCK_DIR=/etc/wanpipe + LOCK_FILE=$WAN_CONF_DIR/$PROD.lck + LOCK_DIR=$WAN_CONF_DIR fi - if [ -f $ROOT/etc/wanpipe/wanrouter.rc ]; then - . /etc/wanpipe/wanrouter.rc + if [ -f $ROOT$WAN_CONF_DIR/wanrouter.rc ]; then + . $ROOT$WAN_CONF_DIR/wanrouter.rc fi if [ "$WAN_DEVICES" = "" ]; then WAN_DEVICES="wanpipe1" else echo - echo "Wanpipe META config file found in /etc/wanpipe directory" + echo "Wanpipe META config file found in $WAN_CONF_DIR directory" echo echo "Wanpipe startup sequence: $WAN_DEVICES" echo @@ -1521,7 +1521,7 @@ # router.rc WAN router meta-configuration file. # # This file defines variables used by the router shell scripts -# and should be located in /etc/wanpipe directory. These are: +# and should be located in $WAN_CONF_DIR directory. These are: # # ROUTER_BOOT = Boot flag (YES/NO). # WAN_CONF_DIR = Where to put wanpipe config files. @@ -1552,13 +1552,13 @@ echo "WAN_LOCK_DIR=$LOCK_DIR" >> $META_CONF echo "WAN_IP_FORWARD=$ENABLE_IP_FWD" >> $META_CONF echo "NEW_IF_TYPE=$NEW_IF_TYPE" >> $META_CONF - echo "WAN_LIB_DIR=/etc/wanpipe/lib" >> $META_CONF - echo "WAN_ADSL_LIST=/etc/wanpipe/wan_adsl.list" >> $META_CONF + echo "WAN_LIB_DIR=$WAN_CONF_DIR/lib" >> $META_CONF + echo "WAN_ADSL_LIST=$WAN_CONF_DIR/wan_adsl.list" >> $META_CONF echo "WAN_ANNEXG_LOAD=$ANNEXG_LOAD" >> $META_CONF echo "WAN_SCTP_LOAD=$SCTP_LOAD" >> $META_CONF echo "WAN_LIP_LOAD=$LIP_LOAD" >> $META_CONF echo "WAN_DYN_WANCONFIG=NO" >> $META_CONF - echo "WAN_SCRIPTS_DIR=/etc/wanpipe/scripts" >> $META_CONF + echo "WAN_SCRIPTS_DIR=$WAN_CONF_DIR/scripts" >> $META_CONF echo "WAN_FIRMWARE_DIR=$WAN_FIRMWARE_DIR" >> $META_CONF echo "WAN_DEVICES_REV_STOP_ORDER=YES" >> $META_CONF echo "WAN_DEVICES=\"$WAN_DEVICES\"" >> $META_CONF @@ -1756,11 +1756,11 @@ #FIXME: Find a better way of doing this if [ "$PKG_NAME" != "wanpipe-lite" ]; then - if [ -d /etc/wanpipe ]; then - rm -rf /etc/wanpipe + if [ -d $WAN_CONF_DIR ]; then + rm -rf $WAN_CONF_DIR fi else - IFCFG_LIST=`ls /etc/wanpipe/ifcfg-* 2>/dev/null` + IFCFG_LIST=`ls $WAN_CONF_DIR/ifcfg-* 2>/dev/null` for ifcfg in $IFCFG_LIST; do [ -f "$ifcfg" ] && rm -f $ifcfg done @@ -1845,7 +1845,7 @@ 4) debug line, protocol and driver problems. (/usr/sbin/wanpipemon) 5) aid in WANPIPE API development - (/etc/wanpipe/api) + ($WAN_CONF_DIR/api) Refer to the WanpipeInstallation.(pdf/txt) for more information. @@ -4468,12 +4468,17 @@ echo "Installing ${DISTR_NAME} Utilities in $ROOT/usr/sbin" + if [ ! -e $WAN_CONF_DIR ]; then + \mkdir -p $WAN_CONF_DIR + \mkdir -p $WAN_CONF_DIR/util + fi + cd $PROD_HOME/util make install WAN_VIRTUAL=$ROOT > /dev/null 2> /dev/null if [ "$PKG_NAME" = "wanpipe-lite" ]; then cd $PROD_HOME - \cp -rf samples $ROOT/etc/wanpipe + \cp -rf samples $ROOT$WAN_CONF_DIR install -D -m 755 $PROD_HOME/scripts/wanlite $ROOT/usr/sbin/wanlite pause return 0 @@ -4484,20 +4489,20 @@ cd $PROD_HOME/util/misc make install WAN_VIRTUAL=$ROOT > /dev/null 2> /dev/null - echo "Installing wanrouter.rc in $ROOT/etc/wanpipe" + echo "Installing wanrouter.rc in $ROOT$WAN_CONF_DIR" cd $PROD_HOME - install -D -m 644 wanrouter.rc $ROOT/etc/wanpipe/wanrouter.rc + install -D -m 644 wanrouter.rc $ROOT$WAN_CONF_DIR/wanrouter.rc - echo "Installing wanpipe libraries in $ROOT/etc/wanpipe" + echo "Installing wanpipe libraries in $ROOT$WAN_CONF_DIR" - \mkdir -p $ROOT/etc/wanpipe/lib/ - \cp -f $PROD_HOME/util/wancfg_legacy/lib/* $ROOT/etc/wanpipe/lib/ + \mkdir -p $ROOT$WAN_CONF_DIR/lib/ + \cp -f $PROD_HOME/util/wancfg_legacy/lib/* $ROOT$WAN_CONF_DIR/lib/ - echo "Installing firmware in $ROOT/etc/wanpipe/firmware" - \cp -rf firmware $ROOT/etc/wanpipe/ + echo "Installing firmware in $ROOT$WAN_CONF_DIR/firmware" + \cp -rf firmware $ROOT$WAN_CONF_DIR/ - if [ ! -f $ROOT/etc/wanpipe/interfaces ]; then - \mkdir -p $ROOT/etc/wanpipe/interfaces + if [ ! -f $ROOT$WAN_CONF_DIR/interfaces ]; then + \mkdir -p $ROOT$WAN_CONF_DIR/interfaces fi echo "Installing documentation in $ROOT/usr/share/doc/wanpipe" @@ -4507,25 +4512,37 @@ \cp -f doc/* $ROOT/usr/share/doc/wanpipe \cp -f README* $ROOT/usr/share/doc/wanpipe - echo "Installing sample api code in $ROOT/etc/wanpipe/api" - \cp -rf api $ROOT/etc/wanpipe - \cp -rf samples $ROOT/etc/wanpipe - \cp -rf util/wanec_apilib /etc/wanpipe/api + echo "Installing sample api code in $ROOT$WAN_CONF_DIR/api" + \cp -rf api $ROOT$WAN_CONF_DIR + \cp -rf samples $ROOT$WAN_CONF_DIR - if [ ! -d $ROOT/etc/wanpipe/scripts ]; then - \mkdir -p $ROOT/etc/wanpipe/scripts + echo "Installing AFT Firmware update utility in $ROOT$WAN_CONF_DIR/util" + \cp -rf util/wanec_apilib/ $ROOT$WAN_CONF_DIR/util + \cp -rf util/wan_aftup/ $ROOT$WAN_CONF_DIR/util + + cd firmware + if [ -e wan_aftup ]; then + \rm -f wan_aftup 2> /dev/null + fi + \ln -s ../util/wan_aftup wan_aftup + + cd $PROD_HOME + + + if [ ! -d $ROOT$WAN_CONF_DIR/scripts ]; then + \mkdir -p $ROOT$WAN_CONF_DIR/scripts fi - echo "Installing driver headers in $ROOT/etc/wanpipe/api/include/linux" - if [ ! -d $ROOT/etc/wanpipe/api/include/linux ]; then - \mkdir -p $ROOT/etc/wanpipe/api/include/linux + echo "Installing driver headers in $ROOT$WAN_CONF_DIR/api/include/linux" + if [ ! -d $ROOT$WAN_CONF_DIR/api/include/linux ]; then + \mkdir -p $ROOT$WAN_CONF_DIR/api/include/linux fi cd $PROD_HOME if [ -d wan_ec ]; then - cp -rf wan_ec $ROOT/etc/wanpipe + cp -rf wan_ec $ROOT$WAN_CONF_DIR echo "Installing Hardware Echo Cancel Utilites" cd util/wanec_client make install WAN_VIRTUAL=$ROOT > /dev/null 2> /dev/null @@ -4540,11 +4557,11 @@ cd $PROD_HOME - if [ ! -f $ROOT/etc/wanpipe/api/include/linux/ ]; then - \mkdir -p $ROOT/etc/wanpipe/api/include/linux/ + if [ ! -f $ROOT$WAN_CONF_DIR/api/include/linux/ ]; then + \mkdir -p $ROOT$WAN_CONF_DIR/api/include/linux/ fi - \cp -f $DRIVER_UPDATE_DIR/include/*.* $ROOT/etc/wanpipe/api/include/linux/ + \cp -f $DRIVER_UPDATE_DIR/include/*.* $ROOT$WAN_CONF_DIR/api/include/linux/ pause return 0 @@ -4568,7 +4585,7 @@ cd $PROD_HOME rm -f $ROOT/usr/sbin/wp_pppconfig rm -rf $ROOT/usr/doc/wanpipe - rm -rf $ROOT/etc/wanpipe + rm -rf $ROOT/$WAN_CONF_DIR pause return 0 @@ -5872,8 +5889,14 @@ if [ -f $ZAPTEL_INSTALL_DIR/zaptel-base.c ]; then eval "grep hdlc_hard_xmit $ZAPTEL_INSTALL_DIR/zaptel-base.c > /dev/null 2> /dev/null" if [ $? -eq 0 ] ; then + echo echo "Native Zaptel HW HDLC Support Detected - No patch required" - echo "Zaptel source unmodified" + echo "Zaptel source unmodified, no zaptel re-compilation needed!" + echo + pause + + echo + echo TDM_DCHAN="(DCHAN)" PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN_ZAPTEL " @@ -6004,6 +6027,7 @@ fi fi tdmv_check_zaptel_udev + echo fi fi PROT_MATCH=YES @@ -6162,29 +6186,6 @@ fi } -function compile_aft_firmware_util() -{ - lhome=`pwd` - \cp -f $PROD_HOME/util/wan_aftup $PROD_HOME/rpmbuild/etc/wanpipe/firmware/ -r - - cd $PROD_HOME/rpmbuild/etc/wanpipe/firmware/wan_aftup - echo "Compiling firmware update utilities..." - eval "make wan_aftup" >/dev/null 2>/dev/null - if [ ! $? -eq 0 ]; then - echo "failed" - exit - else - echo "done" - fi - - - \rm -f *.c - \rm -f *.o - \rm -f *.h - \rm -f Makefile - cd $lhome -} - function usage() { if [ "$PKG_NAME" != "wanpipe-lite" ]; then @@ -6321,10 +6322,10 @@ PKG_NAME=wanpipe DISTR_NAME="WANPIPE" PROD=wanrouter -PROD_VER=3.2.2 +PROD_VER=3.2.4.p6 PROD_HOME=`pwd` -WAN_CONF_DIR=/etc/wanpipe -META_CONF=$WAN_CONF_DIR/$PROD.rc +WAN_CONF_DIR=/etc/wanpipe +META_CONF=$PROD_HOME/$PROD.rc WAN_INTR_DIR=$PROD_HOME/interfaces PROD_CONF=$WAN_CONF_DIR/wanpipe1.conf PROD_PATCH=$PROD_HOME/patches @@ -6956,7 +6957,6 @@ fi if [ "$setup_cmd" = "buildrpm" ]; then - compile_aft_firmware_util detect_rpm_build_utility diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/util/ft1/Makefile wanpipe-3.2.4.p6/util/ft1/Makefile --- wanpipe-3.2.2/util/ft1/Makefile 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/util/ft1/Makefile 2008-02-01 16:16:13.000000000 -0500 @@ -14,7 +14,7 @@ SYSINC=/lib/modules/$(shell uname -r)/build/include # Tools options. -CFLAGS = -D__LINUX__ -Wall -O2 -D_GNUC_ -I$(SYSINC) -D$(OS_TYPE) -D_DEBUG_=$(DEBUG) +CFLAGS = -D__LINUX__ -Wall -O2 -D_GNUC_ -I$(SYSINC) -D$(OS_TYPE) -D_DEBUG_=$(DEBUG) -I../../patches/kdrivers/include LIBS = -lncurses ####### RULES ################################################################ diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/util/Makefile wanpipe-3.2.4.p6/util/Makefile --- wanpipe-3.2.2/util/Makefile 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/util/Makefile 2008-02-05 15:08:31.000000000 -0500 @@ -12,6 +12,7 @@ make -C wanconfig all CC=$(CC) SYSINC=$(SYSINC) EXTRA_FLAGS="$(EXTRA_FLAGS)" ARCH=$(ARCH) make -C wanec_client all CC=$(CC) SYSINC=$(SYSINC) WANINCDIR=$(WANINCDIR) EXTRA_FLAGS="$(EXTRA_FLAGS)" ARCH=$(ARCH) make -C wan_plxctrl all CC=$(CC) SYSINC=$(SYSINC) EXTRA_FLAGS="$(EXTRA_FLAGS)" ARCH=$(ARCH) + make -C wan_aftup all CC=$(CC) SYSINC=$(SYSINC) EXTRA_FLAGS="$(EXTRA_FLAGS)" ARCH=$(ARCH) make -C wanpipemon all CC=$(CC) SYSINC=$(SYSINC) PROTOCOL_DEFS=$(PROTOCOL_DEFS) ENABLE_WANPIPEMON_ZAP=$(ENABLE_WANPIPEMON_ZAP) EXTRA_FLAGS="$(EXTRA_FLAGS)" ARCH=$(ARCH) make -C wanpipemon_legacy all CC=$(CC) SYSINC=$(SYSINC) PROTOCOL_DEFS=$(PROTOCOL_DEFS) EXTRA_FLAGS="$(EXTRA_FLAGS)" ARCH=$(ARCH) make -C bwm all SYSINC=$(SYSINC) CC=$(CC) PROTOCOL_DEFS=$(PROTOCOL_DEFS) EXTRA_FLAGS="$(EXTRA_FLAGS)" ARCH=$(ARCH) diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/util/wan_aftup/Makefile wanpipe-3.2.4.p6/util/wan_aftup/Makefile --- wanpipe-3.2.2/util/wan_aftup/Makefile 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/util/wan_aftup/Makefile 2008-02-05 15:07:54.000000000 -0500 @@ -28,12 +28,14 @@ # Project file paths. SYSINC=/lib/modules/$(shell uname -r)/build/include endif +SRCINC=../../patches/kdrivers/include +WANINC=/usr/include/wanpipe WAN_VIRTUAL= # Tools options. -CFLAGS = -Wall -O2 -D$(OS_TYPE) -I$(SYSINC) -D_DEBUG_=$(DEBUG) +CFLAGS = -Wall -O2 -D$(OS_TYPE) -I$(SYSINC) -I$(SRCINC) -I$(WANINC) -D_DEBUG_=$(DEBUG) ####### RULES ################################################################ diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/util/wan_aftup/update_aft_firm.sh wanpipe-3.2.4.p6/util/wan_aftup/update_aft_firm.sh --- wanpipe-3.2.2/util/wan_aftup/update_aft_firm.sh 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/util/wan_aftup/update_aft_firm.sh 2008-02-05 15:13:26.000000000 -0500 @@ -2,8 +2,10 @@ cmd=$1; -eval "make clean > /dev/null" -eval "make > /dev/null" +if [ ! -e wan_aftup ]; then + eval "make clean > /dev/null" + eval "make > /dev/null" +fi if [ -e /proc/net/wanrouter ]; then diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/util/wan_aftup/wan_aftup.c wanpipe-3.2.4.p6/util/wan_aftup/wan_aftup.c --- wanpipe-3.2.2/util/wan_aftup/wan_aftup.c 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/util/wan_aftup/wan_aftup.c 2008-01-29 11:09:32.000000000 -0500 @@ -77,7 +77,7 @@ ***********************************************************************/ static int sock; static wan_cmd_api_t api_cmd; -static unsigned char ifname_def[20]; +static char ifname_def[20]; static struct ifreq req; int options = 0x00; static char aft_firmware_force[MAXPATHLEN]; @@ -602,17 +602,17 @@ /* Read subsystem vendor ID */ exec_read_cmd(aft, - PCI_DEVICE_ID_WORD, 2, &aft->chip_id); - exec_read_cmd(aft, 0x08, 1, &aft->revision_id); + PCI_DEVICE_ID_WORD, 2, (unsigned int*)&aft->chip_id); + exec_read_cmd(aft, 0x08, 1, (unsigned int*)&aft->revision_id); #if defined(__OpenBSD__) exec_read_cmd(aft, PCI_SUBSYS_VENDOR_WORD, 4, &aft->board_id); aft->board_id &= 0xFFFF; #else exec_read_cmd(aft, - PCI_SUBSYS_VENDOR_WORD, 2, &aft->board_id); + PCI_SUBSYS_VENDOR_WORD, 2, (unsigned int*)&aft->board_id); #endif - exec_read_cmd(aft, PCI_SUBSYS_ID_WORD, 2, &tmp); + exec_read_cmd(aft, PCI_SUBSYS_ID_WORD, 2, (unsigned int*)&tmp); aft->core_rev = AFT_CORE_REV(tmp); aft->core_id = AFT_CORE_ID(tmp); @@ -718,7 +718,7 @@ aft->cpld.chip_id = AFT_CHIP_X300; /* Read revision ID */ exec_read_cmd(aft, - 0x08, 1, &aft->cpld.adptr_subtype); + 0x08, 1, (unsigned int*)&aft->cpld.adptr_subtype); if (aft->cpld.adptr_subtype == 0x01){ /* A101/A102 new cards */ strncpy(aft->prefix_fw, "A101N", 5); @@ -848,7 +848,7 @@ char sel_name[20], *tmp = NULL; int j, cnt = 0; - tmp = strtok(api_cmd->data, "\n"); + tmp = strtok((char*)api_cmd->data, "\n"); while (tmp){ /* Create new interface structure */ aft = malloc(sizeof(wan_aftup_t)); @@ -886,8 +886,8 @@ while(aft){ /* Use api_cmd structure to parse hwprobe info */ - strncpy(api_cmd->data, aft->hwinfo, strlen(aft->hwinfo)); - tmp = strtok(api_cmd->data, ":"); + strncpy((char*)api_cmd->data, aft->hwinfo, strlen(aft->hwinfo)); + tmp = strtok((char*)api_cmd->data, ":"); if (tmp == NULL){ printf("ERROR:%d: Internal error (hwinfo:%s)\n", __LINE__, aft->hwinfo); diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/util/wan_aftup/wan_plxctrl.c wanpipe-3.2.4.p6/util/wan_aftup/wan_plxctrl.c --- wanpipe-3.2.2/util/wan_aftup/wan_plxctrl.c 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/util/wan_aftup/wan_plxctrl.c 2008-01-29 11:09:48.000000000 -0500 @@ -77,11 +77,11 @@ void PEX_8111Read(void *info, int addr, int *data) { if (addr < 0x1000){ - exec_bridge_read_cmd(info, addr, 4, data); + exec_bridge_read_cmd(info, addr, 4, (unsigned int*)data); }else if (addr >= 0x1000 && addr <= 0x1FFF){ exec_bridge_write_cmd(info, 0x84, 4, addr); - exec_bridge_read_cmd(info, 0x88, 4, data); + exec_bridge_read_cmd(info, 0x88, 4, (unsigned int*)data); } } Only in wanpipe-3.2.4.p6/util/wancfg_zaptel/templates: zaptel.conf_test diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/util/wancfg_zaptel/wancfg_zaptel.pl wanpipe-3.2.4.p6/util/wancfg_zaptel/wancfg_zaptel.pl --- wanpipe-3.2.2/util/wancfg_zaptel/wancfg_zaptel.pl 2008-01-17 10:14:34.000000000 -0500 +++ wanpipe-3.2.4.p6/util/wancfg_zaptel/wancfg_zaptel.pl 2008-02-15 11:09:20.000000000 -0500 @@ -255,7 +255,7 @@ sub set_zaptel_hwhdlc{ - if ((system("grep hdlc_hard_xmit '$include_dir/zaptel/zaptel.h'>/dev/null 2>/dev/null")==0)){ + if ((system("ztcfg -t -c $current_dir/templates/zaptel.conf_test > /dev/null 2>/dev/null")==0)){ $dchan_str="hardhdlc"; } } diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/util/wanconfig/wanconfig.c wanpipe-3.2.4.p6/util/wanconfig/wanconfig.c --- wanpipe-3.2.2/util/wanconfig/wanconfig.c 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/util/wanconfig/wanconfig.c 2008-02-14 16:11:26.000000000 -0500 @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -543,6 +544,7 @@ { "FE_FRAME", offsetof(wandev_conf_t, fe_cfg)+smemof(sdla_fe_cfg_t, frame), DTYPE_UCHAR }, { "FE_LINE", offsetof(wandev_conf_t, fe_cfg)+smemof(sdla_fe_cfg_t, line_no), DTYPE_UINT }, { "FE_TXTRISTATE", offsetof(wandev_conf_t, fe_cfg)+smemof(sdla_fe_cfg_t, tx_tristate_mode), DTYPE_UCHAR }, + { "FE_POLL", offsetof(wandev_conf_t, fe_cfg)+smemof(sdla_fe_cfg_t, poll_mode), DTYPE_UCHAR }, /* Front-End parameters (old style) */ /* Front-End parameters (old style) */ { "MEDIA", offsetof(wandev_conf_t, fe_cfg)+smemof(sdla_fe_cfg_t, media), DTYPE_UCHAR }, @@ -579,6 +581,13 @@ { "TDMV_SPAN", offsetof(wandev_conf_t, tdmv_conf)+smemof(wan_tdmv_conf_t, span_no), DTYPE_UINT}, { "TDMV_DCHAN", offsetof(wandev_conf_t, tdmv_conf)+smemof(wan_tdmv_conf_t, dchan), DTYPE_UINT}, { "TDMV_HW_DTMF", offsetof(wandev_conf_t, tdmv_conf)+smemof(wan_tdmv_conf_t, hw_dtmf), DTYPE_UCHAR}, + + { "RTP_TAP_IP", offsetof(wandev_conf_t, rtp_conf)+smemof(wan_rtp_conf_t, rtp_ip), DTYPE_UINT}, + { "RTP_TAP_PORT", offsetof(wandev_conf_t, rtp_conf)+smemof(wan_rtp_conf_t, rtp_port), DTYPE_USHORT}, + { "RTP_TAP_SAMPLE", offsetof(wandev_conf_t, rtp_conf)+smemof(wan_rtp_conf_t, rtp_sample), DTYPE_USHORT}, + { "RTP_TAP_DEV", offsetof(wandev_conf_t, rtp_conf)+smemof(wan_rtp_conf_t, rtp_devname), DTYPE_STR}, + { "RTP_TAP_MAC", offsetof(wandev_conf_t, rtp_conf)+smemof(wan_rtp_conf_t, rtp_mac), DTYPE_STR}, + { "HWEC_CLKSRC", offsetof(wandev_conf_t, hwec_conf)+smemof(wan_hwec_conf_t, clk_src), DTYPE_UINT}, { "HWEC_PERSIST_DISABLE", offsetof(wandev_conf_t, hwec_conf)+smemof(wan_hwec_conf_t, persist_disable), DTYPE_UINT}, @@ -711,6 +720,10 @@ // { "HWEC_CLKSRC", smemof(wan_xilinx_conf_t, ec_clk_src), DTYPE_UINT}, // { "TDMV_HWEC", smemof(wan_xilinx_conf_t, tdmv_hwec), DTYPE_UCHAR}, { "RX_CRC_BYTES", smemof(wan_xilinx_conf_t, rx_crc_bytes), DTYPE_UINT}, + + { "ERR_CHECK_PERIOD", smemof(wan_xilinx_conf_t, err_throttle_period), DTYPE_UINT}, + { "ERR_TIMEOUT", smemof(wan_xilinx_conf_t, err_throttle_timeout), DTYPE_UINT}, + { NULL, 0, 0 } }; @@ -3217,6 +3230,61 @@ if (verbose) printf(" * Setting %s to %s\n", key, val); + + if (strcmp(key, "RTP_TAP_IP") == 0) { + int err; + struct hostent *result = NULL; +#if defined(__LINUX__) + char buf[512]; + struct hostent hp; + gethostbyname_r(val, &hp, buf, sizeof(buf), &result, &err); +#else + result = gethostbyname(val); + err = h_errno; +#endif + if (result) { +#if defined(__LINUX__) + memcpy((char*)conf + dtab->offset, hp.h_addr_list[0], hp.h_length); +#else + memcpy((char*)conf + dtab->offset, result->h_addr_list[0], result->h_length); +#endif + } else { + printf("Error: Invalid IP Address %s (%s)\n", + val, hstrerror(err)); + memset((char*)conf + dtab->offset, 0, sizeof(unsigned int)); + err=1; + } + return err; + } + + if (strcmp(key, "RTP_TAP_MAC") == 0) { + char *token; + char *cp = strdup(val); + int cnt=0; + unsigned char *mac =(unsigned char*)conf + dtab->offset; + token=strtok(cp, ":"); + if (token) { + mac[cnt] = (unsigned char)strtoul(token,NULL,16); + cnt++; + + while ((token=strtok(NULL, ":")) != NULL){ + mac[cnt] = strtoul(token,NULL,16); + cnt++; + if (cnt >= 6) { + break; + } + } + } + free(cp); + + if (cnt != 6) { + printf("Error: Invalid MAC Address %s\n",val); + return 1; + } + + return 0; + } + if (dtab->dtype == DTYPE_STR) { strcpy((char*)conf + dtab->offset, val); return 0; Only in wanpipe-3.2.4.p6/util/wanconfig: .wanconfig.c.swp diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/util/wanec_client/Makefile wanpipe-3.2.4.p6/util/wanec_client/Makefile --- wanpipe-3.2.2/util/wanec_client/Makefile 2008-01-17 12:49:26.000000000 -0500 +++ wanpipe-3.2.4.p6/util/wanec_client/Makefile 2008-02-07 18:14:25.000000000 -0500 @@ -13,7 +13,7 @@ PROD = wan_ec_setup VERSION = 1.0 DEBUG = 2 -YACC = yacc +YACC = bison # Project File Paths. TMPDIR = tmp @@ -45,7 +45,7 @@ $(CC) $(CFLAGS) -o $@ $^ y.tab.c: - $(YACC) -d wan_ec_arg.y + $(YACC) -d -o y.tab.c wan_ec_arg.y wan_ec_argl.c: $(LEX) -owan_ec_argl.c wan_ec_arg.l diff -dur --exclude=wanec --exclude=ssmg --exclude=api --exclude='*~' wanpipe-3.2.2/util/wanpipemon/fe_lib.c wanpipe-3.2.4.p6/util/wanpipemon/fe_lib.c --- wanpipe-3.2.2/util/wanpipemon/fe_lib.c 2008-01-11 14:07:46.000000000 -0500 +++ wanpipe-3.2.4.p6/util/wanpipemon/fe_lib.c 2008-02-06 13:29:31.000000000 -0500 @@ -1201,9 +1201,34 @@ } #endif err = DO_COMMAND(wan_udp); + if (fe_debug->type == WAN_FE_DEBUG_REG && fe_debug->fe_debug_reg.read == 1){ + if (err == 0 && wan_udp.wan_udphdr_return_code == 0){ + int cnt = 0; + printf("Please wait.");fflush(stdout); +repeat_read_reg: + wan_udp.wan_udphdr_return_code = 0xaa; + fe_debug->fe_debug_reg.read = 2; + memcpy(data, (unsigned char*)fe_debug, sizeof(sdla_fe_debug_t)); + usleep(100000); + err = DO_COMMAND(wan_udp); + if (err || wan_udp.wan_udphdr_return_code != 0){ + if (cnt < 5){ + printf(".");fflush(stdout); + goto repeat_read_reg; + } + } + printf("\n\n"); + } + } + if (err || wan_udp.wan_udphdr_return_code != 0){ - printf("Failed to %s mode.\n", + if (fe_debug->type == WAN_FE_DEBUG_RBS){ + printf("Failed to %s mode.\n", WAN_FE_DEBUG_RBS_DECODE(fe_debug->mode)); + }else{ + printf("Failed to execute debug mode (%02X).\n", + fe_debug->type); + } }else{ fe_debug = (sdla_fe_debug_t*)get_wan_udphdr_data_ptr(0); switch(fe_debug->type){ @@ -1224,11 +1249,11 @@ WAN_FE_DEBUG_ALARM_DECODE(fe_debug->mode)); break; case WAN_FE_DEBUG_REG: - if (fe_debug->fe_debug_reg.read){ - printf("Read %02X value from register %X.\n", - fe_debug->fe_debug_reg.value, - fe_debug->fe_debug_reg.reg); - } + if (fe_debug->fe_debug_reg.read == 2){ + printf("Read Front-End Reg:%04X=%02X\n", + fe_debug->fe_debug_reg.reg, + fe_debug->fe_debug_reg.value); + } break; } }