Skip to content

Commit

Permalink
mt7603: work around a compiler issue on accessing 802.11 header fields
Browse files Browse the repository at this point in the history
For some reason the FIELD_GET call runs into a BUILD_BUG_ON on some
platforms when using the 802.11 frame type/subtype definitions.

Use mask and shift explicitly to work around this

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Dec 15, 2016
1 parent a39d4b7 commit 7ce4368
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mt7603_mac.c
Expand Up @@ -612,6 +612,7 @@ mt7603_mac_write_txwi(struct mt7603_dev *dev, __le32 *txwi,
int hdr_len = ieee80211_get_hdrlen_from_skb(skb);
int tx_count = 8;
u8 frame_type, frame_subtype;
u16 fc = le16_to_cpu(hdr->frame_control);
u8 bw;

if (sta) {
Expand All @@ -624,10 +625,8 @@ mt7603_mac_write_txwi(struct mt7603_dev *dev, __le32 *txwi,
else
wlan_idx = MT7603_WTBL_RESERVED;

frame_type = FIELD_GET(IEEE80211_FCTL_FTYPE,
le16_to_cpu(hdr->frame_control));
frame_subtype = FIELD_GET(IEEE80211_FCTL_STYPE,
le16_to_cpu(hdr->frame_control));
frame_type = (fc & IEEE80211_FCTL_FTYPE) >> 2;
frame_subtype = (fc & IEEE80211_FCTL_STYPE) >> 4;

txwi[0] = cpu_to_le32(
FIELD_PREP(MT_TXD0_TX_BYTES, skb->len + MT_TXD_SIZE) |
Expand Down

1 comment on commit 7ce4368

@camelcamro
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great .. i will try if there is a difference ...
or is that not related to the issues reported on: #63
?

Please sign in to comment.