Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Data transmitting implementation.
0004  *
0005  * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
0006  * Copyright (c) 2010, ST-Ericsson
0007  */
0008 #ifndef WFX_DATA_TX_H
0009 #define WFX_DATA_TX_H
0010 
0011 #include <linux/list.h>
0012 #include <net/mac80211.h>
0013 
0014 #include "hif_api_cmd.h"
0015 #include "hif_api_mib.h"
0016 
0017 struct wfx_tx_priv;
0018 struct wfx_dev;
0019 struct wfx_vif;
0020 
0021 struct wfx_tx_policy {
0022     struct list_head link;
0023     int usage_count;
0024     u8 rates[12];
0025     bool uploaded;
0026 };
0027 
0028 struct wfx_tx_policy_cache {
0029     struct wfx_tx_policy cache[HIF_TX_RETRY_POLICY_MAX];
0030     /* FIXME: use a trees and drop hash from tx_policy */
0031     struct list_head used;
0032     struct list_head free;
0033     spinlock_t lock;
0034 };
0035 
0036 struct wfx_tx_priv {
0037     ktime_t xmit_timestamp;
0038     unsigned char icv_size;
0039 };
0040 
0041 void wfx_tx_policy_init(struct wfx_vif *wvif);
0042 void wfx_tx_policy_upload_work(struct work_struct *work);
0043 
0044 void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb);
0045 void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg);
0046 void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, bool drop);
0047 
0048 static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb)
0049 {
0050     struct ieee80211_tx_info *tx_info;
0051 
0052     if (!skb)
0053         return NULL;
0054     tx_info = IEEE80211_SKB_CB(skb);
0055     return (struct wfx_tx_priv *)tx_info->rate_driver_data;
0056 }
0057 
0058 static inline struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb)
0059 {
0060     struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data;
0061     struct wfx_hif_req_tx *req = (struct wfx_hif_req_tx *)hif->body;
0062 
0063     return req;
0064 }
0065 
0066 #endif