wct4xxp: Reduce time spent waiting for auth done bit on TE820.
It is not necessary to wait a full second for the donebit. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10395 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
parent
892e49c356
commit
afe3702873
@ -4888,20 +4888,22 @@ static int t4_hardware_init_1(struct t4 *wc, unsigned int cardflags)
|
||||
|
||||
/* TE820 Auth Check */
|
||||
if (is_octal(wc)) {
|
||||
unsigned long stop = jiffies + HZ;
|
||||
uint32_t donebit;
|
||||
|
||||
donebit = t4_pci_in(wc, WC_LEDS2);
|
||||
t4_pci_out(wc, WC_LEDS2, WC_SET_AUTH);
|
||||
|
||||
msleep(1000);
|
||||
|
||||
donebit = t4_pci_in(wc, WC_LEDS2);
|
||||
if (!(donebit & WC_GET_AUTH)) {
|
||||
while (!(donebit & WC_GET_AUTH)) {
|
||||
if (time_after(jiffies, stop)) {
|
||||
/* Encryption check failed, stop operation */
|
||||
dev_info(&wc->dev->dev, "Failed encryption check. "\
|
||||
dev_info(&wc->dev->dev,
|
||||
"Failed encryption check. "
|
||||
"Unloading driver.\n");
|
||||
return -EIO;
|
||||
}
|
||||
msleep(20);
|
||||
donebit = t4_pci_in(wc, WC_LEDS2);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user