-
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
net: added ng_nomac MAC implementation #2426
Conversation
* @return -EINVAL if creation of thread fails | ||
* @return -ENODEV if *dev* is invalid | ||
*/ | ||
kernel_pid_t nomac_init(char *stack, int stacksize, char priority, |
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.
s/nomac/ng_nomac
739d505
to
cb1f5ca
Compare
rebased |
Hint: don't rebase all the stuff on top of each other. Choose one branch as your starting point and merge the others in one at a time. This way you don't create new commits that will never appear in master creating merge conflicts that will hurt you as soon as the original ones get merged ;-) |
e.g
|
DEBUG("nomac: NG_NETAPI_MSG_TYPE_SND received"); | ||
dev->driver->send_data(dev, (ng_pktsnip_t *)msg.content.ptr); | ||
break; | ||
case NG_NETAPI_MSG_TYPE_SETOPT: |
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.
Are they called that way in netapi
now? if yes, they slipped past my review. For consistency with the other setter/getters of netdev and the wrappers of netapi
it self those should be called NG_NETAPI_MSG_TYPE_SET
and NG_NETAPI_MSG_TYPE_GET
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.
yes, this is what they are named. But I agree that they should be changed, will do.
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.
See #2427
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.
see #2428
hm, someday I will learn this :-) Anyway, put in the registering to netif and fixed the function naming issue. |
adapted NETAPI msg type names... |
Need's rebase + I predict, that you need to port |
I wait with the rebase until the dependencies are merged... |
/* dispatch NETDEV and NETAPI messages */ | ||
switch (msg.type) { | ||
case NG_NETDEV_MSG_TYPE_EVENT: | ||
DEBUG("nomac: NG_NETDEV_MSG_TYPE_EVENT received"); |
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.
missing \n
added missing newlines... |
rephrased some documentation |
Just one question: what do you need |
very good question, I guess I don't. |
#if ENABLE_DEBUG | ||
if (sendto == NULL) { | ||
DEBUG("nomac: unable to forward packet of type %i\n", | ||
pkt->next->type); |
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.
here to s/next->//
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 you have to release the packet here.
Apart from my comments this looks okay. ACK when applied. |
* @return -ENODEV if *dev* is invalid | ||
*/ | ||
kernel_pid_t ng_nomac_init(char *stack, int stacksize, char priority, | ||
const char *name, ng_netdev_t *dev); |
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.
indentation.
rebased and addressed comments. @authmillenon, do you re-ack? |
#if ENABLE_DEBUG | ||
if (sendto == NULL) { | ||
DEBUG("nomac: unable to forward packet of type %i\n", pkt->type); | ||
ng_pktbuf_release(pkt); |
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.
Why only in debug context? Also: return
is missing.
Had still some minor complaints ;-) |
removed the |
I gave the NULL pointer controversy some thought: IF it might come to it, it's relatively easy to patch in afterwards. So ACK, please squash |
@haukepetersen please squash |
did. Let's wait for Travis... |
seems like Travis is a little lazy today... |
added one missing include, maybe this gets Travis going... |
Aaalmost done :D |
\o/ |
net: added ng_nomac MAC implementation
I re-implemented the nomac module using the current network stack APIs and paradigms.
Depends on
netreg: Initial import #2404net/ng_netapi: fixed typo #2424net/ng_netdev: fixed msg type macro name #2425netif: Initial import of ng_* version #2417net/ng_netapi: fixed get/set msg type macro names #2428netdev: unify msg type macro with msg type macros in netapi #2427