Skip to content

Commit 7d33989

Browse files
committed
Merge branch 'isdn-next'
Tilman Schmidt says: ==================== ISDN patches for net-next Here's a series of patches for the Gigaset ISDN driver and one for the ISDN CAPI subsystem. Please merge as appropriate. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 340b6e5 + 330078a commit 7d33989

File tree

4 files changed

+38
-46
lines changed

4 files changed

+38
-46
lines changed

drivers/isdn/capi/capiutil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static unsigned char *cpars[] =
201201
#define structTRcpyovl(x, y, l) memmove(y, x, l)
202202

203203
/*-------------------------------------------------------*/
204-
static unsigned command_2_index(unsigned c, unsigned sc)
204+
static unsigned command_2_index(u8 c, u8 sc)
205205
{
206206
if (c & 0x80)
207207
c = 0x9 + (c & 0x0f);

drivers/isdn/gigaset/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if ISDN_DRV_GIGASET
2020
config GIGASET_CAPI
2121
bool "Gigaset CAPI support"
2222
depends on ISDN_CAPI='y'||(ISDN_CAPI='m'&&ISDN_DRV_GIGASET='m')
23-
default ISDN_I4L='n'
23+
default 'y'
2424
help
2525
Build the Gigaset driver as a CAPI 2.0 driver interfacing with
2626
the Kernel CAPI subsystem. To use it with the old ISDN4Linux

drivers/isdn/gigaset/gigaset.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,6 @@ void gigaset_stop(struct cardstate *cs);
751751
/* Tell common.c that the driver is being unloaded. */
752752
int gigaset_shutdown(struct cardstate *cs);
753753

754-
/* Tell common.c that an skb has been sent. */
755-
void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb);
756-
757754
/* Append event to the queue.
758755
* Returns NULL on failure or a pointer to the event on success.
759756
* ptr must be kmalloc()ed (and not be freed by the caller).

drivers/isdn/gigaset/usb-gigaset.c

Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static int gigaset_close_bchannel(struct bc_state *bcs)
293293
}
294294

295295
static int write_modem(struct cardstate *cs);
296-
static int send_cb(struct cardstate *cs, struct cmdbuf_t *cb);
296+
static int send_cb(struct cardstate *cs);
297297

298298

299299
/* Write tasklet handler: Continue sending current skb, or send command, or
@@ -303,8 +303,6 @@ static void gigaset_modem_fill(unsigned long data)
303303
{
304304
struct cardstate *cs = (struct cardstate *) data;
305305
struct bc_state *bcs = &cs->bcs[0]; /* only one channel */
306-
struct cmdbuf_t *cb;
307-
int again;
308306

309307
gig_dbg(DEBUG_OUTPUT, "modem_fill");
310308

@@ -313,36 +311,32 @@ static void gigaset_modem_fill(unsigned long data)
313311
return;
314312
}
315313

316-
do {
317-
again = 0;
318-
if (!bcs->tx_skb) { /* no skb is being sent */
319-
cb = cs->cmdbuf;
320-
if (cb) { /* commands to send? */
321-
gig_dbg(DEBUG_OUTPUT, "modem_fill: cb");
322-
if (send_cb(cs, cb) < 0) {
323-
gig_dbg(DEBUG_OUTPUT,
324-
"modem_fill: send_cb failed");
325-
again = 1; /* no callback will be
326-
called! */
327-
}
328-
} else { /* skbs to send? */
329-
bcs->tx_skb = skb_dequeue(&bcs->squeue);
330-
if (bcs->tx_skb)
331-
gig_dbg(DEBUG_INTR,
332-
"Dequeued skb (Adr: %lx)!",
333-
(unsigned long) bcs->tx_skb);
334-
}
335-
}
336-
337-
if (bcs->tx_skb) {
338-
gig_dbg(DEBUG_OUTPUT, "modem_fill: tx_skb");
339-
if (write_modem(cs) < 0) {
314+
again:
315+
if (!bcs->tx_skb) { /* no skb is being sent */
316+
if (cs->cmdbuf) { /* commands to send? */
317+
gig_dbg(DEBUG_OUTPUT, "modem_fill: cb");
318+
if (send_cb(cs) < 0) {
340319
gig_dbg(DEBUG_OUTPUT,
341-
"modem_fill: write_modem failed");
342-
again = 1; /* no callback will be called! */
320+
"modem_fill: send_cb failed");
321+
goto again; /* no callback will be called! */
343322
}
323+
return;
344324
}
345-
} while (again);
325+
326+
/* skbs to send? */
327+
bcs->tx_skb = skb_dequeue(&bcs->squeue);
328+
if (!bcs->tx_skb)
329+
return;
330+
331+
gig_dbg(DEBUG_INTR, "Dequeued skb (Adr: %lx)!",
332+
(unsigned long) bcs->tx_skb);
333+
}
334+
335+
gig_dbg(DEBUG_OUTPUT, "modem_fill: tx_skb");
336+
if (write_modem(cs) < 0) {
337+
gig_dbg(DEBUG_OUTPUT, "modem_fill: write_modem failed");
338+
goto again; /* no callback will be called! */
339+
}
346340
}
347341

348342
/*
@@ -429,36 +423,37 @@ static void gigaset_write_bulk_callback(struct urb *urb)
429423
spin_unlock_irqrestore(&cs->lock, flags);
430424
}
431425

432-
static int send_cb(struct cardstate *cs, struct cmdbuf_t *cb)
426+
static int send_cb(struct cardstate *cs)
433427
{
434-
struct cmdbuf_t *tcb;
428+
struct cmdbuf_t *cb = cs->cmdbuf;
435429
unsigned long flags;
436430
int count;
437431
int status = -ENOENT;
438432
struct usb_cardstate *ucs = cs->hw.usb;
439433

440434
do {
441435
if (!cb->len) {
442-
tcb = cb;
443-
444436
spin_lock_irqsave(&cs->cmdlock, flags);
445437
cs->cmdbytes -= cs->curlen;
446438
gig_dbg(DEBUG_OUTPUT, "send_cb: sent %u bytes, %u left",
447439
cs->curlen, cs->cmdbytes);
448-
cs->cmdbuf = cb = cb->next;
449-
if (cb) {
450-
cb->prev = NULL;
451-
cs->curlen = cb->len;
440+
cs->cmdbuf = cb->next;
441+
if (cs->cmdbuf) {
442+
cs->cmdbuf->prev = NULL;
443+
cs->curlen = cs->cmdbuf->len;
452444
} else {
453445
cs->lastcmdbuf = NULL;
454446
cs->curlen = 0;
455447
}
456448
spin_unlock_irqrestore(&cs->cmdlock, flags);
457449

458-
if (tcb->wake_tasklet)
459-
tasklet_schedule(tcb->wake_tasklet);
460-
kfree(tcb);
450+
if (cb->wake_tasklet)
451+
tasklet_schedule(cb->wake_tasklet);
452+
kfree(cb);
453+
454+
cb = cs->cmdbuf;
461455
}
456+
462457
if (cb) {
463458
count = min(cb->len, ucs->bulk_out_size);
464459
gig_dbg(DEBUG_OUTPUT, "send_cb: send %d bytes", count);

0 commit comments

Comments
 (0)