nl80211: Add CMD_CONTROL_PORT_FRAME API

This commit also adds cfg80211_rx_control_port function.  This is used
to generate a CMD_CONTROL_PORT_FRAME event out to userspace.  The
conn_owner_nlportid is used as the unicast destination.  This means that
userspace must specify NL80211_ATTR_SOCKET_OWNER flag if control port
over nl80211 routing is requested in NL80211_CMD_CONNECT,
NL80211_CMD_ASSOCIATE, NL80211_CMD_START_AP or IBSS/mesh join.

Signed-off-by: Denis Kenzior <denkenz@gmail.com>
[johannes: fix return value of cfg80211_rx_control_port()]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Denis Kenzior
2018-03-26 12:52:41 -05:00
committed by Johannes Berg
parent 4d191c7536
commit 6a671a50f8
4 changed files with 114 additions and 0 deletions

View File

@@ -5721,6 +5721,28 @@ void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie,
const u8 *buf, size_t len, bool ack, gfp_t gfp);
/**
* cfg80211_rx_control_port - notification about a received control port frame
* @dev: The device the frame matched to
* @buf: control port frame
* @len: length of the frame data
* @addr: The peer from which the frame was received
* @proto: frame protocol, typically PAE or Pre-authentication
* @unencrypted: Whether the frame was received unencrypted
*
* This function is used to inform userspace about a received control port
* frame. It should only be used if userspace indicated it wants to receive
* control port frames over nl80211.
*
* The frame is the data portion of the 802.3 or 802.11 data frame with all
* network layer headers removed (e.g. the raw EAPoL frame).
*
* Return: %true if the frame was passed to userspace
*/
bool cfg80211_rx_control_port(struct net_device *dev,
const u8 *buf, size_t len,
const u8 *addr, u16 proto, bool unencrypted);
/**
* cfg80211_cqm_rssi_notify - connection quality monitoring rssi event
* @dev: network device