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>
This commit is contained in:
Alexander Aring 2015-06-06 17:30:49 +02:00 committed by Marcel Holtmann
parent f265be3d12
commit bcbfd2078d
1 changed files with 36 additions and 20 deletions

View File

@ -79,32 +79,48 @@ struct ieee802154_hw {
struct wpan_phy *phy; 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 * the stack. Generally, flags here should have their meaning
* done in a way that the simplest hardware doesn't need setting * done in a way that the simplest hardware doesn't need setting
* any particular flags. There are some exceptions to this rule, * any particular flags. There are some exceptions to this rule,
* however, so you are advised to review these flags carefully. * 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.
*/ */
enum ieee802154_hw_flags {
/* Indicates that xmitter will add FCS on it's own. */ IEEE802154_HW_TX_OMIT_CKSUM = BIT(1),
#define IEEE802154_HW_TX_OMIT_CKSUM 0x00000001 IEEE802154_HW_LBT = BIT(2),
/* Indicates that transceiver will support listen before transmit. */ IEEE802154_HW_CSMA_PARAMS = BIT(3),
#define IEEE802154_HW_LBT 0x00000004 IEEE802154_HW_FRAME_RETRIES = BIT(4),
/* Indicates that transceiver will support csma (max_be, min_be, csma retries) IEEE802154_HW_AFILT = BIT(5),
* settings. */ IEEE802154_HW_PROMISCUOUS = BIT(6),
#define IEEE802154_HW_CSMA_PARAMS 0x00000008 IEEE802154_HW_RX_OMIT_CKSUM = BIT(7),
/* Indicates that transceiver will support ARET frame retries setting. */ IEEE802154_HW_RX_DROP_BAD_CKSUM = BIT(8),
#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
/* Indicates that receiver omits FCS and xmitter will add FCS on it's own. */ /* Indicates that receiver omits FCS and xmitter will add FCS on it's own. */
#define IEEE802154_HW_OMIT_CKSUM (IEEE802154_HW_TX_OMIT_CKSUM | \ #define IEEE802154_HW_OMIT_CKSUM (IEEE802154_HW_TX_OMIT_CKSUM | \