Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79137
b: refs/heads/master
c: 8af23b2
h: refs/heads/master
i:
  79135: 09b5ed8
v: v3
  • Loading branch information
David Woodhouse authored and David S. Miller committed Jan 28, 2008
1 parent 37406cd commit 72157ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9bdce6564b25268af7315d3dd17f4f5b6435a45
refs/heads/master: 8af23b2f96dc3dabbc791c75f7c98a7b0d287177
45 changes: 13 additions & 32 deletions trunk/drivers/net/wireless/libertas/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ static u32 convert_radiotap_rate_to_mv(u8 rate)
* @param skb A pointer to skb which includes TX packet
* @return 0 or -1
*/
static int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)
int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct lbs_private *priv = dev->priv;
int ret = -1;
struct txpd localtxpd;
struct txpd *plocaltxpd = &localtxpd;
Expand All @@ -70,12 +71,21 @@ static int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)

lbs_deb_hex(LBS_DEB_TX, "TX Data", skb->data, min_t(unsigned int, skb->len, 100));

netif_stop_queue(priv->dev);
if (priv->mesh_dev)
netif_stop_queue(priv->mesh_dev);

if (priv->dnld_sent) {
lbs_pr_alert( "TX error: dnld_sent = %d, not sending\n",
priv->dnld_sent);
goto done;
}

if (priv->currenttxskb) {
lbs_pr_err("%s while TX skb pending\n", __func__);
goto done;
}

if ((priv->psstate == PS_STATE_SLEEP) ||
(priv->psstate == PS_STATE_PRE_SLEEP)) {
lbs_pr_alert("TX error: packet xmit in %ssleep mode\n",
Expand Down Expand Up @@ -154,6 +164,8 @@ static int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)
if (!ret) {
priv->stats.tx_packets++;
priv->stats.tx_bytes += skb->len;

dev->trans_start = jiffies;
} else {
priv->stats.tx_dropped++;
priv->stats.tx_errors++;
Expand All @@ -179,37 +191,6 @@ static int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)
return ret;
}

int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
int ret = 0;
struct lbs_private *priv = dev->priv;

lbs_deb_enter(LBS_DEB_TX);

/* We could return NETDEV_TX_BUSY here, but I'd actually
like to get the point where we can BUG() */
if (priv->dnld_sent) {
lbs_pr_err("%s while dnld_sent\n", __func__);
priv->stats.tx_dropped++;
goto done;
}
if (priv->currenttxskb) {
lbs_pr_err("%s while TX skb pending\n", __func__);
priv->stats.tx_dropped++;
goto done;
}

netif_stop_queue(priv->dev);
if (priv->mesh_dev)
netif_stop_queue(priv->mesh_dev);

if (lbs_process_tx(priv, skb) == 0)
dev->trans_start = jiffies;
done:
lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret);
return ret;
}

/**
* @brief This function sends to the host the last transmitted packet,
* filling the radiotap headers with transmission information.
Expand Down

0 comments on commit 72157ab

Please sign in to comment.