The third argument of usb_maxpacket(): in_out has been deprecated because it could be derived from the second argument (e.g. using usb_pipeout(pipe)). N.B. function usb_maxpacket() was made variadic to accommodate the transition from the old prototype with three arguments to the new one with only two arguments (so that no renaming is needed). The variadic argument is to be removed once all users of usb_maxpacket() get migrated.
Unified · Split
| @@ -1091,7 +1091,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, · 1090 unmodified lines | ||
| 1091 | 1091 | snd_buf_bytes - (snd_buf_bytes % instance->tx_channel.stride)); |
| 1092 | 1092 | |
| 1093 | 1093 | /* rx buffer size must be a positive multiple of the endpoint maxpacket */ |
| 1094 | − maxpacket = usb_maxpacket(usb_dev, instance->rx_channel.endpoint, 0); | |
| 1094 | + maxpacket = usb_maxpacket(usb_dev, instance->rx_channel.endpoint); | |
| 1095 | 1095 | |
| 1096 | 1096 | if ((maxpacket < 1) || (maxpacket > UDSL_MAX_BUF_SIZE)) { |
| 1097 | 1097 | dev_err(dev, "%s: invalid endpoint %02x!\n", __func__, |
| @@ -655,7 +655,7 @@ static int c67x00_add_data_urb(struct c67x00_hcd *c67x00, struct urb *urb) · 654 unmodified lines | ||
| 655 | 655 | usb_pipeout(urb->pipe)); |
| 656 | 656 | remaining = urb->transfer_buffer_length - urb->actual_length; |
| 657 | 657 | |
| 658 | − maxps = usb_maxpacket(urb->dev, urb->pipe, usb_pipeout(urb->pipe)); | |
| 658 | + maxps = usb_maxpacket(urb->dev, urb->pipe); | |
| 659 | 659 | |
| 660 | 660 | need_empty = (urb->transfer_flags & URB_ZERO_PACKET) && |
| 661 | 661 | usb_pipeout(urb->pipe) && !(remaining % maxps); |
| @@ -866,7 +866,7 @@ static inline int c67x00_end_of_data(struct c67x00_td *td) · 204 unmodified lines | ||
| 866 | 866 | if (unlikely(!act_bytes)) |
| 867 | 867 | return 1; /* This was an empty packet */ |
| 868 | 868 | |
| 869 | − maxps = usb_maxpacket(td_udev(td), td->pipe, usb_pipeout(td->pipe)); | |
| 869 | + maxps = usb_maxpacket(td_udev(td), td->pipe); | |
| 870 | 870 | |
| 871 | 871 | if (unlikely(act_bytes < maxps)) |
| 872 | 872 | return 1; /* Smaller then full packet */ |
| @@ -1635,7 +1635,7 @@ static int hub_configure(struct usb_hub *hub, · 1634 unmodified lines | ||
| 1635 | 1635 | * maxpktsize is defined in hcd.c's fake endpoint descriptors |
| 1636 | 1636 | * to be big enough for at least USB_MAXCHILDREN ports. */ |
| 1637 | 1637 | pipe = usb_rcvintpipe(hdev, endpoint->bEndpointAddress); |
| 1638 | − maxp = usb_maxpacket(hdev, pipe, usb_pipeout(pipe)); | |
| 1638 | + maxp = usb_maxpacket(hdev, pipe); | |
| 1639 | 1639 | |
| 1640 | 1640 | if (maxp > sizeof(*hub->buffer)) |
| 1641 | 1641 | maxp = sizeof(*hub->buffer); |
| @@ -645,7 +645,7 @@ qh_urb_transaction ( · 644 unmodified lines | ||
| 645 | 645 | token |= (1 /* "in" */ << 8); |
| 646 | 646 | /* else it's already initted to "out" pid (0 << 8) */ |
| 647 | 647 | |
| 648 | − maxpacket = usb_maxpacket(urb->dev, urb->pipe, !is_input); | |
| 648 | + maxpacket = usb_maxpacket(urb->dev, urb->pipe); | |
| 649 | 649 | |
| 650 | 650 | /* |
| 651 | 651 | * buffer gets wrapped in one or more qtds; |
| @@ -1218,7 +1218,7 @@ static int ehci_submit_single_step_set_feature( · 566 unmodified lines | ||
| 1218 | 1218 | |
| 1219 | 1219 | token |= (1 /* "in" */ << 8); /*This is IN stage*/ |
| 1220 | 1220 | |
| 1221 | − maxpacket = usb_maxpacket(urb->dev, urb->pipe, 0); | |
| 1221 | + maxpacket = usb_maxpacket(urb->dev, urb->pipe); | |
| 1222 | 1222 | |
| 1223 | 1223 | qtd_fill(ehci, qtd, buf, len, token, maxpacket); |
| 1224 | 1224 | |
| @@ -408,8 +408,7 @@ static int fhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, · 407 unmodified lines | ||
| 408 | 408 | size++; |
| 409 | 409 | else if ((urb->transfer_flags & URB_ZERO_PACKET) != 0 |
| 410 | 410 | && (urb->transfer_buffer_length |
| 411 | − % usb_maxpacket(urb->dev, pipe, | |
| 412 | − usb_pipeout(pipe))) != 0) | |
| 411 | + % usb_maxpacket(urb->dev, pipe)) != 0) | |
| 413 | 412 | size++; |
| 414 | 413 | break; |
| 415 | 414 | case PIPE_ISOCHRONOUS: |
| @@ -2596,7 +2596,7 @@ static struct list_head *qh_urb_transaction(struct fotg210_hcd *fotg210, · 2595 unmodified lines | ||
| 2596 | 2596 | token |= (1 /* "in" */ << 8); |
| 2597 | 2597 | /* else it's already initted to "out" pid (0 << 8) */ |
| 2598 | 2598 | |
| 2599 | − maxpacket = usb_maxpacket(urb->dev, urb->pipe, !is_input); | |
| 2599 | + maxpacket = usb_maxpacket(urb->dev, urb->pipe); | |
| 2600 | 2600 | |
| 2601 | 2601 | /* |
| 2602 | 2602 | * buffer gets wrapped in one or more qtds; |
| @@ -726,7 +726,7 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd, · 725 unmodified lines | ||
| 726 | 726 | INIT_LIST_HEAD(&ep->schedule); |
| 727 | 727 | ep->udev = udev; |
| 728 | 728 | ep->epnum = epnum; |
| 729 | − ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out); | |
| 729 | + ep->maxpacket = usb_maxpacket(udev, urb->pipe); | |
| 730 | 730 | usb_settoggle(udev, epnum, is_out, 0); |
| 731 | 731 | |
| 732 | 732 | if (type == PIPE_CONTROL) { |
| @@ -757,8 +757,7 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd, · 24 unmodified lines | ||
| 757 | 757 | ep->load = usb_calc_bus_time(udev->speed, |
| 758 | 758 | !is_out, |
| 759 | 759 | (type == PIPE_ISOCHRONOUS), |
| 760 | − usb_maxpacket(udev, pipe, | |
| 761 | − is_out)) / | |
| 760 | + usb_maxpacket(udev, pipe)) / | |
| 762 | 761 | 1000; |
| 763 | 762 | } |
| 764 | 763 | hep->hcpriv = ep; |
| @@ -1279,7 +1279,7 @@ static int isp1362_urb_enqueue(struct usb_hcd *hcd, · 1278 unmodified lines | ||
| 1279 | 1279 | ep->udev = usb_get_dev(udev); |
| 1280 | 1280 | ep->hep = hep; |
| 1281 | 1281 | ep->epnum = epnum; |
| 1282 | − ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out); | |
| 1282 | + ep->maxpacket = usb_maxpacket(udev, urb->pipe); | |
| 1283 | 1283 | ep->ptd_offset = -EINVAL; |
| 1284 | 1284 | ep->ptd_index = -EINVAL; |
| 1285 | 1285 | usb_settoggle(udev, epnum, is_out, 0); |
| @@ -1299,8 +1299,8 @@ static int isp1362_urb_enqueue(struct usb_hcd *hcd, · 13 unmodified lines | ||
| 1299 | 1299 | ep->interval = urb->interval; |
| 1300 | 1300 | ep->branch = PERIODIC_SIZE; |
| 1301 | 1301 | ep->load = usb_calc_bus_time(udev->speed, !is_out, |
| 1302 | − (type == PIPE_ISOCHRONOUS), | |
| 1303 | − usb_maxpacket(udev, pipe, is_out)) / 1000; | |
| 1302 | + type == PIPE_ISOCHRONOUS, | |
| 1303 | + usb_maxpacket(udev, pipe)) / 1000; | |
| 1304 | 1304 | break; |
| 1305 | 1305 | } |
| 1306 | 1306 | hep->hcpriv = ep; |
| @@ -546,7 +546,7 @@ max3421_transfer_out(struct usb_hcd *hcd, struct urb *urb, int fast_retransmit) · 545 unmodified lines | ||
| 546 | 546 | return MAX3421_HXFR_BULK_OUT(epnum); |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | − max_packet = usb_maxpacket(urb->dev, urb->pipe, 1); | |
| 549 | + max_packet = usb_maxpacket(urb->dev, urb->pipe); | |
| 550 | 550 | |
| 551 | 551 | if (max_packet > MAX3421_FIFO_SIZE) { |
| 552 | 552 | /* |
| @@ -952,7 +952,7 @@ max3421_transfer_in_done(struct usb_hcd *hcd, struct urb *urb) · 399 unmodified lines | ||
| 952 | 952 | * USB 2.0 Section 5.3.2 Pipes: packets must be full size |
| 953 | 953 | * except for last one. |
| 954 | 954 | */ |
| 955 | − max_packet = usb_maxpacket(urb->dev, urb->pipe, 0); | |
| 955 | + max_packet = usb_maxpacket(urb->dev, urb->pipe); | |
| 956 | 956 | if (max_packet > MAX3421_FIFO_SIZE) { |
| 957 | 957 | /* |
| 958 | 958 | * We do not support isochronous transfers at this |
| @@ -998,7 +998,7 @@ max3421_transfer_out_done(struct usb_hcd *hcd, struct urb *urb) · 39 unmodified lines | ||
| 998 | 998 | * max_packet as an indicator that the end of the |
| 999 | 999 | * packet has been reached). |
| 1000 | 1000 | */ |
| 1001 | − u32 max_packet = usb_maxpacket(urb->dev, urb->pipe, 1); | |
| 1001 | + u32 max_packet = usb_maxpacket(urb->dev, urb->pipe); | |
| 1002 | 1002 | |
| 1003 | 1003 | if (max3421_hcd->curr_len == max_packet) |
| 1004 | 1004 | return 0; |
| @@ -181,8 +181,7 @@ static int ohci_urb_enqueue ( · 180 unmodified lines | ||
| 181 | 181 | size++; |
| 182 | 182 | else if ((urb->transfer_flags & URB_ZERO_PACKET) != 0 |
| 183 | 183 | && (urb->transfer_buffer_length |
| 184 | − % usb_maxpacket (urb->dev, pipe, | |
| 185 | − usb_pipeout (pipe))) == 0) | |
| 184 | + % usb_maxpacket(urb->dev, pipe)) == 0) | |
| 186 | 185 | size++; |
| 187 | 186 | break; |
| 188 | 187 | case PIPE_ISOCHRONOUS: /* number of packets from URB */ |
| @@ -1685,7 +1685,7 @@ static struct list_head *qh_urb_transaction(struct oxu_hcd *oxu, · 1684 unmodified lines | ||
| 1685 | 1685 | token |= (1 /* "in" */ << 8); |
| 1686 | 1686 | /* else it's already initted to "out" pid (0 << 8) */ |
| 1687 | 1687 | |
| 1688 | − maxpacket = usb_maxpacket(urb->dev, urb->pipe, !is_input); | |
| 1688 | + maxpacket = usb_maxpacket(urb->dev, urb->pipe); | |
| 1689 | 1689 | |
| 1690 | 1690 | /* |
| 1691 | 1691 | * buffer gets wrapped in one or more qtds; |
| @@ -1796,7 +1796,7 @@ static struct ehci_qh *qh_make(struct oxu_hcd *oxu, · 104 unmodified lines | ||
| 1796 | 1796 | |
| 1797 | 1797 | is_input = usb_pipein(urb->pipe); |
| 1798 | 1798 | type = usb_pipetype(urb->pipe); |
| 1799 | − maxp = usb_maxpacket(urb->dev, urb->pipe, !is_input); | |
| 1799 | + maxp = usb_maxpacket(urb->dev, urb->pipe); | |
| 1800 | 1800 | |
| 1801 | 1801 | /* Compute interrupt scheduling parameters just once, and save. |
| 1802 | 1802 | * - allowing for high bandwidth, how many nsec/uframe are used? |
| @@ -1867,8 +1867,7 @@ static struct r8a66597_td *r8a66597_make_td(struct r8a66597 *r8a66597, · 1866 unmodified lines | ||
| 1867 | 1867 | td->pipe = hep->hcpriv; |
| 1868 | 1868 | td->urb = urb; |
| 1869 | 1869 | td->address = get_urb_to_r8a66597_addr(r8a66597, urb); |
| 1870 | − td->maxpacket = usb_maxpacket(urb->dev, urb->pipe, | |
| 1871 | − !usb_pipein(urb->pipe)); | |
| 1870 | + td->maxpacket = usb_maxpacket(urb->dev, urb->pipe); | |
| 1872 | 1871 | if (usb_pipecontrol(urb->pipe)) |
| 1873 | 1872 | td->type = USB_PID_SETUP; |
| 1874 | 1873 | else if (usb_pipein(urb->pipe)) |
| @@ -842,7 +842,7 @@ static int sl811h_urb_enqueue( · 841 unmodified lines | ||
| 842 | 842 | INIT_LIST_HEAD(&ep->schedule); |
| 843 | 843 | ep->udev = udev; |
| 844 | 844 | ep->epnum = epnum; |
| 845 | − ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out); | |
| 845 | + ep->maxpacket = usb_maxpacket(udev, urb->pipe); | |
| 846 | 846 | ep->defctrl = SL11H_HCTLMASK_ARM | SL11H_HCTLMASK_ENABLE; |
| 847 | 847 | usb_settoggle(udev, epnum, is_out, 0); |
| 848 | 848 | |
| @@ -878,8 +878,8 @@ static int sl811h_urb_enqueue( · 29 unmodified lines | ||
| 878 | 878 | if (type == PIPE_ISOCHRONOUS) |
| 879 | 879 | ep->defctrl |= SL11H_HCTLMASK_ISOCH; |
| 880 | 880 | ep->load = usb_calc_bus_time(udev->speed, !is_out, |
| 881 | − (type == PIPE_ISOCHRONOUS), | |
| 882 | − usb_maxpacket(udev, pipe, is_out)) | |
| 881 | + type == PIPE_ISOCHRONOUS, | |
| 882 | + usb_maxpacket(udev, pipe)) | |
| 883 | 883 | / 1000; |
| 884 | 884 | break; |
| 885 | 885 | } |
| @@ -825,8 +825,7 @@ static void create_ptd_atl(struct isp1760_qh *qh, · 824 unmodified lines | ||
| 825 | 825 | memset(ptd, 0, sizeof(*ptd)); |
| 826 | 826 | |
| 827 | 827 | /* according to 3.6.2, max packet len can not be > 0x400 */ |
| 828 | − maxpacket = usb_maxpacket(qtd->urb->dev, qtd->urb->pipe, | |
| 829 | − usb_pipeout(qtd->urb->pipe)); | |
| 828 | + maxpacket = usb_maxpacket(qtd->urb->dev, qtd->urb->pipe); | |
| 830 | 829 | multi = 1 + ((maxpacket >> 11) & 0x3); |
| 831 | 830 | maxpacket &= 0x7ff; |
| 832 | 831 | |
| @@ -1808,8 +1807,7 @@ static void packetize_urb(struct usb_hcd *hcd, · 975 unmodified lines | ||
| 1808 | 1807 | packet_type = IN_PID; |
| 1809 | 1808 | } |
| 1810 | 1809 | |
| 1811 | − maxpacketsize = usb_maxpacket(urb->dev, urb->pipe, | |
| 1812 | − usb_pipeout(urb->pipe)); | |
| 1810 | + maxpacketsize = usb_maxpacket(urb->dev, urb->pipe); | |
| 1813 | 1811 | |
| 1814 | 1812 | /* |
| 1815 | 1813 | * buffer gets wrapped in one or more qtds; |
| @@ -1449,8 +1449,7 @@ wait:if (ftdi->disconnected > 0) { · 1448 unmodified lines | ||
| 1449 | 1449 | command->length = 0x8007; |
| 1450 | 1450 | command->address = (toggle_bits << 6) | (ep_number << 2) |
| 1451 | 1451 | | (address << 0); |
| 1452 | − command->width = usb_maxpacket(urb->dev, urb->pipe, | |
| 1453 | − usb_pipeout(urb->pipe)); | |
| 1452 | + command->width = usb_maxpacket(urb->dev, urb->pipe); | |
| 1454 | 1453 | command->follows = 8; |
| 1455 | 1454 | command->value = 0; |
| 1456 | 1455 | command->buffer = urb->setup_packet; |
| @@ -1514,8 +1513,7 @@ wait:if (ftdi->disconnected > 0) { · 57 unmodified lines | ||
| 1514 | 1513 | 1); |
| 1515 | 1514 | command->address = (toggle_bits << 6) | (ep_number << 2) |
| 1516 | 1515 | | (address << 0); |
| 1517 | − command->width = usb_maxpacket(urb->dev, urb->pipe, | |
| 1518 | − usb_pipeout(urb->pipe)); | |
| 1516 | + command->width = usb_maxpacket(urb->dev, urb->pipe); | |
| 1519 | 1517 | command->follows = 0; |
| 1520 | 1518 | command->value = 0; |
| 1521 | 1519 | command->buffer = NULL; |
| @@ -1571,8 +1569,7 @@ wait:if (ftdi->disconnected > 0) { · 49 unmodified lines | ||
| 1571 | 1569 | command->length = 0x0000; |
| 1572 | 1570 | command->address = (toggle_bits << 6) | (ep_number << 2) |
| 1573 | 1571 | | (address << 0); |
| 1574 | − command->width = usb_maxpacket(urb->dev, urb->pipe, | |
| 1575 | − usb_pipeout(urb->pipe)); | |
| 1572 | + command->width = usb_maxpacket(urb->dev, urb->pipe); | |
| 1576 | 1573 | command->follows = 0; |
| 1577 | 1574 | command->value = 0; |
| 1578 | 1575 | command->buffer = NULL; |
| @@ -1634,8 +1631,7 @@ wait:if (ftdi->disconnected > 0) { · 55 unmodified lines | ||
| 1634 | 1631 | command->header = 0x81 | (ed << 5); |
| 1635 | 1632 | command->address = (toggle_bits << 6) | (ep_number << 2) |
| 1636 | 1633 | | (address << 0); |
| 1637 | − command->width = usb_maxpacket(urb->dev, urb->pipe, | |
| 1638 | − usb_pipeout(urb->pipe)); | |
| 1634 | + command->width = usb_maxpacket(urb->dev, urb->pipe); | |
| 1639 | 1635 | command->follows = min_t(u32, 1024, |
| 1640 | 1636 | urb->transfer_buffer_length - |
| 1641 | 1637 | urb->actual_length); |
| @@ -1715,8 +1711,7 @@ wait:if (ftdi->disconnected > 0) { · 73 unmodified lines | ||
| 1715 | 1711 | 1); |
| 1716 | 1712 | command->address = (toggle_bits << 6) | (ep_number << 2) |
| 1717 | 1713 | | (address << 0); |
| 1718 | − command->width = usb_maxpacket(urb->dev, urb->pipe, | |
| 1719 | − usb_pipeout(urb->pipe)); | |
| 1714 | + command->width = usb_maxpacket(urb->dev, urb->pipe); | |
| 1720 | 1715 | command->follows = 0; |
| 1721 | 1716 | command->value = 0; |
| 1722 | 1717 | command->buffer = NULL; |
| @@ -437,7 +437,7 @@ static int lvs_rh_probe(struct usb_interface *intf, · 436 unmodified lines | ||
| 437 | 437 | INIT_WORK(&lvs->rh_work, lvs_rh_work); |
| 438 | 438 | |
| 439 | 439 | pipe = usb_rcvintpipe(hdev, endpoint->bEndpointAddress); |
| 440 | − maxp = usb_maxpacket(hdev, pipe, usb_pipeout(pipe)); | |
| 440 | + maxp = usb_maxpacket(hdev, pipe); | |
| 441 | 441 | usb_fill_int_urb(lvs->urb, hdev, pipe, &lvs->buffer[0], maxp, |
| 442 | 442 | lvs_rh_irq, lvs, endpoint->bInterval); |
| 443 | 443 | |
| @@ -180,7 +180,7 @@ static int onetouch_connect_input(struct us_data *ss) · 179 unmodified lines | ||
| 180 | 180 | return -ENODEV; |
| 181 | 181 | |
| 182 | 182 | pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress); |
| 183 | − maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); | |
| 183 | + maxp = usb_maxpacket(udev, pipe); | |
| 184 | 184 | maxp = min(maxp, ONETOUCH_PKT_LEN); |
| 185 | 185 | |
| 186 | 186 | onetouch = kzalloc(sizeof(struct usb_onetouch), GFP_KERNEL); |
| @@ -363,7 +363,7 @@ static int usb_stor_intr_transfer(struct us_data *us, void *buf, · 362 unmodified lines | ||
| 363 | 363 | usb_stor_dbg(us, "xfer %u bytes\n", length); |
| 364 | 364 | |
| 365 | 365 | /* calculate the max packet size */ |
| 366 | − maxp = usb_maxpacket(us->pusb_dev, pipe, usb_pipeout(pipe)); | |
| 366 | + maxp = usb_maxpacket(us->pusb_dev, pipe); | |
| 367 | 367 | if (maxp > length) |
| 368 | 368 | maxp = length; |
| 369 | 369 | |