diff options
author | Karsten Keil <keil@b1-systems.de> | 2009-07-09 04:02:29 -0400 |
---|---|---|
committer | Karsten Keil <keil@b1-systems.de> | 2009-07-25 14:18:16 -0400 |
commit | fb286f0471a04ef646c8e5c79750ae6718183745 (patch) | |
tree | 6e88ae4869ca1aedb5e674733a903324530d6ee1 /drivers/isdn/mISDN | |
parent | f3fad223ed69f406f33c9619c256858d5a5fc5c7 (diff) |
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 0481a0cdf6db..e8049be552aa 100644 --- a/drivers/isdn/mISDN/hwchannel.c +++ b/drivers/isdn/mISDN/hwchannel.c | |||
@@ -114,13 +114,14 @@ mISDN_freedchannel(struct dchannel *ch) | |||
114 | } | 114 | } |
115 | EXPORT_SYMBOL(mISDN_freedchannel); | 115 | EXPORT_SYMBOL(mISDN_freedchannel); |
116 | 116 | ||
117 | int | 117 | void |
118 | mISDN_freebchannel(struct bchannel *ch) | 118 | mISDN_clear_bchannel(struct bchannel *ch) |
119 | { | 119 | { |
120 | if (ch->tx_skb) { | 120 | if (ch->tx_skb) { |
121 | dev_kfree_skb(ch->tx_skb); | 121 | dev_kfree_skb(ch->tx_skb); |
122 | ch->tx_skb = NULL; | 122 | ch->tx_skb = NULL; |
123 | } | 123 | } |
124 | ch->tx_idx = 0; | ||
124 | if (ch->rx_skb) { | 125 | if (ch->rx_skb) { |
125 | dev_kfree_skb(ch->rx_skb); | 126 | dev_kfree_skb(ch->rx_skb); |
126 | ch->rx_skb = NULL; | 127 | ch->rx_skb = NULL; |
@@ -129,6 +130,16 @@ mISDN_freebchannel(struct bchannel *ch) | |||
129 | dev_kfree_skb(ch->next_skb); | 130 | dev_kfree_skb(ch->next_skb); |
130 | ch->next_skb = NULL; | 131 | ch->next_skb = NULL; |
131 | } | 132 | } |
133 | test_and_clear_bit(FLG_TX_BUSY, &ch->Flags); | ||
134 | test_and_clear_bit(FLG_TX_NEXT, &ch->Flags); | ||
135 | test_and_clear_bit(FLG_ACTIVE, &ch->Flags); | ||
136 | } | ||
137 | EXPORT_SYMBOL(mISDN_clear_bchannel); | ||
138 | |||
139 | int | ||
140 | mISDN_freebchannel(struct bchannel *ch) | ||
141 | { | ||
142 | mISDN_clear_bchannel(ch); | ||
132 | skb_queue_purge(&ch->rqueue); | 143 | skb_queue_purge(&ch->rqueue); |
133 | ch->rcount = 0; | 144 | ch->rcount = 0; |
134 | flush_scheduled_work(); | 145 | flush_scheduled_work(); |