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

Commit 62d83681 authored by David S. Miller's avatar David S. Miller
Browse files
parents 230f9bb7 e7fec0bb
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@
 *   i2400m_set_init_config()
 *   i2400m_cmd_get_state()
 * i2400m_dev_shutdown()        Called by i2400m_dev_stop()
 *   i2400m->bus_reset()
 *   i2400m_reset()
 *
 * i2400m_{cmd,get,set}_*()
 *   i2400m_msg_to_dev()
@@ -82,6 +82,13 @@
#define D_SUBMODULE control
#include "debug-levels.h"

int i2400m_passive_mode;	/* 0 (passive mode disabled) by default */
module_param_named(passive_mode, i2400m_passive_mode, int, 0644);
MODULE_PARM_DESC(passive_mode,
		 "If true, the driver will not do any device setup "
		 "and leave it up to user space, who must be properly "
		 "setup.");


/*
 * Return if a TLV is of a give type and size
@@ -263,7 +270,7 @@ int i2400m_msg_check_status(const struct i2400m_l3l4_hdr *l3l4_hdr,

	if (status == 0)
		return 0;
	if (status > ARRAY_SIZE(ms_to_errno)) {
	if (status >= ARRAY_SIZE(ms_to_errno)) {
		str = "unknown status code";
		result = -EBADR;
	} else {
@@ -336,7 +343,7 @@ void i2400m_report_tlv_system_state(struct i2400m *i2400m,
		/* Huh? just in case, shut it down */
		dev_err(dev, "HW BUG? unknown state %u: shutting down\n",
			i2400m_state);
		i2400m->bus_reset(i2400m, I2400M_RT_WARM);
		i2400m_reset(i2400m, I2400M_RT_WARM);
		break;
	};
	d_fnend(3, dev, "(i2400m %p ss %p [%u]) = void\n",
@@ -1335,6 +1342,8 @@ int i2400m_dev_initialize(struct i2400m *i2400m)
	unsigned argc = 0;

	d_fnstart(3, dev, "(i2400m %p)\n", i2400m);
	if (i2400m_passive_mode)
		goto out_passive;
	/* Disable idle mode? (enabled by default) */
	if (i2400m_idle_mode_disabled) {
		if (i2400m_le_v1_3(i2400m)) {
@@ -1377,6 +1386,7 @@ int i2400m_dev_initialize(struct i2400m *i2400m)
	result = i2400m_set_init_config(i2400m, args, argc);
	if (result < 0)
		goto error;
out_passive:
	/*
	 * Update state: Here it just calls a get state; parsing the
	 * result (System State TLV and RF Status TLV [done in the rx
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ int debugfs_i2400m_reset_set(void *data, u64 val)
	case I2400M_RT_WARM:
	case I2400M_RT_COLD:
	case I2400M_RT_BUS:
		result = i2400m->bus_reset(i2400m, rt);
		result = i2400m_reset(i2400m, rt);
		if (result >= 0)
			result = 0;
	default:
+364 −136

File changed.

Preview size limit exceeded, changes collapsed.

+729 −157

File changed.

Preview size limit exceeded, changes collapsed.

+15 −1
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@

/* Host-Device interface for SDIO */
enum {
	I2400M_SDIO_BOOT_RETRIES = 3,
	I2400MS_BLK_SIZE = 256,
	I2400MS_PL_SIZE_MAX = 0x3E00,

@@ -77,9 +78,11 @@ enum {
	I2400MS_INTR_GET_SIZE_ADDR = 0x2C,
	/* The number of ticks to wait for the device to signal that
	 * it is ready */
	I2400MS_INIT_SLEEP_INTERVAL = 10,
	I2400MS_INIT_SLEEP_INTERVAL = 100,
	/* How long to wait for the device to settle after reset */
	I2400MS_SETTLE_TIME = 40,
	/* The number of msec to wait for IOR after sending IOE */
	IWMC3200_IOR_TIMEOUT = 10,
};


@@ -97,6 +100,14 @@ enum {
 * @tx_workqueue: workqeueue used for data TX; we don't use the
 *     system's workqueue as that might cause deadlocks with code in
 *     the bus-generic driver.
 *
 * @debugfs_dentry: dentry for the SDIO specific debugfs files
 *
 *     Note this value is set to NULL upon destruction; this is
 *     because some routinges use it to determine if we are inside the
 *     probe() path or some other path. When debugfs is disabled,
 *     creation sets the dentry to '(void*) -ENODEV', which is valid
 *     for the test.
 */
struct i2400ms {
	struct i2400m i2400m;		/* FIRST! See doc */
@@ -111,6 +122,9 @@ struct i2400ms {
	wait_queue_head_t bm_wfa_wq;
	int bm_wait_result;
	size_t bm_ack_size;

	/* Device is any of the iwmc3200 SKUs */
	unsigned iwmc3200:1;
};


Loading