Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337121
b: refs/heads/master
c: 36ac9b0
h: refs/heads/master
i:
  337119: 069ba23
v: v3
  • Loading branch information
Bart Westgeest authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent 4e1ccff commit 567c46e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a297ad936ebd6d22b59bbed7d77caa6ff045caa6
refs/heads/master: 36ac9b055fa49b9a0097ec8dfd59c5ffc812a60d
2 changes: 1 addition & 1 deletion trunk/drivers/staging/usbip/stub_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static int stub_send_ret_submit(struct stub_device *sdev)
int ret;
struct urb *urb = priv->urb;
struct usbip_header pdu_header;
void *iso_buffer = NULL;
struct usbip_iso_packet_descriptor *iso_buffer = NULL;
struct kvec *iov = NULL;
int iovnum = 0;

Expand Down
23 changes: 10 additions & 13 deletions trunk/drivers/staging/usbip/usbip_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,28 +639,26 @@ static void usbip_pack_iso(struct usbip_iso_packet_descriptor *iso,
}

/* must free buffer */
void *usbip_alloc_iso_desc_pdu(struct urb *urb, ssize_t *bufflen)
struct usbip_iso_packet_descriptor*
usbip_alloc_iso_desc_pdu(struct urb *urb, ssize_t *bufflen)
{
void *buff;
struct usbip_iso_packet_descriptor *iso;
int np = urb->number_of_packets;
ssize_t size = np * sizeof(*iso);
int i;

buff = kzalloc(size, GFP_KERNEL);
if (!buff)
iso = kzalloc(size, GFP_KERNEL);
if (!iso)
return NULL;

for (i = 0; i < np; i++) {
iso = buff + (i * sizeof(*iso));

usbip_pack_iso(iso, &urb->iso_frame_desc[i], 1);
usbip_iso_packet_correct_endian(iso, 1);
usbip_pack_iso(&iso[i], &urb->iso_frame_desc[i], 1);
usbip_iso_packet_correct_endian(&iso[i], 1);
}

*bufflen = size;

return buff;
return iso;
}
EXPORT_SYMBOL_GPL(usbip_alloc_iso_desc_pdu);

Expand Down Expand Up @@ -703,11 +701,10 @@ int usbip_recv_iso(struct usbip_device *ud, struct urb *urb)
return -EPIPE;
}

iso = (struct usbip_iso_packet_descriptor *) buff;
for (i = 0; i < np; i++) {
iso = buff + (i * sizeof(*iso));

usbip_iso_packet_correct_endian(iso, 0);
usbip_pack_iso(iso, &urb->iso_frame_desc[i], 0);
usbip_iso_packet_correct_endian(&iso[i], 0);
usbip_pack_iso(&iso[i], &urb->iso_frame_desc[i], 0);
total_length += urb->iso_frame_desc[i].actual_length;
}

Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/staging/usbip/usbip_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ void usbip_pack_pdu(struct usbip_header *pdu, struct urb *urb, int cmd,
int pack);
void usbip_header_correct_endian(struct usbip_header *pdu, int send);

void *usbip_alloc_iso_desc_pdu(struct urb *urb, ssize_t *bufflen);
struct usbip_iso_packet_descriptor*
usbip_alloc_iso_desc_pdu(struct urb *urb, ssize_t *bufflen);

/* some members of urb must be substituted before. */
int usbip_recv_iso(struct usbip_device *ud, struct urb *urb);
void usbip_pad_iso(struct usbip_device *ud, struct urb *urb);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/usbip/vhci_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static int vhci_send_cmd_submit(struct vhci_device *vdev)
int ret;
struct urb *urb = priv->urb;
struct usbip_header pdu_header;
void *iso_buffer = NULL;
struct usbip_iso_packet_descriptor *iso_buffer = NULL;

txsize = 0;
memset(&pdu_header, 0, sizeof(pdu_header));
Expand Down

0 comments on commit 567c46e

Please sign in to comment.