diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2008-11-21 00:05:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-21 00:05:08 -0500 |
commit | 46132188bf72e22ef097f16ed5c969ee8cea1e8b (patch) | |
tree | e776ed8011b8314ff08abf4f3467c07d037fec4f /drivers/net/ixgbe | |
parent | 2f90b8657ec942d1880f720e0177ee71df7c8e3c (diff) |
DCB: Add interface to query for the DCB capabilities of an device.
Adds to the netlink interface for Data Center Bridging (DCB), allowing
the DCB capabilities supported by a device to be queried.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_dcb_nl.c | 42 |
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 | ||
340 | static 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 | |||
340 | struct dcbnl_rtnl_ops dcbnl_ops = { | 379 | struct 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 | ||