Lines Matching refs:deviceName
120 static bool IsDeviceDirExist(const char *deviceName)
123 int32_t ret = snprintf_s(tmp, MAX_PATHLEN, MAX_PATHLEN - 1, "%s/%s", CONFIGFS_DIR, deviceName);
154 static int32_t UsbFnWriteProp(const char *deviceName, const char *propName, uint32_t propValue)
159 if (deviceName == NULL || propName == NULL) {
163 ret = snprintf_s(tmp, MAX_PATHLEN, MAX_PATHLEN - 1, "%s/%s/%s", CONFIGFS_DIR, deviceName, propName);
178 static int32_t UsbFnWriteConfString(const char *deviceName, int32_t configVal, uint16_t lang, const char *stringValue)
183 ret = snprintf_s(tmp, MAX_PATHLEN, MAX_PATHLEN - 1, "%s/%s/configs/b.%d/strings/0x%x", CONFIGFS_DIR, deviceName,
209 const char *deviceName, uint16_t lang, const char *stringName, const char *stringValue)
214 ret = snprintf_s(tmp, MAX_PATHLEN, MAX_PATHLEN - 1, "%s/%s/strings/0x%x", CONFIGFS_DIR, deviceName, lang);
272 static int32_t UsbFnAdapterWriteUDC(const char *deviceName, const char *udcName, int32_t enable)
275 if (deviceName == NULL || udcName == NULL || IsDeviceDirExist(deviceName) == false) {
279 int32_t ret = snprintf_s(tmp, MAX_PATHLEN, MAX_PATHLEN - 1, "%s/%s/UDC", CONFIGFS_DIR, deviceName);
837 static void DelConfigDevice(const char *deviceName)
842 ret = snprintf_s(tmp, MAX_PATHLEN, MAX_PATHLEN - 1, "%s/%s/configs", CONFIGFS_DIR, deviceName);
849 ret = snprintf_s(tmp, MAX_PATHLEN, MAX_PATHLEN - 1, "%s/%s/functions", CONFIGFS_DIR, deviceName);
856 ret = snprintf_s(tmp, MAX_PATHLEN, MAX_PATHLEN - 1, "%s/%s/strings", CONFIGFS_DIR, deviceName);
863 ret = snprintf_s(tmp, MAX_PATHLEN, MAX_PATHLEN - 1, "%s/%s", CONFIGFS_DIR, deviceName);
927 static int32_t UsbFnAdapterDelDevice(const char *deviceName, const char *udcName, struct UsbFnDeviceDesc *des)
931 if (deviceName == NULL) {
934 ret = UsbFnAdapterWriteUDC(deviceName, udcName, 0);
944 CleanConfigFs(deviceName, des->configs[i]->functions[j]->funcName);
947 CleanFunction(deviceName, des->configs[i]->functions[j]->funcName);
951 if (strcmp("g1", deviceName) != 0) {
952 DelConfigDevice(deviceName);