aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_dcb_nl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_dcb_nl.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 50bff2af6b04..eb3a6cea1aaa 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -337,6 +337,45 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
337 return ret; 337 return ret;
338} 338}
339 339
340static u8 ixgbe_dcbnl_getcap(struct net_device *netdev, int capid, u8 *cap)
341{
342 struct ixgbe_adapter *adapter = netdev_priv(netdev);
343 u8 rval = 0;
344
345 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
346 switch (capid) {
347 case DCB_CAP_ATTR_PG:
348 *cap = true;
349 break;
350 case DCB_CAP_ATTR_PFC:
351 *cap = true;
352 break;
353 case DCB_CAP_ATTR_UP2TC:
354 *cap = false;
355 break;
356 case DCB_CAP_ATTR_PG_TCS:
357 *cap = 0x80;
358 break;
359 case DCB_CAP_ATTR_PFC_TCS:
360 *cap = 0x80;
361 break;
362 case DCB_CAP_ATTR_GSP:
363 *cap = true;
364 break;
365 case DCB_CAP_ATTR_BCN:
366 *cap = false;
367 break;
368 default:
369 rval = -EINVAL;
370 break;
371 }
372 } else {
373 rval = -EINVAL;
374 }
375
376 return rval;
377}
378
340struct dcbnl_rtnl_ops dcbnl_ops = { 379struct dcbnl_rtnl_ops dcbnl_ops = {
341 .getstate = ixgbe_dcbnl_get_state, 380 .getstate = ixgbe_dcbnl_get_state,
342 .setstate = ixgbe_dcbnl_set_state, 381 .setstate = ixgbe_dcbnl_set_state,
@@ -351,6 +390,7 @@ struct dcbnl_rtnl_ops dcbnl_ops = {
351 .getpgbwgcfgrx = ixgbe_dcbnl_get_pg_bwg_cfg_rx, 390 .getpgbwgcfgrx = ixgbe_dcbnl_get_pg_bwg_cfg_rx,
352 .setpfccfg = ixgbe_dcbnl_set_pfc_cfg, 391 .setpfccfg = ixgbe_dcbnl_set_pfc_cfg,
353 .getpfccfg = ixgbe_dcbnl_get_pfc_cfg, 392 .getpfccfg = ixgbe_dcbnl_get_pfc_cfg,
354 .setall = ixgbe_dcbnl_set_all 393 .setall = ixgbe_dcbnl_set_all,
394 .getcap = ixgbe_dcbnl_getcap
355}; 395};
356 396