diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-23 16:08:17 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-24 10:59:04 -0800 |
commit | c459302db655c1a7fd05fd4266b18990854e8386 (patch) | |
tree | 94adde79f8c3a5a447305cf425a5caa1c7091df7 /drivers/net/sfc/net_driver.h | |
parent | f5e7adc3d4aa8edab63bb63f0ce5fe92c3dd7604 (diff) |
sfc: Log interrupt and reset type names, not numbers
Define name tables for these enumerations in a similar way as for
loopback. Move the loopback name table together with them.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/net_driver.h')
-rw-r--r-- | drivers/net/sfc/net_driver.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index f2df32423c9..ac808d5f24a 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h @@ -394,8 +394,23 @@ enum efx_led_mode { EFX_LED_DEFAULT = 2 }; -#define STRING_TABLE_LOOKUP(val, member) \ - member ## _names[val] +#define STRING_TABLE_LOOKUP(val, member) \ + ((val) < member ## _max) ? member ## _names[val] : "(invalid)" + +extern const char *efx_loopback_mode_names[]; +extern const unsigned int efx_loopback_mode_max; +#define LOOPBACK_MODE(efx) \ + STRING_TABLE_LOOKUP((efx)->loopback_mode, efx_loopback_mode) + +extern const char *efx_interrupt_mode_names[]; +extern const unsigned int efx_interrupt_mode_max; +#define INT_MODE(efx) \ + STRING_TABLE_LOOKUP(efx->interrupt_mode, efx_interrupt_mode) + +extern const char *efx_reset_type_names[]; +extern const unsigned int efx_reset_type_max; +#define RESET_TYPE(type) \ + STRING_TABLE_LOOKUP(type, efx_reset_type) enum efx_int_mode { /* Be careful if altering to correct macro below */ |