summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/myri10ge.c
diff options
context:
space:
mode:
authorMichael Brown2010-11-30 02:10:38 +0100
committerMichael Brown2011-01-11 22:24:40 +0100
commit1651d4f6d7f764ff5bfafc12bd058a88e49b0ff5 (patch)
treea2ea4008bbe1d2398017e1bdd96e7e7cbc20d1e1 /src/drivers/net/myri10ge.c
parent[nvs] Allow for non-volatile storage devices without block boundaries (diff)
downloadipxe-1651d4f6d7f764ff5bfafc12bd058a88e49b0ff5.tar.gz
ipxe-1651d4f6d7f764ff5bfafc12bd058a88e49b0ff5.tar.xz
ipxe-1651d4f6d7f764ff5bfafc12bd058a88e49b0ff5.zip
[nvo] Remove the non-volatile options fragment list
Since its implementation several years ago, no driver has used a fragment list containing more than a single fragment. Simplify the NVO core and the drivers that use it by removing the whole concept of the fragment list, and using a simple (address,length) pair instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/myri10ge.c')
-rw-r--r--src/drivers/net/myri10ge.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/drivers/net/myri10ge.c b/src/drivers/net/myri10ge.c
index cea2758f..bc730ea9 100644
--- a/src/drivers/net/myri10ge.c
+++ b/src/drivers/net/myri10ge.c
@@ -183,8 +183,8 @@ struct myri10ge_private
*/
struct nvs_device nvs;
- struct nvo_fragment nvo_fragment[2];
struct nvo_block nvo;
+ unsigned int nvo_registered;
/* Cached PCI capability locations. */
@@ -727,28 +727,20 @@ static int myri10ge_nv_init ( struct myri10ge_private *priv )
priv->nvs.read = myri10ge_nvs_read;
priv->nvs.write = myri10ge_nvs_write;
- /* Build the NonVolatile storage fragment list. We would like
- to use the whole last EEPROM block for this, but we must
- reduce the block size lest malloc fail in
- src/core/nvo.o. */
-
- priv->nvo_fragment[0].address = nvo_fragment_pos;
- priv->nvo_fragment[0].len = 0x200;
-
/* Register the NonVolatile Options storage. */
nvo_init ( &priv->nvo,
&priv->nvs,
- priv->nvo_fragment,
+ nvo_fragment_pos, 0x200,
& myri10ge_netdev (priv) -> refcnt );
rc = register_nvo ( &priv->nvo,
netdev_settings ( myri10ge_netdev ( priv ) ) );
if ( rc ) {
DBG ("register_nvo failed");
- priv->nvo_fragment[0].len = 0;
return rc;
}
+ priv->nvo_registered = 1;
DBG2 ( "NVO supported\n" );
return 0;
}
@@ -758,7 +750,7 @@ myri10ge_nv_fini ( struct myri10ge_private *priv )
{
/* Simply return if nonvolatile access is not supported. */
- if ( 0 == priv->nvo_fragment[0].len )
+ if ( 0 == priv->nvo_registered )
return;
unregister_nvo ( &priv->nvo );