Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a95cf1be authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "defconfig: sdxprairie: Enable AQC IPA offload driver"

parents 44a0fc2c e0c3a0a0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ CONFIG_SCSI_SCAN_ASYNC=y
CONFIG_NETDEVICES=y
CONFIG_TUN=y
CONFIG_AQFWD=y
CONFIG_AQFWD_QCOM=y
CONFIG_AQFWD_QCOM_IPA=y
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_FARADAY is not set
@@ -346,6 +346,8 @@ CONFIG_GSI_REGISTER_VERSION_2=y
CONFIG_MSM_MHI_DEV=y
CONFIG_IPA3=y
CONFIG_IPA_WDI_UNIFIED_API=y
CONFIG_IPA_ETH=y
CONFIG_AQC_IPA=y
CONFIG_RMNET_IPA3=y
CONFIG_ECM_IPA=y
CONFIG_RNDIS_IPA=y
+4 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ CONFIG_SCSI_SCAN_ASYNC=y
CONFIG_NETDEVICES=y
CONFIG_TUN=y
CONFIG_AQFWD=y
CONFIG_AQFWD_QCOM=y
CONFIG_AQFWD_QCOM_IPA=y
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_FARADAY is not set
@@ -349,6 +349,9 @@ CONFIG_MSM_MHI_DEV=y
CONFIG_IPA3=y
CONFIG_IPA_DEBUG=y
CONFIG_IPA_WDI_UNIFIED_API=y
CONFIG_IPA_ETH=y
CONFIG_AQC_IPA=y
CONFIG_AQC_IPA_DEBUG=y
CONFIG_RMNET_IPA3=y
CONFIG_ECM_IPA=y
CONFIG_RNDIS_IPA=y
+8 −3
Original line number Diff line number Diff line
@@ -89,14 +89,19 @@ static struct ipa_eth_channel *atl_ipa_request_channel(
	channel->direction = dir;
	channel->queue = ring->idx;

	channel->desc_mem.size = ring->hw.size * 16;
	channel->desc_size = 16;
	channel->desc_count = ring->hw.size;
	channel->desc_mem.size = channel->desc_size * channel->desc_count;

	channel->desc_mem.vaddr = ring->hw.descs;
	channel->desc_mem.daddr = ring->hw.daddr;
	channel->desc_mem.paddr =
		page_to_phys(vmalloc_to_page(channel->desc_mem.vaddr));

	channel->buff_mem.size =
		ATL_IPA_DEFAULT_RING_SZ * ATL_IPA_DEFAULT_BUFF_SZ;
	channel->buff_size = ATL_IPA_DEFAULT_BUFF_SZ;
	channel->buff_count = channel->desc_count;
	channel->buff_mem.size = channel->buff_size * channel->buff_count;

	channel->buff_mem.vaddr = (void *)ring->bufs->vaddr_vec;
	channel->buff_mem.daddr = ring->bufs->daddr_vec_base;
	channel->buff_mem.paddr = virt_to_phys((void *)ring->bufs->vaddr_vec);
+10 −0
Original line number Diff line number Diff line
@@ -31,3 +31,13 @@ config AQC_IPA_PROXY_HOST
	  need to be available and configured to receive the MSI.

endchoice

config AQC_IPA_DEBUG
	bool "Aquantia IPA Ethernet Offload Driver Debugging Support"
	depends on AQC_IPA
	help
	  Enable various debug features provided by Aquantia IPA
	  offload driver. Using this feature may add a lot of
	  additional log messages and panic on bugs. Enable this
	  option with caution.
	  If unsure, say N.
+73 −3
Original line number Diff line number Diff line
@@ -30,10 +30,14 @@ static LIST_HEAD(ipa_eth_devices);
static DEFINE_MUTEX(ipa_eth_devices_lock);

static bool ipa_eth_noauto = IPA_ETH_NOAUTO_DEFAULT;
module_param(ipa_eth_noauto, bool, 0644);
module_param(ipa_eth_noauto, bool, 0444);
MODULE_PARM_DESC(ipa_eth_noauto,
	"Disable automatic offload initialization of interfaces");

static bool ipa_eth_ipc_logdbg = IPA_ETH_IPC_LOGDBG_DEFAULT;
module_param(ipa_eth_ipc_logdbg, bool, 0444);
MODULE_PARM_DESC(ipa_eth_ipc_logdbg, "Log debug IPC messages");

static inline bool ipa_eth_ready(void)
{
	return ipa_eth_is_ready &&
@@ -570,6 +574,8 @@ int ipa_eth_register_device(struct ipa_eth_device *eth_dev)

	list_add(&eth_dev->device_list, &ipa_eth_devices);

	ipa_eth_dev_log(eth_dev, "Registered new device");

	(void) __ipa_eth_pair_device(eth_dev);

	mutex_unlock(&ipa_eth_devices_lock);
@@ -584,6 +590,8 @@ void ipa_eth_unregister_device(struct ipa_eth_device *eth_dev)
	__ipa_eth_unpair_device(eth_dev);
	list_del(&eth_dev->device_list);

	ipa_eth_dev_log(eth_dev, "Unregistered device");

	mutex_unlock(&ipa_eth_devices_lock);
}

@@ -727,7 +735,15 @@ int ipa_eth_iommu_unmap(struct iommu_domain *domain,
 */
int ipa_eth_register_net_driver(struct ipa_eth_net_driver *nd)
{
	return ipa_eth_bus_register_driver(nd);
	int rc;

	rc = ipa_eth_bus_register_driver(nd);
	if (rc)
		ipa_eth_err("Failed to register network driver %s", nd->name);
	else
		ipa_eth_log("Registered network driver %s", nd->name);

	return rc;
}
EXPORT_SYMBOL(ipa_eth_register_net_driver);

@@ -737,7 +753,7 @@ EXPORT_SYMBOL(ipa_eth_register_net_driver);
 */
void ipa_eth_unregister_net_driver(struct ipa_eth_net_driver *nd)
{
	return ipa_eth_bus_unregister_driver(nd);
	ipa_eth_bus_unregister_driver(nd);
}
EXPORT_SYMBOL(ipa_eth_unregister_net_driver);

@@ -758,6 +774,8 @@ int ipa_eth_register_offload_driver(struct ipa_eth_offload_driver *od)
		return rc;
	}

	ipa_eth_log("Registered offload driver %s", od->name);

	ipa_eth_pair_devices();

	return 0;
@@ -772,6 +790,8 @@ void ipa_eth_unregister_offload_driver(struct ipa_eth_offload_driver *od)
{
	ipa_eth_unpair_devices(od);
	ipa_eth_offload_unregister_driver(od);

	ipa_eth_log("Unregistered offload driver %s", od->name);
}
EXPORT_SYMBOL(ipa_eth_unregister_offload_driver);

@@ -826,6 +846,12 @@ static int ipa_eth_debugfs_init(void)
	(void) debugfs_create_bool("uc_ready", 0444,
				   ipa_eth_debugfs, &ipa_eth_ipa_uc_is_ready);

	(void) debugfs_create_bool("no_auto", 0644,
				   ipa_eth_debugfs, &ipa_eth_noauto);

	(void) debugfs_create_bool("ipc_logdbg", 0644,
				   ipa_eth_debugfs, &ipa_eth_ipc_logdbg);

	return 0;

err_exit:
@@ -833,12 +859,53 @@ static int ipa_eth_debugfs_init(void)
	return rc;
}

static void *ipa_eth_ipc_logbuf;

void *ipa_eth_get_ipc_logbuf(void)
{
	return ipa_eth_ipc_logbuf;
}
EXPORT_SYMBOL(ipa_eth_get_ipc_logbuf);

void *ipa_eth_get_ipc_logbuf_dbg(void)
{
	return ipa_eth_ipc_logdbg ? ipa_eth_ipc_logbuf : NULL;
}
EXPORT_SYMBOL(ipa_eth_get_ipc_logbuf_dbg);

#define IPA_ETH_IPC_LOG_PAGES 50

static int ipa_eth_ipc_log_init(void)
{
	if (ipa_eth_ipc_logbuf)
		return 0;

	ipa_eth_ipc_logbuf = ipc_log_context_create(
				IPA_ETH_IPC_LOG_PAGES, IPA_ETH_SUBSYS, 0);

	return ipa_eth_ipc_logbuf ? 0 : -EFAULT;
}

static void ipa_eth_ipc_log_cleanup(void)
{
	if (ipa_eth_ipc_logbuf) {
		ipc_log_context_destroy(ipa_eth_ipc_logbuf);
		ipa_eth_ipc_logbuf = NULL;
	}
}

int ipa_eth_init(void)
{
	int rc;

	ipa_eth_dbg("Initializing IPA Ethernet Offload Sub-System");

	rc = ipa_eth_ipc_log_init();
	if (rc) {
		ipa_eth_err("Failed to initialize IPC logging");
		goto err_ipclog;
	}

	rc = ipa_eth_debugfs_init();
	if (rc) {
		ipa_eth_err("Failed to initialize debugfs");
@@ -884,6 +951,8 @@ int ipa_eth_init(void)
err_bus:
	ipa_eth_debugfs_cleanup();
err_dbgfs:
	ipa_eth_ipc_log_cleanup();
err_ipclog:
	return rc;
}

@@ -899,4 +968,5 @@ void ipa_eth_exit(void)
	ipa_eth_offload_modexit();
	ipa_eth_bus_modexit();
	ipa_eth_debugfs_cleanup();
	ipa_eth_ipc_log_cleanup();
}
Loading