[RFC experiment 0/2] Qualcom raw IP mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm probably making too much noise again, but here is some testing
code if anyone wants to have a more meat on the bone.  It is not
meant as a submission of any kind - just for anyone brave enough
to test these things and comment on how it should work.

Using this code and configuring the modem with:

=> QMUX Header:
=>   len:    0x0014
=>   sender: 0x00
=>   svc:    0x00
=>   cid:    0x00

=> QMI Header:
=>   Flags:  0x00
=>   TXN:    0x07
=>   Cmd:    0x0026
=>   Size:   0x0009
=> [0x01] ( 1) 00       .
=> [0x10] ( 2) 02 00    ..

And the driver with

nemi:/tmp# ethtool --set-priv-flags wwan1 raw_ip_mode on
nemi:/tmp# ifconfig wwan1 77.19.196.10 netmask 255.255.255.255 && ip route add 148.122.171.130/32 dev wwan1

results in an odd-looking interface like this:

nemi:/tmp# ifconfig wwan1
wwan1     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:77.19.196.10  P-t-P:77.19.196.10  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:252 (252.0 B)  TX bytes:848 (848.0 B)


Dumping a few ping packets to demonstrate what they look like:

nemi:/tmp# tshark -nxi wwan1
Running as user "root" and group "root". This could be dangerous.
Capturing on wwan1
  0.000000 77.19.196.10 -> 148.122.171.130 ICMP 84 Echo (ping) request  id=0x24c3, seq=1/256, ttl=64

0000  45 00 00 54 00 00 40 00 40 01 e9 8e 4d 13 c4 0a   E..T..@.@...M...
0010  94 7a ab 82 08 00 2c 06 24 c3 00 01 d7 5d 3a 4f   .z....,.$....]:O
0020  00 00 00 00 ce b5 08 00 00 00 00 00 10 11 12 13   ................
0030  14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23   ............ !"#
0040  24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33   $%&'()*+,-./0123
0050  34 35 36 37                                       4567

  0.065590 148.122.171.130 -> 77.19.196.10 ICMP 84 Echo (ping) reply    id=0x24c3, seq=1/256, ttl=56

0000  45 00 00 54 2e 22 00 00 38 01 03 6d 94 7a ab 82   E..T."..8..m.z..
0010  4d 13 c4 0a 00 00 34 06 24 c3 00 01 d7 5d 3a 4f   M.....4.$....]:O
0020  00 00 00 00 ce b5 08 00 00 00 00 00 10 11 12 13   ................
0030  14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23   ............ !"#
0040  24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33   $%&'()*+,-./0123
0050  34 35 36 37                                       4567

  1.001156 77.19.196.10 -> 148.122.171.130 ICMP 84 Echo (ping) request  id=0x24c3, seq=2/512, ttl=64

0000  45 00 00 54 00 00 40 00 40 01 e9 8e 4d 13 c4 0a   E..T..@.@...M...
0010  94 7a ab 82 08 00 ac 00 24 c3 00 02 d8 5d 3a 4f   .z......$....]:O
0020  00 00 00 00 4d ba 08 00 00 00 00 00 10 11 12 13   ....M...........
0030  14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23   ............ !"#
0040  24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33   $%&'()*+,-./0123
0050  34 35 36 37                                       4567

  1.051599 148.122.171.130 -> 77.19.196.10 ICMP 84 Echo (ping) reply    id=0x24c3, seq=2/512, ttl=56

0000  45 00 00 54 2e 23 00 00 38 01 03 6c 94 7a ab 82   E..T.#..8..l.z..
0010  4d 13 c4 0a 00 00 b4 00 24 c3 00 02 d8 5d 3a 4f   M.......$....]:O
0020  00 00 00 00 4d ba 08 00 00 00 00 00 10 11 12 13   ....M...........
0030  14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23   ............ !"#
0040  24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33   $%&'()*+,-./0123
0050  34 35 36 37                                       4567


Note that I added support for a QMI QoS header to this as well, borrowed
from the msm_rmnet driver.  It seems to work in the sense that traffic
still is forwarded and that I can use iptables MARK to set different
values.  But I will probably drop it again until there is some
documentation available.  We need to understand how the device uses this
if we're going to add it.  Setting flow_id to 0 or 1 works fine.  Setting
it to 0xdeadbeef crashes the device....

But if anyone has any pointers to documentation, then I'm more than happy
to keep it in some form.

One final note:  This includes a minor modification to usbnet to avoid
duplicating usbnet_skb_return, as it wasn't prepared for receiving the
headerless packets.  But if that is unacceptable, then we can always
just duplicate the code.


Bjørn Mork (2):
  usbnet: allow mini-drivers to consume L2 headers
  qmi_wwan: support "raw IP" mode

 drivers/net/usb/qmi_wwan.c |  154 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/usb/usbnet.c   |    5 +-
 2 files changed, 158 insertions(+), 1 deletions(-)

-- 
1.7.9

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux