-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: add ethernet over serial driver #4438
Conversation
Cool, that could help to run a 6LBR on the IoT-LAB testbed. |
I also thought that the shell could also be available as a server. This way, the multiplexing would directly use the network stack. It would just needed to set the first ip address automatically and print in on the serial line like as done in contiki examples. |
did not look into your implementation in detail, but shouldn't it be way simpler to just multiplex slip and shell input/output over one UART? |
... which in turn would make it impossible to debug the network stack edit using stdio. |
It would end up being the same but on Layer 3 in principal, which honestly I realized when taking a look at how you did some things in gnrc_slip. But ethos is also netdev based and thus works without gnrc. |
Ah, I missed the non-gnrc part :-) |
tsrb_init(&dev->inbuf, (char*)buf, bufsize); | ||
mutex_init(&dev->out_mutex); | ||
|
||
uint32_t a = genrand_uint32(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already hate the fact, that netdev2_tap
has more or less random MAC addresses, but at least they are somewhat stable as long as you don't rebuild the TAP. Can't you use the CPUID to generate the MAC? It would make debugging and testing with these devices way easier ;-).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also keep in mind that bits 7 (U/L) and 8 (I/G) have special meaning in 48-bit MAC addresses http://standards.ieee.org/develop/regauth/tut/eui.pdf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(address is globally unique if bit 7 is unset [so you need to set it, since you generated it], bit 8 needs to be unset since your address is a unicast address)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally. Will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaspar030 do you have time to address @authmillenon's comment until the Hack'n'Ack session?
fc09427
to
713a369
Compare
Is this too WIP to be an H&A candidate? Arguably it is a new functionality that could be improved later too... right? |
Hey! I was about to ask the same, if I can ACK this PR let me know |
@emmanuelsearch I used this feature several times with great success. I would also vote for getting this merged as soon as @kaspar030 addressed @authmillenon's comments. I couldn't get |
@kYc0o did you already test this? On which hardware/config? |
@cgundogan you used successfully this with SAMR21, I suppose? |
yes, the typical scenario: samr21-xpro running the border router example |
I didn't already test but I plan to do it as soon as possible on IoT-Lab |
|
||
#include <netinet/in.h> | ||
#include <linux/if.h> | ||
#include <linux/if_tun.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mention in the README or somewhere else this is only usable with linux.
interesting - tested with |
713a369
to
665786c
Compare
|
I had some trouble using this on a uclibc-based OpenWrt as host. |
I just realized that ethos doesn't work until I've used the board once using "make term". Probably something is missing in ethos' linux side terminal setup. |
RIOT doesn't answer to pings for addresses that were not the interface the echo request came in. See #4456. |
Confirmed. |
44a5243
to
871add0
Compare
|
Now is also working on my side. I think if travis is happy the PR can be merged |
I'll have to squash first... |
871add0
to
dce8927
Compare
|
dce8927
to
fa15d31
Compare
Travis seem lazy. :) |
fa15d31
to
ecf70f3
Compare
|
63327ee
to
c762a6f
Compare
|
Mr. T. is all green. Anyone cares to say ACK and press merge? |
ACK :) |
drivers: add ethernet over serial driver
I needed a one-cable solution for connecting boards with both network and console. So I came up with this driver, which is essentially l2 SLIP and additional support for multiplexing STDIO over the same serial connection.
It is an alternative to gnrc_slip / tuntap.
Differences:
The last two will probably be fixed.
In order to play with it, see
dist/tools/ethos/README.md
for what to add to your makefiles.