From patchwork Thu May 7 20:28:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 6360811 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7CEABBEEE1 for ; Thu, 7 May 2015 20:29:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5020E20204 for ; Thu, 7 May 2015 20:29:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1FCCF201CE for ; Thu, 7 May 2015 20:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751263AbbEGU3T (ORCPT ); Thu, 7 May 2015 16:29:19 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:38584 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751096AbbEGU3S (ORCPT ); Thu, 7 May 2015 16:29:18 -0400 Received: by wiun10 with SMTP id n10so5031835wiu.1 for ; Thu, 07 May 2015 13:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=LAAM12YdpHb3v7C4yQr1v2b37PYaUOOGDtpRYbKx6xU=; b=RN+GEvK+HjdvF4fPCaL8ITnUk9jv7FhfiAkk5ttBfLd7xNkh3cZaAiHpmxDiCnv3vW /mAWbffbAboHVBbN3dUF+rZomrsXOAtJca1P3sVnRN7o3r+oFZmGtzjsxM4AuuFHwuU6 57eXbJFvYROSTxLifS8KiZOEuzc/1JDwvpADMOYzAusYKxMU3fSAUy8QRhEg6KJYoGd7 J/mQIyXtrKp53phCczYxmrZ/rw/GGy8KtTAp7Nt+VTcLfBTIjul41prt5e93IE4tPF+Z IrA7p5MYlDmC6nwfkhtUNtpDv1woEj3aps3ZjzzC8D88ivAE2GZjb69O9xBhAhNxY88B q8fw== X-Received: by 10.194.172.72 with SMTP id ba8mr735175wjc.136.1431030557011; Thu, 07 May 2015 13:29:17 -0700 (PDT) Received: from linux-tdhb.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by mx.google.com with ESMTPSA id b10sm9100921wiz.9.2015.05.07.13.29.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 13:29:16 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: brcm80211-dev-list@broadcom.com Cc: Brett Rudley , Arend van Spriel , "Franky (Zhenhui) Lin" , Hante Meuleman , linux-wireless@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH RFC:rxctl wait timed out] brcmfmac: add BCM43526 USB support Date: Thu, 7 May 2015 22:28:55 +0200 Message-Id: <1431030535-11083-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Rafa? Mi?ecki --- Hi, I'm trying to add BCM43526 support. This chipset can be found in: 1) Some USB dongles, e.g. Tenda W900U uses revision 2 2) Some routers, e.g. Asus RT-AC53U uses revision 3+ Unfortunately attached patch doesn't seem to be enough, brcmfmac doesn't work with my Tenda W900U. I keep getting following error: > brcmfmac: brcmf_usb_recv_ctl Enter > brcmf_usb_rx_ctlpkt: rxctl wait timed out > brcmfmac: brcmf_fil_cmd_data Failed: -5 It seems that: 1) driver sends TX URB and gets completion callback called 2) driver sents RX URB but it never gets completed This seems to happen for the very first wlioctl send to the firmware which is BRCMF_C_GET_VAR. I tried hacking brcmf_c_preinit_dcmds to start with BRCMF_C_GET_REVINFO instead, but the result is the same. I believe firmware simply doesn't reply to any wlioctl. I tried extracing firmware from: 1) Tenda W900U's bcmwlhigh6.sys 2) Tenda W900U's bcmwlhigh664.sys 3) DWA-182A1 Vistax64's bcmwlhigh664.sys 4) DWA-182A1 Win7x86's bcmwlhigh6.sys Firmware seems to be OK because extracting 43526b instead of 43526a results in: brcmf_usb_resetcfg: Cannot talk to Dongle. Firmware is not UP, 1000 ms Any idea what may be wrong/missing? [29078.703293] brcmfmac: brcmf_usb_probe Enter 0x0a5c:0xbd1d [29078.703297] brcmfmac: brcmf_usb_probe Broadcom high speed USB WLAN interface detected [29078.703298] brcmfmac: brcmf_usb_probe_cb Enter [29078.703299] brcmfmac: brcmf_usb_attach Enter [29078.703313] brcmfmac: brcmf_usb_dlneeded Enter [29078.704271] brcmfmac: brcmf_usb_dlneeded chip 43526 rev 0x2 [29078.704276] brcmfmac: brcmf_fw_get_firmwares enter: dev=3-2 [29078.704524] brcmfmac: brcmf_fw_request_code_done enter: dev=3-2 [29078.704526] brcmfmac: brcmf_usb_probe_phase2 Start fw downloading [29078.704527] brcmfmac: check_file Enter [29078.704529] brcmfmac: brcmf_usb_fw_download Enter [29078.704530] brcmfmac: brcmf_usb_dlstart Enter [29078.704532] brcmfmac: brcmf_usb_dl_writeimage Enter, fw ffffc900050a8000, len 368640 [29078.807929] brcmfmac: brcmf_usb_dl_writeimage Exit, err=0 [29078.807932] brcmfmac: brcmf_usb_dlstart Exit, err=0 [29078.807934] brcmfmac: brcmf_usb_dlrun Enter [29078.808624] brcmfmac: brcmf_usb_resetcfg Enter [29079.009038] brcmfmac: brcmf_usb_resetcfg postboot chip 0xa123/rev 0x1 [29079.011264] brcmfmac: brcmf_usb_dlrun Exit [29079.011319] brcmfmac: brcmf_attach Enter [29079.011352] brcmfmac: brcmf_proto_attach Enter [29079.011366] brcmfmac: brcmf_usb_up Enter [29079.011368] brcmfmac: brcmf_usb_state_change Enter, current state=2, new state=3 [29079.011369] brcmfmac: brcmf_usb_state_change DBUS is up [29079.011371] brcmfmac: brcmf_bus_change_state 0 -> 1 [29079.011429] brcmfmac: brcmf_bus_start [29079.011431] brcmfmac: brcmf_add_if Enter, idx=0, ifidx=0 [29079.011432] brcmfmac: brcmf_add_if allocate netdev interface [29079.011442] brcmfmac: brcmf_add_if ==== pid:1495, if:wlan%d (00:00:00:00:00:00) created === [29079.011443] brcmfmac: brcmf_bus_change_state 1 -> 1 [29079.011446] brcmfmac: brcmf_proto_bcdc_query_dcmd Enter, cmd 262 len 20 [29079.011447] brcmfmac: brcmf_proto_bcdc_msg Enter [29079.011449] brcmfmac: brcmf_usb_tx_ctlpkt Enter [29079.011450] brcmfmac: brcmf_usb_send_ctl Enter [29079.011491] brcmfmac: brcmf_usb_ctlwrite_complete Enter [29079.011494] brcmfmac: brcmf_usb_ctl_complete Enter, status=0 [29079.011510] brcmfmac: brcmf_proto_bcdc_cmplt Enter [29079.011522] brcmfmac: brcmf_usb_rx_ctlpkt Enter [29079.011523] brcmfmac: brcmf_usb_recv_ctl Enter [29081.013165] brcmf_usb_rx_ctlpkt: rxctl wait timed out [29081.013170] brcmfmac: brcmf_fil_cmd_data Failed: -5 [29081.013172] brcmfmac: brcmf_fil_iovar_data_get ifidx=0, name=cur_etheraddr, len=6 [29081.013176] brcmf_c_preinit_dcmds: Retreiving cur_etheraddr failed, -52 [29081.013177] brcmf_bus_start: failed: -52 --- drivers/net/wireless/brcm80211/brcmfmac/usb.c | 12 ++++++++++++ drivers/net/wireless/brcm80211/include/brcm_hw_ids.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c index daba86d..e300c7d 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c @@ -46,6 +46,8 @@ #define BRCMF_USB_43143_FW_NAME "brcm/brcmfmac43143.bin" #define BRCMF_USB_43236_FW_NAME "brcm/brcmfmac43236b.bin" #define BRCMF_USB_43242_FW_NAME "brcm/brcmfmac43242a.bin" +#define BRCMF_USB_43526A_FW_NAME "brcm/brcmfmac43526a.bin" +#define BRCMF_USB_43526B_FW_NAME "brcm/brcmfmac43526b.bin" #define BRCMF_USB_43569_FW_NAME "brcm/brcmfmac43569.bin" #define TRX_MAGIC 0x30524448 /* "HDR0" */ @@ -993,6 +995,8 @@ static bool brcmf_usb_chip_support(int chipid, int chiprev) return (chiprev == 3); case BRCM_CC_43242_CHIP_ID: return true; + case BRCM_CC_43526_CHIP_ID: + return true; case BRCM_CC_43566_CHIP_ID: case BRCM_CC_43569_CHIP_ID: return true; @@ -1072,6 +1076,8 @@ static int check_file(const u8 *headers) static const char *brcmf_usb_get_fwname(struct brcmf_usbdev_info *devinfo) { + int chiprev = devinfo->bus_pub.chiprev; + switch (devinfo->bus_pub.devid) { case BRCM_CC_43143_CHIP_ID: return BRCMF_USB_43143_FW_NAME; @@ -1081,6 +1087,11 @@ static const char *brcmf_usb_get_fwname(struct brcmf_usbdev_info *devinfo) return BRCMF_USB_43236_FW_NAME; case BRCM_CC_43242_CHIP_ID: return BRCMF_USB_43242_FW_NAME; + case BRCM_CC_43526_CHIP_ID: + if (chiprev <= 2) + return BRCMF_USB_43526A_FW_NAME; + else + return BRCMF_USB_43526B_FW_NAME; case BRCM_CC_43566_CHIP_ID: case BRCM_CC_43569_CHIP_ID: return BRCMF_USB_43569_FW_NAME; @@ -1461,6 +1472,7 @@ static struct usb_device_id brcmf_usb_devid_table[] = { BRCMF_USB_DEVICE(BRCM_USB_43143_DEVICE_ID), BRCMF_USB_DEVICE(BRCM_USB_43236_DEVICE_ID), BRCMF_USB_DEVICE(BRCM_USB_43242_DEVICE_ID), + BRCMF_USB_DEVICE(BRCM_USB_43526_DEVICE_ID), BRCMF_USB_DEVICE(BRCM_USB_43569_DEVICE_ID), /* special entry for device with firmware loaded and running */ BRCMF_USB_DEVICE(BRCM_USB_BCMFW_DEVICE_ID), diff --git a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h index 2124a17..56c1948 100644 --- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h @@ -39,6 +39,7 @@ #define BRCM_CC_4339_CHIP_ID 0x4339 #define BRCM_CC_4354_CHIP_ID 0x4354 #define BRCM_CC_4356_CHIP_ID 0x4356 +#define BRCM_CC_43526_CHIP_ID 43526 #define BRCM_CC_43566_CHIP_ID 43566 #define BRCM_CC_43567_CHIP_ID 43567 #define BRCM_CC_43569_CHIP_ID 43569 @@ -49,6 +50,7 @@ #define BRCM_USB_43143_DEVICE_ID 0xbd1e #define BRCM_USB_43236_DEVICE_ID 0xbd17 #define BRCM_USB_43242_DEVICE_ID 0xbd1f +#define BRCM_USB_43526_DEVICE_ID 0xbd1d #define BRCM_USB_43569_DEVICE_ID 0xbd27 #define BRCM_USB_BCMFW_DEVICE_ID 0x0bdc