Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d339890 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 340b6e59 330078ab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ static unsigned char *cpars[] =
#define structTRcpyovl(x, y, l) memmove(y, x, l)

/*-------------------------------------------------------*/
static unsigned command_2_index(unsigned c, unsigned sc)
static unsigned command_2_index(u8 c, u8 sc)
{
	if (c & 0x80)
		c = 0x9 + (c & 0x0f);
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ if ISDN_DRV_GIGASET
config GIGASET_CAPI
	bool "Gigaset CAPI support"
	depends on ISDN_CAPI='y'||(ISDN_CAPI='m'&&ISDN_DRV_GIGASET='m')
	default ISDN_I4L='n'
	default 'y'
	help
	  Build the Gigaset driver as a CAPI 2.0 driver interfacing with
	  the Kernel CAPI subsystem. To use it with the old ISDN4Linux
+0 −3
Original line number Diff line number Diff line
@@ -751,9 +751,6 @@ void gigaset_stop(struct cardstate *cs);
/* Tell common.c that the driver is being unloaded. */
int gigaset_shutdown(struct cardstate *cs);

/* Tell common.c that an skb has been sent. */
void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb);

/* Append event to the queue.
 * Returns NULL on failure or a pointer to the event on success.
 * ptr must be kmalloc()ed (and not be freed by the caller).
+36 −41
Original line number Diff line number Diff line
@@ -293,7 +293,7 @@ static int gigaset_close_bchannel(struct bc_state *bcs)
}

static int write_modem(struct cardstate *cs);
static int send_cb(struct cardstate *cs, struct cmdbuf_t *cb);
static int send_cb(struct cardstate *cs);


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

	gig_dbg(DEBUG_OUTPUT, "modem_fill");

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

	do {
		again = 0;
again:
	if (!bcs->tx_skb) {	/* no skb is being sent */
			cb = cs->cmdbuf;
			if (cb) { /* commands to send? */
		if (cs->cmdbuf) {	/* commands to send? */
			gig_dbg(DEBUG_OUTPUT, "modem_fill: cb");
				if (send_cb(cs, cb) < 0) {
			if (send_cb(cs) < 0) {
				gig_dbg(DEBUG_OUTPUT,
					"modem_fill: send_cb failed");
					again = 1; /* no callback will be
						      called! */
				goto again; /* no callback will be called! */
			}
			return;
		}
			} else { /* skbs to send? */

		/* skbs to send? */
		bcs->tx_skb = skb_dequeue(&bcs->squeue);
				if (bcs->tx_skb)
					gig_dbg(DEBUG_INTR,
						"Dequeued skb (Adr: %lx)!",
		if (!bcs->tx_skb)
			return;

		gig_dbg(DEBUG_INTR, "Dequeued skb (Adr: %lx)!",
			(unsigned long) bcs->tx_skb);
	}
		}

		if (bcs->tx_skb) {
	gig_dbg(DEBUG_OUTPUT, "modem_fill: tx_skb");
	if (write_modem(cs) < 0) {
				gig_dbg(DEBUG_OUTPUT,
					"modem_fill: write_modem failed");
				again = 1; /* no callback will be called! */
			}
		gig_dbg(DEBUG_OUTPUT, "modem_fill: write_modem failed");
		goto again;	/* no callback will be called! */
	}
	} while (again);
}

/*
@@ -429,9 +423,9 @@ static void gigaset_write_bulk_callback(struct urb *urb)
	spin_unlock_irqrestore(&cs->lock, flags);
}

static int send_cb(struct cardstate *cs, struct cmdbuf_t *cb)
static int send_cb(struct cardstate *cs)
{
	struct cmdbuf_t *tcb;
	struct cmdbuf_t *cb = cs->cmdbuf;
	unsigned long flags;
	int count;
	int status = -ENOENT;
@@ -439,26 +433,27 @@ static int send_cb(struct cardstate *cs, struct cmdbuf_t *cb)

	do {
		if (!cb->len) {
			tcb = cb;

			spin_lock_irqsave(&cs->cmdlock, flags);
			cs->cmdbytes -= cs->curlen;
			gig_dbg(DEBUG_OUTPUT, "send_cb: sent %u bytes, %u left",
				cs->curlen, cs->cmdbytes);
			cs->cmdbuf = cb = cb->next;
			if (cb) {
				cb->prev = NULL;
				cs->curlen = cb->len;
			cs->cmdbuf = cb->next;
			if (cs->cmdbuf) {
				cs->cmdbuf->prev = NULL;
				cs->curlen = cs->cmdbuf->len;
			} else {
				cs->lastcmdbuf = NULL;
				cs->curlen = 0;
			}
			spin_unlock_irqrestore(&cs->cmdlock, flags);

			if (tcb->wake_tasklet)
				tasklet_schedule(tcb->wake_tasklet);
			kfree(tcb);
			if (cb->wake_tasklet)
				tasklet_schedule(cb->wake_tasklet);
			kfree(cb);

			cb = cs->cmdbuf;
		}

		if (cb) {
			count = min(cb->len, ucs->bulk_out_size);
			gig_dbg(DEBUG_OUTPUT, "send_cb: send %d bytes", count);