|
@@ -1,6 +1,6 @@
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
/*
|
|
|
- * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
|
|
|
+ * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
|
|
|
*/
|
|
|
|
|
|
#include <linux/atomic.h>
|
|
@@ -20,6 +20,7 @@
|
|
|
#include <linux/ipa.h>
|
|
|
#include <linux/random.h>
|
|
|
#include <linux/workqueue.h>
|
|
|
+#include <linux/version.h>
|
|
|
#include "rndis_ipa.h"
|
|
|
#include "ipa_common_i.h"
|
|
|
#include "ipa_pm.h"
|
|
@@ -247,7 +248,14 @@ static void rndis_ipa_packet_receive_notify
|
|
|
(void *private, enum ipa_dp_evt_type evt, unsigned long data);
|
|
|
static void rndis_ipa_tx_complete_notify
|
|
|
(void *private, enum ipa_dp_evt_type evt, unsigned long data);
|
|
|
+
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
|
|
+static void rndis_ipa_tx_timeout(struct net_device *net,
|
|
|
+ unsigned int txqueue);
|
|
|
+#else /* Legacy API. */
|
|
|
static void rndis_ipa_tx_timeout(struct net_device *net);
|
|
|
+#endif
|
|
|
+
|
|
|
static int rndis_ipa_stop(struct net_device *net);
|
|
|
static void rndis_ipa_enable_data_path(struct rndis_ipa_dev *rndis_ipa_ctx);
|
|
|
static struct sk_buff *rndis_encapsulate_skb(struct sk_buff *skb,
|
|
@@ -1075,7 +1083,12 @@ out:
|
|
|
dev_kfree_skb_any(skb);
|
|
|
}
|
|
|
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
|
|
+static void rndis_ipa_tx_timeout(struct net_device *net,
|
|
|
+ unsigned int txqueue)
|
|
|
+#else /* Legacy API. */
|
|
|
static void rndis_ipa_tx_timeout(struct net_device *net)
|
|
|
+#endif
|
|
|
{
|
|
|
struct rndis_ipa_dev *rndis_ipa_ctx = netdev_priv(net);
|
|
|
int outstanding = atomic_read(&rndis_ipa_ctx->outstanding_pkts);
|
|
@@ -2189,23 +2202,15 @@ static void rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx)
|
|
|
goto fail_file;
|
|
|
}
|
|
|
|
|
|
- file = debugfs_create_u32
|
|
|
+ debugfs_create_u32
|
|
|
("outstanding_high", flags_read_write,
|
|
|
rndis_ipa_ctx->directory,
|
|
|
&rndis_ipa_ctx->outstanding_high);
|
|
|
- if (!file) {
|
|
|
- RNDIS_IPA_ERROR("could not create outstanding_high file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
- file = debugfs_create_u32
|
|
|
+ debugfs_create_u32
|
|
|
("outstanding_low", flags_read_write,
|
|
|
rndis_ipa_ctx->directory,
|
|
|
&rndis_ipa_ctx->outstanding_low);
|
|
|
- if (!file) {
|
|
|
- RNDIS_IPA_ERROR("could not create outstanding_low file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
file = debugfs_create_file
|
|
|
("outstanding", flags_read_only,
|
|
@@ -2216,29 +2221,17 @@ static void rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx)
|
|
|
goto fail_file;
|
|
|
}
|
|
|
|
|
|
- file = debugfs_create_u8
|
|
|
+ debugfs_create_u8
|
|
|
("state", flags_read_only,
|
|
|
rndis_ipa_ctx->directory, (u8 *)&rndis_ipa_ctx->state);
|
|
|
- if (!file) {
|
|
|
- RNDIS_IPA_ERROR("could not create state file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
- file = debugfs_create_u32
|
|
|
+ debugfs_create_u32
|
|
|
("tx_dropped", flags_read_only,
|
|
|
rndis_ipa_ctx->directory, &rndis_ipa_ctx->tx_dropped);
|
|
|
- if (!file) {
|
|
|
- RNDIS_IPA_ERROR("could not create tx_dropped file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
- file = debugfs_create_u32
|
|
|
+ debugfs_create_u32
|
|
|
("rx_dropped", flags_read_only,
|
|
|
rndis_ipa_ctx->directory, &rndis_ipa_ctx->rx_dropped);
|
|
|
- if (!file) {
|
|
|
- RNDIS_IPA_ERROR("could not create rx_dropped file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
aggr_directory = debugfs_create_dir
|
|
|
(DEBUGFS_AGGR_DIR_NAME,
|
|
@@ -2257,48 +2250,29 @@ static void rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx)
|
|
|
goto fail_file;
|
|
|
}
|
|
|
|
|
|
- file = debugfs_create_u8
|
|
|
+ debugfs_create_u8
|
|
|
("aggr_enable", flags_read_write,
|
|
|
aggr_directory, (u8 *)&ipa_to_usb_ep_cfg.aggr.aggr_en);
|
|
|
- if (!file) {
|
|
|
- RNDIS_IPA_ERROR("could not create aggr_enable file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
- file = debugfs_create_u8
|
|
|
+ debugfs_create_u8
|
|
|
("aggr_type", flags_read_write,
|
|
|
aggr_directory, (u8 *)&ipa_to_usb_ep_cfg.aggr.aggr);
|
|
|
- if (!file) {
|
|
|
RNDIS_IPA_ERROR("could not create aggr_type file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
- file = debugfs_create_u32
|
|
|
+ debugfs_create_u32
|
|
|
("aggr_byte_limit", flags_read_write,
|
|
|
aggr_directory,
|
|
|
&ipa_to_usb_ep_cfg.aggr.aggr_byte_limit);
|
|
|
- if (!file) {
|
|
|
- RNDIS_IPA_ERROR("could not create aggr_byte_limit file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
- file = debugfs_create_u32
|
|
|
+ debugfs_create_u32
|
|
|
("aggr_time_limit", flags_read_write,
|
|
|
aggr_directory,
|
|
|
&ipa_to_usb_ep_cfg.aggr.aggr_time_limit);
|
|
|
- if (!file) {
|
|
|
- RNDIS_IPA_ERROR("could not create aggr_time_limit file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
- file = debugfs_create_u32
|
|
|
+ debugfs_create_u32
|
|
|
("aggr_pkt_limit", flags_read_write,
|
|
|
aggr_directory,
|
|
|
&ipa_to_usb_ep_cfg.aggr.aggr_pkt_limit);
|
|
|
- if (!file) {
|
|
|
- RNDIS_IPA_ERROR("could not create aggr_pkt_limit file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
file = debugfs_create_bool
|
|
|
("tx_dump_enable", flags_read_write,
|
|
@@ -2327,14 +2301,10 @@ static void rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx)
|
|
|
goto fail_file;
|
|
|
}
|
|
|
|
|
|
- file = debugfs_create_u32
|
|
|
+ debugfs_create_u32
|
|
|
("error_msec_sleep_time", flags_read_write,
|
|
|
rndis_ipa_ctx->directory,
|
|
|
&rndis_ipa_ctx->error_msec_sleep_time);
|
|
|
- if (!file) {
|
|
|
- RNDIS_IPA_ERROR("fail to create error_msec_sleep_time file\n");
|
|
|
- goto fail_file;
|
|
|
- }
|
|
|
|
|
|
file = debugfs_create_bool
|
|
|
("during_xmit_error", flags_read_only,
|