Update to 2.6.32.39 Mainline
/drivers/staging/usbip/usbip_common.c
blob:719e0c1830f8fe54c89fedde14431b97d67e5d25 -> blob:ddb6f5fd04d56b024aa9d9f3e1ebe6c0e66f1adb
--- drivers/staging/usbip/usbip_common.c
+++ drivers/staging/usbip/usbip_common.c
@@ -361,11 +361,10 @@ void usbip_dump_header(struct usbip_head
usbip_udbg("CMD_UNLINK: seq %u\n", pdu->u.cmd_unlink.seqnum);
break;
case USBIP_RET_SUBMIT:
- usbip_udbg("RET_SUBMIT: st %d al %u sf %d #p %d ec %d\n",
+ usbip_udbg("RET_SUBMIT: st %d al %u sf %d ec %d\n",
pdu->u.ret_submit.status,
pdu->u.ret_submit.actual_length,
pdu->u.ret_submit.start_frame,
- pdu->u.ret_submit.number_of_packets,
pdu->u.ret_submit.error_count);
case USBIP_RET_UNLINK:
usbip_udbg("RET_UNLINK: status %d\n", pdu->u.ret_unlink.status);
@@ -687,7 +686,6 @@ static void usbip_pack_ret_submit(struct
rpdu->status = urb->status;
rpdu->actual_length = urb->actual_length;
rpdu->start_frame = urb->start_frame;
- rpdu->number_of_packets = urb->number_of_packets;
rpdu->error_count = urb->error_count;
} else {
/* vhci_rx.c */
@@ -695,7 +693,6 @@ static void usbip_pack_ret_submit(struct
urb->status = rpdu->status;
urb->actual_length = rpdu->actual_length;
urb->start_frame = rpdu->start_frame;
- urb->number_of_packets = rpdu->number_of_packets;
urb->error_count = rpdu->error_count;
}
}
@@ -764,13 +761,11 @@ static void correct_endian_ret_submit(st
cpu_to_be32s(&pdu->status);
cpu_to_be32s(&pdu->actual_length);
cpu_to_be32s(&pdu->start_frame);
- cpu_to_be32s(&pdu->number_of_packets);
cpu_to_be32s(&pdu->error_count);
} else {
be32_to_cpus(&pdu->status);
be32_to_cpus(&pdu->actual_length);
be32_to_cpus(&pdu->start_frame);
- cpu_to_be32s(&pdu->number_of_packets);
be32_to_cpus(&pdu->error_count);
}
}
@@ -896,7 +891,6 @@ int usbip_recv_iso(struct usbip_device *
int size = np * sizeof(*iso);
int i;
int ret;
- int total_length = 0;
if (!usb_pipeisoc(urb->pipe))
return 0;
@@ -926,75 +920,19 @@ int usbip_recv_iso(struct usbip_device *
return -EPIPE;
}
-
for (i = 0; i < np; i++) {
iso = buff + (i * sizeof(*iso));
usbip_iso_pakcet_correct_endian(iso, 0);
usbip_pack_iso(iso, &urb->iso_frame_desc[i], 0);
- total_length += urb->iso_frame_desc[i].actual_length;
}
kfree(buff);
- if (total_length != urb->actual_length) {
- dev_err(&urb->dev->dev,
- "total length of iso packets (%d) not equal to actual length of buffer (%d)\n",
- total_length, urb->actual_length);
-
- if (ud->side == USBIP_STUB)
- usbip_event_add(ud, SDEV_EVENT_ERROR_TCP);
- else
- usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);
-
- return -EPIPE;
- }
-
return ret;
}
EXPORT_SYMBOL_GPL(usbip_recv_iso);
-/*
- * This functions restores the padding which was removed for optimizing
- * the bandwidth during transfer over tcp/ip
- *
- * buffer and iso packets need to be stored and be in propeper endian in urb
- * before calling this function
- */
-int usbip_pad_iso(struct usbip_device *ud, struct urb *urb)
-{
- int np = urb->number_of_packets;
- int i;
- int ret;
- int actualoffset = urb->actual_length;
-
- if (!usb_pipeisoc(urb->pipe))
- return 0;
-
- /* if no packets or length of data is 0, then nothing to unpack */
- if (np == 0 || urb->actual_length == 0)
- return 0;
-
- /*
- * if actual_length is transfer_buffer_length then no padding is
- * present.
- */
- if (urb->actual_length == urb->transfer_buffer_length)
- return 0;
-
- /*
- * loop over all packets from last to first (to prevent overwritting
- * memory when padding) and move them into the proper place
- */
- for (i = np-1; i > 0; i--) {
- actualoffset -= urb->iso_frame_desc[i].actual_length;
- memmove(urb->transfer_buffer + urb->iso_frame_desc[i].offset,
- urb->transfer_buffer + actualoffset,
- urb->iso_frame_desc[i].actual_length);
- }
- return ret;
-}
-EXPORT_SYMBOL_GPL(usbip_pad_iso);
/* some members of urb must be substituted before. */
int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb)