History

usbfs: Add ep_to_host_endpoint helper function

Hans de Goede committed 13 years ago

Commit 2fec32b1 parent 948cd8c1 file · +11 −7Browse files

Unified · Split

drivers/usb/core/devio.c+11−7
@@ -769,6 +769,15 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, · 768 unmodified lines
769 return ret;769 return ret;
770}770}
771 771
772static struct usb_host_endpoint *ep_to_host_endpoint(struct usb_device *dev,
773 unsigned char ep)
774{
775 if (ep & USB_ENDPOINT_DIR_MASK)
776 return dev->ep_in[ep & USB_ENDPOINT_NUMBER_MASK];
777 else
778 return dev->ep_out[ep & USB_ENDPOINT_NUMBER_MASK];
779}
780
772static int match_devt(struct device *dev, void *data)781static int match_devt(struct device *dev, void *data)
773{782{
774 return dev->devt == (dev_t) (unsigned long) data;783 return dev->devt == (dev_t) (unsigned long) data;
@@ -1230,15 +1239,10 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, · 455 unmodified lines
1230 if (ret)1239 if (ret)
1231 return ret;1240 return ret;
1232 }1241 }
1233 if ((uurb->endpoint & USB_ENDPOINT_DIR_MASK) != 0) {1242 ep = ep_to_host_endpoint(ps->dev, uurb->endpoint);
1234 is_in = 1;
1235 ep = ps->dev->ep_in[uurb->endpoint & USB_ENDPOINT_NUMBER_MASK];
1236 } else {
1237 is_in = 0;
1238 ep = ps->dev->ep_out[uurb->endpoint & USB_ENDPOINT_NUMBER_MASK];
1239 }
1240 if (!ep)1243 if (!ep)
1241 return -ENOENT;1244 return -ENOENT;
1245 is_in = (uurb->endpoint & USB_ENDPOINT_DIR_MASK) != 0;
1242 1246
1243 u = 0;1247 u = 0;
1244 switch(uurb->type) {1248 switch(uurb->type) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t