From 62f7ab54a8973d9de7a76e79fed81347908505c4 Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Tue, 18 May 2010 08:48:48 -0600 Subject: [PATCH] Remove set functionality for Manufacturer descriptor. Current cp210x firmware doesn't allow it to be set anyway. --- src/cp210x.c | 22 ---------------------- src/cp210x.c.karmic | 22 ---------------------- src/cp210x.h | 8 +++----- 3 files changed, 3 insertions(+), 49 deletions(-) diff --git a/src/cp210x.c b/src/cp210x.c index 4b1a29d..c670ea5 100644 --- a/src/cp210x.c +++ b/src/cp210x.c @@ -274,17 +274,6 @@ static size_t cp210x_usbstr_from_user(char *kbuf, unsigned long ubuf, return make_usb_string(kbuf, klen, str, slen); } -/* cp210x_has_setmfg - * Returns 1 if the CP210X part includes firmware that allows setting the - * USB MFG descriptor, else 0. As of this writing, no CP210X firmware allows - * this. SiLabs has suggested this may change in future firmware versions or - * parts. - */ -static inline int cp210x_has_setmfg(void) -{ - return 0; -} - /* * cp210x_ctlmsg * A generic usb control message interface. @@ -770,17 +759,6 @@ static int cp210x_ioctl(struct usb_serial_port *port, struct file *file, } break; - case CP210x_IOCTL_SETMFG: - if (cp210x_has_setmfg()) { - char usbstr[USBSTRLEN(CP210x_MAX_MFG_STRLEN)]; - size_t len = cp210x_usbstr_from_user(usbstr, arg, - sizeof(usbstr)); - if (len && cp210x_setstr(port, 0x00, usbstr) == len) - return 0; - } - return -EFAULT; - break; - case CP210x_IOCTL_SETPRODUCT: { char usbstr[USBSTRLEN(CP210x_MAX_PRODUCT_STRLEN)]; diff --git a/src/cp210x.c.karmic b/src/cp210x.c.karmic index d418849..4f74b1b 100644 --- a/src/cp210x.c.karmic +++ b/src/cp210x.c.karmic @@ -295,17 +295,6 @@ static size_t cp210x_usbstr_from_user(char *kbuf, unsigned long ubuf, return make_usb_string(kbuf, klen, str, slen); } -/* cp210x_has_setmfg - * Returns 1 if the CP210X part includes firmware that allows setting the - * USB MFG descriptor, else 0. As of this writing, no CP210X firmware allows - * this. SiLabs has suggested this may change in future firmware versions or - * parts. - */ -static inline int cp210x_has_setmfg(void) -{ - return 0; -} - /* * cp210x_ctlmsg * A generic usb control message interface. @@ -837,17 +826,6 @@ static int cp210x_ioctl(struct tty_struct *tty, struct file *file, } break; - case CP210x_IOCTL_SETMFG: - if (cp210x_has_setmfg()) { - char usbstr[USBSTRLEN(CP210x_MAX_MFG_STRLEN)]; - size_t len = cp210x_usbstr_from_user(usbstr, arg, - sizeof(usbstr)); - if (len && cp210x_setstr(port, 0x00, usbstr) == len) - return 0; - } - return -EFAULT; - break; - case CP210x_IOCTL_SETPRODUCT: { char usbstr[USBSTRLEN(CP210x_MAX_PRODUCT_STRLEN)]; diff --git a/src/cp210x.h b/src/cp210x.h index 14a13f4..315e203 100644 --- a/src/cp210x.h +++ b/src/cp210x.h @@ -33,10 +33,9 @@ #define CP210x_IOCTL_PORTCONFSET (SIOCDEVPRIVATE + 6) #define CP210x_IOCTL_SETVID (SIOCDEVPRIVATE + 7) #define CP210x_IOCTL_SETPID (SIOCDEVPRIVATE + 8) -#define CP210x_IOCTL_SETMFG (SIOCDEVPRIVATE + 9) -#define CP210x_IOCTL_SETPRODUCT (SIOCDEVPRIVATE + 10) -#define CP210x_IOCTL_SETSERIAL (SIOCDEVPRIVATE + 11) -#define CP210x_IOCTL_SETDEVVER (SIOCDEVPRIVATE + 12) +#define CP210x_IOCTL_SETPRODUCT (SIOCDEVPRIVATE + 9) +#define CP210x_IOCTL_SETSERIAL (SIOCDEVPRIVATE + 10) +#define CP210x_IOCTL_SETDEVVER (SIOCDEVPRIVATE + 11) /* CP2103 GPIO bit positions */ #define GPIO_0 0x01 @@ -46,7 +45,6 @@ #define GPIO_MASK (GPIO_3|GPIO_2|GPIO_1|GPIO_0) /* USB descriptor sizes */ -#define CP210x_MAX_MFG_STRLEN 255 #define CP210x_MAX_PRODUCT_STRLEN 126 #define CP210x_MAX_SERIAL_STRLEN 63 -- 2.39.2