summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/hci.h23
-rw-r--r--include/net/bluetooth/hci_core.h1
-rw-r--r--include/net/bluetooth/mgmt.h5
-rw-r--r--include/net/cfg80211.h36
-rw-r--r--include/net/dsa.h8
-rw-r--r--include/net/tsn.h114
6 files changed, 186 insertions, 1 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 5bc1e30dedde..ebe7606ab35d 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -204,6 +204,15 @@ enum {
*
*/
HCI_QUIRK_NON_PERSISTENT_SETUP,
+
+ /* When this quirk is set, wide band speech is supported by
+ * the driver since no reliable mechanism exist to report
+ * this from the hardware, a driver flag is use to convey
+ * this support
+ *
+ * This quirk must be set before hci_register_dev is called.
+ */
+ HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
};
/* HCI device flags */
@@ -276,6 +285,7 @@ enum {
HCI_FAST_CONNECTABLE,
HCI_BREDR_ENABLED,
HCI_LE_SCAN_INTERRUPTED,
+ HCI_WIDEBAND_SPEECH_ENABLED,
HCI_DUT_MODE,
HCI_VENDOR_DIAG,
@@ -1254,6 +1264,19 @@ struct hci_rp_read_tx_power {
__s8 tx_power;
} __packed;
+#define HCI_OP_READ_DEF_ERR_DATA_REPORTING 0x0c5a
+ #define ERR_DATA_REPORTING_DISABLED 0x00
+ #define ERR_DATA_REPORTING_ENABLED 0x01
+struct hci_rp_read_def_err_data_reporting {
+ __u8 status;
+ __u8 err_data_reporting;
+} __packed;
+
+#define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING 0x0c5b
+struct hci_cp_write_def_err_data_reporting {
+ __u8 err_data_reporting;
+} __packed;
+
#define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46
struct hci_rp_read_page_scan_type {
__u8 status;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 14d00cc10e22..594c21fb325f 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -253,6 +253,7 @@ struct hci_dev {
__u8 stored_num_keys;
__u8 io_capability;
__s8 inq_tx_power;
+ __u8 err_data_reporting;
__u16 page_scan_interval;
__u16 page_scan_window;
__u8 page_scan_type;
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 9cee7ddc6741..6a8a0ccb9d17 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -101,7 +101,8 @@ struct mgmt_rp_read_index_list {
#define MGMT_SETTING_PRIVACY 0x00002000
#define MGMT_SETTING_CONFIGURATION 0x00004000
#define MGMT_SETTING_STATIC_ADDRESS 0x00008000
-#define MGMT_SETTING_PHY_CONFIGURATION 0x00010000
+#define MGMT_SETTING_PHY_CONFIGURATION 0x00010000
+#define MGMT_SETTING_WIDEBAND_SPEECH 0x00020000
#define MGMT_OP_READ_INFO 0x0004
#define MGMT_READ_INFO_SIZE 0
@@ -654,6 +655,8 @@ struct mgmt_cp_set_phy_confguration {
} __packed;
#define MGMT_SET_PHY_CONFIGURATION_SIZE 4
+#define MGMT_OP_SET_WIDEBAND_SPEECH 0x0047
+
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
__le16 opcode;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 69b9ccbe1ad0..0170eb31769e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4022,6 +4022,7 @@ enum wiphy_flags {
WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22),
WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23),
WIPHY_FLAG_HAS_STATIC_WEP = BIT(24),
+ WIPHY_FLAG_DFS_OFFLOAD = BIT(25)
};
/**
@@ -5479,6 +5480,32 @@ void cfg80211_send_layer2_update(struct net_device *dev, const u8 *addr);
int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
/**
+ * regulatory_hint_user - hint to the wireless core a regulatory domain
+ * which the driver has received from an application
+ * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain
+ * should be in. If @rd is set this should be NULL. Note that if you
+ * set this to NULL you should still set rd->alpha2 to some accepted
+ * alpha2.
+ * @user_reg_hint_type: the type of user regulatory hint.
+ *
+ * Wireless drivers can use this function to hint to the wireless core
+ * the current regulatory domain as specified by trusted applications,
+ * it is the driver's responsibilty to estbalish which applications it
+ * trusts.
+ *
+ * The wiphy should be registered to cfg80211 prior to this call.
+ * For cfg80211 drivers this means you must first use wiphy_register(),
+ * for mac80211 drivers you must first use ieee80211_register_hw().
+ *
+ * Drivers should check the return value, its possible you can get
+ * an -ENOMEM or an -EINVAL.
+ *
+ * Return: 0 on success. -ENOMEM, -EINVAL.
+ */
+int regulatory_hint_user(const char *alpha2,
+ enum nl80211_user_reg_hint_type user_reg_hint_type);
+
+/**
* regulatory_set_wiphy_regd - set regdom info for self managed drivers
* @wiphy: the wireless device we want to process the regulatory domain on
* @rd: the regulatory domain informatoin to use for this wiphy
@@ -7450,6 +7477,15 @@ void cfg80211_pmsr_complete(struct wireless_dev *wdev,
bool cfg80211_iftype_allowed(struct wiphy *wiphy, enum nl80211_iftype iftype,
bool is_4addr, u8 check_swif);
+/**
+ * cfg80211_is_gratuitous_arp_unsolicited_na - packet is grat. ARP/unsol. NA
+ * @skb: the input packet, must be an ethernet frame already
+ *
+ * Return: %true if the packet is a gratuitous ARP or unsolicited NA packet.
+ * This is used to drop packets that shouldn't occur because the AP implements
+ * a proxy service.
+ */
+bool cfg80211_is_gratuitous_arp_unsolicited_na(struct sk_buff *skb);
/* Logging, debugging and troubleshooting/diagnostic helpers. */
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 541fb514e31d..5fbb0aa5b426 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -42,6 +42,7 @@ struct phylink_link_state;
#define DSA_TAG_PROTO_8021Q_VALUE 12
#define DSA_TAG_PROTO_SJA1105_VALUE 13
#define DSA_TAG_PROTO_KSZ8795_VALUE 14
+#define DSA_TAG_PROTO_OCELOT_VALUE 15
enum dsa_tag_protocol {
DSA_TAG_PROTO_NONE = DSA_TAG_PROTO_NONE_VALUE,
@@ -59,6 +60,7 @@ enum dsa_tag_protocol {
DSA_TAG_PROTO_8021Q = DSA_TAG_PROTO_8021Q_VALUE,
DSA_TAG_PROTO_SJA1105 = DSA_TAG_PROTO_SJA1105_VALUE,
DSA_TAG_PROTO_KSZ8795 = DSA_TAG_PROTO_KSZ8795_VALUE,
+ DSA_TAG_PROTO_OCELOT = DSA_TAG_PROTO_OCELOT_VALUE,
};
struct packet_type;
@@ -275,6 +277,11 @@ struct dsa_switch {
*/
bool vlan_filtering;
+ /* MAC PCS does not provide link state change interrupt, and requires
+ * polling. Flag passed on to PHYLINK.
+ */
+ bool pcs_poll;
+
/* Dynamically allocated ports, keep last */
size_t num_ports;
struct dsa_port ports[];
@@ -543,6 +550,7 @@ struct dsa_switch_ops {
*/
netdev_tx_t (*port_deferred_xmit)(struct dsa_switch *ds, int port,
struct sk_buff *skb);
+ int (*port_tsn_enable)(struct dsa_port *dp);
};
struct dsa_switch_driver {
diff --git a/include/net/tsn.h b/include/net/tsn.h
new file mode 100644
index 000000000000..f1c53bae76be
--- /dev/null
+++ b/include/net/tsn.h
@@ -0,0 +1,114 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/* Copyright 2017-2019 NXP */
+
+#ifndef __TSN_H__
+#define __TSN_H__
+
+#include <linux/notifier.h>
+#include <uapi/linux/tsn.h>
+
+enum tsn_notifier_type {
+ TSN_QBV_CONFIGCHANGETIME_ARRIVE = 1,
+};
+
+struct tsn_notifier_info {
+ struct net_device *dev;
+ union {
+ struct tsn_qbv_conf qbv_notify;
+ struct tsn_qci_psfp_sgi_conf qci_notify;
+ } ntdata;
+};
+
+static inline struct net_device *
+tsn_notifier_info_to_dev(const struct tsn_notifier_info *info)
+{
+ return info->dev;
+}
+
+struct tsn_ops {
+ void (*device_init)(struct net_device *ndev);
+ void (*device_deinit)(struct net_device *ndev);
+ u32 (*get_capability)(struct net_device *ndev);
+ /* Qbv standard */
+ int (*qbv_set)(struct net_device *ndev, struct tsn_qbv_conf *qbvconf);
+ int (*qbv_get)(struct net_device *ndev, struct tsn_qbv_conf *qbvconf);
+ int (*qbv_get_status)(struct net_device *ndev,
+ struct tsn_qbv_status *qbvstat);
+ int (*cb_streamid_set)(struct net_device *ndev, u32 index,
+ bool enable, struct tsn_cb_streamid *sid);
+ int (*cb_streamid_get)(struct net_device *ndev, u32 index,
+ struct tsn_cb_streamid *sid);
+ int (*cb_streamid_counters_get)(struct net_device *ndev, u32 index,
+ struct tsn_cb_streamid_counters *sidcounter);
+ int (*qci_get_maxcap)(struct net_device *ndev,
+ struct tsn_qci_psfp_stream_param *qcicapa);
+ int (*qci_sfi_set)(struct net_device *ndev, u32 index, bool enable,
+ struct tsn_qci_psfp_sfi_conf *sficonf);
+ /* return: 0 stream filter instance not valid
+ * 1 stream filter instance valid
+ * -1 error happened
+ */
+ int (*qci_sfi_get)(struct net_device *ndev, u32 index,
+ struct tsn_qci_psfp_sfi_conf *sficonf);
+ int (*qci_sfi_counters_get)(struct net_device *ndev, u32 index,
+ struct tsn_qci_psfp_sfi_counters *sficounter);
+ int (*qci_sgi_set)(struct net_device *ndev, u32 index,
+ struct tsn_qci_psfp_sgi_conf *sgiconf);
+ int (*qci_sgi_get)(struct net_device *ndev, u32 index,
+ struct tsn_qci_psfp_sgi_conf *sgiconf);
+ int (*qci_sgi_status_get)(struct net_device *ndev, u16 index,
+ struct tsn_psfp_sgi_status *sgistat);
+ int (*qci_fmi_set)(struct net_device *ndev, u32 index, bool enable,
+ struct tsn_qci_psfp_fmi *fmi);
+ int (*qci_fmi_get)(struct net_device *ndev, u32 index,
+ struct tsn_qci_psfp_fmi *fmi,
+ struct tsn_qci_psfp_fmi_counters *counters);
+ int (*cbs_set)(struct net_device *ndev, u8 tc, u8 bw);
+ int (*cbs_get)(struct net_device *ndev, u8 tc);
+ /* To set a 8 bits vector shows 8 traffic classes
+ * preemtable(1) or express(0)
+ */
+ int (*qbu_set)(struct net_device *ndev, u8 ptvector);
+ /* To get port preemtion status */
+ int (*qbu_get)(struct net_device *ndev,
+ struct tsn_preempt_status *preemptstat);
+ int (*tsd_set)(struct net_device *ndev, struct tsn_tsd *tsd);
+ int (*tsd_get)(struct net_device *ndev, struct tsn_tsd_status *stats);
+ int (*ct_set)(struct net_device *ndev, u8 cut_thru);
+ int (*cbgen_set)(struct net_device *ndev, u32 index,
+ struct tsn_seq_gen_conf *seqgen);
+ int (*cbrec_set)(struct net_device *ndev, u32 index,
+ struct tsn_seq_rec_conf *seqrec);
+ int (*cb_get)(struct net_device *ndev, u32 index,
+ struct tsn_cb_status *c);
+ int (*dscp_set)(struct net_device *ndev, bool enable,
+ const u8 dscp_ix,
+ struct tsn_qos_switch_dscp_conf *c);
+};
+
+enum ethdev_type {
+ TSN_SWITCH,
+ TSN_ENDPOINT,
+};
+
+#define GROUP_OFFSET_SWITCH 256
+
+struct tsn_port {
+ u16 groupid;
+ struct tsn_ops *tsnops;
+ struct net_device *netdev;
+ struct list_head list;
+ enum ethdev_type type;
+ u8 tc_nums;
+ struct tsn_notifier_info nd;
+};
+
+struct tsn_port *tsn_get_port(struct net_device *ndev);
+int register_tsn_notifier(struct notifier_block *nb);
+int unregister_tsn_notifier(struct notifier_block *nb);
+int call_tsn_notifiers(unsigned long val, struct net_device *dev,
+ struct tsn_notifier_info *info);
+int tsn_port_register(struct net_device *netdev,
+ struct tsn_ops *tsnops, u16 groupid);
+void tsn_port_unregister(struct net_device *netdev);
+#endif