From patchwork Sat Dec 2 18:51:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17176 X-Patchwork-Delegate: sven@narfation.org Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 7EAF28149A; Sat, 2 Dec 2017 19:53:31 +0100 (CET) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="f68n3Iii"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id DCD63803DB for ; Sat, 2 Dec 2017 19:52:52 +0100 (CET) Received: from sven-desktop.home.narfation.org (p200300C593DF83F90000000000004065.dip0.t-ipconnect.de [IPv6:2003:c5:93df:83f9::4065]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id C3AC9110116; Sat, 2 Dec 2017 19:52:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1512240772; bh=Wr9VwaR+lopNA8ypDSHOQnKt3AoVMVe3WgRLJR1wess=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f68n3Iiieiu9weGHH+b6K4s+dCnY+yEtTDrjmbjPQjhboAf2Xgf8lwv96El1aGUm2 zFbZbnqL8GX+7ycb3qkepvYQXqDS7HpvZIwUKavkMsskbozRfSYccJj1qAn58v5olO /mD/sKTa6Hb780qGyYzp1R+9tVd73yRAeMPipEv8= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 2 Dec 2017 19:51:50 +0100 Message-Id: <20171202185153.552-6-sven@narfation.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171202185153.552-1-sven@narfation.org> References: <20171202185153.552-1-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH 5/8] batman-adv: Add kernel-doc to structs in headers X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" All structs in types.h are already documented. But some other headers still have private structs which also should be documented. Signed-off-by: Sven Eckelmann --- net/batman-adv/hash.h | 14 +++++++++++--- net/batman-adv/sysfs.h | 13 +++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/net/batman-adv/hash.h b/net/batman-adv/hash.h index 1aabe40b..accac5c2 100644 --- a/net/batman-adv/hash.h +++ b/net/batman-adv/hash.h @@ -45,10 +45,18 @@ typedef bool (*batadv_hashdata_compare_cb)(const struct hlist_node *, typedef u32 (*batadv_hashdata_choose_cb)(const void *, u32); typedef void (*batadv_hashdata_free_cb)(struct hlist_node *, void *); +/** + * struct batadv_hashtable - Wrapper of simple hlist based hashtable + */ struct batadv_hashtable { - struct hlist_head *table; /* the hashtable itself with the buckets */ - spinlock_t *list_locks; /* spinlock for each hash list entry */ - u32 size; /* size of hashtable */ + /** @table: the hashtable itself with the buckets */ + struct hlist_head *table; + + /** @list_locks: spinlock for each hash list entry */ + spinlock_t *list_locks; + + /** @size: size of hashtable */ + u32 size; }; /* allocates and clears the hash */ diff --git a/net/batman-adv/sysfs.h b/net/batman-adv/sysfs.h index e487412e..8fe65c9b 100644 --- a/net/batman-adv/sysfs.h +++ b/net/batman-adv/sysfs.h @@ -35,10 +35,23 @@ struct net_device; */ #define BATADV_SYSFS_VLAN_SUBDIR_PREFIX "vlan" +/** + * struct batadv_attribute - sysfs export helper for batman-adv attributes + */ struct batadv_attribute { + /** @attr: sysfs attribute file */ struct attribute attr; + + /** + * @show: function to export the current attribute's content to sysfs + */ ssize_t (*show)(struct kobject *kobj, struct attribute *attr, char *buf); + + /** + * @store: function to load new value from character buffer and save it + * in batman-adv attribute + */ ssize_t (*store)(struct kobject *kobj, struct attribute *attr, char *buf, size_t count); };