From patchwork Sat Nov 18 15:55:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jian-Hong Pan X-Patchwork-Id: 10064897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF80860352 for ; Sat, 18 Nov 2017 17:28:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C198B294B6 for ; Sat, 18 Nov 2017 17:28:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A43A729B36; Sat, 18 Nov 2017 17:28:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52B40294B6 for ; Sat, 18 Nov 2017 17:28:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424344AbdKRR2O (ORCPT ); Sat, 18 Nov 2017 12:28:14 -0500 Received: from msr14.hinet.net ([168.95.4.114]:38923 "EHLO msr14.hinet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424359AbdKRR2M (ORCPT ); Sat, 18 Nov 2017 12:28:12 -0500 X-Greylist: delayed 5551 seconds by postgrey-1.27 at vger.kernel.org; Sat, 18 Nov 2017 12:28:11 EST Received: from StarNight.local (118-165-38-148.dynamic-ip.hinet.net [118.165.38.148]) by msr14.hinet.net (8.14.9/8.14.9) with ESMTP id vAIFtU8u015142; Sat, 18 Nov 2017 23:55:30 +0800 (CST) From: Jian-Hong Pan To: Alexander Aring , Stefan Schmidt , Jonathan Corbet , linux-wpan@vger.kernel.org, linux-doc@vger.kernel.org Cc: Jian-Hong Pan Subject: [PATCH] doc: linux-wpan: Fulfill the description of missed 802.15.4 APIs Date: Sat, 18 Nov 2017 23:55:01 +0800 Message-Id: <20171118155501.14148-1-starnight@g.ncu.edu.tw> X-Mailer: git-send-email 2.15.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFrMTGxVK2VG2K7udwgSiD/hWaFocazC0uNP9jtXhyoJ3R4s7kZSwW C9uWsFjsfzKbzYHNY+esu+weW/qBxOK+yawenzfJeTR9mMEWwBrFmpmXlF+RwJpx9/kD1oLP IhWTTt5kbWD8KtDFyMkhJBAl8WHVfHYQm01AR+LZvs1sXYxcHCICGxglltw8ywKSYBbQkph2 bgGYLSwQKHH07hnWLkYODhYBVYmL5+JAwrwC1hIzDj9hA7ElBOQlFn/fyTaBkWMVo0hucaJu cW6xoa6hXkZmXmqJHhBvYgR6b0U8u/sOxrMnDQ8xMnFwHmIU4GBU4uG9IekdKcSaWFZcmQsS 5z7EKMnBpCTKe2A9f5QQX1J+SmVGYnFGfFFpTmrxIUYJDh4lEd5LYQJRQrzFBYm5xZnpMCkZ Dg4lCd5zICnBotT01Iq0zJyS1CKI9ClGY45pV1ubmDmezXzdwCzEkpeflyolzqsHDG0hAZBJ GaV5cNWwyLjEKCslzLslBKiGpyC1KDezBFX+FaM40A/CvHdBlvJk5pXAnfMK6FImoEu7L/CD XFqSiJACALj0EUrvAQAA Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are more functions and operations which must be used or implemented in each IEEE 802.15.4 device driver, but are not mentioned in the Device drivers API section of Documentation/networking/ieee802154.txt. Therefore, I want to fulfill the missed part into the documentation with this patch. Signed-off-by: Jian-Hong Pan Acked-by: Alexander Aring --- Documentation/networking/ieee802154.txt | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Documentation/networking/ieee802154.txt b/Documentation/networking/ieee802154.txt index 057e9fdbfac9..e74d8e1da0e2 100644 --- a/Documentation/networking/ieee802154.txt +++ b/Documentation/networking/ieee802154.txt @@ -97,6 +97,46 @@ The include/net/mac802154.h defines following functions: - void ieee802154_unregister_hw(struct ieee802154_hw *hw): freeing registered PHY + - void ieee802154_rx_irqsafe(struct ieee802154_hw *hw, struct sk_buff *skb, + u8 lqi): + telling 802.15.4 module there is a new received frame in the skb with + the RF Link Quality Indicator (LQI) from the hardware device + + - void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb, + bool ifs_handling): + telling 802.15.4 module the frame in the skb is or going to be + transmitted through the hardware device + +The device driver must implement the following callbacks in the IEEE 802.15.4 +operations structure at least: +struct ieee802154_ops { + ... + int (*start)(struct ieee802154_hw *hw); + void (*stop)(struct ieee802154_hw *hw); + ... + int (*xmit_async)(struct ieee802154_hw *hw, struct sk_buff *skb); + int (*ed)(struct ieee802154_hw *hw, u8 *level); + int (*set_channel)(struct ieee802154_hw *hw, u8 page, u8 channel); + ... +}; + + - int start(struct ieee802154_hw *hw): + handler that 802.15.4 module calls for the hardware device initialization. + + - void stop(struct ieee802154_hw *hw): + handler that 802.15.4 module calls for the hardware device cleanup. + + - int xmit_async(struct ieee802154_hw *hw, struct sk_buff *skb): + handler that 802.15.4 module calls for each frame in the skb going to be + transmitted through the hardware device. + + - int ed(struct ieee802154_hw *hw, u8 *level): + handler that 802.15.4 module calls for Energy Detection from the hardware + device. + + - int set_channel(struct ieee802154_hw *hw, u8 page, u8 channel): + set radio for listening on specific channel of the hardware device. + Moreover IEEE 802.15.4 device operations structure should be filled. Fake drivers