From bbdcb0c7bad454e43907415ea2588914f006b5a2 Mon Sep 17 00:00:00 2001 From: Russ Meyerriecks Date: Wed, 8 Dec 2010 22:11:53 +0000 Subject: [PATCH] dahdi: Removing loopstop maint function DAHDI_MAINT_LOOPSTOP is being removed due to the redundancy with DAHDI_MAINT_NONE. Also removing some timing logic, as amount of time a loopup or loopdown signal is held on the line, is now defined in userspace with dahdi_maint. Signed-off-by: Russ Meyerriecks Acked-by: Shaun Ruffell Acked-by: Kinsey Moore git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9515 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/dahdi-base.c | 2 -- drivers/dahdi/tor2.c | 5 +---- drivers/dahdi/wct1xxp.c | 5 +---- drivers/dahdi/wct4xxp/base.c | 8 +------- drivers/dahdi/wcte11xp.c | 7 +------ drivers/dahdi/wcte12xp/base.c | 10 +--------- drivers/dahdi/xpp/xpp_dahdi.c | 3 --- include/dahdi/user.h | 1 - 8 files changed, 5 insertions(+), 36 deletions(-) diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 0040d31..9f9516f 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -8455,8 +8455,6 @@ int dahdi_transmit(struct dahdi_span *span) span->mainttimer -= DAHDI_CHUNKSIZE; if (span->mainttimer <= 0) { span->mainttimer = 0; - if (span->ops->maint) - span->ops->maint(span, DAHDI_MAINT_LOOPSTOP); span->maintstat = 0; } } diff --git a/drivers/dahdi/tor2.c b/drivers/dahdi/tor2.c index b181e3f..396ad05 100644 --- a/drivers/dahdi/tor2.c +++ b/drivers/dahdi/tor2.c @@ -1042,7 +1042,6 @@ static int tor2_maint(struct dahdi_span *span, int cmd) break; case DAHDI_MAINT_LOOPUP: case DAHDI_MAINT_LOOPDOWN: - case DAHDI_MAINT_LOOPSTOP: return -ENOSYS; default: printk(KERN_NOTICE "Tor2: Unknown maint command: %d\n", cmd); @@ -1054,6 +1053,7 @@ static int tor2_maint(struct dahdi_span *span, int cmd) case DAHDI_MAINT_NONE: t1out(p->tor,tspan,0x19,(japan ? 0x80 : 0x00)); /* no local loop */ t1out(p->tor,tspan,0x0a,0); /* no remote loop */ + t1out(p->tor, tspan, 0x30, 0); /* stop sending loopup code */ break; case DAHDI_MAINT_LOCALLOOP: t1out(p->tor,tspan,0x19,0x40 | (japan ? 0x80 : 0x00)); /* local loop */ @@ -1073,9 +1073,6 @@ static int tor2_maint(struct dahdi_span *span, int cmd) t1out(p->tor,tspan,0x12,0x62); /* send loopdown code */ t1out(p->tor,tspan,0x13,0x90); /* send loopdown code */ break; - case DAHDI_MAINT_LOOPSTOP: - t1out(p->tor,tspan,0x30,0); /* stop sending loopup code */ - break; default: printk(KERN_NOTICE "Tor2: Unknown maint command: %d\n", cmd); break; diff --git a/drivers/dahdi/wct1xxp.c b/drivers/dahdi/wct1xxp.c index 2650242..095a354 100644 --- a/drivers/dahdi/wct1xxp.c +++ b/drivers/dahdi/wct1xxp.c @@ -674,7 +674,6 @@ static int t1xxp_maint(struct dahdi_span *span, int cmd) break; case DAHDI_MAINT_LOOPUP: case DAHDI_MAINT_LOOPDOWN: - case DAHDI_MAINT_LOOPSTOP: res = -ENOSYS; break; default: @@ -687,6 +686,7 @@ static int t1xxp_maint(struct dahdi_span *span, int cmd) case DAHDI_MAINT_NONE: __t1_set_reg(wc,0x19,0); /* no local loop */ __t1_set_reg(wc,0x0a,0); /* no remote loop */ + __t1_set_reg(wc, 0x30, 0); /* stop sending loopup code*/ break; case DAHDI_MAINT_LOCALLOOP: __t1_set_reg(wc,0x19,0x40); /* local loop */ @@ -706,9 +706,6 @@ static int t1xxp_maint(struct dahdi_span *span, int cmd) __t1_set_reg(wc,0x12,0x62); /* send loopdown code */ __t1_set_reg(wc,0x13,0x90); /* send loopdown code */ break; - case DAHDI_MAINT_LOOPSTOP: - __t1_set_reg(wc,0x30,0); /* stop sending loopup code */ - break; default: printk(KERN_NOTICE "wct1xxp/T1: Unknown maint command: %d\n", cmd); res = -EINVAL; diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index b83e53b..422eb11 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -1538,9 +1538,8 @@ static int t4_maint(struct dahdi_span *span, int cmd) break; case DAHDI_MAINT_LOOPUP: case DAHDI_MAINT_LOOPDOWN: - case DAHDI_MAINT_LOOPSTOP: dev_info(&wc->dev->dev, - "Loopup & loopdown supported in E1 mode\n"); + "Loopup & loopdown not supported in E1 mode\n"); return -ENOSYS; case DAHDI_MAINT_FAS_DEFECT: t4_framer_out(wc, span->offset, IERR_T, IFASE); @@ -1610,11 +1609,6 @@ static int t4_maint(struct dahdi_span *span, int cmd) t4_clear_maint(span); t4_framer_out(wc, span->offset, 0x21, 0x60); break; - case DAHDI_MAINT_LOOPSTOP: - dev_info(&wc->dev->dev, "Transmitting loopstop code\n"); - t4_clear_maint(span); - t4_framer_out(wc, span->offset, 0x21, 0x40); - break; case DAHDI_MAINT_FAS_DEFECT: t4_framer_out(wc, span->offset, IERR_T, IFASE); break; diff --git a/drivers/dahdi/wcte11xp.c b/drivers/dahdi/wcte11xp.c index 204eff5..b89a6d6 100644 --- a/drivers/dahdi/wcte11xp.c +++ b/drivers/dahdi/wcte11xp.c @@ -468,9 +468,6 @@ static int t1xxp_maint(struct dahdi_span *span, int cmd) case DAHDI_MAINT_LOOPDOWN: printk(KERN_INFO "XXX Send loopdown code E1 XXX\n"); break; - case DAHDI_MAINT_LOOPSTOP: - printk(KERN_INFO "XXX Stop sending loop codes E1 XXX\n"); - break; default: printk(KERN_NOTICE "TE110P: Unknown E1 maint command: %d\n", cmd); break; @@ -479,6 +476,7 @@ static int t1xxp_maint(struct dahdi_span *span, int cmd) switch(cmd) { case DAHDI_MAINT_NONE: printk(KERN_INFO "XXX Turn off local and remote loops T1 XXX\n"); + t1_framer_out(wc, 0x21, 0x40); break; case DAHDI_MAINT_LOCALLOOP: printk(KERN_INFO "XXX Turn on local loop and no remote loop XXX\n"); @@ -492,9 +490,6 @@ static int t1xxp_maint(struct dahdi_span *span, int cmd) case DAHDI_MAINT_LOOPDOWN: t1_framer_out(wc, 0x21, 0x60); /* FMR5: Nothing but RBS mode */ break; - case DAHDI_MAINT_LOOPSTOP: - t1_framer_out(wc, 0x21, 0x40); /* FMR5: Nothing but RBS mode */ - break; default: printk(KERN_NOTICE "TE110P: Unknown T1 maint command: %d\n", cmd); break; diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index 9870aaf..a97cd32 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -1161,7 +1161,6 @@ static void t1xxp_maint_work(struct work_struct *work) case DAHDI_MAINT_REMOTELOOP: case DAHDI_MAINT_LOOPUP: case DAHDI_MAINT_LOOPDOWN: - case DAHDI_MAINT_LOOPSTOP: t1_info(wc, "Only local loop supported in E1 mode\n"); goto cleanup; default: @@ -1202,10 +1201,6 @@ static void t1xxp_maint_work(struct work_struct *work) t1xxp_clear_maint(span); t1_setreg(wc, 0x21, 0x60); break; - case DAHDI_MAINT_LOOPSTOP: - t1xxp_clear_maint(w->span); - t1_setreg(w->wc, 0x21, 0x40); - break; default: t1_info(wc, "Unknown T1 maint command: %d\n", cmd); return; @@ -1230,7 +1225,6 @@ static int t1xxp_maint(struct dahdi_span *span, int cmd) case DAHDI_MAINT_REMOTELOOP: case DAHDI_MAINT_LOOPUP: case DAHDI_MAINT_LOOPDOWN: - case DAHDI_MAINT_LOOPSTOP: t1_info(wc, "Only local loop supported in E1 mode\n"); return -ENOSYS; default: @@ -1245,7 +1239,6 @@ static int t1xxp_maint(struct dahdi_span *span, int cmd) case DAHDI_MAINT_NETWORKPAYLOADLOOP: case DAHDI_MAINT_LOOPUP: case DAHDI_MAINT_LOOPDOWN: - case DAHDI_MAINT_LOOPSTOP: break; default: t1_info(wc, "Unknown T1 maint command: %d\n", cmd); @@ -1255,8 +1248,7 @@ static int t1xxp_maint(struct dahdi_span *span, int cmd) work = kmalloc(sizeof(*work), GFP_ATOMIC); if (!work) { - t1_info(wc, "Failed to allocate memory for " - "DAHDI_MAINT_LOOPSTOP\n"); + t1_info(wc, "Failed to allocate memory for workqueue\n"); return -ENOMEM; } diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c index ea5229d..43dda58 100644 --- a/drivers/dahdi/xpp/xpp_dahdi.c +++ b/drivers/dahdi/xpp/xpp_dahdi.c @@ -999,9 +999,6 @@ int xpp_maint(struct dahdi_span *span, int cmd) case DAHDI_MAINT_LOOPDOWN: INFO("XXX Send loopdown code XXX\n"); break; - case DAHDI_MAINT_LOOPSTOP: - INFO("XXX Stop sending loop codes XXX\n"); - break; default: ERR("XPP: Unknown maint command: %d\n", cmd); ret = -EINVAL; diff --git a/include/dahdi/user.h b/include/dahdi/user.h index e743cad..0c51b37 100644 --- a/include/dahdi/user.h +++ b/include/dahdi/user.h @@ -334,7 +334,6 @@ enum { #define DAHDI_MAINT_NETWORKLINELOOP 2 /* Remote Loopback */ #define DAHDI_MAINT_LOOPUP 3 /* send loopup code */ #define DAHDI_MAINT_LOOPDOWN 4 /* send loopdown code */ -#define DAHDI_MAINT_LOOPSTOP 5 /* stop sending loop codes */ #define DAHDI_MAINT_FAS_DEFECT 6 /* insert a FAS defect */ #define DAHDI_MAINT_MULTI_DEFECT 7 /* insert a Multiframe defect */ #define DAHDI_MAINT_CRC_DEFECT 8 /* insert a FAS defect */