diff options
Diffstat (limited to 'include/linux/mlx4/device.h')
-rw-r--r-- | include/linux/mlx4/device.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index bd6c9fcdf2dd..6e1b0f973a03 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -796,6 +796,19 @@ enum mlx4_net_trans_rule_id { | |||
796 | MLX4_NET_TRANS_RULE_NUM, /* should be last */ | 796 | MLX4_NET_TRANS_RULE_NUM, /* should be last */ |
797 | }; | 797 | }; |
798 | 798 | ||
799 | extern const u16 __sw_id_hw[]; | ||
800 | |||
801 | static inline int map_hw_to_sw_id(u16 header_id) | ||
802 | { | ||
803 | |||
804 | int i; | ||
805 | for (i = 0; i < MLX4_NET_TRANS_RULE_NUM; i++) { | ||
806 | if (header_id == __sw_id_hw[i]) | ||
807 | return i; | ||
808 | } | ||
809 | return -EINVAL; | ||
810 | } | ||
811 | |||
799 | enum mlx4_net_trans_promisc_mode { | 812 | enum mlx4_net_trans_promisc_mode { |
800 | MLX4_FS_PROMISC_NONE = 0, | 813 | MLX4_FS_PROMISC_NONE = 0, |
801 | MLX4_FS_PROMISC_UPLINK, | 814 | MLX4_FS_PROMISC_UPLINK, |