BigW Consortium Gitlab

Commit 8cfbdb4e by David Clark

Updated Linux side to check free space first before scheduling Tx when

writer is blocked
parent f4b33a26
......@@ -66,7 +66,7 @@ int mt7697_irq_run(struct mt7697q_info *qinfo)
}
else {
WARN_ON(!qs->notify_tx_fcn);
ret = qs->notify_tx_fcn(qs->priv);
ret = qs->notify_tx_fcn(qs->priv, mt7697q_get_free_words(qs));
if (ret < 0) {
dev_err(qs->qinfo->dev,
"%s(): notify_tx_fcn() failed(%d)\n",
......
......@@ -52,11 +52,6 @@ static __inline size_t mt7697q_get_num_words(const struct mt7697q_spec *qs)
qs->data.rd_offset, qs->data.wr_offset);
}
static __inline size_t mt7697q_get_free_words(const struct mt7697q_spec *qs)
{
return mt7697q_get_capacity(qs) - mt7697q_get_num_words(qs);
}
static int mt7697q_wr_init(u8 tx_ch, u8 rx_ch, struct mt7697q_spec *qs)
{
struct mt7697_queue_init_req req;
......@@ -295,6 +290,11 @@ cleanup:
return ret;
}
__inline size_t mt7697q_get_free_words(const struct mt7697q_spec *qs)
{
return mt7697q_get_capacity(qs) - mt7697q_get_num_words(qs);
}
int mt7697q_get_s2m_mbx(struct mt7697q_info *qinfo, u8* s2m_mbox)
{
int ret;
......
......@@ -76,6 +76,7 @@ void mt7697_irq_delayed_work(struct work_struct*);
void mt7697_irq_work(struct work_struct*);
irqreturn_t mt7697_isr(int, void*);
size_t mt7697q_get_free_words(const struct mt7697q_spec*);
int mt7697q_proc_data(struct mt7697q_spec*);
int mt7697q_get_s2m_mbx(struct mt7697q_info*, u8*);
......
......@@ -75,7 +75,7 @@ struct mt7697_queue_reset_req {
} __attribute__((packed, aligned(4)));
typedef int (*rx_hndlr)(const struct mt7697q_rsp_hdr*, void*);
typedef int (*notify_tx_hndlr)(void*);
typedef int (*notify_tx_hndlr)(void*, u32);
struct mt7697q_if_ops {
int (*init)(u8, u8, void*, notify_tx_hndlr, rx_hndlr, void**, void**);
......
......@@ -80,8 +80,8 @@ enum mt7697_vif_state {
};
struct mt7697_tx_pkt {
struct sk_buff *skb;
struct list_head next;
struct sk_buff *skb;
};
struct mt7697_cfg80211_info {
......@@ -215,7 +215,7 @@ void mt7697_init_netdev(struct net_device*);
struct mt7697_vif *mt7697_get_vif_by_idx(struct mt7697_cfg80211_info*, u32);
struct wireless_dev *mt7697_interface_add(struct mt7697_cfg80211_info*,
const char*, enum nl80211_iftype, u8);
int mt7697_notify_tx(void*);
int mt7697_notify_tx(void*, u32);
void mt7697_tx_work(struct work_struct *);
int mt7697_data_tx(struct sk_buff*, struct net_device*);
int mt7697_rx_data(struct mt7697_cfg80211_info*, u32, u32);
......
......@@ -18,18 +18,22 @@
#include "common.h"
#include "core.h"
int mt7697_notify_tx(void* priv)
int mt7697_notify_tx(void* priv, u32 free)
{
struct mt7697_cfg80211_info *cfg = (struct mt7697_cfg80211_info*)priv;
int ret = 0;
spin_lock_bh(&cfg->tx_skb_list_lock);
if (!list_empty(&cfg->tx_skb_list)) {
ret = queue_work(cfg->tx_workq, &cfg->tx_work);
if (ret < 0) {
dev_err(cfg->dev, "%s(): queue_work() failed(%d)\n",
__func__, ret);
goto cleanup;
struct mt7697_tx_pkt *tx_pkt = list_entry(&cfg->tx_skb_list,
struct mt7697_tx_pkt, next);
if (tx_pkt->skb->len >= free) {
ret = queue_work(cfg->tx_workq, &cfg->tx_work);
if (ret < 0) {
dev_err(cfg->dev, "%s(): queue_work() failed(%d)\n",
__func__, ret);
goto cleanup;
}
}
}
......
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