mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-08-27 20:49:55 -04:00
fix:usb ddk reviewbot
Signed-off-by: wu-chengwen <wuchengwen4@huawei.com>
This commit is contained in:
@@ -78,7 +78,7 @@ struct UsbPnpRemoveInfo {
|
||||
uint8_t interfaceNum;
|
||||
};
|
||||
|
||||
int UsbDdkPnpLoaderEventReceived(void *usbPnpManagerPtr, uint32_t id, struct HdfSBuf *data);
|
||||
int UsbDdkPnpLoaderEventHandle(void);
|
||||
int32_t UsbDdkPnpLoaderEventReceived(void *usbPnpManagerPtr, uint32_t id, struct HdfSBuf *data);
|
||||
int32_t UsbDdkPnpLoaderEventHandle(void);
|
||||
|
||||
#endif /* USB_DDK_PNP_LOADER_H */
|
||||
|
||||
Regular → Executable
+36
-47
@@ -112,7 +112,7 @@ static bool UsbDdkPnpLoaderMatchDevice(const struct UsbPnpNotifyMatchInfoTable *
|
||||
// Need optimize this device object array later, should bind device object to usb deivce
|
||||
#define REGISTER_DEV_MAX 16
|
||||
static struct HdfDeviceObject *g_resistedDevice[REGISTER_DEV_MAX] = {0};
|
||||
static int SaveRegistedDevice(struct HdfDeviceObject *dev)
|
||||
static int32_t SaveRegistedDevice(struct HdfDeviceObject *dev)
|
||||
{
|
||||
for (size_t i = 0; i < REGISTER_DEV_MAX; i++) {
|
||||
if (g_resistedDevice[i] == NULL) {
|
||||
@@ -143,7 +143,7 @@ static struct HdfDeviceObject *GetRegistedDevice(const char *serviceName)
|
||||
|
||||
int32_t UsbPnpManagerRegisterDevice(struct UsbPnpManagerDeviceInfo *managerInfo)
|
||||
{
|
||||
int ret = HDF_FAILURE;
|
||||
int32_t ret = HDF_FAILURE;
|
||||
struct HdfDeviceObject *devObj = HdfDeviceObjectAlloc(managerInfo->usbPnpManager, managerInfo->moduleName);
|
||||
if (devObj == NULL) {
|
||||
HDF_LOGE("%s: failed to alloc device object", __func__);
|
||||
@@ -211,12 +211,10 @@ static bool UsbDdkPnpLoaderMatchFlagFirst(struct UsbPnpMatchIdTable *id)
|
||||
{
|
||||
int32_t i;
|
||||
bool ret = true;
|
||||
uint32_t offset;
|
||||
|
||||
if (id->matchFlag & USB_PNP_NOTIFY_MATCH_INT_CLASS) {
|
||||
for (i = 0; i < id->interfaceClassLength; i++) {
|
||||
offset = i;
|
||||
if (!((id->interfaceClassMask >> offset) & 0x01)) {
|
||||
if (((id->interfaceClassMask >> (uint32_t)i) & 0x01) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -228,8 +226,7 @@ static bool UsbDdkPnpLoaderMatchFlagFirst(struct UsbPnpMatchIdTable *id)
|
||||
|
||||
if (id->matchFlag & USB_PNP_NOTIFY_MATCH_INT_SUBCLASS) {
|
||||
for (i = 0; i < id->interfaceSubClassLength; i++) {
|
||||
offset = i;
|
||||
if (!((id->interfaceSubClassMask >> offset) & 0x01)) {
|
||||
if (((id->interfaceSubClassMask >> (uint32_t)i) & 0x01) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -250,7 +247,6 @@ static bool UsbDdkPnpLoaderMatchFlag(const struct UsbPnpNotifyMatchInfoTable *de
|
||||
{
|
||||
int32_t i;
|
||||
bool ret = true;
|
||||
uint32_t offset;
|
||||
|
||||
if (!UsbDdkPnpLoaderMatchFlagFirst(id)) {
|
||||
ret = false;
|
||||
@@ -259,8 +255,7 @@ static bool UsbDdkPnpLoaderMatchFlag(const struct UsbPnpNotifyMatchInfoTable *de
|
||||
|
||||
if (id->matchFlag & USB_PNP_NOTIFY_MATCH_INT_PROTOCOL) {
|
||||
for (i = 0; i < id->interfaceProtocolLength; i++) {
|
||||
offset = i;
|
||||
if (!((id->interfaceProtocolMask >> offset) & 0x01)) {
|
||||
if (((id->interfaceProtocolMask >> (uint32_t)i) & 0x01) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -272,8 +267,7 @@ static bool UsbDdkPnpLoaderMatchFlag(const struct UsbPnpNotifyMatchInfoTable *de
|
||||
|
||||
if (id->matchFlag & USB_PNP_NOTIFY_MATCH_INT_NUMBER) {
|
||||
for (i = 0; i < id->interfaceLength; i++) {
|
||||
offset = i;
|
||||
if (!((id->interfaceMask >> offset) & 0x01)) {
|
||||
if (((id->interfaceMask >> (uint32_t)i) & 0x01) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -703,10 +697,10 @@ static int32_t UsbDdkPnpLoaderDispatchPnpDevice(struct HdfDeviceObject *usbPnpMa
|
||||
return UsbPnpManagerRegisterOrUnregisterDevice(&managerInfo);
|
||||
}
|
||||
|
||||
static int UsbDdkPnpLoaderDeviceListAdd(const struct UsbPnpNotifyMatchInfoTable *info,
|
||||
static int32_t UsbDdkPnpLoaderDeviceListAdd(const struct UsbPnpNotifyMatchInfoTable *info,
|
||||
const struct UsbPnpMatchIdTable *idTable)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
unsigned char *ptr = NULL;
|
||||
struct UsbPnpDeviceListTable *deviceTableListTemp = NULL;
|
||||
|
||||
@@ -754,23 +748,22 @@ static struct UsbPnpDeviceListTable *UsbDdkPnpLoaderAddInterface(
|
||||
(strcmp(deviceListTablePos->serviceName, idTable->serviceName) == 0) && \
|
||||
(strcmp(deviceListTablePos->deviceMatchAttr, idTable->deviceMatchAttr) == 0) && \
|
||||
(deviceListTablePos->usbDevAddr == info->usbDevAddr) && \
|
||||
(deviceListTablePos->devNum = info->devNum) && \
|
||||
(deviceListTablePos->busNum = info->busNum)) {
|
||||
(deviceListTablePos->devNum == info->devNum) && \
|
||||
(deviceListTablePos->busNum == info->busNum)) {
|
||||
return deviceListTablePos;
|
||||
}
|
||||
}
|
||||
|
||||
HDF_LOGE("%s:%d usbDevAddr=0x%x, interface=%d-%d-%d to \
|
||||
be add but not exist. ",
|
||||
__func__, __LINE__, (uint32_t)info->usbDevAddr, info->devNum, info->busNum, info->numInfos);
|
||||
HDF_LOGE("%s:%d interface=%d-%d-%d to be add but not exist. ",
|
||||
__func__, __LINE__, info->devNum, info->busNum, info->numInfos);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int UsbDdkPnpLoaderrAddPnpDevice(struct HdfDeviceObject *usbPnpManagerDevice,
|
||||
static int32_t UsbDdkPnpLoaderrAddPnpDevice(struct HdfDeviceObject *usbPnpManagerDevice,
|
||||
const struct UsbPnpNotifyMatchInfoTable *infoTable, const struct UsbPnpMatchIdTable *idTable, uint32_t cmdId)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct HdfSBuf *pnpData = NULL;
|
||||
struct UsbPnpNotifyServiceInfo serviceInfo;
|
||||
struct UsbPnpDeviceListTable *deviceListTable = NULL;
|
||||
@@ -825,7 +818,7 @@ ERROR:
|
||||
static void UsbDdkPnpLoaderAddDevice(uint32_t cmdId, uint8_t index, struct HdfDeviceObject *usbPnpManagerDevice,
|
||||
const struct UsbPnpNotifyMatchInfoTable *infoTable, struct UsbPnpMatchIdTable **matchIdTable)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbPnpMatchIdTable *idTable = NULL;
|
||||
int32_t tableCount;
|
||||
|
||||
@@ -838,9 +831,8 @@ static void UsbDdkPnpLoaderAddDevice(uint32_t cmdId, uint8_t index, struct HdfDe
|
||||
continue;
|
||||
}
|
||||
|
||||
HDF_LOGD("%s:%d matchDevice end, index=%d tableCount=%d is match \
|
||||
idTable=%p, moduleName=%s, serviceName=%s",
|
||||
__func__, __LINE__, index, tableCount, idTable, idTable->moduleName, idTable->serviceName);
|
||||
HDF_LOGD("%s:%d matchDevice end, index=%d tableCount=%d is match moduleName=%s, serviceName=%s",
|
||||
__func__, __LINE__, index, tableCount, idTable->moduleName, idTable->serviceName);
|
||||
|
||||
ret = UsbDdkPnpLoaderrAddPnpDevice(usbPnpManagerDevice, infoTable, idTable, cmdId);
|
||||
if (ret != HDF_SUCCESS) {
|
||||
@@ -849,15 +841,15 @@ static void UsbDdkPnpLoaderAddDevice(uint32_t cmdId, uint8_t index, struct HdfDe
|
||||
}
|
||||
}
|
||||
|
||||
static int UsbDdkPnpLoaderRemoveHandle(struct HdfDeviceObject *usbPnpManager,
|
||||
static int32_t UsbDdkPnpLoaderRemoveHandle(struct HdfDeviceObject *usbPnpManager,
|
||||
struct UsbPnpDeviceListTable *deviceListTablePos)
|
||||
{
|
||||
struct UsbPnpNotifyServiceInfo serviceInfo;
|
||||
struct HdfSBuf *pnpData = NULL;
|
||||
int ret = HDF_SUCCESS;
|
||||
int32_t ret = HDF_SUCCESS;
|
||||
|
||||
serviceInfo.length = sizeof(struct UsbPnpNotifyServiceInfo) - (USB_PNP_INFO_MAX_INTERFACES \
|
||||
- deviceListTablePos->interfaceLength);
|
||||
serviceInfo.length = (uint32_t)(sizeof(struct UsbPnpNotifyServiceInfo) - (USB_PNP_INFO_MAX_INTERFACES \
|
||||
- deviceListTablePos->interfaceLength));
|
||||
serviceInfo.devNum = deviceListTablePos->devNum;
|
||||
serviceInfo.busNum = deviceListTablePos->busNum;
|
||||
serviceInfo.interfaceLength = deviceListTablePos->interfaceLength;
|
||||
@@ -885,10 +877,10 @@ ERROR:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int UsbDdkPnpLoaderRemoveDevice(struct HdfDeviceObject *usbPnpManager,
|
||||
static int32_t UsbDdkPnpLoaderRemoveDevice(struct HdfDeviceObject *usbPnpManager,
|
||||
struct UsbPnpRemoveInfo removeInfo, uint32_t cmdId)
|
||||
{
|
||||
int ret = HDF_SUCCESS;
|
||||
int32_t ret = HDF_SUCCESS;
|
||||
struct UsbPnpDeviceListTable *deviceListTablePos = NULL;
|
||||
struct UsbPnpDeviceListTable *deviceListTableTemp = NULL;
|
||||
bool findFlag = false;
|
||||
@@ -929,15 +921,14 @@ static int UsbDdkPnpLoaderRemoveDevice(struct HdfDeviceObject *usbPnpManager,
|
||||
}
|
||||
|
||||
if (findFlag == false) {
|
||||
HDF_LOGE("%s:%d removeType=%d, usbDevAddr=0x%x, to be remove but not exist.",
|
||||
__func__, __LINE__, removeInfo.removeType, (uint32_t)removeInfo.usbDevAddr);
|
||||
HDF_LOGE("%s:%d removeType=%d to be remove but not exist.", __func__, __LINE__, removeInfo.removeType);
|
||||
ret = HDF_FAILURE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int UsbDdkPnpLoaderDevice(struct HdfDeviceObject *usbPnpManagerDevice,
|
||||
static int32_t UsbDdkPnpLoaderDevice(struct HdfDeviceObject *usbPnpManagerDevice,
|
||||
const struct UsbPnpNotifyMatchInfoTable *infoTable, uint32_t id)
|
||||
{
|
||||
int8_t i;
|
||||
@@ -977,10 +968,10 @@ static int UsbDdkPnpLoaderDevice(struct HdfDeviceObject *usbPnpManagerDevice,
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
static int UsbDdkPnpLoaderEventSend(const struct HdfIoService *serv, const char *eventData)
|
||||
static int32_t UsbDdkPnpLoaderEventSend(const struct HdfIoService *serv, const char *eventData)
|
||||
{
|
||||
int ret;
|
||||
int replyData = 0;
|
||||
int32_t ret;
|
||||
int32_t replyData = 0;
|
||||
struct HdfSBuf *data = NULL;
|
||||
|
||||
data = HdfSbufObtainDefaultSize();
|
||||
@@ -1024,9 +1015,9 @@ OUT:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int UsbDdkPnpLoaderEventReceived(void *usbPnpManagerPtr, uint32_t id, struct HdfSBuf *data)
|
||||
int32_t UsbDdkPnpLoaderEventReceived(void *usbPnpManagerPtr, uint32_t id, struct HdfSBuf *data)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
bool flag = false;
|
||||
uint32_t infoSize;
|
||||
struct UsbPnpNotifyMatchInfoTable *infoTable = NULL;
|
||||
@@ -1036,15 +1027,13 @@ int UsbDdkPnpLoaderEventReceived(void *usbPnpManagerPtr, uint32_t id, struct Hdf
|
||||
flag = HdfSbufReadBuffer(data, (const void **)(&infoTable), &infoSize);
|
||||
if ((flag == false) || (infoTable == NULL)) {
|
||||
ret = HDF_ERR_INVALID_PARAM;
|
||||
HDF_LOGE("%s: fail to read infoTable in event data, flag=%d, infoTable=%p", \
|
||||
__func__, flag, infoTable);
|
||||
HDF_LOGE("%s: fail to read infoTable in event data, flag=%d", __func__, flag);
|
||||
return ret;
|
||||
}
|
||||
|
||||
HDF_LOGI("%s:%d id=%d infoSize=%d, usbDevAddr=0x%x, devNum=%d, \
|
||||
busNum=%d, infoTable=0x%x-0x%x success",
|
||||
__func__, __LINE__, id, infoSize, (uint32_t)infoTable->usbDevAddr, infoTable->devNum,
|
||||
infoTable->busNum, infoTable->deviceInfo.vendorId, infoTable->deviceInfo.productId);
|
||||
HDF_LOGI("%s:%d id=%d infoSize=%d, devNum=%d, busNum=%d, infoTable=0x%x-0x%x success",
|
||||
__func__, __LINE__, id, infoSize, infoTable->devNum, infoTable->busNum,
|
||||
infoTable->deviceInfo.vendorId, infoTable->deviceInfo.productId);
|
||||
|
||||
switch (id) {
|
||||
case USB_PNP_NOTIFY_ADD_INTERFACE:
|
||||
@@ -1077,9 +1066,9 @@ int UsbDdkPnpLoaderEventReceived(void *usbPnpManagerPtr, uint32_t id, struct Hdf
|
||||
return ret;
|
||||
}
|
||||
|
||||
int UsbDdkPnpLoaderEventHandle(void)
|
||||
int32_t UsbDdkPnpLoaderEventHandle(void)
|
||||
{
|
||||
int status;
|
||||
int32_t status;
|
||||
int32_t tableCount = 0;
|
||||
static bool firstInitFlag = true;
|
||||
const struct UsbPnpMatchIdTable *idTable = NULL;
|
||||
|
||||
@@ -69,13 +69,13 @@ struct Serial {
|
||||
bool writeBusy;
|
||||
bool suspended;
|
||||
bool startDelayed;
|
||||
int refCount;
|
||||
int32_t refCount;
|
||||
};
|
||||
|
||||
struct AcmNotifyMethod {
|
||||
void (*Connect)(struct AcmDevice *acm);
|
||||
void (*Disconnect)(struct AcmDevice *acm);
|
||||
int (*SendBreak)(struct AcmDevice *acm, int duration);
|
||||
int32_t (*SendBreak)(struct AcmDevice *acm, int32_t duration);
|
||||
};
|
||||
|
||||
struct AcmPipe {
|
||||
@@ -132,7 +132,7 @@ struct AcmDevice *SetUpAcmDevice(void);
|
||||
void ReleaseAcmDevice(struct AcmDevice *acm);
|
||||
void AcmEventCallback(struct UsbFnEvent *event);
|
||||
void AcmDeviceRelease(struct AcmDevice *acmDevice);
|
||||
int remove_usb_device(void);
|
||||
int32_t remove_usb_device(void);
|
||||
|
||||
struct AcmDevice *UsbGetAcmDevice(void);
|
||||
int32_t UsbFnDviceTestCreate(void);
|
||||
|
||||
@@ -338,7 +338,7 @@ static struct Serial *SerialAlloc(void)
|
||||
static void ParsePipes(struct AcmDevice *acmDevice, const struct UsbFnInterface *fnIface, UsbFnInterfaceHandle handle)
|
||||
{
|
||||
uint32_t j;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnPipeInfo pipeInfo = {0};
|
||||
for (j = 0; j < fnIface->info.numPipes; j++) {
|
||||
ret = UsbFnGetInterfacePipeInfo((struct UsbFnInterface *)fnIface, j, &pipeInfo);
|
||||
@@ -366,7 +366,7 @@ static void ParsePipes(struct AcmDevice *acmDevice, const struct UsbFnInterface
|
||||
}
|
||||
}
|
||||
|
||||
static int ParseInterfaces(struct AcmDevice *acmDevice)
|
||||
static int32_t ParseInterfaces(struct AcmDevice *acmDevice)
|
||||
{
|
||||
uint32_t i;
|
||||
struct UsbFnInterface *fnIface = NULL;
|
||||
@@ -408,13 +408,13 @@ OUT:
|
||||
DListInsertTail(&req->list, &acm->ctrlPool);
|
||||
}
|
||||
|
||||
static int AllocCtrlRequests(struct AcmDevice *acmDevice)
|
||||
static int32_t AllocCtrlRequests(struct AcmDevice *acmDevice)
|
||||
{
|
||||
struct DListHead *head = &acmDevice->ctrlPool;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
struct CtrlInfo *ctrlInfo = NULL;
|
||||
int i;
|
||||
int count = 2;
|
||||
int32_t i;
|
||||
int32_t count = 2;
|
||||
|
||||
DListHeadInit(&acmDevice->ctrlPool);
|
||||
acmDevice->ctrlReqNum = 0;
|
||||
@@ -444,7 +444,7 @@ static int32_t SendNotifyRequest(struct AcmDevice *acm, uint8_t type,
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
struct UsbCdcNotification *notify = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if ((data == NULL) || (acm == NULL) || (acm->ctrlIface.fn == NULL)) {
|
||||
return -1;
|
||||
}
|
||||
@@ -543,7 +543,7 @@ static void Disconnect(struct AcmDevice *acm)
|
||||
NotifySerialState(acm);
|
||||
}
|
||||
|
||||
static int32_t SendBreak(struct AcmDevice *acm, int duration)
|
||||
static int32_t SendBreak(struct AcmDevice *acm, int32_t duration)
|
||||
{
|
||||
uint16_t state;
|
||||
|
||||
@@ -601,13 +601,13 @@ static struct UsbFnRequest *GetCtrlReq(struct AcmDevice *acm)
|
||||
return req;
|
||||
}
|
||||
|
||||
static int Setup(struct AcmDevice *acm, const struct UsbFnCtrlRequest *setup)
|
||||
static int32_t Setup(struct AcmDevice *acm, const struct UsbFnCtrlRequest *setup)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
struct CtrlInfo *ctrlInfo = NULL;
|
||||
uint16_t value = Le16ToCpu(setup->value);
|
||||
uint16_t length = Le16ToCpu(setup->length);
|
||||
int ret = 0;
|
||||
int32_t ret = 0;
|
||||
req = GetCtrlReq(acm);
|
||||
if (req == NULL) {
|
||||
return ret;
|
||||
@@ -617,7 +617,7 @@ static int Setup(struct AcmDevice *acm, const struct UsbFnCtrlRequest *setup)
|
||||
if (length != sizeof(struct UsbCdcLineCoding)) {
|
||||
goto OUT;
|
||||
}
|
||||
ret = length;
|
||||
ret = (int)length;
|
||||
break;
|
||||
case USB_DDK_CDC_REQ_GET_LINE_CODING:
|
||||
ret = (length > sizeof(struct UsbCdcLineCoding)) ? \
|
||||
@@ -640,7 +640,7 @@ static int Setup(struct AcmDevice *acm, const struct UsbFnCtrlRequest *setup)
|
||||
OUT:
|
||||
ctrlInfo = (struct CtrlInfo *)req->context;
|
||||
ctrlInfo->request = setup->request;
|
||||
req->length = ret;
|
||||
req->length = (uint32_t)ret;
|
||||
ret = UsbFnSubmitRequestAsync(req);
|
||||
return ret;
|
||||
}
|
||||
@@ -742,7 +742,7 @@ struct AcmDevice *SetUpAcmDevice(void)
|
||||
|
||||
static int32_t FreeNotifyRequest(struct AcmDevice *acmDevice)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
/* allocate notification request */
|
||||
if (acmDevice->notifyReq == NULL) {
|
||||
@@ -759,7 +759,7 @@ static int32_t FreeNotifyRequest(struct AcmDevice *acmDevice)
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
static int FreeCtrlRequests(struct AcmDevice *acmDevice)
|
||||
static int32_t FreeCtrlRequests(struct AcmDevice *acmDevice)
|
||||
{
|
||||
struct DListHead *head = &acmDevice->ctrlPool;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
@@ -788,15 +788,15 @@ void ReleaseAcmDevice(struct AcmDevice *acm)
|
||||
OsalMemFree(acm->port);
|
||||
}
|
||||
|
||||
int remove_usb_device(void)
|
||||
int32_t remove_usb_device(void)
|
||||
{
|
||||
struct UsbFnDevice *device = NULL;
|
||||
struct UsbFnDeviceMgr *devMgr = NULL;
|
||||
struct UsbFnFuncMgr *funcMgr = NULL;
|
||||
struct UsbFnInterfaceMgr *intfMgr = NULL;
|
||||
const char *udcName = "100e0000.hidwc3_0";
|
||||
int i = 0;
|
||||
int ret;
|
||||
uint8_t i = 0;
|
||||
int32_t ret;
|
||||
|
||||
device = (struct UsbFnDevice *)UsbFnGetDevice(udcName);
|
||||
if (device == NULL) {
|
||||
|
||||
@@ -116,7 +116,7 @@ int32_t UsbFnDviceTestCreate006(void)
|
||||
|
||||
int32_t UsbFnDviceTestStatus(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbFnDeviceState devState;
|
||||
if (g_acmDevice == NULL || g_acmDevice->fnDev == NULL) {
|
||||
HDF_LOGE("%s: fnDev is invail", __func__);
|
||||
@@ -136,7 +136,7 @@ int32_t UsbFnDviceTestStatus(void)
|
||||
|
||||
int32_t UsbFnDviceTestStatus002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbFnDeviceState devState;
|
||||
ret = UsbFnGetDeviceState(NULL, &devState);
|
||||
if (HDF_SUCCESS == ret) {
|
||||
@@ -148,8 +148,8 @@ int32_t UsbFnDviceTestStatus002(void)
|
||||
|
||||
int32_t UsbFnDviceTestStatus003(void)
|
||||
{
|
||||
int ret;
|
||||
int count;
|
||||
int32_t ret;
|
||||
int32_t count;
|
||||
UsbFnDeviceState devState;
|
||||
if (g_acmDevice == NULL || g_acmDevice->fnDev == NULL) {
|
||||
HDF_LOGE("%s: fnDev is invail", __func__);
|
||||
@@ -171,7 +171,7 @@ int32_t UsbFnDviceTestStatus003(void)
|
||||
|
||||
int32_t UsbFnDviceTestStatus004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbFnGetDeviceState(NULL, NULL);
|
||||
if (HDF_SUCCESS == ret) {
|
||||
HDF_LOGE("%s: get status success!!", __func__);
|
||||
@@ -182,7 +182,7 @@ int32_t UsbFnDviceTestStatus004(void)
|
||||
|
||||
int32_t UsbFnDviceTestStatus005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbFnDeviceState *devState = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->fnDev == NULL) {
|
||||
HDF_LOGE("%s: fnDev is invail", __func__);
|
||||
@@ -344,7 +344,7 @@ int32_t UsbFnDviceTestGetInterface005(void)
|
||||
int32_t UsbFnDviceTestGetInterface006(void)
|
||||
{
|
||||
struct UsbFnInterface *fnInterface = NULL;
|
||||
int idCount;
|
||||
int32_t idCount;
|
||||
if (g_acmDevice == NULL || g_acmDevice->fnDev == NULL) {
|
||||
HDF_LOGE("%s: fnDev is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -361,7 +361,7 @@ int32_t UsbFnDviceTestGetInterface006(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetPipeInfo(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnPipeInfo info;
|
||||
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
@@ -382,7 +382,7 @@ int32_t UsbFnDviceTestGetPipeInfo(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetPipeInfo002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnPipeInfo info;
|
||||
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
@@ -403,7 +403,7 @@ int32_t UsbFnDviceTestGetPipeInfo002(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetPipeInfo003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnPipeInfo info;
|
||||
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
@@ -420,7 +420,7 @@ int32_t UsbFnDviceTestGetPipeInfo003(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetPipeInfo004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnPipeInfo *info = NULL;
|
||||
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
@@ -437,7 +437,7 @@ int32_t UsbFnDviceTestGetPipeInfo004(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetPipeInfo005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnPipeInfo info;
|
||||
struct UsbFnInterface *fn = NULL;
|
||||
|
||||
@@ -451,7 +451,7 @@ int32_t UsbFnDviceTestGetPipeInfo005(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetPipeInfo006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnPipeInfo info;
|
||||
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
@@ -481,7 +481,7 @@ static int32_t PropCallBack(const struct UsbFnInterface *intf, const char *name,
|
||||
|
||||
int32_t UsbFnDviceTestRegistProp(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRegistInfo info;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -501,7 +501,7 @@ int32_t UsbFnDviceTestRegistProp(void)
|
||||
|
||||
int32_t UsbFnDviceTestRegistProp002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRegistInfo info;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -521,7 +521,7 @@ int32_t UsbFnDviceTestRegistProp002(void)
|
||||
|
||||
int32_t UsbFnDviceTestRegistProp003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRegistInfo info;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -541,7 +541,7 @@ int32_t UsbFnDviceTestRegistProp003(void)
|
||||
|
||||
int32_t UsbFnDviceTestRegistProp004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRegistInfo info;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -561,7 +561,7 @@ int32_t UsbFnDviceTestRegistProp004(void)
|
||||
|
||||
int32_t UsbFnDviceTestRegistProp005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRegistInfo info;
|
||||
struct UsbFnInterface *fn = NULL;
|
||||
|
||||
@@ -579,7 +579,7 @@ int32_t UsbFnDviceTestRegistProp005(void)
|
||||
|
||||
int32_t UsbFnDviceTestRegistProp006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRegistInfo *info = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -595,7 +595,7 @@ int32_t UsbFnDviceTestRegistProp006(void)
|
||||
|
||||
int32_t UsbFnDviceTestRegistProp007(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRegistInfo info;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -615,7 +615,7 @@ int32_t UsbFnDviceTestRegistProp007(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetProp(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
char buffer[BUFFER_LEN] = {0};
|
||||
char *buff = buffer;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
@@ -636,7 +636,7 @@ int32_t UsbFnDviceTestGetProp(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetProp002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
char buffer[BUFFER_LEN] = {0};
|
||||
char *buff = buffer;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
@@ -653,7 +653,7 @@ int32_t UsbFnDviceTestGetProp002(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetProp003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
char buffer[BUFFER_LEN] = {0};
|
||||
char *buff = buffer;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
@@ -670,7 +670,7 @@ int32_t UsbFnDviceTestGetProp003(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetProp004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
char buffer[BUFFER_LEN] = {0};
|
||||
char *buff = buffer;
|
||||
struct UsbFnInterface *fn = NULL;
|
||||
@@ -685,7 +685,7 @@ int32_t UsbFnDviceTestGetProp004(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetProp005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
char buffer[BUFFER_LEN] = {0};
|
||||
char *buff = buffer;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
@@ -702,7 +702,7 @@ int32_t UsbFnDviceTestGetProp005(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetProp006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.fn is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -717,7 +717,7 @@ int32_t UsbFnDviceTestGetProp006(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetProp007(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
char buffer[BUFFER_LEN] = {0};
|
||||
char *buff = buffer;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
@@ -738,7 +738,7 @@ int32_t UsbFnDviceTestGetProp007(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetProp008(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
char buffer[BUFFER_LEN] = {0};
|
||||
char *buff = buffer;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
@@ -755,7 +755,7 @@ int32_t UsbFnDviceTestGetProp008(void)
|
||||
|
||||
int32_t UsbFnDviceTestSetProp(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.fn is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -770,7 +770,7 @@ int32_t UsbFnDviceTestSetProp(void)
|
||||
|
||||
int32_t UsbFnDviceTestSetProp002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.fn is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -785,7 +785,7 @@ int32_t UsbFnDviceTestSetProp002(void)
|
||||
|
||||
int32_t UsbFnDviceTestSetProp003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnInterface *fn = NULL;
|
||||
|
||||
ret = UsbFnSetInterfaceProp(fn, "name_test", "hellotest");
|
||||
@@ -798,7 +798,7 @@ int32_t UsbFnDviceTestSetProp003(void)
|
||||
|
||||
int32_t UsbFnDviceTestSetProp004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
const char *propName = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.fn is invail", __func__);
|
||||
@@ -814,7 +814,7 @@ int32_t UsbFnDviceTestSetProp004(void)
|
||||
|
||||
int32_t UsbFnDviceTestSetProp005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.fn is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -829,7 +829,7 @@ int32_t UsbFnDviceTestSetProp005(void)
|
||||
|
||||
int32_t UsbFnDviceTestSetProp006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.fn is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -844,7 +844,7 @@ int32_t UsbFnDviceTestSetProp006(void)
|
||||
|
||||
int32_t UsbFnDviceTestSetProp007(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.fn is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -859,7 +859,7 @@ int32_t UsbFnDviceTestSetProp007(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocCtrlRequest(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: dataIface.handle is invail", __func__);
|
||||
@@ -881,7 +881,7 @@ int32_t UsbFnDviceTestAllocCtrlRequest(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocCtrlRequest002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: dataIface.handle is invail", __func__);
|
||||
@@ -903,7 +903,7 @@ int32_t UsbFnDviceTestAllocCtrlRequest002(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocCtrlRequest003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: dataIface.handle is invail", __func__);
|
||||
@@ -924,7 +924,7 @@ int32_t UsbFnDviceTestAllocCtrlRequest003(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocCtrlRequest004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: dataIface.handle is invail", __func__);
|
||||
@@ -945,7 +945,7 @@ int32_t UsbFnDviceTestAllocCtrlRequest004(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocCtrlRequest005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
UsbFnInterfaceHandle handle = NULL;
|
||||
|
||||
@@ -969,7 +969,7 @@ int32_t UsbFnDviceTestAllocCtrlRequest005(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocCtrlRequest006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: dataIface.handle is invail", __func__);
|
||||
@@ -990,7 +990,7 @@ int32_t UsbFnDviceTestAllocCtrlRequest006(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocCtrlRequest007(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: dataIface.handle is invail", __func__);
|
||||
@@ -1011,7 +1011,7 @@ int32_t UsbFnDviceTestAllocCtrlRequest007(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocCtrlRequest008(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
UsbFnInterfaceHandle handle = NULL;
|
||||
|
||||
@@ -1030,7 +1030,7 @@ int32_t UsbFnDviceTestAllocCtrlRequest008(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocRequest(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1052,7 +1052,7 @@ int32_t UsbFnDviceTestAllocRequest(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocRequest002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1074,7 +1074,7 @@ int32_t UsbFnDviceTestAllocRequest002(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocRequest003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1096,7 +1096,7 @@ int32_t UsbFnDviceTestAllocRequest003(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocRequest004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
UsbFnInterfaceHandle handle = NULL;
|
||||
|
||||
@@ -1119,7 +1119,7 @@ int32_t UsbFnDviceTestAllocRequest004(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocRequest005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1140,7 +1140,7 @@ int32_t UsbFnDviceTestAllocRequest005(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocRequest006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1162,7 +1162,7 @@ int32_t UsbFnDviceTestAllocRequest006(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocRequest007(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1184,7 +1184,7 @@ int32_t UsbFnDviceTestAllocRequest007(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocRequest008(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
uint32_t length;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.handle == NULL) {
|
||||
@@ -1207,7 +1207,7 @@ int32_t UsbFnDviceTestAllocRequest008(void)
|
||||
|
||||
int32_t UsbFnDviceTestAllocRequest009(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1229,7 +1229,7 @@ int32_t UsbFnDviceTestAllocRequest009(void)
|
||||
|
||||
int32_t UsbFnDviceTestFreeRequest(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1251,7 +1251,7 @@ int32_t UsbFnDviceTestFreeRequest(void)
|
||||
|
||||
int32_t UsbFnDviceTestFreeRequest002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1273,7 +1273,7 @@ int32_t UsbFnDviceTestFreeRequest002(void)
|
||||
|
||||
int32_t UsbFnDviceTestFreeRequest003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1295,7 +1295,7 @@ int32_t UsbFnDviceTestFreeRequest003(void)
|
||||
|
||||
int32_t UsbFnDviceTestFreeRequest004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1317,8 +1317,8 @@ int32_t UsbFnDviceTestFreeRequest004(void)
|
||||
|
||||
int32_t UsbFnDviceTestFreeRequest005(void)
|
||||
{
|
||||
int ret;
|
||||
int count;
|
||||
int32_t ret;
|
||||
int32_t count;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1342,7 +1342,7 @@ int32_t UsbFnDviceTestFreeRequest005(void)
|
||||
|
||||
int32_t UsbFnDviceTestFreeRequest006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
ret = UsbFnFreeRequest(req);
|
||||
if (HDF_SUCCESS == ret) {
|
||||
@@ -1354,7 +1354,7 @@ int32_t UsbFnDviceTestFreeRequest006(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetRequestStatus(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbRequestStatus status;
|
||||
struct UsbFnRequest *notifyReq = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
@@ -1386,7 +1386,7 @@ int32_t UsbFnDviceTestGetRequestStatus(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetRequestStatus002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbRequestStatus status;
|
||||
struct UsbFnRequest *notifyReq = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
@@ -1419,7 +1419,7 @@ int32_t UsbFnDviceTestGetRequestStatus002(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetRequestStatus003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
@@ -1447,7 +1447,7 @@ int32_t UsbFnDviceTestGetRequestStatus003(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetRequestStatus004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbRequestStatus status;
|
||||
struct UsbFnRequest *notifyReq = NULL;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.handle == NULL) {
|
||||
@@ -1484,7 +1484,7 @@ int32_t UsbFnDviceTestGetRequestStatus004(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetRequestStatus005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbRequestStatus status;
|
||||
struct UsbFnRequest *notifyReq = NULL;
|
||||
ret = UsbFnGetRequestStatus(notifyReq, &status);
|
||||
@@ -1497,7 +1497,7 @@ int32_t UsbFnDviceTestGetRequestStatus005(void)
|
||||
|
||||
int32_t UsbFnDviceTestGetRequestStatus006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbRequestStatus *status = NULL;
|
||||
struct UsbFnRequest *notifyReq = NULL;
|
||||
ret = UsbFnGetRequestStatus(notifyReq, status);
|
||||
@@ -1510,7 +1510,7 @@ int32_t UsbFnDviceTestGetRequestStatus006(void)
|
||||
|
||||
int32_t UsbFnDviceTestStopReceEvent(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1525,7 +1525,7 @@ int32_t UsbFnDviceTestStopReceEvent(void)
|
||||
|
||||
int32_t UsbFnDviceTestStopReceEvent002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnInterface *fn = NULL;
|
||||
ret = UsbFnStopRecvInterfaceEvent(fn);
|
||||
if (HDF_SUCCESS == ret) {
|
||||
@@ -1537,7 +1537,7 @@ int32_t UsbFnDviceTestStopReceEvent002(void)
|
||||
|
||||
int32_t UsbFnDviceTestStopReceEvent003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1552,7 +1552,7 @@ int32_t UsbFnDviceTestStopReceEvent003(void)
|
||||
|
||||
int32_t UsbFnDviceTestStopReceEvent004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1572,7 +1572,7 @@ static void EventCallBack(struct UsbFnEvent *event)
|
||||
|
||||
int32_t UsbFnDviceTestStartReceEvent(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1588,7 +1588,7 @@ int32_t UsbFnDviceTestStartReceEvent(void)
|
||||
|
||||
int32_t UsbFnDviceTestStartReceEvent002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1604,7 +1604,7 @@ int32_t UsbFnDviceTestStartReceEvent002(void)
|
||||
|
||||
int32_t UsbFnDviceTestStartReceEvent003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnInterface *fn = NULL;
|
||||
|
||||
if (g_acmDevice == NULL) {
|
||||
@@ -1622,7 +1622,7 @@ int32_t UsbFnDviceTestStartReceEvent003(void)
|
||||
|
||||
int32_t UsbFnDviceTestStartReceEvent004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1638,8 +1638,8 @@ int32_t UsbFnDviceTestStartReceEvent004(void)
|
||||
|
||||
int32_t UsbFnDviceTestStartReceEvent005(void)
|
||||
{
|
||||
int ret;
|
||||
int count;
|
||||
int32_t ret;
|
||||
int32_t count;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1662,7 +1662,7 @@ int32_t UsbFnDviceTestStartReceEvent005(void)
|
||||
|
||||
int32_t UsbFnDviceTestStartReceEvent006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1678,7 +1678,7 @@ int32_t UsbFnDviceTestStartReceEvent006(void)
|
||||
|
||||
int32_t UsbFnDviceTestStartReceEvent007(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1732,7 +1732,7 @@ int32_t UsbFnDviceTestOpenInterface002(void)
|
||||
|
||||
int32_t UsbFnDviceTestOpenInterface003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbFnInterfaceHandle handle;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.fn == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.fn is invail", __func__);
|
||||
@@ -1759,7 +1759,7 @@ int32_t UsbFnDviceTestOpenInterface003(void)
|
||||
|
||||
int32_t UsbFnDviceTestOpenInterface004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbFnInterfaceHandle handle;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.fn == NULL) {
|
||||
HDF_LOGE("%s: dataIface.handle is invail", __func__);
|
||||
@@ -1799,7 +1799,7 @@ int32_t UsbFnDviceTestOpenInterface005(void)
|
||||
|
||||
int32_t UsbFnDviceTestCloseInterface(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->ctrlIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1816,7 +1816,7 @@ int32_t UsbFnDviceTestCloseInterface(void)
|
||||
|
||||
int32_t UsbFnDviceTestCloseInterface002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: ctrlIface.handle is invail", __func__);
|
||||
return HDF_FAILURE;
|
||||
@@ -1833,7 +1833,7 @@ int32_t UsbFnDviceTestCloseInterface002(void)
|
||||
|
||||
int32_t UsbFnDviceTestCloseInterface003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
if (g_acmDevice == NULL) {
|
||||
HDF_LOGE("%s: dataIface.handle is invail", __func__);
|
||||
@@ -1850,7 +1850,7 @@ int32_t UsbFnDviceTestCloseInterface003(void)
|
||||
|
||||
int32_t UsbFnDviceTestCloseInterface004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
if (g_acmDevice == NULL) {
|
||||
HDF_LOGE("%s: dataIface.handle is invail", __func__);
|
||||
@@ -1867,7 +1867,7 @@ int32_t UsbFnDviceTestCloseInterface004(void)
|
||||
|
||||
int32_t UsbFnDviceTestRemove(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnDevice *fnDev = NULL;
|
||||
|
||||
ret = UsbFnRemoveDevice(fnDev);
|
||||
@@ -1880,7 +1880,7 @@ int32_t UsbFnDviceTestRemove(void)
|
||||
|
||||
int32_t UsbFnDviceTestRemove002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
if (g_acmDevice == NULL || g_acmDevice->fnDev == NULL) {
|
||||
HDF_LOGE("%s: fndev is null", __func__);
|
||||
return HDF_FAILURE;
|
||||
|
||||
@@ -37,7 +37,7 @@ static void ReadComplete(uint8_t pipe, struct UsbFnRequest *req)
|
||||
int32_t UsbFnDviceTestRequestAsync(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbFnSubmitRequestAsync(req);
|
||||
if (HDF_SUCCESS == ret) {
|
||||
@@ -50,8 +50,8 @@ int32_t UsbFnDviceTestRequestAsync(void)
|
||||
int32_t UsbFnDviceTestRequestAsync002(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int ret = HDF_SUCCESS;
|
||||
int ret1;
|
||||
int32_t ret = HDF_SUCCESS;
|
||||
int32_t ret1;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
if (acmDevice == NULL || acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: dataIface.fn is invail", __func__);
|
||||
@@ -95,8 +95,8 @@ int32_t UsbFnDviceTestRequestAsync002(void)
|
||||
int32_t UsbFnDviceTestRequestAsync003(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int ret = HDF_SUCCESS;
|
||||
int ret1;
|
||||
int32_t ret = HDF_SUCCESS;
|
||||
int32_t ret1;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
if (acmDevice == NULL || acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: dataIface.fn is invail", __func__);
|
||||
@@ -148,7 +148,7 @@ static void WriteComplete(uint8_t pipe, struct UsbFnRequest *req)
|
||||
int32_t UsbFnDviceTestRequestAsync004(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
|
||||
if (acmDevice == NULL || acmDevice->dataIface.handle == NULL) {
|
||||
@@ -196,8 +196,8 @@ int32_t UsbFnDviceTestRequestAsync004(void)
|
||||
int32_t UsbFnDviceTestRequestAsync005(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int loopTime = TEST_TIMES;
|
||||
int ret;
|
||||
int32_t loopTime = TEST_TIMES;
|
||||
int32_t ret;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
|
||||
if (acmDevice == NULL || acmDevice->dataIface.handle == NULL) {
|
||||
@@ -245,7 +245,7 @@ int32_t UsbFnDviceTestRequestAsync006(void)
|
||||
int32_t UsbFnDviceTestRequestSync(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbFnSubmitRequestSync(req, 0);
|
||||
if (HDF_SUCCESS == ret) {
|
||||
HDF_LOGE("%s: sync Request success!!", __func__);
|
||||
@@ -257,7 +257,7 @@ int32_t UsbFnDviceTestRequestSync(void)
|
||||
int32_t UsbFnDviceTestRequestSync002(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
uint8_t *data = NULL;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
if (acmDevice == NULL || acmDevice->dataIface.handle == NULL) {
|
||||
@@ -290,8 +290,8 @@ int32_t UsbFnDviceTestRequestSync002(void)
|
||||
int32_t UsbFnDviceTestRequestSync003(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int ret;
|
||||
int submitExit = 0;
|
||||
int32_t ret;
|
||||
int32_t submitExit = 0;
|
||||
uint8_t *data = NULL;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
if (acmDevice == NULL || acmDevice->dataIface.handle == NULL) {
|
||||
@@ -330,7 +330,7 @@ int32_t UsbFnDviceTestRequestSync003(void)
|
||||
int32_t UsbFnDviceTestRequestSync004(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
|
||||
if (acmDevice == NULL || acmDevice->dataIface.handle == NULL) {
|
||||
@@ -365,8 +365,8 @@ int32_t UsbFnDviceTestRequestSync004(void)
|
||||
int32_t UsbFnDviceTestRequestSync005(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int loopTime = TEST_TIMES;
|
||||
int ret;
|
||||
int32_t loopTime = TEST_TIMES;
|
||||
int32_t ret;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
|
||||
if (acmDevice == NULL || acmDevice->dataIface.handle == NULL) {
|
||||
@@ -403,7 +403,7 @@ int32_t UsbFnDviceTestRequestSync005(void)
|
||||
int32_t UsbFnDviceTestRequestSync006(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
if (acmDevice == NULL || acmDevice->dataIface.handle == NULL) {
|
||||
HDF_LOGE("%s: dataIface.fn is invail", __func__);
|
||||
@@ -432,7 +432,7 @@ int32_t UsbFnDviceTestRequestSync006(void)
|
||||
int32_t UsbFnDviceTestRequestSync007(void)
|
||||
{
|
||||
struct UsbFnRequest *req = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbFnSubmitRequestSync(req, SYNC_5000MS);
|
||||
if (ret == 0) {
|
||||
@@ -454,7 +454,7 @@ static void TestCancelComplete(uint8_t pipe, struct UsbFnRequest *req)
|
||||
|
||||
int32_t UsbFnDviceTestCancelRequest(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *notifyReq = NULL;
|
||||
ret = UsbFnCancelRequest(notifyReq);
|
||||
if (HDF_SUCCESS == ret) {
|
||||
@@ -466,7 +466,7 @@ int32_t UsbFnDviceTestCancelRequest(void)
|
||||
|
||||
int32_t UsbFnDviceTestCancelRequest002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
|
||||
@@ -500,7 +500,7 @@ int32_t UsbFnDviceTestCancelRequest002(void)
|
||||
|
||||
int32_t UsbFnDviceTestCancelRequest003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
|
||||
@@ -534,7 +534,7 @@ int32_t UsbFnDviceTestCancelRequest003(void)
|
||||
|
||||
int32_t UsbFnDviceTestCancelRequest004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
|
||||
@@ -568,7 +568,7 @@ int32_t UsbFnDviceTestCancelRequest004(void)
|
||||
|
||||
int32_t UsbFnDviceTestCancelRequest005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
|
||||
@@ -614,7 +614,7 @@ int32_t UsbFnDviceTestCancelRequest005(void)
|
||||
|
||||
int32_t TestCancelRequest(struct UsbFnRequest *req, struct UsbFnRequest *req2)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbFnSubmitRequestAsync(req2);
|
||||
if (HDF_SUCCESS != ret) {
|
||||
HDF_LOGE("%s: request async error", __func__);
|
||||
@@ -645,7 +645,7 @@ int32_t TestCancelRequest(struct UsbFnRequest *req, struct UsbFnRequest *req2)
|
||||
|
||||
int32_t UsbFnDviceTestCancelRequest006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbFnRequest *req = NULL;
|
||||
struct UsbFnRequest *req2 = NULL;
|
||||
struct AcmDevice *acmDevice = UsbGetAcmDevice();
|
||||
|
||||
@@ -188,15 +188,15 @@ struct RawWb {
|
||||
struct UsbRawRequest *request;
|
||||
struct AcmRawDevice *instance;
|
||||
uint8_t *buf;
|
||||
int len;
|
||||
int use;
|
||||
uint32_t len;
|
||||
int32_t use;
|
||||
};
|
||||
|
||||
struct RawRb {
|
||||
uint8_t *base;
|
||||
int size;
|
||||
int index;
|
||||
int use;
|
||||
int32_t size;
|
||||
int32_t index;
|
||||
int32_t use;
|
||||
struct AcmRawDevice *instance;
|
||||
};
|
||||
|
||||
@@ -238,7 +238,7 @@ struct AcmRawDevice {
|
||||
struct SerialRawDevice *port;
|
||||
uint32_t nbIndex;
|
||||
uint32_t nbSize;
|
||||
int transmitting;
|
||||
int32_t transmitting;
|
||||
uint8_t busNum;
|
||||
uint8_t devAddr;
|
||||
uint8_t interfaceCnt;
|
||||
@@ -255,9 +255,9 @@ typedef enum {
|
||||
USB_REQUEST_SELECT_CONFIGURATION,
|
||||
/* select an alternate setting for an interface */
|
||||
USB_REQUEST_SELECT_INTERFACE,
|
||||
/* get the device descriptor from a specific USB device/interface/endpoint */
|
||||
/* get the device descriptor from a specific USB device/interface/endpoint */
|
||||
USB_REQUEST_GET_DESCRIPTOR,
|
||||
/* set descriptor on a device/interface/endpoint */
|
||||
/* set descriptor on a device/interface/endpoint */
|
||||
USB_REQUEST_SET_DESCRIPTOR,
|
||||
/* set a feature on a device/interface/endpoint/other */
|
||||
USB_REQUEST_SET_FEATURE,
|
||||
@@ -287,14 +287,14 @@ struct UsbIsoPacketDesc {
|
||||
struct UsbAdapterUrb {
|
||||
unsigned char type;
|
||||
unsigned char endPoint;
|
||||
int status;
|
||||
int32_t status;
|
||||
unsigned int flags;
|
||||
void *buffer;
|
||||
int bufferLength;
|
||||
int actualLength;
|
||||
int startFrame;
|
||||
int numberOfPackets;
|
||||
int errorCount;
|
||||
int32_t bufferLength;
|
||||
int32_t actualLength;
|
||||
int32_t startFrame;
|
||||
int32_t numberOfPackets;
|
||||
int32_t errorCount;
|
||||
unsigned int signr;
|
||||
void *userContext;
|
||||
struct UsbIsoPacketDesc isoFrameDesc[0];
|
||||
@@ -305,9 +305,9 @@ struct UsbHostRequest {
|
||||
/* the address of data buffer */
|
||||
unsigned char *buffer;
|
||||
/* the length of data buffer */
|
||||
int length;
|
||||
uint32_t length;
|
||||
/* the actual length of the requested data */
|
||||
int actualLength;
|
||||
int32_t actualLength;
|
||||
/* the status of the request */
|
||||
UsbRequestStatus status;
|
||||
/* private user data */
|
||||
@@ -318,7 +318,7 @@ struct UsbHostRequest {
|
||||
UsbRawRequestCallback callback;
|
||||
UsbRequestCallback userCallback;
|
||||
/* the length of data buffer */
|
||||
int bufLen;
|
||||
int32_t bufLen;
|
||||
struct OsalSem sem;
|
||||
unsigned char endPoint;
|
||||
unsigned int timeout;
|
||||
@@ -327,13 +327,13 @@ struct UsbHostRequest {
|
||||
void *urbs;
|
||||
void **isoUrbs;
|
||||
};
|
||||
int numUrbs;
|
||||
int numRetired;
|
||||
int32_t numUrbs;
|
||||
int32_t numRetired;
|
||||
UsbRequestStatus reqStatus;
|
||||
int isoPacketOffset;
|
||||
int32_t isoPacketOffset;
|
||||
struct OsalMutex lock;
|
||||
void *privateObj;
|
||||
int numIsoPackets;
|
||||
int32_t numIsoPackets;
|
||||
/* isopacketdesc ptr */
|
||||
struct UsbIsoPacketDesc isoPacketDesc[0];
|
||||
}__attribute__((aligned(4)));
|
||||
@@ -344,8 +344,8 @@ struct UsbHostRequest {
|
||||
struct UsbFillRequestData {
|
||||
unsigned char endPoint;
|
||||
unsigned char *buffer;
|
||||
int length;
|
||||
int numIsoPackets;
|
||||
uint32_t length;
|
||||
int32_t numIsoPackets;
|
||||
UsbRawRequestCallback callback;
|
||||
void *userData;
|
||||
unsigned int timeout;
|
||||
@@ -358,15 +358,15 @@ struct UsbRawTestFunc {
|
||||
};
|
||||
|
||||
struct AcmRawDevice *UsbGetIoAcm(void);
|
||||
int UsbParseConfigDescriptor(struct AcmRawDevice *acm, struct UsbRawConfigDescriptor *config);
|
||||
int AcmWriteBufAlloc(struct AcmRawDevice *acm);
|
||||
int32_t UsbParseConfigDescriptor(struct AcmRawDevice *acm, struct UsbRawConfigDescriptor *config);
|
||||
int32_t AcmWriteBufAlloc(struct AcmRawDevice *acm);
|
||||
void AcmNotifyReqCallback(const void *requestArg);
|
||||
void AcmReadBulkCallback(const void *requestArg);
|
||||
void AcmWriteIsoCallback(const void *requestArg);
|
||||
void AcmWriteBulkCallback(const void *requestArg);
|
||||
int UsbStopIo(void);
|
||||
int UsbStartIo(void);
|
||||
int UsbIoThread(void *data);
|
||||
int32_t UsbStopIo(void);
|
||||
int32_t UsbStartIo(void);
|
||||
int32_t UsbIoThread(void *data);
|
||||
void AcmWriteBufFree(struct AcmRawDevice *acm);
|
||||
void AcmCtrlReqCallback(const void *requestArg);
|
||||
int32_t CheckRawSdkIfInit001(void);
|
||||
|
||||
@@ -137,15 +137,15 @@ struct AcmWb {
|
||||
struct UsbRequest *request;
|
||||
struct AcmDevice *instance;
|
||||
uint8_t *buf;
|
||||
int len;
|
||||
int use;
|
||||
uint32_t len;
|
||||
int32_t use;
|
||||
};
|
||||
|
||||
struct AcmRb {
|
||||
uint8_t *base;
|
||||
int size;
|
||||
int index;
|
||||
int use;
|
||||
int32_t size;
|
||||
int32_t index;
|
||||
int32_t use;
|
||||
struct AcmDevice *instance;
|
||||
};
|
||||
|
||||
@@ -189,7 +189,7 @@ struct AcmDevice {
|
||||
struct SerialDevice *port;
|
||||
uint32_t nbIndex;
|
||||
uint32_t nbSize;
|
||||
int transmitting;
|
||||
int32_t transmitting;
|
||||
int32_t ctrlReqNum;
|
||||
uint8_t busNum;
|
||||
uint8_t devAddr;
|
||||
|
||||
@@ -26,7 +26,7 @@ struct AcmRawDevice g_deviceService;
|
||||
struct AcmRawDevice *g_acm = &g_deviceService;
|
||||
UsbRawHandle *g_devHandle = NULL;
|
||||
UsbRawDevice *g_dev = NULL;
|
||||
int g_activeConfig;
|
||||
int32_t g_activeConfig;
|
||||
bool g_initFlag;
|
||||
bool g_stopIoThreadFlag = false;
|
||||
|
||||
@@ -35,9 +35,9 @@ struct AcmRawDevice *UsbGetIoAcm(void)
|
||||
return g_acm;
|
||||
}
|
||||
|
||||
int UsbIoThread(void *data)
|
||||
int32_t UsbIoThread(void *data)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *acm = (struct AcmRawDevice *)data;
|
||||
|
||||
while (true) {
|
||||
@@ -77,10 +77,10 @@ int UsbIoThread(void *data)
|
||||
}
|
||||
|
||||
|
||||
int UsbStartIo(void)
|
||||
int32_t UsbStartIo(void)
|
||||
{
|
||||
struct OsalThreadParam threadCfg;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
printf("%s start\n", __func__);
|
||||
g_stopIoThreadFlag = false;
|
||||
@@ -107,9 +107,9 @@ int UsbStartIo(void)
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
int UsbStopIo(void)
|
||||
int32_t UsbStopIo(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
g_stopIoThreadFlag = true;
|
||||
HDF_LOGD("%s:%d", __func__, __LINE__);
|
||||
ret = OsalThreadDestroy(&g_acm->ioThread);
|
||||
@@ -164,7 +164,7 @@ void AcmReadBulkCallback(const void *requestArg)
|
||||
printf("%s:%d userData(acm) is NULL!", __func__, __LINE__);
|
||||
return;
|
||||
}
|
||||
size_t size = req->actualLength;
|
||||
size_t size = (size_t)req->actualLength;
|
||||
|
||||
switch (req->status) {
|
||||
case USB_REQUEST_COMPLETED:
|
||||
@@ -175,7 +175,6 @@ void AcmReadBulkCallback(const void *requestArg)
|
||||
}
|
||||
break;
|
||||
case USB_REQUEST_CANCELLED:
|
||||
printf("%s: the request is cancelled request:%p\n", __func__, req);
|
||||
return;
|
||||
default:
|
||||
printf("%s: the request is failed\n", __func__);
|
||||
@@ -211,9 +210,9 @@ void AcmNotifyReqCallback(const void *requestArg)
|
||||
printf("Irqstatus:%d,actualLength:%u\n", req->status, currentSize);
|
||||
}
|
||||
|
||||
static int AcmWriteBufAllocHandle(const struct AcmRawDevice *acm)
|
||||
static int32_t AcmWriteBufAllocHandle(const struct AcmRawDevice *acm)
|
||||
{
|
||||
int i;
|
||||
int32_t i;
|
||||
struct RawWb *wb;
|
||||
for (wb = (struct RawWb *)&acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
|
||||
wb->buf = OsalMemCalloc(acm->dataOutEp.maxPacketSize);
|
||||
@@ -232,9 +231,9 @@ static int AcmWriteBufAllocHandle(const struct AcmRawDevice *acm)
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
int AcmWriteBufAlloc(struct AcmRawDevice *acm)
|
||||
int32_t AcmWriteBufAlloc(struct AcmRawDevice *acm)
|
||||
{
|
||||
int ret = HDF_SUCCESS;
|
||||
int32_t ret = HDF_SUCCESS;
|
||||
|
||||
if (!g_writeBufFlag) {
|
||||
ret = AcmWriteBufAllocHandle(acm);
|
||||
@@ -245,7 +244,7 @@ int AcmWriteBufAlloc(struct AcmRawDevice *acm)
|
||||
|
||||
void AcmWriteBufFree(struct AcmRawDevice *acm)
|
||||
{
|
||||
int i;
|
||||
int32_t i;
|
||||
struct RawWb *wb;
|
||||
for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
|
||||
if (wb->buf) {
|
||||
@@ -274,7 +273,7 @@ static void AcmParaseInterfaceClass(
|
||||
switch (ifaceClass) {
|
||||
case USB_DDK_CLASS_COMM:
|
||||
acm->ctrlIface = number;
|
||||
/* get the first endpoint by default */
|
||||
/* get the first endpoint by default */
|
||||
acm->notifyEp.addr = interface->altsetting->endPoint[0].endpointDescriptor.bEndpointAddress;
|
||||
acm->notifyEp.interval = interface->altsetting->endPoint[0].endpointDescriptor.bInterval;
|
||||
acm->notifyEp.maxPacketSize = interface->altsetting->endPoint[0].endpointDescriptor.wMaxPacketSize;
|
||||
@@ -284,13 +283,13 @@ static void AcmParaseInterfaceClass(
|
||||
for (uint8_t j = 0; j < numEndpoints; j++) {
|
||||
const struct UsbRawEndpointDescriptor *endPoint = &interface->altsetting->endPoint[j];
|
||||
|
||||
/* get bulk in endpoint */
|
||||
/* get bulk in endpoint */
|
||||
if ((endPoint->endpointDescriptor.bEndpointAddress
|
||||
& USB_DDK_ENDPOINT_DIR_MASK) == USB_DDK_DIR_IN) {
|
||||
acm->dataInEp.addr = endPoint->endpointDescriptor.bEndpointAddress;
|
||||
acm->dataInEp.interval = endPoint->endpointDescriptor.bInterval;
|
||||
acm->dataInEp.maxPacketSize = endPoint->endpointDescriptor.wMaxPacketSize;
|
||||
} else { /* get bulk out endpoint */
|
||||
} else { /* get bulk out endpoint */
|
||||
acm->dataOutEp.addr = endPoint->endpointDescriptor.bEndpointAddress;
|
||||
acm->dataOutEp.interval = endPoint->endpointDescriptor.bInterval;
|
||||
acm->dataOutEp.maxPacketSize = endPoint->endpointDescriptor.wMaxPacketSize;
|
||||
@@ -303,11 +302,11 @@ static void AcmParaseInterfaceClass(
|
||||
}
|
||||
}
|
||||
|
||||
int UsbParseConfigDescriptor(struct AcmRawDevice *acm, struct UsbRawConfigDescriptor *config)
|
||||
int32_t UsbParseConfigDescriptor(struct AcmRawDevice *acm, struct UsbRawConfigDescriptor *config)
|
||||
{
|
||||
uint8_t numInterfaces;
|
||||
uint8_t i;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
const struct UsbRawInterface *interface = NULL;
|
||||
|
||||
numInterfaces = config->configDescriptor.bNumInterfaces;
|
||||
@@ -564,8 +563,8 @@ int32_t CheckRawSdkIfExit002(void)
|
||||
|
||||
int32_t CheckRawSdkIfInit003(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int32_t ret;
|
||||
int32_t i;
|
||||
|
||||
for (i = 0; i < USB_LOOP_NUM; i++) {
|
||||
ret = UsbRawInit(&g_session);
|
||||
@@ -588,8 +587,8 @@ int32_t CheckRawSdkIfInit003(void)
|
||||
|
||||
int32_t CheckRawSdkIfInit004(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int32_t ret;
|
||||
int32_t i;
|
||||
|
||||
for (i = 0; i < USB_LOOP_NUM; i++) {
|
||||
ret = UsbRawInit(NULL);
|
||||
@@ -845,8 +844,8 @@ int32_t CheckRawSdkIfGetDevice002(void)
|
||||
|
||||
int32_t CheckRawSdkIfClaimInterface002(void)
|
||||
{
|
||||
int ret;
|
||||
int interfaceNumber = 1;
|
||||
int32_t ret;
|
||||
int32_t interfaceNumber = 1;
|
||||
|
||||
ret = UsbRawClaimInterface(g_devHandle, interfaceNumber);
|
||||
if (ret) {
|
||||
@@ -859,8 +858,8 @@ int32_t CheckRawSdkIfClaimInterface002(void)
|
||||
|
||||
int32_t CheckRawSdkIfClaimInterface003(void)
|
||||
{
|
||||
int ret;
|
||||
int interfaceNumber = 0;
|
||||
int32_t ret;
|
||||
int32_t interfaceNumber = 0;
|
||||
|
||||
ret = UsbRawClaimInterface(g_devHandle, interfaceNumber);
|
||||
if (ret) {
|
||||
@@ -873,8 +872,8 @@ int32_t CheckRawSdkIfClaimInterface003(void)
|
||||
|
||||
int32_t CheckRawSdkIfClaimInterface004(void)
|
||||
{
|
||||
int ret;
|
||||
int interfaceNumber = USB_MAX_BYTE;
|
||||
int32_t ret;
|
||||
int32_t interfaceNumber = USB_MAX_BYTE;
|
||||
|
||||
ret = UsbRawClaimInterface(g_devHandle, interfaceNumber);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
@@ -887,7 +886,7 @@ int32_t CheckRawSdkIfClaimInterface004(void)
|
||||
|
||||
int32_t CheckRawSdkIfGetDeviceDescriptor002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbRawGetDeviceDescriptor(g_dev, NULL);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
@@ -900,7 +899,7 @@ int32_t CheckRawSdkIfGetDeviceDescriptor002(void)
|
||||
|
||||
int32_t CheckRawSdkIfGetDeviceDescriptor003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbRawGetDeviceDescriptor(NULL, NULL);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
@@ -914,7 +913,7 @@ int32_t CheckRawSdkIfGetDeviceDescriptor003(void)
|
||||
int32_t CheckRawSdkIfGetDeviceDescriptor004(void)
|
||||
{
|
||||
struct UsbDeviceDescriptor desc;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbRawGetDeviceDescriptor(g_dev, &desc);
|
||||
if (ret) {
|
||||
@@ -942,7 +941,7 @@ int32_t CheckRawSdkIfGetConfigDescriptor005(void)
|
||||
int32_t CheckRawSdkIfGetDeviceDescriptor005(void)
|
||||
{
|
||||
struct UsbDeviceDescriptor desc;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbRawGetDeviceDescriptor(g_dev, &desc);
|
||||
if (ret) {
|
||||
@@ -1009,7 +1008,7 @@ int32_t CheckRawSdkIfGetConfigDescriptor004(void)
|
||||
int32_t CheckRawSdkIfSetConfiguration001(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int config = 0;
|
||||
int32_t config = 0;
|
||||
|
||||
ret = UsbRawSetConfiguration(NULL, config);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
@@ -1023,7 +1022,7 @@ int32_t CheckRawSdkIfSetConfiguration001(void)
|
||||
int32_t CheckRawSdkIfSetConfiguration002(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int config = 0;
|
||||
int32_t config = 0;
|
||||
|
||||
ret = UsbRawSetConfiguration(g_acm->devHandle, config);
|
||||
if (ret) {
|
||||
@@ -1037,7 +1036,7 @@ int32_t CheckRawSdkIfSetConfiguration002(void)
|
||||
int32_t CheckRawSdkIfSetConfiguration003(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int config = 1;
|
||||
int32_t config = 1;
|
||||
|
||||
ret = UsbRawSetConfiguration(g_acm->devHandle, config);
|
||||
if (ret) {
|
||||
@@ -1051,7 +1050,7 @@ int32_t CheckRawSdkIfSetConfiguration003(void)
|
||||
int32_t CheckRawSdkIfSetConfiguration004(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int config = 10;
|
||||
int32_t config = 10;
|
||||
|
||||
ret = UsbRawSetConfiguration(g_acm->devHandle, config);
|
||||
if (ret != HDF_SUCCESS) {
|
||||
@@ -1065,7 +1064,7 @@ int32_t CheckRawSdkIfSetConfiguration004(void)
|
||||
int32_t CheckRawSdkIfSetConfiguration005(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int config = 100;
|
||||
int32_t config = 100;
|
||||
|
||||
ret = UsbRawSetConfiguration(g_acm->devHandle, config);
|
||||
if (ret != HDF_SUCCESS) {
|
||||
@@ -1079,7 +1078,7 @@ int32_t CheckRawSdkIfSetConfiguration005(void)
|
||||
int32_t CheckRawSdkIfSetConfiguration006(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int config = 200;
|
||||
int32_t config = 200;
|
||||
|
||||
ret = UsbRawSetConfiguration(g_acm->devHandle, config);
|
||||
if (ret != HDF_SUCCESS) {
|
||||
@@ -1093,7 +1092,7 @@ int32_t CheckRawSdkIfSetConfiguration006(void)
|
||||
int32_t CheckRawSdkIfSetConfiguration007(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int config = USB_MAX_BYTE;
|
||||
int32_t config = USB_MAX_BYTE;
|
||||
|
||||
ret = UsbRawSetConfiguration(g_acm->devHandle, config);
|
||||
if (ret != HDF_SUCCESS) {
|
||||
@@ -1107,7 +1106,7 @@ int32_t CheckRawSdkIfSetConfiguration007(void)
|
||||
int32_t CheckRawSdkIfSetConfiguration008(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int config = 0;
|
||||
int32_t config = 0;
|
||||
|
||||
ret = UsbRawSetConfiguration(g_acm->devHandle, config);
|
||||
if (ret) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
int32_t CheckRawSdkIfGetDeviceDescriptor001(void)
|
||||
{
|
||||
struct UsbDeviceDescriptor desc;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbRawGetDeviceDescriptor(NULL, &desc);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -37,8 +37,8 @@ int32_t CheckRawSdkIfGetDeviceDescriptor001(void)
|
||||
|
||||
int32_t CheckRawSdkIfClaimInterface001(void)
|
||||
{
|
||||
int ret;
|
||||
int interfaceNumber = 1;
|
||||
int32_t ret;
|
||||
int32_t interfaceNumber = 1;
|
||||
|
||||
ret = UsbRawClaimInterface(NULL, interfaceNumber);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
@@ -51,7 +51,7 @@ int32_t CheckRawSdkIfClaimInterface001(void)
|
||||
|
||||
int32_t CheckRawSdkIfClaimInterface005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbParseConfigDescriptor(rawAcm, rawAcm->config);
|
||||
@@ -65,7 +65,7 @@ int32_t CheckRawSdkIfClaimInterface005(void)
|
||||
|
||||
int32_t CheckRawSdkIfReleaseInterface001(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbRawReleaseInterface(NULL, rawAcm->ctrlIface);
|
||||
@@ -79,7 +79,7 @@ int32_t CheckRawSdkIfReleaseInterface001(void)
|
||||
|
||||
int32_t CheckRawSdkIfReleaseInterface002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbRawReleaseInterface(rawAcm->devHandle, rawAcm->ctrlIface);
|
||||
@@ -93,7 +93,7 @@ int32_t CheckRawSdkIfReleaseInterface002(void)
|
||||
|
||||
int32_t CheckRawSdkIfReleaseInterface003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbRawReleaseInterface(NULL, rawAcm->dataIface);
|
||||
@@ -107,7 +107,7 @@ int32_t CheckRawSdkIfReleaseInterface003(void)
|
||||
|
||||
int32_t CheckRawSdkIfReleaseInterface004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbRawReleaseInterface(rawAcm->devHandle, rawAcm->dataIface);
|
||||
@@ -121,7 +121,7 @@ int32_t CheckRawSdkIfReleaseInterface004(void)
|
||||
|
||||
int32_t CheckRawSdkIfClaimInterface006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbParseConfigDescriptor(rawAcm, rawAcm->config);
|
||||
@@ -135,8 +135,8 @@ int32_t CheckRawSdkIfClaimInterface006(void)
|
||||
|
||||
int32_t CheckRawSdkIfAllocRequest001(void)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
int32_t i;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = AcmWriteBufAlloc(rawAcm);
|
||||
@@ -159,8 +159,8 @@ int32_t CheckRawSdkIfAllocRequest001(void)
|
||||
|
||||
int32_t CheckRawSdkIfAllocRequest002(void)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
int32_t i;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = AcmWriteBufAlloc(rawAcm);
|
||||
@@ -184,7 +184,7 @@ int32_t CheckRawSdkIfAllocRequest002(void)
|
||||
|
||||
int32_t CheckRawSdkIfAllocRequest003(void)
|
||||
{
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
for (i = 0; i < ACM_NR; i++) {
|
||||
@@ -200,7 +200,7 @@ int32_t CheckRawSdkIfAllocRequest003(void)
|
||||
|
||||
int32_t CheckRawSdkIfAllocRequest004(void)
|
||||
{
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
for (i = 0; i < ACM_NR; i++) {
|
||||
@@ -308,12 +308,12 @@ int32_t CheckRawSdkIfFillIsoRequest001(void)
|
||||
{
|
||||
struct UsbRawFillRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
uint32_t size;
|
||||
char sendData[] = {"abcde\0"};
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
size = strlen(sendData) + 1;
|
||||
printf("---size:%d\n", size);
|
||||
printf("---size:%u\n", size);
|
||||
size = (size > rawAcm->isoEp.maxPacketSize) ? rawAcm->isoEp.maxPacketSize : size;
|
||||
for (i = 0; i < 1; i++) {
|
||||
reqData.endPoint = rawAcm->isoEp.addr;
|
||||
@@ -336,12 +336,12 @@ int32_t CheckRawSdkIfFillIsoRequest002(void)
|
||||
{
|
||||
struct UsbRawFillRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
uint32_t size;
|
||||
char sendData[] = {"abcde\0"};
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
size = strlen(sendData) + 1;
|
||||
printf("---size:%d\n", size);
|
||||
printf("---size:%u\n", size);
|
||||
size = (size > rawAcm->isoEp.maxPacketSize) ? rawAcm->isoEp.maxPacketSize : size;
|
||||
for (i = 0; i < 1; i++) {
|
||||
reqData.endPoint = rawAcm->isoEp.addr;
|
||||
@@ -364,12 +364,12 @@ int32_t CheckRawSdkIfFillIsoRequest003(void)
|
||||
{
|
||||
struct UsbRawFillRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
uint32_t size;
|
||||
char sendData[] = {"abcde\0"};
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
size = strlen(sendData) + 1;
|
||||
printf("---size:%d\n", size);
|
||||
printf("---size:%u\n", size);
|
||||
size = (size > rawAcm->isoEp.maxPacketSize) ? rawAcm->isoEp.maxPacketSize : size;
|
||||
for (i = 0; i < 1; i++) {
|
||||
reqData.endPoint = rawAcm->isoEp.addr;
|
||||
@@ -392,12 +392,12 @@ int32_t CheckRawSdkIfFillIsoRequest004(void)
|
||||
{
|
||||
struct UsbRawFillRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
uint32_t size;
|
||||
char sendData[] = {"abcde\0"};
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
size = strlen(sendData) + 1;
|
||||
printf("---size:%d\n", size);
|
||||
printf("---size:%u\n", size);
|
||||
size = (size > rawAcm->isoEp.maxPacketSize) ? rawAcm->isoEp.maxPacketSize : size;
|
||||
for (i = 0; i < 1; i++) {
|
||||
reqData.endPoint = rawAcm->isoEp.addr;
|
||||
@@ -420,12 +420,12 @@ int32_t CheckRawSdkIfFillIsoRequest005(void)
|
||||
{
|
||||
struct UsbRawFillRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
uint32_t size;
|
||||
char sendData[] = {"abcde\0"};
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
size = strlen(sendData) + 1;
|
||||
printf("---size:%d\n", size);
|
||||
printf("---size:%u\n", size);
|
||||
size = (size > rawAcm->isoEp.maxPacketSize) ? rawAcm->isoEp.maxPacketSize : size;
|
||||
for (i = 0; i < 1; i++) {
|
||||
reqData.endPoint = rawAcm->isoEp.addr;
|
||||
@@ -448,12 +448,12 @@ int32_t CheckRawSdkIfFillIsoRequest006(void)
|
||||
{
|
||||
struct UsbRawFillRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
uint32_t size;
|
||||
char sendData[] = {"abcde\0"};
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
size = strlen(sendData) + 1;
|
||||
printf("---size:%d\n", size);
|
||||
printf("---size:%u\n", size);
|
||||
size = (size > rawAcm->isoEp.maxPacketSize) ? rawAcm->isoEp.maxPacketSize : size;
|
||||
for (i = 0; i < 1; i++) {
|
||||
reqData.endPoint = rawAcm->isoEp.addr;
|
||||
@@ -474,7 +474,7 @@ int32_t CheckRawSdkIfFillIsoRequest006(void)
|
||||
int32_t CheckRawSdkIfFreeRequest001(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
for (i = 0; i < ACM_NW; i++) {
|
||||
@@ -493,7 +493,7 @@ int32_t CheckRawSdkIfFreeRequest001(void)
|
||||
int32_t CheckRawSdkIfFreeRequest002(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
for (i = 0; i < ACM_NW; i++) {
|
||||
@@ -553,8 +553,8 @@ int32_t CheckRawSdkIfFreeRequest005(void)
|
||||
|
||||
int32_t CheckRawSdkIfAllocRequest009(void)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
int32_t i;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = AcmWriteBufAlloc(rawAcm);
|
||||
@@ -599,7 +599,7 @@ int32_t CheckRawSdkIfGetDescriptor001(void)
|
||||
{
|
||||
struct UsbRawDescriptorParam param;
|
||||
unsigned char *data = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
data = OsalMemCalloc(USB_BUFFER_MAX_SIZE);
|
||||
@@ -627,7 +627,7 @@ int32_t CheckRawSdkIfGetDescriptor002(void)
|
||||
{
|
||||
struct UsbRawDescriptorParam param;
|
||||
unsigned char *data = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
data = OsalMemCalloc(USB_BUFFER_MAX_SIZE);
|
||||
@@ -655,7 +655,7 @@ int32_t CheckRawSdkIfGetDescriptor003(void)
|
||||
{
|
||||
struct UsbRawDescriptorParam param;
|
||||
unsigned char *data = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
data = OsalMemCalloc(USB_BUFFER_MAX_SIZE);
|
||||
if (data == NULL) {
|
||||
@@ -681,7 +681,7 @@ ERROR:
|
||||
int32_t CheckRawSdkIfGetDescriptor004(void)
|
||||
{
|
||||
unsigned char *data = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
data = OsalMemCalloc(USB_BUFFER_MAX_SIZE);
|
||||
@@ -708,7 +708,7 @@ ERROR:
|
||||
int32_t CheckRawSdkIfGetDescriptor005(void)
|
||||
{
|
||||
struct UsbRawDescriptorParam param;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbRawGetDescriptor(rawAcm->ctrlReq, rawAcm->devHandle, ¶m, NULL);
|
||||
@@ -724,7 +724,7 @@ int32_t CheckRawSdkIfGetDescriptor006(void)
|
||||
{
|
||||
struct UsbRawDescriptorParam param;
|
||||
unsigned char *data = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
data = OsalMemCalloc(USB_BUFFER_MAX_SIZE);
|
||||
@@ -755,7 +755,7 @@ ERROR:
|
||||
int32_t CheckRawSdkIfGetDescriptor007(void)
|
||||
{
|
||||
unsigned char *data = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
data = OsalMemCalloc(USB_BUFFER_MAX_SIZE);
|
||||
@@ -781,7 +781,7 @@ ERROR:
|
||||
|
||||
int32_t CheckRawSdkIfGetDescriptor008(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbRawGetDescriptor(rawAcm->ctrlReq, rawAcm->devHandle, NULL, NULL);
|
||||
@@ -796,7 +796,7 @@ int32_t CheckRawSdkIfGetDescriptor008(void)
|
||||
int32_t CheckRawSdkIfGetDescriptor009(void)
|
||||
{
|
||||
unsigned char *data = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
data = OsalMemCalloc(USB_BUFFER_MAX_SIZE);
|
||||
@@ -824,7 +824,7 @@ int32_t CheckRawSdkIfGetDescriptor010(void)
|
||||
{
|
||||
struct UsbRawDescriptorParam param;
|
||||
unsigned char data[100];
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
param.descType = 0;
|
||||
@@ -844,7 +844,7 @@ int32_t CheckRawSdkIfGetDescriptor011(void)
|
||||
{
|
||||
struct UsbRawDescriptorParam param;
|
||||
unsigned char data[100];
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
param.descType = 0;
|
||||
@@ -863,7 +863,7 @@ int32_t CheckRawSdkIfGetDescriptor011(void)
|
||||
int32_t CheckRawSdkIfGetDescriptor012(void)
|
||||
{
|
||||
unsigned char *data = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
data = OsalMemCalloc(USB_BUFFER_MAX_SIZE);
|
||||
if (data == NULL) {
|
||||
@@ -890,7 +890,7 @@ int32_t CheckRawSdkIfGetDescriptor013(void)
|
||||
{
|
||||
struct UsbRawDescriptorParam param;
|
||||
unsigned char data[100];
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
param.descType = 0;
|
||||
param.descIndex = 0;
|
||||
@@ -907,7 +907,7 @@ int32_t CheckRawSdkIfGetDescriptor013(void)
|
||||
|
||||
int32_t CheckRawSdkIfGetDescriptor014(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbRawGetDescriptor(NULL, rawAcm->devHandle, NULL, NULL);
|
||||
@@ -921,7 +921,7 @@ int32_t CheckRawSdkIfGetDescriptor014(void)
|
||||
|
||||
int32_t CheckRawSdkIfGetDescriptor015(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbRawGetDescriptor(rawAcm->ctrlReq, NULL, NULL, NULL);
|
||||
@@ -935,7 +935,7 @@ int32_t CheckRawSdkIfGetDescriptor015(void)
|
||||
|
||||
int32_t CheckRawSdkIfGetDescriptor016(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbRawGetDescriptor(NULL, NULL, NULL, NULL);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
@@ -950,18 +950,18 @@ int32_t CheckRawSdkIfFillBulkRequest001(void)
|
||||
{
|
||||
struct UsbRawFillRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
uint32_t size;
|
||||
char sendData[] = {"abcde\0"};
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
size = strlen(sendData) + 1;
|
||||
printf("---size:%d\n", size);
|
||||
printf("---size:%u\n", size);
|
||||
|
||||
size = (size > rawAcm->dataOutEp.maxPacketSize) ? rawAcm->dataOutEp.maxPacketSize : size;
|
||||
for (i = 0; i < 1; i++) {
|
||||
struct RawWb *snd = &rawAcm->wb[i];
|
||||
snd->len = size;
|
||||
snd->len = (int)size;
|
||||
ret = memcpy_s(snd->buf, rawAcm->dataOutEp.maxPacketSize, sendData, size);
|
||||
if (ret) {
|
||||
printf("memcpy_s fial");
|
||||
@@ -975,7 +975,7 @@ int32_t CheckRawSdkIfFillBulkRequest001(void)
|
||||
reqData.timeout = USB_CTRL_SET_TIMEOUT;
|
||||
reqData.buffer = snd->buf;
|
||||
reqData.length = snd->len;
|
||||
printf("maxPacketSize:%d+snd->request:%p\n", rawAcm->dataOutEp.maxPacketSize, snd->request);
|
||||
printf("maxPacketSize:%d\n", rawAcm->dataOutEp.maxPacketSize);
|
||||
ret = UsbRawFillBulkRequest(snd->request, rawAcm->devHandle, &reqData);
|
||||
if (ret) {
|
||||
printf("%s: error++ret=%d\n", __func__, ret);
|
||||
@@ -990,9 +990,9 @@ int32_t CheckRawSdkIfFillBulkRequest002(void)
|
||||
{
|
||||
struct UsbRawFillRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->dataInEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->dataInEp.maxPacketSize;
|
||||
|
||||
for (i = 0; i < 1; i++) {
|
||||
reqData.endPoint = rawAcm->dataInEp.addr;
|
||||
@@ -1017,7 +1017,7 @@ int32_t CheckRawSdkIfFillInterruptRequest001(void)
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->notifyEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->notifyEp.maxPacketSize;
|
||||
|
||||
fillRequestData.endPoint = rawAcm->notifyEp.addr;
|
||||
fillRequestData.length = size;
|
||||
@@ -1040,7 +1040,7 @@ int32_t CheckRawSdkIfFillInterruptRequest002(void)
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->notifyEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->notifyEp.maxPacketSize;
|
||||
|
||||
fillRequestData.endPoint = rawAcm->notifyEp.addr;
|
||||
fillRequestData.length = size;
|
||||
@@ -1063,7 +1063,7 @@ int32_t CheckRawSdkIfFillInterruptRequest003(void)
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->notifyEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->notifyEp.maxPacketSize;
|
||||
|
||||
fillRequestData.endPoint = rawAcm->notifyEp.addr;
|
||||
fillRequestData.length = size;
|
||||
@@ -1086,7 +1086,7 @@ int32_t CheckRawSdkIfFillInterruptRequest004(void)
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->notifyEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->notifyEp.maxPacketSize;
|
||||
|
||||
fillRequestData.endPoint = rawAcm->notifyEp.addr;
|
||||
fillRequestData.length = size;
|
||||
@@ -1107,8 +1107,8 @@ int32_t CheckRawSdkIfFillInterruptRequest004(void)
|
||||
int32_t CheckRawSdkIfFillControlRequest001(void)
|
||||
{
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int ret;
|
||||
int completed = 0;
|
||||
int32_t ret;
|
||||
int32_t completed = 0;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
fillRequestData.callback = AcmCtrlReqCallback;
|
||||
@@ -1127,8 +1127,8 @@ int32_t CheckRawSdkIfFillControlRequest001(void)
|
||||
int32_t CheckRawSdkIfFillControlRequest002(void)
|
||||
{
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int ret;
|
||||
int completed = 0;
|
||||
int32_t ret;
|
||||
int32_t completed = 0;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
fillRequestData.callback = AcmCtrlReqCallback;
|
||||
@@ -1147,8 +1147,8 @@ int32_t CheckRawSdkIfFillControlRequest002(void)
|
||||
int32_t CheckRawSdkIfFillControlRequest003(void)
|
||||
{
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int ret;
|
||||
int completed = 0;
|
||||
int32_t ret;
|
||||
int32_t completed = 0;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
fillRequestData.callback = AcmCtrlReqCallback;
|
||||
@@ -1167,8 +1167,8 @@ int32_t CheckRawSdkIfFillControlRequest003(void)
|
||||
int32_t CheckRawSdkIfFillControlRequest004(void)
|
||||
{
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int ret;
|
||||
int completed = 0;
|
||||
int32_t ret;
|
||||
int32_t completed = 0;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
fillRequestData.callback = AcmCtrlReqCallback;
|
||||
@@ -1187,8 +1187,8 @@ int32_t CheckRawSdkIfFillControlRequest004(void)
|
||||
int32_t CheckRawSdkIfFillControlRequest005(void)
|
||||
{
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int ret;
|
||||
int completed = 0;
|
||||
int32_t ret;
|
||||
int32_t completed = 0;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
fillRequestData.callback = AcmCtrlReqCallback;
|
||||
@@ -1207,8 +1207,8 @@ int32_t CheckRawSdkIfFillControlRequest005(void)
|
||||
int32_t CheckRawSdkIfFillControlRequest006(void)
|
||||
{
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int ret;
|
||||
int completed = 0;
|
||||
int32_t ret;
|
||||
int32_t completed = 0;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
fillRequestData.callback = AcmCtrlReqCallback;
|
||||
@@ -1227,8 +1227,8 @@ int32_t CheckRawSdkIfFillControlRequest006(void)
|
||||
int32_t CheckRawSdkIfFillControlRequest007(void)
|
||||
{
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int ret;
|
||||
int completed = 0;
|
||||
int32_t ret;
|
||||
int32_t completed = 0;
|
||||
|
||||
fillRequestData.callback = AcmCtrlReqCallback;
|
||||
fillRequestData.userData = &completed;
|
||||
@@ -1246,8 +1246,8 @@ int32_t CheckRawSdkIfFillControlRequest007(void)
|
||||
int32_t CheckRawSdkIfFillControlRequest008(void)
|
||||
{
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int ret;
|
||||
int completed = 0;
|
||||
int32_t ret;
|
||||
int32_t completed = 0;
|
||||
|
||||
fillRequestData.callback = AcmCtrlReqCallback;
|
||||
fillRequestData.userData = &completed;
|
||||
@@ -1265,7 +1265,7 @@ int32_t CheckRawSdkIfFillControlRequest008(void)
|
||||
int32_t CheckRawSdkIfFillControlSetup001(void)
|
||||
{
|
||||
struct UsbControlRequestData ctrlReq;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
rawAcm->lineCoding.dwDTERate = CpuToLe32(DATARATE);
|
||||
@@ -1293,7 +1293,7 @@ int32_t CheckRawSdkIfFillControlSetup001(void)
|
||||
int32_t CheckRawSdkIfFillControlSetup002(void)
|
||||
{
|
||||
unsigned char *setup = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
setup = OsalMemCalloc(USB_BUFFER_MAX_SIZE);
|
||||
if (setup == NULL) {
|
||||
@@ -1318,7 +1318,7 @@ ERROR:
|
||||
|
||||
int32_t CheckRawSdkIfFillControlSetup003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbRawFillControlSetup(NULL, NULL);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
@@ -1333,7 +1333,7 @@ int32_t CheckRawSdkIfFillControlSetup004(void)
|
||||
{
|
||||
struct UsbControlRequestData ctrlReq;
|
||||
unsigned char *setup = NULL;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
rawAcm->lineCoding.dwDTERate = CpuToLe32(DATARATE);
|
||||
@@ -1373,7 +1373,7 @@ ERROR:
|
||||
int32_t CheckRawSdkIfSendControlRequest001(void)
|
||||
{
|
||||
struct UsbControlRequestData ctrlReq;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
rawAcm->lineCoding.dwDTERate = CpuToLe32(DATARATE);
|
||||
@@ -1400,7 +1400,7 @@ int32_t CheckRawSdkIfSendControlRequest001(void)
|
||||
int32_t CheckRawSdkIfSendControlRequest002(void)
|
||||
{
|
||||
struct UsbControlRequestData ctrlReq;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
rawAcm->lineCoding.dwDTERate = CpuToLe32(DATARATE);
|
||||
@@ -1426,7 +1426,7 @@ int32_t CheckRawSdkIfSendControlRequest002(void)
|
||||
|
||||
int32_t CheckRawSdkIfSendControlRequest003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
ret = UsbRawSendControlRequest(rawAcm->ctrlReq, rawAcm->devHandle, NULL);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
@@ -1440,7 +1440,7 @@ int32_t CheckRawSdkIfSendControlRequest003(void)
|
||||
int32_t CheckRawSdkIfSendControlRequest004(void)
|
||||
{
|
||||
struct UsbControlRequestData ctrlReq;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
rawAcm->lineCoding.dwDTERate = CpuToLe32(DATARATE);
|
||||
@@ -1467,7 +1467,7 @@ int32_t CheckRawSdkIfSendControlRequest004(void)
|
||||
int32_t CheckRawSdkIfSendControlRequest005(void)
|
||||
{
|
||||
struct UsbControlRequestData ctrlReq;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
rawAcm->lineCoding.dwDTERate = CpuToLe32(DATARATE);
|
||||
@@ -1493,7 +1493,7 @@ int32_t CheckRawSdkIfSendControlRequest005(void)
|
||||
|
||||
int32_t CheckRawSdkIfSendControlRequest006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbRawSendControlRequest(NULL, rawAcm->devHandle, NULL);
|
||||
@@ -1507,7 +1507,7 @@ int32_t CheckRawSdkIfSendControlRequest006(void)
|
||||
|
||||
int32_t CheckRawSdkIfSendControlRequest007(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
ret = UsbRawSendControlRequest(rawAcm->ctrlReq, NULL, NULL);
|
||||
@@ -1523,7 +1523,7 @@ int32_t CheckRawSdkIfSendBulkRequest001(void)
|
||||
{
|
||||
struct UsbRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
uint32_t size;
|
||||
char sendData[] = {"abcd\0"};
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
@@ -1533,7 +1533,7 @@ int32_t CheckRawSdkIfSendBulkRequest001(void)
|
||||
|
||||
for (i = 0; i < 1; i++) {
|
||||
struct RawWb *snd = &rawAcm->wb[i];
|
||||
snd->len = size;
|
||||
snd->len = (int)size;
|
||||
ret = memcpy_s(snd->buf, rawAcm->dataOutEp.maxPacketSize, sendData, size);
|
||||
if (ret) {
|
||||
printf("memcpy_s fial");
|
||||
@@ -1544,7 +1544,7 @@ int32_t CheckRawSdkIfSendBulkRequest001(void)
|
||||
reqData.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
reqData.data = snd->buf;
|
||||
reqData.length = snd->len;
|
||||
reqData.requested = (int *)&size;
|
||||
reqData.requested = (int32_t *)&size;
|
||||
}
|
||||
|
||||
for (i = 0; i < 1; i++) {
|
||||
@@ -1564,16 +1564,16 @@ int32_t CheckRawSdkIfSendBulkRequest002(void)
|
||||
{
|
||||
struct UsbRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->dataInEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->dataInEp.maxPacketSize;
|
||||
|
||||
for (i = 0; i < 1; i++) {
|
||||
reqData.endPoint = rawAcm->dataInEp.addr;
|
||||
reqData.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
reqData.length = size;
|
||||
reqData.data = ((struct UsbRawRequest *)rawAcm->readReq[i])->buffer;
|
||||
reqData.requested = (int *)&size;
|
||||
reqData.requested = (int32_t *)&size;
|
||||
}
|
||||
|
||||
for (i = 0; i < 1; i++) {
|
||||
@@ -1592,16 +1592,16 @@ int32_t CheckRawSdkIfSendBulkRequest003(void)
|
||||
{
|
||||
struct UsbRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->dataInEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->dataInEp.maxPacketSize;
|
||||
|
||||
for (i = 0; i < 1; i++) {
|
||||
reqData.endPoint = rawAcm->dataInEp.addr;
|
||||
reqData.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
reqData.length = size;
|
||||
reqData.data = ((struct UsbRawRequest *)rawAcm->readReq[i])->buffer;
|
||||
reqData.requested = (int *)&size;
|
||||
reqData.requested = (int32_t *)&size;
|
||||
}
|
||||
|
||||
for (i = 0; i < 1; i++) {
|
||||
@@ -1620,16 +1620,16 @@ int32_t CheckRawSdkIfSendBulkRequest004(void)
|
||||
{
|
||||
struct UsbRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->dataInEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->dataInEp.maxPacketSize;
|
||||
|
||||
for (i = 0; i < 1; i++) {
|
||||
reqData.endPoint = rawAcm->dataInEp.addr;
|
||||
reqData.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
reqData.length = size;
|
||||
reqData.data = ((struct UsbRawRequest *)rawAcm->readReq[i])->buffer;
|
||||
reqData.requested = (int *)&size;
|
||||
reqData.requested = (int32_t *)&size;
|
||||
}
|
||||
for (i = 0; i < 1; i++) {
|
||||
printf("UsbRawSendBulkRequest i = [%d]\n", i);
|
||||
@@ -1646,7 +1646,7 @@ int32_t CheckRawSdkIfSendBulkRequest004(void)
|
||||
int32_t CheckRawSdkIfSendBulkRequest005(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
for (i = 0; i < 1; i++) {
|
||||
@@ -1666,13 +1666,13 @@ int32_t CheckRawSdkIfSendInterruptRequest001(void)
|
||||
struct UsbRequestData reqData;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->notifyEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->notifyEp.maxPacketSize;
|
||||
|
||||
reqData.endPoint = rawAcm->notifyEp.addr;
|
||||
reqData.length = size;
|
||||
reqData.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
reqData.data = ((struct UsbRawRequest *)rawAcm->notifyReq)->buffer;
|
||||
reqData.requested = (int *)&size;
|
||||
reqData.requested = (int32_t *)&size;
|
||||
ret = UsbRawSendInterruptRequest(rawAcm->notifyReq, rawAcm->devHandle, &reqData);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1687,13 +1687,13 @@ int32_t CheckRawSdkIfSendInterruptRequest002(void)
|
||||
struct UsbRequestData reqData;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->notifyEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->notifyEp.maxPacketSize;
|
||||
|
||||
reqData.endPoint = rawAcm->notifyEp.addr;
|
||||
reqData.length = size;
|
||||
reqData.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
reqData.data = ((struct UsbRawRequest *)rawAcm->notifyReq)->buffer;
|
||||
reqData.requested = (int *)&size;
|
||||
reqData.requested = (int32_t *)&size;
|
||||
|
||||
ret = UsbRawSendInterruptRequest(NULL, rawAcm->devHandle, &reqData);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
@@ -1709,13 +1709,13 @@ int32_t CheckRawSdkIfSendInterruptRequest003(void)
|
||||
struct UsbRequestData reqData;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->notifyEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->notifyEp.maxPacketSize;
|
||||
|
||||
reqData.endPoint = rawAcm->notifyEp.addr;
|
||||
reqData.length = size;
|
||||
reqData.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
reqData.data = ((struct UsbRawRequest *)rawAcm->notifyReq)->buffer;
|
||||
reqData.requested = (int *)&size;
|
||||
reqData.requested = (int32_t *)&size;
|
||||
|
||||
ret = UsbRawSendInterruptRequest(rawAcm->notifyReq, NULL, &reqData);
|
||||
if (ret != HDF_ERR_INVALID_PARAM) {
|
||||
@@ -1744,7 +1744,7 @@ int32_t CheckRawSdkIfFillBulkRequest003(void)
|
||||
{
|
||||
struct UsbRawFillRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
uint32_t size;
|
||||
char sendData[] = {"abcde\0"};
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
@@ -1753,7 +1753,7 @@ int32_t CheckRawSdkIfFillBulkRequest003(void)
|
||||
|
||||
for (i = 0; i < ACM_NW; i++) {
|
||||
struct RawWb *snd = &rawAcm->wb[i];
|
||||
snd->len = size;
|
||||
snd->len = (int)size;
|
||||
ret = memcpy_s(snd->buf, rawAcm->dataOutEp.maxPacketSize, sendData, size);
|
||||
if (ret) {
|
||||
printf("memcpy_s fial");
|
||||
@@ -1782,9 +1782,9 @@ int32_t CheckRawSdkIfFillBulkRequest004(void)
|
||||
{
|
||||
struct UsbRawFillRequestData reqData;
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->dataInEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->dataInEp.maxPacketSize;
|
||||
|
||||
for (i = 0; i < ACM_NW; i++) {
|
||||
reqData.endPoint = rawAcm->dataInEp.addr;
|
||||
@@ -1808,7 +1808,7 @@ int32_t CheckRawSdkIfFillInterruptRequest005(void)
|
||||
struct UsbRawFillRequestData fillRequestData;
|
||||
int32_t ret;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
int size = rawAcm->notifyEp.maxPacketSize;
|
||||
uint32_t size = rawAcm->notifyEp.maxPacketSize;
|
||||
fillRequestData.endPoint = rawAcm->notifyEp.addr;
|
||||
fillRequestData.length = size;
|
||||
fillRequestData.numIsoPackets = 0;
|
||||
@@ -1827,7 +1827,7 @@ int32_t CheckRawSdkIfFillInterruptRequest005(void)
|
||||
int32_t CheckRawSdkIfSubmitRequest001(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
for (i = 0; i < ACM_NW; i++) {
|
||||
@@ -1846,7 +1846,7 @@ int32_t CheckRawSdkIfSubmitRequest001(void)
|
||||
int32_t CheckRawSdkIfSubmitRequest002(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
for (i = 0; i < ACM_NW; i++) {
|
||||
@@ -1891,7 +1891,7 @@ int32_t CheckRawSdkIfSubmitRequest004(void)
|
||||
int32_t CheckRawSdkIfCancelRequest001(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
for (i = 0; i < ACM_NW; i++) {
|
||||
@@ -1909,7 +1909,7 @@ int32_t CheckRawSdkIfCancelRequest001(void)
|
||||
int32_t CheckRawSdkIfCancelRequest002(void)
|
||||
{
|
||||
int32_t ret;
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmRawDevice *rawAcm = UsbGetIoAcm();
|
||||
|
||||
for (i = 0; i < ACM_NR; i++) {
|
||||
|
||||
@@ -34,9 +34,9 @@ static UsbInterfaceHandle *g_acmDataDevHandle[USB_LOOP_NUM];
|
||||
static void AcmReadBulk(struct UsbRequest *req)
|
||||
{
|
||||
uint32_t size;
|
||||
int status = req->compInfo.status;
|
||||
int32_t status = req->compInfo.status;
|
||||
size = req->compInfo.actualLength;
|
||||
printf("Bulk status:%d,actualLength:%d\n", status, size);
|
||||
printf("Bulk status:%d,actualLength:%u\n", status, size);
|
||||
switch (status) {
|
||||
case 0:
|
||||
break;
|
||||
@@ -53,7 +53,7 @@ EXIT:
|
||||
|
||||
static void AcmWriteBulk(struct UsbRequest *req)
|
||||
{
|
||||
int status;
|
||||
int32_t status;
|
||||
|
||||
if (req == NULL) {
|
||||
printf("%s:%d req is NULL!", __func__, __LINE__);
|
||||
@@ -84,9 +84,9 @@ static void AcmWriteIsoCallback(struct UsbRequest *requestArg)
|
||||
printf("%s:%d status:%d\n", __func__, __LINE__, req->compInfo.status);
|
||||
}
|
||||
|
||||
static int AcmWriteBufAllocHandle(const struct AcmDevice *acm)
|
||||
static int32_t AcmWriteBufAllocHandle(const struct AcmDevice *acm)
|
||||
{
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmWb *wb;
|
||||
for (wb = (struct AcmWb *)&acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
|
||||
wb->buf = (uint8_t *)OsalMemCalloc(acm->writeSize);
|
||||
@@ -105,9 +105,9 @@ static int AcmWriteBufAllocHandle(const struct AcmDevice *acm)
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
static int AcmWriteBufAlloc(struct AcmDevice *acm)
|
||||
static int32_t AcmWriteBufAlloc(struct AcmDevice *acm)
|
||||
{
|
||||
int ret = HDF_SUCCESS;
|
||||
int32_t ret = HDF_SUCCESS;
|
||||
|
||||
if (!g_writeBufFlag) {
|
||||
ret = AcmWriteBufAllocHandle(acm);
|
||||
@@ -118,7 +118,7 @@ static int AcmWriteBufAlloc(struct AcmDevice *acm)
|
||||
|
||||
static void AcmWriteBufFree(struct AcmDevice *acm)
|
||||
{
|
||||
int i;
|
||||
int32_t i;
|
||||
struct AcmWb *wb;
|
||||
for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
|
||||
if (wb->buf) {
|
||||
@@ -136,7 +136,7 @@ static void AcmCtrlIrq(struct UsbRequest *req)
|
||||
printf("%s:%d req is NULL!", __func__, __LINE__);
|
||||
return;
|
||||
}
|
||||
int status = req->compInfo.status;
|
||||
int32_t status = req->compInfo.status;
|
||||
unsigned int currentSize = req->compInfo.actualLength;
|
||||
printf("Irqstatus:%d,actualLength:%u\n", status, currentSize);
|
||||
}
|
||||
@@ -157,7 +157,7 @@ static struct UsbControlRequest UsbControlMsg(struct TestControlMsgData msgData)
|
||||
|
||||
static int32_t CheckHostSdkIfInit001(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbInitHostSdk(&g_session);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -170,7 +170,7 @@ static int32_t CheckHostSdkIfInit001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfExit001(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbExitHostSdk(g_acm->session);
|
||||
if (ret) {
|
||||
@@ -185,7 +185,7 @@ static int32_t CheckHostSdkIfExit001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfInit002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbInitHostSdk(NULL);
|
||||
if (ret) {
|
||||
@@ -198,7 +198,7 @@ static int32_t CheckHostSdkIfInit002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfExit002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbExitHostSdk(NULL);
|
||||
if (ret) {
|
||||
@@ -211,8 +211,8 @@ static int32_t CheckHostSdkIfExit002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfInit003(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int32_t ret;
|
||||
int32_t i;
|
||||
|
||||
for (i = 0; i < USB_LOOP_NUM; i++) {
|
||||
ret = UsbInitHostSdk(&g_session);
|
||||
@@ -235,8 +235,8 @@ static int32_t CheckHostSdkIfInit003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfInit004(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int32_t ret;
|
||||
int32_t i;
|
||||
|
||||
for (i = 0; i < USB_LOOP_NUM; i++) {
|
||||
ret = UsbInitHostSdk(NULL);
|
||||
@@ -256,7 +256,7 @@ static int32_t CheckHostSdkIfInit004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfInit005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbInitHostSdk(&g_session);
|
||||
if (ret) {
|
||||
@@ -284,7 +284,7 @@ static int32_t CheckHostSdkIfClaimInterface001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfReleaseInterface001(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbReleaseInterface(g_acm->dataIface);
|
||||
if (ret) {
|
||||
@@ -311,7 +311,7 @@ static int32_t CheckHostSdkIfClaimInterface002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfReleaseInterface002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbReleaseInterface(g_acm->intIface);
|
||||
if (ret) {
|
||||
@@ -338,7 +338,7 @@ static int32_t CheckHostSdkIfClaimInterface003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfReleaseInterface003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbReleaseInterface(g_acm->ctrIface);
|
||||
if (ret) {
|
||||
@@ -436,7 +436,7 @@ static int32_t CheckHostSdkIfOpenInterface001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfCloseInterface001(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbCloseInterface(g_acm->data_devHandle);
|
||||
if (ret) {
|
||||
@@ -460,7 +460,7 @@ static int32_t CheckHostSdkIfOpenInterface002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfCloseInterface002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbCloseInterface(g_acm->int_devHandle);
|
||||
if (ret) {
|
||||
@@ -484,7 +484,7 @@ static int32_t CheckHostSdkIfOpenInterface003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfCloseInterface003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbCloseInterface(g_acm->ctrl_devHandle);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -507,7 +507,7 @@ static int32_t CheckHostSdkIfOpenInterface004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfOpenInterface005(void)
|
||||
{
|
||||
int i;
|
||||
int32_t i;
|
||||
for (i = 0; i < USB_LOOP_NUM; i++) {
|
||||
g_acmDataDevHandle[i] = UsbOpenInterface(g_acm->dataIface);
|
||||
if (g_acmDataDevHandle[i] == NULL) {
|
||||
@@ -521,8 +521,8 @@ static int32_t CheckHostSdkIfOpenInterface005(void)
|
||||
|
||||
static int32_t CheckHostSdkIfCloseInterface005(void)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
int32_t i;
|
||||
int32_t ret;
|
||||
for (i = 0; i < USB_LOOP_NUM; i++) {
|
||||
ret = UsbCloseInterface(g_acmDataDevHandle[i]);
|
||||
if (ret) {
|
||||
@@ -567,8 +567,8 @@ static int32_t CheckHostSdkIfOpenInterface006(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSelectInterfaceSetting001(void)
|
||||
{
|
||||
int ret;
|
||||
int settingIndex = 0;
|
||||
int32_t ret;
|
||||
int32_t settingIndex = 0;
|
||||
ret = UsbSelectInterfaceSetting(g_ecmDataDevHandle, settingIndex, &g_ecmDataIface);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -580,8 +580,8 @@ static int32_t CheckHostSdkIfSelectInterfaceSetting001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSelectInterfaceSetting002(void)
|
||||
{
|
||||
int ret;
|
||||
int settingIndex = 10;
|
||||
int32_t ret;
|
||||
int32_t settingIndex = 10;
|
||||
ret = UsbSelectInterfaceSetting(g_ecmDataDevHandle, settingIndex, &g_ecmDataIface);
|
||||
if (ret != HDF_FAILURE) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -593,8 +593,8 @@ static int32_t CheckHostSdkIfSelectInterfaceSetting002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSelectInterfaceSetting003(void)
|
||||
{
|
||||
int ret;
|
||||
int settingIndex = 100;
|
||||
int32_t ret;
|
||||
int32_t settingIndex = 100;
|
||||
ret = UsbSelectInterfaceSetting(g_ecmDataDevHandle, settingIndex, &g_ecmDataIface);
|
||||
if (ret != HDF_FAILURE) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -606,8 +606,8 @@ static int32_t CheckHostSdkIfSelectInterfaceSetting003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSelectInterfaceSetting004(void)
|
||||
{
|
||||
int ret;
|
||||
int settingIndex = 200;
|
||||
int32_t ret;
|
||||
int32_t settingIndex = 200;
|
||||
ret = UsbSelectInterfaceSetting(g_ecmDataDevHandle, settingIndex, &g_ecmDataIface);
|
||||
if (ret != HDF_FAILURE) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -619,8 +619,8 @@ static int32_t CheckHostSdkIfSelectInterfaceSetting004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSelectInterfaceSetting005(void)
|
||||
{
|
||||
int ret;
|
||||
int settingIndex = USB_MAX_BYTE;
|
||||
int32_t ret;
|
||||
int32_t settingIndex = USB_MAX_BYTE;
|
||||
ret = UsbSelectInterfaceSetting(g_ecmDataDevHandle, settingIndex, &g_ecmDataIface);
|
||||
if (ret != HDF_FAILURE) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -632,8 +632,8 @@ static int32_t CheckHostSdkIfSelectInterfaceSetting005(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSelectInterfaceSetting006(void)
|
||||
{
|
||||
int ret;
|
||||
int settingIndex = 1;
|
||||
int32_t ret;
|
||||
int32_t settingIndex = 1;
|
||||
ret = UsbSelectInterfaceSetting(g_ecmDataDevHandle, settingIndex, &g_ecmDataIface);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -672,19 +672,19 @@ static int32_t CheckHostSdkIfClaimInterface008(void)
|
||||
|
||||
static int32_t CheckHostSdkIfGetPipe001(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbPipeInfo p;
|
||||
int i;
|
||||
uint8_t i;
|
||||
for (i = 0; i <= g_acm->dataIface->info.pipeNum; i++) {
|
||||
ret = UsbGetPipeInfo(NULL, g_acm->dataIface->info.curAltSetting, i, &p);
|
||||
if (ret < 0) {
|
||||
continue;
|
||||
}
|
||||
if ((p.pipeDirection == USB_PIPE_DIRECTION_IN) && (p.pipeType == USB_PIPE_TYPE_BULK)) {
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(*pi));
|
||||
if (pi) {
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(struct UsbPipeInfo));
|
||||
if (pi == NULL) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
return HDF_SUCCESS;
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
p.interfaceId = g_acm->dataIface->info.interfaceIndex;
|
||||
*pi = p;
|
||||
@@ -705,16 +705,16 @@ static int32_t CheckHostSdkIfGetPipe001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfGetPipe002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbPipeInfo p;
|
||||
int i;
|
||||
uint8_t i;
|
||||
for (i = 0; i <= g_acm->dataIface->info.pipeNum; i++) {
|
||||
ret = UsbGetPipeInfo(g_acm->data_devHandle, g_acm->dataIface->info.curAltSetting, i, &p);
|
||||
if (ret < 0) {
|
||||
continue;
|
||||
}
|
||||
if ((p.pipeDirection == USB_PIPE_DIRECTION_IN) && (p.pipeType == USB_PIPE_TYPE_BULK)) {
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(*pi));
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(struct UsbPipeInfo));
|
||||
if (pi == NULL) {
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
@@ -734,19 +734,19 @@ static int32_t CheckHostSdkIfGetPipe002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfGetPipe003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbPipeInfo p;
|
||||
int i;
|
||||
uint8_t i;
|
||||
for (i = 0; i <= g_acm->dataIface->info.pipeNum; i++) {
|
||||
ret = UsbGetPipeInfo(NULL, g_acm->dataIface->info.curAltSetting, i, &p);
|
||||
if (ret < 0) {
|
||||
continue;
|
||||
}
|
||||
if ((p.pipeDirection == USB_PIPE_DIRECTION_OUT) && (p.pipeType == USB_PIPE_TYPE_BULK)) {
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(*pi));
|
||||
if (pi) {
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(struct UsbPipeInfo));
|
||||
if (pi == NULL) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
return HDF_SUCCESS;
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
p.interfaceId = g_acm->dataIface->info.interfaceIndex;
|
||||
*pi = p;
|
||||
@@ -767,16 +767,16 @@ static int32_t CheckHostSdkIfGetPipe003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfGetPipe004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbPipeInfo p;
|
||||
int i;
|
||||
uint8_t i;
|
||||
for (i = 0; i <= g_acm->dataIface->info.pipeNum; i++) {
|
||||
ret = UsbGetPipeInfo(g_acm->data_devHandle, g_acm->dataIface->info.curAltSetting, i, &p);
|
||||
if (ret < 0) {
|
||||
continue;
|
||||
}
|
||||
if ((p.pipeDirection == USB_PIPE_DIRECTION_OUT) && (p.pipeType == USB_PIPE_TYPE_BULK)) {
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(*pi));
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(struct UsbPipeInfo));
|
||||
if (pi == NULL) {
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
@@ -796,16 +796,16 @@ static int32_t CheckHostSdkIfGetPipe004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfGetPipe005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbPipeInfo p;
|
||||
int i;
|
||||
uint8_t i;
|
||||
for (i = 0; i <= g_acm->intIface->info.pipeNum; i++) {
|
||||
ret = UsbGetPipeInfo(NULL, g_acm->intIface->info.curAltSetting, i, &p);
|
||||
if (ret < 0) {
|
||||
continue;
|
||||
}
|
||||
if ((p.pipeDirection == USB_PIPE_DIRECTION_IN) && (p.pipeType == USB_PIPE_TYPE_INTERRUPT)) {
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(*pi));
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(struct UsbPipeInfo));
|
||||
if (pi == NULL) {
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
@@ -828,16 +828,16 @@ static int32_t CheckHostSdkIfGetPipe005(void)
|
||||
|
||||
static int32_t CheckHostSdkIfGetPipe006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbPipeInfo p;
|
||||
int i;
|
||||
uint8_t i;
|
||||
for (i = 0; i <= g_acm->intIface->info.pipeNum; i++) {
|
||||
ret = UsbGetPipeInfo(g_acm->int_devHandle, g_acm->intIface->info.curAltSetting, i, &p);
|
||||
if (ret < 0) {
|
||||
continue;
|
||||
}
|
||||
if ((p.pipeDirection == USB_PIPE_DIRECTION_IN) && (p.pipeType == USB_PIPE_TYPE_INTERRUPT)) {
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(*pi));
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(struct UsbPipeInfo));
|
||||
if (pi == NULL) {
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
@@ -857,9 +857,9 @@ static int32_t CheckHostSdkIfGetPipe006(void)
|
||||
|
||||
static int32_t CheckHostSdkIfGetPipe007(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbPipeInfo p;
|
||||
int i;
|
||||
uint8_t i;
|
||||
g_acm->interfaceIndex = USB_CTRL_INTERFACE_ID;
|
||||
for (i = 0; i <= g_acm->ctrIface->info.pipeNum; i++) {
|
||||
ret = UsbGetPipeInfo(NULL, g_acm->ctrIface->info.curAltSetting, i, &p);
|
||||
@@ -867,7 +867,7 @@ static int32_t CheckHostSdkIfGetPipe007(void)
|
||||
continue;
|
||||
}
|
||||
if ((p.pipeDirection == USB_PIPE_DIRECTION_OUT) && (p.pipeType == USB_PIPE_TYPE_CONTROL)) {
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(*pi));
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(struct UsbPipeInfo));
|
||||
if (pi == NULL) {
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
@@ -890,9 +890,9 @@ static int32_t CheckHostSdkIfGetPipe007(void)
|
||||
|
||||
static int32_t CheckHostSdkIfGetPipe008(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbPipeInfo p;
|
||||
int i;
|
||||
uint8_t i;
|
||||
g_acm->interfaceIndex = USB_CTRL_INTERFACE_ID;
|
||||
for (i = 0; i <= g_acm->ctrIface->info.pipeNum; i++) {
|
||||
ret = UsbGetPipeInfo(g_acm->ctrl_devHandle, g_acm->ctrIface->info.curAltSetting, i, &p);
|
||||
@@ -900,7 +900,7 @@ static int32_t CheckHostSdkIfGetPipe008(void)
|
||||
continue;
|
||||
}
|
||||
if ((p.pipeDirection == USB_PIPE_DIRECTION_OUT) && (p.pipeType == USB_PIPE_TYPE_CONTROL)) {
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(*pi));
|
||||
struct UsbPipeInfo *pi = (struct UsbPipeInfo *)OsalMemCalloc(sizeof(struct UsbPipeInfo));
|
||||
if (pi == NULL) {
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
@@ -920,7 +920,7 @@ static int32_t CheckHostSdkIfGetPipe008(void)
|
||||
|
||||
static int32_t CheckHostSdkIfAllocRequest001(void)
|
||||
{
|
||||
int i;
|
||||
int32_t i;
|
||||
g_acm->readSize = g_acm->dataInPipe->maxPacketSize;
|
||||
printf("------readSize = [%d]------\n", g_acm->readSize);
|
||||
for (i = 0; i < ACM_NR; i++) {
|
||||
@@ -936,7 +936,7 @@ static int32_t CheckHostSdkIfAllocRequest001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfAllocRequest002(void)
|
||||
{
|
||||
int i;
|
||||
int32_t i;
|
||||
g_acm->readSize = g_acm->dataInPipe->maxPacketSize;
|
||||
printf("------readSize = [%d]------\n", g_acm->readSize);
|
||||
for (i = 0; i < ACM_NR; i++) {
|
||||
@@ -952,8 +952,8 @@ static int32_t CheckHostSdkIfAllocRequest002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFreeRequest001(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int32_t ret;
|
||||
int32_t i;
|
||||
for (i = 0; i < ACM_NR; i++) {
|
||||
ret = UsbFreeRequest(g_acm->readReq[i]);
|
||||
if (ret) {
|
||||
@@ -968,8 +968,8 @@ static int32_t CheckHostSdkIfFreeRequest001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfAllocRequest003(void)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
int32_t i;
|
||||
int32_t ret;
|
||||
g_acm->writeSize = g_acm->dataOutPipe->maxPacketSize;
|
||||
ret = AcmWriteBufAlloc(g_acm);
|
||||
if (ret) {
|
||||
@@ -990,8 +990,8 @@ static int32_t CheckHostSdkIfAllocRequest003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfAllocRequest004(void)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
int32_t i;
|
||||
int32_t ret;
|
||||
g_acm->writeSize = g_acm->dataOutPipe->maxPacketSize;
|
||||
ret = AcmWriteBufAlloc(g_acm);
|
||||
if (ret) {
|
||||
@@ -1013,8 +1013,8 @@ static int32_t CheckHostSdkIfAllocRequest004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFreeRequest002(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int32_t ret;
|
||||
int32_t i;
|
||||
for (i = 0; i < ACM_NR; i++) {
|
||||
ret = UsbFreeRequest(g_acm->wb[i].request);
|
||||
if (ret) {
|
||||
@@ -1054,7 +1054,7 @@ static int32_t CheckHostSdkIfAllocRequest006(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFreeRequest003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbFreeRequest(g_acm->notifyReq);
|
||||
if (ret) {
|
||||
@@ -1115,7 +1115,7 @@ static int32_t CheckHostSdkIfAllocRequest011(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFreeRequest006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
if (g_acm->isoReq == NULL) {
|
||||
HDF_LOGE("%s: isoReq is NULL", __func__);
|
||||
@@ -1133,9 +1133,9 @@ static int32_t CheckHostSdkIfFreeRequest006(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillIsoRequest001(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams parmas = {0};
|
||||
int i;
|
||||
int32_t i;
|
||||
char sendData[] = {"abcde\0"};
|
||||
uint32_t size = strlen(sendData) + 1;
|
||||
if (g_acm->isoPipe == NULL) {
|
||||
@@ -1151,7 +1151,7 @@ static int32_t CheckHostSdkIfFillIsoRequest001(void)
|
||||
parmas.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
parmas.dataReq.numIsoPackets = USB_ISO_PACKAT_CNT;
|
||||
parmas.dataReq.directon = USB_REQUEST_DIR_TO_DEVICE;
|
||||
parmas.dataReq.length = size;
|
||||
parmas.dataReq.length = (int)size;
|
||||
parmas.dataReq.buffer = (unsigned char *)sendData;
|
||||
ret = UsbFillRequest(g_acm->isoReq, g_acm->iso_devHandle, &parmas);
|
||||
if (ret) {
|
||||
@@ -1165,9 +1165,9 @@ static int32_t CheckHostSdkIfFillIsoRequest001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillIsoRequest002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams parmas;
|
||||
int i;
|
||||
int32_t i;
|
||||
char sendData[] = {"abcde\0"};
|
||||
uint32_t size = strlen(sendData) + 1;
|
||||
if (g_acm->isoPipe == NULL) {
|
||||
@@ -1182,7 +1182,7 @@ static int32_t CheckHostSdkIfFillIsoRequest002(void)
|
||||
parmas.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
parmas.dataReq.numIsoPackets = USB_ISO_PACKAT_CNT;
|
||||
parmas.dataReq.directon = USB_REQUEST_DIR_TO_DEVICE;
|
||||
parmas.dataReq.length = size;
|
||||
parmas.dataReq.length = (int)size;
|
||||
parmas.dataReq.buffer = (unsigned char *)sendData;
|
||||
ret = UsbFillRequest(NULL, g_acm->iso_devHandle, &parmas);
|
||||
if (ret) {
|
||||
@@ -1196,9 +1196,9 @@ static int32_t CheckHostSdkIfFillIsoRequest002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillIsoRequest003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams parmas;
|
||||
int i;
|
||||
int32_t i;
|
||||
char sendData[] = {"abcde\0"};
|
||||
uint32_t size = strlen(sendData) + 1;
|
||||
if (g_acm->isoPipe == NULL) {
|
||||
@@ -1213,7 +1213,7 @@ static int32_t CheckHostSdkIfFillIsoRequest003(void)
|
||||
parmas.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
parmas.dataReq.numIsoPackets = USB_ISO_PACKAT_CNT;
|
||||
parmas.dataReq.directon = USB_REQUEST_DIR_TO_DEVICE;
|
||||
parmas.dataReq.length = size;
|
||||
parmas.dataReq.length = (int)size;
|
||||
parmas.dataReq.buffer = (unsigned char *)sendData;
|
||||
ret = UsbFillRequest(g_acm->isoReq, NULL, &parmas);
|
||||
if (ret) {
|
||||
@@ -1227,9 +1227,9 @@ static int32_t CheckHostSdkIfFillIsoRequest003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillIsoRequest004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams parmas;
|
||||
int i;
|
||||
int32_t i;
|
||||
char sendData[] = {"abcde\0"};
|
||||
uint32_t size = strlen(sendData) + 1;
|
||||
if (g_acm->isoPipe == NULL) {
|
||||
@@ -1244,7 +1244,7 @@ static int32_t CheckHostSdkIfFillIsoRequest004(void)
|
||||
parmas.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
parmas.dataReq.numIsoPackets = USB_ISO_PACKAT_CNT;
|
||||
parmas.dataReq.directon = USB_REQUEST_DIR_TO_DEVICE;
|
||||
parmas.dataReq.length = size;
|
||||
parmas.dataReq.length = (int)size;
|
||||
parmas.dataReq.buffer = (unsigned char *)sendData;
|
||||
ret = UsbFillRequest(g_acm->isoReq, g_acm->iso_devHandle, NULL);
|
||||
if (ret) {
|
||||
@@ -1258,9 +1258,9 @@ static int32_t CheckHostSdkIfFillIsoRequest004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillIsoRequest005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams parmas;
|
||||
int i;
|
||||
int32_t i;
|
||||
char sendData[] = {"abcde\0"};
|
||||
uint32_t size = strlen(sendData) + 1;
|
||||
if (g_acm->isoPipe == NULL) {
|
||||
@@ -1275,7 +1275,7 @@ static int32_t CheckHostSdkIfFillIsoRequest005(void)
|
||||
parmas.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
parmas.dataReq.numIsoPackets = USB_ISO_PACKAT_CNT;
|
||||
parmas.dataReq.directon = USB_REQUEST_DIR_TO_DEVICE;
|
||||
parmas.dataReq.length = size;
|
||||
parmas.dataReq.length = (int)size;
|
||||
parmas.dataReq.buffer = (unsigned char *)sendData;
|
||||
ret = UsbFillRequest(NULL, NULL, &parmas);
|
||||
if (ret) {
|
||||
@@ -1289,9 +1289,9 @@ static int32_t CheckHostSdkIfFillIsoRequest005(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillIsoRequest006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams parmas;
|
||||
int i;
|
||||
int32_t i;
|
||||
char sendData[] = {"abcde\0"};
|
||||
uint32_t size = strlen(sendData) + 1;
|
||||
if (g_acm->isoPipe == NULL) {
|
||||
@@ -1306,7 +1306,7 @@ static int32_t CheckHostSdkIfFillIsoRequest006(void)
|
||||
parmas.timeout = USB_RAW_REQUEST_TIME_ZERO_MS;
|
||||
parmas.dataReq.numIsoPackets = USB_ISO_PACKAT_CNT;
|
||||
parmas.dataReq.directon = USB_REQUEST_DIR_TO_DEVICE;
|
||||
parmas.dataReq.length = size;
|
||||
parmas.dataReq.length = (int)size;
|
||||
parmas.dataReq.buffer = (unsigned char *)sendData;
|
||||
ret = UsbFillRequest(g_acm->isoReq, NULL, NULL);
|
||||
if (ret) {
|
||||
@@ -1320,7 +1320,7 @@ static int32_t CheckHostSdkIfFillIsoRequest006(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFreeRequest004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbFreeRequest(g_acm->ctrlReq);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1333,8 +1333,8 @@ static int32_t CheckHostSdkIfFreeRequest004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfAllocRequest009(void)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
int32_t i;
|
||||
int32_t ret;
|
||||
g_acm->readSize = g_acm->dataInPipe->maxPacketSize;
|
||||
for (i = 0; i < ACM_NR; i++) {
|
||||
g_acm->readReq[i] = UsbAllocRequest(g_acm->data_devHandle, 0, g_acm->readSize);
|
||||
@@ -1350,7 +1350,7 @@ static int32_t CheckHostSdkIfAllocRequest009(void)
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
for (int i = 0; i < ACM_NW; i++) {
|
||||
for (int32_t i = 0; i < ACM_NW; i++) {
|
||||
g_acm->wb[i].request = UsbAllocRequest(g_acm->data_devHandle, 0, g_acm->writeSize);
|
||||
g_acm->wb[i].instance = g_acm;
|
||||
if (g_acm->wb[i].request == NULL) {
|
||||
@@ -1376,9 +1376,9 @@ static int32_t CheckHostSdkIfAllocRequest009(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillRequest001(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams readParmas;
|
||||
int i;
|
||||
int32_t i;
|
||||
for (i = 0; i < 1; i++) {
|
||||
readParmas.userData = (void *)g_acm;
|
||||
readParmas.pipeAddress = g_acm->dataInPipe->pipeAddress;
|
||||
@@ -1390,7 +1390,7 @@ static int32_t CheckHostSdkIfFillRequest001(void)
|
||||
readParmas.dataReq.numIsoPackets = 0;
|
||||
readParmas.dataReq.directon =
|
||||
(UsbRequestDirection)(((uint32_t)g_acm->dataInPipe->pipeDirection >> USB_DIR_OFFSET) & DIRECTION_MASK);
|
||||
readParmas.dataReq.length = g_acm->readSize;
|
||||
readParmas.dataReq.length = (int)g_acm->readSize;
|
||||
ret = UsbFillRequest(g_acm->readReq[i], g_acm->data_devHandle, &readParmas);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1403,16 +1403,16 @@ static int32_t CheckHostSdkIfFillRequest001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillRequest002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams parmas;
|
||||
int i;
|
||||
int32_t i;
|
||||
char sendData[] = {"abcde\0"};
|
||||
uint32_t size = strlen(sendData) + 1;
|
||||
g_acm->writeSize = g_acm->dataOutPipe->maxPacketSize;
|
||||
size = (size > g_acm->writeSize) ? g_acm->writeSize : size;
|
||||
|
||||
for (i = 0; i < 1; i++) {
|
||||
g_acm->wb[i].len = size;
|
||||
g_acm->wb[i].len = (int)size;
|
||||
ret = memcpy_s(g_acm->wb[i].buf, g_acm->writeSize, sendData, size);
|
||||
if (ret) {
|
||||
printf("memcpy_s fial");
|
||||
@@ -1440,7 +1440,7 @@ static int32_t CheckHostSdkIfFillRequest002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillRequest003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams intParmas;
|
||||
intParmas.userData = (void *)g_acm;
|
||||
intParmas.pipeAddress = g_acm->intPipe->pipeAddress;
|
||||
@@ -1452,7 +1452,7 @@ static int32_t CheckHostSdkIfFillRequest003(void)
|
||||
intParmas.dataReq.numIsoPackets = 0;
|
||||
intParmas.dataReq.directon = (UsbRequestDirection)(((uint32_t)g_acm->intPipe->pipeDirection >> USB_PIPE_DIR_OFFSET)
|
||||
& DIRECTION_MASK);
|
||||
intParmas.dataReq.length = g_acm->intSize;
|
||||
intParmas.dataReq.length = (int)g_acm->intSize;
|
||||
intParmas.dataReq.buffer = NULL;
|
||||
ret = UsbFillRequest(g_acm->notifyReq, g_acm->int_devHandle, &intParmas);
|
||||
if (ret) {
|
||||
@@ -1465,7 +1465,7 @@ static int32_t CheckHostSdkIfFillRequest003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillRequest004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams parmas;
|
||||
uint16_t index = 2;
|
||||
uint16_t value = 0;
|
||||
@@ -1499,8 +1499,8 @@ static int32_t CheckHostSdkIfFillRequest004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSubmitRequestSync001(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int32_t ret;
|
||||
int32_t i;
|
||||
for (i = 0; i < 1; i++) {
|
||||
printf("------UsbSubmitRequestSync i = [%d]------\n", i);
|
||||
ret = UsbSubmitRequestSync(g_acm->readReq[i]);
|
||||
@@ -1515,8 +1515,8 @@ static int32_t CheckHostSdkIfSubmitRequestSync001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSubmitRequestSync002(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int32_t ret;
|
||||
int32_t i;
|
||||
for (i = 0; i < 1; i++) {
|
||||
printf("------UsbSubmitRequestSync i = [%d]------\n", i);
|
||||
ret = UsbSubmitRequestSync(g_acm->wb[i].request);
|
||||
@@ -1531,7 +1531,7 @@ static int32_t CheckHostSdkIfSubmitRequestSync002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSubmitRequestSync003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
ret = UsbSubmitRequestSync(g_acm->ctrlReq);
|
||||
if (ret) {
|
||||
@@ -1544,7 +1544,7 @@ static int32_t CheckHostSdkIfSubmitRequestSync003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSubmitRequestSync004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbSubmitRequestSync(g_acm->notifyReq);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1556,9 +1556,9 @@ static int32_t CheckHostSdkIfSubmitRequestSync004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillRequest005(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams readParmas;
|
||||
int i;
|
||||
int32_t i;
|
||||
for (i = 0; i < ACM_NR; i++) {
|
||||
readParmas.userData = (void *)g_acm;
|
||||
readParmas.pipeAddress = g_acm->dataInPipe->pipeAddress;
|
||||
@@ -1570,7 +1570,7 @@ static int32_t CheckHostSdkIfFillRequest005(void)
|
||||
readParmas.dataReq.numIsoPackets = 0;
|
||||
readParmas.dataReq.directon =
|
||||
(UsbRequestDirection)(((uint32_t)g_acm->dataInPipe->pipeDirection >> USB_DIR_OFFSET) & DIRECTION_MASK);
|
||||
readParmas.dataReq.length = g_acm->readSize;
|
||||
readParmas.dataReq.length = (int)g_acm->readSize;
|
||||
ret = UsbFillRequest(g_acm->readReq[i], g_acm->data_devHandle, &readParmas);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1583,15 +1583,15 @@ static int32_t CheckHostSdkIfFillRequest005(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillRequest006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams parmas;
|
||||
int i;
|
||||
int32_t i;
|
||||
char sendData[] = {"abcde\0"};
|
||||
uint32_t size = strlen(sendData) + 1;
|
||||
g_acm->writeSize = g_acm->dataOutPipe->maxPacketSize;
|
||||
size = (size > g_acm->writeSize) ? g_acm->writeSize : size;
|
||||
for (i = 0; i < ACM_NR; i++) {
|
||||
g_acm->wb[i].len = size;
|
||||
g_acm->wb[i].len = (int)size;
|
||||
ret = memcpy_s(g_acm->wb[i].buf, g_acm->writeSize, sendData, size);
|
||||
if (ret) {
|
||||
printf("memcpy_s fial");
|
||||
@@ -1618,7 +1618,7 @@ static int32_t CheckHostSdkIfFillRequest006(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillRequest007(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams intParmas;
|
||||
intParmas.userData = (void *)g_acm;
|
||||
intParmas.pipeAddress = g_acm->intPipe->pipeAddress;
|
||||
@@ -1631,7 +1631,7 @@ static int32_t CheckHostSdkIfFillRequest007(void)
|
||||
intParmas.dataReq.numIsoPackets = 0;
|
||||
intParmas.dataReq.directon = (UsbRequestDirection)(((uint32_t)g_acm->intPipe->pipeDirection >> USB_PIPE_DIR_OFFSET)
|
||||
& DIRECTION_MASK);
|
||||
intParmas.dataReq.length = g_acm->intSize;
|
||||
intParmas.dataReq.length = (int)g_acm->intSize;
|
||||
ret = UsbFillRequest(g_acm->notifyReq, g_acm->int_devHandle, &intParmas);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1643,7 +1643,7 @@ static int32_t CheckHostSdkIfFillRequest007(void)
|
||||
|
||||
static int32_t CheckHostSdkIfFillRequest008(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
struct UsbRequestParams parmas;
|
||||
uint16_t index = 2;
|
||||
uint16_t value = 0;
|
||||
@@ -1678,8 +1678,8 @@ static int32_t CheckHostSdkIfFillRequest008(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSubmitRequestAsync001(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int32_t ret;
|
||||
int32_t i;
|
||||
for (i = 0; i < 1; i++) {
|
||||
ret = UsbSubmitRequestAsync(g_acm->readReq[i]);
|
||||
if (ret) {
|
||||
@@ -1693,8 +1693,8 @@ static int32_t CheckHostSdkIfSubmitRequestAsync001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfCancelRequest001(void)
|
||||
{
|
||||
int ret;
|
||||
int i = 0;
|
||||
int32_t ret;
|
||||
int32_t i = 0;
|
||||
ret = UsbCancelRequest(g_acm->readReq[i]);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1706,8 +1706,8 @@ static int32_t CheckHostSdkIfCancelRequest001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSubmitRequestAsync002(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int32_t ret;
|
||||
int32_t i;
|
||||
for (i = 0; i < 1; i++) {
|
||||
ret = UsbSubmitRequestAsync(g_acm->wb[i].request);
|
||||
if (ret) {
|
||||
@@ -1721,8 +1721,8 @@ static int32_t CheckHostSdkIfSubmitRequestAsync002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfCancelRequest002(void)
|
||||
{
|
||||
int ret;
|
||||
int i = 0;
|
||||
int32_t ret;
|
||||
int32_t i = 0;
|
||||
ret = UsbCancelRequest(g_acm->wb[i].request);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1734,7 +1734,7 @@ static int32_t CheckHostSdkIfCancelRequest002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSubmitRequestAsync003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbSubmitRequestAsync(g_acm->notifyReq);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1746,7 +1746,7 @@ static int32_t CheckHostSdkIfSubmitRequestAsync003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfCancelRequest003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbCancelRequest(g_acm->notifyReq);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1758,7 +1758,7 @@ static int32_t CheckHostSdkIfCancelRequest003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfSubmitRequestAsync004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbSubmitRequestAsync(g_acm->ctrlReq);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1770,7 +1770,7 @@ static int32_t CheckHostSdkIfSubmitRequestAsync004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfCancelRequest004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbCancelRequest(g_acm->ctrlReq);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1782,7 +1782,7 @@ static int32_t CheckHostSdkIfCancelRequest004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfClearInterfaceHalt002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbClearInterfaceHalt(g_acm->data_devHandle, g_acm->dataOutPipe->pipeAddress);
|
||||
if (ret < 0) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1794,7 +1794,7 @@ static int32_t CheckHostSdkIfClearInterfaceHalt002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfClearInterfaceHalt003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbClearInterfaceHalt(g_acm->int_devHandle, g_acm->intPipe->pipeAddress);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1806,7 +1806,7 @@ static int32_t CheckHostSdkIfClearInterfaceHalt003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfClearInterfaceHalt004(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbClearInterfaceHalt(g_acm->ctrl_devHandle, g_acm->ctrPipe->pipeAddress);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
@@ -1818,7 +1818,7 @@ static int32_t CheckHostSdkIfClearInterfaceHalt004(void)
|
||||
|
||||
static int32_t CheckHostSdkIfRemoveInterface001(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbInterfaceStatus status = USB_INTERFACE_STATUS_REMOVE;
|
||||
ret = UsbAddOrRemoveInterface(g_acm->session, g_acm->busNum, g_acm->devAddr,
|
||||
g_acm->dataIface->info.interfaceIndex, status);
|
||||
@@ -1832,7 +1832,7 @@ static int32_t CheckHostSdkIfRemoveInterface001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfAddInterface001(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbInterfaceStatus status = USB_INTERFACE_STATUS_ADD;
|
||||
OsalSleep(1);
|
||||
ret = UsbAddOrRemoveInterface(g_acm->session, g_acm->busNum, g_acm->devAddr,
|
||||
@@ -1847,7 +1847,7 @@ static int32_t CheckHostSdkIfAddInterface001(void)
|
||||
|
||||
static int32_t CheckHostSdkIfRemoveInterface002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbInterfaceStatus status = USB_INTERFACE_STATUS_REMOVE;
|
||||
OsalSleep(1);
|
||||
ret = UsbAddOrRemoveInterface(g_acm->session, g_acm->busNum, g_acm->devAddr,
|
||||
@@ -1862,7 +1862,7 @@ static int32_t CheckHostSdkIfRemoveInterface002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfAddInterface002(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbInterfaceStatus status = USB_INTERFACE_STATUS_ADD;
|
||||
|
||||
OsalSleep(1);
|
||||
@@ -1879,7 +1879,7 @@ static int32_t CheckHostSdkIfAddInterface002(void)
|
||||
|
||||
static int32_t CheckHostSdkIfRemoveInterface003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbInterfaceStatus status = USB_INTERFACE_STATUS_REMOVE;
|
||||
|
||||
ret = UsbAddOrRemoveInterface(g_acm->session, g_acm->busNum, g_acm->devAddr,
|
||||
@@ -1894,7 +1894,7 @@ static int32_t CheckHostSdkIfRemoveInterface003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfAddInterface003(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
UsbInterfaceStatus status = USB_INTERFACE_STATUS_ADD;
|
||||
|
||||
ret = UsbAddOrRemoveInterface(g_acm->session, g_acm->busNum, g_acm->devAddr,
|
||||
@@ -1909,7 +1909,7 @@ static int32_t CheckHostSdkIfAddInterface003(void)
|
||||
|
||||
static int32_t CheckHostSdkIfCloseInterface006(void)
|
||||
{
|
||||
int ret;
|
||||
int32_t ret;
|
||||
ret = UsbCloseInterface(g_ecmIntDevHandle);
|
||||
if (ret) {
|
||||
HDF_LOGE("%s: error", __func__);
|
||||
|
||||
Reference in New Issue
Block a user