mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
usb: add ifnum to USBEndpoint
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
d8e17efdec
commit
82f02fe965
3 changed files with 18 additions and 0 deletions
14
hw/usb.c
14
hw/usb.c
|
@ -422,6 +422,8 @@ void usb_ep_init(USBDevice *dev)
|
|||
for (ep = 0; ep < USB_MAX_ENDPOINTS; ep++) {
|
||||
dev->ep_in[ep].type = USB_ENDPOINT_XFER_INVALID;
|
||||
dev->ep_out[ep].type = USB_ENDPOINT_XFER_INVALID;
|
||||
dev->ep_in[ep].ifnum = 0;
|
||||
dev->ep_out[ep].ifnum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -444,3 +446,15 @@ void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type)
|
|||
struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
|
||||
uep->type = type;
|
||||
}
|
||||
|
||||
uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep)
|
||||
{
|
||||
struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
|
||||
return uep->ifnum;
|
||||
}
|
||||
|
||||
void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum)
|
||||
{
|
||||
struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
|
||||
uep->ifnum = ifnum;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue