]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5: Move iseg access helper routines close to mlx5_core driver
authorParav Pandit <parav@mellanox.com>
Fri, 15 May 2020 22:16:53 +0000 (15:16 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 18 May 2020 16:21:46 +0000 (09:21 -0700)
Only mlx5_core driver handles fw initialization check and command
interface revision check.
Hence move them inside the mlx5_core driver where it is used.
This avoid exposing these helpers to all mlx5 drivers.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c
drivers/net/ethernet/mellanox/mlx5/core/main.c
include/linux/mlx5/driver.h

index 34cba97f7bf4891a2bb26e10cf3c31d30cd40550..e6567d5570baea4a04c7c6041d6e2062afda4e59 100644 (file)
@@ -1890,6 +1890,11 @@ static void free_cmd_page(struct mlx5_core_dev *dev, struct mlx5_cmd *cmd)
                          cmd->alloc_dma);
 }
 
+static u16 cmdif_rev(struct mlx5_core_dev *dev)
+{
+       return ioread32be(&dev->iseg->cmdif_rev_fw_sub) >> 16;
+}
+
 int mlx5_cmd_init(struct mlx5_core_dev *dev)
 {
        int size = sizeof(struct mlx5_cmd_prot_block);
index 061b69ea9cc4f3318e844135f3e47b352f899b47..8a375e3ed5c188ef08091640ec9330c2cba9e08a 100644 (file)
@@ -177,6 +177,11 @@ static struct mlx5_profile profile[] = {
 #define FW_PRE_INIT_TIMEOUT_MILI       120000
 #define FW_INIT_WARN_MESSAGE_INTERVAL  20000
 
+static int fw_initializing(struct mlx5_core_dev *dev)
+{
+       return ioread32be(&dev->iseg->initializing) >> 31;
+}
+
 static int wait_fw_init(struct mlx5_core_dev *dev, u32 max_wait_mili,
                        u32 warn_time_mili)
 {
index 24e04901f92e0163683afd74a5ac7f8d4bef670e..a988eb405aa65017d9c314de6fdfe5b2f3da8f81 100644 (file)
@@ -823,11 +823,6 @@ static inline u16 fw_rev_sub(struct mlx5_core_dev *dev)
        return ioread32be(&dev->iseg->cmdif_rev_fw_sub) & 0xffff;
 }
 
-static inline u16 cmdif_rev(struct mlx5_core_dev *dev)
-{
-       return ioread32be(&dev->iseg->cmdif_rev_fw_sub) >> 16;
-}
-
 static inline u32 mlx5_base_mkey(const u32 key)
 {
        return key & 0xffffff00u;
@@ -1012,11 +1007,6 @@ int mlx5_core_roce_gid_set(struct mlx5_core_dev *dev, unsigned int index,
                           u8 roce_version, u8 roce_l3_type, const u8 *gid,
                           const u8 *mac, bool vlan, u16 vlan_id, u8 port_num);
 
-static inline int fw_initializing(struct mlx5_core_dev *dev)
-{
-       return ioread32be(&dev->iseg->initializing) >> 31;
-}
-
 static inline u32 mlx5_mkey_to_idx(u32 mkey)
 {
        return mkey >> 8;