diff --git a/model/usb/device/Kconfig b/model/usb/device/Kconfig old mode 100644 new mode 100755 index 54d4cc7962744db897c85acd2382a7872169167f..eb473b36f628c1ad0943f5d61175f5bc90900861 --- a/model/usb/device/Kconfig +++ b/model/usb/device/Kconfig @@ -1,6 +1,6 @@ config DRIVERS_HDF_USB_F_GENERIC bool "Enable F_GENERIC driver" - default y + default n depends on DRIVERS_HDF help Answer Y to choice HDF USB F_GENERIC driver. diff --git a/model/usb/device/f_generic.c b/model/usb/device/f_generic.c index 0ec6465f243896e9bc93070e89e8a7f5676828e8..a4288d3dce94f1f543abe5c0867719dfc8a075cb 100755 --- a/model/usb/device/f_generic.c +++ b/model/usb/device/f_generic.c @@ -1449,6 +1449,7 @@ static const struct file_operations ffs_epfile_operations = { static void ffs_data_clear(struct ffs_data *ffs); static void ffs_data_reset(struct ffs_data *ffs); static dev_t g_dev; +#define MAX_EP_DEV 10 static long usbfn_ioctl(struct file *file, unsigned int cmd, unsigned long value) { long ret; @@ -1485,7 +1486,7 @@ static long usbfn_ioctl(struct file *file, unsigned int cmd, unsigned long value } ffs->private_data = ffs_dev; - ret = alloc_chrdev_region(&g_dev, 0, 10, nameEp0); + ret = alloc_chrdev_region(&g_dev, 0, MAX_EP_DEV, nameEp0); if (ret < 0) { return -EBUSY; @@ -1525,7 +1526,7 @@ static long usbfn_ioctl(struct file *file, unsigned int cmd, unsigned long value ffs = ffs_dev->ffs_data; device_destroy(ffs_class, ffs->devno); cdev_del(&ffs->cdev); - unregister_chrdev_region(g_dev, 10); + unregister_chrdev_region(g_dev, MAX_EP_DEV); ffs_release_dev(ffs); ffs_data_clear(ffs); destroy_workqueue(ffs->io_completion_wq); @@ -2820,10 +2821,8 @@ static int __ffs_func_bind_do_os_desc(enum ffs_os_desc_type type, t = &func->function.os_desc_table[desc->bFirstInterfaceNumber]; t->if_id = func->interfaces_nums[desc->bFirstInterfaceNumber]; - memcpy_s(t->os_desc->ext_compat_id, ARRAY_SIZE(desc->CompatibleID) + - ARRAY_SIZE(desc->SubCompatibleID), &desc->CompatibleID, - ARRAY_SIZE(desc->CompatibleID) + - ARRAY_SIZE(desc->SubCompatibleID)); + memcpy_s(t->os_desc->ext_compat_id, ARRAY_SIZE(desc->CompatibleID) + ARRAY_SIZE(desc->SubCompatibleID), + &desc->CompatibleID, ARRAY_SIZE(desc->CompatibleID) + ARRAY_SIZE(desc->SubCompatibleID)); length = sizeof(*desc); } break; @@ -2853,9 +2852,8 @@ static int __ffs_func_bind_do_os_desc(enum ffs_os_desc_type type, ext_prop_data = func->ffs->ms_os_descs_ext_prop_data_avail; func->ffs->ms_os_descs_ext_prop_data_avail += ext_prop->data_len; - memcpy_s(ext_prop_data, ext_prop->data_len, - usb_ext_prop_data_ptr(data, ext_prop->name_len), - ext_prop->data_len); + memcpy_s(ext_prop_data, ext_prop->data_len, usb_ext_prop_data_ptr(data, ext_prop->name_len), + ext_prop->data_len); /* unicode data reported to the host as "WCHAR"s */ switch (ext_prop->type) { case USB_EXT_PROP_UNICODE: @@ -2990,8 +2988,7 @@ static int _ffs_func_bind(struct usb_configuration *c, struct usb_function *f) vla_ptr(vlabuf, d, ext_prop_data); /* Copy descriptors */ - memcpy_s(vla_ptr(vlabuf, d, raw_descs), ffs->raw_descs_length, ffs->raw_descs, - ffs->raw_descs_length); + memcpy_s(vla_ptr(vlabuf, d, raw_descs), ffs->raw_descs_length, ffs->raw_descs, ffs->raw_descs_length); memset_s(vla_ptr(vlabuf, d, inums), d_inums__sz, 0xff, d_inums__sz); eps_ptr = vla_ptr(vlabuf, d, eps); @@ -3438,7 +3435,7 @@ static void ffs_free_inst(struct usb_function_instance *f) static int ffs_set_inst_name(struct usb_function_instance *fi, const char *name) { char name_dev[MAX_NAMELEN] = {0}; - if (snprintf_s(name_dev, MAX_NAMELEN, MAX_NAMELEN - 1,"%s.%s", FUNCTION_GENERIC, name) < 0) { + if (snprintf_s(name_dev, MAX_NAMELEN, MAX_NAMELEN - 1, "%s.%s", FUNCTION_GENERIC, name) < 0) { return -EFAULT; } if (strlen(name_dev) >= sizeof_field(struct ffs_dev, name)) diff --git a/model/usb/host/Kconfig b/model/usb/host/Kconfig old mode 100644 new mode 100755 index 97f59cb6a050e44e2717c4ec952249658fe19b75..710f80dba66d0389e3365586b5bba6e96b9791ab --- a/model/usb/host/Kconfig +++ b/model/usb/host/Kconfig @@ -11,7 +11,7 @@ config DRIVERS_HDF_USB_PNP_NOTIFY bool "Enable HDF USB PNP Notify driver" - default y + default n depends on DRIVERS_HDF help Answer Y to choice HDF USB PNP Notify driver.