drivers/platform/chrome/cros_ec_proto_test_util.h

Source file repositories/reference/linux-study-clean/drivers/platform/chrome/cros_ec_proto_test_util.h

File Facts

System
Linux kernel
Corpus path
drivers/platform/chrome/cros_ec_proto_test_util.h
Extension
.h
Size
1461 bytes
Lines
52
Domain
Driver Families
Bucket
drivers/platform
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ec_xfer_mock {
	struct list_head list;
	struct kunit *test;

	/* input */
	void *i_data;

	/* output */
	int ret;
	int result;
	void *o_data;
	u32 o_data_len;

	/* input */
	/* Must be last -ends in a flexible-array member. */
	struct cros_ec_command msg;
};

extern int cros_kunit_ec_xfer_mock_default_result;
extern int cros_kunit_ec_xfer_mock_default_ret;
extern int cros_kunit_ec_cmd_xfer_mock_called;
extern int cros_kunit_ec_pkt_xfer_mock_called;

int cros_kunit_ec_xfer_mock(struct cros_ec_device *ec_dev, struct cros_ec_command *msg);
int cros_kunit_ec_cmd_xfer_mock(struct cros_ec_device *ec_dev, struct cros_ec_command *msg);
int cros_kunit_ec_pkt_xfer_mock(struct cros_ec_device *ec_dev, struct cros_ec_command *msg);
struct ec_xfer_mock *cros_kunit_ec_xfer_mock_add(struct kunit *test, size_t size);
struct ec_xfer_mock *cros_kunit_ec_xfer_mock_addx(struct kunit *test,
						  int ret, int result, size_t size);
struct ec_xfer_mock *cros_kunit_ec_xfer_mock_next(void);

extern int cros_kunit_readmem_mock_offset;
extern u8 *cros_kunit_readmem_mock_data;
extern int cros_kunit_readmem_mock_ret;

int cros_kunit_readmem_mock(struct cros_ec_device *ec_dev, unsigned int offset,
			    unsigned int bytes, void *dest);

void cros_kunit_mock_reset(void);

#endif

Annotation

Implementation Notes