-
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
at86rf2xx: port to netdev2 #4646
Conversation
3cdc688
to
274318b
Compare
nice! |
30edbf4
to
f8fc6a0
Compare
Great job! |
Please consider miri64#25 to get this into a compiling state. |
Please be aware, that this PR is still WIP! |
b2b5fd3
to
46724d2
Compare
No more WIP and #4678 as additional dependency, but there is an issue: When I send an IEEE 802.15.4 frame from a master-build Here's a dump from the situation: https://www.cloudshark.org/captures/3d0d88044e65.
|
46724d2
to
ca0c25b
Compare
@authmillenon Comparing packet 19 and 21 from your dump, the byte order of the PAN id seems the other way around. |
Ah thanks! Will fix with the redo of the ieee802154 intermediate layer. |
ca0c25b
to
a662561
Compare
Rebased and adapted to current version of #4645. |
} | ||
|
||
void at86rf2xx_set_pan(at86rf2xx_t *dev, uint16_t pan) | ||
{ | ||
dev->pan = pan; | ||
dev->pan = byteorder_htons(pan); |
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.
This is the culprit of my previous reception problems, btw. If I assess the situation correctly the byteorder of the PAN is returned wrong on driver->get
on most devices, it should be in network byte order but is in little-endian (this PR intentionally doesn't fix that, since it is not topic of this PR).
@haukepetersen @jfischer-phytec-iot @jremmert-phytec-iot @thomaseichinger can you assess the situation for kw2xrf and xbee?
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.
isn't 802.15.4 PAN id supposed to be in little endian byte order (i.e. the opposite of "network byte order")?
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 in the MAC header (which is the case here). I was talking about the handing of the option to the upper layers. But your comment solicited me to read the doc again and I was wrong: The PAN is supposed to be handed up in host byte order. I guess I was confused because the ifconfig
config command of my implementation prints it address-like (as in "in network byte order", though it isn't). Will fix this.
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.
Quote 802.15.4-2011 (emphasis mine):
5.2 MAC frame formats
This subclause specifies the format of the MAC frame (MPDU).
The frames in the MAC sublayer are described as a sequence of fields in a specific order. All frame formats in this subclause are depicted in the order in which they are transmitted by the PHY, from left to right, where the leftmost bit is transmitted first in time. Bits within each field are numbered from 0 (leftmost and least significant) to k – 1 (rightmost and most significant), where the length of the field is k bits. Fields that are longer than a single octet are sent to the PHY in the order from the octet containing the lowest numbered bits to the octet containing the highest numbered bits.
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.
Fixed.
@gebart: I know! Again: my comment wasn't about the order in the MAC frame (this was and still is right), but in the RIOT internal representation and storing according to the documentation.
292b1b7
to
e365d66
Compare
Rebased an squashed... Hopefully for the last time :-) |
Nope, the GNRC glue code is still buggy :( |
I provided a fix in #5096. Since the bug is already in master I decided to provide the fix separately. To test please merge it in here. |
4222a17
to
0c1b6ae
Compare
#5096 was merged so I rebased to current master again. |
ping? |
0c1b6ae
to
14c6ba3
Compare
Rebased and adapted to changes from #4862 |
|
||
netdev->driver = &at86rf2xx_driver; |
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.
Couldn't (shouldn't) this be done by the caller?
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.
Hm, maybe not, but this casting back seems strange to me.
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.
But I guess
dev->netdev->netdev->driver = &at86rf2xx_driver;
isn't very pretty, either.
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.
The other netdev2
s are also the setting the driver in the setup and it makes more sense to me. Why expose the driver when it other stuff needs to be set for the device too.
It was your idea to use this kind of inheritance ;P
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.
(and I warned about the implications)
I would say: ready to be squashed and let's have Murdock taking a look then. |
14c6ba3
to
dff0c52
Compare
Squashed. |
I am fine with this PR, Murdock is fine, what about you, @haukepetersen? |
I am good |
so go! |
Yeah! Nice work, @authmillenon! |
+1 it's the beginning of a new era ;) |
finally! :D congrats @authmillenon ;-) |
Thank you all for the review! :-) |
Congratulations! |
Ports at86rf2xx to netdev2
Depends on
#4645(merged) and#4678(closed).