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
......@@ -41,7 +41,7 @@ static inline int muststuff(unsigned char c)
* number of processed bytes
*/
static inline int cmd_loop(unsigned char c, unsigned char *src, int numbytes,
struct inbuf_t *inbuf)
struct inbuf_t *inbuf)
{
struct cardstate *cs = inbuf->cs;
unsigned cbytes = cs->cbytes;
......@@ -51,8 +51,8 @@ static inline int cmd_loop(unsigned char c, unsigned char *src, int numbytes,
for (;;) {
cs->respdata[cbytes] = c;
if (c == 10 || c == 13) {
dbg(DEBUG_TRANSCMD, "%s: End of Command (%d Bytes)",
__func__, cbytes);
gig_dbg(DEBUG_TRANSCMD, "%s: End of Command (%d Bytes)",
__func__, cbytes);
cs->cbytes = cbytes;
gigaset_handle_modem_response(cs); /* can change
cs->dle */
......@@ -68,7 +68,7 @@ static inline int cmd_loop(unsigned char c, unsigned char *src, int numbytes,
if (cbytes < MAX_RESP_SIZE - 1)
cbytes++;
else
warn("response too large");
dev_warn(cs->dev, "response too large\n");
}
if (!numbytes)
......@@ -93,7 +93,7 @@ static inline int cmd_loop(unsigned char c, unsigned char *src, int numbytes,
* number of processed bytes
*/
static inline int lock_loop(unsigned char *src, int numbytes,
struct inbuf_t *inbuf)
struct inbuf_t *inbuf)
{
struct cardstate *cs = inbuf->cs;
......@@ -113,7 +113,7 @@ static inline int lock_loop(unsigned char *src, int numbytes,
* numbytes (all bytes processed) on error --FIXME
*/
static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
struct inbuf_t *inbuf)
struct inbuf_t *inbuf)
{
struct cardstate *cs = inbuf->cs;
struct bc_state *bcs = inbuf->bcs;
......@@ -154,39 +154,37 @@ byte_stuff:
c ^= PPP_TRANS;
#ifdef CONFIG_GIGASET_DEBUG
if (unlikely(!muststuff(c)))
dbg(DEBUG_HDLC,
"byte stuffed: 0x%02x", c);
gig_dbg(DEBUG_HDLC, "byte stuffed: 0x%02x", c);
#endif
} else if (unlikely(c == PPP_FLAG)) {
if (unlikely(inputstate & INS_skip_frame)) {
if (!(inputstate & INS_have_data)) { /* 7E 7E */
//dbg(DEBUG_HDLC, "(7e)7e------------------------");
#ifdef CONFIG_GIGASET_DEBUG
++bcs->emptycount;
#endif
} else
dbg(DEBUG_HDLC,
gig_dbg(DEBUG_HDLC,
"7e----------------------------");
/* end of frame */
error = 1;
gigaset_rcv_error(NULL, cs, bcs);
} else if (!(inputstate & INS_have_data)) { /* 7E 7E */
//dbg(DEBUG_HDLC, "(7e)7e------------------------");
#ifdef CONFIG_GIGASET_DEBUG
++bcs->emptycount;
#endif
break;
} else {
dbg(DEBUG_HDLC,
"7e----------------------------");
gig_dbg(DEBUG_HDLC,
"7e----------------------------");
/* end of frame */
error = 0;
if (unlikely(fcs != PPP_GOODFCS)) {
err("Packet checksum at %lu failed, "
"packet is corrupted (%u bytes)!",
dev_err(cs->dev,
"Packet checksum at %lu failed, "
"packet is corrupted (%u bytes)!\n",
bcs->rcvbytes, skb->len);
compskb = NULL;
gigaset_rcv_error(compskb, cs, bcs);
......@@ -200,9 +198,11 @@ byte_stuff:
skb = NULL;
inputstate |= INS_skip_frame;
if (l == 1) {
err("invalid packet size (1)!");
dev_err(cs->dev,
"invalid packet size (1)!\n");
error = 1;
gigaset_rcv_error(NULL, cs, bcs);
gigaset_rcv_error(NULL,
cs, bcs);
}
}
if (likely(!(error ||
......@@ -225,7 +225,8 @@ byte_stuff:
} else if (likely((skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL)) {
skb_reserve(skb, HW_HDR_LEN);
} else {
warn("could not allocate new skb");
dev_warn(cs->dev,
"could not allocate new skb\n");
inputstate |= INS_skip_frame;
}
......@@ -233,7 +234,7 @@ byte_stuff:
#ifdef CONFIG_GIGASET_DEBUG
} else if (unlikely(muststuff(c))) {
/* 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
}
......@@ -241,8 +242,8 @@ byte_stuff:
#ifdef CONFIG_GIGASET_DEBUG
if (unlikely(!(inputstate & INS_have_data))) {
dbg(DEBUG_HDLC,
"7e (%d x) ================", bcs->emptycount);
gig_dbg(DEBUG_HDLC, "7e (%d x) ================",
bcs->emptycount);
bcs->emptycount = 0;
}
#endif
......@@ -251,7 +252,7 @@ byte_stuff:
if (likely(!(inputstate & INS_skip_frame))) {
if (unlikely(skb->len == SBUFSIZE)) {
warn("received packet too long");
dev_warn(cs->dev, "received packet too long\n");
dev_kfree_skb_any(skb);
skb = NULL;
inputstate |= INS_skip_frame;
......@@ -287,7 +288,7 @@ byte_stuff:
* numbytes (all bytes processed) on error --FIXME
*/
static inline int iraw_loop(unsigned char c, unsigned char *src, int numbytes,
struct inbuf_t *inbuf)
struct inbuf_t *inbuf)
{
struct cardstate *cs = inbuf->cs;
struct bc_state *bcs = inbuf->bcs;
......@@ -307,7 +308,7 @@ static inline int iraw_loop(unsigned char c, unsigned char *src, int numbytes,
if (likely(!(inputstate & INS_skip_frame))) {
if (unlikely(skb->len == SBUFSIZE)) {
//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);
skb = NULL;
inputstate |= INS_skip_frame;
......@@ -341,7 +342,7 @@ static inline int iraw_loop(unsigned char c, unsigned char *src, int numbytes,
!= NULL)) {
skb_reserve(skb, HW_HDR_LEN);
} else {
warn("could not allocate new skb");
dev_warn(cs->dev, "could not allocate new skb\n");
inputstate |= INS_skip_frame;
}
}
......@@ -362,13 +363,13 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
head = atomic_read(&inbuf->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) {
cs = inbuf->cs;
src = inbuf->data + head;
numbytes = (head > tail ? RBUFSIZE : tail) - head;
dbg(DEBUG_INTR, "processing %u bytes", numbytes);
gig_dbg(DEBUG_INTR, "processing %u bytes", numbytes);
while (numbytes) {
if (atomic_read(&cs->mstate) == MS_LOCKED) {
......@@ -400,13 +401,14 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
src += procbytes;
numbytes -= procbytes;
} else { /* DLE-char */
} else { /* DLE char */
inbuf->inputstate &= ~INS_DLE_char;
switch (c) {
case 'X': /*begin of command*/
#ifdef CONFIG_GIGASET_DEBUG
if (inbuf->inputstate & INS_command)
err("received <DLE> 'X' in command mode");
dev_err(cs->dev,
"received <DLE> 'X' in command mode\n");
#endif
inbuf->inputstate |=
INS_command | INS_DLE_command;
......@@ -414,7 +416,8 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
case '.': /*end of command*/
#ifdef CONFIG_GIGASET_DEBUG
if (!(inbuf->inputstate & INS_command))
err("received <DLE> '.' in hdlc mode");
dev_err(cs->dev,
"received <DLE> '.' in hdlc mode\n");
#endif
inbuf->inputstate &= cs->dle ?
~(INS_DLE_command|INS_command)
......@@ -422,7 +425,9 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
break;
//case DLE_FLAG: /*DLE_FLAG in data stream*/ /* schon oben behandelt! */
default:
err("received 0x10 0x%02x!", (int) c);
dev_err(cs->dev,
"received 0x10 0x%02x!\n",
(int) c);
/* FIXME: reset driver?? */
}
}
......@@ -441,7 +446,7 @@ nextbyte:
}
}
dbg(DEBUG_INTR, "setting head to %u", head);
gig_dbg(DEBUG_INTR, "setting head to %u", head);
atomic_set(&inbuf->head, head);
}
}
......@@ -476,14 +481,13 @@ static struct sk_buff *HDLC_Encode(struct sk_buff *skb, int head, int tail)
stuf_cnt++;
fcs = crc_ccitt_byte(fcs, *cp++);
}
fcs ^= 0xffff; /* complement */
fcs ^= 0xffff; /* complement */
/* size of new buffer: original size + number of stuffing bytes
* + 2 bytes FCS + 2 stuffing bytes for FCS (if needed) + 2 flag bytes
*/
hdlc_skb = dev_alloc_skb(skb->len + stuf_cnt + 6 + tail + head);
if (!hdlc_skb) {
err("unable to allocate memory for HDLC encoding!");
dev_kfree_skb(skb);
return NULL;
}
......@@ -505,7 +509,7 @@ static struct sk_buff *HDLC_Encode(struct sk_buff *skb, int head, int tail)
}
/* Finally add FCS (byte stuffed) and flag sequence */
c = (fcs & 0x00ff); /* least significant byte first */
c = (fcs & 0x00ff); /* least significant byte first */
if (muststuff(c)) {
*(skb_put(hdlc_skb, 1)) = PPP_ESCAPE;
c ^= PPP_TRANS;
......@@ -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 */
iraw_skb = dev_alloc_skb(2*skb->len + tail + head);
if (!iraw_skb) {
err("unable to allocate memory for HDLC encoding!");
dev_kfree_skb(skb);
return NULL;
}
......@@ -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);
else
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;
}
skb_queue_tail(&bcs->squeue, skb);
tasklet_schedule(&bcs->cs->write_tasklet);
......
This diff is collapsed.
......@@ -32,17 +32,14 @@ MODULE_PARM_DESC(debug, "debug level");
Prototypes of internal functions
*/
//static void gigaset_process_response(int resp_code, int parameter,
// struct at_state_t *at_state,
// unsigned char ** pstring);
static struct cardstate *alloc_cs(struct gigaset_driver *drv);
static void free_cs(struct cardstate *cs);
static void make_valid(struct cardstate *cs, unsigned mask);
static void make_invalid(struct cardstate *cs, unsigned mask);
#define VALID_MINOR 0x01
#define VALID_ID 0x02
#define ASSIGNED 0x04
#define VALID_MINOR 0x01
#define VALID_ID 0x02
#define ASSIGNED 0x04
/* bitwise byte inversion table */
__u8 gigaset_invtab[256] = {
......@@ -82,10 +79,11 @@ __u8 gigaset_invtab[256] = {
EXPORT_SYMBOL_GPL(gigaset_invtab);
void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
size_t len, const unsigned char *buf, int from_user)
size_t len, const unsigned char *buf, int from_user)
{
unsigned char outbuf[80];
unsigned char inbuf[80 - 1];
unsigned char c;
size_t numin;
const unsigned char *in;
size_t space = sizeof outbuf - 1;
......@@ -99,26 +97,38 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
in = inbuf;
if (copy_from_user(inbuf, (const unsigned char __user *) buf,
numin)) {
strncpy(inbuf, "<FAULT>", sizeof inbuf);
numin = sizeof "<FAULT>" - 1;
gig_dbg(level, "%s (%u bytes) - copy_from_user failed",
msg, (unsigned) len);
return;
}
}
for (; numin && space; --numin, ++in) {
--space;
if (*in >= 32)
*out++ = *in;
else {
while (numin-- > 0) {
c = *buf++;
if (c == '~' || c == '^' || c == '\\') {
if (space-- <= 0)
break;
*out++ = '\\';
}
if (c & 0x80) {
if (space-- <= 0)
break;
*out++ = '~';
c ^= 0x80;
}
if (c < 0x20 || c == 0x7f) {
if (space-- <= 0)
break;
*out++ = '^';
if (space) {
*out++ = '@' + *in;
--space;
}
c ^= 0x40;
}
if (space-- <= 0)
break;
*out++ = c;
}
*out = 0;
dbg(level, "%s (%u bytes): %s", msg, (unsigned) len, outbuf);
gig_dbg(level, "%s (%u bytes): %s", msg, (unsigned) len, outbuf);
}
EXPORT_SYMBOL_GPL(gigaset_dbg_buffer);
......@@ -171,7 +181,7 @@ int gigaset_enterconfigmode(struct cardstate *cs)
return 0;
error:
err("error %d on setuartbits!\n", -r);
dev_err(cs->dev, "error %d on setuartbits\n", -r);
cs->control_state = TIOCM_RTS|TIOCM_DTR; // FIXME is this a good value?
cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS|TIOCM_DTR);
......@@ -184,13 +194,13 @@ static int test_timeout(struct at_state_t *at_state)
return 0;
if (--at_state->timer_expires) {
dbg(DEBUG_MCMD, "decreased timer of %p to %lu",
at_state, at_state->timer_expires);
gig_dbg(DEBUG_MCMD, "decreased timer of %p to %lu",
at_state, at_state->timer_expires);
return 0;
}
if (!gigaset_add_event(at_state->cs, at_state, EV_TIMEOUT, NULL,
atomic_read(&at_state->timer_index), NULL)) {
atomic_read(&at_state->timer_index), NULL)) {
//FIXME what should we do?
}
......@@ -221,7 +231,7 @@ static void timer_tick(unsigned long data)
if (atomic_read(&cs->running)) {
mod_timer(&cs->timer, jiffies + msecs_to_jiffies(GIG_TICK));
if (timeout) {
dbg(DEBUG_CMD, "scheduling timeout");
gig_dbg(DEBUG_CMD, "scheduling timeout");
tasklet_schedule(&cs->event_tasklet);
}
}
......@@ -235,13 +245,14 @@ int gigaset_get_channel(struct bc_state *bcs)
spin_lock_irqsave(&bcs->cs->lock, flags);
if (bcs->use_count) {
dbg(DEBUG_ANY, "could not allocate channel %d", bcs->channel);
gig_dbg(DEBUG_ANY, "could not allocate channel %d",
bcs->channel);
spin_unlock_irqrestore(&bcs->cs->lock, flags);
return 0;
}
++bcs->use_count;
bcs->busy = 1;
dbg(DEBUG_ANY, "allocated channel %d", bcs->channel);
gig_dbg(DEBUG_ANY, "allocated channel %d", bcs->channel);
spin_unlock_irqrestore(&bcs->cs->lock, flags);
return 1;
}
......@@ -252,13 +263,13 @@ void gigaset_free_channel(struct bc_state *bcs)
spin_lock_irqsave(&bcs->cs->lock, flags);
if (!bcs->busy) {
dbg(DEBUG_ANY, "could not free channel %d", bcs->channel);
gig_dbg(DEBUG_ANY, "could not free channel %d", bcs->channel);
spin_unlock_irqrestore(&bcs->cs->lock, flags);
return;
}
--bcs->use_count;
bcs->busy = 0;
dbg(DEBUG_ANY, "freed channel %d", bcs->channel);
gig_dbg(DEBUG_ANY, "freed channel %d", bcs->channel);
spin_unlock_irqrestore(&bcs->cs->lock, flags);
}
......@@ -271,14 +282,14 @@ int gigaset_get_channels(struct cardstate *cs)
for (i = 0; i < cs->channels; ++i)
if (cs->bcs[i].use_count) {
spin_unlock_irqrestore(&cs->lock, flags);
dbg(DEBUG_ANY, "could not allocated all channels");
gig_dbg(DEBUG_ANY, "could not allocate all channels");
return 0;
}
for (i = 0; i < cs->channels; ++i)
++cs->bcs[i].use_count;
spin_unlock_irqrestore(&cs->lock, flags);
dbg(DEBUG_ANY, "allocated all channels");
gig_dbg(DEBUG_ANY, "allocated all channels");
return 1;
}
......@@ -288,7 +299,7 @@ void gigaset_free_channels(struct cardstate *cs)
unsigned long flags;
int i;
dbg(DEBUG_ANY, "unblocking all channels");
gig_dbg(DEBUG_ANY, "unblocking all channels");
spin_lock_irqsave(&cs->lock, flags);
for (i = 0; i < cs->channels; ++i)
--cs->bcs[i].use_count;
......@@ -300,7 +311,7 @@ void gigaset_block_channels(struct cardstate *cs)
unsigned long flags;
int i;
dbg(DEBUG_ANY, "blocking all channels");
gig_dbg(DEBUG_ANY, "blocking all channels");
spin_lock_irqsave(&cs->lock, flags);
for (i = 0; i < cs->channels; ++i)
++cs->bcs[i].use_count;
......@@ -328,8 +339,8 @@ static void clear_events(struct cardstate *cs)
}
struct event_t *gigaset_add_event(struct cardstate *cs,
struct at_state_t *at_state, int type,
void *ptr, int parameter, void *arg)
struct at_state_t *at_state, int type,
void *ptr, int parameter, void *arg)
{
unsigned long flags;
unsigned next, tail;
......@@ -388,14 +399,14 @@ static void gigaset_freebcs(struct bc_state *bcs)
{
int i;
dbg(DEBUG_INIT, "freeing bcs[%d]->hw", bcs->channel);
gig_dbg(DEBUG_INIT, "freeing bcs[%d]->hw", bcs->channel);
if (!bcs->cs->ops->freebcshw(bcs)) {
dbg(DEBUG_INIT, "failed");
gig_dbg(DEBUG_INIT, "failed");
}
dbg(DEBUG_INIT, "clearing bcs[%d]->at_state", bcs->channel);
gig_dbg(DEBUG_INIT, "clearing bcs[%d]->at_state", bcs->channel);
clear_at_state(&bcs->at_state);
dbg(DEBUG_INIT, "freeing bcs[%d]->skb", bcs->channel);
gig_dbg(DEBUG_INIT, "freeing bcs[%d]->skb", bcs->channel);
if (bcs->skb)
dev_kfree_skb(bcs->skb);
......@@ -432,7 +443,7 @@ void gigaset_freecs(struct cardstate *cs)
default:
gigaset_if_free(cs);
dbg(DEBUG_INIT, "clearing hw");
gig_dbg(DEBUG_INIT, "clearing hw");
cs->ops->freecshw(cs);
//FIXME cmdbuf
......@@ -441,36 +452,36 @@ void gigaset_freecs(struct cardstate *cs)
case 2: /* error in initcshw */
/* Deregister from LL */
make_invalid(cs, VALID_ID);
dbg(DEBUG_INIT, "clearing iif");
gig_dbg(DEBUG_INIT, "clearing iif");
gigaset_i4l_cmd(cs, ISDN_STAT_UNLOAD);
/* fall through */
case 1: /* error when regestering to LL */
dbg(DEBUG_INIT, "clearing at_state");
gig_dbg(DEBUG_INIT, "clearing at_state");
clear_at_state(&cs->at_state);
dealloc_at_states(cs);
/* fall through */
case 0: /* error in one call to initbcs */
for (i = 0; i < cs->channels; ++i) {
dbg(DEBUG_INIT, "clearing bcs[%d]", i);
gig_dbg(DEBUG_INIT, "clearing bcs[%d]", i);
gigaset_freebcs(cs->bcs + i);
}
clear_events(cs);
dbg(DEBUG_INIT, "freeing inbuf");
gig_dbg(DEBUG_INIT, "freeing inbuf");
kfree(cs->inbuf);
}
f_bcs: dbg(DEBUG_INIT, "freeing bcs[]");
f_bcs: gig_dbg(DEBUG_INIT, "freeing bcs[]");
kfree(cs->bcs);
f_cs: dbg(DEBUG_INIT, "freeing cs");
f_cs: gig_dbg(DEBUG_INIT, "freeing cs");
up(&cs->sem);
free_cs(cs);
}
EXPORT_SYMBOL_GPL(gigaset_freecs);
void gigaset_at_init(struct at_state_t *at_state, struct bc_state *bcs,
struct cardstate *cs, int cid)
struct cardstate *cs, int cid)
{
int i;
......@@ -499,7 +510,7 @@ void gigaset_at_init(struct at_state_t *at_state, struct bc_state *bcs,
static void gigaset_inbuf_init(struct inbuf_t *inbuf, struct bc_state *bcs,
struct cardstate *cs, int inputstate)
struct cardstate *cs, int inputstate)
/* inbuf->read must be allocated before! */
{
atomic_set(&inbuf->head, 0);
......@@ -512,7 +523,7 @@ static void gigaset_inbuf_init(struct inbuf_t *inbuf, struct bc_state *bcs,
/* Initialize the b-channel structure */
static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
struct cardstate *cs, int channel)
struct cardstate *cs, int channel)
{
int i;
......@@ -524,7 +535,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
bcs->trans_down = 0;
bcs->trans_up = 0;
dbg(DEBUG_INIT, "setting up bcs[%d]->at_state", channel);
gig_dbg(DEBUG_INIT, "setting up bcs[%d]->at_state", channel);
gigaset_at_init(&bcs->at_state, bcs, cs, -1);
bcs->rcvbytes = 0;
......@@ -533,7 +544,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
bcs->emptycount = 0;
#endif
dbg(DEBUG_INIT, "allocating bcs[%d]->skb", channel);
gig_dbg(DEBUG_INIT, "allocating bcs[%d]->skb", channel);
bcs->fcs = PPP_INITFCS;
bcs->inputstate = 0;
if (cs->ignoreframes) {
......@@ -542,7 +553,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
} else if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL)
skb_reserve(bcs->skb, HW_HDR_LEN);
else {
warn("could not allocate skb");
dev_warn(cs->dev, "could not allocate skb\n");
bcs->inputstate |= INS_skip_frame;
}
......@@ -557,13 +568,13 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
for (i = 0; i < AT_NUM; ++i)
bcs->commands[i] = NULL;
dbg(DEBUG_INIT, " setting up bcs[%d]->hw", channel);
gig_dbg(DEBUG_INIT, " setting up bcs[%d]->hw", channel);
if (cs->ops->initbcshw(bcs))
return bcs;
dbg(DEBUG_INIT, " failed");
gig_dbg(DEBUG_INIT, " failed");
dbg(DEBUG_INIT, " freeing bcs[%d]->skb", channel);
gig_dbg(DEBUG_INIT, " freeing bcs[%d]->skb", channel);
if (bcs->skb)
dev_kfree_skb(bcs->skb);
......@@ -575,7 +586,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
* Calls hardware dependent gigaset_initcshw() function
* Calls B channel initialization function gigaset_initbcs() for each B channel
* parameters:
* drv hardware driver the device belongs to
* drv hardware driver the device belongs to
* channels number of B channels supported by device
* onechannel !=0: B channel data and AT commands share one
* communication channel
......@@ -593,15 +604,15 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
struct cardstate *cs = NULL;
int i;
dbg(DEBUG_INIT, "allocating cs");
gig_dbg(DEBUG_INIT, "allocating cs");
cs = alloc_cs(drv);
if (!cs)
goto error;
dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1);
gig_dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1);
cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL);
if (!cs->bcs)
goto error;
dbg(DEBUG_INIT, "allocating inbuf");
gig_dbg(DEBUG_INIT, "allocating inbuf");