diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-09-17 21:33:56 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2013-08-21 14:43:27 -0400 |
commit | f3ad50034425692965a0f2becdd9c45ecb45cd66 (patch) | |
tree | 0ada5470ce0cc43c1589ebd619bba22716b4844f /drivers/net/ethernet/sfc/net_driver.h | |
parent | f073dde03b3e8d11050d82f52caaf75fd924e069 (diff) |
sfc: Make MCDI independent of Siena
Move the lowest layer (transport) of the current MCDI code to
per-NIC-type operations.
Introduce a new structure and efx_nic member for MCDI-specific data.
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.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index bdded38cbf12..fb9361f384de 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h | |||
@@ -718,6 +718,7 @@ struct vfdi_status; | |||
718 | * @selftest_work: Work item for asynchronous self-test | 718 | * @selftest_work: Work item for asynchronous self-test |
719 | * @mtd_list: List of MTDs attached to the NIC | 719 | * @mtd_list: List of MTDs attached to the NIC |
720 | * @nic_data: Hardware dependent state | 720 | * @nic_data: Hardware dependent state |
721 | * @mcdi: Management-Controller-to-Driver Interface state | ||
721 | * @mac_lock: MAC access lock. Protects @port_enabled, @phy_mode, | 722 | * @mac_lock: MAC access lock. Protects @port_enabled, @phy_mode, |
722 | * efx_monitor() and efx_reconfigure_port() | 723 | * efx_monitor() and efx_reconfigure_port() |
723 | * @port_enabled: Port enabled indicator. | 724 | * @port_enabled: Port enabled indicator. |
@@ -847,6 +848,7 @@ struct efx_nic { | |||
847 | #endif | 848 | #endif |
848 | 849 | ||
849 | void *nic_data; | 850 | void *nic_data; |
851 | struct efx_mcdi_data *mcdi; | ||
850 | 852 | ||
851 | struct mutex mac_lock; | 853 | struct mutex mac_lock; |
852 | struct work_struct mac_work; | 854 | struct work_struct mac_work; |
@@ -956,6 +958,17 @@ static inline unsigned int efx_port_num(struct efx_nic *efx) | |||
956 | * @test_chip: Test registers. Should use efx_nic_test_registers(), and is | 958 | * @test_chip: Test registers. Should use efx_nic_test_registers(), and is |
957 | * expected to reset the NIC. | 959 | * expected to reset the NIC. |
958 | * @test_nvram: Test validity of NVRAM contents | 960 | * @test_nvram: Test validity of NVRAM contents |
961 | * @mcdi_request: Send an MCDI request with the given header and SDU. | ||
962 | * The SDU length may be any value from 0 up to the protocol- | ||
963 | * defined maximum, but its buffer will be padded to a multiple | ||
964 | * of 4 bytes. | ||
965 | * @mcdi_poll_response: Test whether an MCDI response is available. | ||
966 | * @mcdi_read_response: Read the MCDI response PDU. The offset will | ||
967 | * be a multiple of 4. The length may not be, but the buffer | ||
968 | * will be padded so it is safe to round up. | ||
969 | * @mcdi_poll_reboot: Test whether the MCDI has rebooted. If so, | ||
970 | * return an appropriate error code for aborting any current | ||
971 | * request; otherwise return 0. | ||
959 | * @revision: Hardware architecture revision | 972 | * @revision: Hardware architecture revision |
960 | * @mem_map_size: Memory BAR mapped size | 973 | * @mem_map_size: Memory BAR mapped size |
961 | * @txd_ptr_tbl_base: TX descriptor ring base address | 974 | * @txd_ptr_tbl_base: TX descriptor ring base address |
@@ -1004,6 +1017,13 @@ struct efx_nic_type { | |||
1004 | void (*resume_wol)(struct efx_nic *efx); | 1017 | void (*resume_wol)(struct efx_nic *efx); |
1005 | int (*test_chip)(struct efx_nic *efx, struct efx_self_tests *tests); | 1018 | int (*test_chip)(struct efx_nic *efx, struct efx_self_tests *tests); |
1006 | int (*test_nvram)(struct efx_nic *efx); | 1019 | int (*test_nvram)(struct efx_nic *efx); |
1020 | void (*mcdi_request)(struct efx_nic *efx, | ||
1021 | const efx_dword_t *hdr, size_t hdr_len, | ||
1022 | const efx_dword_t *sdu, size_t sdu_len); | ||
1023 | bool (*mcdi_poll_response)(struct efx_nic *efx); | ||
1024 | void (*mcdi_read_response)(struct efx_nic *efx, efx_dword_t *pdu, | ||
1025 | size_t pdu_offset, size_t pdu_len); | ||
1026 | int (*mcdi_poll_reboot)(struct efx_nic *efx); | ||
1007 | 1027 | ||
1008 | int revision; | 1028 | int revision; |
1009 | unsigned int mem_map_size; | 1029 | unsigned int mem_map_size; |