On 24/02/12 13:02, Prajosh Premdas wrote: > From: Felix Varghese <felixvarg...@gmail.com> > > Added function prototypes, structure definitions and netlink attributes for > supporting PIB get/set functionality
First, why do you need PIB functionality? Except standard conformance, of course. Second, union containing all possible value types is ugly. Don't do that. Third, PIB is a PHY level functionality. Even if you need the PIB access directly (I don't believe that having direct PIB access from external code is a Good Thing (tm).), it does not belong to MLME interface (or nl-mac.c file). >From my point of view, PIB interfaces serves its role as an intermediate interface between hardware and MAC layer. We don't have this boundary. Access to channel/page/etc. are handled in other ways. So I see no point in PIB interface per se. > Signed-off-by: Felix Varghese <felixvarg...@gmail.com> > Signed-off-by: Prajosh Premdas <premdas.praj...@gmail.com> > --- > include/linux/nl802154.h | 3 +++ > include/net/ieee802154_netdev.h | 19 +++++++++++++++++++ > include/net/nl802154.h | 23 +++++++++++++++++++++++ > 3 files changed, 45 insertions(+), 0 deletions(-) > > diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h > index 69fe03a..94ec8af 100644 > --- a/include/linux/nl802154.h > +++ b/include/linux/nl802154.h > @@ -71,6 +71,9 @@ enum { > IEEE802154_ATTR_DEV_TYPE, > > IEEE802154_ATTR_SET_DEFAULT_PIB, > + IEEE802154_ATTR_PIB_ATTRIBUTE, > + IEEE802154_ATTR_PIB_VALUE, > + IEEE802154_ATTR_PIB_SIZE, > > __IEEE802154_ATTR_MAX, > }; > diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h > index 25cb045..183b384 100644 > --- a/include/net/ieee802154_netdev.h > +++ b/include/net/ieee802154_netdev.h > @@ -27,6 +27,21 @@ > #define IEEE802154_NETDEVICE_H > > #include <net/af_ieee802154.h> > +#include <net/ieee802154.h> > + > +/* PIB attribute value type */ > +union pib_value_t { > + /* PIB attribute 8-bit */ > + u8 pib_value_8bit; > + /* PIB attribute 16-bit */ > + u8 pib_value_16bit; > + /* PIB attribute 32-bit */ > + u8 pib_value_32bit; > + /* PIB attribute 64-bit */ > + u8 pib_value_64bit; > + /* PIB attribute array */ > + u8 pib_array[aMaxBeaconPayloadLength]; > +}; > > /* > * A control block of skb passed between the ARPHRD_IEEE802154 device > @@ -94,6 +109,10 @@ struct wpan_phy; > struct ieee802154_mlme_ops { > int (*reset_req)(struct net_device *dev, > u8 SetDefaultPIB); > + int (*get_req)(struct net_device *dev, > + u8 PIBattr); > + int (*set_req)(struct net_device *dev, > + u8 PIBattr, void *PIBval); > int (*assoc_req)(struct net_device *dev, > struct ieee802154_addr *addr, > u8 channel, u8 page, u8 cap); > diff --git a/include/net/nl802154.h b/include/net/nl802154.h > index 23c2302..c3bec60 100644 > --- a/include/net/nl802154.h > +++ b/include/net/nl802154.h > @@ -132,4 +132,27 @@ int ieee802154_nl_start_confirm(struct net_device *dev, > u8 status); > */ > int ieee802154_reset_confirm(struct net_device *dev, u8 status); > > +/** > + * ieee802154_nl_get_confirm - Notify userland of completion of get confirm. > + * @dev: The device which was instructed the get operation. > + * @PIBattr: > + * @PIBval: > + * @size: > + * > + * Note: This is in section xxxxx of the IEEE 802.15.4 document. > + */ > +int ieee802154_nl_get_confirm(struct net_device *dev, u8 PIBattr, > + void *PIBval, int size); > + > +/** > + * ieee802154_nl_set_confirm - Notify userland of completion of set confirm. > + * @dev: The device which was instructed the set operation. > + * @PIBattr: > + * @status: > + * > + * Note: This is in section xxxxx of the IEEE 802.15.4 document. > + */ > +int ieee802154_nl_set_confirm(struct net_device *dev, u8 PIBattr, > + int status); > + > #endif ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel