diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-12-13 14:11:54 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-12-13 14:11:54 -0800 |
commit | c4dbb1e1443887c88f0af46fb7c83d13a9597cfc (patch) | |
tree | 44ded7422c94f3e207f04a3cadca2f55347cae6c /usb | |
parent | 1d73f8fce5c1442af64cb5de4056420a2728f396 (diff) | |
download | patches-c4dbb1e1443887c88f0af46fb7c83d13a9597cfc.tar.gz |
updates to usbip from akpm and bunk
Diffstat (limited to 'usb')
-rw-r--r-- | usb/usbip.patch | 139 |
1 files changed, 71 insertions, 68 deletions
diff --git a/usb/usbip.patch b/usb/usbip.patch index 8d49944f3bf5d4..8a242cd2c4a643 100644 --- a/usb/usbip.patch +++ b/usb/usbip.patch @@ -17,7 +17,7 @@ a link to the userspace tools needed to get this to work. drivers/usb/ip/stub_main.c | 319 +++++++++++++ drivers/usb/ip/stub_rx.c | 320 +++++++++++++ drivers/usb/ip/stub_tx.c | 205 ++++++++ - drivers/usb/ip/usbip_common.c | 857 +++++++++++++++++++++++++++++++++++ + drivers/usb/ip/usbip_common.c | 860 +++++++++++++++++++++++++++++++++++ drivers/usb/ip/usbip_common.h | 392 ++++++++++++++++ drivers/usb/ip/usbip_event.c | 147 ++++++ drivers/usb/ip/vhci.h | 110 ++++ @@ -25,7 +25,7 @@ a link to the userspace tools needed to get this to work. drivers/usb/ip/vhci_rx.c | 149 ++++++ drivers/usb/ip/vhci_sysfs.c | 265 ++++++++++ drivers/usb/ip/vhci_tx.c | 165 ++++++ - 17 files changed, 4516 insertions(+) + 17 files changed, 4519 insertions(+) --- gregkh-2.6.orig/drivers/usb/Kconfig +++ gregkh-2.6/drivers/usb/Kconfig @@ -464,7 +464,7 @@ a link to the userspace tools needed to get this to work. + * + * Allocates and initializes a new stub_devce struct. + */ -+struct stub_device * stub_device_alloc(struct usb_interface *interface) ++static struct stub_device * stub_device_alloc(struct usb_interface *interface) +{ + struct stub_device *sdev; + @@ -504,7 +504,7 @@ a link to the userspace tools needed to get this to work. + return sdev; +} + -+int stub_device_free(struct stub_device *sdev) ++static int stub_device_free(struct stub_device *sdev) +{ + if( !sdev ) return -EINVAL; + @@ -1029,7 +1029,7 @@ a link to the userspace tools needed to get this to work. + +static int stub_recv_unlink(struct stub_device *sdev, struct usbip_header *pdu) +{ -+ __u32 seqnum = pdu->unlink.seqnum; ++ __u32 seqnum = pdu->u.unlink.seqnum; + struct list_head *listhead = &sdev->priv_init; + struct list_head *ptr; + struct stub_priv *priv; @@ -1122,7 +1122,7 @@ a link to the userspace tools needed to get this to work. + * setup a urb + */ + if (usb_pipeisoc(pdu->base.pipe)) -+ priv->urb = usb_alloc_urb(pdu->submit.number_of_packets, GFP_KERNEL); ++ priv->urb = usb_alloc_urb(pdu->u.submit.number_of_packets, GFP_KERNEL); + else + priv->urb = usb_alloc_urb(0, GFP_KERNEL); + @@ -1133,14 +1133,14 @@ a link to the userspace tools needed to get this to work. + } + + /* set priv->urb->transfer_buffer */ -+ if (pdu->submit.transfer_buffer_length > 0) { -+ priv->urb->transfer_buffer = kmalloc(pdu->submit.transfer_buffer_length, GFP_KERNEL); ++ if (pdu->u.submit.transfer_buffer_length > 0) { ++ priv->urb->transfer_buffer = kmalloc(pdu->u.submit.transfer_buffer_length, GFP_KERNEL); + if (!priv->urb->transfer_buffer) { + VHCI_ERROR("malloc x_buff\n"); + usbip_event_add(ud, SDEV_EVENT_ERROR_MALLOC); + return; + } -+ memset(priv->urb->transfer_buffer, 0, pdu->submit.transfer_buffer_length); ++ memset(priv->urb->transfer_buffer, 0, pdu->u.submit.transfer_buffer_length); + } + + /* set priv->urb->setup_packet */ @@ -1152,7 +1152,7 @@ a link to the userspace tools needed to get this to work. + return; + } + memset(priv->urb->setup_packet, 0, 8); -+ memcpy(priv->urb->setup_packet, &pdu->submit.setup, 8); ++ memcpy(priv->urb->setup_packet, &pdu->u.submit.setup, 8); + } + + priv->urb->context = (void *) priv; @@ -1473,7 +1473,7 @@ a link to the userspace tools needed to get this to work. +} --- /dev/null +++ gregkh-2.6/drivers/usb/ip/usbip_common.c -@@ -0,0 +1,857 @@ +@@ -0,0 +1,860 @@ +/* + * $Id: usbip_common.c 265 2005-09-01 09:24:10Z taka-hir $ + * @@ -2084,21 +2084,24 @@ a link to the userspace tools needed to get this to work. + switch(pdu->base.command) { + case VHC_C_SUBMIT: + VHCI_DEBUG("SUBMIT: x_flags %u x_len %u bw %u sf %u #p %u iv %u\n", -+ pdu->submit.transfer_flags, -+ pdu->submit.transfer_buffer_length, -+ pdu->submit.bandwidth, -+ pdu->submit.start_frame, -+ pdu->submit.number_of_packets, -+ pdu->submit.interval); ++ pdu->u.submit.transfer_flags, ++ pdu->u.submit.transfer_buffer_length, ++ pdu->u.submit.bandwidth, ++ pdu->u.submit.start_frame, ++ pdu->u.submit.number_of_packets, ++ pdu->u.submit.interval); + break; + case VHC_C_UNLINK: -+ VHCI_DEBUG("UNLINK: seq %u\n", pdu->unlink.seqnum); ++ VHCI_DEBUG("UNLINK: seq %u\n", pdu->u.unlink.seqnum); + break; + case VHC_C_RETURN: + VHCI_DEBUG("RETURN: st %d x_flags %u al %u bw %u sf %d ec %d\n", -+ pdu->ret.status, pdu->ret.transfer_flags, pdu->ret.actual_length, -+ pdu->ret.bandwidth, pdu->ret.start_frame, pdu->ret.error_count); -+ ++ pdu->u.ret.status, ++ pdu->u.ret.transfer_flags, ++ pdu->u.ret.actual_length, ++ pdu->u.ret.bandwidth, ++ pdu->u.ret.start_frame, ++ pdu->u.ret.error_count); + break; + default: + /* NOT REACHED */ @@ -2176,20 +2179,20 @@ a link to the userspace tools needed to get this to work. +{ + if (pack) { + /* vhci_tx.c */ -+ pdu->submit.transfer_flags = urb->transfer_flags & ~URB_NO_TRANSFER_DMA_MAP & ~URB_NO_SETUP_DMA_MAP; -+ pdu->submit.transfer_buffer_length = urb->transfer_buffer_length; -+ pdu->submit.bandwidth = urb->bandwidth; -+ pdu->submit.start_frame = urb->start_frame; -+ pdu->submit.number_of_packets = urb->number_of_packets; -+ pdu->submit.interval = urb->interval; ++ pdu->u.submit.transfer_flags = urb->transfer_flags & ~URB_NO_TRANSFER_DMA_MAP & ~URB_NO_SETUP_DMA_MAP; ++ pdu->u.submit.transfer_buffer_length = urb->transfer_buffer_length; ++ pdu->u.submit.bandwidth = urb->bandwidth; ++ pdu->u.submit.start_frame = urb->start_frame; ++ pdu->u.submit.number_of_packets = urb->number_of_packets; ++ pdu->u.submit.interval = urb->interval; + } else { + /* stub_rx.c */ -+ urb->transfer_flags = pdu->submit.transfer_flags; -+ urb->transfer_buffer_length = pdu->submit.transfer_buffer_length; -+ urb->bandwidth = pdu->submit.bandwidth; -+ urb->start_frame = pdu->submit.start_frame; -+ urb->number_of_packets = pdu->submit.number_of_packets; -+ urb->interval = pdu->submit.interval; ++ urb->transfer_flags = pdu->u.submit.transfer_flags; ++ urb->transfer_buffer_length = pdu->u.submit.transfer_buffer_length; ++ urb->bandwidth = pdu->u.submit.bandwidth; ++ urb->start_frame = pdu->u.submit.start_frame; ++ urb->number_of_packets = pdu->u.submit.number_of_packets; ++ urb->interval = pdu->u.submit.interval; + } +} + @@ -2197,22 +2200,22 @@ a link to the userspace tools needed to get this to work. +{ + if (pack) { + /* stub_tx.c */ -+ pdu->ret.transfer_flags = urb->transfer_flags; -+ pdu->ret.status = urb->status; -+ pdu->ret.actual_length = urb->actual_length; -+ pdu->ret.bandwidth = urb->bandwidth; -+ pdu->ret.start_frame = urb->start_frame; ++ pdu->u.ret.transfer_flags = urb->transfer_flags; ++ pdu->u.ret.status = urb->status; ++ pdu->u.ret.actual_length = urb->actual_length; ++ pdu->u.ret.bandwidth = urb->bandwidth; ++ pdu->u.ret.start_frame = urb->start_frame; + -+ pdu->ret.number_of_packets = urb->number_of_packets; ++ pdu->u.ret.number_of_packets = urb->number_of_packets; + } else { + /* vhci_rx.c */ -+ urb->transfer_flags = pdu->ret.transfer_flags; -+ urb->status = pdu->ret.status; -+ urb->actual_length = pdu->ret.actual_length; -+ urb->bandwidth = pdu->ret.bandwidth; -+ urb->start_frame = pdu->ret.start_frame; ++ urb->transfer_flags = pdu->u.ret.transfer_flags; ++ urb->status = pdu->u.ret.status; ++ urb->actual_length = pdu->u.ret.actual_length; ++ urb->bandwidth = pdu->u.ret.bandwidth; ++ urb->start_frame = pdu->u.ret.start_frame; + -+ urb->error_count = pdu->ret.error_count; ++ urb->error_count = pdu->u.ret.error_count; + } +} + @@ -2399,10 +2402,10 @@ a link to the userspace tools needed to get this to work. + do{ \ + printk(KERN_DEBUG "%-10s:(%s,%d) %s: " fmt, \ + (in_interrupt() ? "interrupt" : (current)->comm),\ -+ __FILE__, __LINE__, __FUNCTION__, ##args); \ ++ __FILE__, __LINE__, __FUNCTION__ , ##args); \ + }while(0) + -+#define VHCI_DEBUG(fmt, args...) udbg(fmt, ##args) ++#define VHCI_DEBUG(fmt, args...) udbg(fmt , ##args) + +#else /* CONFIG_USB_DEBUG */ + @@ -2445,23 +2448,23 @@ a link to the userspace tools needed to get this to work. +#define dbg_with_flag(flag, fmt, args...) \ + do { \ + if(flag & usbip_debug_flag) \ -+ udbg(fmt, ##args); \ ++ udbg(fmt , ##args); \ + } while(0) + -+#define dbg_sysfs(fmt, args...) dbg_with_flag(usbip_debug_sysfs, fmt, ##args) -+#define dbg_xmit(fmt, args...) dbg_with_flag(usbip_debug_xmit, fmt, ##args) -+#define dbg_urb(fmt, args...) dbg_with_flag(usbip_debug_urb, fmt, ##args) -+#define dbg_eh(fmt, args...) dbg_with_flag(usbip_debug_eh, fmt, ##args) ++#define dbg_sysfs(fmt, args...) dbg_with_flag(usbip_debug_sysfs, fmt , ##args) ++#define dbg_xmit(fmt, args...) dbg_with_flag(usbip_debug_xmit, fmt , ##args) ++#define dbg_urb(fmt, args...) dbg_with_flag(usbip_debug_urb, fmt , ##args) ++#define dbg_eh(fmt, args...) dbg_with_flag(usbip_debug_eh, fmt , ##args) + -+#define dbg_vhci_rh(fmt, args...) dbg_with_flag(usbip_debug_vhci_rh, fmt, ##args) -+#define dbg_vhci_hc(fmt, args...) dbg_with_flag(usbip_debug_vhci_hc, fmt, ##args) -+#define dbg_vhci_rx(fmt, args...) dbg_with_flag(usbip_debug_vhci_rx, fmt, ##args) -+#define dbg_vhci_tx(fmt, args...) dbg_with_flag(usbip_debug_vhci_tx, fmt, ##args) -+#define dbg_vhci_sysfs(fmt, args...) dbg_with_flag(usbip_debug_vhci_sysfs, fmt, ##args) ++#define dbg_vhci_rh(fmt, args...) dbg_with_flag(usbip_debug_vhci_rh, fmt , ##args) ++#define dbg_vhci_hc(fmt, args...) dbg_with_flag(usbip_debug_vhci_hc, fmt , ##args) ++#define dbg_vhci_rx(fmt, args...) dbg_with_flag(usbip_debug_vhci_rx, fmt , ##args) ++#define dbg_vhci_tx(fmt, args...) dbg_with_flag(usbip_debug_vhci_tx, fmt , ##args) ++#define dbg_vhci_sysfs(fmt, args...) dbg_with_flag(usbip_debug_vhci_sysfs, fmt , ##args) + -+#define dbg_stub_cmp(fmt, args...) dbg_with_flag(usbip_debug_stub_cmp, fmt, ##args) -+#define dbg_stub_rx(fmt, args...) dbg_with_flag(usbip_debug_stub_rx, fmt, ##args) -+#define dbg_stub_tx(fmt, args...) dbg_with_flag(usbip_debug_stub_tx, fmt, ##args) ++#define dbg_stub_cmp(fmt, args...) dbg_with_flag(usbip_debug_stub_cmp, fmt , ##args) ++#define dbg_stub_rx(fmt, args...) dbg_with_flag(usbip_debug_stub_rx, fmt , ##args) ++#define dbg_stub_tx(fmt, args...) dbg_with_flag(usbip_debug_stub_tx, fmt , ##args) + + +/** @@ -2473,10 +2476,10 @@ a link to the userspace tools needed to get this to work. + do { \ + printk(KERN_ERR "%-10s: ***ERROR*** (%s,%d) %s: " fmt, \ + (in_interrupt() ? "interrupt" : (current)->comm),\ -+ __FILE__, __LINE__, __FUNCTION__, ##args); \ ++ __FILE__, __LINE__, __FUNCTION__ , ##args); \ + } while(0) + -+#define VHCI_ERROR(fmt, args...) uerr(fmt, ##args) ++#define VHCI_ERROR(fmt, args...) uerr(fmt , ##args) + +#if 0 +#define VHCI_ERROR(fmt, args...) \ @@ -2487,7 +2490,7 @@ a link to the userspace tools needed to get this to work. + printk(KERN_ERR "interrupt :"); \ + } \ + printk("usbip: ***ERROR*** (%s, %d, %s)", __FILE__, __LINE__, __FUNCTION__); \ -+ printk("usbip: " fmt, ## args); \ ++ printk("usbip: " fmt , ## args); \ + }while(0) +#endif + @@ -2499,12 +2502,12 @@ a link to the userspace tools needed to get this to work. + +#define uinfo(fmt, args...) \ + do { \ -+ printk(KERN_INFO "usbip: " fmt, ## args); \ ++ printk(KERN_INFO "usbip: " fmt , ## args); \ + } while(0) + +#define VHCI_INFO(fmt, args...) \ + do { \ -+ printk(KERN_INFO "usbip: " fmt, ## args); \ ++ printk(KERN_INFO "usbip: " fmt , ## args); \ + } while(0) + + @@ -2588,7 +2591,7 @@ a link to the userspace tools needed to get this to work. + struct usbip_header_submit submit; + struct usbip_header_return ret; + struct usbip_header_unlink unlink; -+ }; ++ } u; +}; + + @@ -4470,7 +4473,7 @@ a link to the userspace tools needed to get this to work. + +/* @p: pipe whose dev number modified + * @pdev: new devive number */ -+unsigned long vhci_change_pipe_devnum(__u32 p, __u8 pdev) ++static unsigned long vhci_change_pipe_devnum(__u32 p, __u8 pdev) +{ + __u32 oldp; + oldp = p; @@ -4505,7 +4508,7 @@ a link to the userspace tools needed to get this to work. + usbip_pack_pdu(pdup, urb, VHC_C_SUBMIT, 1); + + if (urb->setup_packet != NULL) -+ memcpy(pdup->submit.setup, urb->setup_packet, 8); ++ memcpy(pdup->u.submit.setup, urb->setup_packet, 8); +} + +#define MAX_SUBMIT_QUEUE_DEPTH 100 |