Commit 8437ab99 authored by Felipe Balbi's avatar Felipe Balbi

usb: host: ehci: remove unnecessary max_packet() macro

Now that usb_endpoint_maxp() only returns the lowest
11 bits from wMaxPacketSize, we can remove this macro
from the driver.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: <linux-usb@vger.kernel.org>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 5f9492ff
...@@ -550,9 +550,6 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -550,9 +550,6 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
// ... and packet size, for any kind of endpoint descriptor
#define max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff)
/* /*
* reverse of qh_urb_transaction: free a list of TDs. * reverse of qh_urb_transaction: free a list of TDs.
* used for cleanup after errors, before HC sees an URB's TDs. * used for cleanup after errors, before HC sees an URB's TDs.
...@@ -649,7 +646,7 @@ qh_urb_transaction ( ...@@ -649,7 +646,7 @@ qh_urb_transaction (
token |= (1 /* "in" */ << 8); token |= (1 /* "in" */ << 8);
/* else it's already initted to "out" pid (0 << 8) */ /* else it's already initted to "out" pid (0 << 8) */
maxpacket = max_packet(usb_maxpacket(urb->dev, urb->pipe, !is_input)); maxpacket = usb_maxpacket(urb->dev, urb->pipe, !is_input);
/* /*
* buffer gets wrapped in one or more qtds; * buffer gets wrapped in one or more qtds;
...@@ -788,14 +785,14 @@ qh_make ( ...@@ -788,14 +785,14 @@ qh_make (
is_input = usb_pipein (urb->pipe); is_input = usb_pipein (urb->pipe);
type = usb_pipetype (urb->pipe); type = usb_pipetype (urb->pipe);
ep = usb_pipe_endpoint (urb->dev, urb->pipe); ep = usb_pipe_endpoint (urb->dev, urb->pipe);
maxp = usb_maxpacket (urb->dev, urb->pipe, !is_input); maxp = usb_endpoint_maxp (&ep->desc);
mult = usb_endpoint_maxp_mult (&ep->desc); mult = usb_endpoint_maxp_mult (&ep->desc);
/* 1024 byte maxpacket is a hardware ceiling. High bandwidth /* 1024 byte maxpacket is a hardware ceiling. High bandwidth
* acts like up to 3KB, but is built from smaller packets. * acts like up to 3KB, but is built from smaller packets.
*/ */
if (max_packet(maxp) > 1024) { if (maxp > 1024) {
ehci_dbg(ehci, "bogus qh maxpacket %d\n", max_packet(maxp)); ehci_dbg(ehci, "bogus qh maxpacket %d\n", maxp);
goto done; goto done;
} }
...@@ -811,8 +808,7 @@ qh_make ( ...@@ -811,8 +808,7 @@ qh_make (
unsigned tmp; unsigned tmp;
qh->ps.usecs = NS_TO_US(usb_calc_bus_time(USB_SPEED_HIGH, qh->ps.usecs = NS_TO_US(usb_calc_bus_time(USB_SPEED_HIGH,
is_input, 0, is_input, 0, mult * maxp));
mult * max_packet(maxp)));
qh->ps.phase = NO_FRAME; qh->ps.phase = NO_FRAME;
if (urb->dev->speed == USB_SPEED_HIGH) { if (urb->dev->speed == USB_SPEED_HIGH) {
...@@ -856,7 +852,7 @@ qh_make ( ...@@ -856,7 +852,7 @@ qh_make (
think_time = tt ? tt->think_time : 0; think_time = tt ? tt->think_time : 0;
qh->ps.tt_usecs = NS_TO_US(think_time + qh->ps.tt_usecs = NS_TO_US(think_time +
usb_calc_bus_time (urb->dev->speed, usb_calc_bus_time (urb->dev->speed,
is_input, 0, max_packet (maxp))); is_input, 0, maxp));
if (urb->interval > ehci->periodic_size) if (urb->interval > ehci->periodic_size)
urb->interval = ehci->periodic_size; urb->interval = ehci->periodic_size;
qh->ps.period = urb->interval; qh->ps.period = urb->interval;
...@@ -927,10 +923,10 @@ qh_make ( ...@@ -927,10 +923,10 @@ qh_make (
* to help them do so. So now people expect to use * to help them do so. So now people expect to use
* such nonconformant devices with Linux too; sigh. * such nonconformant devices with Linux too; sigh.
*/ */
info1 |= max_packet(maxp) << 16; info1 |= maxp << 16;
info2 |= (EHCI_TUNE_MULT_HS << 30); info2 |= (EHCI_TUNE_MULT_HS << 30);
} else { /* PIPE_INTERRUPT */ } else { /* PIPE_INTERRUPT */
info1 |= max_packet (maxp) << 16; info1 |= maxp << 16;
info2 |= mult << 30; info2 |= mult << 30;
} }
break; break;
...@@ -1223,7 +1219,7 @@ static int submit_single_step_set_feature( ...@@ -1223,7 +1219,7 @@ static int submit_single_step_set_feature(
token |= (1 /* "in" */ << 8); /*This is IN stage*/ token |= (1 /* "in" */ << 8); /*This is IN stage*/
maxpacket = max_packet(usb_maxpacket(urb->dev, urb->pipe, 0)); maxpacket = usb_maxpacket(urb->dev, urb->pipe, 0);
qtd_fill(ehci, qtd, buf, len, token, maxpacket); qtd_fill(ehci, qtd, buf, len, token, maxpacket);
......
...@@ -1068,7 +1068,6 @@ iso_stream_init( ...@@ -1068,7 +1068,6 @@ iso_stream_init(
stream->highspeed = 1; stream->highspeed = 1;
maxp = max_packet(maxp);
buf1 |= maxp; buf1 |= maxp;
maxp *= multi; maxp *= multi;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment