diff options
author | Michael Brown | 2013-05-01 18:20:39 +0200 |
---|---|---|
committer | Michael Brown | 2013-05-01 20:52:12 +0200 |
commit | 15d2f947f51a0ea72e9938f5648fd5133950ecdb (patch) | |
tree | f53d0e87063b2c2972c3602ad8962332b3756a72 /src/drivers/net/phantom | |
parent | [realtek] Defer packets when no transmit descriptors are available (diff) | |
download | ipxe-15d2f947f51a0ea72e9938f5648fd5133950ecdb.tar.gz ipxe-15d2f947f51a0ea72e9938f5648fd5133950ecdb.tar.xz ipxe-15d2f947f51a0ea72e9938f5648fd5133950ecdb.zip |
[settings] Eliminate settings "tag magic"
Create an explicit concept of "settings scope" and eliminate the magic
values used for numerical setting tags.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/phantom')
-rw-r--r-- | src/drivers/net/phantom/phantom.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/drivers/net/phantom/phantom.c b/src/drivers/net/phantom/phantom.c index 1c798e04..7f2fe0b6 100644 --- a/src/drivers/net/phantom/phantom.c +++ b/src/drivers/net/phantom/phantom.c @@ -1454,11 +1454,8 @@ static struct net_device_operations phantom_operations = { * */ -/** Phantom CLP settings tag magic */ -#define PHN_CLP_TAG_MAGIC 0xc19c1900UL - -/** Phantom CLP settings tag magic mask */ -#define PHN_CLP_TAG_MAGIC_MASK 0xffffff00UL +/** Phantom CLP settings scope */ +static struct settings_scope phantom_settings_scope; /** Phantom CLP data * @@ -1689,8 +1686,8 @@ phantom_clp_setting ( struct phantom_nic *phantom, struct setting *setting ) { } /* Allow for use of numbered settings */ - if ( ( setting->tag & PHN_CLP_TAG_MAGIC_MASK ) == PHN_CLP_TAG_MAGIC ) - return ( setting->tag & ~PHN_CLP_TAG_MAGIC_MASK ); + if ( setting->scope == &phantom_settings_scope ) + return setting->tag; DBGC2 ( phantom, "Phantom %p has no \"%s\" setting\n", phantom, setting->name ); @@ -2075,7 +2072,7 @@ static int phantom_probe ( struct pci_device *pci ) { assert ( phantom->port < PHN_MAX_NUM_PORTS ); settings_init ( &phantom->settings, &phantom_settings_operations, - &netdev->refcnt, PHN_CLP_TAG_MAGIC ); + &netdev->refcnt, &phantom_settings_scope ); /* Fix up PCI device */ adjust_pci_device ( pci ); |