Lines Matching refs:mock

26 	struct ec_xfer_mock *mock;  in cros_kunit_ec_xfer_mock()  local
28 mock = list_first_entry_or_null(&cros_kunit_ec_xfer_mock_in, struct ec_xfer_mock, list); in cros_kunit_ec_xfer_mock()
29 if (!mock) { in cros_kunit_ec_xfer_mock()
34 list_del(&mock->list); in cros_kunit_ec_xfer_mock()
36 memcpy(&mock->msg, msg, sizeof(*msg)); in cros_kunit_ec_xfer_mock()
38 mock->i_data = kunit_kzalloc(mock->test, msg->outsize, GFP_KERNEL); in cros_kunit_ec_xfer_mock()
39 if (mock->i_data) in cros_kunit_ec_xfer_mock()
40 memcpy(mock->i_data, msg->data, msg->outsize); in cros_kunit_ec_xfer_mock()
43 msg->result = mock->result; in cros_kunit_ec_xfer_mock()
45 memcpy(msg->data, mock->o_data, min(msg->insize, mock->o_data_len)); in cros_kunit_ec_xfer_mock()
47 list_add_tail(&mock->list, &cros_kunit_ec_xfer_mock_out); in cros_kunit_ec_xfer_mock()
49 return mock->ret; in cros_kunit_ec_xfer_mock()
72 struct ec_xfer_mock *mock; in cros_kunit_ec_xfer_mock_addx() local
74 mock = kunit_kzalloc(test, sizeof(*mock), GFP_KERNEL); in cros_kunit_ec_xfer_mock_addx()
75 if (!mock) in cros_kunit_ec_xfer_mock_addx()
78 list_add_tail(&mock->list, &cros_kunit_ec_xfer_mock_in); in cros_kunit_ec_xfer_mock_addx()
79 mock->test = test; in cros_kunit_ec_xfer_mock_addx()
81 mock->ret = ret; in cros_kunit_ec_xfer_mock_addx()
82 mock->result = result; in cros_kunit_ec_xfer_mock_addx()
83 mock->o_data = kunit_kzalloc(test, size, GFP_KERNEL); in cros_kunit_ec_xfer_mock_addx()
84 if (!mock->o_data) in cros_kunit_ec_xfer_mock_addx()
86 mock->o_data_len = size; in cros_kunit_ec_xfer_mock_addx()
88 return mock; in cros_kunit_ec_xfer_mock_addx()
93 struct ec_xfer_mock *mock; in cros_kunit_ec_xfer_mock_next() local
95 mock = list_first_entry_or_null(&cros_kunit_ec_xfer_mock_out, struct ec_xfer_mock, list); in cros_kunit_ec_xfer_mock_next()
96 if (mock) in cros_kunit_ec_xfer_mock_next()
97 list_del(&mock->list); in cros_kunit_ec_xfer_mock_next()
99 return mock; in cros_kunit_ec_xfer_mock_next()