Lines Matching full:mw
815 struct mlx4_mw *mw) in mlx4_mw_alloc() argument
829 mw->key = hw_index_to_key(index); in mlx4_mw_alloc()
830 mw->pd = pd; in mlx4_mw_alloc()
831 mw->type = type; in mlx4_mw_alloc()
832 mw->enabled = MLX4_MPT_DISABLED; in mlx4_mw_alloc()
838 int mlx4_mw_enable(struct mlx4_dev *dev, struct mlx4_mw *mw) in mlx4_mw_enable() argument
844 err = mlx4_mpt_alloc_icm(dev, key_to_hw_index(mw->key)); in mlx4_mw_enable()
858 mpt_entry->key = cpu_to_be32(key_to_hw_index(mw->key)); in mlx4_mw_enable()
859 mpt_entry->pd_flags = cpu_to_be32(mw->pd); in mlx4_mw_enable()
860 if (mw->type == MLX4_MW_TYPE_2) { in mlx4_mw_enable()
867 key_to_hw_index(mw->key) & in mlx4_mw_enable()
873 mw->enabled = MLX4_MPT_EN_HW; in mlx4_mw_enable()
883 mlx4_mpt_free_icm(dev, key_to_hw_index(mw->key)); in mlx4_mw_enable()
888 void mlx4_mw_free(struct mlx4_dev *dev, struct mlx4_mw *mw) in mlx4_mw_free() argument
892 if (mw->enabled == MLX4_MPT_EN_HW) { in mlx4_mw_free()
894 key_to_hw_index(mw->key) & in mlx4_mw_free()
899 mw->enabled = MLX4_MPT_EN_SW; in mlx4_mw_free()
901 if (mw->enabled) in mlx4_mw_free()
902 mlx4_mpt_free_icm(dev, key_to_hw_index(mw->key)); in mlx4_mw_free()
903 mlx4_mpt_release(dev, key_to_hw_index(mw->key)); in mlx4_mw_free()