From patchwork Tue Feb 27 14:26:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitkumar Karwar X-Patchwork-Id: 10245545 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 343C260384 for ; Tue, 27 Feb 2018 14:38:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 267C128927 for ; Tue, 27 Feb 2018 14:38:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AE3F28925; Tue, 27 Feb 2018 14:38:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB66B2891E for ; Tue, 27 Feb 2018 14:38:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753568AbeB0Oh7 (ORCPT ); Tue, 27 Feb 2018 09:37:59 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35904 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753524AbeB0Oh4 (ORCPT ); Tue, 27 Feb 2018 09:37:56 -0500 Received: by mail-pg0-f65.google.com with SMTP id i14so2664841pgv.3; Tue, 27 Feb 2018 06:37:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hqsq7EjK+nHsUa9Ar1NHgjjq9EFJpuMx2oAt4xtqqv4=; b=ZfWnp864uH6VDj1vvx7sORdrR6ay/ZdNLJ0mCJCrIHzeZgMOw2aQh7drM1nsXHqWzT rknDIYtm5+tJv3GgwobVgim85a1+HZ2ghXwiL0rKMk60LL+A/pfdtO4aiVVvskaUStHL k9Hk6lhyjD1VWi7Af3UU3BeCSomh2Uj+2OUTUCIt9GHe//mCOTykDxCE8XMWoAJYTsg5 XVLiQF46I4PMu0jUzaz4obkQk0Rjcy/+bt3/baCkcge65MZgyDO+iSM0AsX+MNzbmLMu hgt4miz6HLmGR++XPeJoiSsjLGxT3YTXgUb9/VDDzoxr5U9T7n5/+W4+Qnhsbyu6Qo6a LMQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hqsq7EjK+nHsUa9Ar1NHgjjq9EFJpuMx2oAt4xtqqv4=; b=Su7Dg3v+IUcx50GSTY4BngFfA+MFwLd+JCEREg5g4GiAI2eIwbMcqwUiiVFds6Fw9c 3cLjMF8WyQacTGKEo8+jOx1z4gSTEmHZ3fXGsWahhyX+NiWDvBvF+DHLS8pCNsJqK+06 8HQIhrxazRDo9kWfzWZuOBAPXspNklKRrCL39gXj8EXQ8HHBr5DTc3Q7zCAUluasKYOQ 6HSV1VL1qGWjIn9cTP01J3p40pHYi8ca6ndXW0Jl3sj3I5d+X0ZP0izml2yXvp6vYkL3 +0ffvyRGPLUDctDQ7AIzSnNfcioFdOsMhvK4F8Fcm6Wi/sB8HhgY4INMvF3d5xz3hZoV UKlQ== X-Gm-Message-State: APf1xPDa6VqqRBDHbG/sskUMlfOcnNkeIZTIaLdpuuka5UOPIIkS1G9Z ey9v63U2FcGNI8bb3Q3BIh0= X-Google-Smtp-Source: AH8x225qy4y2FpnGC76vtFz3VKLKF2W7c7qyBuFiNLS+feTmrRBVL8Z8VZmwga9LQCFDLBT1LtT77w== X-Received: by 10.98.135.76 with SMTP id i73mr14333139pfe.140.1519742275426; Tue, 27 Feb 2018 06:37:55 -0800 (PST) Received: from cpu185.redpinesignals.com ([203.196.161.90]) by smtp.gmail.com with ESMTPSA id g186sm23637490pfb.168.2018.02.27.06.37.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Feb 2018 06:37:54 -0800 (PST) From: Amitkumar Karwar To: Kalle Valo , marcel@holtmann.org Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Siva Rebbagondla , linux-bluetooth@vger.kernel.org, Prameela Rani Garnepudi Subject: [v9 2/8] rsi: add bluetooth rx endpoint Date: Tue, 27 Feb 2018 19:56:12 +0530 Message-Id: <1519741578-12640-3-git-send-email-amitkarwar@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519741578-12640-1-git-send-email-amitkarwar@gmail.com> References: <1519741578-12640-1-git-send-email-amitkarwar@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Siva Rebbagondla USB endpoint 1 is used for WLAN which is presently in use. USB endpoint 2 is introduced for BT Rx traffic. Enumeration of Rx BT endpoint and submitting Rx BT URB are added. From /sys/kernel/debug/usb/devices, Ad=81(I) is for WLAN EP IN and Ad=01(O) is for Wlan EP OUT. Ad=82(I) is for BT EP IN and Ad=02(O) is for BT EP OUT. T: Bus=01 Lev=01 Prnt=01 Port=09 Cnt=03 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1618 ProdID=9113 Rev= 0.02 S: Manufacturer=Redpine Signals, Inc. S: Product=Wireless USB Network Module S: SerialNumber=000000000001 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA I:* If#= 0 Alt= 0 #EPs= 6 Cls=00(>ifc ) Sub=00 Prot=00 Driver=(none) E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Siva Rebbagondla Signed-off-by: Prameela Rani Garnepudi Signed-off-by: Amitkumar Karwar --- v9: No change since v2 v2: Included '/sys/kernel/debug/usb/devices' info in patch description(Marcel) --- drivers/net/wireless/rsi/rsi_91x_usb.c | 37 ++++++++++++++++++++-------------- drivers/net/wireless/rsi/rsi_usb.h | 6 +++--- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index bbce809..9ab86fb 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -103,41 +103,42 @@ static int rsi_find_bulk_in_and_out_endpoints(struct usb_interface *interface, struct usb_host_interface *iface_desc; struct usb_endpoint_descriptor *endpoint; __le16 buffer_size; - int ii, bep_found = 0; + int ii, bin_found = 0, bout_found = 0; iface_desc = &(interface->altsetting[0]); for (ii = 0; ii < iface_desc->desc.bNumEndpoints; ++ii) { endpoint = &(iface_desc->endpoint[ii].desc); - if ((!(dev->bulkin_endpoint_addr)) && + if (!dev->bulkin_endpoint_addr[bin_found] && (endpoint->bEndpointAddress & USB_DIR_IN) && - ((endpoint->bmAttributes & - USB_ENDPOINT_XFERTYPE_MASK) == + ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK)) { buffer_size = endpoint->wMaxPacketSize; - dev->bulkin_size = buffer_size; - dev->bulkin_endpoint_addr = + dev->bulkin_size[bin_found] = buffer_size; + dev->bulkin_endpoint_addr[bin_found] = endpoint->bEndpointAddress; + bin_found++; } - if (!dev->bulkout_endpoint_addr[bep_found] && + if (!dev->bulkout_endpoint_addr[bout_found] && !(endpoint->bEndpointAddress & USB_DIR_IN) && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == - USB_ENDPOINT_XFER_BULK)) { - dev->bulkout_endpoint_addr[bep_found] = + USB_ENDPOINT_XFER_BULK)) { + buffer_size = endpoint->wMaxPacketSize; + dev->bulkout_endpoint_addr[bout_found] = endpoint->bEndpointAddress; buffer_size = endpoint->wMaxPacketSize; - dev->bulkout_size[bep_found] = buffer_size; - bep_found++; + dev->bulkout_size[bout_found] = buffer_size; + bout_found++; } - if (bep_found >= MAX_BULK_EP) + if (bin_found >= MAX_BULK_EP || bout_found >= MAX_BULK_EP) break; } - if (!(dev->bulkin_endpoint_addr) && - (dev->bulkout_endpoint_addr[0])) + if (!(dev->bulkin_endpoint_addr[0]) && + dev->bulkout_endpoint_addr[0]) return -EINVAL; return 0; @@ -273,7 +274,7 @@ static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num) usb_fill_bulk_urb(urb, dev->usbdev, usb_rcvbulkpipe(dev->usbdev, - dev->bulkin_endpoint_addr), + dev->bulkin_endpoint_addr[ep_num - 1]), urb->transfer_buffer, 3000, rsi_rx_done_handler, @@ -745,6 +746,12 @@ static int rsi_probe(struct usb_interface *pfunction, if (status) goto err1; + if (adapter->priv->coex_mode > 1) { + status = rsi_rx_urb_submit(adapter, BT_EP); + if (status) + goto err1; + } + return 0; err1: rsi_deinit_usb_interface(adapter); diff --git a/drivers/net/wireless/rsi/rsi_usb.h b/drivers/net/wireless/rsi/rsi_usb.h index 7e781d5..0fda14c 100644 --- a/drivers/net/wireless/rsi/rsi_usb.h +++ b/drivers/net/wireless/rsi/rsi_usb.h @@ -31,7 +31,7 @@ #define USB_VENDOR_REGISTER_WRITE 0x16 #define RSI_USB_TX_HEAD_ROOM 128 -#define MAX_RX_URBS 1 +#define MAX_RX_URBS 2 #define MAX_BULK_EP 8 #define WLAN_EP 1 #define BT_EP 2 @@ -54,8 +54,8 @@ struct rsi_91x_usbdev { struct usb_interface *pfunction; struct rx_usb_ctrl_block rx_cb[MAX_RX_URBS]; u8 *tx_buffer; - __le16 bulkin_size; - u8 bulkin_endpoint_addr; + __le16 bulkin_size[MAX_BULK_EP]; + u8 bulkin_endpoint_addr[MAX_BULK_EP]; __le16 bulkout_size[MAX_BULK_EP]; u8 bulkout_endpoint_addr[MAX_BULK_EP]; u32 tx_blk_size;