aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/dcbnl.h1
-rw-r--r--net/dcb/dcbnl.c26
2 files changed, 27 insertions, 0 deletions
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index 62a268531d4a..c14fd9483e46 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -32,6 +32,7 @@ u8 dcb_setapp(struct net_device *, struct dcb_app *);
32u8 dcb_getapp(struct net_device *, struct dcb_app *); 32u8 dcb_getapp(struct net_device *, struct dcb_app *);
33int dcb_ieee_setapp(struct net_device *, struct dcb_app *); 33int dcb_ieee_setapp(struct net_device *, struct dcb_app *);
34int dcb_ieee_delapp(struct net_device *, struct dcb_app *); 34int dcb_ieee_delapp(struct net_device *, struct dcb_app *);
35u8 dcb_ieee_getapp_mask(struct net_device *, struct dcb_app *);
35 36
36int dcbnl_notify(struct net_device *dev, int event, int cmd, u32 seq, u32 pid); 37int dcbnl_notify(struct net_device *dev, int event, int cmd, u32 seq, u32 pid);
37 38
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 196084f310d2..b7d0be01dcc4 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1929,6 +1929,32 @@ out:
1929EXPORT_SYMBOL(dcb_setapp); 1929EXPORT_SYMBOL(dcb_setapp);
1930 1930
1931/** 1931/**
1932 * dcb_ieee_getapp_mask - retrieve the IEEE DCB application priority
1933 *
1934 * Helper routine which on success returns a non-zero 802.1Qaz user
1935 * priority bitmap otherwise returns 0 to indicate the dcb_app was
1936 * not found in APP list.
1937 */
1938u8 dcb_ieee_getapp_mask(struct net_device *dev, struct dcb_app *app)
1939{
1940 struct dcb_app_type *itr;
1941 u8 prio = 0;
1942
1943 spin_lock(&dcb_lock);
1944 list_for_each_entry(itr, &dcb_app_list, list) {
1945 if (itr->app.selector == app->selector &&
1946 itr->app.protocol == app->protocol &&
1947 (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) {
1948 prio |= 1 << itr->app.priority;
1949 }
1950 }
1951 spin_unlock(&dcb_lock);
1952
1953 return prio;
1954}
1955EXPORT_SYMBOL(dcb_ieee_getapp_mask);
1956
1957/**
1932 * dcb_ieee_setapp - add IEEE dcb application data to app list 1958 * dcb_ieee_setapp - add IEEE dcb application data to app list
1933 * 1959 *
1934 * This adds Application data to the list. Multiple application 1960 * This adds Application data to the list. Multiple application