netdev: add event handler thread as member of netdev_t#2163
netdev: add event handler thread as member of netdev_t#2163miri64 wants to merge 7 commits intoRIOT-OS:masterfrom
netdev_t#2163Conversation
|
@fnack @thomaseichinger can you port this for your driver implementations? |
|
(if you need a guideline: see #1733) |
888c00d to
f12f60a
Compare
|
kicked travis |
tests/netdev/main.c
Outdated
There was a problem hiding this comment.
Shouldn't this be done earlier in the main sequence? At this point the sender's packet might have been received already, or am I wrong?
There was a problem hiding this comment.
Since the test script starts the receiver first anyways I don't think that this is an issue.
There was a problem hiding this comment.
Okay, I didn't look thoroughly through the script ;)
|
I adapted the cc110x driver implementation (see #2177). |
|
I don't quite understand why this additional function is needed. I think just makes the interface bulkier without any benefit as I don't see any need for changing the event handler PID at after initialization. I would suggest to call a simple |
|
You are completely right, this would simplify a lot :/. Also in that the event handler PID is more a device dependent option than a driver dependent. I'm not quite sure though, if |
|
After digging a little bit through existing driver code (and porting for this change here), I realized, that a context value (to identify the position in the device internal buffer e.g.) for the IPC call by the driver and as argument for the |
Another open implementation detail that remains is: how does the driver identify the device of which event handler it needs to notify. Usually the devices are allocated outside of the context of the driver and the driver thus usually does not have any (hardware interface -> event handler PID)-mapping context available. |
|
(I'm aware that this problem is not solved with this PR either ;-)) |
|
[@haukepetersen we discussed this in RL, but can you give us a pointer to the interrupt argument in the current master/one of your PRs] |
|
About the device/driver interfaces and hw interface -> handler PID mapping: I do not understand the question. |
|
About the argument for the |
@haukepetersen that was exactly what you told me in but can you show me how to do this? |
|
I can try :-) say you have as the device descriptor for an imaginable device. During initialization of your driver you call to initialize your external interrupt line that the radio device pulls low in case new data arrives. In the callback, that is called in the interrupt routine, you do something like Now in the event loop of the MAC thread you receive this message trigger the event call finally the Is this what you meant? |
There was a problem hiding this comment.
This initializer needs to be fixed, too.
|
Seems valid to me. I wasn't tracking this PR after #2163 (comment). |
|
Ping @authmillenon, @haukepetersen . What's the status of this PR? A lot of other PR's seem to rely on this one to be merged. |
|
Okay, I don't like it but I guess I have to accept it. From my point of view, the restructuring of netdev will probably take a lot of time and meanwhile this PR could simplify using the current master branch. |
|
That's up to the reviewers of this and the follow-up PRs ;-) |
|
Closed in favor for #2398 |
To send
NETDEV_MSG_EVENT_TYPEa target PID (event handler) has to be known. This API extension allows to set one.Functionality for existing drivers will follow in separate PRs.