diff options
author | Saeed Mahameed <saeedm@mellanox.com> | 2014-10-27 05:37:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-28 17:17:59 -0400 |
commit | 32a173c7f9e9ec2b87142f67e1478cd20084a45b (patch) | |
tree | 3464627af9e7001470aff187ecc9155ccf2e18a9 /include/linux/mlx4 | |
parent | 941d8ebcf773fd5da5c79e1c86e1afaae7032a0b (diff) |
net/mlx4_core: Introduce mlx4_get_module_info for cable module info reading
Added new MAD_IFC command to read cable module info with attribute id (0xFF60).
Update include/linux/mlx4/device.h with function declaration (mlx4_get_module_info)
and the needed defines/enums for future use.
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mlx4')
-rw-r--r-- | include/linux/mlx4/device.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 37e4404d0227..73910daec317 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -379,6 +379,13 @@ enum { | |||
379 | #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ | 379 | #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ |
380 | MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) | 380 | MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) |
381 | 381 | ||
382 | enum mlx4_module_id { | ||
383 | MLX4_MODULE_ID_SFP = 0x3, | ||
384 | MLX4_MODULE_ID_QSFP = 0xC, | ||
385 | MLX4_MODULE_ID_QSFP_PLUS = 0xD, | ||
386 | MLX4_MODULE_ID_QSFP28 = 0x11, | ||
387 | }; | ||
388 | |||
382 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) | 389 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) |
383 | { | 390 | { |
384 | return (major << 32) | (minor << 16) | subminor; | 391 | return (major << 32) | (minor << 16) | subminor; |
@@ -799,6 +806,26 @@ struct mlx4_init_port_param { | |||
799 | u64 si_guid; | 806 | u64 si_guid; |
800 | }; | 807 | }; |
801 | 808 | ||
809 | #define MAD_IFC_DATA_SZ 192 | ||
810 | /* MAD IFC Mailbox */ | ||
811 | struct mlx4_mad_ifc { | ||
812 | u8 base_version; | ||
813 | u8 mgmt_class; | ||
814 | u8 class_version; | ||
815 | u8 method; | ||
816 | __be16 status; | ||
817 | __be16 class_specific; | ||
818 | __be64 tid; | ||
819 | __be16 attr_id; | ||
820 | __be16 resv; | ||
821 | __be32 attr_mod; | ||
822 | __be64 mkey; | ||
823 | __be16 dr_slid; | ||
824 | __be16 dr_dlid; | ||
825 | u8 reserved[28]; | ||
826 | u8 data[MAD_IFC_DATA_SZ]; | ||
827 | } __packed; | ||
828 | |||
802 | #define mlx4_foreach_port(port, dev, type) \ | 829 | #define mlx4_foreach_port(port, dev, type) \ |
803 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ | 830 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ |
804 | if ((type) == (dev)->caps.port_mask[(port)]) | 831 | if ((type) == (dev)->caps.port_mask[(port)]) |
@@ -1283,6 +1310,9 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr, | |||
1283 | u64 iova, u64 size, int npages, | 1310 | u64 iova, u64 size, int npages, |
1284 | int page_shift, struct mlx4_mpt_entry *mpt_entry); | 1311 | int page_shift, struct mlx4_mpt_entry *mpt_entry); |
1285 | 1312 | ||
1313 | int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, | ||
1314 | u16 offset, u16 size, u8 *data); | ||
1315 | |||
1286 | /* Returns true if running in low memory profile (kdump kernel) */ | 1316 | /* Returns true if running in low memory profile (kdump kernel) */ |
1287 | static inline bool mlx4_low_memory_profile(void) | 1317 | static inline bool mlx4_low_memory_profile(void) |
1288 | { | 1318 | { |