aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/i4l.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/gigaset/i4l.c')
-rw-r--r--drivers/isdn/gigaset/i4l.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index c22e5ace8276..f01c3c2e2e46 100644
--- a/drivers/isdn/gigaset/i4l.c
+++ b/drivers/isdn/gigaset/i4l.c
@@ -16,7 +16,10 @@
16#include "gigaset.h" 16#include "gigaset.h"
17#include <linux/isdnif.h> 17#include <linux/isdnif.h>
18 18
19#define SBUFSIZE 4096 /* sk_buff payload size */
20#define TRANSBUFSIZE 768 /* bytes per skb for transparent receive */
19#define HW_HDR_LEN 2 /* Header size used to store ack info */ 21#define HW_HDR_LEN 2 /* Header size used to store ack info */
22#define MAX_BUF_SIZE (SBUFSIZE - HW_HDR_LEN) /* max data packet from LL */
20 23
21/* == Handling of I4L IO =====================================================*/ 24/* == Handling of I4L IO =====================================================*/
22 25
@@ -231,6 +234,15 @@ static int command_from_LL(isdn_ctrl *cntrl)
231 dev_err(cs->dev, "ISDN_CMD_DIAL: channel not free\n"); 234 dev_err(cs->dev, "ISDN_CMD_DIAL: channel not free\n");
232 return -EBUSY; 235 return -EBUSY;
233 } 236 }
237 switch (bcs->proto2) {
238 case L2_HDLC:
239 bcs->rx_bufsize = SBUFSIZE;
240 break;
241 default: /* assume transparent */
242 bcs->rx_bufsize = TRANSBUFSIZE;
243 }
244 dev_kfree_skb(bcs->rx_skb);
245 gigaset_new_rx_skb(bcs);
234 246
235 commands = kzalloc(AT_NUM*(sizeof *commands), GFP_ATOMIC); 247 commands = kzalloc(AT_NUM*(sizeof *commands), GFP_ATOMIC);
236 if (!commands) { 248 if (!commands) {
@@ -314,6 +326,15 @@ static int command_from_LL(isdn_ctrl *cntrl)
314 return -EINVAL; 326 return -EINVAL;
315 } 327 }
316 bcs = cs->bcs + ch; 328 bcs = cs->bcs + ch;
329 switch (bcs->proto2) {
330 case L2_HDLC:
331 bcs->rx_bufsize = SBUFSIZE;
332 break;
333 default: /* assume transparent */
334 bcs->rx_bufsize = TRANSBUFSIZE;
335 }
336 dev_kfree_skb(bcs->rx_skb);
337 gigaset_new_rx_skb(bcs);
317 if (!gigaset_add_event(cs, &bcs->at_state, 338 if (!gigaset_add_event(cs, &bcs->at_state,
318 EV_ACCEPT, NULL, 0, NULL)) 339 EV_ACCEPT, NULL, 0, NULL))
319 return -ENOMEM; 340 return -ENOMEM;