From patchwork Thu Jun 12 17:33:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: michael-dev X-Patchwork-Id: 4344091 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 08A0EBEEAA for ; Thu, 12 Jun 2014 17:34:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 145DF201F7 for ; Thu, 12 Jun 2014 17:34:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A6C220149 for ; Thu, 12 Jun 2014 17:34:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964931AbaFLReq (ORCPT ); Thu, 12 Jun 2014 13:34:46 -0400 Received: from mail.fem.tu-ilmenau.de ([141.24.220.54]:58263 "EHLO mail.fem.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964867AbaFLRem (ORCPT ); Thu, 12 Jun 2014 13:34:42 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.fem.tu-ilmenau.de (Postfix) with ESMTP id 3012E67C5; Thu, 12 Jun 2014 19:34:39 +0200 (CEST) X-Virus-Scanned: amavisd-new at fem.tu-ilmenau.de Received: from mail.fem.tu-ilmenau.de ([127.0.0.1]) by localhost (mail.fem.tu-ilmenau.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f++Kb8xTjurn; Thu, 12 Jun 2014 19:34:36 +0200 (CEST) Received: from charlie.fem.tu-ilmenau.de (a-keller-044.fem.tu-ilmenau.de [141.24.40.108]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.fem.tu-ilmenau.de (Postfix) with ESMTPSA; Thu, 12 Jun 2014 19:34:35 +0200 (CEST) Received: from charlie.fem.tu-ilmenau.de (localhost [127.0.0.1]) by charlie.fem.tu-ilmenau.de (Postfix) with ESMTP id CD8D21C812E5; Thu, 12 Jun 2014 19:33:41 +0200 (CEST) Subject: [PATCH v2 2/2] rt2800usb:fix hang during firmware load To: Ivo van Doorn , Helmut Schaa From: Michael Braun Cc: netdev@vger.kernel.org, users@rt2x00.serialmonkey.com, linux-wireless@vger.kernel.org, "John W. Linville" , linux-kernel@vger.kernel.org Date: Thu, 12 Jun 2014 19:33:41 +0200 Message-ID: <20140612173341.15935.7058.stgit@charlie.fem.tu-ilmenau.de> In-Reply-To: <20140612173057.15935.14194.stgit@charlie.fem.tu-ilmenau.de> References: <20140612173057.15935.14194.stgit@charlie.fem.tu-ilmenau.de> User-Agent: StGit/0.15 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=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The device 057c:8501 (AVM Fritz! WLAN v2 rev. B) boots into a state that does not actually require loading a firmware file. The vendors driver finds out about this by checking a firmware state register, so this patch adds this here. Finally, with this patch applied, my wifi dongle actually becomes useful (scan + connect to wpa network works). Signed-off-by: Michael Braun Acked-by: Stanislaw Gruszka --- drivers/net/wireless/rt2x00/rt2800usb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 11583ca..e11dab2 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c @@ -278,8 +278,13 @@ static int rt2800usb_write_firmware(struct rt2x00_dev *rt2x00dev, /* * Write firmware to device. */ - rt2x00usb_register_multiwrite(rt2x00dev, FIRMWARE_IMAGE_BASE, - data + offset, length); + if (rt2800usb_autorun_detect(rt2x00dev)) { + rt2x00_info(rt2x00dev, + "Firmware loading not required - NIC in AutoRun mode\n"); + } else { + rt2x00usb_register_multiwrite(rt2x00dev, FIRMWARE_IMAGE_BASE, + data + offset, length); + } rt2x00usb_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0); rt2x00usb_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);