xref: /linux/tools/testing/selftests/drivers/net/mlxsw/mlxsw_lib.sh (revision 2cef30d7bd8b8fbddeb74e3753c29d4248c094e0)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4##############################################################################
5# Defines
6
7if [[ ! -v MLXSW_CHIP ]]; then
8	MLXSW_CHIP=$(devlink -j dev info $DEVLINK_DEV | jq -r '.[][]["driver"]')
9	if [ -z "$MLXSW_CHIP" ]; then
10		echo "SKIP: Device $DEVLINK_DEV doesn't support devlink info command"
11		exit 1
12	fi
13fi
14