All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libertas: prioritize usb8388_v5.bin firmware on OLPC machines
@ 2011-07-31  7:03 Andres Salomon
  2011-07-31  7:05 ` Andres Salomon
  0 siblings, 1 reply; 7+ messages in thread
From: Andres Salomon @ 2011-07-31  7:03 UTC (permalink / raw)
  To: dcbw; +Cc: David Woodhouse, libertas-dev, dsd, cjb, linux-kernel

Normally, the v9 firmware will be loaded if it's available.  However, on
OLPC XO-1 machines, the v5 firmware supports extra functionality.  This
makes the libertas driver attempt to load the v5 firmware first if the
machine is an OLPC machine; if that fails (or it's not an OLPC machine),
fall back to attempting to load the other firmwares.

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/net/wireless/libertas/if_usb.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index b5acc39..6a2e70e 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -973,6 +973,26 @@ static const struct {
 	{ MODEL_8682, "libertas/usb8682.bin" }
 };
 
+#ifdef CONFIG_OLPC
+
+/* default OLPC firmware to try; index into fw_table above */
+#define OLPC_FW 1
+
+static int try_olpc_fw(struct if_usb_card *cardp)
+{
+	int retval = -ENOENT;
+
+	/* try the OLPC firmware first; fall back to any others */
+	if (machine_is_olpc())
+		retval = request_firmware(&cardp->fw,
+				fw_table[OLPC_FW].fwname, &cardp->udev->dev);
+	return retval;
+}
+
+#else
+static int try_olpc_fw(struct if_usb_card *cardp) { return -ENOENT; }
+#endif /* !CONFIG_OLPC */
+
 static int get_fw(struct if_usb_card *cardp, const char *fwname)
 {
 	int i;
@@ -981,6 +1001,10 @@ static int get_fw(struct if_usb_card *cardp, const char *fwname)
 	if (fwname)
 		return request_firmware(&cardp->fw, fwname, &cardp->udev->dev);
 
+	/* Handle OLPC firmware */
+	if (try_olpc_fw(cardp) == 0)
+		return 0;
+
 	/* Otherwise search for firmware to use */
 	for (i = 0; i < ARRAY_SIZE(fw_table); i++) {
 		if (fw_table[i].model != cardp->model)
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] libertas: prioritize usb8388_v5.bin firmware on OLPC machines
  2011-07-31  7:03 [PATCH] libertas: prioritize usb8388_v5.bin firmware on OLPC machines Andres Salomon
@ 2011-07-31  7:05 ` Andres Salomon
  2011-07-31 12:59   ` Daniel Drake
  0 siblings, 1 reply; 7+ messages in thread
From: Andres Salomon @ 2011-07-31  7:05 UTC (permalink / raw)
  To: dcbw; +Cc: David Woodhouse, libertas-dev, dsd, cjb, linux-kernel

Note: I've not tested this out yet on an XO-1.  I'll do that after some
feedback regarding the matching linux-firmware pull request.  This
should address dsd's concern about changing the loading order of the
firmware.

On Sun, 31 Jul 2011
00:03:00 -0700 Andres Salomon <dilinger@queued.net> wrote:

> Normally, the v9 firmware will be loaded if it's available.  However,
> on OLPC XO-1 machines, the v5 firmware supports extra functionality.
> This makes the libertas driver attempt to load the v5 firmware first
> if the machine is an OLPC machine; if that fails (or it's not an OLPC
> machine), fall back to attempting to load the other firmwares.
> 
> Signed-off-by: Andres Salomon <dilinger@queued.net>
> ---
>  drivers/net/wireless/libertas/if_usb.c |   24
> ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0
> deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/if_usb.c
> b/drivers/net/wireless/libertas/if_usb.c index b5acc39..6a2e70e 100644
> --- a/drivers/net/wireless/libertas/if_usb.c
> +++ b/drivers/net/wireless/libertas/if_usb.c
> @@ -973,6 +973,26 @@ static const struct {
>  	{ MODEL_8682, "libertas/usb8682.bin" }
>  };
>  
> +#ifdef CONFIG_OLPC
> +
> +/* default OLPC firmware to try; index into fw_table above */
> +#define OLPC_FW 1
> +
> +static int try_olpc_fw(struct if_usb_card *cardp)
> +{
> +	int retval = -ENOENT;
> +
> +	/* try the OLPC firmware first; fall back to any others */
> +	if (machine_is_olpc())
> +		retval = request_firmware(&cardp->fw,
> +				fw_table[OLPC_FW].fwname,
> &cardp->udev->dev);
> +	return retval;
> +}
> +
> +#else
> +static int try_olpc_fw(struct if_usb_card *cardp) { return -ENOENT; }
> +#endif /* !CONFIG_OLPC */
> +
>  static int get_fw(struct if_usb_card *cardp, const char *fwname)
>  {
>  	int i;
> @@ -981,6 +1001,10 @@ static int get_fw(struct if_usb_card *cardp,
> const char *fwname) if (fwname)
>  		return request_firmware(&cardp->fw, fwname,
> &cardp->udev->dev); 
> +	/* Handle OLPC firmware */
> +	if (try_olpc_fw(cardp) == 0)
> +		return 0;
> +
>  	/* Otherwise search for firmware to use */
>  	for (i = 0; i < ARRAY_SIZE(fw_table); i++) {
>  		if (fw_table[i].model != cardp->model)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libertas: prioritize usb8388_v5.bin firmware on OLPC machines
  2011-07-31  7:05 ` Andres Salomon
@ 2011-07-31 12:59   ` Daniel Drake
  2011-08-01 17:17     ` Dan Williams
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Drake @ 2011-07-31 12:59 UTC (permalink / raw)
  To: Andres Salomon; +Cc: dcbw, David Woodhouse, libertas-dev, cjb, linux-kernel

On 31 July 2011 08:05, Andres Salomon <dilinger@queued.net> wrote:
> Note: I've not tested this out yet on an XO-1.  I'll do that after some
> feedback regarding the matching linux-firmware pull request.  This
> should address dsd's concern about changing the loading order of the
> firmware.

That indeed was a concern, but only until Dan Williams and Chris
pointed out that OLPC is the only usb8388 user. With that in mind, I
am in agreement with them that simply putting usb8388_olpc_v5.bin (or
whatever name is chosen) at the top of the firmware loading list is
the best option.

Daniel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libertas: prioritize usb8388_v5.bin firmware on OLPC machines
  2011-07-31 12:59   ` Daniel Drake
@ 2011-08-01 17:17     ` Dan Williams
  2011-08-01 18:25       ` Andres Salomon
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Williams @ 2011-08-01 17:17 UTC (permalink / raw)
  To: Daniel Drake
  Cc: Andres Salomon, cjb, David Woodhouse, linux-kernel, libertas-dev

On Sun, 2011-07-31 at 13:59 +0100, Daniel Drake wrote:
> On 31 July 2011 08:05, Andres Salomon <dilinger@queued.net> wrote:
> > Note: I've not tested this out yet on an XO-1.  I'll do that after some
> > feedback regarding the matching linux-firmware pull request.  This
> > should address dsd's concern about changing the loading order of the
> > firmware.
> 
> That indeed was a concern, but only until Dan Williams and Chris
> pointed out that OLPC is the only usb8388 user. With that in mind, I
> am in agreement with them that simply putting usb8388_olpc_v5.bin (or
> whatever name is chosen) at the top of the firmware loading list is
> the best option.

Yeah, patches for that would be immediately acked.

Dan


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libertas: prioritize usb8388_v5.bin firmware on OLPC machines
  2011-08-01 17:17     ` Dan Williams
@ 2011-08-01 18:25       ` Andres Salomon
  2011-08-01 21:20         ` Dan Williams
  0 siblings, 1 reply; 7+ messages in thread
From: Andres Salomon @ 2011-08-01 18:25 UTC (permalink / raw)
  To: Dan Williams
  Cc: Daniel Drake, cjb, David Woodhouse, linux-kernel, libertas-dev

On Mon, 01 Aug 2011 12:17:23 -0500
Dan Williams <dcbw@redhat.com> wrote:

> On Sun, 2011-07-31 at 13:59 +0100, Daniel Drake wrote:
> > On 31 July 2011 08:05, Andres Salomon <dilinger@queued.net> wrote:
> > > Note: I've not tested this out yet on an XO-1.  I'll do that
> > > after some feedback regarding the matching linux-firmware pull
> > > request.  This should address dsd's concern about changing the
> > > loading order of the firmware.
> > 
> > That indeed was a concern, but only until Dan Williams and Chris
> > pointed out that OLPC is the only usb8388 user. With that in mind, I
> > am in agreement with them that simply putting usb8388_olpc_v5.bin
> > (or whatever name is chosen) at the top of the firmware loading
> > list is the best option.
> 
> Yeah, patches for that would be immediately acked.
> 

What's your opinion on overwriting usb8388_v5.bin with OLPC's version,
versus having both a usb8388_v5.bin and a usb8388_olpc_v5.bin?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libertas: prioritize usb8388_v5.bin firmware on OLPC machines
  2011-08-01 18:25       ` Andres Salomon
@ 2011-08-01 21:20         ` Dan Williams
  2011-08-03  6:37           ` Andres Salomon
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Williams @ 2011-08-01 21:20 UTC (permalink / raw)
  To: Andres Salomon
  Cc: libertas-dev, cjb, David Woodhouse, Daniel Drake, linux-kernel

On Mon, 2011-08-01 at 11:25 -0700, Andres Salomon wrote:
> On Mon, 01 Aug 2011 12:17:23 -0500
> Dan Williams <dcbw@redhat.com> wrote:
> 
> > On Sun, 2011-07-31 at 13:59 +0100, Daniel Drake wrote:
> > > On 31 July 2011 08:05, Andres Salomon <dilinger@queued.net> wrote:
> > > > Note: I've not tested this out yet on an XO-1.  I'll do that
> > > > after some feedback regarding the matching linux-firmware pull
> > > > request.  This should address dsd's concern about changing the
> > > > loading order of the firmware.
> > > 
> > > That indeed was a concern, but only until Dan Williams and Chris
> > > pointed out that OLPC is the only usb8388 user. With that in mind, I
> > > am in agreement with them that simply putting usb8388_olpc_v5.bin
> > > (or whatever name is chosen) at the top of the firmware loading
> > > list is the best option.
> > 
> > Yeah, patches for that would be immediately acked.
> > 
> 
> What's your opinion on overwriting usb8388_v5.bin with OLPC's version,
> versus having both a usb8388_v5.bin and a usb8388_olpc_v5.bin?

I'd slightly prefer to keep them separate, but I don't really care that
much.  Whatever you'd like to do here is fine.

Dan



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libertas: prioritize usb8388_v5.bin firmware on OLPC machines
  2011-08-01 21:20         ` Dan Williams
@ 2011-08-03  6:37           ` Andres Salomon
  0 siblings, 0 replies; 7+ messages in thread
From: Andres Salomon @ 2011-08-03  6:37 UTC (permalink / raw)
  To: Dan Williams
  Cc: libertas-dev, cjb, David Woodhouse, Daniel Drake, linux-kernel

On Mon, 01 Aug 2011 16:20:07 -0500
Dan Williams <dcbw@redhat.com> wrote:

> On Mon, 2011-08-01 at 11:25 -0700, Andres Salomon wrote:
> > On Mon, 01 Aug 2011 12:17:23 -0500
> > Dan Williams <dcbw@redhat.com> wrote:
> > 
> > > On Sun, 2011-07-31 at 13:59 +0100, Daniel Drake wrote:
> > > > On 31 July 2011 08:05, Andres Salomon <dilinger@queued.net>
> > > > wrote:
> > > > > Note: I've not tested this out yet on an XO-1.  I'll do that
> > > > > after some feedback regarding the matching linux-firmware pull
> > > > > request.  This should address dsd's concern about changing the
> > > > > loading order of the firmware.
> > > > 
> > > > That indeed was a concern, but only until Dan Williams and Chris
> > > > pointed out that OLPC is the only usb8388 user. With that in
> > > > mind, I am in agreement with them that simply putting
> > > > usb8388_olpc_v5.bin (or whatever name is chosen) at the top of
> > > > the firmware loading list is the best option.
> > > 
> > > Yeah, patches for that would be immediately acked.
> > > 
> > 
> > What's your opinion on overwriting usb8388_v5.bin with OLPC's
> > version, versus having both a usb8388_v5.bin and a
> > usb8388_olpc_v5.bin?
> 
> I'd slightly prefer to keep them separate, but I don't really care
> that much.  Whatever you'd like to do here is fine.
> 

Alright, since people seem to prefer keeping it around, I'll redo the
pull request (and libertas patch) to do that.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-03  6:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-31  7:03 [PATCH] libertas: prioritize usb8388_v5.bin firmware on OLPC machines Andres Salomon
2011-07-31  7:05 ` Andres Salomon
2011-07-31 12:59   ` Daniel Drake
2011-08-01 17:17     ` Dan Williams
2011-08-01 18:25       ` Andres Salomon
2011-08-01 21:20         ` Dan Williams
2011-08-03  6:37           ` Andres Salomon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.