ACRN:DM Release resource when destroy the device

When destroy the usb device release the resource allocate for transfer
in case cause the memory leak issue. Add the release and cancel
transfer request call back for the emulation device, use the emulation
device call back in xHCI controller emulation.

Tracked-On: #6533
Signed-off-by: Liu Long <long.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Liu Long
2021-09-01 16:45:07 +08:00
committed by wenlingz
parent f45344b6bc
commit a0b3f1cfc8
4 changed files with 53 additions and 20 deletions

View File

@@ -115,6 +115,8 @@ struct usb_devemu {
int (*ue_reset)(void *sc);
int (*ue_remove)(void *sc);
int (*ue_stop)(void *sc);
void (*ue_cancel_req)(void *pdata);
void (*ue_free_req)(void *pdata);
void (*ue_deinit)(void *pdata);
};
#define USB_EMUL_SET(x) DATA_SET(usb_emu_set, x)

View File

@@ -129,4 +129,6 @@ int usb_dev_info(void *pdata, int type, void *value, int size);
int usb_dev_request(void *pdata, struct usb_xfer *xfer);
int usb_dev_reset(void *pdata);
int usb_dev_data(void *pdata, struct usb_xfer *xfer, int dir, int epctx);
void usb_dev_cancel_request(void *pdata);
void usb_dev_free_request(void *pdata);
#endif