mISDN: Cleanup channel also if it already was deactivated
Subsystems (2)
PATCH 18/28 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.
Signed-off-by Karsten Keil <[email protected]>
--- drivers/isdn/hardware/mISDN/avmfritz.c | 12 ++++-------- drivers/isdn/hardware/mISDN/hfcmulti.c | 3 +-- drivers/isdn/hardware/mISDN/hfcpci.c | 3 +-- drivers/isdn/hardware/mISDN/hfcsusb.c | 3 +-- drivers/isdn/hardware/mISDN/mISDNipac.c | 13 ++++--------- drivers/isdn/hardware/mISDN/mISDNisar.c | 13 ++++--------- drivers/isdn/hardware/mISDN/netjet.c | 12 ++++-------- drivers/isdn/hardware/mISDN/w6692.c | 13 ++++--------- 8 files changed, 23 insertions(+), 49 deletions(-)
drivers/isdn/hardware/mISDN/avmfritz.c +4 -8
@@ -839,14 +839,10 @@ avm_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg)switch (cmd) {case CLOSE_CHANNEL :test_and_clear_bit (FLG_OPEN , &bch->Flags); -if (test_bit (FLG_ACTIVE , &bch->Flags)) { -spin_lock_irqsave (&fc->lock, flags); -mISDN_freebchannel (bch); -test_and_clear_bit (FLG_TX_BUSY , &bch->Flags); -test_and_clear_bit (FLG_ACTIVE , &bch->Flags); -modehdlc (bch,ISDN_P_NONE ); -spin_unlock_irqrestore (&fc->lock, flags); - } +spin_lock_irqsave (&fc->lock, flags); +mISDN_freebchannel (bch); +modehdlc (bch,ISDN_P_NONE ); +spin_unlock_irqrestore (&fc->lock, flags); ch->protocol =ISDN_P_NONE ; ch->peer =NULL ;module_put (THIS_MODULE );
drivers/isdn/hardware/mISDN/hfcmulti.c +1 -2
@@ -3859,8 +3859,7 @@ hfcm_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg)switch (cmd) {case CLOSE_CHANNEL :test_and_clear_bit (FLG_OPEN , &bch->Flags); -if (test_bit (FLG_ACTIVE , &bch->Flags)) -deactivate_bchannel (bch);/* locked there */ +deactivate_bchannel (bch);/* locked there */ ch->protocol =ISDN_P_NONE ; ch->peer =NULL ;module_put (THIS_MODULE );
drivers/isdn/hardware/mISDN/hfcpci.c +1 -2
@@ -1581,8 +1581,7 @@ hfc_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg)break ;case CLOSE_CHANNEL :test_and_clear_bit (FLG_OPEN , &bch->Flags); -if (test_bit (FLG_ACTIVE , &bch->Flags)) -deactivate_bchannel (bch); +deactivate_bchannel (bch); ch->protocol =ISDN_P_NONE ; ch->peer =NULL ;module_put (THIS_MODULE );
drivers/isdn/hardware/mISDN/hfcsusb.c +1 -2
@@ -1836,8 +1836,7 @@ hfc_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg)case CLOSE_CHANNEL :test_and_clear_bit (FLG_OPEN , &bch->Flags); -if (test_bit (FLG_ACTIVE , &bch->Flags)) -deactivate_bchannel (bch); +deactivate_bchannel (bch); ch->protocol =ISDN_P_NONE ; ch->peer =NULL ;module_put (THIS_MODULE );
drivers/isdn/hardware/mISDN/mISDNipac.c +4 -9
@@ -1416,15 +1416,10 @@ hscx_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg)switch (cmd) {case CLOSE_CHANNEL :test_and_clear_bit (FLG_OPEN , &bch->Flags); -if (test_bit (FLG_ACTIVE , &bch->Flags)) { -spin_lock_irqsave (hx->ip->hwlock, flags); -mISDN_freebchannel (bch); -hscx_mode (hx,ISDN_P_NONE ); -spin_unlock_irqrestore (hx->ip->hwlock, flags); - }else { -skb_queue_purge (&bch->rqueue); - bch->rcount =0 ; - } +spin_lock_irqsave (hx->ip->hwlock, flags); +mISDN_freebchannel (bch); +hscx_mode (hx,ISDN_P_NONE ); +spin_unlock_irqrestore (hx->ip->hwlock, flags); ch->protocol =ISDN_P_NONE ; ch->peer =NULL ;module_put (hx->ip->owner);
drivers/isdn/hardware/mISDN/mISDNisar.c +4 -9
@@ -1603,15 +1603,10 @@ isar_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg)switch (cmd) {case CLOSE_CHANNEL :test_and_clear_bit (FLG_OPEN , &bch->Flags); -if (test_bit (FLG_ACTIVE , &bch->Flags)) { -spin_lock_irqsave (ich->is->hwlock, flags); -mISDN_freebchannel (bch); -modeisar (ich,ISDN_P_NONE ); -spin_unlock_irqrestore (ich->is->hwlock, flags); - }else { -skb_queue_purge (&bch->rqueue); - bch->rcount =0 ; - } +spin_lock_irqsave (ich->is->hwlock, flags); +mISDN_freebchannel (bch); +modeisar (ich,ISDN_P_NONE ); +spin_unlock_irqrestore (ich->is->hwlock, flags); ch->protocol =ISDN_P_NONE ; ch->peer =NULL ;module_put (ich->is->owner);
drivers/isdn/hardware/mISDN/netjet.c +4 -8
@@ -808,14 +808,10 @@ nj_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg)switch (cmd) {case CLOSE_CHANNEL :test_and_clear_bit (FLG_OPEN , &bch->Flags); -if (test_bit (FLG_ACTIVE , &bch->Flags)) { -spin_lock_irqsave (&card->lock, flags); -mISDN_freebchannel (bch); -test_and_clear_bit (FLG_TX_BUSY , &bch->Flags); -test_and_clear_bit (FLG_ACTIVE , &bch->Flags); -mode_tiger (bc,ISDN_P_NONE ); -spin_unlock_irqrestore (&card->lock, flags); - } +spin_lock_irqsave (&card->lock, flags); +mISDN_freebchannel (bch); +mode_tiger (bc,ISDN_P_NONE ); +spin_unlock_irqrestore (&card->lock, flags); ch->protocol =ISDN_P_NONE ; ch->peer =NULL ;module_put (THIS_MODULE );
drivers/isdn/hardware/mISDN/w6692.c +4 -9
@@ -1058,15 +1058,10 @@ w6692_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg)switch (cmd) {case CLOSE_CHANNEL :test_and_clear_bit (FLG_OPEN , &bch->Flags); -if (test_bit (FLG_ACTIVE , &bch->Flags)) { -spin_lock_irqsave (&card->lock, flags); -mISDN_freebchannel (bch); -w6692_mode (bc,ISDN_P_NONE ); -spin_unlock_irqrestore (&card->lock, flags); - }else { -skb_queue_purge (&bch->rqueue); - bch->rcount =0 ; - } +spin_lock_irqsave (&card->lock, flags); +mISDN_freebchannel (bch); +w6692_mode (bc,ISDN_P_NONE ); +spin_unlock_irqrestore (&card->lock, flags); ch->protocol =ISDN_P_NONE ; ch->peer =NULL ;module_put (THIS_MODULE );
Signature · 1 line
1.7.3.4