aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/mon/mon_bin.c
diff options
context:
space:
mode:
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 c03dfd7a9d36..0b0d77c669da 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,
354 const struct urb *urb, char ev_type) 354 const struct urb *urb, char ev_type)
355{ 355{
356 356
357 if (!usb_pipecontrol(urb->pipe) || ev_type != 'S') 357 if (!usb_endpoint_xfer_control(&urb->ep->desc) || ev_type != 'S')
358 return '-'; 358 return '-';
359 359
360 if (urb->dev->bus->uses_dma && 360 if (urb->dev->bus->uses_dma &&
@@ -410,7 +410,7 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb,
410 if (length >= rp->b_size/5) 410 if (length >= rp->b_size/5)
411 length = rp->b_size/5; 411 length = rp->b_size/5;
412 412
413 if (usb_pipein(urb->pipe)) { 413 if (usb_urb_dir_in(urb)) {
414 if (ev_type == 'S') { 414 if (ev_type == 'S') {
415 length = 0; 415 length = 0;
416 data_tag = '<'; 416 data_tag = '<';
@@ -440,10 +440,22 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb,
440 */ 440 */
441 memset(ep, 0, PKT_SIZE); 441 memset(ep, 0, PKT_SIZE);
442 ep->type = ev_type; 442 ep->type = ev_type;
443 ep->xfer_type = usb_pipetype(urb->pipe); 443 switch (usb_endpoint_type(&urb->ep->desc)) {
444 /* We use the fact that usb_pipein() returns 0x80 */ 444 case USB_ENDPOINT_XFER_CONTROL:
445 ep->epnum = usb_pipeendpoint(urb->pipe) | usb_pipein(urb->pipe); 445 ep->xfer_type = PIPE_CONTROL;
446 ep->devnum = usb_pipedevice(urb->pipe); 446 break;
447 case USB_ENDPOINT_XFER_BULK:
448 ep->xfer_type = PIPE_BULK;
449 break;
450 case USB_ENDPOINT_XFER_INT:
451 ep->xfer_type = PIPE_INTERRUPT;
452 break;
453 default:
454 ep->xfer_type = PIPE_ISOCHRONOUS;
455 break;
456 }
457 ep->epnum = urb->ep->desc.bEndpointAddress;
458 ep->devnum = urb->dev->devnum;
447 ep->busnum = urb->dev->bus->busnum; 459 ep->busnum = urb->dev->bus->busnum;
448 ep->id = (unsigned long) urb; 460 ep->id = (unsigned long) urb;
449 ep->ts_sec = ts.tv_sec; 461 ep->ts_sec = ts.tv_sec;
@@ -500,10 +512,22 @@ static void mon_bin_error(void *data, struct urb *urb, int error)
500 512
501 memset(ep, 0, PKT_SIZE); 513 memset(ep, 0, PKT_SIZE);
502 ep->type = 'E'; 514 ep->type = 'E';
503 ep->xfer_type = usb_pipetype(urb->pipe); 515 switch (usb_endpoint_type(&urb->ep->desc)) {
504 /* We use the fact that usb_pipein() returns 0x80 */ 516 case USB_ENDPOINT_XFER_CONTROL:
505 ep->epnum = usb_pipeendpoint(urb->pipe) | usb_pipein(urb->pipe); 517 ep->xfer_type = PIPE_CONTROL;
506 ep->devnum = usb_pipedevice(urb->pipe); 518 break;
519 case USB_ENDPOINT_XFER_BULK:
520 ep->xfer_type = PIPE_BULK;
521 break;
522 case USB_ENDPOINT_XFER_INT:
523 ep->xfer_type = PIPE_INTERRUPT;
524 break;
525 default:
526 ep->xfer_type = PIPE_ISOCHRONOUS;
527 break;
528 }
529 ep->epnum = urb->ep->desc.bEndpointAddress;
530 ep->devnum = urb->dev->devnum;
507 ep->busnum = urb->dev->bus->busnum; 531 ep->busnum = urb->dev->bus->busnum;
508 ep->id = (unsigned long) urb; 532 ep->id = (unsigned long) urb;
509 ep->status = error; 533 ep->status = error;