Commit f27659f4 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: drop useless structs only used in hif_req_tx

The structs hif_queue, hif_data_flags, hif_tx_flags and
hif_ht_tx_parameters have no real reasons to exist. Drop them and
simplify access to fields of struct hif_req_tx.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-20-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7df30b85
...@@ -300,23 +300,14 @@ static u8 wfx_tx_get_rate_id(struct wfx_vif *wvif, ...@@ -300,23 +300,14 @@ static u8 wfx_tx_get_rate_id(struct wfx_vif *wvif,
return rate_id; return rate_id;
} }
static struct hif_ht_tx_parameters wfx_tx_get_tx_parms(struct wfx_dev *wdev, static int wfx_tx_get_frame_format(struct ieee80211_tx_info *tx_info)
struct ieee80211_tx_info *tx_info)
{ {
struct ieee80211_tx_rate *rate = &tx_info->driver_rates[0]; if (!(tx_info->driver_rates[0].flags & IEEE80211_TX_RC_MCS))
struct hif_ht_tx_parameters ret = { }; return HIF_FRAME_FORMAT_NON_HT;
else if (!(tx_info->driver_rates[0].flags & IEEE80211_TX_RC_GREEN_FIELD))
if (!(rate->flags & IEEE80211_TX_RC_MCS)) return HIF_FRAME_FORMAT_MIXED_FORMAT_HT;
ret.frame_format = HIF_FRAME_FORMAT_NON_HT;
else if (!(rate->flags & IEEE80211_TX_RC_GREEN_FIELD))
ret.frame_format = HIF_FRAME_FORMAT_MIXED_FORMAT_HT;
else else
ret.frame_format = HIF_FRAME_FORMAT_GF_HT_11N; return HIF_FRAME_FORMAT_GF_HT_11N;
if (rate->flags & IEEE80211_TX_RC_SHORT_GI)
ret.short_gi = 1;
if (tx_info->flags & IEEE80211_TX_CTL_STBC)
ret.stbc = 0; // FIXME: Not yet supported by firmware?
return ret;
} }
static int wfx_tx_get_icv_len(struct ieee80211_key_conf *hw_key) static int wfx_tx_get_icv_len(struct ieee80211_key_conf *hw_key)
...@@ -377,14 +368,16 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, ...@@ -377,14 +368,16 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
req->packet_id |= IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 16; req->packet_id |= IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 16;
req->packet_id |= queue_id << 28; req->packet_id |= queue_id << 28;
req->data_flags.fc_offset = offset; req->fc_offset = offset;
if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)
req->data_flags.after_dtim = 1; req->after_dtim = 1;
req->queue_id.peer_sta_id = wfx_tx_get_link_id(wvif, sta, hdr); req->peer_sta_id = wfx_tx_get_link_id(wvif, sta, hdr);
// Queue index are inverted between firmware and Linux // Queue index are inverted between firmware and Linux
req->queue_id.queue_id = 3 - queue_id; req->queue_id = 3 - queue_id;
req->ht_tx_parameters = wfx_tx_get_tx_parms(wvif->wdev, tx_info); req->retry_policy_index = wfx_tx_get_rate_id(wvif, tx_info);
req->tx_flags.retry_policy_index = wfx_tx_get_rate_id(wvif, tx_info); req->frame_format = wfx_tx_get_frame_format(tx_info);
if (tx_info->driver_rates[0].flags & IEEE80211_TX_RC_SHORT_GI)
req->short_gi = 1;
// Auxiliary operations // Auxiliary operations
wfx_tx_queues_put(wvif, skb); wfx_tx_queues_put(wvif, skb);
...@@ -436,10 +429,10 @@ static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb) ...@@ -436,10 +429,10 @@ static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
struct hif_req_tx *req = (struct hif_req_tx *)hif->body; struct hif_req_tx *req = (struct hif_req_tx *)hif->body;
unsigned int offset = sizeof(struct hif_msg) + unsigned int offset = sizeof(struct hif_msg) +
sizeof(struct hif_req_tx) + sizeof(struct hif_req_tx) +
req->data_flags.fc_offset; req->fc_offset;
WARN_ON(!wvif); WARN_ON(!wvif);
wfx_tx_policy_put(wvif, req->tx_flags.retry_policy_index); wfx_tx_policy_put(wvif, req->retry_policy_index);
skb_pull(skb, offset); skb_pull(skb, offset);
ieee80211_tx_status_irqsafe(wvif->wdev->hw, skb); ieee80211_tx_status_irqsafe(wvif->wdev->hw, skb);
} }
......
...@@ -191,53 +191,32 @@ enum hif_frame_format { ...@@ -191,53 +191,32 @@ enum hif_frame_format {
HIF_FRAME_FORMAT_GF_HT_11N = 0x2 HIF_FRAME_FORMAT_GF_HT_11N = 0x2
}; };
enum hif_stbc { struct hif_req_tx {
HIF_STBC_NOT_ALLOWED = 0x0, // packet_id is not interpreted by the device, so it is not necessary to
HIF_STBC_ALLOWED = 0x1 // declare it little endian
}; u32 packet_id;
u8 max_tx_rate;
struct hif_queue {
u8 queue_id:2; u8 queue_id:2;
u8 peer_sta_id:4; u8 peer_sta_id:4;
u8 reserved:2; u8 reserved1:2;
} __packed;
struct hif_data_flags {
u8 more:1; u8 more:1;
u8 fc_offset:3; u8 fc_offset:3;
u8 after_dtim:1; u8 after_dtim:1;
u8 reserved:3; u8 reserved2:3;
} __packed;
struct hif_tx_flags {
u8 start_exp:1; u8 start_exp:1;
u8 reserved:3; u8 reserved3:3;
u8 retry_policy_index:4; u8 retry_policy_index:4;
} __packed; __le32 reserved4;
__le32 expire_time;
struct hif_ht_tx_parameters {
u8 frame_format:4; u8 frame_format:4;
u8 fec_coding:1; u8 fec_coding:1;
u8 short_gi:1; u8 short_gi:1;
u8 reserved1:1; u8 reserved5:1;
u8 stbc:1; u8 stbc:1;
u8 reserved2; u8 reserved6;
u8 aggregation:1; u8 aggregation:1;
u8 reserved3:7; u8 reserved7:7;
u8 reserved4; u8 reserved8;
} __packed;
struct hif_req_tx {
// packet_id is not interpreted by the device, so it is not necessary to
// declare it little endian
u32 packet_id;
u8 max_tx_rate;
struct hif_queue queue_id;
struct hif_data_flags data_flags;
struct hif_tx_flags tx_flags;
__le32 reserved;
__le32 expire_time;
struct hif_ht_tx_parameters ht_tx_parameters;
u8 frame[]; u8 frame[];
} __packed; } __packed;
......
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