Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315507
b: refs/heads/master
c: 8b0d2f9
h: refs/heads/master
i:
  315505: f84ca4e
  315503: dbbf622
v: v3
  • Loading branch information
Bjørn Mork authored and David S. Miller committed Jul 19, 2012
1 parent 9e7fd02 commit ac7ab4f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 215029375c833a0b22acade0efb582ffd20836ce
refs/heads/master: 8b0d2f9ed3d8e92feada7c5d70fa85be46e6f948
40 changes: 31 additions & 9 deletions trunk/drivers/net/ethernet/intel/e100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,20 +1249,35 @@ static const struct firmware *e100_request_firmware(struct nic *nic)
const struct firmware *fw = nic->fw;
u8 timer, bundle, min_size;
int err = 0;
bool required = false;

/* do not load u-code for ICH devices */
if (nic->flags & ich)
return NULL;

/* Search for ucode match against h/w revision */
if (nic->mac == mac_82559_D101M)
/* Search for ucode match against h/w revision
*
* Based on comments in the source code for the FreeBSD fxp
* driver, the FIRMWARE_D102E ucode includes both CPUSaver and
*
* "fixes for bugs in the B-step hardware (specifically, bugs
* with Inline Receive)."
*
* So we must fail if it cannot be loaded.
*
* The other microcode files are only required for the optional
* CPUSaver feature. Nice to have, but no reason to fail.
*/
if (nic->mac == mac_82559_D101M) {
fw_name = FIRMWARE_D101M;
else if (nic->mac == mac_82559_D101S)
} else if (nic->mac == mac_82559_D101S) {
fw_name = FIRMWARE_D101S;
else if (nic->mac == mac_82551_F || nic->mac == mac_82551_10)
} else if (nic->mac == mac_82551_F || nic->mac == mac_82551_10) {
fw_name = FIRMWARE_D102E;
else /* No ucode on other devices */
required = true;
} else { /* No ucode on other devices */
return NULL;
}

/* If the firmware has not previously been loaded, request a pointer
* to it. If it was previously loaded, we are reinitializing the
Expand All @@ -1273,10 +1288,17 @@ static const struct firmware *e100_request_firmware(struct nic *nic)
err = request_firmware(&fw, fw_name, &nic->pdev->dev);

if (err) {
netif_err(nic, probe, nic->netdev,
"Failed to load firmware \"%s\": %d\n",
fw_name, err);
return ERR_PTR(err);
if (required) {
netif_err(nic, probe, nic->netdev,
"Failed to load firmware \"%s\": %d\n",
fw_name, err);
return ERR_PTR(err);
} else {
netif_info(nic, probe, nic->netdev,
"CPUSaver disabled. Needs \"%s\": %d\n",
fw_name, err);
return NULL;
}
}

/* Firmware should be precisely UCODE_SIZE (words) plus three bytes
Expand Down

0 comments on commit ac7ab4f

Please sign in to comment.