aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/gigaset.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/gigaset/gigaset.h')
-rw-r--r--drivers/isdn/gigaset/gigaset.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index 05947f9c1849..f77ec54eb07d 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -45,10 +45,6 @@
45#define MAX_EVENTS 64 /* size of event queue */ 45#define MAX_EVENTS 64 /* size of event queue */
46 46
47#define RBUFSIZE 8192 47#define RBUFSIZE 8192
48#define SBUFSIZE 4096 /* sk_buff payload size */
49
50#define TRANSBUFSIZE 768 /* bytes per skb for transparent receive */
51#define MAX_BUF_SIZE (SBUFSIZE - 2) /* Max. size of a data packet from LL */
52 48
53/* compile time options */ 49/* compile time options */
54#define GIG_MAJOR 0 50#define GIG_MAJOR 0
@@ -380,8 +376,10 @@ struct bc_state {
380 376
381 struct at_state_t at_state; 377 struct at_state_t at_state;
382 378
383 __u16 fcs; 379 /* receive buffer */
384 struct sk_buff *skb; 380 unsigned rx_bufsize; /* max size accepted by application */
381 struct sk_buff *rx_skb;
382 __u16 rx_fcs;
385 int inputstate; /* see INS_XXXX */ 383 int inputstate; /* see INS_XXXX */
386 384
387 int channel; 385 int channel;
@@ -801,8 +799,23 @@ static inline void gigaset_bchannel_up(struct bc_state *bcs)
801 gigaset_schedule_event(bcs->cs); 799 gigaset_schedule_event(bcs->cs);
802} 800}
803 801
804/* handling routines for sk_buff */ 802/* set up next receive skb for data mode */
805/* ============================= */ 803static inline struct sk_buff *gigaset_new_rx_skb(struct bc_state *bcs)
804{
805 struct cardstate *cs = bcs->cs;
806 unsigned short hw_hdr_len = cs->hw_hdr_len;
807
808 if (bcs->ignore) {
809 bcs->rx_skb = NULL;
810 } else {
811 bcs->rx_skb = dev_alloc_skb(bcs->rx_bufsize + hw_hdr_len);
812 if (bcs->rx_skb == NULL)
813 dev_warn(cs->dev, "could not allocate skb\n");
814 else
815 skb_reserve(bcs->rx_skb, hw_hdr_len);
816 }
817 return bcs->rx_skb;
818}
806 819
807/* append received bytes to inbuf */ 820/* append received bytes to inbuf */
808int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src, 821int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,