Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172012
b: refs/heads/master
c: 0aa3fba
h: refs/heads/master
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Nov 30, 2009
1 parent 214876c commit 6d8f1fb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 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: 9bfc4bb1f9b5863b177752b88e8bfa364e83a4fa
refs/heads/master: 0aa3fbaa3f2d29a14231ebb0c8e521c23701d41f
10 changes: 9 additions & 1 deletion trunk/drivers/net/sfc/falcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,8 @@ static void falcon_remove_port(struct efx_nic *efx)
*
**************************************************************************/

int falcon_read_nvram(struct efx_nic *efx, struct falcon_nvconfig *nvconfig_out)
static int
falcon_read_nvram(struct efx_nic *efx, struct falcon_nvconfig *nvconfig_out)
{
struct falcon_nvconfig *nvconfig;
struct efx_spi_device *spi;
Expand Down Expand Up @@ -2408,6 +2409,11 @@ int falcon_read_nvram(struct efx_nic *efx, struct falcon_nvconfig *nvconfig_out)
return rc;
}

static int falcon_test_nvram(struct efx_nic *efx)
{
return falcon_read_nvram(efx, NULL);
}

/* Registers tested in the falcon register test */
static struct {
unsigned address;
Expand Down Expand Up @@ -3290,6 +3296,7 @@ struct efx_nic_type falcon_a1_nic_type = {
.get_wol = falcon_get_wol,
.set_wol = falcon_set_wol,
.resume_wol = efx_port_dummy_op_void,
.test_nvram = falcon_test_nvram,
.default_mac_ops = &falcon_xmac_operations,

.revision = EFX_REV_FALCON_A1,
Expand Down Expand Up @@ -3328,6 +3335,7 @@ struct efx_nic_type falcon_b0_nic_type = {
.set_wol = falcon_set_wol,
.resume_wol = efx_port_dummy_op_void,
.test_registers = falcon_b0_test_registers,
.test_nvram = falcon_test_nvram,
.default_mac_ops = &falcon_xmac_operations,

.revision = EFX_REV_FALCON_B0,
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/net/sfc/falcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ extern void falcon_stop_nic_stats(struct efx_nic *efx);
extern int falcon_reset_xaui(struct efx_nic *efx);

/* Tests */
struct falcon_nvconfig;
extern int falcon_read_nvram(struct efx_nic *efx,
struct falcon_nvconfig *nvconfig);

/**************************************************************************
*
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/sfc/net_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ static inline const char *efx_dev_name(struct efx_nic *efx)
* @set_wol: Push WoL configuration to the NIC
* @resume_wol: Synchronise WoL state between driver and MC (e.g. after resume)
* @test_registers: Test read/write functionality of control registers
* @test_nvram: Test validity of NVRAM contents
* @default_mac_ops: efx_mac_operations to set at startup
* @revision: Hardware architecture revision
* @mem_map_size: Memory BAR mapped size
Expand Down Expand Up @@ -904,6 +905,7 @@ struct efx_nic_type {
int (*set_wol)(struct efx_nic *efx, u32 type);
void (*resume_wol)(struct efx_nic *efx);
int (*test_registers)(struct efx_nic *efx);
int (*test_nvram)(struct efx_nic *efx);
struct efx_mac_operations *default_mac_ops;

int revision;
Expand Down
9 changes: 6 additions & 3 deletions trunk/drivers/net/sfc/selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,13 @@ static int efx_test_mdio(struct efx_nic *efx, struct efx_self_tests *tests)

static int efx_test_nvram(struct efx_nic *efx, struct efx_self_tests *tests)
{
int rc;
int rc = 0;

if (efx->type->test_nvram) {
rc = efx->type->test_nvram(efx);
tests->nvram = rc ? -1 : 1;
}

rc = falcon_read_nvram(efx, NULL);
tests->nvram = rc ? -1 : 1;
return rc;
}

Expand Down

0 comments on commit 6d8f1fb

Please sign in to comment.