mm.c (2b30f8291a30305eeedcd787b4d0e352410f7268) mm.c (04692c9020b76939715d6f2b4ff84d832246e0fc)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright 2022-2023 NXP
4 */
5#include "common.h"
6#include "netlink.h"
7
8struct mm_req_info {

--- 239 unchanged lines hidden (view full) ---

248out_complete:
249 ethnl_ops_complete(dev);
250out_rtnl_unlock:
251 rtnl_unlock();
252out_dev_put:
253 ethnl_parse_header_dev_put(&req_info);
254 return ret;
255}
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright 2022-2023 NXP
4 */
5#include "common.h"
6#include "netlink.h"
7
8struct mm_req_info {

--- 239 unchanged lines hidden (view full) ---

248out_complete:
249 ethnl_ops_complete(dev);
250out_rtnl_unlock:
251 rtnl_unlock();
252out_dev_put:
253 ethnl_parse_header_dev_put(&req_info);
254 return ret;
255}
256
257/* Returns whether a given device supports the MAC merge layer
258 * (has an eMAC and a pMAC). Must be called under rtnl_lock() and
259 * ethnl_ops_begin().
260 */
261bool __ethtool_dev_mm_supported(struct net_device *dev)
262{
263 const struct ethtool_ops *ops = dev->ethtool_ops;
264 struct ethtool_mm_state state = {};
265 int ret = -EOPNOTSUPP;
266
267 if (ops && ops->get_mm)
268 ret = ops->get_mm(dev, &state);
269
270 return !!ret;
271}