From patchwork Mon Dec 19 16:33:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alex.bluesman.smirnov@gmail.com X-Patchwork-Id: 132269 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 246E4B6FE7 for ; Tue, 20 Dec 2011 02:35:09 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753202Ab1LSPfD (ORCPT ); Mon, 19 Dec 2011 10:35:03 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:54585 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752800Ab1LSPe4 (ORCPT ); Mon, 19 Dec 2011 10:34:56 -0500 Received: by mail-ee0-f46.google.com with SMTP id c4so5551520eek.19 for ; Mon, 19 Dec 2011 07:34:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=k+oFvFNqXMj2Xjuma2oRItCeTwgRaLJeRUPlAI5h8uU=; b=abJ1DsTogOPxlJrB21Hz8rz7hDdNp5Pqas5AJ3z9wpL6Nlb3wUk08vdq6Z5uC2ci0H QOsIabbwj7tdH6W3cpMqiqrmgu465ZI3eB1Rbdfe4rYZxTfJ0/LNDg/0EkbZxVoDHxEU PDLA1IuHR9dhaxpfHeHnKuY0osOISUPOTRmhQ= Received: by 10.14.121.196 with SMTP id r44mr4346913eeh.55.1324308895681; Mon, 19 Dec 2011 07:34:55 -0800 (PST) Received: from localhost.localdomain ([91.213.169.4]) by mx.google.com with ESMTPS id j20sm45819212eej.8.2011.12.19.07.34.53 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Dec 2011 07:34:54 -0800 (PST) From: Alexander Smirnov To: davem@davemloft.net Cc: dbaryshkov@gmail.com, linux-zigbee-devel@lists.sourceforge.net, netdev@vger.kernel.org, Alexander Smirnov Subject: [PATCH 05/14] mac802154: define reduced mlme operations Date: Mon, 19 Dec 2011 19:33:45 +0300 Message-Id: <1324312434-13151-5-git-send-email-alex.bluesman.smirnov@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <20111219163117.GA13123@avtobot.cybertron> References: <20111219163117.GA13123@avtobot.cybertron> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org According IEEE 802.15.4 standard each node can be either full functionality device (FFD) or reduce functionality device (RFD). So 2 sets of operations are needed. This patch define RFD operations structure. Signed-off-by: Alexander Smirnov --- include/net/ieee802154_netdev.h | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h index 12a7ee4..f74c5db 100644 --- a/include/net/ieee802154_netdev.h +++ b/include/net/ieee802154_netdev.h @@ -83,6 +83,14 @@ struct wpan_phy; * get_phy should increment the reference counting on returned phy. * Use wpan_wpy_put to put that reference. */ + +/* + * The IEEE 802.15.4 standard defines 2 type of devices: + * - FFD - full functionality device + * - RFD - reduce functionality device + * + * So 2 sets of mlme operations are needed + */ struct ieee802154_mlme_ops { int (*assoc_req)(struct net_device *dev, struct ieee802154_addr *addr, @@ -112,12 +120,20 @@ struct ieee802154_mlme_ops { u8 (*get_bsn)(const struct net_device *dev); }; +struct ieee802154_reduced_mlme_ops { + struct wpan_phy *(*get_phy)(const struct net_device *dev); +}; + static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops( const struct net_device *dev) { return dev->ml_priv; } -#endif - +static inline struct ieee802154_reduced_mlme_ops *ieee802154_reduced_mlme_ops( + const struct net_device *dev) +{ + return dev->ml_priv; +} +#endif