void handle_push(struct cfw_message *msg)
{
	ll_storage_push_req_msg_t * req = (ll_storage_push_req_msg_t *) msg;
	ll_storage_push_rsp_msg_t * resp =
		(ll_storage_push_rsp_msg_t *) cfw_alloc_rsp_msg(msg,
		MSG_ID_LL_PUSH_RSP, sizeof(*resp));
	DRIVER_API_RC ret = DRV_RC_FAIL;

	if (cir_storage_push((cir_storage_t *)req->storage, req->buffer, req->size) ==
			CBUFFER_STORAGE_SUCCESS) {
			ret = DRV_RC_OK;
	}

	resp->rsp_header.status = ret;
	cfw_send_message(resp);
}
Esempio n. 2
0
void handle_push(struct cfw_message *msg)
{
	circular_storage_push_req_msg_t *req =
		(circular_storage_push_req_msg_t *)msg;
	circular_storage_service_push_rsp_msg_t *resp =
		(circular_storage_service_push_rsp_msg_t *)cfw_alloc_rsp_msg(
			msg,
			MSG_ID_CIRCULAR_STORAGE_SERVICE_PUSH_RSP,
			sizeof(*resp));
	DRIVER_API_RC ret = DRV_RC_FAIL;

	if (cir_storage_push((cir_storage_t *)req->storage, req->buffer) ==
	    CBUFFER_STORAGE_SUCCESS) {
		ret = DRV_RC_OK;
	}

	resp->status = ret;
	cfw_send_message(resp);
}