From 312818e2c6455f247ec5886ce8321c8964218fcd Mon Sep 17 00:00:00 2001 From: John Fastabend Date: Tue, 21 Jun 2011 07:34:53 +0000 Subject: [PATCH] --- yaml --- r: 255659 b: refs/heads/master c: a364c8cf80251849bab207be8c9e66253c8ca8f8 h: refs/heads/master i: 255657: 81c003607de771783c3fd2f922419e01000293f6 255655: 75cfa47ba8b896171b34da092d5170bc6e19e761 v: v3 --- [refs] | 2 +- trunk/include/net/dcbnl.h | 1 + trunk/net/dcb/dcbnl.c | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 51284c1684a1..b5a8944c81f9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f9ae7e4b515c4d56baf6e0e84ebee2e03ae57a25 +refs/heads/master: a364c8cf80251849bab207be8c9e66253c8ca8f8 diff --git a/trunk/include/net/dcbnl.h b/trunk/include/net/dcbnl.h index 62a268531d4a..c14fd9483e46 100644 --- a/trunk/include/net/dcbnl.h +++ b/trunk/include/net/dcbnl.h @@ -32,6 +32,7 @@ u8 dcb_setapp(struct net_device *, struct dcb_app *); u8 dcb_getapp(struct net_device *, struct dcb_app *); int dcb_ieee_setapp(struct net_device *, struct dcb_app *); int dcb_ieee_delapp(struct net_device *, struct dcb_app *); +u8 dcb_ieee_getapp_mask(struct net_device *, struct dcb_app *); int dcbnl_notify(struct net_device *dev, int event, int cmd, u32 seq, u32 pid); diff --git a/trunk/net/dcb/dcbnl.c b/trunk/net/dcb/dcbnl.c index 196084f310d2..b7d0be01dcc4 100644 --- a/trunk/net/dcb/dcbnl.c +++ b/trunk/net/dcb/dcbnl.c @@ -1928,6 +1928,32 @@ u8 dcb_setapp(struct net_device *dev, struct dcb_app *new) } EXPORT_SYMBOL(dcb_setapp); +/** + * dcb_ieee_getapp_mask - retrieve the IEEE DCB application priority + * + * Helper routine which on success returns a non-zero 802.1Qaz user + * priority bitmap otherwise returns 0 to indicate the dcb_app was + * not found in APP list. + */ +u8 dcb_ieee_getapp_mask(struct net_device *dev, struct dcb_app *app) +{ + struct dcb_app_type *itr; + u8 prio = 0; + + spin_lock(&dcb_lock); + list_for_each_entry(itr, &dcb_app_list, list) { + if (itr->app.selector == app->selector && + itr->app.protocol == app->protocol && + (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) { + prio |= 1 << itr->app.priority; + } + } + spin_unlock(&dcb_lock); + + return prio; +} +EXPORT_SYMBOL(dcb_ieee_getapp_mask); + /** * dcb_ieee_setapp - add IEEE dcb application data to app list *