[zircon][xhci] Add complete_cb as a param to hci_request_queue op
usb_request_t now has public and private portions for each driver in usb stack. The complete_cb is different for each layer. At the moment we are using the same req->complete_cb and modifying it when the request passes down the stack. By making a private field for complete_cb in each driver, we make the code less error prone. This changeset modifies the request_queue hci protocol op to take complete_cb as a parameter. The hci layer saves the callback in its private context and uses the one in the private context when the request is complete. After all the usage of complete_cb in usb_request_t are removed, I wll remove the unnecessary fields. Test: Vim2: fx serve. iochk on usb mass storage device. Astro: netboot. lsusb. Verified usb network adapter showed up Pixelbook: fx serve using usb network adapter. iochk on usb mass storage device. audio -d 1 tone on usb audio device. Change-Id: Ia5bb083325a9ec2cb7547a378b58a9cbb1e60824
Showing
- system/dev/usb/usb-bus/usb-device.c 2 additions, 2 deletionssystem/dev/usb/usb-bus/usb-device.c
- system/dev/usb/usb-bus/util.c 1 addition, 1 deletionsystem/dev/usb/usb-bus/util.c
- system/dev/usb/xhci/usb-xhci.cpp 9 additions, 4 deletionssystem/dev/usb/xhci/usb-xhci.cpp
- system/dev/usb/xhci/xhci-device-manager.cpp 11 additions, 6 deletionssystem/dev/usb/xhci/xhci-device-manager.cpp
- system/dev/usb/xhci/xhci-root-hub.cpp 30 additions, 19 deletionssystem/dev/usb/xhci/xhci-root-hub.cpp
- system/dev/usb/xhci/xhci-transfer.cpp 21 additions, 10 deletionssystem/dev/usb/xhci/xhci-transfer.cpp
- system/dev/usb/xhci/xhci.cpp 15 additions, 5 deletionssystem/dev/usb/xhci/xhci.cpp
- system/dev/usb/xhci/xhci.h 2 additions, 1 deletionsystem/dev/usb/xhci/xhci.h
- system/ulib/ddk/include/ddk/protocol/usb-hci.h 6 additions, 3 deletionssystem/ulib/ddk/include/ddk/protocol/usb-hci.h
Loading
Please register or sign in to comment