diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-29 10:08:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 20:23:53 -0500 |
commit | c1c4f453b61463df4df16f7aa5782fc0cfe05b9e (patch) | |
tree | a72b533294500e7f19ab1f67142b732471df53cb /drivers/net/sfc/net_driver.h | |
parent | e58f69f4082f60076885798fae8f3a17ea713bf6 (diff) |
sfc: Remove static PHY data and enumerations
New NICs have firmware managing the PHY, and we will discover the PHY
capabilities at run-time. Replace the static data with probe() and
test_name() operations.
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 | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index cd2debb0a552..452f83510b0d 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -428,19 +428,6 @@ enum efx_int_mode { | |||
428 | }; | 428 | }; |
429 | #define EFX_INT_MODE_USE_MSI(x) (((x)->interrupt_mode) <= EFX_INT_MODE_MSI) | 429 | #define EFX_INT_MODE_USE_MSI(x) (((x)->interrupt_mode) <= EFX_INT_MODE_MSI) |
430 | 430 | ||
431 | enum phy_type { | ||
432 | PHY_TYPE_NONE = 0, | ||
433 | PHY_TYPE_TXC43128 = 1, | ||
434 | PHY_TYPE_88E1111 = 2, | ||
435 | PHY_TYPE_SFX7101 = 3, | ||
436 | PHY_TYPE_QT2022C2 = 4, | ||
437 | PHY_TYPE_PM8358 = 6, | ||
438 | PHY_TYPE_SFT9001A = 8, | ||
439 | PHY_TYPE_QT2025C = 9, | ||
440 | PHY_TYPE_SFT9001B = 10, | ||
441 | PHY_TYPE_MAX /* Insert any new items before this */ | ||
442 | }; | ||
443 | |||
444 | #define EFX_IS10G(efx) ((efx)->link_state.speed == 10000) | 431 | #define EFX_IS10G(efx) ((efx)->link_state.speed == 10000) |
445 | 432 | ||
446 | enum nic_state { | 433 | enum nic_state { |
@@ -483,12 +470,6 @@ enum efx_fc_type { | |||
483 | EFX_FC_AUTO = 4, | 470 | EFX_FC_AUTO = 4, |
484 | }; | 471 | }; |
485 | 472 | ||
486 | /* Supported MAC bit-mask */ | ||
487 | enum efx_mac_type { | ||
488 | EFX_GMAC = 1, | ||
489 | EFX_XMAC = 2, | ||
490 | }; | ||
491 | |||
492 | /** | 473 | /** |
493 | * struct efx_link_state - Current state of the link | 474 | * struct efx_link_state - Current state of the link |
494 | * @up: Link is up | 475 | * @up: Link is up |
@@ -524,6 +505,8 @@ struct efx_mac_operations { | |||
524 | 505 | ||
525 | /** | 506 | /** |
526 | * struct efx_phy_operations - Efx PHY operations table | 507 | * struct efx_phy_operations - Efx PHY operations table |
508 | * @probe: Probe PHY and initialise efx->mdio.mode_support, efx->mdio.mmds, | ||
509 | * efx->loopback_modes. | ||
527 | * @init: Initialise PHY | 510 | * @init: Initialise PHY |
528 | * @fini: Shut down PHY | 511 | * @fini: Shut down PHY |
529 | * @reconfigure: Reconfigure PHY (e.g. for new link parameters) | 512 | * @reconfigure: Reconfigure PHY (e.g. for new link parameters) |
@@ -533,15 +516,12 @@ struct efx_mac_operations { | |||
533 | * @set_settings: Set ethtool settings. Serialised by the mac_lock. | 516 | * @set_settings: Set ethtool settings. Serialised by the mac_lock. |
534 | * @set_npage_adv: Set abilities advertised in (Extended) Next Page | 517 | * @set_npage_adv: Set abilities advertised in (Extended) Next Page |
535 | * (only needed where AN bit is set in mmds) | 518 | * (only needed where AN bit is set in mmds) |
536 | * @num_tests: Number of PHY-specific tests/results | 519 | * @test_name: Get the name of a PHY-specific test/result |
537 | * @test_names: Names of the tests/results | ||
538 | * @run_tests: Run tests and record results as appropriate. | 520 | * @run_tests: Run tests and record results as appropriate. |
539 | * Flags are the ethtool tests flags. | 521 | * Flags are the ethtool tests flags. |
540 | * @mmds: MMD presence mask | ||
541 | * @loopbacks: Supported loopback modes mask | ||
542 | */ | 522 | */ |
543 | struct efx_phy_operations { | 523 | struct efx_phy_operations { |
544 | enum efx_mac_type macs; | 524 | int (*probe) (struct efx_nic *efx); |
545 | int (*init) (struct efx_nic *efx); | 525 | int (*init) (struct efx_nic *efx); |
546 | void (*fini) (struct efx_nic *efx); | 526 | void (*fini) (struct efx_nic *efx); |
547 | int (*reconfigure) (struct efx_nic *efx); | 527 | int (*reconfigure) (struct efx_nic *efx); |
@@ -551,11 +531,8 @@ struct efx_phy_operations { | |||
551 | int (*set_settings) (struct efx_nic *efx, | 531 | int (*set_settings) (struct efx_nic *efx, |
552 | struct ethtool_cmd *ecmd); | 532 | struct ethtool_cmd *ecmd); |
553 | void (*set_npage_adv) (struct efx_nic *efx, u32); | 533 | void (*set_npage_adv) (struct efx_nic *efx, u32); |
554 | u32 num_tests; | 534 | const char *(*test_name) (struct efx_nic *efx, unsigned int index); |
555 | const char *const *test_names; | ||
556 | int (*run_tests) (struct efx_nic *efx, int *results, unsigned flags); | 535 | int (*run_tests) (struct efx_nic *efx, int *results, unsigned flags); |
557 | int mmds; | ||
558 | unsigned loopbacks; | ||
559 | }; | 536 | }; |
560 | 537 | ||
561 | /** | 538 | /** |
@@ -806,7 +783,7 @@ struct efx_nic { | |||
806 | struct efx_mac_operations *mac_op; | 783 | struct efx_mac_operations *mac_op; |
807 | unsigned char mac_address[ETH_ALEN]; | 784 | unsigned char mac_address[ETH_ALEN]; |
808 | 785 | ||
809 | enum phy_type phy_type; | 786 | unsigned int phy_type; |
810 | struct mutex mdio_lock; | 787 | struct mutex mdio_lock; |
811 | struct efx_phy_operations *phy_op; | 788 | struct efx_phy_operations *phy_op; |
812 | void *phy_data; | 789 | void *phy_data; |