Lines Matching refs:res

204 	struct tb_cfg_result res = { 0 };  in decode_error()  local
205 res.response_route = get_route(pkg->header); in decode_error()
206 res.response_port = 0; in decode_error()
207 res.err = check_header(response, sizeof(*pkg), TB_CFG_PKG_ERROR, in decode_error()
209 if (res.err) in decode_error()
210 return res; in decode_error()
215 res.err = 1; in decode_error()
216 res.tb_error = pkg->error; in decode_error()
217 res.response_port = pkg->port; in decode_error()
218 return res; in decode_error()
226 struct tb_cfg_result res = { 0 }; in parse_header() local
231 res.response_port = 0; /* will be updated later for cfg_read/write */ in parse_header()
232 res.response_route = get_route(*header); in parse_header()
233 res.err = check_header(pkg, len, type, route); in parse_header()
234 return res; in parse_header()
238 const struct tb_cfg_result *res) in tb_cfg_print_error() argument
240 WARN_ON(res->err != 1); in tb_cfg_print_error()
241 switch (res->tb_error) { in tb_cfg_print_error()
253 res->response_route, res->response_port); in tb_cfg_print_error()
262 res->response_route, res->response_port); in tb_cfg_print_error()
266 res->response_route, res->response_port); in tb_cfg_print_error()
271 res->response_route, res->response_port); in tb_cfg_print_error()
339 int res; in tb_ctl_tx() local
360 res = ring_tx(ctl->tx, &pkg->frame); in tb_ctl_tx()
361 if (res) /* ring is stopped */ in tb_ctl_tx()
363 return res; in tb_ctl_tx()
444 struct tb_cfg_result res; in tb_ctl_rx() local
457 res = parse_header(pkg, length, type, route); in tb_ctl_rx()
458 if (!res.err) in tb_ctl_rx()
461 return res; in tb_ctl_rx()
620 struct tb_cfg_result res = { 0 }; in tb_cfg_read_raw() local
632 res.err = tb_ctl_tx(ctl, &request, sizeof(request), TB_CFG_PKG_READ); in tb_cfg_read_raw()
633 if (res.err) in tb_cfg_read_raw()
634 return res; in tb_cfg_read_raw()
636 res = tb_ctl_rx(ctl, &reply, 12 + 4 * length, timeout_msec, route, in tb_cfg_read_raw()
638 if (res.err) in tb_cfg_read_raw()
639 return res; in tb_cfg_read_raw()
641 res.response_port = reply.addr.port; in tb_cfg_read_raw()
642 res.err = check_config_address(reply.addr, space, offset, length); in tb_cfg_read_raw()
643 if (!res.err) in tb_cfg_read_raw()
645 return res; in tb_cfg_read_raw()
657 struct tb_cfg_result res = { 0 }; in tb_cfg_write_raw() local
671 res.err = tb_ctl_tx(ctl, &request, 12 + 4 * length, TB_CFG_PKG_WRITE); in tb_cfg_write_raw()
672 if (res.err) in tb_cfg_write_raw()
673 return res; in tb_cfg_write_raw()
675 res = tb_ctl_rx(ctl, &reply, sizeof(reply), timeout_msec, route, in tb_cfg_write_raw()
677 if (res.err) in tb_cfg_write_raw()
678 return res; in tb_cfg_write_raw()
680 res.response_port = reply.addr.port; in tb_cfg_write_raw()
681 res.err = check_config_address(reply.addr, space, offset, length); in tb_cfg_write_raw()
682 return res; in tb_cfg_write_raw()
688 struct tb_cfg_result res = tb_cfg_read_raw(ctl, buffer, route, port, in tb_cfg_read() local
690 if (res.err == 1) { in tb_cfg_read()
691 tb_cfg_print_error(ctl, &res); in tb_cfg_read()
694 WARN(res.err, "tb_cfg_read: %d\n", res.err); in tb_cfg_read()
695 return res.err; in tb_cfg_read()
701 struct tb_cfg_result res = tb_cfg_write_raw(ctl, buffer, route, port, in tb_cfg_write() local
703 if (res.err == 1) { in tb_cfg_write()
704 tb_cfg_print_error(ctl, &res); in tb_cfg_write()
707 WARN(res.err, "tb_cfg_write: %d\n", res.err); in tb_cfg_write()
708 return res.err; in tb_cfg_write()
723 struct tb_cfg_result res = tb_cfg_read_raw(ctl, &dummy, route, 0, in tb_cfg_get_upstream_port() local
726 if (res.err == 1) in tb_cfg_get_upstream_port()
728 if (res.err) in tb_cfg_get_upstream_port()
729 return res.err; in tb_cfg_get_upstream_port()
730 return res.response_port; in tb_cfg_get_upstream_port()