Skip to content
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

mrf24j40: Don't use netdev_ieee802154_t for link layer address #10402

Merged
merged 4 commits into from
Jan 13, 2019

Conversation

bergzand
Copy link
Member

@bergzand bergzand commented Nov 15, 2018

Contribution description

This PR modifies the behaviour of the mrf24j40 driver to not propagate the link layer address to the netdev_ieee802154_t struct. This helps the goal of separating the netdev and the ieee802154_t layer by another bit. The end goal is to remove the short and long address from the netdev_ieee802154_t struct and match the behaviour of the ethernet drivers.

The performance impact of this change should be negligible, the NETOPT_ADDRESS(_LONG) call is only used on initialization and by the ifconfig command.

Testing procedure

Test whether:

  • ifconfig still shows the correct link layer addresses. These should not have changed between this PR and master.
  • ping still works. This to verify that the link layer address is also properly configured in the radio, if the ping echo/reply fails, the address filter of the radio might be configured in the wrong endianness.

Issues/PRs references

related to #10401, part of #7736

@bergzand bergzand added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: drivers Area: Device drivers labels Nov 15, 2018
@bergzand
Copy link
Member Author

The last commit replaces a number of shifts by byteorder.h types. This shaves of 32B of flash usage and should make these operations endianness safe.

@bergzand bergzand added the State: waiting for other PR State: The PR requires another PR to be merged first label Dec 4, 2018
@bergzand
Copy link
Member Author

bergzand commented Dec 4, 2018

blocking until #10537 is merged

@miri64
Copy link
Member

miri64 commented Dec 14, 2018

#10537 got merged into master. Please rebase.

@bergzand bergzand force-pushed the pr/mrf24j40/undedup_address branch from d69115a to 4ea4aae Compare January 12, 2019 16:08
@bergzand
Copy link
Member Author

Rebased!

@bergzand bergzand removed the State: waiting for other PR State: The PR requires another PR to be merged first label Jan 12, 2019
@miri64
Copy link
Member

miri64 commented Jan 12, 2019

@gschorcht can you test this?

miri64
miri64 previously requested changes Jan 12, 2019
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question

#ifdef MODULE_SIXLOWPAN
/* https://tools.ietf.org/html/rfc4944#section-12 requires the first bit to
* 0 for unicast addresses */
dev->netdev.short_addr[0] &= 0x7F;
naddr.u8[0] &= 0xFF7F;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left is uint8_t, right is signed with at least 16-byte defined. Why don't keep it 0x7F as in the original?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

This change modifies the mrf24j40 driver to read the address directly
from the device instead of returning the netdev_ieee802154_t member
@bergzand bergzand force-pushed the pr/mrf24j40/undedup_address branch from 4ea4aae to e29ebc7 Compare January 12, 2019 19:23
@bergzand
Copy link
Member Author

Reworded the first commit message as it mentioned the at86rf2xx driver and not the mrf24j40 driver

@gschorcht
Copy link
Contributor

@gschorcht can you test this?

Of course, I will do it tomorrow.

@miri64 miri64 dismissed their stale review January 12, 2019 19:36

ACK, my comment was addressed and now it only removes the (addressing) dependency from the netdev_ieee802154_t struct.

@miri64 miri64 added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines labels Jan 12, 2019
*(uint64_t*)val = mrf24j40_get_addr_long(dev);
res = sizeof(uint64_t);
}
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this part is different, but it makes sense and is sane ;-)

@gschorcht
Copy link
Contributor

work as expected

@gschorcht gschorcht added the Reviewed: 3-testing The PR was tested according to the maintainer guidelines label Jan 13, 2019
@miri64
Copy link
Member

miri64 commented Jan 13, 2019

@bergzand please squash

@bergzand bergzand force-pushed the pr/mrf24j40/undedup_address branch from e29ebc7 to a6e7882 Compare January 13, 2019 11:03
@bergzand
Copy link
Member Author

squashed!

@miri64 miri64 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 13, 2019
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@miri64 miri64 merged commit 35868a3 into RIOT-OS:master Jan 13, 2019
@aabadie aabadie added this to the Release 2019.01 milestone Jan 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants