aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/mISDN/hwchannel.c
diff options
context:
space:
mode:
authorKarsten Keil <kkeil@linux-pingi.de>2012-05-15 19:51:08 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-16 15:24:36 -0400
commitc27b46e7f1cbf3be95a4cf5840c76a7b7d54b26f (patch)
treedb406c5ceb174b3b41a0085929fe85c5e6951bb6 /drivers/isdn/mISDN/hwchannel.c
parent6d1ee48fd0d8d2586aaeda24dacffc426c2be44a (diff)
mISDN: Implement MISDN_CTRL_RX_OFF for more drivers
MISDN_CTRL_RX_OFF is a meachanism to discard RX data in the driver if the data is not needed by the application. It can be used when playing mesages, but not recording or with unidirectional protocols. Signed-off-by: Karsten Keil <kkeil@linux-pingi.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/mISDN/hwchannel.c')
-rw-r--r--drivers/isdn/mISDN/hwchannel.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/isdn/mISDN/hwchannel.c b/drivers/isdn/mISDN/hwchannel.c
index e541b65f68ba..ef34fd40867c 100644
--- a/drivers/isdn/mISDN/hwchannel.c
+++ b/drivers/isdn/mISDN/hwchannel.c
@@ -142,6 +142,8 @@ mISDN_clear_bchannel(struct bchannel *ch)
142 test_and_clear_bit(FLG_ACTIVE, &ch->Flags); 142 test_and_clear_bit(FLG_ACTIVE, &ch->Flags);
143 test_and_clear_bit(FLG_FILLEMPTY, &ch->Flags); 143 test_and_clear_bit(FLG_FILLEMPTY, &ch->Flags);
144 test_and_clear_bit(FLG_TX_EMPTY, &ch->Flags); 144 test_and_clear_bit(FLG_TX_EMPTY, &ch->Flags);
145 test_and_clear_bit(FLG_RX_OFF, &ch->Flags);
146 ch->dropcnt = 0;
145 ch->minlen = ch->init_minlen; 147 ch->minlen = ch->init_minlen;
146 ch->next_minlen = ch->init_minlen; 148 ch->next_minlen = ch->init_minlen;
147 ch->maxlen = ch->init_maxlen; 149 ch->maxlen = ch->init_maxlen;
@@ -167,7 +169,8 @@ mISDN_ctrl_bchannel(struct bchannel *bch, struct mISDN_ctrl_req *cq)
167 169
168 switch (cq->op) { 170 switch (cq->op) {
169 case MISDN_CTRL_GETOP: 171 case MISDN_CTRL_GETOP:
170 cq->op = MISDN_CTRL_RX_BUFFER | MISDN_CTRL_FILL_EMPTY; 172 cq->op = MISDN_CTRL_RX_BUFFER | MISDN_CTRL_FILL_EMPTY |
173 MISDN_CTRL_RX_OFF;
171 break; 174 break;
172 case MISDN_CTRL_FILL_EMPTY: 175 case MISDN_CTRL_FILL_EMPTY:
173 if (cq->p1) { 176 if (cq->p1) {
@@ -177,6 +180,15 @@ mISDN_ctrl_bchannel(struct bchannel *bch, struct mISDN_ctrl_req *cq)
177 test_and_clear_bit(FLG_FILLEMPTY, &bch->Flags); 180 test_and_clear_bit(FLG_FILLEMPTY, &bch->Flags);
178 } 181 }
179 break; 182 break;
183 case MISDN_CTRL_RX_OFF:
184 /* read back dropped byte count */
185 cq->p2 = bch->dropcnt;
186 if (cq->p1)
187 test_and_set_bit(FLG_RX_OFF, &bch->Flags);
188 else
189 test_and_clear_bit(FLG_RX_OFF, &bch->Flags);
190 bch->dropcnt = 0;
191 break;
180 case MISDN_CTRL_RX_BUFFER: 192 case MISDN_CTRL_RX_BUFFER:
181 if (cq->p2 > MISDN_CTRL_RX_SIZE_IGNORE) 193 if (cq->p2 > MISDN_CTRL_RX_SIZE_IGNORE)
182 bch->next_maxlen = cq->p2; 194 bch->next_maxlen = cq->p2;