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 <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9515 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Russ Meyerriecks 2010-12-08 22:11:53 +00:00
parent 5ee55a6147
commit bbdcb0c7ba
8 changed files with 5 additions and 36 deletions

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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 */