xref: /linux/tools/testing/selftests/drivers/net/mlxsw/mlxsw_lib.sh (revision 0d3b051adbb72ed81956447d0d1e54d5943ee6f5)
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