summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-06-06 17:30:49 +0200
committerMarcel Holtmann <marcel@holtmann.org>2015-06-07 09:13:32 +0200
commitbcbfd2078d9b11277d9c9ce0c30ba73c750503c9 (patch)
tree867229ad6710e34b983ef11e5c75b0c6f18167f4 /include/net
parentf265be3d124a5b62e5a339685b6cfaa0292f1250 (diff)
downloadop-kernel-dev-bcbfd2078d9b11277d9c9ce0c30ba73c750503c9.zip
op-kernel-dev-bcbfd2078d9b11277d9c9ce0c30ba73c750503c9.tar.gz
mac802154: cleanup ieee802154 hardware flags
This patch changes the ieee802154 hardware flags to enums and setting the flag values with the BIT macro. Additional this patch changes the commenting style for matching usual kernel style. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Reviewed-by: Varka Bhadram <varkabhadram@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/mac802154.h56
1 files changed, 36 insertions, 20 deletions
diff --git a/include/net/mac802154.h b/include/net/mac802154.h
index a20ba28..c21a700 100644
--- a/include/net/mac802154.h
+++ b/include/net/mac802154.h
@@ -79,32 +79,48 @@ struct ieee802154_hw {
struct wpan_phy *phy;
};
-/* Checksum is in hardware and is omitted from a packet
+/**
+ * enum ieee802154_hw_flags - hardware flags
*
- * These following flags are used to indicate hardware capabilities to
+ * These flags are used to indicate hardware capabilities to
* the stack. Generally, flags here should have their meaning
* done in a way that the simplest hardware doesn't need setting
* any particular flags. There are some exceptions to this rule,
* however, so you are advised to review these flags carefully.
+ *
+ * @IEEE802154_HW_TX_OMIT_CKSUM: Indicates that xmitter will add FCS on it's
+ * own.
+ *
+ * @IEEE802154_HW_LBT: Indicates that transceiver will support listen before
+ * transmit.
+ *
+ * @IEEE802154_HW_CSMA_PARAMS: Indicates that transceiver will support csma
+ * parameters (max_be, min_be, backoff exponents).
+ *
+ * @IEEE802154_HW_FRAME_RETRIES: Indicates that transceiver will support ARET
+ * frame retries setting.
+ *
+ * @IEEE802154_HW_AFILT: Indicates that transceiver will support hardware
+ * address filter setting.
+ *
+ * @IEEE802154_HW_PROMISCUOUS: Indicates that transceiver will support
+ * promiscuous mode setting.
+ *
+ * @IEEE802154_HW_RX_OMIT_CKSUM: Indicates that receiver omits FCS.
+ *
+ * @IEEE802154_HW_RX_DROP_BAD_CKSUM: Indicates that receiver will not filter
+ * frames with bad checksum.
*/
-
-/* Indicates that xmitter will add FCS on it's own. */
-#define IEEE802154_HW_TX_OMIT_CKSUM 0x00000001
-/* Indicates that transceiver will support listen before transmit. */
-#define IEEE802154_HW_LBT 0x00000004
-/* Indicates that transceiver will support csma (max_be, min_be, csma retries)
- * settings. */
-#define IEEE802154_HW_CSMA_PARAMS 0x00000008
-/* Indicates that transceiver will support ARET frame retries setting. */
-#define IEEE802154_HW_FRAME_RETRIES 0x00000010
-/* Indicates that transceiver will support hardware address filter setting. */
-#define IEEE802154_HW_AFILT 0x00000020
-/* Indicates that transceiver will support promiscuous mode setting. */
-#define IEEE802154_HW_PROMISCUOUS 0x00000040
-/* Indicates that receiver omits FCS. */
-#define IEEE802154_HW_RX_OMIT_CKSUM 0x00000080
-/* Indicates that receiver will not filter frames with bad checksum. */
-#define IEEE802154_HW_RX_DROP_BAD_CKSUM 0x00000100
+enum ieee802154_hw_flags {
+ IEEE802154_HW_TX_OMIT_CKSUM = BIT(1),
+ IEEE802154_HW_LBT = BIT(2),
+ IEEE802154_HW_CSMA_PARAMS = BIT(3),
+ IEEE802154_HW_FRAME_RETRIES = BIT(4),
+ IEEE802154_HW_AFILT = BIT(5),
+ IEEE802154_HW_PROMISCUOUS = BIT(6),
+ IEEE802154_HW_RX_OMIT_CKSUM = BIT(7),
+ IEEE802154_HW_RX_DROP_BAD_CKSUM = BIT(8),
+};
/* Indicates that receiver omits FCS and xmitter will add FCS on it's own. */
#define IEEE802154_HW_OMIT_CKSUM (IEEE802154_HW_TX_OMIT_CKSUM | \
OpenPOWER on IntegriCloud