Skip to contentSkip to conversation

Debug message API names for WPAN

DISCUSSION Varka Bhadram 2 participants 2 messages Oct 16, 2014 – Oct 17, 2014 IEEE 802.15.4

lore
Share & tools
lore
#0 lore raw

Hi,

I am planning to implement the debug message API's for WPAN.

I thought of using the name started with wpan_*. ex: wpan_info(),wpan_dbg()..

Is this API name is OK....?

In which header file i can add these '#define's.. ieee802154.h or mac802154.h..?

If these things are confirmed patches are on the way.

Signature · 2 lines
Thanks and Regards,
Varka Bhadram.
maintainer
#1 lore raw

Hi Varka,

Quoted 4 lines · Varka Bhadram

Hi,

I am planning to implement the debug message API's for WPAN.

ok.

Quoted 4 lines

I thought of using the name started with wpan_*. ex: wpan_info(),wpan_dbg()..

Is this API name is OK....?

For what is the API for?

Such function are good for debugging device specific things. People knows then about to which interface or phy the printout (dbg/error/warning, etc..) belongs to. Instead to doing pr_debug("%s: ... ", wpan_phy_name(phy), ...); Simple we should call then wpan_phy_info(phy, "...");

Now for interface we should use netdev_dbg, etc... functions, because these interfaces belongs a netdev device and netdev_foo macros are already exist.

For phy debugging macros we should introduce such function, because we create the wpan_phy struct in "include/net/wpan-phy.h". It's a own new device class.

These names for these functions should be wpan_phy_info(wpan_phy). The wpan_phy struct contains a "struct device dev" then you should call the generic device prinout functions like dev_info, etc...

Quoted 2 lines

In which header file i can add these '#define's.. ieee802154.h or mac802154.h..?

The ieee802154 header should contain ONLY things which comes from IEEE 802.15.4 standard. Put it in "include/net/wpan-phy.h".

But introduce such function only for phy handling not interface handling, use then netdev_foo.

What I don't will ack are such things like:

#define wpan_info(...) pr_info(...)

this makes really no sense.

Quoted 2 lines

If these things are confirmed patches are on the way.

ok.

- Alex