int status = check_urb_status(urb);
int retval;
- if (status == -EAGAIN)
+ if (status) {
+ if (status != -EAGAIN)
+ dev_err(dev, "urb svc in error %d (dropped)\n", status);
goto exit;
- if (status)
- return;
+ }
/* We have a message, create a new message structure, add it to the
* list, and wake up our thread that will process the messages.
u8 cport;
u8 *data;
- if (status == -EAGAIN)
+ if (status) {
+ if (status != -EAGAIN)
+ dev_err(dev, "urb cport in error %d (dropped)\n",
+ status);
goto exit;
- if (status)
- return;
+ }
/* The size has to be at least one, for the cport id */
if (!urb->actual_length) {
unsigned long flags;
int i;
+ /* Record whether the transfer was successful */
+ gbuf->status = check_urb_status(urb);
+
/*
* See if this was an urb in our pool, if so mark it "free", otherwise
* we need to free it ourselves.
gbuf->outbound = outbound;
gbuf->complete = complete;
gbuf->context = context;
+ gbuf->status = -EBADR; /* Initial value--means "never set" */
/* Host controller specific allocation for the actual buffer */
retval = connection->hd->driver->alloc_gbuf_data(gbuf, size, gfp_mask);
{
struct greybus_host_device *hd = gbuf->connection->hd;
+ gbuf->status = -EINPROGRESS;
+
return hd->driver->submit_gbuf(gbuf, gfp_mask);
}
}
gb_operation_remove(operation);
gbuf = operation->response;
+ gbuf->status = GB_OP_SUCCESS; /* If we got here we're good */
if (size > gbuf->transfer_buffer_length) {
gb_connection_err(connection, "recv buffer too small");
return;