From patchwork Wed Nov 15 07:20:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitkumar Karwar X-Patchwork-Id: 10058891 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 94158601D3 for ; Wed, 15 Nov 2017 07:28:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8554E29DBE for ; Wed, 15 Nov 2017 07:28:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A48F29DCF; Wed, 15 Nov 2017 07:28:32 +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 1208929DBE for ; Wed, 15 Nov 2017 07:28:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754650AbdKOH2a (ORCPT ); Wed, 15 Nov 2017 02:28:30 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:47521 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752358AbdKOH21 (ORCPT ); Wed, 15 Nov 2017 02:28:27 -0500 Received: by mail-pf0-f193.google.com with SMTP id t69so7425146pfg.4; Tue, 14 Nov 2017 23:28:27 -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=zr9eGzY+GB3DAs6y5zfdXTjRMcRp0YUflTTNCTFn0Xc=; b=W+SqQ1mszBxlPrs+Qz+1iMZDnqNMIs4aI2PlngfAL2Fsm2NcH+hbC97w0MVmgpaVsO SCwf5d/ybz8qiBZo9l7IjuuzAn/cHXKh0ce8R7vdrE687UgI6u75Rn65eeTl3LpF9xYE Gb5iZxnLwA1Ix3o4u7nuasqjFd9xBBex6bjiQHtNyS1rJVWObyNlGFxnF1IezPcY43pK L6lju3FRDYJ6KvBHa8c/IiF5jYslicNkG5XqsyBYS8GdjhJ2TGjZ5ScTRaUjRLNxGtCr P2rROtMWybwp8mo9K/TAww9dyD0f84dKCxbqTKn3KkhX4myg0qLEWOkIX3X6sOkL2Elp e5gg== 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=zr9eGzY+GB3DAs6y5zfdXTjRMcRp0YUflTTNCTFn0Xc=; b=eYX1Ft4BKBE8Bokh7oZow7Lgf5ZICJs0XEpS6fIbG4cEyzyoU8Gn0mFqY0+6ePA0Sd jfE+/+ubmDjUwChz8H2ourrC4yEnqyX82M+MYvbcNx1v24qNr/ABMpikZK/h7dn97mF9 BMRGYptmPZG+Ozp9Q48oXGzUYfkBV9ooyQbdu2Oxy+4h2RP5yyC8jh6x5bzB0M0pqcWD CgPwofBHMKzR2mHZh6Ms9yTW+wZxb5cOeNBvTtLxoa7dUzAf6FjhjB7yDGPK6BevJ372 eFDnomBqlmUCBV7aJlHmpx/qASj6xsCgETga5AAcML/B7bD+XtJ3RpOKxtPEYX9xkRnS PAkQ== X-Gm-Message-State: AJaThX5ECdGGH4HBiqU9ZZu7Vj2GzdLHv5gmZvJkCtUyj9OK06yqbTv9 S05//XtbtDqvdLwUkccTeEk= X-Google-Smtp-Source: AGs4zMYz7XKdxSeqNriIp1QsxeN3sXRQohG3f4rihaBOy1dKo0bDYcm9cyNev9T34c8Arpw4w9jVAg== X-Received: by 10.99.165.25 with SMTP id n25mr14491776pgf.3.1510730906621; Tue, 14 Nov 2017 23:28:26 -0800 (PST) Received: from cpu185.redpinesignals.com ([203.196.161.90]) by smtp.gmail.com with ESMTPSA id y5sm14975850pfa.128.2017.11.14.23.28.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Nov 2017 23:28:26 -0800 (PST) From: Amitkumar Karwar To: Kalle Valo , marcel@holtmann.org Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Prameela Rani Garnepudi , linux-bluetooth@vger.kernel.org, Siva Rebbagondla Subject: [PATCH 2/8] rsi: add bluetooth rx endpoint Date: Wed, 15 Nov 2017 12:50:38 +0530 Message-Id: <1510730444-3237-3-git-send-email-amitkarwar@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510730444-3237-1-git-send-email-amitkarwar@gmail.com> References: <1510730444-3237-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. Signed-off-by: Prameela Rani Garnepudi Signed-off-by: Siva Rebbagondla Signed-off-by: Amitkumar Karwar --- 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 147fcee2..b212a15 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;