lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 06 Feb 2011 21:04:19 +0100
From:	Maciej Szmigiero <mhej@...pl>
To:	Sergei Shtylyov <sshtylyov@...sta.com>
CC:	Greg KH <gregkh@...e.de>, Johan Hovold <jhovold@...il.com>,
	Joe Perches <joe@...ches.com>, Alan Cox <alan@...ux.intel.com>,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [USB]Add Samsung SGH-I500/Android modem ID switch to visor driver

W dniu 06.02.2011 00:29, Sergei Shtylyov pisze:
> Hello.
> 
> On 06.02.2011 0:41, Maciej Szmigiero wrote:
> 
>> New version of patch which autodetects devices with ACM class.
>> Tested on Galaxy Spica.
> 
>> Signed-off-by: Maciej Szmigiero <mhej@...pl>
> 
>> diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
>> index 15a5d89..e1c4527 100644
>> --- a/drivers/usb/serial/visor.c
>> +++ b/drivers/usb/serial/visor.c
> [...]
>> @@ -479,6 +480,15 @@ static int visor_probe(struct usb_serial *serial,
>>
>>       dbg("%s", __func__);
>>
>> +    /* some Samsung Android phones in modem mode have the same ID */
>> +    /* as SPH-I500, but they are ACM devices, so dont bind to them */
> 
>    The preferred style for the multi-line comments is this:
> 
> /*
>  * bla
>  * bla
>  */
> 
>> +    if ((id->idVendor == SAMSUNG_VENDOR_ID)&&
>> +        (id->idProduct == SAMSUNG_SPH_I500_ID)&&
>> +        (serial->dev->descriptor.bDeviceClass == USB_CLASS_COMM)&&
>> +        (serial->dev->descriptor.bDeviceSubClass ==
>> +            USB_CDC_SUBCLASS_ACM))
> 
>    Parens around == not necessary...
> 
> WBR, Sergei

Thanks for comments, new version of this patch with style fixes follows.

Best regards,
Maciej Szmigiero

Signed-off-by: Maciej Szmigiero <mhej@...pl>

diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 15a5d89..0f75948 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -27,6 +27,7 @@
 #include <linux/uaccess.h>
 #include <linux/usb.h>
 #include <linux/usb/serial.h>
+#include <linux/usb/cdc.h>
 #include "visor.h"
 
 /*
@@ -479,6 +480,17 @@ static int visor_probe(struct usb_serial *serial,
 
 	dbg("%s", __func__);
 
+	/*
+	 * some Samsung Android phones in modem mode have the same ID
+	 * as SPH-I500, but they are ACM devices, so dont bind to them
+	*/
+	if (id->idVendor == SAMSUNG_VENDOR_ID &&
+		id->idProduct == SAMSUNG_SPH_I500_ID &&
+		serial->dev->descriptor.bDeviceClass == USB_CLASS_COMM &&
+		serial->dev->descriptor.bDeviceSubClass ==
+			USB_CDC_SUBCLASS_ACM)
+		return -ENODEV;
+
 	if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
 		dev_err(&serial->dev->dev, "active config #%d != 1 ??\n",
 			serial->dev->actconfig->desc.bConfigurationValue);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ