From 9813337a4b16ea5b1701b1d00f7e410f5decdfa5 Mon Sep 17 00:00:00 2001 From: Eugenia Emantayev Date: Sun, 2 Mar 2014 10:25:01 +0200 Subject: net/mlx4: Replace mlx4_en_mac_to_u64() with mlx4_mac_to_u64() Currently, the EN driver uses a private static function mlx4_en_mac_to_u64(). Move it to a common include file (driver.h) for mlx4_en and mlx4_ib for further use. Signed-off-by: Eugenia Emantayev Signed-off-by: Amir Vadai Signed-off-by: David S. Miller --- include/linux/mlx4/driver.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index c257e1b211be..022055c8fb26 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h @@ -64,4 +64,16 @@ void mlx4_unregister_interface(struct mlx4_interface *intf); void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); +static inline u64 mlx4_mac_to_u64(u8 *addr) +{ + u64 mac = 0; + int i; + + for (i = 0; i < ETH_ALEN; i++) { + mac <<= 8; + mac |= addr[i]; + } + return mac; +} + #endif /* MLX4_DRIVER_H */ -- cgit v1.2.3