Skip to content

Commit

Permalink
Merge tag 'mac80211-next-for-davem-2016-10-04' of git://git.kernel.or…
Browse files Browse the repository at this point in the history
…g/pub/scm/linux/kernel/git/jberg/mac80211-next

Johannes Berg says:

====================
This time around, we have
 * Neighbor Awareness Networking (NAN) APIs
 * a fix for a previous patch that caused memory corruption
   in wireless extensions key settings
 * beacon rate configuration for AP and mesh
 * memory limits for mac80211's internal TXQs
 * a (fairly involved) fix for the TXQ vs. crypto problems
 * direct cfg80211 driver API for WEP keys

This also pulls in net-next to fix the merge conflicts, see
the merge commit for more details.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 5, 2016
2 parents 9a8dd21 + 1e1430d commit 1ebf8b4
Show file tree
Hide file tree
Showing 33 changed files with 2,682 additions and 433 deletions.
223 changes: 210 additions & 13 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright 2015 Intel Deutschland GmbH
* Copyright 2015-2016 Intel Deutschland GmbH
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand Down Expand Up @@ -593,6 +593,8 @@ struct survey_info {
s8 noise;
};

#define CFG80211_MAX_WEP_KEYS 4

/**
* struct cfg80211_crypto_settings - Crypto settings
* @wpa_versions: indicates which, if any, WPA versions are enabled
Expand All @@ -610,6 +612,9 @@ struct survey_info {
* allowed through even on unauthorized ports
* @control_port_no_encrypt: TRUE to prevent encryption of control port
* protocol frames.
* @wep_keys: static WEP keys, if not NULL points to an array of
* CFG80211_MAX_WEP_KEYS WEP keys
* @wep_tx_key: key index (0..3) of the default TX static WEP key
*/
struct cfg80211_crypto_settings {
u32 wpa_versions;
Expand All @@ -621,6 +626,8 @@ struct cfg80211_crypto_settings {
bool control_port;
__be16 control_port_ethertype;
bool control_port_no_encrypt;
struct key_params *wep_keys;
int wep_tx_key;
};

/**
Expand Down Expand Up @@ -676,6 +683,18 @@ struct cfg80211_acl_data {
struct mac_address mac_addrs[];
};

/*
* cfg80211_bitrate_mask - masks for bitrate control
*/
struct cfg80211_bitrate_mask {
struct {
u32 legacy;
u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
u16 vht_mcs[NL80211_VHT_NSS_MAX];
enum nl80211_txrate_gi gi;
} control[NUM_NL80211_BANDS];
};

/**
* struct cfg80211_ap_settings - AP configuration
*
Expand All @@ -700,6 +719,7 @@ struct cfg80211_acl_data {
* MAC address based access control
* @pbss: If set, start as a PCP instead of AP. Relevant for DMG
* networks.
* @beacon_rate: bitrate to be used for beacons
*/
struct cfg80211_ap_settings {
struct cfg80211_chan_def chandef;
Expand All @@ -719,6 +739,7 @@ struct cfg80211_ap_settings {
bool p2p_opp_ps;
const struct cfg80211_acl_data *acl;
bool pbss;
struct cfg80211_bitrate_mask beacon_rate;
};

/**
Expand Down Expand Up @@ -1351,6 +1372,7 @@ struct mesh_config {
* @beacon_interval: beacon interval to use
* @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]
* @basic_rates: basic rates to use when creating the mesh
* @beacon_rate: bitrate to be used for beacons
*
* These parameters are fixed when the mesh is created.
*/
Expand All @@ -1371,6 +1393,7 @@ struct mesh_setup {
u16 beacon_interval;
int mcast_rate[NUM_NL80211_BANDS];
u32 basic_rates;
struct cfg80211_bitrate_mask beacon_rate;
};

/**
Expand Down Expand Up @@ -2010,17 +2033,6 @@ enum wiphy_params_flags {
WIPHY_PARAM_DYN_ACK = 1 << 5,
};

/*
* cfg80211_bitrate_mask - masks for bitrate control
*/
struct cfg80211_bitrate_mask {
struct {
u32 legacy;
u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
u16 vht_mcs[NL80211_VHT_NSS_MAX];
enum nl80211_txrate_gi gi;
} control[NUM_NL80211_BANDS];
};
/**
* struct cfg80211_pmksa - PMK Security Association
*
Expand Down Expand Up @@ -2301,6 +2313,98 @@ struct cfg80211_qos_map {
struct cfg80211_dscp_range up[8];
};

/**
* struct cfg80211_nan_conf - NAN configuration
*
* This struct defines NAN configuration parameters
*
* @master_pref: master preference (1 - 255)
* @dual: dual band operation mode, see &enum nl80211_nan_dual_band_conf
*/
struct cfg80211_nan_conf {
u8 master_pref;
u8 dual;
};

/**
* enum cfg80211_nan_conf_changes - indicates changed fields in NAN
* configuration
*
* @CFG80211_NAN_CONF_CHANGED_PREF: master preference
* @CFG80211_NAN_CONF_CHANGED_DUAL: dual band operation
*/
enum cfg80211_nan_conf_changes {
CFG80211_NAN_CONF_CHANGED_PREF = BIT(0),
CFG80211_NAN_CONF_CHANGED_DUAL = BIT(1),
};

/**
* struct cfg80211_nan_func_filter - a NAN function Rx / Tx filter
*
* @filter: the content of the filter
* @len: the length of the filter
*/
struct cfg80211_nan_func_filter {
const u8 *filter;
u8 len;
};

/**
* struct cfg80211_nan_func - a NAN function
*
* @type: &enum nl80211_nan_function_type
* @service_id: the service ID of the function
* @publish_type: &nl80211_nan_publish_type
* @close_range: if true, the range should be limited. Threshold is
* implementation specific.
* @publish_bcast: if true, the solicited publish should be broadcasted
* @subscribe_active: if true, the subscribe is active
* @followup_id: the instance ID for follow up
* @followup_reqid: the requestor instance ID for follow up
* @followup_dest: MAC address of the recipient of the follow up
* @ttl: time to live counter in DW.
* @serv_spec_info: Service Specific Info
* @serv_spec_info_len: Service Specific Info length
* @srf_include: if true, SRF is inclusive
* @srf_bf: Bloom Filter
* @srf_bf_len: Bloom Filter length
* @srf_bf_idx: Bloom Filter index
* @srf_macs: SRF MAC addresses
* @srf_num_macs: number of MAC addresses in SRF
* @rx_filters: rx filters that are matched with corresponding peer's tx_filter
* @tx_filters: filters that should be transmitted in the SDF.
* @num_rx_filters: length of &rx_filters.
* @num_tx_filters: length of &tx_filters.
* @instance_id: driver allocated id of the function.
* @cookie: unique NAN function identifier.
*/
struct cfg80211_nan_func {
enum nl80211_nan_function_type type;
u8 service_id[NL80211_NAN_FUNC_SERVICE_ID_LEN];
u8 publish_type;
bool close_range;
bool publish_bcast;
bool subscribe_active;
u8 followup_id;
u8 followup_reqid;
struct mac_address followup_dest;
u32 ttl;
const u8 *serv_spec_info;
u8 serv_spec_info_len;
bool srf_include;
const u8 *srf_bf;
u8 srf_bf_len;
u8 srf_bf_idx;
struct mac_address *srf_macs;
int srf_num_macs;
struct cfg80211_nan_func_filter *rx_filters;
struct cfg80211_nan_func_filter *tx_filters;
u8 num_tx_filters;
u8 num_rx_filters;
u8 instance_id;
u64 cookie;
};

/**
* struct cfg80211_ops - backend description for wireless configuration
*
Expand Down Expand Up @@ -2589,6 +2693,19 @@ struct cfg80211_qos_map {
* and returning to the base channel for communication with the AP.
* @tdls_cancel_channel_switch: Stop channel-switching with a TDLS peer. Both
* peers must be on the base channel when the call completes.
* @start_nan: Start the NAN interface.
* @stop_nan: Stop the NAN interface.
* @add_nan_func: Add a NAN function. Returns negative value on failure.
* On success @nan_func ownership is transferred to the driver and
* it may access it outside of the scope of this function. The driver
* should free the @nan_func when no longer needed by calling
* cfg80211_free_nan_func().
* On success the driver should assign an instance_id in the
* provided @nan_func.
* @del_nan_func: Delete a NAN function.
* @nan_change_conf: changes NAN configuration. The changed parameters must
* be specified in @changes (using &enum cfg80211_nan_conf_changes);
* All other parameters must be ignored.
*/
struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
Expand Down Expand Up @@ -2854,6 +2971,17 @@ struct cfg80211_ops {
void (*tdls_cancel_channel_switch)(struct wiphy *wiphy,
struct net_device *dev,
const u8 *addr);
int (*start_nan)(struct wiphy *wiphy, struct wireless_dev *wdev,
struct cfg80211_nan_conf *conf);
void (*stop_nan)(struct wiphy *wiphy, struct wireless_dev *wdev);
int (*add_nan_func)(struct wiphy *wiphy, struct wireless_dev *wdev,
struct cfg80211_nan_func *nan_func);
void (*del_nan_func)(struct wiphy *wiphy, struct wireless_dev *wdev,
u64 cookie);
int (*nan_change_conf)(struct wiphy *wiphy,
struct wireless_dev *wdev,
struct cfg80211_nan_conf *conf,
u32 changes);
};

/*
Expand Down Expand Up @@ -2900,6 +3028,8 @@ struct cfg80211_ops {
* @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels.
* @WIPHY_FLAG_HAS_CHANNEL_SWITCH: Device supports channel switch in
* beaconing mode (AP, IBSS, Mesh, ...).
* @WIPHY_FLAG_HAS_STATIC_WEP: The device supports static WEP key installation
* before connection.
*/
enum wiphy_flags {
/* use hole at 0 */
Expand All @@ -2925,6 +3055,7 @@ enum wiphy_flags {
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21),
WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22),
WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23),
WIPHY_FLAG_HAS_STATIC_WEP = BIT(24),
};

/**
Expand Down Expand Up @@ -3302,6 +3433,8 @@ struct wiphy_iftype_ext_capab {
* @bss_select_support: bitmask indicating the BSS selection criteria supported
* by the driver in the .connect() callback. The bit position maps to the
* attribute indices defined in &enum nl80211_bss_select_attr.
*
* @cookie_counter: unique generic cookie counter, used to identify objects.
*/
struct wiphy {
/* assign these fields before you register the wiphy */
Expand Down Expand Up @@ -3431,6 +3564,8 @@ struct wiphy {

u32 bss_select_support;

u64 cookie_counter;

char priv[0] __aligned(NETDEV_ALIGN);
};

Expand Down Expand Up @@ -3611,6 +3746,7 @@ struct cfg80211_cached_keys;
* beacons, 0 when not valid
* @address: The address for this device, valid only if @netdev is %NULL
* @p2p_started: true if this is a P2P Device that has been started
* @nan_started: true if this is a NAN interface that has been started
* @cac_started: true if DFS channel availability check has been started
* @cac_start_time: timestamp (jiffies) when the dfs state was entered.
* @cac_time_ms: CAC time in ms
Expand Down Expand Up @@ -3642,7 +3778,7 @@ struct wireless_dev {

struct mutex mtx;

bool use_4addr, p2p_started;
bool use_4addr, p2p_started, nan_started;

u8 address[ETH_ALEN] __aligned(sizeof(u16));

Expand Down Expand Up @@ -5550,6 +5686,67 @@ wiphy_ext_feature_isset(struct wiphy *wiphy,
return (ft_byte & BIT(ftidx % 8)) != 0;
}

/**
* cfg80211_free_nan_func - free NAN function
* @f: NAN function that should be freed
*
* Frees all the NAN function and all it's allocated members.
*/
void cfg80211_free_nan_func(struct cfg80211_nan_func *f);

/**
* struct cfg80211_nan_match_params - NAN match parameters
* @type: the type of the function that triggered a match. If it is
* %NL80211_NAN_FUNC_SUBSCRIBE it means that we replied to a subscriber.
* If it is %NL80211_NAN_FUNC_PUBLISH, it means that we got a discovery
* result.
* If it is %NL80211_NAN_FUNC_FOLLOW_UP, we received a follow up.
* @inst_id: the local instance id
* @peer_inst_id: the instance id of the peer's function
* @addr: the MAC address of the peer
* @info_len: the length of the &info
* @info: the Service Specific Info from the peer (if any)
* @cookie: unique identifier of the corresponding function
*/
struct cfg80211_nan_match_params {
enum nl80211_nan_function_type type;
u8 inst_id;
u8 peer_inst_id;
const u8 *addr;
u8 info_len;
const u8 *info;
u64 cookie;
};

/**
* cfg80211_nan_match - report a match for a NAN function.
* @wdev: the wireless device reporting the match
* @match: match notification parameters
* @gfp: allocation flags
*
* This function reports that the a NAN function had a match. This
* can be a subscribe that had a match or a solicited publish that
* was sent. It can also be a follow up that was received.
*/
void cfg80211_nan_match(struct wireless_dev *wdev,
struct cfg80211_nan_match_params *match, gfp_t gfp);

/**
* cfg80211_nan_func_terminated - notify about NAN function termination.
*
* @wdev: the wireless device reporting the match
* @inst_id: the local instance id
* @reason: termination reason (one of the NL80211_NAN_FUNC_TERM_REASON_*)
* @cookie: unique NAN function identifier
* @gfp: allocation flags
*
* This function reports that the a NAN function is terminated.
*/
void cfg80211_nan_func_terminated(struct wireless_dev *wdev,
u8 inst_id,
enum nl80211_nan_func_term_reason reason,
u64 cookie, gfp_t gfp);

/* ethtool helper */
void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info);

Expand Down
3 changes: 3 additions & 0 deletions include/net/fq.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ struct fq {
u32 flows_cnt;
u32 perturbation;
u32 limit;
u32 memory_limit;
u32 memory_usage;
u32 quantum;
u32 backlog;
u32 overlimit;
u32 overmemory;
u32 collisions;
};

Expand Down
Loading

0 comments on commit 1ebf8b4

Please sign in to comment.