sys: add improved network device API#3210
Conversation
|
Can we just call it |
|
@authmillenon of course, that's the plan. I went for netdev2 because I didn't want the name clash while developing. Also ng_* seems gnrc_* related to me... |
sys/include/net/netdev_events.h
Outdated
There was a problem hiding this comment.
Why is this a file on its own?
There was a problem hiding this comment.
the old ng_netdev has the same events. I didn't want to copy them as long as both interfaces exist.
2dc75cb to
3706aa0
Compare
349f5d1 to
eeff25b
Compare
|
|
Is there a reason not to put this into |
|
Is there a reason not to put this into `drivers/include`?
no.
|
|
Apart from the location of the file, I'm fine with the proposal. |
d88418c to
83eb1e2
Compare
There was a problem hiding this comment.
Shouldn't this return an iovec too?
There was a problem hiding this comment.
(as an out parameter) That would make the receive function you are having such problems with in #3683 much easier, because you don't need to copy twice.
There was a problem hiding this comment.
Why? The driver has the whole packet available at the time recv is called.
There was a problem hiding this comment.
Nvm, I did not read on the behavior of the return value.
|
I think it would make sense to add |
|
I would go with get/set here. IMO this has two advantages: 1. it keeps the interface slim and 2. it can be used more fine-grained, e.g. if the transceiver device supports multiple sleep modes. |
|
|
Is this really still WIP? |
|
Btw. I think you can squash. ACK |
|
Regarding on/off in the interface, I'd say, let's go with set/get first. If it turns out to be a performance problem, we can easily extend the interface. |
drivers/include/net/netdev2.h
Outdated
There was a problem hiding this comment.
net otherwise you are adding it to itself.
There was a problem hiding this comment.
Shouldn't it be rather @ingroup drivers?
There was a problem hiding this comment.
Right. Sorry about that. But then the group should also be called drivers_netdev2.
|
-force-push-amended doxygen group fix |
drivers/include/net/netdev2.h
Outdated
There was a problem hiding this comment.
Doxygen is complaining about this line, but technically its already documented in l81-86. Merge anyway?
There was a problem hiding this comment.
I'm not in favour of introducing more doxygen warnings.
There was a problem hiding this comment.
And I know @kaspar030 is gonna hate me for this comment.
|
double green! |
sys: add improved network device API
|
\o/ |
|
Yeah! Thanks for reviewing! |
@haukepetersen and I tried to find a generally usable but maximally minimized "network device interface".
This is our work in progress. Please comment.