Skip to content

Commit ad5bbef

Browse files
jukkarAnas Nashif
authored andcommitted
net: Add function to convert VLAN priority to packet priority
Currently the VLAN priority is the same as packet priority but if such conversion is needed, then this function can be used for such conversion. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 6643bb0 commit ad5bbef

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

include/net/net_ip.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,20 @@ int net_tx_priority2tc(enum net_priority prio);
981981
*/
982982
int net_rx_priority2tc(enum net_priority prio);
983983

984+
/**
985+
* @brief Convert network packet VLAN priority to network packet priority so we
986+
* can place the packet into correct queue.
987+
*
988+
* @param priority VLAN priority
989+
*
990+
* @return Network priority
991+
*/
992+
static inline enum net_priority net_vlan2priority(u8_t priority)
993+
{
994+
/* Currently this is 1:1 mapping */
995+
return priority;
996+
}
997+
984998
#ifdef __cplusplus
985999
}
9861000
#endif

0 commit comments

Comments
 (0)