From patchwork Thu Oct 28 22:10:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 288882 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9SMANsk028755 for ; Thu, 28 Oct 2010 22:10:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760589Ab0J1WJw (ORCPT ); Thu, 28 Oct 2010 18:09:52 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:57758 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760568Ab0J1WJv (ORCPT ); Thu, 28 Oct 2010 18:09:51 -0400 Received: by wyf28 with SMTP id 28so2446241wyf.19 for ; Thu, 28 Oct 2010 15:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type; bh=2JnbYCd9VcVxcspWAzVGiOe+3hYHPI6DllGDjRfGg60=; b=nX3LQKbrMKsajHqAe0DYBLcsZB2H7JQOsOxGZra+iGNC2HHfxwaxy+6yCum0i58J1z P0LOBJIu0fOq2P7H7nO6EfFaRhXlWBXJp28ZGVmNGk4UwqxhhspMiPyVsMbFAio1jj3l 2/buQQv418lnRMIivclYL50up7coLI91UKj7s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; b=fbwNkadOY+U3QRtOjkxvSkJNXgtu7JedLqQ+SaJIcRdYqsDSYoCTbe2y3951lOXy8+ nn0NdNp9y+qz0a7RAcx98WbrFok0ig6FCJc2jRxXxO0ONMmI6nqOztLan0hxWCYsz47m BMgxIPJ2kMBTKkybOl+JYsXsUva7FU7I35WTI= Received: by 10.216.142.199 with SMTP id i49mr11144625wej.96.1288303789954; Thu, 28 Oct 2010 15:09:49 -0700 (PDT) Received: from larrylap.lan (cpe-65-28-92-85.kc.res.rr.com [65.28.92.85]) by mx.google.com with ESMTPS id y15sm1079017weq.30.2010.10.28.15.09.47 (version=SSLv3 cipher=RC4-MD5); Thu, 28 Oct 2010 15:09:48 -0700 (PDT) Message-ID: <4CC9F4BE.7070500@lwfinger.net> Date: Thu, 28 Oct 2010 17:10:06 -0500 From: Larry Finger User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.14) Gecko/20101013 SUSE/3.0.9 Thunderbird/3.0.9 MIME-Version: 1.0 To: Stefan Lippers-Hollmann CC: wireless Subject: Re: Realtek rtl8188 support? References: <201009212120.07914.s.L-H@gmx.de> <4CC9C067.9040105@lwfinger.net> <201010282348.16673.s.L-H@gmx.de> In-Reply-To: <201010282348.16673.s.L-H@gmx.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 28 Oct 2010 22:10:23 +0000 (UTC) From 2559d624a3bfc47e6ba9d1cf5157c5c7b1cbf80e Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Tue, 26 Oct 2010 10:59:11 -0500 Subject: [PATCH 1/2] staging: r8712u: Switch driver to use external firmware from linux-firmware Signed-off-by: Larry Finger --- drivers/staging/rtl8712/TODO | 2 -- drivers/staging/rtl8712/hal_init.c | 22 +++++++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8712/TODO b/drivers/staging/rtl8712/TODO index 5c88821..ed22b0b 100644 --- a/drivers/staging/rtl8712/TODO +++ b/drivers/staging/rtl8712/TODO @@ -4,8 +4,6 @@ TODO: - switch to use MAC80211 - checkpatch.pl fixes - only a few remain - sparse fixes -- switch from large inline firmware file to use the firmware interface - and add the file to the linux-firmware package. Please send any patches to Greg Kroah-Hartman , Larry Finger and diff --git a/drivers/staging/rtl8712/hal_init.c b/drivers/staging/rtl8712/hal_init.c index 32088a6..014fbbc 100644 --- a/drivers/staging/rtl8712/hal_init.c +++ b/drivers/staging/rtl8712/hal_init.c @@ -31,7 +31,6 @@ #include "osdep_service.h" #include "drv_types.h" #include "rtl871x_byteorder.h" -#include "farray.h" #include "usb_osintf.h" #define FWBUFF_ALIGN_SZ 512 @@ -40,11 +39,24 @@ static u32 rtl871x_open_fw(struct _adapter *padapter, void **pphfwfile_hdl, const u8 **ppmappedfw) { - u32 len; + int rc; + const char firmware_file[] = "rtl8712u/rtl8712u.bin"; + const struct firmware **praw = (const struct firmware **) + (pphfwfile_hdl); + struct dvobj_priv *pdvobjpriv = (struct dvobj_priv *) + (&padapter->dvobjpriv); + struct usb_device *pusbdev = pdvobjpriv->pusbdev; - *ppmappedfw = f_array; - len = sizeof(f_array); - return len; + printk(KERN_INFO "r8712u: Loading firmware from \"%s\"\n", + firmware_file); + rc = request_firmware(praw, firmware_file, &pusbdev->dev); + if (rc < 0) { + printk(KERN_ERR "r8712u: Unable to load firmware\n"); + printk(KERN_ERR "r8712u: Install latest linux-firmware\n"); + return 0; + } + *ppmappedfw = (u8 *)((*praw)->data); + return (*praw)->size; } static void fill_fwpriv(struct _adapter *padapter, struct fw_priv *pfwpriv) -- 1.7.1