diff options
Diffstat (limited to 'drivers/isdn/gigaset/gigaset.h')
-rw-r--r-- | drivers/isdn/gigaset/gigaset.h | 199 |
1 files changed, 95 insertions, 104 deletions
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h index bc5a6294f0c0..d77588de7eb7 100644 --- a/drivers/isdn/gigaset/gigaset.h +++ b/drivers/isdn/gigaset/gigaset.h | |||
@@ -106,10 +106,10 @@ extern int gigaset_debuglevel; /* "needs" cast to (enum debuglevel) */ | |||
106 | * DEBUG_INTR. | 106 | * DEBUG_INTR. |
107 | */ | 107 | */ |
108 | enum debuglevel { /* up to 24 bits (atomic_t) */ | 108 | enum debuglevel { /* up to 24 bits (atomic_t) */ |
109 | DEBUG_REG = 0x0002,/* serial port I/O register operations */ | 109 | DEBUG_REG = 0x0002, /* serial port I/O register operations */ |
110 | DEBUG_OPEN = 0x0004, /* open/close serial port */ | 110 | DEBUG_OPEN = 0x0004, /* open/close serial port */ |
111 | DEBUG_INTR = 0x0008, /* interrupt processing */ | 111 | DEBUG_INTR = 0x0008, /* interrupt processing */ |
112 | DEBUG_INTR_DUMP = 0x0010, /* Activating hexdump debug output on | 112 | DEBUG_INTR_DUMP = 0x0010, /* Activating hexdump debug output on |
113 | interrupt requests, not available as | 113 | interrupt requests, not available as |
114 | run-time option */ | 114 | run-time option */ |
115 | DEBUG_CMD = 0x00020, /* sent/received LL commands */ | 115 | DEBUG_CMD = 0x00020, /* sent/received LL commands */ |
@@ -120,66 +120,68 @@ enum debuglevel { /* up to 24 bits (atomic_t) */ | |||
120 | DEBUG_DRIVER = 0x00400, /* driver structure */ | 120 | DEBUG_DRIVER = 0x00400, /* driver structure */ |
121 | DEBUG_HDLC = 0x00800, /* M10x HDLC processing */ | 121 | DEBUG_HDLC = 0x00800, /* M10x HDLC processing */ |
122 | DEBUG_WRITE = 0x01000, /* M105 data write */ | 122 | DEBUG_WRITE = 0x01000, /* M105 data write */ |
123 | DEBUG_TRANSCMD = 0x02000, /* AT-COMMANDS+RESPONSES */ | 123 | DEBUG_TRANSCMD = 0x02000, /* AT-COMMANDS+RESPONSES */ |
124 | DEBUG_MCMD = 0x04000, /* COMMANDS THAT ARE SENT VERY OFTEN */ | 124 | DEBUG_MCMD = 0x04000, /* COMMANDS THAT ARE SENT VERY OFTEN */ |
125 | DEBUG_INIT = 0x08000, /* (de)allocation+initialization of data | 125 | DEBUG_INIT = 0x08000, /* (de)allocation+initialization of data |
126 | structures */ | 126 | structures */ |
127 | DEBUG_LOCK = 0x10000, /* semaphore operations */ | 127 | DEBUG_LOCK = 0x10000, /* semaphore operations */ |
128 | DEBUG_OUTPUT = 0x20000, /* output to device */ | 128 | DEBUG_OUTPUT = 0x20000, /* output to device */ |
129 | DEBUG_ISO = 0x40000, /* isochronous transfers */ | 129 | DEBUG_ISO = 0x40000, /* isochronous transfers */ |
130 | DEBUG_IF = 0x80000, /* character device operations */ | 130 | DEBUG_IF = 0x80000, /* character device operations */ |
131 | DEBUG_USBREQ = 0x100000, /* USB communication (except payload | 131 | DEBUG_USBREQ = 0x100000, /* USB communication (except payload |
132 | data) */ | 132 | data) */ |
133 | DEBUG_LOCKCMD = 0x200000, /* AT commands and responses when | 133 | DEBUG_LOCKCMD = 0x200000, /* AT commands and responses when |
134 | MS_LOCKED */ | 134 | MS_LOCKED */ |
135 | 135 | ||
136 | DEBUG_ANY = 0x3fffff, /* print message if any of the others is | 136 | DEBUG_ANY = 0x3fffff, /* print message if any of the others is |
137 | activated */ | 137 | activated */ |
138 | }; | 138 | }; |
139 | 139 | ||
140 | #ifdef CONFIG_GIGASET_DEBUG | 140 | /* missing from linux/device.h ... */ |
141 | #define DEBUG_DEFAULT (DEBUG_INIT | DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ) | 141 | #ifndef dev_notice |
142 | #else | 142 | #define dev_notice(dev, format, arg...) \ |
143 | #define DEBUG_DEFAULT 0 | 143 | dev_printk(KERN_NOTICE , dev , format , ## arg) |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | /* redefine syslog macros to prepend module name instead of entire | 146 | /* Kernel message macros for situations where dev_printk and friends cannot be |
147 | * source path */ | 147 | * used for lack of reliable access to a device structure. |
148 | * linux/usb.h already contains these but in an obsolete form which clutters | ||
149 | * the log needlessly, and according to the USB maintainer those should be | ||
150 | * removed rather than fixed anyway. | ||
151 | */ | ||
152 | #undef err | ||
148 | #undef info | 153 | #undef info |
149 | #define info(format, arg...) \ | ||
150 | printk(KERN_INFO "%s: " format "\n", \ | ||
151 | THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" , ## arg) | ||
152 | |||
153 | #undef notice | ||
154 | #define notice(format, arg...) \ | ||
155 | printk(KERN_NOTICE "%s: " format "\n", \ | ||
156 | THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" , ## arg) | ||
157 | |||
158 | #undef warn | 154 | #undef warn |
159 | #define warn(format, arg...) \ | 155 | #undef notice |
160 | printk(KERN_WARNING "%s: " format "\n", \ | ||
161 | THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" , ## arg) | ||
162 | 156 | ||
163 | #undef err | 157 | #define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ |
164 | #define err(format, arg...) \ | 158 | format "\n" , ## arg) |
165 | printk(KERN_ERR "%s: " format "\n", \ | 159 | #define info(format, arg...) printk(KERN_INFO KBUILD_MODNAME ": " \ |
166 | THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" , ## arg) | 160 | format "\n" , ## arg) |
161 | #define warn(format, arg...) printk(KERN_WARNING KBUILD_MODNAME ": " \ | ||
162 | format "\n" , ## arg) | ||
163 | #define notice(format, arg...) printk(KERN_NOTICE KBUILD_MODNAME ": " \ | ||
164 | format "\n" , ## arg) | ||
167 | 165 | ||
168 | #undef dbg | ||
169 | #ifdef CONFIG_GIGASET_DEBUG | 166 | #ifdef CONFIG_GIGASET_DEBUG |
170 | #define dbg(level, format, arg...) \ | 167 | |
168 | #define gig_dbg(level, format, arg...) \ | ||
171 | do { \ | 169 | do { \ |
172 | if (unlikely(((enum debuglevel)gigaset_debuglevel) & (level))) \ | 170 | if (unlikely(((enum debuglevel)gigaset_debuglevel) & (level))) \ |
173 | printk(KERN_DEBUG "%s: " format "\n", \ | 171 | printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \ |
174 | THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" \ | 172 | ## arg); \ |
175 | , ## arg); \ | ||
176 | } while (0) | 173 | } while (0) |
174 | #define DEBUG_DEFAULT (DEBUG_INIT | DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ) | ||
175 | |||
177 | #else | 176 | #else |
178 | #define dbg(level, format, arg...) do {} while (0) | 177 | |
178 | #define gig_dbg(level, format, arg...) do {} while (0) | ||
179 | #define DEBUG_DEFAULT 0 | ||
180 | |||
179 | #endif | 181 | #endif |
180 | 182 | ||
181 | void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, | 183 | void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, |
182 | size_t len, const unsigned char *buf, int from_user); | 184 | size_t len, const unsigned char *buf, int from_user); |
183 | 185 | ||
184 | /* connection state */ | 186 | /* connection state */ |
185 | #define ZSAU_NONE 0 | 187 | #define ZSAU_NONE 0 |
@@ -368,16 +370,6 @@ struct inbuf_t { | |||
368 | * BAS_OUTBUFPAD bytes immediately before data[write] (if | 370 | * BAS_OUTBUFPAD bytes immediately before data[write] (if |
369 | * write>=BAS_OUTBUFPAD) or those of the pad area (if write<BAS_OUTBUFPAD) | 371 | * write>=BAS_OUTBUFPAD) or those of the pad area (if write<BAS_OUTBUFPAD) |
370 | * are also filled with that value | 372 | * are also filled with that value |
371 | * - optionally, the following statistics on the buffer's usage can be | ||
372 | * collected: | ||
373 | * maxfill: maximum number of bytes occupied | ||
374 | * idlefills: number of times a frame of idle bytes is prepared | ||
375 | * emptygets: number of times the buffer was empty when a data frame was | ||
376 | * requested | ||
377 | * backtoback: number of times two data packets were entered into the buffer | ||
378 | * without intervening idle flags | ||
379 | * nakedback: set if no idle flags have been inserted since the last data | ||
380 | * packet | ||
381 | */ | 373 | */ |
382 | struct isowbuf_t { | 374 | struct isowbuf_t { |
383 | atomic_t read; | 375 | atomic_t read; |
@@ -471,7 +463,7 @@ struct bc_state { | |||
471 | int busy; | 463 | int busy; |
472 | int use_count; | 464 | int use_count; |
473 | 465 | ||
474 | /* hardware drivers */ | 466 | /* private data of hardware drivers */ |
475 | union { | 467 | union { |
476 | struct ser_bc_state *ser; /* serial hardware driver */ | 468 | struct ser_bc_state *ser; /* serial hardware driver */ |
477 | struct usb_bc_state *usb; /* usb hardware driver (m105) */ | 469 | struct usb_bc_state *usb; /* usb hardware driver (m105) */ |
@@ -482,6 +474,7 @@ struct bc_state { | |||
482 | struct cardstate { | 474 | struct cardstate { |
483 | struct gigaset_driver *driver; | 475 | struct gigaset_driver *driver; |
484 | unsigned minor_index; | 476 | unsigned minor_index; |
477 | struct device *dev; | ||
485 | 478 | ||
486 | const struct gigaset_ops *ops; | 479 | const struct gigaset_ops *ops; |
487 | 480 | ||
@@ -531,11 +524,11 @@ struct cardstate { | |||
531 | int cs_init; | 524 | int cs_init; |
532 | int ignoreframes; /* frames to ignore after setting up the | 525 | int ignoreframes; /* frames to ignore after setting up the |
533 | B channel */ | 526 | B channel */ |
534 | struct semaphore sem; /* locks this structure: */ | 527 | struct semaphore sem; /* locks this structure: |
535 | /* connected is not changed, */ | 528 | * connected is not changed, |
536 | /* hardware_up is not changed, */ | 529 | * hardware_up is not changed, |
537 | /* MState is not changed to or from | 530 | * MState is not changed to or from |
538 | MS_LOCKED */ | 531 | * MS_LOCKED */ |
539 | 532 | ||
540 | struct timer_list timer; | 533 | struct timer_list timer; |
541 | int retry_count; | 534 | int retry_count; |
@@ -543,7 +536,7 @@ struct cardstate { | |||
543 | dle encoded */ | 536 | dle encoded */ |
544 | int cur_at_seq; /* sequence of AT commands being | 537 | int cur_at_seq; /* sequence of AT commands being |
545 | processed */ | 538 | processed */ |
546 | int curchannel; /* channel, those commands are meant | 539 | int curchannel; /* channel those commands are meant |
547 | for */ | 540 | for */ |
548 | atomic_t commands_pending; /* flag(s) in xxx.commands_pending have | 541 | atomic_t commands_pending; /* flag(s) in xxx.commands_pending have |
549 | been set */ | 542 | been set */ |
@@ -551,7 +544,7 @@ struct cardstate { | |||
551 | /* tasklet for serializing AT commands. | 544 | /* tasklet for serializing AT commands. |
552 | * Scheduled | 545 | * Scheduled |
553 | * -> for modem reponses (and | 546 | * -> for modem reponses (and |
554 | * incomming data for M10x) | 547 | * incoming data for M10x) |
555 | * -> on timeout | 548 | * -> on timeout |
556 | * -> after setting bits in | 549 | * -> after setting bits in |
557 | * xxx.at_state.pending_command | 550 | * xxx.at_state.pending_command |
@@ -569,7 +562,7 @@ struct cardstate { | |||
569 | unsigned char respdata[MAX_RESP_SIZE]; | 562 | unsigned char respdata[MAX_RESP_SIZE]; |
570 | unsigned cbytes; | 563 | unsigned cbytes; |
571 | 564 | ||
572 | /* hardware drivers */ | 565 | /* private data of hardware drivers */ |
573 | union { | 566 | union { |
574 | struct usb_cardstate *usb; /* USB hardware driver (m105) */ | 567 | struct usb_cardstate *usb; /* USB hardware driver (m105) */ |
575 | struct ser_cardstate *ser; /* serial hardware driver */ | 568 | struct ser_cardstate *ser; /* serial hardware driver */ |
@@ -607,36 +600,33 @@ struct bas_bc_state { | |||
607 | struct isow_urbctx_t isoouturbs[BAS_OUTURBS]; | 600 | struct isow_urbctx_t isoouturbs[BAS_OUTURBS]; |
608 | struct isow_urbctx_t *isooutdone, *isooutfree, *isooutovfl; | 601 | struct isow_urbctx_t *isooutdone, *isooutfree, *isooutovfl; |
609 | struct isowbuf_t *isooutbuf; | 602 | struct isowbuf_t *isooutbuf; |
610 | unsigned numsub; /* submitted URB counter (for | 603 | unsigned numsub; /* submitted URB counter |
611 | diagnostic messages only) */ | 604 | (for diagnostic messages only) */ |
612 | struct tasklet_struct sent_tasklet; | 605 | struct tasklet_struct sent_tasklet; |
613 | 606 | ||
614 | /* isochronous input state */ | 607 | /* isochronous input state */ |
615 | spinlock_t isoinlock; | 608 | spinlock_t isoinlock; |
616 | struct urb *isoinurbs[BAS_INURBS]; | 609 | struct urb *isoinurbs[BAS_INURBS]; |
617 | unsigned char isoinbuf[BAS_INBUFSIZE * BAS_INURBS]; | 610 | unsigned char isoinbuf[BAS_INBUFSIZE * BAS_INURBS]; |
618 | struct urb *isoindone; /* completed isoc read URB */ | 611 | struct urb *isoindone; /* completed isoc read URB */ |
619 | int loststatus; /* status of dropped URB */ | 612 | int loststatus; /* status of dropped URB */ |
620 | unsigned isoinlost; /* number of bytes lost */ | 613 | unsigned isoinlost; /* number of bytes lost */ |
621 | /* state of bit unstuffing algorithm (in addition to | 614 | /* state of bit unstuffing algorithm |
622 | BC_state.inputstate) */ | 615 | (in addition to BC_state.inputstate) */ |
623 | unsigned seqlen; /* number of '1' bits not yet | 616 | unsigned seqlen; /* number of '1' bits not yet |
624 | unstuffed */ | 617 | unstuffed */ |
625 | unsigned inbyte, inbits; /* collected bits for next byte | 618 | unsigned inbyte, inbits; /* collected bits for next byte */ |
626 | */ | ||
627 | /* statistics */ | 619 | /* statistics */ |
628 | unsigned goodbytes; /* bytes correctly received */ | 620 | unsigned goodbytes; /* bytes correctly received */ |
629 | unsigned alignerrs; /* frames with incomplete byte | 621 | unsigned alignerrs; /* frames with incomplete byte at end */ |
630 | at end */ | 622 | unsigned fcserrs; /* FCS errors */ |
631 | unsigned fcserrs; /* FCS errors */ | 623 | unsigned frameerrs; /* framing errors */ |
632 | unsigned frameerrs; /* framing errors */ | 624 | unsigned giants; /* long frames */ |
633 | unsigned giants; /* long frames */ | 625 | unsigned runts; /* short frames */ |
634 | unsigned runts; /* short frames */ | 626 | unsigned aborts; /* HDLC aborts */ |
635 | unsigned aborts; /* HDLC aborts */ | 627 | unsigned shared0s; /* '0' bits shared between flags */ |
636 | unsigned shared0s; /* '0' bits shared between flags | 628 | unsigned stolen0s; /* '0' stuff bits also serving as |
637 | */ | 629 | leading flag bits */ |
638 | unsigned stolen0s; /* '0' stuff bits also serving | ||
639 | as leading flag bits */ | ||
640 | struct tasklet_struct rcvd_tasklet; | 630 | struct tasklet_struct rcvd_tasklet; |
641 | }; | 631 | }; |
642 | 632 | ||
@@ -644,8 +634,8 @@ struct gigaset_ops { | |||
644 | /* Called from ev-layer.c/interface.c for sending AT commands to the | 634 | /* Called from ev-layer.c/interface.c for sending AT commands to the |
645 | device */ | 635 | device */ |
646 | int (*write_cmd)(struct cardstate *cs, | 636 | int (*write_cmd)(struct cardstate *cs, |
647 | const unsigned char *buf, int len, | 637 | const unsigned char *buf, int len, |
648 | struct tasklet_struct *wake_tasklet); | 638 | struct tasklet_struct *wake_tasklet); |
649 | 639 | ||
650 | /* Called from interface.c for additional device control */ | 640 | /* Called from interface.c for additional device control */ |
651 | int (*write_room)(struct cardstate *cs); | 641 | int (*write_room)(struct cardstate *cs); |
@@ -699,7 +689,7 @@ struct gigaset_ops { | |||
699 | * <DLE_FLAG>: 0x10 | 689 | * <DLE_FLAG>: 0x10 |
700 | * <EVENT>: ((a-z)* | (A-Z)* | (0-10)*)+ | 690 | * <EVENT>: ((a-z)* | (A-Z)* | (0-10)*)+ |
701 | */ | 691 | */ |
702 | #define DLE_FLAG 0x10 | 692 | #define DLE_FLAG 0x10 |
703 | 693 | ||
704 | /* =========================================================================== | 694 | /* =========================================================================== |
705 | * Functions implemented in asyncdata.c | 695 | * Functions implemented in asyncdata.c |
@@ -764,7 +754,7 @@ static inline void gigaset_isdn_rcv_err(struct bc_state *bcs) | |||
764 | isdn_ctrl response; | 754 | isdn_ctrl response; |
765 | 755 | ||
766 | /* error -> LL */ | 756 | /* error -> LL */ |
767 | dbg(DEBUG_CMD, "sending L1ERR"); | 757 | gig_dbg(DEBUG_CMD, "sending L1ERR"); |
768 | response.driver = bcs->cs->myid; | 758 | response.driver = bcs->cs->myid; |
769 | response.command = ISDN_STAT_L1ERR; | 759 | response.command = ISDN_STAT_L1ERR; |
770 | response.arg = bcs->channel; | 760 | response.arg = bcs->channel; |
@@ -797,7 +787,7 @@ void gigaset_free_dev_sysfs(struct usb_interface *interface); | |||
797 | 787 | ||
798 | void gigaset_bcs_reinit(struct bc_state *bcs); | 788 | void gigaset_bcs_reinit(struct bc_state *bcs); |
799 | void gigaset_at_init(struct at_state_t *at_state, struct bc_state *bcs, | 789 | void gigaset_at_init(struct at_state_t *at_state, struct bc_state *bcs, |
800 | struct cardstate *cs, int cid); | 790 | struct cardstate *cs, int cid); |
801 | int gigaset_get_channel(struct bc_state *bcs); | 791 | int gigaset_get_channel(struct bc_state *bcs); |
802 | void gigaset_free_channel(struct bc_state *bcs); | 792 | void gigaset_free_channel(struct bc_state *bcs); |
803 | int gigaset_get_channels(struct cardstate *cs); | 793 | int gigaset_get_channels(struct cardstate *cs); |
@@ -806,11 +796,11 @@ void gigaset_block_channels(struct cardstate *cs); | |||
806 | 796 | ||
807 | /* Allocate and initialize driver structure. */ | 797 | /* Allocate and initialize driver structure. */ |
808 | struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors, | 798 | struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors, |
809 | const char *procname, | 799 | const char *procname, |
810 | const char *devname, | 800 | const char *devname, |
811 | const char *devfsname, | 801 | const char *devfsname, |
812 | const struct gigaset_ops *ops, | 802 | const struct gigaset_ops *ops, |
813 | struct module *owner); | 803 | struct module *owner); |
814 | 804 | ||
815 | /* Deallocate driver structure. */ | 805 | /* Deallocate driver structure. */ |
816 | void gigaset_freedriver(struct gigaset_driver *drv); | 806 | void gigaset_freedriver(struct gigaset_driver *drv); |
@@ -850,8 +840,8 @@ void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb); | |||
850 | * ptr must be kmalloc()ed (and not be freed by the caller). | 840 | * ptr must be kmalloc()ed (and not be freed by the caller). |
851 | */ | 841 | */ |
852 | struct event_t *gigaset_add_event(struct cardstate *cs, | 842 | struct event_t *gigaset_add_event(struct cardstate *cs, |
853 | struct at_state_t *at_state, int type, | 843 | struct at_state_t *at_state, int type, |
854 | void *ptr, int parameter, void *arg); | 844 | void *ptr, int parameter, void *arg); |
855 | 845 | ||
856 | /* Called on CONFIG1 command from frontend. */ | 846 | /* Called on CONFIG1 command from frontend. */ |
857 | int gigaset_enterconfigmode(struct cardstate *cs); //0: success <0: errorcode | 847 | int gigaset_enterconfigmode(struct cardstate *cs); //0: success <0: errorcode |
@@ -872,7 +862,7 @@ static inline void gigaset_bchannel_down(struct bc_state *bcs) | |||
872 | { | 862 | { |
873 | gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_CLOSED, NULL, 0, NULL); | 863 | gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_CLOSED, NULL, 0, NULL); |
874 | 864 | ||
875 | dbg(DEBUG_CMD, "scheduling BC_CLOSED"); | 865 | gig_dbg(DEBUG_CMD, "scheduling BC_CLOSED"); |
876 | gigaset_schedule_event(bcs->cs); | 866 | gigaset_schedule_event(bcs->cs); |
877 | } | 867 | } |
878 | 868 | ||
@@ -882,7 +872,7 @@ static inline void gigaset_bchannel_up(struct bc_state *bcs) | |||
882 | { | 872 | { |
883 | gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_OPEN, NULL, 0, NULL); | 873 | gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_OPEN, NULL, 0, NULL); |
884 | 874 | ||
885 | dbg(DEBUG_CMD, "scheduling BC_OPEN"); | 875 | gig_dbg(DEBUG_CMD, "scheduling BC_OPEN"); |
886 | gigaset_schedule_event(bcs->cs); | 876 | gigaset_schedule_event(bcs->cs); |
887 | } | 877 | } |
888 | 878 | ||
@@ -897,7 +887,7 @@ static inline void gigaset_bchannel_up(struct bc_state *bcs) | |||
897 | * appropriate locks held only. | 887 | * appropriate locks held only. |
898 | */ | 888 | */ |
899 | static inline unsigned char *gigaset_skb_put_quick(struct sk_buff *skb, | 889 | static inline unsigned char *gigaset_skb_put_quick(struct sk_buff *skb, |
900 | unsigned int len) | 890 | unsigned int len) |
901 | { | 891 | { |
902 | unsigned char *tmp = skb->tail; | 892 | unsigned char *tmp = skb->tail; |
903 | /*SKB_LINEAR_ASSERT(skb);*/ /* not needed here */ | 893 | /*SKB_LINEAR_ASSERT(skb);*/ /* not needed here */ |
@@ -910,8 +900,8 @@ static inline unsigned char *gigaset_skb_put_quick(struct sk_buff *skb, | |||
910 | * Warning: skb must not be accessed anymore! | 900 | * Warning: skb must not be accessed anymore! |
911 | */ | 901 | */ |
912 | static inline void gigaset_rcv_skb(struct sk_buff *skb, | 902 | static inline void gigaset_rcv_skb(struct sk_buff *skb, |
913 | struct cardstate *cs, | 903 | struct cardstate *cs, |
914 | struct bc_state *bcs) | 904 | struct bc_state *bcs) |
915 | { | 905 | { |
916 | cs->iif.rcvcallb_skb(cs->myid, bcs->channel, skb); | 906 | cs->iif.rcvcallb_skb(cs->myid, bcs->channel, skb); |
917 | bcs->trans_down++; | 907 | bcs->trans_down++; |
@@ -921,8 +911,8 @@ static inline void gigaset_rcv_skb(struct sk_buff *skb, | |||
921 | * Warning: skb must not be accessed anymore! | 911 | * Warning: skb must not be accessed anymore! |
922 | */ | 912 | */ |
923 | static inline void gigaset_rcv_error(struct sk_buff *procskb, | 913 | static inline void gigaset_rcv_error(struct sk_buff *procskb, |
924 | struct cardstate *cs, | 914 | struct cardstate *cs, |
925 | struct bc_state *bcs) | 915 | struct bc_state *bcs) |
926 | { | 916 | { |
927 | if (procskb) | 917 | if (procskb) |
928 | dev_kfree_skb(procskb); | 918 | dev_kfree_skb(procskb); |
@@ -942,12 +932,12 @@ extern __u8 gigaset_invtab[]; /* in common.c */ | |||
942 | 932 | ||
943 | /* append received bytes to inbuf */ | 933 | /* append received bytes to inbuf */ |
944 | static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf, | 934 | static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf, |
945 | const unsigned char *src, | 935 | const unsigned char *src, |
946 | unsigned numbytes) | 936 | unsigned numbytes) |
947 | { | 937 | { |
948 | unsigned n, head, tail, bytesleft; | 938 | unsigned n, head, tail, bytesleft; |
949 | 939 | ||
950 | dbg(DEBUG_INTR, "received %u bytes", numbytes); | 940 | gig_dbg(DEBUG_INTR, "received %u bytes", numbytes); |
951 | 941 | ||
952 | if (!numbytes) | 942 | if (!numbytes) |
953 | return 0; | 943 | return 0; |
@@ -955,7 +945,7 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf, | |||
955 | bytesleft = numbytes; | 945 | bytesleft = numbytes; |
956 | tail = atomic_read(&inbuf->tail); | 946 | tail = atomic_read(&inbuf->tail); |
957 | head = atomic_read(&inbuf->head); | 947 | head = atomic_read(&inbuf->head); |
958 | dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail); | 948 | gig_dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail); |
959 | 949 | ||
960 | while (bytesleft) { | 950 | while (bytesleft) { |
961 | if (head > tail) | 951 | if (head > tail) |
@@ -965,7 +955,8 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf, | |||
965 | else | 955 | else |
966 | n = RBUFSIZE - tail; | 956 | n = RBUFSIZE - tail; |
967 | if (!n) { | 957 | if (!n) { |
968 | err("buffer overflow (%u bytes lost)", bytesleft); | 958 | dev_err(inbuf->cs->dev, |
959 | "buffer overflow (%u bytes lost)", bytesleft); | ||
969 | break; | 960 | break; |
970 | } | 961 | } |
971 | if (n > bytesleft) | 962 | if (n > bytesleft) |
@@ -975,7 +966,7 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf, | |||
975 | tail = (tail + n) % RBUFSIZE; | 966 | tail = (tail + n) % RBUFSIZE; |
976 | src += n; | 967 | src += n; |
977 | } | 968 | } |
978 | dbg(DEBUG_INTR, "setting tail to %u", tail); | 969 | gig_dbg(DEBUG_INTR, "setting tail to %u", tail); |
979 | atomic_set(&inbuf->tail, tail); | 970 | atomic_set(&inbuf->tail, tail); |
980 | return numbytes != bytesleft; | 971 | return numbytes != bytesleft; |
981 | } | 972 | } |
@@ -986,7 +977,7 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf, | |||
986 | 977 | ||
987 | /* initialize interface */ | 978 | /* initialize interface */ |
988 | void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname, | 979 | void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname, |
989 | const char *devname, const char *devfsname); | 980 | const char *devname, const char *devfsname); |
990 | /* release interface */ | 981 | /* release interface */ |
991 | void gigaset_if_freedriver(struct gigaset_driver *drv); | 982 | void gigaset_if_freedriver(struct gigaset_driver *drv); |
992 | /* add minor */ | 983 | /* add minor */ |
@@ -995,6 +986,6 @@ void gigaset_if_init(struct cardstate *cs); | |||
995 | void gigaset_if_free(struct cardstate *cs); | 986 | void gigaset_if_free(struct cardstate *cs); |
996 | /* device received data */ | 987 | /* device received data */ |
997 | void gigaset_if_receive(struct cardstate *cs, | 988 | void gigaset_if_receive(struct cardstate *cs, |
998 | unsigned char *buffer, size_t len); | 989 | unsigned char *buffer, size_t len); |
999 | 990 | ||
1000 | #endif | 991 | #endif |