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.h38
1 files changed, 26 insertions, 12 deletions
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index 05947f9c1849..8738b0821fc9 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
@@ -190,10 +186,9 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
190#define AT_BC 3 186#define AT_BC 3
191#define AT_PROTO 4 187#define AT_PROTO 4
192#define AT_TYPE 5 188#define AT_TYPE 5
193#define AT_HLC 6 189#define AT_CLIP 6
194#define AT_CLIP 7
195/* total number */ 190/* total number */
196#define AT_NUM 8 191#define AT_NUM 7
197 192
198/* variables in struct at_state_t */ 193/* variables in struct at_state_t */
199#define VAR_ZSAU 0 194#define VAR_ZSAU 0
@@ -380,8 +375,10 @@ struct bc_state {
380 375
381 struct at_state_t at_state; 376 struct at_state_t at_state;
382 377
383 __u16 fcs; 378 /* receive buffer */
384 struct sk_buff *skb; 379 unsigned rx_bufsize; /* max size accepted by application */
380 struct sk_buff *rx_skb;
381 __u16 rx_fcs;
385 int inputstate; /* see INS_XXXX */ 382 int inputstate; /* see INS_XXXX */
386 383
387 int channel; 384 int channel;
@@ -406,7 +403,9 @@ struct bc_state {
406 struct bas_bc_state *bas; /* usb hardware driver (base) */ 403 struct bas_bc_state *bas; /* usb hardware driver (base) */
407 } hw; 404 } hw;
408 405
409 void *ap; /* LL application structure */ 406 void *ap; /* associated LL application */
407 int apconnstate; /* LL application connection state */
408 spinlock_t aplock;
410}; 409};
411 410
412struct cardstate { 411struct cardstate {
@@ -801,8 +800,23 @@ static inline void gigaset_bchannel_up(struct bc_state *bcs)
801 gigaset_schedule_event(bcs->cs); 800 gigaset_schedule_event(bcs->cs);
802} 801}
803 802
804/* handling routines for sk_buff */ 803/* set up next receive skb for data mode */
805/* ============================= */ 804static inline struct sk_buff *gigaset_new_rx_skb(struct bc_state *bcs)
805{
806 struct cardstate *cs = bcs->cs;
807 unsigned short hw_hdr_len = cs->hw_hdr_len;
808
809 if (bcs->ignore) {
810 bcs->rx_skb = NULL;
811 } else {
812 bcs->rx_skb = dev_alloc_skb(bcs->rx_bufsize + hw_hdr_len);
813 if (bcs->rx_skb == NULL)
814 dev_warn(cs->dev, "could not allocate skb\n");
815 else
816 skb_reserve(bcs->rx_skb, hw_hdr_len);
817 }
818 return bcs->rx_skb;
819}
806 820
807/* append received bytes to inbuf */ 821/* append received bytes to inbuf */
808int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src, 822int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,