Commit 90386a7e authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

mac802154: separate omit tx/rx flags

This patch splits the IEEE802154_HW_OMIT_CKSUM hardware flag into
IEEE802154_HW_TX_OMIT_CKSUM and IEEE802154_HW_RX_OMIT_CKSUM. This is
useful to deliver the received crc from the driver layer to the monitor
interface. At the moment we can't do that without change the xmit
handling.

The received checksum should be visible in monitor mode only.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 92f45f54
...@@ -73,8 +73,8 @@ struct ieee802154_hw { ...@@ -73,8 +73,8 @@ struct ieee802154_hw {
* however, so you are advised to review these flags carefully. * however, so you are advised to review these flags carefully.
*/ */
/* Indicates that receiver omits FCS and xmitter will add FCS on it's own. */ /* Indicates that xmitter will add FCS on it's own. */
#define IEEE802154_HW_OMIT_CKSUM 0x00000001 #define IEEE802154_HW_TX_OMIT_CKSUM 0x00000001
/* Indicates that receiver will autorespond with ACK frames. */ /* Indicates that receiver will autorespond with ACK frames. */
#define IEEE802154_HW_AACK 0x00000002 #define IEEE802154_HW_AACK 0x00000002
/* Indicates that transceiver will support transmit power setting. */ /* Indicates that transceiver will support transmit power setting. */
...@@ -94,6 +94,12 @@ struct ieee802154_hw { ...@@ -94,6 +94,12 @@ struct ieee802154_hw {
#define IEEE802154_HW_AFILT 0x00000100 #define IEEE802154_HW_AFILT 0x00000100
/* Indicates that transceiver will support promiscuous mode setting. */ /* Indicates that transceiver will support promiscuous mode setting. */
#define IEEE802154_HW_PROMISCUOUS 0x00000200 #define IEEE802154_HW_PROMISCUOUS 0x00000200
/* Indicates that receiver omits FCS. */
#define IEEE802154_HW_RX_OMIT_CKSUM 0x00000400
/* Indicates that receiver omits FCS and xmitter will add FCS on it's own. */
#define IEEE802154_HW_OMIT_CKSUM (IEEE802154_HW_TX_OMIT_CKSUM | \
IEEE802154_HW_RX_OMIT_CKSUM)
/* This groups the most common CSMA support fields into one. */ /* This groups the most common CSMA support fields into one. */
#define IEEE802154_HW_CSMA (IEEE802154_HW_CCA_MODE | \ #define IEEE802154_HW_CSMA (IEEE802154_HW_CCA_MODE | \
......
...@@ -255,7 +255,7 @@ void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb) ...@@ -255,7 +255,7 @@ void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb)
WARN_ON_ONCE(softirq_count() == 0); WARN_ON_ONCE(softirq_count() == 0);
if (!(local->hw.flags & IEEE802154_HW_OMIT_CKSUM)) { if (!(local->hw.flags & IEEE802154_HW_RX_OMIT_CKSUM)) {
u16 crc; u16 crc;
if (skb->len < 2) { if (skb->len < 2) {
......
...@@ -83,7 +83,7 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb) ...@@ -83,7 +83,7 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
int ret; int ret;
if (!(local->hw.flags & IEEE802154_HW_OMIT_CKSUM)) { if (!(local->hw.flags & IEEE802154_HW_TX_OMIT_CKSUM)) {
u16 crc = crc_ccitt(0, skb->data, skb->len); u16 crc = crc_ccitt(0, skb->data, skb->len);
put_unaligned_le16(crc, skb_put(skb, 2)); put_unaligned_le16(crc, skb_put(skb, 2));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment