netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karsten Keil <kkeil@linux-pingi.de>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Martin Bachem <info@colognechip.com>
Subject: [PATCH 4/8] mISDN: Bugfix hfcsusb: usb endpoint activation/deactivation
Date: Wed, 16 May 2012 06:22:50 +0200	[thread overview]
Message-ID: <1337142174-8304-5-git-send-email-kkeil@linux-pingi.de> (raw)
In-Reply-To: <1337142174-8304-1-git-send-email-kkeil@linux-pingi.de>

From: Martin Bachem <info@colognechip.com>

Here was a off by one in the activation/deactivation.
The additional activation in open_bchannel() did hide
it, but only if you do not try to use B2.

Signed-off-by: Martin Bachem <info@colognechip.com>
Signed-off-by: Karsten Keil <kkeil@linux-pingi.de>
---
 drivers/isdn/hardware/mISDN/hfcsusb.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
index a4c5b24..919eccc 100644
--- a/drivers/isdn/hardware/mISDN/hfcsusb.c
+++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
@@ -231,7 +231,7 @@ hfcusb_l2l1B(struct mISDNchannel *ch, struct sk_buff *skb)
 		return ret;
 	case PH_ACTIVATE_REQ:
 		if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) {
-			hfcsusb_start_endpoint(hw, bch->nr);
+			hfcsusb_start_endpoint(hw, bch->nr - 1);
 			ret = hfcsusb_setup_bch(bch, ch->protocol);
 		} else
 			ret = 0;
@@ -495,12 +495,6 @@ open_bchannel(struct hfcsusb *hw, struct channel_req *rq)
 	bch->ch.protocol = rq->protocol;
 	rq->ch = &bch->ch;
 
-	/* start USB endpoint for bchannel */
-	if (rq->adr.channel  == 1)
-		hfcsusb_start_endpoint(hw, HFC_CHAN_B1);
-	else
-		hfcsusb_start_endpoint(hw, HFC_CHAN_B2);
-
 	if (!try_module_get(THIS_MODULE))
 		printk(KERN_WARNING "%s: %s:cannot get module\n",
 		       hw->name, __func__);
@@ -1801,7 +1795,7 @@ deactivate_bchannel(struct bchannel *bch)
 	mISDN_clear_bchannel(bch);
 	spin_unlock_irqrestore(&hw->lock, flags);
 	hfcsusb_setup_bch(bch, ISDN_P_NONE);
-	hfcsusb_stop_endpoint(hw, bch->nr);
+	hfcsusb_stop_endpoint(hw, bch->nr - 1);
 }
 
 /*
-- 
1.7.3.4

  parent reply	other threads:[~2012-05-16  4:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-16  4:22 [PATCH 0/8] mISDN: Fixes and enhancements for the data channels Karsten Keil
2012-05-16  4:22 ` [PATCH 1/8] mISDN: Cleanup channel also if it already was deactivated Karsten Keil
2012-05-16  4:22 ` [PATCH 2/8] mISDN: Early confirm for transparent data Karsten Keil
2012-05-16  4:22 ` [PATCH 3/8] mISDN: avmfritz use the bigger fifo of chip version 2 Karsten Keil
2012-05-16  5:16   ` David Miller
2012-05-16  7:00     ` Karsten Keil
2012-05-16  4:22 ` Karsten Keil [this message]
2012-05-16  4:22 ` [PATCH 5/8] mISDN: Reduce RX buffer allocation for transparent data Karsten Keil
2012-05-16  5:21   ` David Miller
2012-05-16  4:22 ` [PATCH 6/8] mISDN: Allow to set a minimum length " Karsten Keil
2012-05-16  5:18   ` David Miller
2012-05-16  4:22 ` [PATCH 7/8] mISDN: Implement MISDN_CTRL_FILL_EMPTY for more drivers Karsten Keil
2012-05-16  4:22 ` [PATCH 8/8] mISDN: Implement MISDN_CTRL_RX_OFF " Karsten Keil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337142174-8304-5-git-send-email-kkeil@linux-pingi.de \
    --to=kkeil@linux-pingi.de \
    --cc=davem@davemloft.net \
    --cc=info@colognechip.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).