aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/mon/mon_bin.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-07-30 17:10:36 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 14:55:01 -0700
commit18ea5d00d05fa6300606f0711748016c95fb26dc (patch)
tree67b0411f8e31f58c4127757875a1ecf2e924d995 /drivers/usb/mon/mon_bin.c
parent93cf9b909efb773f74b5d87659d41f957ccbce7e (diff)
downloadkernel_samsung_smdk4412-18ea5d00d05fa6300606f0711748016c95fb26dc.tar.gz
kernel_samsung_smdk4412-18ea5d00d05fa6300606f0711748016c95fb26dc.tar.bz2
kernel_samsung_smdk4412-18ea5d00d05fa6300606f0711748016c95fb26dc.zip
USB: avoid urb->pipe in usbmon
This patch (as949) changes the usbmon driver to use the new urb->ep field rather than urb->pipe. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/mon/mon_bin.c')
-rw-r--r--drivers/usb/mon/mon_bin.c44
1 files changed, 34 insertions, 10 deletions
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index c03dfd7a9d3..0b0d77c669d 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -354,7 +354,7 @@ static inline char mon_bin_get_setup(unsigned char *setupb,
const struct urb *urb, char ev_type)
{
- if (!usb_pipecontrol(urb->pipe) || ev_type != 'S')
+ if (!usb_endpoint_xfer_control(&urb->ep->desc) || ev_type != 'S')
return '-';
if (urb->dev->bus->uses_dma &&
@@ -410,7 +410,7 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb,
if (length >= rp->b_size/5)
length = rp->b_size/5;
- if (usb_pipein(urb->pipe)) {
+ if (usb_urb_dir_in(urb)) {
if (ev_type == 'S') {
length = 0;
data_tag = '<';
@@ -440,10 +440,22 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb,
*/
memset(ep, 0, PKT_SIZE);
ep->type = ev_type;
- ep->xfer_type = usb_pipetype(urb->pipe);
- /* We use the fact that usb_pipein() returns 0x80 */
- ep->epnum = usb_pipeendpoint(urb->pipe) | usb_pipein(urb->pipe);
- ep->devnum = usb_pipedevice(urb->pipe);
+ switch (usb_endpoint_type(&urb->ep->desc)) {
+ case USB_ENDPOINT_XFER_CONTROL:
+ ep->xfer_type = PIPE_CONTROL;
+ break;
+ case USB_ENDPOINT_XFER_BULK:
+ ep->xfer_type = PIPE_BULK;
+ break;
+ case USB_ENDPOINT_XFER_INT:
+ ep->xfer_type = PIPE_INTERRUPT;
+ break;
+ default:
+ ep->xfer_type = PIPE_ISOCHRONOUS;
+ break;
+ }
+ ep->epnum = urb->ep->desc.bEndpointAddress;
+ ep->devnum = urb->dev->devnum;
ep->busnum = urb->dev->bus->busnum;
ep->id = (unsigned long) urb;
ep->ts_sec = ts.tv_sec;
@@ -500,10 +512,22 @@ static void mon_bin_error(void *data, struct urb *urb, int error)
memset(ep, 0, PKT_SIZE);
ep->type = 'E';
- ep->xfer_type = usb_pipetype(urb->pipe);
- /* We use the fact that usb_pipein() returns 0x80 */
- ep->epnum = usb_pipeendpoint(urb->pipe) | usb_pipein(urb->pipe);
- ep->devnum = usb_pipedevice(urb->pipe);
+ switch (usb_endpoint_type(&urb->ep->desc)) {
+ case USB_ENDPOINT_XFER_CONTROL:
+ ep->xfer_type = PIPE_CONTROL;
+ break;
+ case USB_ENDPOINT_XFER_BULK:
+ ep->xfer_type = PIPE_BULK;
+ break;
+ case USB_ENDPOINT_XFER_INT:
+ ep->xfer_type = PIPE_INTERRUPT;
+ break;
+ default:
+ ep->xfer_type = PIPE_ISOCHRONOUS;
+ break;
+ }
+ ep->epnum = urb->ep->desc.bEndpointAddress;
+ ep->devnum = urb->dev->devnum;
ep->busnum = urb->dev->bus->busnum;
ep->id = (unsigned long) urb;
ep->status = error;