diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-09 12:52:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:06:24 -0800 |
commit | a9bdce6564b25268af7315d3dd17f4f5b6435a45 (patch) | |
tree | 1d6c27d8f024573a510cdba173a077bd4fb2b9a3 /drivers/net/wireless/libertas/tx.c | |
parent | 6b4a7e0fbd772495572e038d296853a741e0454b (diff) |
libertas: move lbs_hard_start_xmit() into tx.c
... where it can shortly be merged with lbs_process_tx()...
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/tx.c')
-rw-r--r-- | drivers/net/wireless/libertas/tx.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c index 10596f3bb59..336544cdeca 100644 --- a/drivers/net/wireless/libertas/tx.c +++ b/drivers/net/wireless/libertas/tx.c @@ -56,7 +56,7 @@ static u32 convert_radiotap_rate_to_mv(u8 rate) * @param skb A pointer to skb which includes TX packet * @return 0 or -1 */ -int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb) +static int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb) { int ret = -1; struct txpd localtxpd; @@ -179,6 +179,37 @@ done: 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. |