From patchwork Sun Jun 1 17:52:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: michael-dev X-Patchwork-Id: 4279011 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 43148BEEA7 for ; Sun, 1 Jun 2014 18:00:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69E3B2024D for ; Sun, 1 Jun 2014 18:00:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 923C820219 for ; Sun, 1 Jun 2014 18:00:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669AbaFAR7n (ORCPT ); Sun, 1 Jun 2014 13:59:43 -0400 Received: from mail.fem.tu-ilmenau.de ([141.24.220.54]:49585 "EHLO mail.fem.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbaFAR7m (ORCPT ); Sun, 1 Jun 2014 13:59:42 -0400 X-Greylist: delayed 375 seconds by postgrey-1.27 at vger.kernel.org; Sun, 01 Jun 2014 13:59:41 EDT Received: from localhost (localhost [127.0.0.1]) by mail.fem.tu-ilmenau.de (Postfix) with ESMTP id 988966894; Sun, 1 Jun 2014 19:53:22 +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 sKhnP7222Ixv; Sun, 1 Jun 2014 19:52:49 +0200 (CEST) Received: from charlie.fem.tu-ilmenau.de (a-keller-042.fem.tu-ilmenau.de [141.24.40.106]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.fem.tu-ilmenau.de (Postfix) with ESMTPSA; Sun, 1 Jun 2014 19:52:49 +0200 (CEST) Received: from charlie.fem.tu-ilmenau.de (localhost [127.0.0.1]) by charlie.fem.tu-ilmenau.de (Postfix) with ESMTP id C79441C82FC9; Sun, 1 Jun 2014 19:52:47 +0200 (CEST) Subject: [PATCH 1/2] rt2800usb:fix efuse detection 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: Sun, 01 Jun 2014 19:52:47 +0200 Message-ID: <20140601175247.7980.2461.stgit@charlie.fem.tu-ilmenau.de> In-Reply-To: <20140601174736.7980.18330.stgit@charlie.fem.tu-ilmenau.de> References: <20140601174736.7980.18330.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) currently does not load. One thing observed is that the vendors driver detects EFUSE mode for this device, but rt2800usb does not. This is due to rt2800usb lacking a check for the firmware mode present in the vendors driver, that this patch adopts for rt2800usb. With this patch applied, the 'RF chipset' detection does no longer fail. Signed-off-by: Michael Braun --- drivers/net/wireless/rt2x00/rt2800usb.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) -- 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 a49c3d7..b601422 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c @@ -735,11 +735,25 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry, /* * Device probe functions. */ +static int rt2800usb_efuse_detect(struct rt2x00_dev *rt2x00dev) +{ + __le32 fwMode; + + rt2x00usb_vendor_request(rt2x00dev, USB_DEVICE_MODE, + USB_VENDOR_REQUEST_IN, 0, 0x11, &fwMode, + sizeof(fwMode), REGISTER_TIMEOUT_FIRMWARE); + + if ((fwMode & 0x00000003) == 2) + return 1; + + return rt2800_efuse_detect(rt2x00dev); +} + static int rt2800usb_read_eeprom(struct rt2x00_dev *rt2x00dev) { int retval; - if (rt2800_efuse_detect(rt2x00dev)) + if (rt2800usb_efuse_detect(rt2x00dev)) retval = rt2800_read_eeprom_efuse(rt2x00dev); else retval = rt2x00usb_eeprom_read(rt2x00dev, rt2x00dev->eeprom,