libertas: prioritize usb8388_olpc.bin firmware on OLPC machines
PATCH v2 1/1 libertas: prioritize usb8388_olpc.bin firmware on OLPC machines
Normally, the v9 firmware will be loaded if it's available. However, on OLPC XO-1 machines, the olpc-specific firmware supports extra functionality. This makes the libertas driver attempt to load the custom 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.
--- drivers/net/wireless/libertas/if_usb.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-)
drivers/net/wireless/libertas/if_usb.c +21 -0
@@ -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,"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;
@@ -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)
Signature · 1 line
1.7.2.5
Quoted 7 lines · Andres Salomon
Normally, the v9 firmware will be loaded if it's available. However, on OLPC XO-1 machines, the olpc-specific firmware supports extra functionality. This makes the libertas driver attempt to load the custom 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 <[email protected]>
works for me...
Quoted 43 lines
--- drivers/net/wireless/libertas/if_usb.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-)drivers/net/wireless/libertas/if_usb.c +21
-0@@ -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,"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;@@ -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)