ADB口在linux上位机安装USB串口驱动(usbserial.ko)后被识别为ttyUSBn口问题的处理参考

如题所述问题,可参考如下链接中处理。

本文仅供参考,请客观考虑具体问题,并评估可行性,谢谢!

https://patchwork.kernel.org/project/linux-usb/patch/20180723140220.7166-1-romain.izard.pro@gmail.com/

上述参考中,核心内容如下:

On Mon, Jul 23, 2018 at 04:02:20PM +0200, Romain Izard wrote:
> Some modems now use the Android Debug Bridge to provide a debugging
> interface, and some phones can also export serial ports managed by the
> "option" driver.
> 
> The ADB daemon running in userspace tries to use USB interfaces with
> bDeviceClass=0xFF, bDeviceSubClass=0x42, bDeviceProtocol=1
> 
> Prevent the option driver from binding to those interfaces, as they
> will not be serial ports.
> 
> This can fix issues like:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=781256
> 
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
> Cc: stable <stable@vger.kernel.org>
> ---
>  drivers/usb/serial/option.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
> index 664e61f16b6a..f98943a57ff0 100644
> --- a/drivers/usb/serial/option.c
> +++ b/drivers/usb/serial/option.c
> @@ -1987,6 +1987,12 @@ static int option_probe(struct usb_serial *serial,
>  	if (iface_desc->bInterfaceClass == USB_CLASS_MASS_STORAGE)
>  		return -ENODEV;
>  
> +	/* Do not bind Android Debug Bridge interfaces */
> +	if (iface_desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC &&
> +		iface_desc->bInterfaceSubClass == 0x42 &&
> +		iface_desc->bInterfaceProtocol == 1)
> +		return -ENODEV;

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值