diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/cfg80211.h | 74 |
1 files changed, 72 insertions, 2 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 4932dfcb72b4..0920daf36807 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1088,6 +1088,38 @@ struct cfg80211_pmksa { | |||
1088 | }; | 1088 | }; |
1089 | 1089 | ||
1090 | /** | 1090 | /** |
1091 | * struct cfg80211_wowlan_trig_pkt_pattern - packet pattern | ||
1092 | * @mask: bitmask where to match pattern and where to ignore bytes, | ||
1093 | * one bit per byte, in same format as nl80211 | ||
1094 | * @pattern: bytes to match where bitmask is 1 | ||
1095 | * @pattern_len: length of pattern (in bytes) | ||
1096 | * | ||
1097 | * Internal note: @mask and @pattern are allocated in one chunk of | ||
1098 | * memory, free @mask only! | ||
1099 | */ | ||
1100 | struct cfg80211_wowlan_trig_pkt_pattern { | ||
1101 | u8 *mask, *pattern; | ||
1102 | int pattern_len; | ||
1103 | }; | ||
1104 | |||
1105 | /** | ||
1106 | * struct cfg80211_wowlan - Wake on Wireless-LAN support info | ||
1107 | * | ||
1108 | * This structure defines the enabled WoWLAN triggers for the device. | ||
1109 | * @any: wake up on any activity -- special trigger if device continues | ||
1110 | * operating as normal during suspend | ||
1111 | * @disconnect: wake up if getting disconnected | ||
1112 | * @magic_pkt: wake up on receiving magic packet | ||
1113 | * @patterns: wake up on receiving packet matching a pattern | ||
1114 | * @n_patterns: number of patterns | ||
1115 | */ | ||
1116 | struct cfg80211_wowlan { | ||
1117 | bool any, disconnect, magic_pkt; | ||
1118 | struct cfg80211_wowlan_trig_pkt_pattern *patterns; | ||
1119 | int n_patterns; | ||
1120 | }; | ||
1121 | |||
1122 | /** | ||
1091 | * struct cfg80211_ops - backend description for wireless configuration | 1123 | * struct cfg80211_ops - backend description for wireless configuration |
1092 | * | 1124 | * |
1093 | * This struct is registered by fullmac card drivers and/or wireless stacks | 1125 | * This struct is registered by fullmac card drivers and/or wireless stacks |
@@ -1100,7 +1132,9 @@ struct cfg80211_pmksa { | |||
1100 | * wireless extensions but this is subject to reevaluation as soon as this | 1132 | * wireless extensions but this is subject to reevaluation as soon as this |
1101 | * code is used more widely and we have a first user without wext. | 1133 | * code is used more widely and we have a first user without wext. |
1102 | * | 1134 | * |
1103 | * @suspend: wiphy device needs to be suspended | 1135 | * @suspend: wiphy device needs to be suspended. The variable @wow will |
1136 | * be %NULL or contain the enabled Wake-on-Wireless triggers that are | ||
1137 | * configured for the device. | ||
1104 | * @resume: wiphy device needs to be resumed | 1138 | * @resume: wiphy device needs to be resumed |
1105 | * | 1139 | * |
1106 | * @add_virtual_intf: create a new virtual interface with the given name, | 1140 | * @add_virtual_intf: create a new virtual interface with the given name, |
@@ -1244,7 +1278,7 @@ struct cfg80211_pmksa { | |||
1244 | * @get_ringparam: Get tx and rx ring current and maximum sizes. | 1278 | * @get_ringparam: Get tx and rx ring current and maximum sizes. |
1245 | */ | 1279 | */ |
1246 | struct cfg80211_ops { | 1280 | struct cfg80211_ops { |
1247 | int (*suspend)(struct wiphy *wiphy); | 1281 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
1248 | int (*resume)(struct wiphy *wiphy); | 1282 | int (*resume)(struct wiphy *wiphy); |
1249 | 1283 | ||
1250 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, | 1284 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, |
@@ -1480,6 +1514,38 @@ struct ieee80211_txrx_stypes { | |||
1480 | }; | 1514 | }; |
1481 | 1515 | ||
1482 | /** | 1516 | /** |
1517 | * enum wiphy_wowlan_support_flags - WoWLAN support flags | ||
1518 | * @WIPHY_WOWLAN_ANY: supports wakeup for the special "any" | ||
1519 | * trigger that keeps the device operating as-is and | ||
1520 | * wakes up the host on any activity, for example a | ||
1521 | * received packet that passed filtering; note that the | ||
1522 | * packet should be preserved in that case | ||
1523 | * @WIPHY_WOWLAN_MAGIC_PKT: supports wakeup on magic packet | ||
1524 | * (see nl80211.h) | ||
1525 | * @WIPHY_WOWLAN_DISCONNECT: supports wakeup on disconnect | ||
1526 | */ | ||
1527 | enum wiphy_wowlan_support_flags { | ||
1528 | WIPHY_WOWLAN_ANY = BIT(0), | ||
1529 | WIPHY_WOWLAN_MAGIC_PKT = BIT(1), | ||
1530 | WIPHY_WOWLAN_DISCONNECT = BIT(2), | ||
1531 | }; | ||
1532 | |||
1533 | /** | ||
1534 | * struct wiphy_wowlan_support - WoWLAN support data | ||
1535 | * @flags: see &enum wiphy_wowlan_support_flags | ||
1536 | * @n_patterns: number of supported wakeup patterns | ||
1537 | * (see nl80211.h for the pattern definition) | ||
1538 | * @pattern_max_len: maximum length of each pattern | ||
1539 | * @pattern_min_len: minimum length of each pattern | ||
1540 | */ | ||
1541 | struct wiphy_wowlan_support { | ||
1542 | u32 flags; | ||
1543 | int n_patterns; | ||
1544 | int pattern_max_len; | ||
1545 | int pattern_min_len; | ||
1546 | }; | ||
1547 | |||
1548 | /** | ||
1483 | * struct wiphy - wireless hardware description | 1549 | * struct wiphy - wireless hardware description |
1484 | * @reg_notifier: the driver's regulatory notification callback, | 1550 | * @reg_notifier: the driver's regulatory notification callback, |
1485 | * note that if your driver uses wiphy_apply_custom_regulatory() | 1551 | * note that if your driver uses wiphy_apply_custom_regulatory() |
@@ -1546,6 +1612,8 @@ struct ieee80211_txrx_stypes { | |||
1546 | * | 1612 | * |
1547 | * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation | 1613 | * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation |
1548 | * may request, if implemented. | 1614 | * may request, if implemented. |
1615 | * | ||
1616 | * @wowlan: WoWLAN support information | ||
1549 | */ | 1617 | */ |
1550 | struct wiphy { | 1618 | struct wiphy { |
1551 | /* assign these fields before you register the wiphy */ | 1619 | /* assign these fields before you register the wiphy */ |
@@ -1583,6 +1651,8 @@ struct wiphy { | |||
1583 | char fw_version[ETHTOOL_BUSINFO_LEN]; | 1651 | char fw_version[ETHTOOL_BUSINFO_LEN]; |
1584 | u32 hw_version; | 1652 | u32 hw_version; |
1585 | 1653 | ||
1654 | struct wiphy_wowlan_support wowlan; | ||
1655 | |||
1586 | u16 max_remain_on_channel_duration; | 1656 | u16 max_remain_on_channel_duration; |
1587 | 1657 | ||
1588 | u8 max_num_pmkids; | 1658 | u8 max_num_pmkids; |