Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171206
b: refs/heads/master
c: 32742e6
h: refs/heads/master
v: v3
  • Loading branch information
Inaky Perez-Gonzalez committed Oct 19, 2009
1 parent 2947b2e commit 20db356
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 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: 59bdc4be0b819173a8f840fc11ccb82d6f2ca64b
refs/heads/master: 32742e6158657f19ad31653705bef56d983508e7
35 changes: 21 additions & 14 deletions trunk/drivers/net/wimax/i2400m/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,17 @@ ssize_t i2400m_dnload_bcf(struct i2400m *i2400m,
}


/*
* Indicate if the device emitted a reboot barker that indicates
* "signed boot"
*/
static
unsigned i2400m_boot_is_signed(struct i2400m *i2400m)
{
return likely(i2400m->sboot);
}


/*
* Do the final steps of uploading firmware
*
Expand All @@ -529,7 +540,7 @@ int i2400m_dnload_finalize(struct i2400m *i2400m,

d_fnstart(3, dev, "offset %zu\n", offset);
cmd = (void *) bcf + offset;
if (i2400m->sboot == 0) {
if (i2400m_boot_is_signed(i2400m) == 0) {
struct i2400m_bootrom_header jump_ack;
d_printf(1, dev, "unsecure boot, jumping to 0x%08x\n",
le32_to_cpu(cmd->target_addr));
Expand Down Expand Up @@ -846,28 +857,24 @@ int i2400m_dnload_init(struct i2400m *i2400m, const struct i2400m_bcf_hdr *bcf)
{
int result;
struct device *dev = i2400m_dev(i2400m);
u32 module_id = le32_to_cpu(bcf->module_id);

if (i2400m->sboot == 0
&& (module_id & I2400M_BCF_MOD_ID_POKES) == 0) {
/* non-signed boot process without pokes */
result = i2400m_dnload_init_nonsigned(i2400m);
if (i2400m_boot_is_signed(i2400m)) {
d_printf(1, dev, "signed boot\n");
result = i2400m_dnload_init_signed(i2400m, bcf);
if (result == -ERESTARTSYS)
return result;
if (result < 0)
dev_err(dev, "fw %s: non-signed download "
dev_err(dev, "firmware %s: signed boot download "
"initialization failed: %d\n",
i2400m->fw_name, result);
} else if (i2400m->sboot == 0
&& (module_id & I2400M_BCF_MOD_ID_POKES)) {
/* non-signed boot process with pokes, nothing to do */
result = 0;
} else { /* signed boot process */
result = i2400m_dnload_init_signed(i2400m, bcf);
} else {
/* non-signed boot process without pokes */
d_printf(1, dev, "non-signed boot\n");
result = i2400m_dnload_init_nonsigned(i2400m);
if (result == -ERESTARTSYS)
return result;
if (result < 0)
dev_err(dev, "fw %s: signed boot download "
dev_err(dev, "firmware %s: non-signed download "
"initialization failed: %d\n",
i2400m->fw_name, result);
}
Expand Down
10 changes: 0 additions & 10 deletions trunk/include/linux/wimax/i2400m.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,6 @@ enum i2400m_brh {
};


/* Constants for bcf->module_id */
enum i2400m_bcf_mod_id {
/* Firmware file carries its own pokes -- pokes are a set of
* magical values that have to be written in certain memory
* addresses to get the device up and ready for firmware
* download when it is in non-signed boot mode. */
I2400M_BCF_MOD_ID_POKES = 0x000000001,
};


/**
* i2400m_bootrom_header - Header for a boot-mode command
*
Expand Down

0 comments on commit 20db356

Please sign in to comment.