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.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index e05c62ac56b2..47d9dde82a8a 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -480,6 +480,64 @@ static void ixgbe_dcbnl_setpfcstate(struct net_device *netdev, u8 state)
480 return; 480 return;
481} 481}
482 482
483/**
484 * ixgbe_dcbnl_getapp - retrieve the DCBX application user priority
485 * @netdev : the corresponding netdev
486 * @idtype : identifies the id as ether type or TCP/UDP port number
487 * @id: id is either ether type or TCP/UDP port number
488 *
489 * Returns : on success, returns a non-zero 802.1p user priority bitmap
490 * otherwise returns 0 as the invalid user priority bitmap to indicate an
491 * error.
492 */
493static u8 ixgbe_dcbnl_getapp(struct net_device *netdev, u8 idtype, u16 id)
494{
495 u8 rval = 0;
496
497 switch (idtype) {
498 case DCB_APP_IDTYPE_ETHTYPE:
499#ifdef IXGBE_FCOE
500 if (id == ETH_P_FCOE)
501 rval = ixgbe_fcoe_getapp(netdev_priv(netdev));
502#endif
503 break;
504 case DCB_APP_IDTYPE_PORTNUM:
505 break;
506 default:
507 break;
508 }
509 return rval;
510}
511
512/**
513 * ixgbe_dcbnl_setapp - set the DCBX application user priority
514 * @netdev : the corresponding netdev
515 * @idtype : identifies the id as ether type or TCP/UDP port number
516 * @id: id is either ether type or TCP/UDP port number
517 * @up: the 802.1p user priority bitmap
518 *
519 * Returns : 0 on success or 1 on error
520 */
521static u8 ixgbe_dcbnl_setapp(struct net_device *netdev,
522 u8 idtype, u16 id, u8 up)
523{
524 u8 rval = 1;
525
526 switch (idtype) {
527 case DCB_APP_IDTYPE_ETHTYPE:
528#ifdef IXGBE_FCOE
529 if (id == ETH_P_FCOE)
530 rval = ixgbe_fcoe_setapp(netdev_priv(netdev), up);
531#endif
532 break;
533 case DCB_APP_IDTYPE_PORTNUM:
534 break;
535 default:
536 break;
537 }
538 return rval;
539}
540
483struct dcbnl_rtnl_ops dcbnl_ops = { 541struct dcbnl_rtnl_ops dcbnl_ops = {
484 .getstate = ixgbe_dcbnl_get_state, 542 .getstate = ixgbe_dcbnl_get_state,
485 .setstate = ixgbe_dcbnl_set_state, 543 .setstate = ixgbe_dcbnl_set_state,
@@ -500,5 +558,7 @@ struct dcbnl_rtnl_ops dcbnl_ops = {
500 .setnumtcs = ixgbe_dcbnl_setnumtcs, 558 .setnumtcs = ixgbe_dcbnl_setnumtcs,
501 .getpfcstate = ixgbe_dcbnl_getpfcstate, 559 .getpfcstate = ixgbe_dcbnl_getpfcstate,
502 .setpfcstate = ixgbe_dcbnl_setpfcstate, 560 .setpfcstate = ixgbe_dcbnl_setpfcstate,
561 .getapp = ixgbe_dcbnl_getapp,
562 .setapp = ixgbe_dcbnl_setapp,
503}; 563};
504 564