Re: MC 7304 ipv4v6



Bjørn Mork <bjorn mork no> writes:

But I believe I implemented it the last time this was discussed.  I'll
see if I can dig up the old code for a demo.  Not going to rush this
anyway.  I'd like everyone to be happy with the result.  And it's going
to be immutable once it's in.

git is a wonderful tool.  Nothing is ever lost :)

I found my example code in an old v3.2 based branch, and turned it into
a demo on the bus to job.  Note that this requires a minor change to
usbnet.c as well, to prevent it from doing eth_type_trans() on the rx
skbs we pass on to it.  Therefore two, eh.. three, patches.

Warning: Trying the qmi_wwan raw-ip feature without the usbnet patch is
a sure path to an oops.


Works for me(tm).  Only tested on an E392 for now:


nemi:/tmp# ifconfig wwan1
wwan1     Link encap:Ethernet  HWaddr 92:b9:2a:c0:4f:96  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
nemi:/tmp# cat /sys/class/net/wwan1/qmi/raw_ip 
N
nemi:/tmp# echo 1 >/sys/class/net/wwan1/qmi/raw_ip
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  
          POINTOPOINT NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

nemi:/tmp# cat /sys/class/net/wwan1/qmi/raw_ip 
Y

bjorn nemi:~$ qmicli -d /dev/cdc-wdm1  --device-open-net='net-raw-ip|net-no-qos-header' 
--wds-start-network=apn=telenor --wds-follow-network
[/dev/cdc-wdm1] Network started
        Packet data handle: '34967784'

Ctrl+C will stop the network
[/dev/cdc-wdm1] Connection status: 'connected'

bjorn nemi:~$ qmicli -d /dev/cdc-wdm1  --client-cid=1 --client-no-release-cid --wds-get-current-settings
[/dev/cdc-wdm1] Current settings retrieved:
           IP Family: IPv4
        IPv4 address: 46.157.38.113
    IPv4 subnet mask: 255.255.255.252
IPv4 gateway address: 46.157.38.114
    IPv4 primary DNS: 193.213.112.4
  IPv4 secondary DNS: 130.67.15.198
                 MTU: 1500
             Domains: none
[/dev/cdc-wdm1] Client ID not released:
        Service: 'wds'
            CID: '1'


nemi:/tmp# ifconfig wwan1 46.157.38.113
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:46.157.38.113  P-t-P:46.157.38.113  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

nemi:/tmp# ip route add 148.122.171.130 dev wwan1
nemi:/tmp# ping -c3 148.122.171.130
PING 148.122.171.130 (148.122.171.130) 56(84) bytes of data.
64 bytes from 148.122.171.130: icmp_seq=1 ttl=58 time=156 ms
64 bytes from 148.122.171.130: icmp_seq=2 ttl=58 time=24.5 ms
64 bytes from 148.122.171.130: icmp_seq=3 ttl=58 time=27.5 ms

--- 148.122.171.130 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 24.568/69.492/156.345/61.426 ms


nemi:/tmp# tshark -nxxi wwan1
tshark: Lua: Error during loading:
 [string "/usr/share/wireshark/init.lua"]:46: dofile has been disabled due to running Wireshark as superuser. 
See http://wiki.wireshark.org/CaptureSetup/CapturePrivileges for help in running Wireshark as an unprivileged 
user.
Running as user "root" and group "root". This could be dangerous.
Capturing on 'wwan1'
0000  45 00 00 54 75 99 40 00 40 01 30 05 2e 9d 26 71   E  Tu   @.0...&q
0010  94 7a ab 82 08 00 4d e4 6e c0 00 01 6e 77 55 56   .z....M.n...nwUV
0020  00 00 00 00 ad b9 0b 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

0000  45 04 00 54 01 98 00 00 3a 01 ea 02 94 7a ab 82   E..T....:....z..
0010  2e 9d 26 71 00 00 55 e4 6e c0 00 01 6e 77 55 56   ..&q..U.n...nwUV
0020  00 00 00 00 ad b9 0b 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

0000  45 00 00 54 76 2f 40 00 40 01 2f 6f 2e 9d 26 71   E..Tv/@   /o..&q
0010  94 7a ab 82 08 00 73 dc 6e c0 00 02 6f 77 55 56   .z....s.n...owUV
0020  00 00 00 00 86 c0 0b 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

0000  45 04 00 54 01 f6 00 00 3a 01 e9 a4 94 7a ab 82   E..T....:....z..
0010  2e 9d 26 71 00 00 7b dc 6e c0 00 02 6f 77 55 56   ..&q..{.n...owUV
0020  00 00 00 00 86 c0 0b 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

0000  45 00 00 54 76 7f 40 00 40 01 2f 1f 2e 9d 26 71   E  Tv   @./...&q
0010  94 7a ab 82 08 00 b7 d8 6e c0 00 03 70 77 55 56   .z......n...pwUV
0020  00 00 00 00 41 c3 0b 00 00 00 00 00 10 11 12 13   ....A...........
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

0000  45 04 00 54 02 bb 00 00 3a 01 e8 df 94 7a ab 82   E..T....:....z..
0010  2e 9d 26 71 00 00 bf d8 6e c0 00 03 70 77 55 56   ..&q....n...pwUV
0020  00 00 00 00 41 c3 0b 00 00 00 00 00 10 11 12 13   ....A...........
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


Judgement time coming up :)  What do you think?  Yes, this might not be
the correct forum for kernel patches, but I believe it is where this has
any meaning.  The load is on userspace here, and there is absolutely no
reason to submit this to the kernel unless it is going to be used by
NM/MM.



Bjørn

Attachment: 0001-usbnet-allow-mini-drivers-to-consume-L2-headers.patch
Description: Text Data

Attachment: 0002-net-qmi_wwan-support-raw-IP-mode.patch
Description: Text Data

Attachment: 0003-net-qmi_wwan-document-the-qmi-raw_ip-sysfs-file.patch
Description: Text Data



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