Lines Matching refs:req
255 static bool icm_match(const struct tb_cfg_request *req,
259 const struct icm_pkg_header *req_hdr = req->request;
261 if (pkg->frame.eof != req->response_type)
269 static bool icm_copy(struct tb_cfg_request *req, const struct ctl_pkg *pkg)
273 if (hdr->packet_id < req->npackets) {
274 size_t offset = hdr->packet_id * req->response_size;
276 memcpy(req->response + offset, pkg->buffer, req->response_size);
289 struct tb_cfg_request *req;
292 req = tb_cfg_request_alloc();
293 if (!req)
296 req->match = icm_match;
297 req->copy = icm_copy;
298 req->request = request;
299 req->request_size = request_size;
300 req->request_type = TB_CFG_PKG_ICM_CMD;
301 req->response = response;
302 req->npackets = npackets;
303 req->response_size = response_size;
304 req->response_type = TB_CFG_PKG_ICM_RESP;
307 res = tb_cfg_request_sync(tb->ctl, req, timeout_msec);
310 tb_cfg_request_put(req);