public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Stefan Lippers-Hollmann" <s.L-H@gmx.de>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: "Greg Kroah-Hartman" <gregkh@suse.de>,
	florian.c.schilhabel@googlemail.com,
	linux-kernel@vger.kernel.org, devel@linuxdriverproject.org
Subject: Re: [PATCH 3/4] staging: r8712u: Switch driver to use external firmware from linux-firmware
Date: Sat, 15 Jan 2011 00:05:24 +0100	[thread overview]
Message-ID: <201101150005.26858.s.L-H@gmx.de> (raw)
In-Reply-To: <4d30b7fa.j0xZq9/VwpVGxx/H%Larry.Finger@lwfinger.net>

Hi

[ Sorry if you already handled these comments in the fourth patch of 
  your series, but as patch 4/4 doesn't appear to have reached lkml 
  yet, I'll respond here. ]

On Friday 14 January 2011, Larry Finger wrote:
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
>  drivers/staging/rtl8712/TODO       |    2 --
>  drivers/staging/rtl8712/hal_init.c |   22 +++++++++++++++++-----
>  2 files changed, 17 insertions(+), 7 deletions(-)
[...]
> @@ -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";

rtl8712u.bin has been merged into linux-firmware.git as 
rtlwifi/rtl8712u.bin, wouldn't it be better to use that location 
instead?

const char firmware_file[] = "rtlwifi/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;
>  }

Additionally I'd suggest to declare the firmware as well, so that 
userspace knows about it, just like selecting FW_LOADER.

MODULE_FIRMWARE("rtlwifi/rtl8712u.bin");

>  
>  static void fill_fwpriv(struct _adapter *padapter, struct fw_priv *pfwpriv)
> 

--- a/drivers/staging/rtl8712/Kconfig
+++ b/drivers/staging/rtl8712/Kconfig
@@ -3,6 +3,7 @@ config R8712U
 	depends on WLAN && USB
 	select WIRELESS_EXT
 	select WEXT_PRIV
+	select FW_LOADER
 	default N
 	---help---
 	This option adds the Realtek RTL8712 USB device such as the D-Link DWA-130.

I'll post an according patch as follow up to this mail, diff'ed against
next-20110114 plus your 3/4 patches that reached lkml:
+ [PATCH 1/4] staging: r8712u: Fix memory leak in firmware loading
+ [PATCH 2/4] staging: r8712u: Fix sparse message
+ [PATCH 3/4] staging: r8712u: Switch driver to use external firmware from linux-firmware

Feel free to merge those changes into your "r8712u: Switch driver to 
use external firmware from linux-firmware", if you like.

Regards
	Stefan Lippers-Hollmann

  reply	other threads:[~2011-01-14 23:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-14 20:54 [PATCH 3/4] staging: r8712u: Switch driver to use external firmware from linux-firmware Larry Finger
2011-01-14 23:05 ` Stefan Lippers-Hollmann [this message]
2011-01-14 23:08   ` [PATCH] staging: r8712u: Fix external firmware loading Stefan Lippers-Hollmann
2011-01-14 23:24     ` Larry Finger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201101150005.26858.s.L-H@gmx.de \
    --to=s.l-h@gmx.de \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@linuxdriverproject.org \
    --cc=florian.c.schilhabel@googlemail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox