Skip to content

ieee802154: clean-up (Intra-PAN behavior + broadcast)#5897

Merged
PeterKietzmann merged 5 commits intoRIOT-OS:masterfrom
miri64:ieee802154/enh/cleanup
Oct 4, 2016
Merged

ieee802154: clean-up (Intra-PAN behavior + broadcast)#5897
PeterKietzmann merged 5 commits intoRIOT-OS:masterfrom
miri64:ieee802154/enh/cleanup

Conversation

@miri64
Copy link
Copy Markdown
Member

@miri64 miri64 commented Sep 30, 2016

In #5685 (comment) we realized, that correcting our Intra-PAN behavior would also effect broadcasting behavior due to inconsistent handling of the broadcast/multicast flags from GNRC. This PR fixes that by getting rid of the IEEE802154_BCAST flag and replacing it with the IEEE802154_ADDR_BCAST constant. This way the broadcast address is handled like any other address in ieee802154_set_frame_hdr() since the GNRC glue code now translates the (GNRC-internal) broadcast/multicast flags into the broadcast address, and not that function.

Since this cleanup is tightly bound to the PAN_COMP clean-up (and it would have been more complicated to work around this changes, since I needed to touch that lines anyway) I decided to incorporate #5685 (due to the dropping of the bcast variable that change looks a little different though, so its more of an alternative) and #5759 in here. Hope @aeneby and @cgundogan won't mind ;).

Summary of the changes

  • Removal of the device state flag NETDEV2_IEEE802154_PAN_COMP + change of the header setting behavior for PANs so that it is independent of external state (except the value of the given PAN IDs ;-))
  • Removal of the need for an IEEE802154_BCAST flag. The IEEE 802.15.4 broadcast address is now a global constant and thus can be set outside ieee802154_set_frame_hdr() so that it can be handled like any other destination address.
  • (clean-up of the netdev2_ieee802154 flags)
  • (adaptation of the unittests)

@miri64 miri64 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. labels Sep 30, 2016
@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 Sep 30, 2016
Copy link
Copy Markdown
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

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

Tested this one on boards SAMR21 and REMOTE-REVB, works but ACK_REQ is on for broadcast.

buf[1] |= IEEE802154_FCF_DST_ADDR_VOID;
break;
case 2:
if (memcmp(dst, ieee802154_addr_bcast,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be if(!memcmp(...)) ..., currently this PR introduces ACKs for broadcasts, which is unwise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Me everytime with these kind of functions ^^"...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed

/**
* @brief Static initializer for broadcast address
*/
#define IEEE802154_ADDR_BCAST { 0xff, 0xff }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rename to IEEE802154_BCAST_ADDR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why? This group defines special IEEE 802.15.4 addresses (IEEE802154_ADDR). So if other special addresses are later added this would look as unified IMHO.:

#define IEEE802154_BCAST_ADDR   { 0xff, 0xff }
#define IEEE802154_FOO_ADDR      ....
#define IEEE802154_BAR_ADDR      ....

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

mhm, this is a matter of taste --and grouping things.

I was thinking IEEE802154_BCAST_ADDR and IEEE802154_BCAST_ADDR_LEN together, so its an broadcast address which has address length (not broadcast length).

But, what matters most is that we get this PR/ fix through, and I don't want to start a naming discussion - such issues are all over the place, if we would look deep enough 😬

* @brief Length in byte of @ref IEEE802154_ADDR_BCAST
*/
#define IEEE802154_BCAST (0x80)
#define IEEE802154_ADDR_BCAST_LEN (IEEE802154_SHORT_ADDRESS_LEN)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rename to IEEE802154_BCAST_ADDR_LEN

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@aeneby
Copy link
Copy Markdown
Member

aeneby commented Sep 30, 2016

Hope @aeneby and @cgundogan won't mind ;).

No, I don't mind. Actually I haven't had much time to work on this so thanks @miri64 for taking the reins.

I still think that the PAN_COMP flag should be getting set before the call to ieee802154_set_frame_hdr() (i.e. in gnrc_netdev2->send()), but it seems that there is still some work to do before this is possible anyway. Perhaps we can re-visit this later. I'm very glad to see NETDEV2_IEEE802154_PAN_COMP disappearing as a device state flag though 👍

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 30, 2016

I still think that the PAN_COMP flag should be getting set before the call to ieee802154_set_frame_hdr() (i.e. in gnrc_netdev2->send()), but it seems that there is still some work to do before this is possible anyway. Perhaps we can re-visit this later. I'm very glad to see NETDEV2_IEEE802154_PAN_COMP disappearing as a device state flag though 👍

That's the thing I don't understand: set where? There is no flag for this in ieee802154_set_frame_hdr() defined anymore. It's purely dependent on the configuration of the input PANs, as you originally intended.

Copy link
Copy Markdown
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

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

you don't like my shorter version using !memcmp(), however: ACK.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 30, 2016

you don't like my shorter version using !memcmp(), however: ACK.

Because it is misleading. The return value of memcmp() is not a boolean value, so using a boolean operation is just lazy coding in my opinion ;-).

@miri64 miri64 force-pushed the ieee802154/enh/cleanup branch from d9b8648 to ed34390 Compare September 30, 2016 12:57
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 30, 2016

Squashed.

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 30, 2016
@aeneby
Copy link
Copy Markdown
Member

aeneby commented Sep 30, 2016

That's the thing I don't understand: set where? There is no flag for this in ieee802154_set_frame_hdr() defined anymore. It's purely dependent on the configuration of the input PANs, as you originally intended.

Okay. But if this is the case then I guess the API documentation for the flags parameter needs updating.

* do ignore @p dst and @p dst_len and just set `ff:ff`
* (broadcast) as destination address
* @ref IEEE802154_FCF_FRAME_PEND, and
* @ref IEEE802154_FCF_ACK_REQ.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's the thing I don't understand: set where? There is no flag for this in ieee802154_set_frame_hdr() defined anymore. It's purely dependent on the configuration of the input PANs, as you originally intended.

Okay. But if this is the case then I guess the API documentation for the flags parameter needs updating.

@aeneby Already ahead of you ;-)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yikes - missed that. Sorry for the noise.

@PeterKietzmann
Copy link
Copy Markdown
Member

ACK, finally :-)! Unfortunately Murdock fails for qemu-i386 builds.

@PeterKietzmann PeterKietzmann added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 4, 2016
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Oct 4, 2016

Mh yeah... The file was provided by @Kijewski, however non of the people with access to the server sprang into action yet :-/.

@PeterKietzmann
Copy link
Copy Markdown
Member

Ah, that story :/ ... How do we proceed, wait until someone found that file? I assume all builds are failing now.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Oct 4, 2016

We have two solution:

  1. the file "was found" (actually @Kijewski just rebuild) so we could upload it to downloads.riot-os.org's new home.
  2. cu is reachable again, so we can move the URL back to that location.

Sadly, the people that could do either of those seem to be MIA.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Oct 4, 2016

Alternatively for this PR we can just say that qemu-i586 is definitely not effected by this PR (because it isn't) and just merge if everything else is alright, but since I'm the author I don't want to make that call ;-).

@PeterKietzmann
Copy link
Copy Markdown
Member

I scanned Murdocks output to verify it's just qemu that fails. Let's wait until early afternoon if someone is able to fix the missing file. Otherwise I'll merge as is.

@PeterKietzmann
Copy link
Copy Markdown
Member

Ok let's do this. ACK (again) and go.

@PeterKietzmann PeterKietzmann merged commit 359f3b5 into RIOT-OS:master Oct 4, 2016
@miri64 miri64 deleted the ieee802154/enh/cleanup branch October 4, 2016 12:15
@OlegHahm OlegHahm added this to the Release 2016.10 milestone Oct 13, 2016
@PeterKietzmann PeterKietzmann mentioned this pull request Nov 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants