Re: umodem0, Cisco USB serial console, and quirks

2018-11-04 Thread Mike Andrews

On Fri, 2 Nov 2018, CeDeROM wrote:


Try to add VID/PID of your device into a usbmodem driver. Use
configurations to see which one works with your device. Rebuild the
module/kernel, reboot, try it out untill success.

After your device is recognised by usbmodem and creates several cuaU*
devices.. still Your device may require uploading a specific firmware
in order for gsm modem to work. You can find those in Windows driver
package.

Use MINICOM for cuaU communications that would save you a debug time.

That works for me - added 3 devices like that with no problem. In fact
they work better on FreeBSD than Windows ;-)


Alternartively, replace your modem with something that is known to
work - for instance QUECTEL EC25 LTE module works far better than my
previous stock 3G module here..


I think we're losing the plot here a bit.

While this is generally useful advice, this thread was originally about 
the USB serial console port of Cisco ASA firewalls.  It should just be a 
plain ol' USB-to-serial setup.  No actual modems of any kind involved, 
especially not cellular ones.


I suspect we shouldn't even be loading umodem at all -- just ucom.  But 
for some reason, umodem gets loaded when I plug the thing in.  With just 
an FTDI serial-to-usb adapter in there, umodem doesn't just, just ucom.


These firewalls (and I suspect all of Cisco's newer routers and switches) 
have both normal serial and mini-USB-to-serial ports, and you can connect 
a simple USB-to-serial converter (PL2303, FTDI, etc) into the normal port 
and of course that works fine on FreeBSD.  But it would be nice to skip 
needing the dongle...

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: umodem0, Cisco USB serial console, and quirks

2018-11-01 Thread Mike Andrews

On 11/1/18 4:59 PM, Andrey V. Elsukov wrote:


On 27.09.2017 05:11, Mike Andrews wrote:

This is the USB read transfer. The other side is not returning any
data, so neither is "cu" printing anything. Maybe you can try to get a
similar trace from the system where it works?

Looks to me like some kind of protocol error, that the Cisco USB
serial console needs some kind of activation.

Took me a few days to get around to getting usbmon going on Linux.  The
verbose dump is too large for the list, so:

    https://www.bit0.com/tmp/usbmon-ciscoasa-verbose.txt
    https://www.bit0.com/tmp/usbmon-ciscoasa.txt

Hi,

did you find some solution? It seems this device still doesn't work with
recent FreeBSD.
I found how it should work on linux:
https://community.cisco.com/t5/network-architecture-documents/cisco-console-connection-via-usb-serial/ta-p/3163540

And it seems in Linux it is handled by generic CDC ACM driver without
any quirks. So, I think the problem is with our umodem(4) or ucom(4)
driver.


No, I didn't.

The usbmon dumps above are still there, and if someone can suggest 
anything else I can do to help, lemme know.


___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: umodem0, Cisco USB serial console, and quirks

2017-09-26 Thread Mike Andrews

On Tue, 19 Sep 2017, Hans Petter Selasky wrote:


On 09/19/17 18:15, Mike Andrews wrote:
 
12:03:37.726830 usbus4.3 SUBM-BULK-EP=0082,SPD=FULL,NFR=1,SLEN=0,IVAL=0

  frame[0] READ 1024 bytes
  flags 0xa 
  status 0xcf023


Hi,

Look for:

-BULK-EP=0082

This is the USB read transfer. The other side is not returning any data, so 
neither is "cu" printing anything. Maybe you can try to get a similar trace 
from the system where it works?


Looks to me like some kind of protocol error, that the Cisco USB serial 
console needs some kind of activation.


Took me a few days to get around to getting usbmon going on Linux.  The 
verbose dump is too large for the list, so:


   https://www.bit0.com/tmp/usbmon-ciscoasa-verbose.txt
   https://www.bit0.com/tmp/usbmon-ciscoasa.txt
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: umodem0, Cisco USB serial console, and quirks

2017-09-19 Thread Mike Andrews

On Tue, 19 Sep 2017, Hans Petter Selasky wrote:


On 09/19/17 16:22, Mike Andrews wrote:
I'm trying to get the USB console of a Cisco ASA 5506-X firewall (not 
terribly obscure hardware) talking to FreeBSD, and having some trouble. The 
relevant dmesg at probe time is:


   umodem0 on uhub7
   umodem0:  on 
usbus4

   umodem0: data interface 1, has no CM over data, has no break

...and /dev/cuaU2 is created, and I can connect to it using cu, but then 
nothing happens.  As in, hitting enter to get a prompt just sits there. 
(cuaU1 and cuaU0 are a separate two-port USB serial adapter and that one 
works fine, it's using uftdi instead of umodem...)


The "has no CM over data" looks worrying.  I attempted to add a quirk, but 
either it isn't working or I didn't do it right.  In /boot/loader.conf I 
tried:




Hi,

Try using usbdump to figure out what is going on.

usbdump -i usbusX -f Y -s 65536 -vvv

X and Y are the numbers in ugenX.Y printed in dmesg.

It will dump all low level communication with the firewall. Maybe it needs 
some special character escaping to respond, or maybe it needs to set the RTS 
CTS bits.


OK, here's a dump while running "cu -s 9600 -l /dev/cuaU2", hitting return 
about a dozen times, and then ~. to quit.


I'm not sure how to interpret this as I'm not familiar with USB stack 
innards.  (I'm more of a tcpdump guy.)


Oh, and I suck for not mentioning that this is FreeBSD 11.1-p1 amd64.

On macOS the same cu command (for /dev/cu.usbmodem1411) works fine without 
any other magic.  I don't know where their equivalent of usbdump is, 
unless it's buried in Xcode somewhere.  I can give Ubuntu a shot too, once 
I dust that hardware off and power it up...



# usbdump -i usbus4 -f 3 -s 65536 -vvv
12:03:37.726789 usbus4.3 SUBM-CTRL-EP=,SPD=FULL,NFR=1,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
   21 22 03 00 00 00 00 00  -- -- -- -- -- -- -- --  |!"..|
 flags 0x10 
 status 0xee1a3 

12:03:37.726815 usbus4.3 SUBM-INTR-EP=0081,SPD=FULL,NFR=1,SLEN=0,IVAL=2
 frame[0] READ 8 bytes
 flags 0x8a 
 status 0xcf023 

12:03:37.726830 usbus4.3 SUBM-BULK-EP=0082,SPD=FULL,NFR=1,SLEN=0,IVAL=0
 frame[0] READ 1024 bytes
 flags 0xa 
 status 0xcf023 

12:03:37.729716 usbus4.3 
DONE-CTRL-EP=,SPD=FULL,NFR=1,SLEN=0,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 flags 0x10 
 status 0xce1a1 

12:03:37.729785 usbus4.3 SUBM-CTRL-EP=,SPD=FULL,NFR=1,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
   21 22 03 00 00 00 00 00  -- -- -- -- -- -- -- --  |!"..|
 flags 0x10 
 status 0xce1a3 

12:03:37.732696 usbus4.3 
DONE-CTRL-EP=,SPD=FULL,NFR=1,SLEN=0,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 flags 0x10 
 status 0xee1a1 

12:03:37.732753 usbus4.3 SUBM-CTRL-EP=,SPD=FULL,NFR=2,SLEN=16,IVAL=0
 frame[0] WRITE 8 bytes
   21 20 00 00 00 00 07 00  -- -- -- -- -- -- -- --  |! ..|
 frame[1] WRITE 7 bytes
   80 25 00 00 00 00 08 --  -- -- -- -- -- -- -- --  |.%. |
 flags 0x10 
 status 0xee1a3 

12:03:37.736700 usbus4.3 
DONE-CTRL-EP=,SPD=FULL,NFR=2,SLEN=0,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 frame[1] WRITE 7 bytes
 flags 0x10 
 status 0xce1a1 

12:03:37.840679 usbus4.3 SUBM-CTRL-EP=,SPD=FULL,NFR=2,SLEN=16,IVAL=0
 frame[0] WRITE 8 bytes
   21 20 00 00 00 00 07 00  -- -- -- -- -- -- -- --  |! ..|
 frame[1] WRITE 7 bytes
   80 25 00 00 00 00 08 --  -- -- -- -- -- -- -- --  |.%. |
 flags 0x10 
 status 0xce1a3 

12:03:37.844696 usbus4.3 
DONE-CTRL-EP=,SPD=FULL,NFR=2,SLEN=0,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 frame[1] WRITE 7 bytes
 flags 0x10 
 status 0xee1a1 

12:03:47.719626 usbus4.3 SUBM-BULK-EP=0003,SPD=FULL,NFR=1,SLEN=4,IVAL=0
 frame[0] WRITE 1 bytes
   0D -- -- -- -- -- -- --  -- -- -- -- -- -- -- --  |.   |
 flags 0x9 
 status 0xce023 

12:03:47.720517 usbus4.3 
DONE-BULK-EP=0003,SPD=FULL,NFR=1,SLEN=0,IVAL=0,ERR=0
 frame[0] WRITE 1 bytes
 flags 0x9 
 status 0xee021 

12:03:48.425798 usbus4.3 SUBM-BULK-EP=0003,SPD=FULL,NFR=1,SLEN=4,IVAL=0
 frame[0] WRITE 1 bytes
   0D -- -- -- -- -- -- --  -- -- -- -- -- -- -- --  |.   |
 flags 0x9 
 status 0xee023 

12:03:48.426504 usbus4.3 
DONE-BULK-EP=0003,SPD=FULL,NFR=1,SLEN=0,IVAL=0,ERR=0
 frame[0] WRITE 1 bytes
 flags 0x9 
 status 0xce021 

12:03:48.959494 usbus4.3 SUBM-BULK-EP=0003,SPD=FULL,NFR=1,SLEN=4,IVAL=0
 frame[0] WRITE 1 bytes
   0D -- -- -- -- -- -- --  -- -- -- -- -- -- -- --  |.   |
 flags 0x9 
 status 0xce023 

12:03:48.960496 usbus4.3 
DONE-BULK-EP=0003,SPD=FULL,NFR=1,SLEN=0,IVAL=0,ERR=0
 frame[0] WRITE 1 bytes
 flags 0x9 
 status 0xee021 

12:03:49.299515 usbus4.3 SUBM-BULK-EP=0003,SPD=FULL,NFR=1,SLEN=4,IVAL=0
 frame[0] WRITE 1 bytes
   0D -- -- -- -- -- -- --  -- -- -- -- -- -- -- --  |.   |
 flags 0x9 
 status 0xee023 

12:03:49.300487 usbus4.3 
DONE-BULK-EP=000

umodem0, Cisco USB serial console, and quirks

2017-09-19 Thread Mike Andrews
I'm trying to get the USB console of a Cisco ASA 5506-X firewall (not 
terribly obscure hardware) talking to FreeBSD, and having some trouble. 
The relevant dmesg at probe time is:


  umodem0 on uhub7
  umodem0:  on usbus4
  umodem0: data interface 1, has no CM over data, has no break

...and /dev/cuaU2 is created, and I can connect to it using cu, but then 
nothing happens.  As in, hitting enter to get a prompt just sits there. 
(cuaU1 and cuaU0 are a separate two-port USB serial adapter and that one 
works fine, it's using uftdi instead of umodem...)


The "has no CM over data" looks worrying.  I attempted to add a quirk, but 
either it isn't working or I didn't do it right.  In /boot/loader.conf I 
tried:


  hw.usb.quirk.0="0x05a6 0x0009 0 0x UQ_ASSUME_CM_OVER_DATA"

and I also tried

  # usbconfig -d ugen4.3 add_quirk UQ_ASSUME_CM_OVER_DATA

but it doesn't make any difference.  It does show up as a new entry in 
"usbconfig dump_device_quirks" but doesn't solve the problem.


Connecting the firewall to a Mac with the same cable works fine, so I know 
the cable is good and that I'm using the right bit rate (9600).


Here are some other usbconfig dumps if these are useful in pointing me in 
the right direction (sorry these have lines longer than 80 columns):


  # usbconfig -d ugen4.3 show_ifdrv
  ugen4.3:  at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) 
pwr=ON (100mA)
  ugen4.3.0: umodem0: 

  # usbconfig -d ugen4.3 dump_device_desc
  ugen4.3:  at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) 
pwr=ON (100mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x0002  
bDeviceSubClass = 0x
bDeviceProtocol = 0x
bMaxPacketSize0 = 0x0008
idVendor = 0x05a6
idProduct = 0x0009
bcdDevice = 0x
iManufacturer = 0x0001  
iProduct = 0x0002  
iSerialNumber = 0x  
bNumConfigurations = 0x0001

  # usbconfig -d ugen4.3 dump_all_config_desc
  ugen4.3:  at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) 
pwr=ON (100mA)


   Configuration index 0

  bLength = 0x0009
  bDescriptorType = 0x0002
  wTotalLength = 0x0043
  bNumInterfaces = 0x0002
  bConfigurationValue = 0x0001
  iConfiguration = 0x0003  
  bmAttributes = 0x00c0
  bMaxPower = 0x0032

  Interface 0
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x
bAlternateSetting = 0x
bNumEndpoints = 0x0001
bInterfaceClass = 0x0002  
bInterfaceSubClass = 0x0002
bInterfaceProtocol = 0x0001
iInterface = 0x  

Additional Descriptor

bLength = 0x05
bDescriptorType = 0x24
bDescriptorSubType = 0x00
 RAW dump:
 0x00 | 0x05, 0x24, 0x00, 0x10, 0x01


Additional Descriptor

bLength = 0x04
bDescriptorType = 0x24
bDescriptorSubType = 0x02
 RAW dump:
 0x00 | 0x04, 0x24, 0x02, 0x02


Additional Descriptor

bLength = 0x05
bDescriptorType = 0x24
bDescriptorSubType = 0x06
 RAW dump:
 0x00 | 0x05, 0x24, 0x06, 0x00, 0x01


Additional Descriptor

bLength = 0x05
bDescriptorType = 0x24
bDescriptorSubType = 0x01
 RAW dump:
 0x00 | 0x05, 0x24, 0x01, 0x00, 0x01


   Endpoint 0
  bLength = 0x0007
  bDescriptorType = 0x0005
  bEndpointAddress = 0x0081  
  bmAttributes = 0x0003  
  wMaxPacketSize = 0x0008
  bInterval = 0x0002
  bRefresh = 0x
  bSynchAddress = 0x


  Interface 1
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0001
bAlternateSetting = 0x
bNumEndpoints = 0x0002
bInterfaceClass = 0x000a  
bInterfaceSubClass = 0x
bInterfaceProtocol = 0x
iInterface = 0x  

   Endpoint 0
  bLength = 0x0007
  bDescriptorType = 0x0005
  bEndpointAddress = 0x0082  
  bmAttributes = 0x0002  
  wMaxPacketSize = 0x0040
  bInterval = 0x
  bRefresh = 0x
  bSynchAddress = 0x

   Endpoint 1
  bLength = 0x0007
  bDescriptorType = 0x0005
  bEndpointAddress = 0x0003  
  bmAttributes = 0x0002  
  wMaxPacketSize = 0x0020
  bInterval = 0x
  bRefresh = 0x
  bSynchAddress = 0x

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"