aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index eb3a6cea1aa..5921795f840 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -376,6 +376,35 @@ static u8 ixgbe_dcbnl_getcap(struct net_device *netdev, int capid, u8 *cap)
376 return rval; 376 return rval;
377} 377}
378 378
379static u8 ixgbe_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num)
380{
381 struct ixgbe_adapter *adapter = netdev_priv(netdev);
382 u8 rval = 0;
383
384 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
385 switch (tcid) {
386 case DCB_NUMTCS_ATTR_PG:
387 *num = MAX_TRAFFIC_CLASS;
388 break;
389 case DCB_NUMTCS_ATTR_PFC:
390 *num = MAX_TRAFFIC_CLASS;
391 break;
392 default:
393 rval = -EINVAL;
394 break;
395 }
396 } else {
397 rval = -EINVAL;
398 }
399
400 return rval;
401}
402
403static u8 ixgbe_dcbnl_setnumtcs(struct net_device *netdev, int tcid, u8 num)
404{
405 return -EINVAL;
406}
407
379struct dcbnl_rtnl_ops dcbnl_ops = { 408struct dcbnl_rtnl_ops dcbnl_ops = {
380 .getstate = ixgbe_dcbnl_get_state, 409 .getstate = ixgbe_dcbnl_get_state,
381 .setstate = ixgbe_dcbnl_set_state, 410 .setstate = ixgbe_dcbnl_set_state,
@@ -391,6 +420,8 @@ struct dcbnl_rtnl_ops dcbnl_ops = {
391 .setpfccfg = ixgbe_dcbnl_set_pfc_cfg, 420 .setpfccfg = ixgbe_dcbnl_set_pfc_cfg,
392 .getpfccfg = ixgbe_dcbnl_get_pfc_cfg, 421 .getpfccfg = ixgbe_dcbnl_get_pfc_cfg,
393 .setall = ixgbe_dcbnl_set_all, 422 .setall = ixgbe_dcbnl_set_all,
394 .getcap = ixgbe_dcbnl_getcap 423 .getcap = ixgbe_dcbnl_getcap,
424 .getnumtcs = ixgbe_dcbnl_getnumtcs,
425 .setnumtcs = ixgbe_dcbnl_setnumtcs
395}; 426};
396 427