1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef USB_IO_MANAGE_H 17 #define USB_IO_MANAGE_H 18 19 #include "usb_ddk_device.h" 20 #include "usb_ddk_request.h" 21 #include "usb_interface_pool.h" 22 #include "usb_session.h" 23 24 #define USB_IO_SEND_PROCESS_STACK_SIZE 100000 25 #define USB_IO_RECEIVE_PROCESS_STACK_SIZE 100000 26 #define USB_IO_SUBMIT_RETRY_TIME_CNT 3 27 #define USB_IO_SLEEP_MS_TIME 100 28 #define USB_IO_STOP_WAIT_MAX_TIME 3 29 30 HDF_STATUS UsbIoCreateQueue(const struct UsbInterfacePool *interfacePool); 31 HDF_STATUS UsbIoDestroyQueue(const struct UsbInterfacePool *interfacePool); 32 int32_t UsbIoSendRequest(const struct UsbMessageQueue *msgQueue, const struct UsbHostRequest *request); 33 HDF_STATUS UsbIoGetRequest(const struct UsbMessageQueue *msgQueue, struct UsbHostRequest **request); 34 HDF_STATUS UsbIoStart(struct UsbInterfacePool *interfacePool); 35 HDF_STATUS UsbIoStop(struct UsbInterfacePool *interfacePool); 36 void UsbIoSetRequestCompletionInfo(const void *requestArg); 37 38 #endif /* USB_IO_MANAGE_H */ 39