Skip to content

auto_init: Initialize link-layer addresses from CPU ID#837

Merged
OlegHahm merged 2 commits intoRIOT-OS:masterfrom
miri64:auto-init-addresses
Sep 30, 2014
Merged

auto_init: Initialize link-layer addresses from CPU ID#837
OlegHahm merged 2 commits intoRIOT-OS:masterfrom
miri64:auto-init-addresses

Conversation

@miri64
Copy link
Copy Markdown
Member

@miri64 miri64 commented Mar 3, 2014

Maybe not the neatest idea, but as long as it stirs up some discussion it's fine.

Depends on #854

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.

I don't think this should go into auto_init itself.

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 was what I meant with "not the neatest idea". ;-)

@LudwigKnuepfer
Copy link
Copy Markdown
Member

Can you describe which layers addresses should be initialized and what the intended use is?

@kaspar030
Copy link
Copy Markdown
Contributor

(PR missing tag)

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 4, 2014

@LudwigOrtmann updated.

@LudwigKnuepfer
Copy link
Copy Markdown
Member

OK, this is much better. Are there any formal requirements for the seed?

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 4, 2014

Which seed?

@LudwigKnuepfer
Copy link
Copy Markdown
Member

The "seed" used to initialize the address - i.e. the second argument to net_if_set_eui64.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 4, 2014

It needs to be at least 8 byte long.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 6, 2014

Rebased to new version of #854

@LudwigKnuepfer
Copy link
Copy Markdown
Member

@authmillenon needs rebase

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented May 13, 2014

Rebased to authmillenon:cpu-id

@OlegHahm OlegHahm added this to the Release NEXT MAJOR milestone May 16, 2014
@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Jun 3, 2014

Needs rebase again.

@OlegHahm OlegHahm modified the milestones: FIX ME FIRST, Release NEXT MAJOR Jun 3, 2014
@OlegHahm
Copy link
Copy Markdown
Member

@authmillenon, ping.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jun 23, 2014

Done

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.

Why char? Wouldn't at fixed length data type make more sense? Why not simply typedef uint16_t cpu_id_t?

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.

Wrong PR?

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.

Yes, but true anyway. ;)

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.

The cpu_id_t can be longer (64 bit for iot-lab_M3 e.g.) CPU_ID_LEN == 2U is just the default, if the board cpu does not define anything.

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.

(But I will do s/char/uint8_t/, there you were right.)

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jun 24, 2014

Addressed comments

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jul 31, 2014

Rebased to master

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.

I think the time has come to refactor this part of auto_init into a dedicated function. (In a prior commit.)

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.

which part exactly?

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.

I'd opt for the complete net_if code.

@LudwigKnuepfer
Copy link
Copy Markdown
Member

It's kaput =(

tests/coap:

/home/lo/native/RIOT/sys/auto_init/auto_init.c: In function ‘auto_init’:
/home/lo/native/RIOT/sys/auto_init/auto_init.c:151:9: warning: implicit declaration of function ‘cpuid_get’ [-Wimplicit-function-declaration]
         cpuid_get(cpuid);

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.

why printf here?

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.

Because it's inside a DEBUG_ENABLED ifdef anyways

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.

but there's DEBUG in there as well..

@LudwigKnuepfer
Copy link
Copy Markdown
Member

I'm not sure if it would be cleaner to move the init function into its own file in the net_if module.. I think it would look cleaner and one could use it without also using auto_init.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 9, 2014

I think not. All this function does is initializing the module net_if_init(); (what is also the case for all other modules in auto_init) and setting some values a user normally does not want to be bothered with (channel, radio address, long address and PAN ID). It just goes through the cases, if a CPU ID is given or not. This is auto-initialization, it's just that a network interface has a whole lot more to do, than a "normal" module. All in all, if you want the functionality of this function, you normally want auto_init, but if you do not want auto_init, then you normally do not want the functionality of this function. Optimally these values are given by the hardware itself, but apparently they are not.

@LudwigKnuepfer
Copy link
Copy Markdown
Member

What about the separation of concerns (cleanliness)?

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 9, 2014

This functionality will look ugly in either way. As far as I'm concerned this initialization shouldn't even be net_if's task, but the of the network device driver since they obviously know best, what there addresses, channels etc look like.

@LudwigKnuepfer
Copy link
Copy Markdown
Member

OK

@LudwigKnuepfer
Copy link
Copy Markdown
Member

Is this ready from your point of view?

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 28, 2014

Yes

@LudwigKnuepfer
Copy link
Copy Markdown
Member

OK, I'll restart Travis for master compatibility checking.

@OlegHahm
Copy link
Copy Markdown
Member

Restarted again.

@OlegHahm
Copy link
Copy Markdown
Member

Needs blacklisting.

@OlegHahm
Copy link
Copy Markdown
Member

@authmillenon, can you add the necessary blacklistings? I think otherwise this should be ready to merge.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 30, 2014

This is not an application. How/what should I blacklist?

@OlegHahm
Copy link
Copy Markdown
Member

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 30, 2014

I think I better check why next to every application is not compiling for Arduino Mega, before I remove support for this board ;-)

@miri64 miri64 force-pushed the auto-init-addresses branch from e8fa71f to a5a7008 Compare September 30, 2014 12:32
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 30, 2014

Rebased => There I fixed it ;-)

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.

Huh?

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.

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.

Ah, missed that.

@OlegHahm
Copy link
Copy Markdown
Member

If Travis is fine, I am fine, too. You can call this an ACK.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 30, 2014

Kicked travis

@OlegHahm OlegHahm assigned OlegHahm and unassigned emmanuelsearch Sep 30, 2014
@OlegHahm
Copy link
Copy Markdown
Member

and again.

@OlegHahm
Copy link
Copy Markdown
Member

\o/ - and go.

OlegHahm added a commit that referenced this pull request Sep 30, 2014
auto_init: Initialize link-layer addresses from CPU ID
@OlegHahm OlegHahm merged commit be1fde1 into RIOT-OS:master Sep 30, 2014
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 30, 2014

Finally

@miri64 miri64 deleted the auto-init-addresses branch October 1, 2014 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking 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.

5 participants