Commit 7dd43d35 authored by Alan Ott's avatar Alan Ott Committed by David S. Miller

mac802154: Do not try to resend failed packets

When ops->xmit() fails, drop the packet. Devices which support hardware
ack and retry (which include all devices currently supported by mainline),
will automatically retry sending the packet (in the hardware) up to 3
times, per the 802.15.4 spec.  There is no need, and it is incorrect to
try to do it in mac802154.
Signed-off-by: default avatarAlan Ott <alan@signal11.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 524fba6c
...@@ -88,8 +88,6 @@ struct mac802154_sub_if_data { ...@@ -88,8 +88,6 @@ struct mac802154_sub_if_data {
#define mac802154_to_priv(_hw) container_of(_hw, struct mac802154_priv, hw) #define mac802154_to_priv(_hw) container_of(_hw, struct mac802154_priv, hw)
#define MAC802154_MAX_XMIT_ATTEMPTS 3
#define MAC802154_CHAN_NONE (~(u8)0) /* No channel is assigned */ #define MAC802154_CHAN_NONE (~(u8)0) /* No channel is assigned */
extern struct ieee802154_reduced_mlme_ops mac802154_mlme_reduced; extern struct ieee802154_reduced_mlme_ops mac802154_mlme_reduced;
......
...@@ -39,7 +39,6 @@ struct xmit_work { ...@@ -39,7 +39,6 @@ struct xmit_work {
struct mac802154_priv *priv; struct mac802154_priv *priv;
u8 chan; u8 chan;
u8 page; u8 page;
u8 xmit_attempts;
}; };
static void mac802154_xmit_worker(struct work_struct *work) static void mac802154_xmit_worker(struct work_struct *work)
...@@ -60,18 +59,12 @@ static void mac802154_xmit_worker(struct work_struct *work) ...@@ -60,18 +59,12 @@ static void mac802154_xmit_worker(struct work_struct *work)
} }
res = xw->priv->ops->xmit(&xw->priv->hw, xw->skb); res = xw->priv->ops->xmit(&xw->priv->hw, xw->skb);
if (res)
pr_debug("transmission failed\n");
out: out:
mutex_unlock(&xw->priv->phy->pib_lock); mutex_unlock(&xw->priv->phy->pib_lock);
if (res) {
if (xw->xmit_attempts++ < MAC802154_MAX_XMIT_ATTEMPTS) {
queue_work(xw->priv->dev_workqueue, &xw->work);
return;
} else
pr_debug("transmission failed for %d times",
MAC802154_MAX_XMIT_ATTEMPTS);
}
dev_kfree_skb(xw->skb); dev_kfree_skb(xw->skb);
...@@ -114,7 +107,6 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb, ...@@ -114,7 +107,6 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
work->priv = priv; work->priv = priv;
work->page = page; work->page = page;
work->chan = chan; work->chan = chan;
work->xmit_attempts = 0;
queue_work(priv->dev_workqueue, &work->work); queue_work(priv->dev_workqueue, &work->work);
......
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