diff options
author | Karsten Keil <keil@b1-systems.de> | 2009-07-09 08:02:29 (GMT) |
---|---|---|
committer | Karsten Keil <keil@b1-systems.de> | 2009-07-25 18:18:16 (GMT) |
commit | fb286f0471a04ef646c8e5c79750ae6718183745 (patch) | |
tree | 6e88ae4869ca1aedb5e674733a903324530d6ee1 /drivers/isdn/mISDN | |
parent | f3fad223ed69f406f33c9619c256858d5a5fc5c7 (diff) | |
download | linux-fb286f0471a04ef646c8e5c79750ae6718183745.tar.xz |
mISDN: Make clearing B-channel a common function
Clearing B-channel is needed in every driver, so it makes sense
to have it as common function.
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Diffstat (limited to 'drivers/isdn/mISDN')
-rw-r--r-- | drivers/isdn/mISDN/hwchannel.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/isdn/mISDN/hwchannel.c b/drivers/isdn/mISDN/hwchannel.c index 0481a0c..e8049be 100644 --- a/drivers/isdn/mISDN/hwchannel.c +++ b/drivers/isdn/mISDN/hwchannel.c @@ -114,13 +114,14 @@ mISDN_freedchannel(struct dchannel *ch) } EXPORT_SYMBOL(mISDN_freedchannel); -int -mISDN_freebchannel(struct bchannel *ch) +void +mISDN_clear_bchannel(struct bchannel *ch) { if (ch->tx_skb) { dev_kfree_skb(ch->tx_skb); ch->tx_skb = NULL; } + ch->tx_idx = 0; if (ch->rx_skb) { dev_kfree_skb(ch->rx_skb); ch->rx_skb = NULL; @@ -129,6 +130,16 @@ mISDN_freebchannel(struct bchannel *ch) dev_kfree_skb(ch->next_skb); ch->next_skb = NULL; } + test_and_clear_bit(FLG_TX_BUSY, &ch->Flags); + test_and_clear_bit(FLG_TX_NEXT, &ch->Flags); + test_and_clear_bit(FLG_ACTIVE, &ch->Flags); +} +EXPORT_SYMBOL(mISDN_clear_bchannel); + +int +mISDN_freebchannel(struct bchannel *ch) +{ + mISDN_clear_bchannel(ch); skb_queue_purge(&ch->rqueue); ch->rcount = 0; flush_scheduled_work(); |