Lines Matching refs:fwe
1273 static int at76_load_external_fw(struct usb_device *udev, struct fwentry *fwe)
1280 u8 *buf = fwe->extfw;
1281 int size = fwe->extfw_size;
1320 if (at76_is_505a(fwe->board_type)) {
1334 static int at76_load_internal_fw(struct usb_device *udev, struct fwentry *fwe)
1337 int need_remap = !at76_is_505a(fwe->board_type);
1339 ret = at76_usbdfu_download(udev, fwe->intfw, fwe->intfw_size,
1579 struct fwentry *fwe = &firmwares[board_type];
1583 if (fwe->loaded) {
1588 at76_dbg(DBG_FW, "downloading firmware %s", fwe->fwname);
1589 ret = request_firmware(&fwe->fw, fwe->fwname, &udev->dev);
1592 fwe->fwname);
1600 fwh = (struct at76_fw_header *)(fwe->fw->data);
1602 if (fwe->fw->size <= sizeof(*fwh)) {
1604 "firmware is too short (0x%zx)\n", fwe->fw->size);
1609 fwe->board_type = le32_to_cpu(fwh->board_type);
1610 if (fwe->board_type != board_type) {
1613 board_type, fwe->board_type);
1617 fwe->fw_version.major = fwh->major;
1618 fwe->fw_version.minor = fwh->minor;
1619 fwe->fw_version.patch = fwh->patch;
1620 fwe->fw_version.build = fwh->build;
1623 fwe->intfw = (u8 *)fwh + le32_to_cpu(fwh->int_fw_offset);
1624 fwe->intfw_size = le32_to_cpu(fwh->int_fw_len);
1625 fwe->extfw = (u8 *)fwh + le32_to_cpu(fwh->ext_fw_offset);
1626 fwe->extfw_size = le32_to_cpu(fwh->ext_fw_len);
1628 fwe->loaded = 1;
1632 fwe->fwname, fwh->major, fwh->minor, fwh->patch, fwh->build);
1642 if (fwe->loaded)
1643 return fwe;
2354 struct fwentry *fwe;
2364 fwe = at76_load_firmware(udev, board_type);
2365 if (!fwe) {
2389 ret = at76_load_internal_fw(udev, fwe);
2408 if ((fwe->fw_version.major > 0 || fwe->fw_version.minor >= 100)
2421 ret = at76_load_external_fw(udev, fwe);