aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2013-06-28 14:51:26 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-07-16 02:58:00 -0400
commitbe29b99a9b51b0338eea3c66a58de53bbd01de24 (patch)
treeabd4b2831ca396dddda2ea8bb02a39b12ea2a1b4 /include/uapi/linux
parenta144f378a489b5900c028425cb0d0a7a3fc8c1c1 (diff)
cfg80211/nl80211: Add packet coalesce support
In most cases, host that receives IPv4 and IPv6 multicast/broadcast packets does not do anything with these packets. Therefore the reception of these unwanted packets causes unnecessary processing and power consumption. Packet coalesce feature helps to reduce number of received interrupts to host by buffering these packets in firmware/hardware for some predefined time. Received interrupt will be generated when one of the following events occur. a) Expiration of hardware timer whose expiration time is set to maximum coalescing delay of matching coalesce rule. b) Coalescing buffer in hardware reaches it's limit. c) Packet doesn't match any of the configured coalesce rules. This patch adds set/get configuration support for packet coalesce. User needs to configure following parameters for creating a coalesce rule. a) Maximum coalescing delay b) List of packet patterns which needs to be matched c) Condition for coalescence. pattern 'match' or 'no match' Multiple such rules can be created. This feature needs to be advertised during driver initialization. Drivers are supposed to do required firmware/hardware settings based on user configuration. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> [fix kernel-doc, change free function, fix copy/paste error] Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/nl80211.h90
1 files changed, 88 insertions, 2 deletions
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index de0ce809068a..5abc54d14d4d 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -126,6 +126,31 @@
126 */ 126 */
127 127
128/** 128/**
129 * DOC: packet coalesce support
130 *
131 * In most cases, host that receives IPv4 and IPv6 multicast/broadcast
132 * packets does not do anything with these packets. Therefore the
133 * reception of these unwanted packets causes unnecessary processing
134 * and power consumption.
135 *
136 * Packet coalesce feature helps to reduce number of received interrupts
137 * to host by buffering these packets in firmware/hardware for some
138 * predefined time. Received interrupt will be generated when one of the
139 * following events occur.
140 * a) Expiration of hardware timer whose expiration time is set to maximum
141 * coalescing delay of matching coalesce rule.
142 * b) Coalescing buffer in hardware reaches it's limit.
143 * c) Packet doesn't match any of the configured coalesce rules.
144 *
145 * User needs to configure following parameters for creating a coalesce
146 * rule.
147 * a) Maximum coalescing delay
148 * b) List of packet patterns which needs to be matched
149 * c) Condition for coalescence. pattern 'match' or 'no match'
150 * Multiple such rules can be created.
151 */
152
153/**
129 * enum nl80211_commands - supported nl80211 commands 154 * enum nl80211_commands - supported nl80211 commands
130 * 155 *
131 * @NL80211_CMD_UNSPEC: unspecified command to catch errors 156 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
@@ -648,6 +673,9 @@
648 * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can 673 * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can
649 * return back to normal. 674 * return back to normal.
650 * 675 *
676 * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules.
677 * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.
678 *
651 * @NL80211_CMD_MAX: highest used command number 679 * @NL80211_CMD_MAX: highest used command number
652 * @__NL80211_CMD_AFTER_LAST: internal use 680 * @__NL80211_CMD_AFTER_LAST: internal use
653 */ 681 */
@@ -810,6 +838,9 @@ enum nl80211_commands {
810 NL80211_CMD_CRIT_PROTOCOL_START, 838 NL80211_CMD_CRIT_PROTOCOL_START,
811 NL80211_CMD_CRIT_PROTOCOL_STOP, 839 NL80211_CMD_CRIT_PROTOCOL_STOP,
812 840
841 NL80211_CMD_GET_COALESCE,
842 NL80211_CMD_SET_COALESCE,
843
813 /* add new commands above here */ 844 /* add new commands above here */
814 845
815 /* used to define NL80211_CMD_MAX below */ 846 /* used to define NL80211_CMD_MAX below */
@@ -1436,6 +1467,8 @@ enum nl80211_commands {
1436 * allowed to be used with the first @NL80211_CMD_SET_STATION command to 1467 * allowed to be used with the first @NL80211_CMD_SET_STATION command to
1437 * update a TDLS peer STA entry. 1468 * update a TDLS peer STA entry.
1438 * 1469 *
1470 * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information.
1471 *
1439 * @NL80211_ATTR_MAX: highest attribute number currently defined 1472 * @NL80211_ATTR_MAX: highest attribute number currently defined
1440 * @__NL80211_ATTR_AFTER_LAST: internal use 1473 * @__NL80211_ATTR_AFTER_LAST: internal use
1441 */ 1474 */
@@ -1736,6 +1769,8 @@ enum nl80211_attrs {
1736 1769
1737 NL80211_ATTR_PEER_AID, 1770 NL80211_ATTR_PEER_AID,
1738 1771
1772 NL80211_ATTR_COALESCE_RULE,
1773
1739 /* add attributes here, update the policy in nl80211.c */ 1774 /* add attributes here, update the policy in nl80211.c */
1740 1775
1741 __NL80211_ATTR_AFTER_LAST, 1776 __NL80211_ATTR_AFTER_LAST,
@@ -3098,8 +3133,10 @@ enum nl80211_packet_pattern_attr {
3098 * @max_pkt_offset: maximum Rx packet offset 3133 * @max_pkt_offset: maximum Rx packet offset
3099 * 3134 *
3100 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when 3135 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
3101 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the 3136 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in
3102 * capability information given by the kernel to userspace. 3137 * %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of
3138 * %NL80211_ATTR_COALESCE_RULE in the capability information given
3139 * by the kernel to userspace.
3103 */ 3140 */
3104struct nl80211_pattern_support { 3141struct nl80211_pattern_support {
3105 __u32 max_patterns; 3142 __u32 max_patterns;
@@ -3318,6 +3355,55 @@ enum nl80211_wowlan_tcp_attrs {
3318}; 3355};
3319 3356
3320/** 3357/**
3358 * struct nl80211_coalesce_rule_support - coalesce rule support information
3359 * @max_rules: maximum number of rules supported
3360 * @pat: packet pattern support information
3361 * @max_delay: maximum supported coalescing delay in msecs
3362 *
3363 * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the
3364 * capability information given by the kernel to userspace.
3365 */
3366struct nl80211_coalesce_rule_support {
3367 __u32 max_rules;
3368 struct nl80211_pattern_support pat;
3369 __u32 max_delay;
3370} __attribute__((packed));
3371
3372/**
3373 * enum nl80211_attr_coalesce_rule - coalesce rule attribute
3374 * @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute
3375 * @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing
3376 * @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence,
3377 * see &enum nl80211_coalesce_condition.
3378 * @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched
3379 * after these fixed number of bytes of received packet
3380 * @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes
3381 * @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number
3382 */
3383enum nl80211_attr_coalesce_rule {
3384 __NL80211_COALESCE_RULE_INVALID,
3385 NL80211_ATTR_COALESCE_RULE_DELAY,
3386 NL80211_ATTR_COALESCE_RULE_CONDITION,
3387 NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
3388
3389 /* keep last */
3390 NUM_NL80211_ATTR_COALESCE_RULE,
3391 NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1
3392};
3393
3394/**
3395 * enum nl80211_coalesce_condition - coalesce rule conditions
3396 * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns
3397 * in a rule are matched.
3398 * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
3399 * in a rule are not matched.
3400 */
3401enum nl80211_coalesce_condition {
3402 NL80211_COALESCE_CONDITION_MATCH,
3403 NL80211_COALESCE_CONDITION_NO_MATCH
3404};
3405
3406/**
3321 * enum nl80211_iface_limit_attrs - limit attributes 3407 * enum nl80211_iface_limit_attrs - limit attributes
3322 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) 3408 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
3323 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that 3409 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that