aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/net_driver.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-09-02 19:15:00 -0400
committerBen Hutchings <bhutchings@solarflare.com>2012-01-26 19:10:46 -0500
commit710b208dc2687fdb3370110d54a67fb2288835eb (patch)
treeb6a403a44f7832a469e31f91121e3eb2cff78c68 /drivers/net/ethernet/sfc/net_driver.h
parent1cb345220f135dcca24f01cc04cbb97a8242d419 (diff)
sfc: Merge efx_mac_operations into efx_nic_type
No NICs need to switch efx_mac_operations at run-time, and the MAC operations are fairly closely bound to NIC types. Move efx_mac_operations::reconfigure to efx_nic_type::reconfigure_mac and efx_mac_operations::check_fault fo efx_nic_type::check_mac_fault. Change callers to call through efx->type or directly if the NIC type is known. Remove efx_mac_operations::update_stats. The implementations for Falcon used to fetch MAC statistics synchronously and this was used by efx_register_netdev() to clear statistics after running self-tests. However, it now only converts statistics that have already been fetched (and that only for Falcon), and the call from efx_register_netdev() has no effect. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/net_driver.h')
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index b6040141ef79..aa5a321a1419 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -474,18 +474,6 @@ static inline bool efx_link_state_equal(const struct efx_link_state *left,
474} 474}
475 475
476/** 476/**
477 * struct efx_mac_operations - Efx MAC operations table
478 * @reconfigure: Reconfigure MAC. Serialised by the mac_lock
479 * @update_stats: Update statistics
480 * @check_fault: Check fault state. True if fault present.
481 */
482struct efx_mac_operations {
483 int (*reconfigure) (struct efx_nic *efx);
484 void (*update_stats) (struct efx_nic *efx);
485 bool (*check_fault)(struct efx_nic *efx);
486};
487
488/**
489 * struct efx_phy_operations - Efx PHY operations table 477 * struct efx_phy_operations - Efx PHY operations table
490 * @probe: Probe PHY and initialise efx->mdio.mode_support, efx->mdio.mmds, 478 * @probe: Probe PHY and initialise efx->mdio.mode_support, efx->mdio.mmds,
491 * efx->loopback_modes. 479 * efx->loopback_modes.
@@ -676,7 +664,6 @@ struct efx_filter_state;
676 * @port_initialized: Port initialized? 664 * @port_initialized: Port initialized?
677 * @net_dev: Operating system network device. Consider holding the rtnl lock 665 * @net_dev: Operating system network device. Consider holding the rtnl lock
678 * @stats_buffer: DMA buffer for statistics 666 * @stats_buffer: DMA buffer for statistics
679 * @mac_op: MAC interface
680 * @phy_type: PHY type 667 * @phy_type: PHY type
681 * @phy_op: PHY interface 668 * @phy_op: PHY interface
682 * @phy_data: PHY private data (including PHY-specific stats) 669 * @phy_data: PHY private data (including PHY-specific stats)
@@ -767,8 +754,6 @@ struct efx_nic {
767 754
768 struct efx_buffer stats_buffer; 755 struct efx_buffer stats_buffer;
769 756
770 const struct efx_mac_operations *mac_op;
771
772 unsigned int phy_type; 757 unsigned int phy_type;
773 const struct efx_phy_operations *phy_op; 758 const struct efx_phy_operations *phy_op;
774 void *phy_data; 759 void *phy_data;
@@ -843,12 +828,13 @@ static inline unsigned int efx_port_num(struct efx_nic *efx)
843 * @push_irq_moderation: Apply interrupt moderation value 828 * @push_irq_moderation: Apply interrupt moderation value
844 * @push_multicast_hash: Apply multicast hash table 829 * @push_multicast_hash: Apply multicast hash table
845 * @reconfigure_port: Push loopback/power/txdis changes to the MAC and PHY 830 * @reconfigure_port: Push loopback/power/txdis changes to the MAC and PHY
831 * @reconfigure_mac: Reconfigure MAC only. Serialised by the mac_lock
832 * @check_mac_fault: Check MAC fault state. True if fault present.
846 * @get_wol: Get WoL configuration from driver state 833 * @get_wol: Get WoL configuration from driver state
847 * @set_wol: Push WoL configuration to the NIC 834 * @set_wol: Push WoL configuration to the NIC
848 * @resume_wol: Synchronise WoL state between driver and MC (e.g. after resume) 835 * @resume_wol: Synchronise WoL state between driver and MC (e.g. after resume)
849 * @test_registers: Test read/write functionality of control registers 836 * @test_registers: Test read/write functionality of control registers
850 * @test_nvram: Test validity of NVRAM contents 837 * @test_nvram: Test validity of NVRAM contents
851 * @default_mac_ops: efx_mac_operations to set at startup
852 * @revision: Hardware architecture revision 838 * @revision: Hardware architecture revision
853 * @mem_map_size: Memory BAR mapped size 839 * @mem_map_size: Memory BAR mapped size
854 * @txd_ptr_tbl_base: TX descriptor ring base address 840 * @txd_ptr_tbl_base: TX descriptor ring base address
@@ -888,12 +874,13 @@ struct efx_nic_type {
888 void (*push_irq_moderation)(struct efx_channel *channel); 874 void (*push_irq_moderation)(struct efx_channel *channel);
889 void (*push_multicast_hash)(struct efx_nic *efx); 875 void (*push_multicast_hash)(struct efx_nic *efx);
890 int (*reconfigure_port)(struct efx_nic *efx); 876 int (*reconfigure_port)(struct efx_nic *efx);
877 int (*reconfigure_mac)(struct efx_nic *efx);
878 bool (*check_mac_fault)(struct efx_nic *efx);
891 void (*get_wol)(struct efx_nic *efx, struct ethtool_wolinfo *wol); 879 void (*get_wol)(struct efx_nic *efx, struct ethtool_wolinfo *wol);
892 int (*set_wol)(struct efx_nic *efx, u32 type); 880 int (*set_wol)(struct efx_nic *efx, u32 type);
893 void (*resume_wol)(struct efx_nic *efx); 881 void (*resume_wol)(struct efx_nic *efx);
894 int (*test_registers)(struct efx_nic *efx); 882 int (*test_registers)(struct efx_nic *efx);
895 int (*test_nvram)(struct efx_nic *efx); 883 int (*test_nvram)(struct efx_nic *efx);
896 const struct efx_mac_operations *default_mac_ops;
897 884
898 int revision; 885 int revision;
899 unsigned int mem_map_size; 886 unsigned int mem_map_size;