diff options
author | Karsten Keil <kkeil@linux-pingi.de> | 2012-05-15 19:51:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-16 15:22:06 -0400 |
commit | 1368112c07bae879fa3d1c21f236ca8eea3e5e84 (patch) | |
tree | 3467a277cc350bbfaf3e98df9513d4209e63f984 /drivers/isdn/hardware | |
parent | dd456d45d7edd01f4054818dd404ec61ca55cbc1 (diff) |
mISDN: Cleanup channel also if it already was deactivated
If a channel was closed after it was deactivated it could happen that
something was not proper resetted. The test if a channel is still activ
was wrong, so remove it and always do the cleanup.
Signed-off-by: Karsten Keil <kkeil@linux-pingi.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/hardware')
-rw-r--r-- | drivers/isdn/hardware/mISDN/avmfritz.c | 12 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/hfcmulti.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/hfcpci.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/hfcsusb.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/mISDNipac.c | 13 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/mISDNisar.c | 13 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/netjet.c | 12 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/w6692.c | 13 |
8 files changed, 23 insertions, 49 deletions
diff --git a/drivers/isdn/hardware/mISDN/avmfritz.c b/drivers/isdn/hardware/mISDN/avmfritz.c index 6bf2c58795a3..2271f2b7d501 100644 --- a/drivers/isdn/hardware/mISDN/avmfritz.c +++ b/drivers/isdn/hardware/mISDN/avmfritz.c | |||
@@ -839,14 +839,10 @@ avm_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) | |||
839 | switch (cmd) { | 839 | switch (cmd) { |
840 | case CLOSE_CHANNEL: | 840 | case CLOSE_CHANNEL: |
841 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 841 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
842 | if (test_bit(FLG_ACTIVE, &bch->Flags)) { | 842 | spin_lock_irqsave(&fc->lock, flags); |
843 | spin_lock_irqsave(&fc->lock, flags); | 843 | mISDN_freebchannel(bch); |
844 | mISDN_freebchannel(bch); | 844 | modehdlc(bch, ISDN_P_NONE); |
845 | test_and_clear_bit(FLG_TX_BUSY, &bch->Flags); | 845 | spin_unlock_irqrestore(&fc->lock, flags); |
846 | test_and_clear_bit(FLG_ACTIVE, &bch->Flags); | ||
847 | modehdlc(bch, ISDN_P_NONE); | ||
848 | spin_unlock_irqrestore(&fc->lock, flags); | ||
849 | } | ||
850 | ch->protocol = ISDN_P_NONE; | 846 | ch->protocol = ISDN_P_NONE; |
851 | ch->peer = NULL; | 847 | ch->peer = NULL; |
852 | module_put(THIS_MODULE); | 848 | module_put(THIS_MODULE); |
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index 9f4e2efa7ff6..1dae761d973e 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c | |||
@@ -3725,8 +3725,7 @@ hfcm_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg) | |||
3725 | switch (cmd) { | 3725 | switch (cmd) { |
3726 | case CLOSE_CHANNEL: | 3726 | case CLOSE_CHANNEL: |
3727 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 3727 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
3728 | if (test_bit(FLG_ACTIVE, &bch->Flags)) | 3728 | deactivate_bchannel(bch); /* locked there */ |
3729 | deactivate_bchannel(bch); /* locked there */ | ||
3730 | ch->protocol = ISDN_P_NONE; | 3729 | ch->protocol = ISDN_P_NONE; |
3731 | ch->peer = NULL; | 3730 | ch->peer = NULL; |
3732 | module_put(THIS_MODULE); | 3731 | module_put(THIS_MODULE); |
diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index 5fe993e2dee9..f7a5ea7988ed 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c | |||
@@ -1581,8 +1581,7 @@ hfc_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg) | |||
1581 | break; | 1581 | break; |
1582 | case CLOSE_CHANNEL: | 1582 | case CLOSE_CHANNEL: |
1583 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 1583 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
1584 | if (test_bit(FLG_ACTIVE, &bch->Flags)) | 1584 | deactivate_bchannel(bch); |
1585 | deactivate_bchannel(bch); | ||
1586 | ch->protocol = ISDN_P_NONE; | 1585 | ch->protocol = ISDN_P_NONE; |
1587 | ch->peer = NULL; | 1586 | ch->peer = NULL; |
1588 | module_put(THIS_MODULE); | 1587 | module_put(THIS_MODULE); |
diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c index 8cde2a0538ab..add28acd54d7 100644 --- a/drivers/isdn/hardware/mISDN/hfcsusb.c +++ b/drivers/isdn/hardware/mISDN/hfcsusb.c | |||
@@ -1836,8 +1836,7 @@ hfc_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg) | |||
1836 | 1836 | ||
1837 | case CLOSE_CHANNEL: | 1837 | case CLOSE_CHANNEL: |
1838 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 1838 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
1839 | if (test_bit(FLG_ACTIVE, &bch->Flags)) | 1839 | deactivate_bchannel(bch); |
1840 | deactivate_bchannel(bch); | ||
1841 | ch->protocol = ISDN_P_NONE; | 1840 | ch->protocol = ISDN_P_NONE; |
1842 | ch->peer = NULL; | 1841 | ch->peer = NULL; |
1843 | module_put(THIS_MODULE); | 1842 | module_put(THIS_MODULE); |
diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c index 92d4a78bc0a5..6c044d55536b 100644 --- a/drivers/isdn/hardware/mISDN/mISDNipac.c +++ b/drivers/isdn/hardware/mISDN/mISDNipac.c | |||
@@ -1420,15 +1420,10 @@ hscx_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) | |||
1420 | switch (cmd) { | 1420 | switch (cmd) { |
1421 | case CLOSE_CHANNEL: | 1421 | case CLOSE_CHANNEL: |
1422 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 1422 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
1423 | if (test_bit(FLG_ACTIVE, &bch->Flags)) { | 1423 | spin_lock_irqsave(hx->ip->hwlock, flags); |
1424 | spin_lock_irqsave(hx->ip->hwlock, flags); | 1424 | mISDN_freebchannel(bch); |
1425 | mISDN_freebchannel(bch); | 1425 | hscx_mode(hx, ISDN_P_NONE); |
1426 | hscx_mode(hx, ISDN_P_NONE); | 1426 | spin_unlock_irqrestore(hx->ip->hwlock, flags); |
1427 | spin_unlock_irqrestore(hx->ip->hwlock, flags); | ||
1428 | } else { | ||
1429 | skb_queue_purge(&bch->rqueue); | ||
1430 | bch->rcount = 0; | ||
1431 | } | ||
1432 | ch->protocol = ISDN_P_NONE; | 1427 | ch->protocol = ISDN_P_NONE; |
1433 | ch->peer = NULL; | 1428 | ch->peer = NULL; |
1434 | module_put(hx->ip->owner); | 1429 | module_put(hx->ip->owner); |
diff --git a/drivers/isdn/hardware/mISDN/mISDNisar.c b/drivers/isdn/hardware/mISDN/mISDNisar.c index 9a6da6edcfa8..af9a966a1fdf 100644 --- a/drivers/isdn/hardware/mISDN/mISDNisar.c +++ b/drivers/isdn/hardware/mISDN/mISDNisar.c | |||
@@ -1603,15 +1603,10 @@ isar_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) | |||
1603 | switch (cmd) { | 1603 | switch (cmd) { |
1604 | case CLOSE_CHANNEL: | 1604 | case CLOSE_CHANNEL: |
1605 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 1605 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
1606 | if (test_bit(FLG_ACTIVE, &bch->Flags)) { | 1606 | spin_lock_irqsave(ich->is->hwlock, flags); |
1607 | spin_lock_irqsave(ich->is->hwlock, flags); | 1607 | mISDN_freebchannel(bch); |
1608 | mISDN_freebchannel(bch); | 1608 | modeisar(ich, ISDN_P_NONE); |
1609 | modeisar(ich, ISDN_P_NONE); | 1609 | spin_unlock_irqrestore(ich->is->hwlock, flags); |
1610 | spin_unlock_irqrestore(ich->is->hwlock, flags); | ||
1611 | } else { | ||
1612 | skb_queue_purge(&bch->rqueue); | ||
1613 | bch->rcount = 0; | ||
1614 | } | ||
1615 | ch->protocol = ISDN_P_NONE; | 1610 | ch->protocol = ISDN_P_NONE; |
1616 | ch->peer = NULL; | 1611 | ch->peer = NULL; |
1617 | module_put(ich->is->owner); | 1612 | module_put(ich->is->owner); |
diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c index 27998d7188a5..55a77ed7b176 100644 --- a/drivers/isdn/hardware/mISDN/netjet.c +++ b/drivers/isdn/hardware/mISDN/netjet.c | |||
@@ -808,14 +808,10 @@ nj_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) | |||
808 | switch (cmd) { | 808 | switch (cmd) { |
809 | case CLOSE_CHANNEL: | 809 | case CLOSE_CHANNEL: |
810 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 810 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
811 | if (test_bit(FLG_ACTIVE, &bch->Flags)) { | 811 | spin_lock_irqsave(&card->lock, flags); |
812 | spin_lock_irqsave(&card->lock, flags); | 812 | mISDN_freebchannel(bch); |
813 | mISDN_freebchannel(bch); | 813 | mode_tiger(bc, ISDN_P_NONE); |
814 | test_and_clear_bit(FLG_TX_BUSY, &bch->Flags); | 814 | spin_unlock_irqrestore(&card->lock, flags); |
815 | test_and_clear_bit(FLG_ACTIVE, &bch->Flags); | ||
816 | mode_tiger(bc, ISDN_P_NONE); | ||
817 | spin_unlock_irqrestore(&card->lock, flags); | ||
818 | } | ||
819 | ch->protocol = ISDN_P_NONE; | 815 | ch->protocol = ISDN_P_NONE; |
820 | ch->peer = NULL; | 816 | ch->peer = NULL; |
821 | module_put(THIS_MODULE); | 817 | module_put(THIS_MODULE); |
diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c index 1d044670ff66..0b5e9297e95b 100644 --- a/drivers/isdn/hardware/mISDN/w6692.c +++ b/drivers/isdn/hardware/mISDN/w6692.c | |||
@@ -1061,15 +1061,10 @@ w6692_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) | |||
1061 | switch (cmd) { | 1061 | switch (cmd) { |
1062 | case CLOSE_CHANNEL: | 1062 | case CLOSE_CHANNEL: |
1063 | test_and_clear_bit(FLG_OPEN, &bch->Flags); | 1063 | test_and_clear_bit(FLG_OPEN, &bch->Flags); |
1064 | if (test_bit(FLG_ACTIVE, &bch->Flags)) { | 1064 | spin_lock_irqsave(&card->lock, flags); |
1065 | spin_lock_irqsave(&card->lock, flags); | 1065 | mISDN_freebchannel(bch); |
1066 | mISDN_freebchannel(bch); | 1066 | w6692_mode(bc, ISDN_P_NONE); |
1067 | w6692_mode(bc, ISDN_P_NONE); | 1067 | spin_unlock_irqrestore(&card->lock, flags); |
1068 | spin_unlock_irqrestore(&card->lock, flags); | ||
1069 | } else { | ||
1070 | skb_queue_purge(&bch->rqueue); | ||
1071 | bch->rcount = 0; | ||
1072 | } | ||
1073 | ch->protocol = ISDN_P_NONE; | 1068 | ch->protocol = ISDN_P_NONE; |
1074 | ch->peer = NULL; | 1069 | ch->peer = NULL; |
1075 | module_put(THIS_MODULE); | 1070 | module_put(THIS_MODULE); |