Re: umsm(4) support for Vodafone k3772

2018-04-10 Thread Jeremie Courreges-Anglas
On Tue, Apr 10 2018, Björn Ketelaars  wrote:
> I received a Vodafone k3772 USB modem, which is not supported out of the
> box in current. dmesg:
>
> umass0 at uhub3 port 2 configuration 1 interface 0 "Vodafone (Huawei) 
> Vodafone Mobile Broadband (Huawei)" rev 2.00/1.02 addr 6
> umass0: using SCSI over Bulk-Only
> scsibus4 at umass0: 2 targets, initiator 0
> cd0 at scsibus4 targ 1 lun 0:  SCSI2 5/cdrom 
> removable
>
>
> Diff below adds support for this device. dmesg:
>
> umsm0 at uhub0 port 2 configuration 1 interface 0 "Vodafone (Huawei) Vodafone 
> Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
> umsm0 detached
> umsm0 at uhub0 port 2 configuration 1 interface 0 "Vodafone (Huawei) Vodafone 
> Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
> ucom0 at umsm0
> umsm1 at uhub0 port 2 configuration 1 interface 1 "Vodafone (Huawei) Vodafone 
> Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
> ucom1 at umsm1
> umsm2 at uhub0 port 2 configuration 1 interface 2 "Vodafone (Huawei) Vodafone 
> Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
> ucom2 at umsm2
> umass0 at uhub0 port 2 configuration 1 interface 3 "Vodafone (Huawei) 
> Vodafone Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
> umass0: using SCSI over Bulk-Only
> scsibus2 at umass0: 2 targets, initiator 0
> cd0 at scsibus2 targ 1 lun 0:  SCSI2 5/cdrom 
> removable
> umass1 at uhub0 port 2 configuration 1 interface 4 "Vodafone (Huawei) 
> Vodafone Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
> umass1: using SCSI over Bulk-Only
> scsibus3 at umass1: 2 targets, initiator 0
> sd1 at scsibus3 targ 1 lun 0:  SCSI2 
> 0/direct removable
>
>
> I'm able to set up an internet connection using this device in
> combination with a Vodafone subscription on a x230. Actually I've been
> using this device for the last few weeks during my daily commute. There
> seems to be however one issue, which does not interfere with reliability
> or stability. dmesg: 
>
> umsm0: this device is not using CDC notify message in intr pipe.
> Please send your dmesg to , thanks.
> umsm0: intr buffer 0xc1 0x1 0x3 0x0 0x0 0x0 0x0
>
>
> A search on misc@ revealed that this is not an isolated issue, e.g.
> https://marc.info/?l=openbsd-misc=142477847307314=2
>
>
> Comments?

The warning isn't new, I think should go ahead and commit this.  ok jca@

> Index: share/man/man4/umsm.4
> ===
> RCS file: /cvs/src/share/man/man4/umsm.4,v
> retrieving revision 1.94
> diff -u -p -r1.94 umsm.4
> --- share/man/man4/umsm.4 20 Mar 2018 07:30:10 -  1.94
> +++ share/man/man4/umsm.4 10 Apr 2018 17:39:52 -
> @@ -113,6 +113,7 @@ driver:
>  .It Li "Toshiba 3G HSDPA MiniCard" Ta "PCI Express Mini Card"
>  .It Li "Vodafone Mobile Connect 3G" Ta "CardBus"
>  .It Li "Vodafone Mobile Broadband K3765" Ta "USB"
> +.It Li "Vodafone Mobile Broadband K3772" Ta "USB"
>  .It Li "ZTE AC2746" Ta "USB"
>  .It Li "ZTE MF112" Ta "USB"
>  .It Li "ZTE MF190" Ta "USB"
> Index: sys/dev/usb/umsm.c
> ===
> RCS file: /cvs/src/sys/dev/usb/umsm.c,v
> retrieving revision 1.111
> diff -u -p -r1.111 umsm.c
> --- sys/dev/usb/umsm.c20 Mar 2018 07:30:10 -  1.111
> +++ sys/dev/usb/umsm.c10 Apr 2018 17:39:52 -
> @@ -142,6 +142,8 @@ static const struct umsm_type umsm_devs[
>   {{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_Mobile }, DEV_HUAWEI},
>   {{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K3765_INIT }, DEV_UMASS5},
>   {{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K3765 }, 0},
> + {{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K3772_INIT }, DEV_UMASS5},
> + {{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K3772 }, 0},
>   {{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_MU609 }, DEV_TRUINSTALL},
>   {{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K4510 }, DEV_UMASS5},
>   {{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K4511 }, DEV_UMASS5},
> Index: sys/dev/usb/usbdevs
> ===
> RCS file: /cvs/src/sys/dev/usb/usbdevs,v
> retrieving revision 1.683
> diff -u -p -r1.683 usbdevs
> --- sys/dev/usb/usbdevs   20 Mar 2018 07:30:10 -  1.683
> +++ sys/dev/usb/usbdevs   10 Apr 2018 17:39:52 -
> @@ -2217,12 +2217,14 @@ product HUAWEI E182   0x1429  HUAWEI Mobil
>  product HUAWEI E3372 0x1442  HUAWEI Mobile Modem
>  product HUAWEI E161  0x1446  HUAWEI Mobile Modem
>  product HUAWEI K3765 0x1465  HUAWEI Mobile K3765
> +product HUAWEI K3772 0x14cf  HUAWEI Mobile K3772
>  product HUAWEI E1820 0x14ac  HUAWEI Mobile Modem
>  product HUAWEI K4510 0x14c5  HUAWEI Mobile Modem
>  product HUAWEI K4511 0x14b7  HUAWEI Mobile Modem K4511
>  product HUAWEI E353_INIT 0x14fe  HUAWEI Mobile E353 Initial
>  

umsm(4) support for Vodafone k3772

2018-04-10 Thread Björn Ketelaars
I received a Vodafone k3772 USB modem, which is not supported out of the
box in current. dmesg:

umass0 at uhub3 port 2 configuration 1 interface 0 "Vodafone (Huawei) Vodafone 
Mobile Broadband (Huawei)" rev 2.00/1.02 addr 6
umass0: using SCSI over Bulk-Only
scsibus4 at umass0: 2 targets, initiator 0
cd0 at scsibus4 targ 1 lun 0:  SCSI2 5/cdrom 
removable


Diff below adds support for this device. dmesg:

umsm0 at uhub0 port 2 configuration 1 interface 0 "Vodafone (Huawei) Vodafone 
Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
umsm0 detached
umsm0 at uhub0 port 2 configuration 1 interface 0 "Vodafone (Huawei) Vodafone 
Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
ucom0 at umsm0
umsm1 at uhub0 port 2 configuration 1 interface 1 "Vodafone (Huawei) Vodafone 
Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
ucom1 at umsm1
umsm2 at uhub0 port 2 configuration 1 interface 2 "Vodafone (Huawei) Vodafone 
Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
ucom2 at umsm2
umass0 at uhub0 port 2 configuration 1 interface 3 "Vodafone (Huawei) Vodafone 
Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
cd0 at scsibus2 targ 1 lun 0:  SCSI2 5/cdrom 
removable
umass1 at uhub0 port 2 configuration 1 interface 4 "Vodafone (Huawei) Vodafone 
Mobile Broadband (Huawei)" rev 2.00/1.02 addr 2
umass1: using SCSI over Bulk-Only
scsibus3 at umass1: 2 targets, initiator 0
sd1 at scsibus3 targ 1 lun 0:  SCSI2 0/direct 
removable


I'm able to set up an internet connection using this device in
combination with a Vodafone subscription on a x230. Actually I've been
using this device for the last few weeks during my daily commute. There
seems to be however one issue, which does not interfere with reliability
or stability. dmesg: 

umsm0: this device is not using CDC notify message in intr pipe.
Please send your dmesg to , thanks.
umsm0: intr buffer 0xc1 0x1 0x3 0x0 0x0 0x0 0x0


A search on misc@ revealed that this is not an isolated issue, e.g.
https://marc.info/?l=openbsd-misc=142477847307314=2


Comments?


Index: share/man/man4/umsm.4
===
RCS file: /cvs/src/share/man/man4/umsm.4,v
retrieving revision 1.94
diff -u -p -r1.94 umsm.4
--- share/man/man4/umsm.4   20 Mar 2018 07:30:10 -  1.94
+++ share/man/man4/umsm.4   10 Apr 2018 17:39:52 -
@@ -113,6 +113,7 @@ driver:
 .It Li "Toshiba 3G HSDPA MiniCard" Ta "PCI Express Mini Card"
 .It Li "Vodafone Mobile Connect 3G" Ta "CardBus"
 .It Li "Vodafone Mobile Broadband K3765" Ta "USB"
+.It Li "Vodafone Mobile Broadband K3772" Ta "USB"
 .It Li "ZTE AC2746" Ta "USB"
 .It Li "ZTE MF112" Ta "USB"
 .It Li "ZTE MF190" Ta "USB"
Index: sys/dev/usb/umsm.c
===
RCS file: /cvs/src/sys/dev/usb/umsm.c,v
retrieving revision 1.111
diff -u -p -r1.111 umsm.c
--- sys/dev/usb/umsm.c  20 Mar 2018 07:30:10 -  1.111
+++ sys/dev/usb/umsm.c  10 Apr 2018 17:39:52 -
@@ -142,6 +142,8 @@ static const struct umsm_type umsm_devs[
{{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_Mobile }, DEV_HUAWEI},
{{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K3765_INIT }, DEV_UMASS5},
{{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K3765 }, 0},
+   {{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K3772_INIT }, DEV_UMASS5},
+   {{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K3772 }, 0},
{{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_MU609 }, DEV_TRUINSTALL},
{{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K4510 }, DEV_UMASS5},
{{ USB_VENDOR_HUAWEI,   USB_PRODUCT_HUAWEI_K4511 }, DEV_UMASS5},
Index: sys/dev/usb/usbdevs
===
RCS file: /cvs/src/sys/dev/usb/usbdevs,v
retrieving revision 1.683
diff -u -p -r1.683 usbdevs
--- sys/dev/usb/usbdevs 20 Mar 2018 07:30:10 -  1.683
+++ sys/dev/usb/usbdevs 10 Apr 2018 17:39:52 -
@@ -2217,12 +2217,14 @@ product HUAWEI E182 0x1429  HUAWEI Mobil
 product HUAWEI E3372   0x1442  HUAWEI Mobile Modem
 product HUAWEI E1610x1446  HUAWEI Mobile Modem
 product HUAWEI K3765   0x1465  HUAWEI Mobile K3765
+product HUAWEI K3772   0x14cf  HUAWEI Mobile K3772
 product HUAWEI E1820   0x14ac  HUAWEI Mobile Modem
 product HUAWEI K4510   0x14c5  HUAWEI Mobile Modem
 product HUAWEI K4511   0x14b7  HUAWEI Mobile Modem K4511
 product HUAWEI E353_INIT   0x14fe  HUAWEI Mobile E353 Initial
 product HUAWEI E392_INIT   0x1505  HUAWEI Mobile E392 Initial
 product HUAWEI K3765_INIT  0x1520  HUAWEI Mobile K3765 Initial
+product HUAWEI K3772_INIT  0x1526  HUAWEI Mobile K3772 Initial
 product HUAWEI MU609   0x1573  HUAWEI Mobile ME906 
 product HUAWEI E173S   0x1c05  HUAWEI Mobile E173s