diff options
author | Eyal Shapira <eyal@wizery.com> | 2012-07-08 18:20:50 +0300 |
---|---|---|
committer | Arik Nemtsov <arik@wizery.com> | 2012-08-02 13:04:00 +0300 |
commit | 14b5eb2853e92bea7af21d2c05b251bef0880c88 (patch) | |
tree | d8255f924af838b12504bac84ec60a5688e138c6 /src | |
parent | e37b3c4d5c381526af9cff438eacebbf2b6715d6 (diff) | |
download | external_wpa_supplicant_8_ti-14b5eb2853e92bea7af21d2c05b251bef0880c88.zip external_wpa_supplicant_8_ti-14b5eb2853e92bea7af21d2c05b251bef0880c88.tar.gz external_wpa_supplicant_8_ti-14b5eb2853e92bea7af21d2c05b251bef0880c88.tar.bz2 |
nl80211: add support for drop rx filters
Enable configuring rx filters which will be
dropped even if matching another rx filter. This
can be used for generating exception filters.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/driver_nl80211.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 86ce8bf..28a9a6d 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -8922,6 +8922,12 @@ struct rx_filter { /* mask_len - The number of bytes used in mask */ u8 mask_len; + + /* action - can be either NL80211_WOWLAN_ACTION_ALLOW or DROP. + * Allow this pattern (and wakeup in case of suspend) or drop + * packets containing it despite matching another wowlan pattern. + */ + u8 action; }; static u8 *nl80211_rx_filter_get_pattern(struct rx_filter *filter, void *arg) @@ -8959,6 +8965,7 @@ static struct rx_filter rx_filters[] = { .mask = { BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) }, .mask_len = 1, .get_pattern_handler = nl80211_self_filter_get_pattern_handler, + .action = NL80211_WOWLAN_ACTION_ALLOW, }, /* ID 1 */ @@ -8967,6 +8974,7 @@ static struct rx_filter rx_filters[] = { .pattern_len = 6, .mask = { BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) }, .mask_len = 1, + .action = NL80211_WOWLAN_ACTION_ALLOW, }, /* ID 2 */ @@ -8975,6 +8983,7 @@ static struct rx_filter rx_filters[] = { .pattern_len = 3, .mask = { BIT(0) | BIT(1) | BIT(2) }, .mask_len = 1, + .action = NL80211_WOWLAN_ACTION_ALLOW, }, /* ID 3 */ @@ -8983,6 +8992,7 @@ static struct rx_filter rx_filters[] = { .pattern_len = 2, .mask = { BIT(0) | BIT(1) }, .mask_len = 1, + .action = NL80211_WOWLAN_ACTION_ALLOW, }, /* ID 4 */ @@ -8999,6 +9009,7 @@ static struct rx_filter rx_filters[] = { 0, /* OCTET 4 */ BIT(4) | BIT(5) }, /* OCTET 5 */ .mask_len = 5, + .action = NL80211_WOWLAN_ACTION_ALLOW, }, /* ID 5 */ @@ -9009,6 +9020,7 @@ static struct rx_filter rx_filters[] = { .mask = { 0, /* OCTET 1 */ BIT(4) | BIT(5) }, /* OCTET 2 */ .mask_len = 2, + .action = NL80211_WOWLAN_ACTION_ALLOW, }, /* ID 6 */ @@ -9025,7 +9037,26 @@ static struct rx_filter rx_filters[] = { BIT(6) | BIT(7), /* OCTET 4 */ BIT(0) | BIT(1) | BIT(4) | BIT(5) }, /* OCTET 5 */ .mask_len = 5, + .action = NL80211_WOWLAN_ACTION_ALLOW, + }, + + /* This is an example of an exception pattern which matches + * any ICMP packet directed at 00:11:11:11:11:11 + */ + + /* ID 7 */ + {.name = "blacklist", + .pattern = {0 , 0x11, 0x11, 0x11, 0x11, 0x11, 0 , 0 , + 0 , 0 , 0 , 0 , 0 , 0 , 0x45, 0 , + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 }, + .pattern_len = 24, + .mask = { BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5), + BIT(6), + BIT(7) }, + .mask_len = 3, + .action = NL80211_WOWLAN_ACTION_DROP, }, + }; #define NR_RX_FILTERS (int)(sizeof(rx_filters) / sizeof(struct rx_filter)) @@ -9092,6 +9123,9 @@ static int nl80211_set_wowlan_triggers(struct i802_bss *bss, int enable) rx_filter->pattern_len, pattern); + NLA_PUT_U8(pats, NL80211_WOWLAN_PKTPAT_ACTION, + rx_filter->action); + nla_nest_end(pats, pat); } } |