Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-11-17 Thread Matti Laakso
Hi Sami,


Having an E3276 would be nice for developing this further. I have already a 
patch for comgt ready which allows it to be used with non-TTY device nodes 
(i.e., /dev/cdc-wdmX), I just need to test it before sending. Then I could dig 
further into netifd integration.


Matti___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-11-16 Thread Sami Olmari
Matti, would you like to have the Huawei e3276 for debugging this
after I get it back? Yours to keep if you want to :) Mine skills is
kinda not there with this, but need for working NCM is more than
needed for me :)

 Sami Olmari

On Sat, Nov 15, 2014 at 6:31 AM, John Crispin blo...@openwrt.org wrote:
 no and i will resend your device back to you next week

 On 14/11/2014 20:26, Sami Olmari wrote:
 I'm sorry to bother, but any luck with this? :) I have tried some
 stuff what Matti has suspected above the quirk is located at, but no
 good with mine coding skills :/

  Sami Olmari

 On Sun, Nov 9, 2014 at 11:49 AM, Matti Laakso malaa...@elisanet.fi wrote:
 Hi Jamie,

 On Thu, Oct 30, 2014 at 12:58:40PM +0200, Matti Laakso wrote:
 Hi Sami,

 Using John's version:

 config interface 'wan'
 option proto 'wwan'
 option apn 'opengate'
 #   option device '/dev/cdc-wdm0' (with or without commenting this)

 Does absolutely nothing, nothing in logread...

 However now when using

 config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'

 I believe that device should be /dev/cdc-wdm0 also here, at least
 when using huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the
 option driver do not necessarily support all necessary AT-commands.
 Also, (at least when using proto ncm) you need to specify in
 addition

 option ifname wwan0

 That wasn't enough to get it to find the device for me for some
 reason. The following change to proto_ncm_setup does make it work:

   echo ncm[$$] Connected, starting DHCP
 - proto_init_update * 1
 + proto_init_update wwan0 1
   proto_send_update $interface

 For bringing the interface down the control device can't be found.
 The following change in proto_ncm_teardown makes that work:

   json_get_vars device
 +
 + device=/dev/ttyUSB0

   echo ncm[$$] Stopping network

 With the above two changes in place this all works fine. I don't know
 enough about how this is all meant to work to know why this is needed
 or why those configuration values are not making it to where they
 need to be.


 I suspect that the call to

 json_load $(cat /etc/gcom/ncm.json)

 in ncm.sh causes the interface information to get lost, so that subsequent
 json_* calls no longer work correctly. We should somehow unload ncm.json
 after the necessary AT-commands are read, and then restore normal
 interface information. Or can we read ncm.json into a separate namespace or
 something? Maybe Felix or Steven could give some advice?

 Matti
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-11-09 Thread Matti Laakso
Hi Jamie,

 On Thu, Oct 30, 2014 at 12:58:40PM +0200, Matti Laakso wrote:
  Hi Sami,
  
  Using John's version:
  
  config interface 'wan'
   option proto 'wwan'
   option apn 'opengate'
  #   option device '/dev/cdc-wdm0' (with or without commenting this)
  
  Does absolutely nothing, nothing in logread...
  
  However now when using
  
  config interface 'wan'
   option proto 'ncm'
   option apn 'opengate'
   option device '/dev/ttyUSB1'
  
  I believe that device should be /dev/cdc-wdm0 also here, at least
  when using huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the
  option driver do not necessarily support all necessary AT-commands.
  Also, (at least when using proto ncm) you need to specify in
  addition
  
  option ifname wwan0

 That wasn't enough to get it to find the device for me for some
 reason. The following change to proto_ncm_setup does make it work:

   echo ncm[$$] Connected, starting DHCP
 - proto_init_update * 1
 + proto_init_update wwan0 1
   proto_send_update $interface

 For bringing the interface down the control device can't be found.
 The following change in proto_ncm_teardown makes that work:

   json_get_vars device
 +
 + device=/dev/ttyUSB0
  
   echo ncm[$$] Stopping network

 With the above two changes in place this all works fine. I don't know
 enough about how this is all meant to work to know why this is needed
 or why those configuration values are not making it to where they
 need to be.


I suspect that the call to 

json_load $(cat /etc/gcom/ncm.json)

in ncm.sh causes the interface information to get lost, so that subsequent
json_* calls no longer work correctly. We should somehow unload ncm.json
after the necessary AT-commands are read, and then restore normal 
interface information. Or can we read ncm.json into a separate namespace or
something? Maybe Felix or Steven could give some advice?

Matti
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-11-05 Thread Sami Olmari
Shouldn't there be declared proto_config_add_string ifname somewhere
at the /lib/netifd/proto/ncm.sh ? and use that as argument somewhere
in here:

echo ncm[$$] Connected, starting DHCP
proto_init_update * 1
proto_send_update $interface

And something similar for teardown?

Sami Olmari

On Sun, Nov 2, 2014 at 9:34 AM, Jamie Lenehan lene...@twibble.org wrote:
 On Thu, Oct 30, 2014 at 12:58:40PM +0200, Matti Laakso wrote:
 Hi Sami,

 Using John's version:
 
 config interface 'wan'
  option proto 'wwan'
  option apn 'opengate'
 #   option device '/dev/cdc-wdm0' (with or without commenting this)
 
 Does absolutely nothing, nothing in logread...
 
 However now when using
 
 config interface 'wan'
  option proto 'ncm'
  option apn 'opengate'
  option device '/dev/ttyUSB1'

 I believe that device should be /dev/cdc-wdm0 also here, at least
 when using huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the
 option driver do not necessarily support all necessary AT-commands.
 Also, (at least when using proto ncm) you need to specify in
 addition

 option ifname wwan0

 That wasn't enough to get it to find the device for me for some
 reason. The following change to proto_ncm_setup does make it work:

 echo ncm[$$] Connected, starting DHCP
 -   proto_init_update * 1
 +   proto_init_update wwan0 1
 proto_send_update $interface

 For bringing the interface down the control device can't be found.
 The following change in proto_ncm_teardown makes that work:

 json_get_vars device
 +
 +   device=/dev/ttyUSB0

 echo ncm[$$] Stopping network

 With the above two changes in place this all works fine. I don't know
 enough about how this is all meant to work to know why this is needed
 or why those configuration values are not making it to where they
 need to be.

 This is the configuration:

 config interface optus
 option proto 'ncm'
 option ifname 'wwan0'
 option device '/dev/ttyUSB0'
 option apn 'connect'
 option ip4table 'optus'

 The ip4table part didn't work either. I added this to proto_ncm_setup
 when setting up the dhcp sub-interface parameters to make it work:

 +   json_add_string ip4table optus

 [...]
 --
  Jamie Lenehan lene...@twibble.org
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-11-02 Thread Jamie Lenehan
On Thu, Oct 30, 2014 at 12:58:40PM +0200, Matti Laakso wrote:
 Hi Sami,
 
 Using John's version:
 
 config interface 'wan'
  option proto 'wwan'
  option apn 'opengate'
 #   option device '/dev/cdc-wdm0' (with or without commenting this)
 
 Does absolutely nothing, nothing in logread...
 
 However now when using
 
 config interface 'wan'
  option proto 'ncm'
  option apn 'opengate'
  option device '/dev/ttyUSB1'
 
 I believe that device should be /dev/cdc-wdm0 also here, at least
 when using huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the
 option driver do not necessarily support all necessary AT-commands.
 Also, (at least when using proto ncm) you need to specify in
 addition
 
 option ifname wwan0

That wasn't enough to get it to find the device for me for some
reason. The following change to proto_ncm_setup does make it work:

echo ncm[$$] Connected, starting DHCP
-   proto_init_update * 1
+   proto_init_update wwan0 1
proto_send_update $interface

For bringing the interface down the control device can't be found.
The following change in proto_ncm_teardown makes that work:

json_get_vars device
+
+   device=/dev/ttyUSB0
 
echo ncm[$$] Stopping network

With the above two changes in place this all works fine. I don't know
enough about how this is all meant to work to know why this is needed
or why those configuration values are not making it to where they
need to be.

This is the configuration:

config interface optus
option proto 'ncm'
option ifname 'wwan0'
option device '/dev/ttyUSB0'
option apn 'connect'
option ip4table 'optus'

The ip4table part didn't work either. I added this to proto_ncm_setup
when setting up the dhcp sub-interface parameters to make it work:

+   json_add_string ip4table optus

[...]
-- 
 Jamie Lenehan lene...@twibble.org
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-30 Thread Matti Laakso

Hi Sami,


Using John's version:

config interface 'wan'
 option proto 'wwan'
 option apn 'opengate'
#   option device '/dev/cdc-wdm0' (with or without commenting this)

Does absolutely nothing, nothing in logread...

However now when using

config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'


I believe that device should be /dev/cdc-wdm0 also here, at least when 
using huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the option 
driver do not necessarily support all necessary AT-commands. Also, (at 
least when using proto ncm) you need to specify in addition


option ifname wwan0

Missing this could lead to the errors below.

Matti



I see the Huawei dongle actually connects, as in the light lits up and
stays, indicating connection is made, but no wwan0 nor any other
interface at openwrt, also some erros still on logread:

Wed Oct 29 18:50:34 2014 kern.info kernel: [ 1174.74] usb 1-1.3:
new high-speed USB device number 5 using ehci-platform
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.45] usb 1-1.3:
USB disconnect, device number 5
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.78] usb 1-1.3:
new high-speed USB device number 6 using ehci-platform
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.91] option
1-1.3:1.0: GSM modem (1-port) converter detected
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.92] usb 1-1.3:
GSM modem (1-port) converter now attached to ttyUSB0
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.93] option
1-1.3:1.1: GSM modem (1-port) converter detected
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.96] usb 1-1.3:
GSM modem (1-port) converter now attached to ttyUSB1
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.97]
huawei_cdc_ncm 1-1.3:1.2: MAC-Address: 0c:5b:8f:27:9a:64
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.98]
huawei_cdc_ncm 1-1.3:1.2: cdc-wdm0: USB WDM device
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.99]
huawei_cdc_ncm 1-1.3:1.2 wwan0: register 'huawei_cdc_ncm' at
usb-ehci-platform-1.3, Huawei CDC NCM device, 0c:5b:8f:27:9a:64

(ifup wan here)

Wed Oct 29 18:51:00 2014 daemon.notice netifd: Interface 'wan' is setting up now

(somewhere close time to the next line the dongles light lits up steady)

Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): ncm[5097]
Connected, starting DHCP
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Invalid argument
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Unknown error
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Unknown error

No interface appears on openwrt...

Also after this, ifdown wan doesn't tear the connection down (light
stays up). So somethign works to the point dongle itself get's
connected, but clearly something doesn't work still... This is on
ar71xx platform with 3.14 kernel...

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-30 Thread Sami Olmari
okay:

config interface 'wan'
option ifname 'wwan0'
option proto 'ncm'
option apn 'opengate'
option device '/dev/cdc-wdm0'

Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 - -- Error Report --
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 -    ^
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 - Error @6, line 1, Can't control /dev/cdc-wdm0, please try
again.
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): . (1)
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446):
Thu Oct 30 21:06:18 2014 user.notice firewall: Reloading firewall due
to ifup of lan (br-lan)
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 - -- Error Report --
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 -    ^
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 - Error @40, line 2, Can't control /dev/cdc-wdm0, please try
again.
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): . (1)
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446):
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): ncm[2446]
Failed to connect
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2502): Command
failed: Permission denied
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2502): ncm[2502]
Stopping network
Thu Oct 30 21:06:19 2014 daemon.notice netifd: wan (2502): Can't open device .
Thu Oct 30 21:06:19 2014 daemon.notice netifd: wan (2502): ncm[2502]
Failed to disconnect
Thu Oct 30 21:06:19 2014 daemon.notice netifd: Interface 'wan' is now down

and no connection, then:

config interface 'wan'
option ifname 'wwan0'
option proto 'ncm'
option apn 'opengate'
option device '/dev/ttyUSB1' (this is correct port when
using Oskari Rauta's original code, running on main router)

Thu Oct 30 21:09:46 2014 daemon.notice netifd: Interface 'wan' is setting up now
Thu Oct 30 21:09:54 2014 daemon.notice netifd: wan (3253): ncm[3253]
Connected, starting DHCP
Thu Oct 30 21:09:54 2014 daemon.notice netifd: wan (3253): Command
failed: Invalid argument
Thu Oct 30 21:09:54 2014 daemon.notice netifd: wan (3253): Command
failed: Unknown error
Thu Oct 30 21:09:54 2014 daemon.notice netifd: wan (3253): Command
failed: Unknown error

Also behaviour is quite similar to mine previous email, Huawei's light
stays lit, but no wwan0 etc available...

Also, if I then run first ifconfig wwan0 up and then dhclient -i
wwan0 I get IP for wwan0 and internet works! can ping and use SSH to
remote location... So this must be something small typo or so
somewhere deep in scripts?!

 Sami Olmari


On Thu, Oct 30, 2014 at 12:58 PM, Matti Laakso malaa...@elisanet.fi wrote:
 Hi Sami,

 Using John's version:

 config interface 'wan'
  option proto 'wwan'
  option apn 'opengate'
 #   option device '/dev/cdc-wdm0' (with or without commenting this)

 Does absolutely nothing, nothing in logread...

 However now when using

 config interface 'wan'
  option proto 'ncm'
  option apn 'opengate'
  option device '/dev/ttyUSB1'


 I believe that device should be /dev/cdc-wdm0 also here, at least when using
 huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the option driver do
 not necessarily support all necessary AT-commands. Also, (at least when
 using proto ncm) you need to specify in addition

 option ifname wwan0

 Missing this could lead to the errors below.

 Matti



 I see the Huawei dongle actually connects, as in the light lits up and
 stays, indicating connection is made, but no wwan0 nor any other
 interface at openwrt, also some erros still on logread:

 Wed Oct 29 18:50:34 2014 kern.info kernel: [ 1174.74] usb 1-1.3:
 new high-speed USB device number 5 using ehci-platform
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.45] usb 1-1.3:
 USB disconnect, device number 5
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.78] usb 1-1.3:
 new high-speed USB device number 6 using ehci-platform
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.91] option
 1-1.3:1.0: GSM modem (1-port) converter detected
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.92] usb 1-1.3:
 GSM modem (1-port) converter now attached to ttyUSB0
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.93] option
 1-1.3:1.1: GSM modem (1-port) converter detected
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.96] usb 1-1.3:
 GSM modem (1-port) converter now attached to ttyUSB1
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.97]
 huawei_cdc_ncm 1-1.3:1.2: MAC-Address: 0c:5b:8f:27:9a:64
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.98]
 huawei_cdc_ncm 1-1.3:1.2: cdc-wdm0: USB WDM device
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.99]
 huawei_cdc_ncm 1-1.3:1.2 wwan0: register 'huawei_cdc_ncm' at
 usb-ehci-platform-1.3, Huawei CDC NCM device, 0c:5b:8f:27:9a:64

 

Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-29 Thread Sami Olmari
Using John's version:

config interface 'wan'
option proto 'wwan'
option apn 'opengate'
#   option device '/dev/cdc-wdm0' (with or without commenting this)

Does absolutely nothing, nothing in logread...

However now when using

config interface 'wan'
option proto 'ncm'
option apn 'opengate'
option device '/dev/ttyUSB1'

I see the Huawei dongle actually connects, as in the light lits up and
stays, indicating connection is made, but no wwan0 nor any other
interface at openwrt, also some erros still on logread:

Wed Oct 29 18:50:34 2014 kern.info kernel: [ 1174.74] usb 1-1.3:
new high-speed USB device number 5 using ehci-platform
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.45] usb 1-1.3:
USB disconnect, device number 5
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.78] usb 1-1.3:
new high-speed USB device number 6 using ehci-platform
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.91] option
1-1.3:1.0: GSM modem (1-port) converter detected
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.92] usb 1-1.3:
GSM modem (1-port) converter now attached to ttyUSB0
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.93] option
1-1.3:1.1: GSM modem (1-port) converter detected
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.96] usb 1-1.3:
GSM modem (1-port) converter now attached to ttyUSB1
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.97]
huawei_cdc_ncm 1-1.3:1.2: MAC-Address: 0c:5b:8f:27:9a:64
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.98]
huawei_cdc_ncm 1-1.3:1.2: cdc-wdm0: USB WDM device
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.99]
huawei_cdc_ncm 1-1.3:1.2 wwan0: register 'huawei_cdc_ncm' at
usb-ehci-platform-1.3, Huawei CDC NCM device, 0c:5b:8f:27:9a:64

(ifup wan here)

Wed Oct 29 18:51:00 2014 daemon.notice netifd: Interface 'wan' is setting up now

(somewhere close time to the next line the dongles light lits up steady)

Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): ncm[5097]
Connected, starting DHCP
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Invalid argument
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Unknown error
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Unknown error

No interface appears on openwrt...

Also after this, ifdown wan doesn't tear the connection down (light
stays up). So somethign works to the point dongle itself get's
connected, but clearly something doesn't work still... This is on
ar71xx platform with 3.14 kernel...

 Sami Olmari


On Sun, Oct 26, 2014 at 7:07 PM, John Crispin blo...@openwrt.org wrote:
 *cough* fixed in r43071

 On 26/10/2014 15:06, Matti Laakso wrote:
 Hi Sami,

 Well this is what John told me:

 try /dev/cdc-wdm0 as a device or simply do

 config interface
 option proto wwan
 option apn opengate

 the new wwan proto will automagically detect your needed prot and device


 I had also tried this and variations, but same resuls:

 config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'

 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): Timeout
 running AT-command
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): ncm[4251]
 Failed to initialize modem
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Command
 failed: Permission denied
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Stopping network
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Can't open 
 device .
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Failed to disconnect
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: Interface 'wan' is now down

 I think John introduced a typo when committing my patch:
 in file package/network/utils/comgt/files/runcommand.gcom on line 11
 there is

 send ^n

 which should be

 send ^m

 Try to change that.

 Matti


 On Thu, Oct 23, 2014 at 10:20 AM, Bjørn Mork bjorn at mork.no 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel wrote:
 / Sami Olmari sami at olmari.fi 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel writes:
 //
 // option proto 'wwan'
 //
 // I don't know much about how this is supposed to work (don't have any
 // Huawei NCM modem), but I do see this in the patch posted earlier in this
 // thread:
 //
 // diff --git a/package/network/utils/comgt/files/3g.usb
 // b/package/network/utils/comgt/files/3g.usb
 // index fd6837e..ac8326b 100644
 // --- a/package/network/utils/comgt/files/3g.usb
 // +++ b/package/network/utils/comgt/files/3g.usb
 // @@ -8,7 +8,7 @@ find_3g_iface() {
 //
 //   local proto
 //   config_get proto $cfg proto
 // - [ $proto = 3g ] || return 0
 // + [ $proto = 3g ] || [ $proto = ncm ] || return 0
 //
 //   # bypass state vars here because 00-netstate could clobber 
 .device
 //   local dev=$(uci_get network 

Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-26 Thread Matti Laakso
Hi Sami,

 Well this is what John told me:

 try /dev/cdc-wdm0 as a device or simply do

 config interface
 option proto wwan
 option apn opengate

 the new wwan proto will automagically detect your needed prot and device


 I had also tried this and variations, but same resuls:

 config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'

 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): Timeout
 running AT-command
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): ncm[4251]
 Failed to initialize modem
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Command
 failed: Permission denied
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Stopping network
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Can't open device .
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Failed to disconnect
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: Interface 'wan' is now down

I think John introduced a typo when committing my patch:
in file package/network/utils/comgt/files/runcommand.gcom on line 11
there is

send ^n

which should be

send ^m

Try to change that.

Matti


 On Thu, Oct 23, 2014 at 10:20 AM, Bjørn Mork bjorn at mork.no 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel wrote:
 / Sami Olmari sami at olmari.fi 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel writes:
 //
 // option proto 'wwan'
 //
 // I don't know much about how this is supposed to work (don't have any
 // Huawei NCM modem), but I do see this in the patch posted earlier in this
 // thread:
 //
 // diff --git a/package/network/utils/comgt/files/3g.usb
 // b/package/network/utils/comgt/files/3g.usb
 // index fd6837e..ac8326b 100644
 // --- a/package/network/utils/comgt/files/3g.usb
 // +++ b/package/network/utils/comgt/files/3g.usb
 // @@ -8,7 +8,7 @@ find_3g_iface() {
 //
 //   local proto
 //   config_get proto $cfg proto
 // - [ $proto = 3g ] || return 0
 // + [ $proto = 3g ] || [ $proto = ncm ] || return 0
 //
 //   # bypass state vars here because 00-netstate could clobber .device
 //   local dev=$(uci_get network $cfg device)
 //
 //
 // which might explain stuff?
 //
 //
 // Bjørn/
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-26 Thread John Crispin
*cough* fixed in r43071

On 26/10/2014 15:06, Matti Laakso wrote:
 Hi Sami,
 
 Well this is what John told me:

 try /dev/cdc-wdm0 as a device or simply do

 config interface
 option proto wwan
 option apn opengate

 the new wwan proto will automagically detect your needed prot and device


 I had also tried this and variations, but same resuls:

 config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'

 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): Timeout
 running AT-command
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): ncm[4251]
 Failed to initialize modem
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Command
 failed: Permission denied
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Stopping network
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Can't open device 
 .
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Failed to disconnect
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: Interface 'wan' is now down
 
 I think John introduced a typo when committing my patch:
 in file package/network/utils/comgt/files/runcommand.gcom on line 11
 there is
 
 send ^n
 
 which should be
 
 send ^m
 
 Try to change that.
 
 Matti
 

 On Thu, Oct 23, 2014 at 10:20 AM, Bjørn Mork bjorn at mork.no 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel wrote:
 / Sami Olmari sami at olmari.fi 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel writes:
 //
 // option proto 'wwan'
 //
 // I don't know much about how this is supposed to work (don't have any
 // Huawei NCM modem), but I do see this in the patch posted earlier in this
 // thread:
 //
 // diff --git a/package/network/utils/comgt/files/3g.usb
 // b/package/network/utils/comgt/files/3g.usb
 // index fd6837e..ac8326b 100644
 // --- a/package/network/utils/comgt/files/3g.usb
 // +++ b/package/network/utils/comgt/files/3g.usb
 // @@ -8,7 +8,7 @@ find_3g_iface() {
 //
 //   local proto
 //   config_get proto $cfg proto
 // - [ $proto = 3g ] || return 0
 // + [ $proto = 3g ] || [ $proto = ncm ] || return 0
 //
 //   # bypass state vars here because 00-netstate could clobber .device
 //   local dev=$(uci_get network $cfg device)
 //
 //
 // which might explain stuff?
 //
 //
 // Bjørn/
 
 
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-24 Thread Sami Olmari
Well this is what John told me:

try /dev/cdc-wdm0 as a device or simply do

config interface
option proto wwan
option apn opengate

the new wwan proto will automagically detect your needed prot and device


I had also tried this and variations, but same resuls:

config interface 'wan'
option proto 'ncm'
option apn 'opengate'
option device '/dev/ttyUSB1'

Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): Timeout
running AT-command
Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): ncm[4251]
Failed to initialize modem
Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Command
failed: Permission denied
Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
Stopping network
Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Can't open device .
Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
Failed to disconnect
Mon Oct 20 12:46:52 2014 daemon.notice netifd: Interface 'wan' is now down

 Sami Olmari

On Thu, Oct 23, 2014 at 10:20 AM, Bjørn Mork bj...@mork.no wrote:
 Sami Olmari s...@olmari.fi writes:

 option proto 'wwan'

 I don't know much about how this is supposed to work (don't have any
 Huawei NCM modem), but I do see this in the patch posted earlier in this
 thread:

 diff --git a/package/network/utils/comgt/files/3g.usb
 b/package/network/utils/comgt/files/3g.usb
 index fd6837e..ac8326b 100644
 --- a/package/network/utils/comgt/files/3g.usb
 +++ b/package/network/utils/comgt/files/3g.usb
 @@ -8,7 +8,7 @@ find_3g_iface() {

   local proto
   config_get proto $cfg proto
 - [ $proto = 3g ] || return 0
 + [ $proto = 3g ] || [ $proto = ncm ] || return 0

   # bypass state vars here because 00-netstate could clobber .device
   local dev=$(uci_get network $cfg device)


 which might explain stuff?


 Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-24 Thread Bjørn Mork
Sami Olmari s...@olmari.fi writes:

 Well this is what John told me:

 try /dev/cdc-wdm0 as a device or simply do

 config interface
 option proto wwan
 option apn opengate

 the new wwan proto will automagically detect your needed prot and device

Ah, right.  So I am only confusing things with my wild guessing.


 I had also tried this and variations, but same resuls:

 config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'

 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): Timeout
 running AT-command
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): ncm[4251]
 Failed to initialize modem
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Command
 failed: Permission denied
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Stopping network
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Can't open device .


Can't open device . sounds wrong.  Shouldn't that at least give a
device name?



Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-23 Thread Bjørn Mork
Sami Olmari s...@olmari.fi writes:

 option proto 'wwan'

I don't know much about how this is supposed to work (don't have any
Huawei NCM modem), but I do see this in the patch posted earlier in this
thread:

 diff --git a/package/network/utils/comgt/files/3g.usb 
 b/package/network/utils/comgt/files/3g.usb
 index fd6837e..ac8326b 100644
 --- a/package/network/utils/comgt/files/3g.usb
 +++ b/package/network/utils/comgt/files/3g.usb
 @@ -8,7 +8,7 @@ find_3g_iface() {
  
   local proto
   config_get proto $cfg proto
 - [ $proto = 3g ] || return 0
 + [ $proto = 3g ] || [ $proto = ncm ] || return 0
  
   # bypass state vars here because 00-netstate could clobber .device
   local dev=$(uci_get network $cfg device)


which might explain stuff?


Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread John Crispin


On 09/10/2014 14:14, Bjørn Mork wrote:
 Conor O'Gorman i...@conorogorman.net writes:
 On 08/10/14 11:00, John Crispin wrote:
 the e3267 that sami sent me works with this proto, but i am
 failing to get a DHCP addr. could someone with a ncm dongle
 please try this patch on top of latest trunk please and tell me
 if they are getting a dhcp addr ?
 
 I had a similar problem with a Huawei device. It worked after
 removing some zero padding in the ncm driver.
 
 In cdc_ncm.c, cdc_ncm_fill_tx_frame(), towards the end there is 
 handling for Zero Length Packets (ZLP) and padding short packets.
 I removed the padding, and it worked. Are you testing 3.10 or
 3.14? It's changed ever so slightly between them.
 
 I am somewhat confused by the comment. It won't pad out short
 packets, but does make shortish packets long.
 
 I don't have an fix for this bug, but I can try to add some
 background wrt the driver code...
 
 The NCM protocol assumes a powerful host and a much less powerful
 device (modem).  It also assumes that devices can operate more
 efficiently if all (or most) packets have the same length, enabling
 the device DMA engine to operate on its own without involving the
 device CPU. These assumptions were true for all NCM devices and
 hosts implemented at the time the protocol was finalized.  They are
 not necessarily true today. But we still have to deal with those
 assumptions somehow.
 
 One of the implications of this is that the device will operate
 more efficiently if the host pads packets the maximum length.  On
 the other hand, this padding does of course cost extra bandwidth
 and buffer usage, so there is some cutoff point for really short
 packets.  This is CDC_NCM_MIN_TX_PKT (512 bytes in the current NCM
 linux driver).
 
 So if a NCM packet exceeds 512 bytes then it is padded to max
 size. This maximum size is decided by the device (i.e. modem), but
 sanitized by the Linux driver.  Most traditional NCM devices have
 buffers in the order of 4 or 8kB, which limits the overhead caused
 by the padding somewhat.  But some Huawei devices have much larger
 buffers, causing an insane padding overhead given the fixed 512
 bytes cutoff even if the driver sanitize the values somewhat.  This
 is one of the issues I tried to fix in Linux v3.16.  Whether it was
 successful remains to be seen, but at least v3.16 gives us (the
 users) a lot more control over the process by adding a few
 tunables.  And some informational attributes as well.
 
 This is an example from v3.16+ (with an MBIM device, but the code
 and issues are both common):
 
 bjorn@nemi:~$ grep . /sys/class/net/wwan0/cdc_ncm/* 
 /sys/class/net/wwan0/cdc_ncm/bmNtbFormatsSupported:0x0001 
 /sys/class/net/wwan0/cdc_ncm/dwNtbInMaxSize:15360 
 /sys/class/net/wwan0/cdc_ncm/dwNtbOutMaxSize:15360 
 /sys/class/net/wwan0/cdc_ncm/min_tx_pkt:13824 
 /sys/class/net/wwan0/cdc_ncm/rx_max:15360 
 /sys/class/net/wwan0/cdc_ncm/tx_max:15360 
 /sys/class/net/wwan0/cdc_ncm/tx_timer_usecs:400 
 /sys/class/net/wwan0/cdc_ncm/wNdpInAlignment:4 
 /sys/class/net/wwan0/cdc_ncm/wNdpInDivisor:1 
 /sys/class/net/wwan0/cdc_ncm/wNdpInPayloadRemainder:0 
 /sys/class/net/wwan0/cdc_ncm/wNdpOutAlignment:4 
 /sys/class/net/wwan0/cdc_ncm/wNdpOutDivisor:32 
 /sys/class/net/wwan0/cdc_ncm/wNdpOutPayloadRemainder:0 
 /sys/class/net/wwan0/cdc_ncm/wNtbOutMaxDatagrams:32
 
 
 Here you can see the device specified TX and RX buffer sizes 
 (dwNtb*MaxSize) and also the buffers sizes currently in use by
 the driver (rx_max/tx_max).  And finally the min_tx_pkt
 attribute, which has replaced the fixed CDC_NCM_MIN_TX_PKT.  This
 is now dynamically calculated based on rx_max, and, as you can see
 from the values above, not causing that much overhead.
 
 Here's an example from a Huawei device (also MBIM), where the
 driver has sanitized the insane 128 kB buffer to 16 kB.
 
 bjorn@nemi:~$ grep . /sys/class/net/wwan1/cdc_ncm/* 
 /sys/class/net/wwan1/cdc_ncm/bmNtbFormatsSupported:0x0003 
 /sys/class/net/wwan1/cdc_ncm/dwNtbInMaxSize:131072 
 /sys/class/net/wwan1/cdc_ncm/dwNtbOutMaxSize:32768 
 /sys/class/net/wwan1/cdc_ncm/min_tx_pkt:14849 
 /sys/class/net/wwan1/cdc_ncm/rx_max:16384 
 /sys/class/net/wwan1/cdc_ncm/tx_max:16385 
 /sys/class/net/wwan1/cdc_ncm/tx_timer_usecs:400 
 /sys/class/net/wwan1/cdc_ncm/wNdpInAlignment:4 
 /sys/class/net/wwan1/cdc_ncm/wNdpInDivisor:4 
 /sys/class/net/wwan1/cdc_ncm/wNdpInPayloadRemainder:0 
 /sys/class/net/wwan1/cdc_ncm/wNdpOutAlignment:4 
 /sys/class/net/wwan1/cdc_ncm/wNdpOutDivisor:4 
 /sys/class/net/wwan1/cdc_ncm/wNdpOutPayloadRemainder:0 
 /sys/class/net/wwan1/cdc_ncm/wNtbOutMaxDatagrams:0
 
 And the last example from a device with extremely small buffers:
 
 bjorn@nemi:~$ grep . /sys/class/net/wwan2/cdc_ncm/* 
 /sys/class/net/wwan2/cdc_ncm/bmNtbFormatsSupported:0x0001 
 /sys/class/net/wwan2/cdc_ncm/dwNtbInMaxSize:2048 
 /sys/class/net/wwan2/cdc_ncm/dwNtbOutMaxSize:2048 
 /sys/class/net/wwan2/cdc_ncm/min_tx_pkt:512 
 /sys/class/net/wwan2/cdc_ncm/rx_max:2048 
 

Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread Bjørn Mork
John Crispin blo...@openwrt.org writes:

 ok, i am currently bumping some targets to v3.17. lets assume it is
 broken for  3.16 and hope 3.17 works.

 NCM seems to be broken by design and only a container as each dongle
 apparently uses its own AT magic. at least between Motorola, Sony and
 Huawei they are totally different.

Yes, the lack of a standardized management protocol is one of the NCM
shortcomings which were solved by MBIM (which started out as NCM 2.0).

 personally i have been using mbim since i wrote umbim and it just works :)

Good to hear :-)

 thanks for the insight, lets hope it works after the kernel bump

It should at least allow us to try out a few things on the fly without
having to rebuild the driver.

One thing I forgot to mention is that you can completely disable the
padding in v3.16+ by setting min_tx_pkt = tx_max.  And these
settings can be changed while the modem is actively in use
(i.e. connected).


Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread Conor O'Gorman

On 09/10/14 13:25, John Crispin wrote:


personally i have been using mbim since i wrote umbim and it just works :)



Ah, nice. I have some similar code, but in lua, from the json files. 
It's only a management protocol.


Note that MBIM uses the NCM code for the bulk packet data, so it's 
packetising is still in play.


Conor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread Bjørn Mork
Conor O'Gorman i...@conorogorman.net writes:
 On 09/10/14 13:25, John Crispin wrote:

 personally i have been using mbim since i wrote umbim and it just works :)


 Ah, nice. I have some similar code, but in lua, from the json
 files. It's only a management protocol.

 Note that MBIM uses the NCM code for the bulk packet data, so it's
 packetising is still in play.

Except that bugs in some MBIM implementations forced us to change the
default to always send ZLPs for MBIM devices.  See the comment starting
at 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/usb/cdc_mbim.c#n561

And since the padding is pointless if followed by a ZLP, it was disabled
for all devices where we send ZLPs:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/usb/cdc_ncm.c#n1162

So effectively:  No, we do not do the padding for (most) MBIM devices.

Hmm, except that this was changed sometime between 3.10 and 3.14.  So if
we are talking about 3.10 then we do pad for MBIM too, yes.


Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread John Crispin


On 09/10/2014 15:35, Conor O'Gorman wrote:
 On 09/10/14 13:25, John Crispin wrote:
 
 personally i have been using mbim since i wrote umbim and it
 just works :)
 
 
 Ah, nice. I have some similar code, but in lua, from the json
 files. It's only a management protocol.
 
 Note that MBIM uses the NCM code for the bulk packet data, so it's 
 packetising is still in play.
 
 Conor 

when i worked on umbim i mailed aleksander who made libmim as i am
using his json meta info as input for my header file generator. he
told me about lua based mbim code for owrt flying around but i failed
to find it. now i find it you made it. a small internet after all ...


___
 openwrt-devel mailing list openwrt-devel@lists.openwrt.org 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread John Crispin


On 09/10/2014 14:58, Bjørn Mork wrote:
 John Crispin blo...@openwrt.org writes:
 
 ok, i am currently bumping some targets to v3.17. lets assume it
 is broken for  3.16 and hope 3.17 works.
 
 NCM seems to be broken by design and only a container as each
 dongle apparently uses its own AT magic. at least between
 Motorola, Sony and Huawei they are totally different.
 
 Yes, the lack of a standardized management protocol is one of the
 NCM shortcomings which were solved by MBIM (which started out as
 NCM 2.0).
 
 personally i have been using mbim since i wrote umbim and it just
 works :)
 
 Good to hear :-)
 
 thanks for the insight, lets hope it works after the kernel bump
 
 It should at least allow us to try out a few things on the fly
 without having to rebuild the driver.
 
 One thing I forgot to mention is that you can completely disable
 the padding in v3.16+ by setting min_tx_pkt = tx_max.  And
 these settings can be changed while the modem is actively in use 
 (i.e. connected).
 

ok will try, we should add some uci magic like option padding 0/1

i am currently using a vodafone k5105 which is a huawei rebrand. at
150 euro its very expensive. any other good ones ?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread Bjørn Mork
John Crispin blo...@openwrt.org writes:

 i am currently using a vodafone k5105 which is a huawei rebrand. at
 150 euro its very expensive. any other good ones ?

I find it impossible to recommend any specific modems because important
firmware features like MBIM depend on both operator branding and
geographical target area.  But I can list the MBIM modems I have:

- Huawei E367 with MBIM firmware. I have no idea whether this is
  available anywhere in the world today.  I know most of the E367s were
  QMI only.  That's of course only a firmware issue, but that doesn't
  help much as long as the firmware isn't available.

- D-Link DWM-156 rev A7.  This might be a safer bet on the cheap side.
  I haven't seen any non MBIM variants for that specific revision.  But
  I wouldn't be suprised if they exist either, so the usual warnings
  apply.

The  rest of my MBIM modems are mini-PCIe or m.2, and also very
expensive:

- Ericsson H5321gw (with newer firmware), halfsize mini-PCIe

- Sierra Wireless MC7710 (with newer firmware, depending on cfg),
  fullsize mini-PCIe

- Sierra Wireless EM7345, m.2 (3042)


Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-08 Thread John Crispin
From: Matti Laakso malaa...@elisanet.fi

Signed-off-by: Matti Laakso malaa...@elisanet.fi
---
 package/network/utils/comgt/Makefile  |   15 ++
 package/network/utils/comgt/files/3g.usb  |2 +-
 package/network/utils/comgt/files/ncm.json|   49 +++
 package/network/utils/comgt/files/ncm.sh  |  156 +
 package/network/utils/comgt/files/runcommand.gcom |   26 
 5 files changed, 247 insertions(+), 1 deletion(-)
 create mode 100644 package/network/utils/comgt/files/ncm.json
 create mode 100644 package/network/utils/comgt/files/ncm.sh
 create mode 100644 package/network/utils/comgt/files/runcommand.gcom

diff --git a/package/network/utils/comgt/Makefile 
b/package/network/utils/comgt/Makefile
index 11a1a49..5fccd94 100644
--- a/package/network/utils/comgt/Makefile
+++ b/package/network/utils/comgt/Makefile
@@ -40,6 +40,12 @@ $(call Package/comgt/Default)
   DEPENDS:=+comgt +kmod-usb-serial +kmod-usb-serial-sierrawireless 
+kmod-usb-net +kmod-usb-net-sierrawireless
 endef
 
+define Package/comgt-ncm
+$(call Package/comgt/Default)
+  TITLE+=NCM 3G/4G Support
+  DEPENDS:=+comgt +kmod-usb-serial +kmod-usb-serial-option +kmod-usb-net 
+kmod-usb-net-cdc-ncm +kmod-usb-net-huawei-cdc-ncm
+endef
+
 define Package/comgt/description
  comgt is a scripting language interpreter useful for establishing 
  communications on serial lines and through PCMCIA modems as well as GPRS 
@@ -86,5 +92,14 @@ define Package/comgt-directip/install
$(INSTALL_BIN) ./files/directip.sh $(1)/lib/netifd/proto/directip.sh
 endef
 
+define Package/comgt-ncm/install
+   $(INSTALL_DIR) $(1)/etc/gcom
+   $(INSTALL_DATA) ./files/ncm.json $(1)/etc/gcom/ncm.json
+   $(INSTALL_DATA) ./files/runcommand.gcom $(1)/etc/gcom/runcommand.gcom
+   $(INSTALL_DIR) $(1)/lib/netifd/proto
+   $(INSTALL_BIN) ./files/ncm.sh $(1)/lib/netifd/proto/ncm.sh
+endef
+
 $(eval $(call BuildPackage,comgt))
 $(eval $(call BuildPackage,comgt-directip))
+$(eval $(call BuildPackage,comgt-ncm))
diff --git a/package/network/utils/comgt/files/3g.usb 
b/package/network/utils/comgt/files/3g.usb
index fd6837e..ac8326b 100644
--- a/package/network/utils/comgt/files/3g.usb
+++ b/package/network/utils/comgt/files/3g.usb
@@ -8,7 +8,7 @@ find_3g_iface() {
 
local proto
config_get proto $cfg proto
-   [ $proto = 3g ] || return 0
+   [ $proto = 3g ] || [ $proto = ncm ] || return 0
 
# bypass state vars here because 00-netstate could clobber .device
local dev=$(uci_get network $cfg device)
diff --git a/package/network/utils/comgt/files/ncm.json 
b/package/network/utils/comgt/files/ncm.json
new file mode 100644
index 000..b9b15cd
--- /dev/null
+++ b/package/network/utils/comgt/files/ncm.json
@@ -0,0 +1,49 @@
+{
+   huawei: {
+   initialize: [
+   AT,
+   ATZ,
+   ATQ0,
+   ATV1,
+   ATE1,
+   ATS0=0
+   ],
+   modes: {
+   preferlte: 
AT^SYSCFGEX=\\\030201\\\,3fff,2,4,7fff,,,
+   preferumts: 
AT^SYSCFGEX=\\\0201\\\,3fff,2,4,7fff,,,
+   lte: 
AT^SYSCFGEX=\\\03\\\,3fff,2,4,7fff,,,
+   umts: 
AT^SYSCFGEX=\\\02\\\,3fff,2,4,7fff,,,
+   gsm: 
AT^SYSCFGEX=\\\01\\\,3fff,2,4,7fff,,,
+   auto: 
AT^SYSCFGEX=\\\00\\\,3fff,2,4,7fff,,
+   },
+   connect: 
AT^NDISDUP=1,1,\\\${apn}\\\${username:+,\\\$username\\\}${password:+,\\\$password\\\}${auth:+,$auth},
+   disconnect: AT^NDISDUP=1,0
+   },
+   SAMSUNG: {
+   initialize: [
+   AT,
+   AT+CGREG=2,
+   AT+CFUN=5,
+   AT+MODESELECT=3,
+   AT+CGDCONT=1,\\\IP\\\,\\\${apn}\\\
+   ],
+   modes: {
+   umts: AT+CHANGEALLPATH=1
+   },
+   connect: AT+CGATT=1,
+   disconnect: AT+CGATT=0
+   },
+   Sony: {
+   initialize: [
+   AT+CFUN=1,
+   AT+CGDCONT=1,\\\IP\\\,\\\${apn}\\\,
+   
AT*EIAAUW=1,1,\\\${username}\\\,\\\${password}\\\,${auth:-00111}
+   ],
+   modes: {
+   umts: AT+CFUN=6,
+   gsm: AT+CFUN=5
+   },
+   connect: AT*ENAP=1,1,
+   disconnect: AT*ENAP=0
+   }
+}
diff --git a/package/network/utils/comgt/files/ncm.sh 
b/package/network/utils/comgt/files/ncm.sh
new file mode 100644
index 000..14e421f
--- /dev/null
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -0,0 +1,156 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. ../netifd-proto.sh
+init_proto 

Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-08 Thread Conor O'Gorman



On 08/10/14 11:00, John Crispin wrote:

the e3267 that sami sent me works with this proto, but i am failing to
get a DHCP addr. could someone with a ncm dongle please try this patch
on top of latest trunk please and tell me if they are getting a dhcp addr ?


I had a similar problem with a Huawei device. It worked after removing 
some zero padding in the ncm driver.


In cdc_ncm.c, cdc_ncm_fill_tx_frame(), towards the end there is handling 
for Zero Length Packets (ZLP) and padding short packets. I removed the 
padding, and it worked. Are you testing 3.10 or 3.14? It's changed ever 
so slightly between them.


I am somewhat confused by the comment. It won't pad out short packets, 
but does make shortish packets long.


FYI:
/*
 * If collected data size is less or equal CDC_NCM_MIN_TX_PKT bytes,
 * we send buffers as it is. If we get more data, it would be more
 * efficient for USB HS mobile device with DMA engine to receive a full
 * size NTB, than canceling DMA transfer and receiving a short packet.
 */
if (skb_out-len  CDC_NCM_MIN_TX_PKT)
/* final zero padding */


Conor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-08 Thread John Crispin
hi conor

On 08/10/2014 17:27, Conor O'Gorman wrote:
 
 
 On 08/10/14 11:00, John Crispin wrote:
 the e3267 that sami sent me works with this proto, but i am
 failing to get a DHCP addr. could someone with a ncm dongle
 please try this patch on top of latest trunk please and tell me
 if they are getting a dhcp addr ?
 
 I had a similar problem with a Huawei device. It worked after
 removing some zero padding in the ncm driver.
 
 In cdc_ncm.c, cdc_ncm_fill_tx_frame(), towards the end there is
 handling for Zero Length Packets (ZLP) and padding short packets. I
 removed the padding, and it worked. Are you testing 3.10 or 3.14?
 It's changed ever so slightly between them.
 

3.14, will have a look at it tomorrow.

 I am somewhat confused by the comment. It won't pad out short
 packets, but does make shortish packets long.

sounds weird indeed

John




 
 FYI: /* * If collected data size is less or equal
 CDC_NCM_MIN_TX_PKT bytes, * we send buffers as it is. If we get
 more data, it would be more * efficient for USB HS mobile device
 with DMA engine to receive a full * size NTB, than canceling DMA
 transfer and receiving a short packet. */ if (skb_out-len 
 CDC_NCM_MIN_TX_PKT) /* final zero padding */
 
 
 Conor ___ openwrt-devel
 mailing list openwrt-devel@lists.openwrt.org 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel