Commit 784d5858 authored by Tilman Schmidt's avatar Tilman Schmidt Committed by Linus Torvalds

[PATCH] isdn4linux: Siemens Gigaset drivers: logging usage

With Hansjoerg Lipp <hjlipp@web.de>

Improve error reporting of the Gigaset drivers, by using the
dev_err/dev_warn/dev_info macros from device.h instead of err/warn/info from
usb.h whereever possible.

Also rename the private dbg macro to gig_dbg in order to avoid confusion with
the macro of the same name in usb.h.
Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ec81b5e6
...@@ -51,7 +51,7 @@ static inline int cmd_loop(unsigned char c, unsigned char *src, int numbytes, ...@@ -51,7 +51,7 @@ static inline int cmd_loop(unsigned char c, unsigned char *src, int numbytes,
for (;;) { for (;;) {
cs->respdata[cbytes] = c; cs->respdata[cbytes] = c;
if (c == 10 || c == 13) { if (c == 10 || c == 13) {
dbg(DEBUG_TRANSCMD, "%s: End of Command (%d Bytes)", gig_dbg(DEBUG_TRANSCMD, "%s: End of Command (%d Bytes)",
__func__, cbytes); __func__, cbytes);
cs->cbytes = cbytes; cs->cbytes = cbytes;
gigaset_handle_modem_response(cs); /* can change gigaset_handle_modem_response(cs); /* can change
...@@ -68,7 +68,7 @@ static inline int cmd_loop(unsigned char c, unsigned char *src, int numbytes, ...@@ -68,7 +68,7 @@ static inline int cmd_loop(unsigned char c, unsigned char *src, int numbytes,
if (cbytes < MAX_RESP_SIZE - 1) if (cbytes < MAX_RESP_SIZE - 1)
cbytes++; cbytes++;
else else
warn("response too large"); dev_warn(cs->dev, "response too large\n");
} }
if (!numbytes) if (!numbytes)
...@@ -154,39 +154,37 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes, ...@@ -154,39 +154,37 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
c ^= PPP_TRANS; c ^= PPP_TRANS;
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
if (unlikely(!muststuff(c))) if (unlikely(!muststuff(c)))
dbg(DEBUG_HDLC, gig_dbg(DEBUG_HDLC, "byte stuffed: 0x%02x", c);
"byte stuffed: 0x%02x", c);
#endif #endif
} else if (unlikely(c == PPP_FLAG)) { } else if (unlikely(c == PPP_FLAG)) {
if (unlikely(inputstate & INS_skip_frame)) { if (unlikely(inputstate & INS_skip_frame)) {
if (!(inputstate & INS_have_data)) { /* 7E 7E */ if (!(inputstate & INS_have_data)) { /* 7E 7E */
//dbg(DEBUG_HDLC, "(7e)7e------------------------");
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
++bcs->emptycount; ++bcs->emptycount;
#endif #endif
} else } else
dbg(DEBUG_HDLC, gig_dbg(DEBUG_HDLC,
"7e----------------------------"); "7e----------------------------");
/* end of frame */ /* end of frame */
error = 1; error = 1;
gigaset_rcv_error(NULL, cs, bcs); gigaset_rcv_error(NULL, cs, bcs);
} else if (!(inputstate & INS_have_data)) { /* 7E 7E */ } else if (!(inputstate & INS_have_data)) { /* 7E 7E */
//dbg(DEBUG_HDLC, "(7e)7e------------------------");
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
++bcs->emptycount; ++bcs->emptycount;
#endif #endif
break; break;
} else { } else {
dbg(DEBUG_HDLC, gig_dbg(DEBUG_HDLC,
"7e----------------------------"); "7e----------------------------");
/* end of frame */ /* end of frame */
error = 0; error = 0;
if (unlikely(fcs != PPP_GOODFCS)) { if (unlikely(fcs != PPP_GOODFCS)) {
err("Packet checksum at %lu failed, " dev_err(cs->dev,
"packet is corrupted (%u bytes)!", "Packet checksum at %lu failed, "
"packet is corrupted (%u bytes)!\n",
bcs->rcvbytes, skb->len); bcs->rcvbytes, skb->len);
compskb = NULL; compskb = NULL;
gigaset_rcv_error(compskb, cs, bcs); gigaset_rcv_error(compskb, cs, bcs);
...@@ -200,9 +198,11 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes, ...@@ -200,9 +198,11 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
skb = NULL; skb = NULL;
inputstate |= INS_skip_frame; inputstate |= INS_skip_frame;
if (l == 1) { if (l == 1) {
err("invalid packet size (1)!"); dev_err(cs->dev,
"invalid packet size (1)!\n");
error = 1; error = 1;
gigaset_rcv_error(NULL, cs, bcs); gigaset_rcv_error(NULL,
cs, bcs);
} }
} }
if (likely(!(error || if (likely(!(error ||
...@@ -225,7 +225,8 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes, ...@@ -225,7 +225,8 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
} else if (likely((skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL)) { } else if (likely((skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL)) {
skb_reserve(skb, HW_HDR_LEN); skb_reserve(skb, HW_HDR_LEN);
} else { } else {
warn("could not allocate new skb"); dev_warn(cs->dev,
"could not allocate new skb\n");
inputstate |= INS_skip_frame; inputstate |= INS_skip_frame;
} }
...@@ -233,7 +234,7 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes, ...@@ -233,7 +234,7 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
} else if (unlikely(muststuff(c))) { } else if (unlikely(muststuff(c))) {
/* Should not happen. Possible after ZDLE=1<CR><LF>. */ /* Should not happen. Possible after ZDLE=1<CR><LF>. */
dbg(DEBUG_HDLC, "not byte stuffed: 0x%02x", c); gig_dbg(DEBUG_HDLC, "not byte stuffed: 0x%02x", c);
#endif #endif
} }
...@@ -241,8 +242,8 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes, ...@@ -241,8 +242,8 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
if (unlikely(!(inputstate & INS_have_data))) { if (unlikely(!(inputstate & INS_have_data))) {
dbg(DEBUG_HDLC, gig_dbg(DEBUG_HDLC, "7e (%d x) ================",
"7e (%d x) ================", bcs->emptycount); bcs->emptycount);
bcs->emptycount = 0; bcs->emptycount = 0;
} }
#endif #endif
...@@ -251,7 +252,7 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes, ...@@ -251,7 +252,7 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
if (likely(!(inputstate & INS_skip_frame))) { if (likely(!(inputstate & INS_skip_frame))) {
if (unlikely(skb->len == SBUFSIZE)) { if (unlikely(skb->len == SBUFSIZE)) {
warn("received packet too long"); dev_warn(cs->dev, "received packet too long\n");
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
skb = NULL; skb = NULL;
inputstate |= INS_skip_frame; inputstate |= INS_skip_frame;
...@@ -307,7 +308,7 @@ static inline int iraw_loop(unsigned char c, unsigned char *src, int numbytes, ...@@ -307,7 +308,7 @@ static inline int iraw_loop(unsigned char c, unsigned char *src, int numbytes,
if (likely(!(inputstate & INS_skip_frame))) { if (likely(!(inputstate & INS_skip_frame))) {
if (unlikely(skb->len == SBUFSIZE)) { if (unlikely(skb->len == SBUFSIZE)) {
//FIXME just pass skb up and allocate a new one //FIXME just pass skb up and allocate a new one
warn("received packet too long"); dev_warn(cs->dev, "received packet too long\n");
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
skb = NULL; skb = NULL;
inputstate |= INS_skip_frame; inputstate |= INS_skip_frame;
...@@ -341,7 +342,7 @@ static inline int iraw_loop(unsigned char c, unsigned char *src, int numbytes, ...@@ -341,7 +342,7 @@ static inline int iraw_loop(unsigned char c, unsigned char *src, int numbytes,
!= NULL)) { != NULL)) {
skb_reserve(skb, HW_HDR_LEN); skb_reserve(skb, HW_HDR_LEN);
} else { } else {
warn("could not allocate new skb"); dev_warn(cs->dev, "could not allocate new skb\n");
inputstate |= INS_skip_frame; inputstate |= INS_skip_frame;
} }
} }
...@@ -362,13 +363,13 @@ void gigaset_m10x_input(struct inbuf_t *inbuf) ...@@ -362,13 +363,13 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
head = atomic_read(&inbuf->head); head = atomic_read(&inbuf->head);
tail = atomic_read(&inbuf->tail); tail = atomic_read(&inbuf->tail);
dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail); gig_dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail);
if (head != tail) { if (head != tail) {
cs = inbuf->cs; cs = inbuf->cs;
src = inbuf->data + head; src = inbuf->data + head;
numbytes = (head > tail ? RBUFSIZE : tail) - head; numbytes = (head > tail ? RBUFSIZE : tail) - head;
dbg(DEBUG_INTR, "processing %u bytes", numbytes); gig_dbg(DEBUG_INTR, "processing %u bytes", numbytes);
while (numbytes) { while (numbytes) {
if (atomic_read(&cs->mstate) == MS_LOCKED) { if (atomic_read(&cs->mstate) == MS_LOCKED) {
...@@ -400,13 +401,14 @@ void gigaset_m10x_input(struct inbuf_t *inbuf) ...@@ -400,13 +401,14 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
src += procbytes; src += procbytes;
numbytes -= procbytes; numbytes -= procbytes;
} else { /* DLE-char */ } else { /* DLE char */
inbuf->inputstate &= ~INS_DLE_char; inbuf->inputstate &= ~INS_DLE_char;
switch (c) { switch (c) {
case 'X': /*begin of command*/ case 'X': /*begin of command*/
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
if (inbuf->inputstate & INS_command) if (inbuf->inputstate & INS_command)
err("received <DLE> 'X' in command mode"); dev_err(cs->dev,
"received <DLE> 'X' in command mode\n");
#endif #endif
inbuf->inputstate |= inbuf->inputstate |=
INS_command | INS_DLE_command; INS_command | INS_DLE_command;
...@@ -414,7 +416,8 @@ void gigaset_m10x_input(struct inbuf_t *inbuf) ...@@ -414,7 +416,8 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
case '.': /*end of command*/ case '.': /*end of command*/
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
if (!(inbuf->inputstate & INS_command)) if (!(inbuf->inputstate & INS_command))
err("received <DLE> '.' in hdlc mode"); dev_err(cs->dev,
"received <DLE> '.' in hdlc mode\n");
#endif #endif
inbuf->inputstate &= cs->dle ? inbuf->inputstate &= cs->dle ?
~(INS_DLE_command|INS_command) ~(INS_DLE_command|INS_command)
...@@ -422,7 +425,9 @@ void gigaset_m10x_input(struct inbuf_t *inbuf) ...@@ -422,7 +425,9 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
break; break;
//case DLE_FLAG: /*DLE_FLAG in data stream*/ /* schon oben behandelt! */ //case DLE_FLAG: /*DLE_FLAG in data stream*/ /* schon oben behandelt! */
default: default:
err("received 0x10 0x%02x!", (int) c); dev_err(cs->dev,
"received 0x10 0x%02x!\n",
(int) c);
/* FIXME: reset driver?? */ /* FIXME: reset driver?? */
} }
} }
...@@ -441,7 +446,7 @@ void gigaset_m10x_input(struct inbuf_t *inbuf) ...@@ -441,7 +446,7 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
} }
} }
dbg(DEBUG_INTR, "setting head to %u", head); gig_dbg(DEBUG_INTR, "setting head to %u", head);
atomic_set(&inbuf->head, head); atomic_set(&inbuf->head, head);
} }
} }
...@@ -483,7 +488,6 @@ static struct sk_buff *HDLC_Encode(struct sk_buff *skb, int head, int tail) ...@@ -483,7 +488,6 @@ static struct sk_buff *HDLC_Encode(struct sk_buff *skb, int head, int tail)
*/ */
hdlc_skb = dev_alloc_skb(skb->len + stuf_cnt + 6 + tail + head); hdlc_skb = dev_alloc_skb(skb->len + stuf_cnt + 6 + tail + head);
if (!hdlc_skb) { if (!hdlc_skb) {
err("unable to allocate memory for HDLC encoding!");
dev_kfree_skb(skb); dev_kfree_skb(skb);
return NULL; return NULL;
} }
...@@ -543,7 +547,6 @@ static struct sk_buff *iraw_encode(struct sk_buff *skb, int head, int tail) ...@@ -543,7 +547,6 @@ static struct sk_buff *iraw_encode(struct sk_buff *skb, int head, int tail)
/* worst case: every byte must be stuffed */ /* worst case: every byte must be stuffed */
iraw_skb = dev_alloc_skb(2*skb->len + tail + head); iraw_skb = dev_alloc_skb(2*skb->len + tail + head);
if (!iraw_skb) { if (!iraw_skb) {
err("unable to allocate memory for HDLC encoding!");
dev_kfree_skb(skb); dev_kfree_skb(skb);
return NULL; return NULL;
} }
...@@ -584,8 +587,11 @@ int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb) ...@@ -584,8 +587,11 @@ int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb)
skb = HDLC_Encode(skb, HW_HDR_LEN, 0); skb = HDLC_Encode(skb, HW_HDR_LEN, 0);
else else
skb = iraw_encode(skb, HW_HDR_LEN, 0); skb = iraw_encode(skb, HW_HDR_LEN, 0);
if (!skb) if (!skb) {
dev_err(bcs->cs->dev,
"unable to allocate memory for encoding!\n");
return -ENOMEM; return -ENOMEM;
}
skb_queue_tail(&bcs->squeue, skb); skb_queue_tail(&bcs->squeue, skb);
tasklet_schedule(&bcs->cs->write_tasklet); tasklet_schedule(&bcs->cs->write_tasklet);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -106,7 +106,7 @@ extern int gigaset_debuglevel; /* "needs" cast to (enum debuglevel) */ ...@@ -106,7 +106,7 @@ extern int gigaset_debuglevel; /* "needs" cast to (enum debuglevel) */
* DEBUG_INTR. * DEBUG_INTR.
*/ */
enum debuglevel { /* up to 24 bits (atomic_t) */ enum debuglevel { /* up to 24 bits (atomic_t) */
DEBUG_REG = 0x0002,/* serial port I/O register operations */ DEBUG_REG = 0x0002, /* serial port I/O register operations */
DEBUG_OPEN = 0x0004, /* open/close serial port */ DEBUG_OPEN = 0x0004, /* open/close serial port */
DEBUG_INTR = 0x0008, /* interrupt processing */ DEBUG_INTR = 0x0008, /* interrupt processing */
DEBUG_INTR_DUMP = 0x0010, /* Activating hexdump debug output on DEBUG_INTR_DUMP = 0x0010, /* Activating hexdump debug output on
...@@ -137,45 +137,47 @@ enum debuglevel { /* up to 24 bits (atomic_t) */ ...@@ -137,45 +137,47 @@ enum debuglevel { /* up to 24 bits (atomic_t) */
activated */ activated */
}; };
#ifdef CONFIG_GIGASET_DEBUG /* missing from linux/device.h ... */
#define DEBUG_DEFAULT (DEBUG_INIT | DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ) #ifndef dev_notice
#else #define dev_notice(dev, format, arg...) \
#define DEBUG_DEFAULT 0 dev_printk(KERN_NOTICE , dev , format , ## arg)
#endif #endif
/* redefine syslog macros to prepend module name instead of entire /* Kernel message macros for situations where dev_printk and friends cannot be
* source path */ * used for lack of reliable access to a device structure.
* linux/usb.h already contains these but in an obsolete form which clutters
* the log needlessly, and according to the USB maintainer those should be
* removed rather than fixed anyway.
*/
#undef err
#undef info #undef info
#define info(format, arg...) \
printk(KERN_INFO "%s: " format "\n", \
THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" , ## arg)
#undef notice
#define notice(format, arg...) \
printk(KERN_NOTICE "%s: " format "\n", \
THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" , ## arg)
#undef warn #undef warn
#define warn(format, arg...) \ #undef notice
printk(KERN_WARNING "%s: " format "\n", \
THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" , ## arg)
#undef err #define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \
#define err(format, arg...) \ format "\n" , ## arg)
printk(KERN_ERR "%s: " format "\n", \ #define info(format, arg...) printk(KERN_INFO KBUILD_MODNAME ": " \
THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" , ## arg) format "\n" , ## arg)
#define warn(format, arg...) printk(KERN_WARNING KBUILD_MODNAME ": " \
format "\n" , ## arg)
#define notice(format, arg...) printk(KERN_NOTICE KBUILD_MODNAME ": " \
format "\n" , ## arg)
#undef dbg
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
#define dbg(level, format, arg...) \
#define gig_dbg(level, format, arg...) \
do { \ do { \
if (unlikely(((enum debuglevel)gigaset_debuglevel) & (level))) \ if (unlikely(((enum debuglevel)gigaset_debuglevel) & (level))) \
printk(KERN_DEBUG "%s: " format "\n", \ printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \
THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" \ ## arg); \
, ## arg); \
} while (0) } while (0)
#define DEBUG_DEFAULT (DEBUG_INIT | DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)
#else #else
#define dbg(level, format, arg...) do {} while (0)
#define gig_dbg(level, format, arg...) do {} while (0)
#define DEBUG_DEFAULT 0
#endif #endif
void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
...@@ -368,16 +370,6 @@ struct inbuf_t { ...@@ -368,16 +370,6 @@ struct inbuf_t {
* BAS_OUTBUFPAD bytes immediately before data[write] (if * BAS_OUTBUFPAD bytes immediately before data[write] (if
* write>=BAS_OUTBUFPAD) or those of the pad area (if write<BAS_OUTBUFPAD) * write>=BAS_OUTBUFPAD) or those of the pad area (if write<BAS_OUTBUFPAD)
* are also filled with that value * are also filled with that value
* - optionally, the following statistics on the buffer's usage can be
* collected:
* maxfill: maximum number of bytes occupied
* idlefills: number of times a frame of idle bytes is prepared
* emptygets: number of times the buffer was empty when a data frame was
* requested
* backtoback: number of times two data packets were entered into the buffer
* without intervening idle flags
* nakedback: set if no idle flags have been inserted since the last data
* packet
*/ */
struct isowbuf_t { struct isowbuf_t {
atomic_t read; atomic_t read;
...@@ -471,7 +463,7 @@ struct bc_state { ...@@ -471,7 +463,7 @@ struct bc_state {
int busy; int busy;
int use_count; int use_count;
/* hardware drivers */ /* private data of hardware drivers */
union { union {
struct ser_bc_state *ser; /* serial hardware driver */ struct ser_bc_state *ser; /* serial hardware driver */
struct usb_bc_state *usb; /* usb hardware driver (m105) */ struct usb_bc_state *usb; /* usb hardware driver (m105) */
...@@ -482,6 +474,7 @@ struct bc_state { ...@@ -482,6 +474,7 @@ struct bc_state {
struct cardstate { struct cardstate {
struct gigaset_driver *driver; struct gigaset_driver *driver;
unsigned minor_index; unsigned minor_index;
struct device *dev;
const struct gigaset_ops *ops; const struct gigaset_ops *ops;
...@@ -531,11 +524,11 @@ struct cardstate { ...@@ -531,11 +524,11 @@ struct cardstate {
int cs_init; int cs_init;
int ignoreframes; /* frames to ignore after setting up the int ignoreframes; /* frames to ignore after setting up the
B channel */ B channel */
struct semaphore sem; /* locks this structure: */ struct semaphore sem; /* locks this structure:
/* connected is not changed, */ * connected is not changed,
/* hardware_up is not changed, */ * hardware_up is not changed,
/* MState is not changed to or from * MState is not changed to or from
MS_LOCKED */ * MS_LOCKED */
struct timer_list timer; struct timer_list timer;
int retry_count; int retry_count;
...@@ -543,7 +536,7 @@ struct cardstate { ...@@ -543,7 +536,7 @@ struct cardstate {
dle encoded */ dle encoded */
int cur_at_seq; /* sequence of AT commands being int cur_at_seq; /* sequence of AT commands being
processed */ processed */
int curchannel; /* channel, those commands are meant int curchannel; /* channel those commands are meant
for */ for */
atomic_t commands_pending; /* flag(s) in xxx.commands_pending have atomic_t commands_pending; /* flag(s) in xxx.commands_pending have
been set */ been set */
...@@ -551,7 +544,7 @@ struct cardstate { ...@@ -551,7 +544,7 @@ struct cardstate {
/* tasklet for serializing AT commands. /* tasklet for serializing AT commands.
* Scheduled * Scheduled
* -> for modem reponses (and * -> for modem reponses (and
* incomming data for M10x) * incoming data for M10x)
* -> on timeout * -> on timeout
* -> after setting bits in * -> after setting bits in
* xxx.at_state.pending_command * xxx.at_state.pending_command
...@@ -569,7 +562,7 @@ struct cardstate { ...@@ -569,7 +562,7 @@ struct cardstate {
unsigned char respdata[MAX_RESP_SIZE]; unsigned char respdata[MAX_RESP_SIZE];
unsigned cbytes; unsigned cbytes;
/* hardware drivers */ /* private data of hardware drivers */
union { union {
struct usb_cardstate *usb; /* USB hardware driver (m105) */ struct usb_cardstate *usb; /* USB hardware driver (m105) */
struct ser_cardstate *ser; /* serial hardware driver */ struct ser_cardstate *ser; /* serial hardware driver */
...@@ -607,8 +600,8 @@ struct bas_bc_state { ...@@ -607,8 +600,8 @@ struct bas_bc_state {
struct isow_urbctx_t isoouturbs[BAS_OUTURBS]; struct isow_urbctx_t isoouturbs[BAS_OUTURBS];
struct isow_urbctx_t *isooutdone, *isooutfree, *isooutovfl; struct isow_urbctx_t *isooutdone, *isooutfree, *isooutovfl;
struct isowbuf_t *isooutbuf; struct isowbuf_t *isooutbuf;
unsigned numsub; /* submitted URB counter (for unsigned numsub; /* submitted URB counter
diagnostic messages only) */ (for diagnostic messages only) */
struct tasklet_struct sent_tasklet; struct tasklet_struct sent_tasklet;
/* isochronous input state */ /* isochronous input state */
...@@ -618,25 +611,22 @@ struct bas_bc_state { ...@@ -618,25 +611,22 @@ struct bas_bc_state {
struct urb *isoindone; /* completed isoc read URB */ struct urb *isoindone; /* completed isoc read URB */
int loststatus; /* status of dropped URB */ int loststatus; /* status of dropped URB */
unsigned isoinlost; /* number of bytes lost */ unsigned isoinlost; /* number of bytes lost */
/* state of bit unstuffing algorithm (in addition to /* state of bit unstuffing algorithm
BC_state.inputstate) */ (in addition to BC_state.inputstate) */
unsigned seqlen; /* number of '1' bits not yet unsigned seqlen; /* number of '1' bits not yet
unstuffed */ unstuffed */
unsigned inbyte, inbits; /* collected bits for next byte unsigned inbyte, inbits; /* collected bits for next byte */
*/
/* statistics */ /* statistics */
unsigned goodbytes; /* bytes correctly received */ unsigned goodbytes; /* bytes correctly received */
unsigned alignerrs; /* frames with incomplete byte unsigned alignerrs; /* frames with incomplete byte at end */
at end */
unsigned fcserrs; /* FCS errors */ unsigned fcserrs; /* FCS errors */
unsigned frameerrs; /* framing errors */ unsigned frameerrs; /* framing errors */
unsigned giants; /* long frames */ unsigned giants; /* long frames */
unsigned runts; /* short frames */ unsigned runts; /* short frames */
unsigned aborts; /* HDLC aborts */ unsigned aborts; /* HDLC aborts */
unsigned shared0s; /* '0' bits shared between flags unsigned shared0s; /* '0' bits shared between flags */
*/ unsigned stolen0s; /* '0' stuff bits also serving as
unsigned stolen0s; /* '0' stuff bits also serving leading flag bits */
as leading flag bits */
struct tasklet_struct rcvd_tasklet; struct tasklet_struct rcvd_tasklet;
}; };
...@@ -764,7 +754,7 @@ static inline void gigaset_isdn_rcv_err(struct bc_state *bcs) ...@@ -764,7 +754,7 @@ static inline void gigaset_isdn_rcv_err(struct bc_state *bcs)
isdn_ctrl response; isdn_ctrl response;
/* error -> LL */ /* error -> LL */
dbg(DEBUG_CMD, "sending L1ERR"); gig_dbg(DEBUG_CMD, "sending L1ERR");
response.driver = bcs->cs->myid; response.driver = bcs->cs->myid;
response.command = ISDN_STAT_L1ERR; response.command = ISDN_STAT_L1ERR;
response.arg = bcs->channel; response.arg = bcs->channel;
...@@ -872,7 +862,7 @@ static inline void gigaset_bchannel_down(struct bc_state *bcs) ...@@ -872,7 +862,7 @@ static inline void gigaset_bchannel_down(struct bc_state *bcs)
{ {
gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_CLOSED, NULL, 0, NULL); gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_CLOSED, NULL, 0, NULL);
dbg(DEBUG_CMD, "scheduling BC_CLOSED"); gig_dbg(DEBUG_CMD, "scheduling BC_CLOSED");
gigaset_schedule_event(bcs->cs); gigaset_schedule_event(bcs->cs);
} }
...@@ -882,7 +872,7 @@ static inline void gigaset_bchannel_up(struct bc_state *bcs) ...@@ -882,7 +872,7 @@ static inline void gigaset_bchannel_up(struct bc_state *bcs)
{ {
gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_OPEN, NULL, 0, NULL); gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_OPEN, NULL, 0, NULL);
dbg(DEBUG_CMD, "scheduling BC_OPEN"); gig_dbg(DEBUG_CMD, "scheduling BC_OPEN");
gigaset_schedule_event(bcs->cs); gigaset_schedule_event(bcs->cs);
} }
...@@ -947,7 +937,7 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf, ...@@ -947,7 +937,7 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf,
{ {
unsigned n, head, tail, bytesleft; unsigned n, head, tail, bytesleft;
dbg(DEBUG_INTR, "received %u bytes", numbytes); gig_dbg(DEBUG_INTR, "received %u bytes", numbytes);
if (!numbytes) if (!numbytes)
return 0; return 0;
...@@ -955,7 +945,7 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf, ...@@ -955,7 +945,7 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf,
bytesleft = numbytes; bytesleft = numbytes;
tail = atomic_read(&inbuf->tail); tail = atomic_read(&inbuf->tail);
head = atomic_read(&inbuf->head); head = atomic_read(&inbuf->head);
dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail); gig_dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail);
while (bytesleft) { while (bytesleft) {
if (head > tail) if (head > tail)
...@@ -965,7 +955,8 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf, ...@@ -965,7 +955,8 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf,
else else
n = RBUFSIZE - tail; n = RBUFSIZE - tail;
if (!n) { if (!n) {
err("buffer overflow (%u bytes lost)", bytesleft); dev_err(inbuf->cs->dev,
"buffer overflow (%u bytes lost)", bytesleft);
break; break;
} }
if (n > bytesleft) if (n > bytesleft)
...@@ -975,7 +966,7 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf, ...@@ -975,7 +966,7 @@ static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf,
tail = (tail + n) % RBUFSIZE; tail = (tail + n) % RBUFSIZE;
src += n; src += n;
} }
dbg(DEBUG_INTR, "setting tail to %u", tail); gig_dbg(DEBUG_INTR, "setting tail to %u", tail);
atomic_set(&inbuf->tail, tail); atomic_set(&inbuf->tail, tail);
return numbytes != bytesleft; return numbytes != bytesleft;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -83,12 +83,12 @@ static inline int isowbuf_startwrite(struct isowbuf_t *iwb) ...@@ -83,12 +83,12 @@ static inline int isowbuf_startwrite(struct isowbuf_t *iwb)
{ {
if (!atomic_dec_and_test(&iwb->writesem)) { if (!atomic_dec_and_test(&iwb->writesem)) {
atomic_inc(&iwb->writesem); atomic_inc(&iwb->writesem);
dbg(DEBUG_ISO, gig_dbg(DEBUG_ISO, "%s: couldn't acquire iso write semaphore",
"%s: couldn't acquire iso write semaphore", __func__); __func__);
return 0; return 0;
} }
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
dbg(DEBUG_ISO, gig_dbg(DEBUG_ISO,
"%s: acquired iso write semaphore, data[write]=%02x, nbits=%d", "%s: acquired iso write semaphore, data[write]=%02x, nbits=%d",
__func__, iwb->data[atomic_read(&iwb->write)], iwb->wbits); __func__, iwb->data[atomic_read(&iwb->write)], iwb->wbits);
#endif #endif
...@@ -143,7 +143,7 @@ static inline void isowbuf_putflag(struct isowbuf_t *iwb) ...@@ -143,7 +143,7 @@ static inline void isowbuf_putflag(struct isowbuf_t *iwb)
/* recover the idle flag byte */ /* recover the idle flag byte */
write = atomic_read(&iwb->write); write = atomic_read(&iwb->write);
iwb->idle = iwb->data[write]; iwb->idle = iwb->data[write];
dbg(DEBUG_ISO, "idle fill byte %02x", iwb->idle); gig_dbg(DEBUG_ISO, "idle fill byte %02x", iwb->idle);
/* mask extraneous bits in buffer */ /* mask extraneous bits in buffer */
iwb->data[write] &= (1 << iwb->wbits) - 1; iwb->data[write] &= (1 << iwb->wbits) - 1;
} }
...@@ -162,15 +162,14 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size) ...@@ -162,15 +162,14 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size)
read = atomic_read(&iwb->nextread); read = atomic_read(&iwb->nextread);
write = atomic_read(&iwb->write); write = atomic_read(&iwb->write);
if (likely(read == write)) { if (likely(read == write)) {
//dbg(DEBUG_STREAM, "%s: send buffer empty", __func__);
/* return idle frame */ /* return idle frame */
return read < BAS_OUTBUFPAD ? return read < BAS_OUTBUFPAD ?
BAS_OUTBUFSIZE : read - BAS_OUTBUFPAD; BAS_OUTBUFSIZE : read - BAS_OUTBUFPAD;
} }
limit = read + size; limit = read + size;
dbg(DEBUG_STREAM, gig_dbg(DEBUG_STREAM, "%s: read=%d write=%d limit=%d",
"%s: read=%d write=%d limit=%d", __func__, read, write, limit); __func__, read, write, limit);
#ifdef CONFIG_GIGASET_DEBUG #ifdef CONFIG_GIGASET_DEBUG
if (unlikely(size < 0 || size > BAS_OUTBUFPAD)) { if (unlikely(size < 0 || size > BAS_OUTBUFPAD)) {
err("invalid size %d", size); err("invalid size %d", size);
...@@ -195,7 +194,7 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size) ...@@ -195,7 +194,7 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size)
pbyte = iwb->data[write]; /* save pbyte = iwb->data[write]; /* save
partial byte */ partial byte */
limit = write + BAS_OUTBUFPAD; limit = write + BAS_OUTBUFPAD;
dbg(DEBUG_STREAM, gig_dbg(DEBUG_STREAM,
"%s: filling %d->%d with %02x", "%s: filling %d->%d with %02x",
__func__, write, limit, iwb->idle); __func__, write, limit, iwb->idle);
if (write + BAS_OUTBUFPAD < BAS_OUTBUFSIZE) if (write + BAS_OUTBUFPAD < BAS_OUTBUFSIZE)
...@@ -208,7 +207,8 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size) ...@@ -208,7 +207,8 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size)
- write); - write);
limit = 0; limit = 0;
} }
dbg(DEBUG_STREAM, "%s: restoring %02x at %d", gig_dbg(DEBUG_STREAM,
"%s: restoring %02x at %d",
__func__, pbyte, limit); __func__, pbyte, limit);
iwb->data[limit] = pbyte; /* restore iwb->data[limit] = pbyte; /* restore
partial byte */ partial byte */
...@@ -252,7 +252,7 @@ static inline void dump_bytes(enum debuglevel level, const char *tag, ...@@ -252,7 +252,7 @@ static inline void dump_bytes(enum debuglevel level, const char *tag,
while (count-- > 0) { while (count-- > 0) {
if (i > sizeof(dbgline) - 4) { if (i > sizeof(dbgline) - 4) {
dbgline[i] = '\0'; dbgline[i] = '\0';
dbg(level, "%s:%s", tag, dbgline); gig_dbg(level, "%s:%s", tag, dbgline);
i = 0; i = 0;
} }
c = *bytes++; c = *bytes++;
...@@ -262,7 +262,7 @@ static inline void dump_bytes(enum debuglevel level, const char *tag, ...@@ -262,7 +262,7 @@ static inline void dump_bytes(enum debuglevel level, const char *tag,
dbgline[i++] = hexdigit[c & 0x0f]; dbgline[i++] = hexdigit[c & 0x0f];
} }
dbgline[i] = '\0'; dbgline[i] = '\0';
dbg(level, "%s:%s", tag, dbgline); gig_dbg(level, "%s:%s", tag, dbgline);
#endif #endif
} }
...@@ -429,7 +429,7 @@ static inline int hdlc_buildframe(struct isowbuf_t *iwb, ...@@ -429,7 +429,7 @@ static inline int hdlc_buildframe(struct isowbuf_t *iwb,
if (isowbuf_freebytes(iwb) < count + count / 5 + 6 || if (isowbuf_freebytes(iwb) < count + count / 5 + 6 ||
!isowbuf_startwrite(iwb)) { !isowbuf_startwrite(iwb)) {
dbg(DEBUG_ISO, "%s: %d bytes free -> -EAGAIN", gig_dbg(DEBUG_ISO, "%s: %d bytes free -> -EAGAIN",
__func__, isowbuf_freebytes(iwb)); __func__, isowbuf_freebytes(iwb));
return -EAGAIN; return -EAGAIN;
} }
...@@ -482,11 +482,11 @@ static inline int trans_buildframe(struct isowbuf_t *iwb, ...@@ -482,11 +482,11 @@ static inline int trans_buildframe(struct isowbuf_t *iwb,
if (isowbuf_freebytes(iwb) < count || if (isowbuf_freebytes(iwb) < count ||
!isowbuf_startwrite(iwb)) { !isowbuf_startwrite(iwb)) {
dbg(DEBUG_ISO, "can't put %d bytes", count); gig_dbg(DEBUG_ISO, "can't put %d bytes", count);
return -EAGAIN; return -EAGAIN;
} }
dbg(DEBUG_STREAM, "put %d bytes", count); gig_dbg(DEBUG_STREAM, "put %d bytes", count);
write = atomic_read(&iwb->write); write = atomic_read(&iwb->write);
do { do {
c = gigaset_invtab[*in++]; c = gigaset_invtab[*in++];
...@@ -506,12 +506,12 @@ int gigaset_isoc_buildframe(struct bc_state *bcs, unsigned char *in, int len) ...@@ -506,12 +506,12 @@ int gigaset_isoc_buildframe(struct bc_state *bcs, unsigned char *in, int len)
switch (bcs->proto2) { switch (bcs->proto2) {
case ISDN_PROTO_L2_HDLC: case ISDN_PROTO_L2_HDLC:
result = hdlc_buildframe(bcs->hw.bas->isooutbuf, in, len); result = hdlc_buildframe(bcs->hw.bas->isooutbuf, in, len);
dbg(DEBUG_ISO, "%s: %d bytes HDLC -> %d", gig_dbg(DEBUG_ISO, "%s: %d bytes HDLC -> %d",
__func__, len, result); __func__, len, result);
break; break;
default: /* assume transparent */ default: /* assume transparent */
result = trans_buildframe(bcs->hw.bas->isooutbuf, in, len); result = trans_buildframe(bcs->hw.bas->isooutbuf, in, len);
dbg(DEBUG_ISO, "%s: %d bytes trans -> %d", gig_dbg(DEBUG_ISO, "%s: %d bytes trans -> %d",
__func__, len, result); __func__, len, result);
} }
return result; return result;
...@@ -528,7 +528,7 @@ static inline void hdlc_putbyte(unsigned char c, struct bc_state *bcs) ...@@ -528,7 +528,7 @@ static inline void hdlc_putbyte(unsigned char c, struct bc_state *bcs)
return; return;
} }
if (unlikely(bcs->skb->len == SBUFSIZE)) { if (unlikely(bcs->skb->len == SBUFSIZE)) {
warn("received oversized packet discarded"); dev_warn(bcs->cs->dev, "received oversized packet discarded\n");
bcs->hw.bas->giants++; bcs->hw.bas->giants++;
dev_kfree_skb_any(bcs->skb); dev_kfree_skb_any(bcs->skb);
bcs->skb = NULL; bcs->skb = NULL;
...@@ -549,7 +549,7 @@ static inline void hdlc_flush(struct bc_state *bcs) ...@@ -549,7 +549,7 @@ static inline void hdlc_flush(struct bc_state *bcs)
if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL) if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL)
skb_reserve(bcs->skb, HW_HDR_LEN); skb_reserve(bcs->skb, HW_HDR_LEN);
else else
err("could not allocate skb"); dev_err(bcs->cs->dev, "could not allocate skb\n");
} }
/* reset packet state */ /* reset packet state */
...@@ -571,21 +571,23 @@ static inline void hdlc_done(struct bc_state *bcs) ...@@ -571,21 +571,23 @@ static inline void hdlc_done(struct bc_state *bcs)
if ((procskb = bcs->skb) == NULL) { if ((procskb = bcs->skb) == NULL) {
/* previous error */ /* previous error */
dbg(DEBUG_ISO, "%s: skb=NULL", __func__); gig_dbg(DEBUG_ISO, "%s: skb=NULL", __func__);
gigaset_rcv_error(NULL, bcs->cs, bcs); gigaset_rcv_error(NULL, bcs->cs, bcs);
} else if (procskb->len < 2) { } else if (procskb->len < 2) {
notice("received short frame (%d octets)", procskb->len); dev_notice(bcs->cs->dev, "received short frame (%d octets)\n",
procskb->len);
bcs->hw.bas->runts++; bcs->hw.bas->runts++;
gigaset_rcv_error(procskb, bcs->cs, bcs); gigaset_rcv_error(procskb, bcs->cs, bcs);
} else if (bcs->fcs != PPP_GOODFCS) { } else if (bcs->fcs != PPP_GOODFCS) {
notice("frame check error (0x%04x)", bcs->fcs); dev_notice(bcs->cs->dev, "frame check error (0x%04x)\n",
bcs->fcs);
bcs->hw.bas->fcserrs++; bcs->hw.bas->fcserrs++;
gigaset_rcv_error(procskb, bcs->cs, bcs); gigaset_rcv_error(procskb, bcs->cs, bcs);
} else { } else {
procskb->len -= 2; /* subtract FCS */ procskb->len -= 2; /* subtract FCS */
procskb->tail -= 2; procskb->tail -= 2;
dbg(DEBUG_ISO, gig_dbg(DEBUG_ISO, "%s: good frame (%d octets)",
"%s: good frame (%d octets)", __func__, procskb->len); __func__, procskb->len);
dump_bytes(DEBUG_STREAM, dump_bytes(DEBUG_STREAM,
"rcv data", procskb->data, procskb->len); "rcv data", procskb->data, procskb->len);
bcs->hw.bas->goodbytes += procskb->len; bcs->hw.bas->goodbytes += procskb->len;
...@@ -595,7 +597,7 @@ static inline void hdlc_done(struct bc_state *bcs) ...@@ -595,7 +597,7 @@ static inline void hdlc_done(struct bc_state *bcs)
if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL) if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL)
skb_reserve(bcs->skb, HW_HDR_LEN); skb_reserve(bcs->skb, HW_HDR_LEN);
else else
err("could not allocate skb"); dev_err(bcs->cs->dev, "could not allocate skb\n");
bcs->fcs = PPP_INITFCS; bcs->fcs = PPP_INITFCS;
} }
...@@ -610,14 +612,14 @@ static inline void hdlc_frag(struct bc_state *bcs, unsigned inbits) ...@@ -610,14 +612,14 @@ static inline void hdlc_frag(struct bc_state *bcs, unsigned inbits)
return; return;
} }
notice("received partial byte (%d bits)", inbits); dev_notice(bcs->cs->dev, "received partial byte (%d bits)\n", inbits);
bcs->hw.bas->alignerrs++; bcs->hw.bas->alignerrs++;
gigaset_rcv_error(bcs->skb, bcs->cs, bcs); gigaset_rcv_error(bcs->skb, bcs->cs, bcs);
if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL) if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL)
skb_reserve(bcs->skb, HW_HDR_LEN); skb_reserve(bcs->skb, HW_HDR_LEN);
else else
err("could not allocate skb"); dev_err(bcs->cs->dev, "could not allocate skb\n");
bcs->fcs = PPP_INITFCS; bcs->fcs = PPP_INITFCS;
} }
...@@ -870,7 +872,7 @@ static inline void trans_receive(unsigned char *src, unsigned count, ...@@ -870,7 +872,7 @@ static inline void trans_receive(unsigned char *src, unsigned count,
if (unlikely((skb = bcs->skb) == NULL)) { if (unlikely((skb = bcs->skb) == NULL)) {
bcs->skb = skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN); bcs->skb = skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN);
if (!skb) { if (!skb) {
err("could not allocate skb"); dev_err(bcs->cs->dev, "could not allocate skb\n");
return; return;
} }
skb_reserve(skb, HW_HDR_LEN); skb_reserve(skb, HW_HDR_LEN);
...@@ -888,7 +890,8 @@ static inline void trans_receive(unsigned char *src, unsigned count, ...@@ -888,7 +890,8 @@ static inline void trans_receive(unsigned char *src, unsigned count,
gigaset_rcv_skb(skb, bcs->cs, bcs); gigaset_rcv_skb(skb, bcs->cs, bcs);
bcs->skb = skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN); bcs->skb = skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN);
if (!skb) { if (!skb) {
err("could not allocate skb"); dev_err(bcs->cs->dev,
"could not allocate skb\n");
return; return;
} }
skb_reserve(bcs->skb, HW_HDR_LEN); skb_reserve(bcs->skb, HW_HDR_LEN);
...@@ -921,7 +924,7 @@ static void cmd_loop(unsigned char *src, int numbytes, struct inbuf_t *inbuf) ...@@ -921,7 +924,7 @@ static void cmd_loop(unsigned char *src, int numbytes, struct inbuf_t *inbuf)
case '\r': case '\r':
case '\n': case '\n':
/* end of line */ /* end of line */
dbg(DEBUG_TRANSCMD, "%s: End of Command (%d Bytes)", gig_dbg(DEBUG_TRANSCMD, "%s: End of Command (%d Bytes)",
__func__, cbytes); __func__, cbytes);
cs->cbytes = cbytes; cs->cbytes = cbytes;
gigaset_handle_modem_response(cs); gigaset_handle_modem_response(cs);
...@@ -932,7 +935,7 @@ static void cmd_loop(unsigned char *src, int numbytes, struct inbuf_t *inbuf) ...@@ -932,7 +935,7 @@ static void cmd_loop(unsigned char *src, int numbytes, struct inbuf_t *inbuf)
if (cbytes < MAX_RESP_SIZE - 1) if (cbytes < MAX_RESP_SIZE - 1)
cbytes++; cbytes++;
else else
warn("response too large"); dev_warn(cs->dev, "response too large\n");
} }
} }
...@@ -951,12 +954,12 @@ void gigaset_isoc_input(struct inbuf_t *inbuf) ...@@ -951,12 +954,12 @@ void gigaset_isoc_input(struct inbuf_t *inbuf)
head = atomic_read(&inbuf->head); head = atomic_read(&inbuf->head);
while (head != (tail = atomic_read(&inbuf->tail))) { while (head != (tail = atomic_read(&inbuf->tail))) {
dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail); gig_dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail);
if (head > tail) if (head > tail)
tail = RBUFSIZE; tail = RBUFSIZE;
src = inbuf->data + head; src = inbuf->data + head;
numbytes = tail - head; numbytes = tail - head;
dbg(DEBUG_INTR, "processing %u bytes", numbytes); gig_dbg(DEBUG_INTR, "processing %u bytes", numbytes);
if (atomic_read(&cs->mstate) == MS_LOCKED) { if (atomic_read(&cs->mstate) == MS_LOCKED) {
gigaset_dbg_buffer(DEBUG_LOCKCMD, "received response", gigaset_dbg_buffer(DEBUG_LOCKCMD, "received response",
...@@ -971,7 +974,7 @@ void gigaset_isoc_input(struct inbuf_t *inbuf) ...@@ -971,7 +974,7 @@ void gigaset_isoc_input(struct inbuf_t *inbuf)
head += numbytes; head += numbytes;
if (head == RBUFSIZE) if (head == RBUFSIZE)
head = 0; head = 0;
dbg(DEBUG_INTR, "setting head to %u", head); gig_dbg(DEBUG_INTR, "setting head to %u", head);
atomic_set(&inbuf->head, head); atomic_set(&inbuf->head, head);
} }
} }
...@@ -999,8 +1002,8 @@ int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb) ...@@ -999,8 +1002,8 @@ int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb)
len = skb->len; len = skb->len;
skb_queue_tail(&bcs->squeue, skb); skb_queue_tail(&bcs->squeue, skb);
dbg(DEBUG_ISO, gig_dbg(DEBUG_ISO, "%s: skb queued, qlen=%d",
"%s: skb queued, qlen=%d", __func__, skb_queue_len(&bcs->squeue)); __func__, skb_queue_len(&bcs->squeue));
/* tasklet submits URB if necessary */ /* tasklet submits URB if necessary */
tasklet_schedule(&bcs->hw.bas->sent_tasklet); tasklet_schedule(&bcs->hw.bas->sent_tasklet);
......
...@@ -50,7 +50,7 @@ static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, ...@@ -50,7 +50,7 @@ static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr,
return -ENOMEM; return -ENOMEM;
} }
dbg(DEBUG_CMD, "scheduling PROC_CIDMODE"); gig_dbg(DEBUG_CMD, "scheduling PROC_CIDMODE");
gigaset_schedule_event(cs); gigaset_schedule_event(cs);
wait_event(cs->waitqueue, !cs->waiting); wait_event(cs->waitqueue, !cs->waiting);
...@@ -65,7 +65,7 @@ static DEVICE_ATTR(cidmode, S_IRUGO|S_IWUSR, show_cidmode, set_cidmode); ...@@ -65,7 +65,7 @@ static DEVICE_ATTR(cidmode, S_IRUGO|S_IWUSR, show_cidmode, set_cidmode);
/* free sysfs for device */ /* free sysfs for device */
void gigaset_free_dev_sysfs(struct usb_interface *interface) void gigaset_free_dev_sysfs(struct usb_interface *interface)
{ {
dbg(DEBUG_INIT, "removing sysfs entries"); gig_dbg(DEBUG_INIT, "removing sysfs entries");
device_remove_file(&interface->dev, &dev_attr_cidmode); device_remove_file(&interface->dev, &dev_attr_cidmode);
} }
EXPORT_SYMBOL_GPL(gigaset_free_dev_sysfs); EXPORT_SYMBOL_GPL(gigaset_free_dev_sysfs);
...@@ -73,7 +73,7 @@ EXPORT_SYMBOL_GPL(gigaset_free_dev_sysfs); ...@@ -73,7 +73,7 @@ EXPORT_SYMBOL_GPL(gigaset_free_dev_sysfs);
/* initialize sysfs for device */ /* initialize sysfs for device */
void gigaset_init_dev_sysfs(struct usb_interface *interface) void gigaset_init_dev_sysfs(struct usb_interface *interface)
{ {
dbg(DEBUG_INIT, "setting up sysfs"); gig_dbg(DEBUG_INIT, "setting up sysfs");
device_create_file(&interface->dev, &dev_attr_cidmode); device_create_file(&interface->dev, &dev_attr_cidmode);
} }
EXPORT_SYMBOL_GPL(gigaset_init_dev_sysfs); EXPORT_SYMBOL_GPL(gigaset_init_dev_sysfs);
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment