Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266049
b: refs/heads/master
c: 55768fa
h: refs/heads/master
i:
  266047: e3db1ea
v: v3
  • Loading branch information
Andres Salomon authored and John W. Linville committed Sep 14, 2011
1 parent 0f42c93 commit 389ba7f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd235913f9d86fde954f7e1215bd0921ee70cb19
refs/heads/master: 55768fa6d9462c18c1ce3c862db3bf55bac3b1c7
21 changes: 21 additions & 0 deletions trunk/drivers/net/wireless/libertas/if_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,23 @@ static const struct {
{ MODEL_8682, "libertas/usb8682.bin" }
};

#ifdef CONFIG_OLPC

static int try_olpc_fw(struct if_usb_card *cardp)
{
int retval = -ENOENT;

/* try the OLPC firmware first; fall back to fw_table list */
if (machine_is_olpc() && cardp->model == MODEL_8388)
retval = request_firmware(&cardp->fw,
"libertas/usb8388_olpc.bin", &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;
Expand All @@ -981,6 +998,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)
Expand Down

0 comments on commit 389ba7f

Please sign in to comment.