diff options
-rw-r--r-- | drivers/net/wireless/libertas/tx.c | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c index 336544cdeca6..7bc212438259 100644 --- a/drivers/net/wireless/libertas/tx.c +++ b/drivers/net/wireless/libertas/tx.c | |||
@@ -56,8 +56,9 @@ static u32 convert_radiotap_rate_to_mv(u8 rate) | |||
56 | * @param skb A pointer to skb which includes TX packet | 56 | * @param skb A pointer to skb which includes TX packet |
57 | * @return 0 or -1 | 57 | * @return 0 or -1 |
58 | */ | 58 | */ |
59 | static int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb) | 59 | int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) |
60 | { | 60 | { |
61 | struct lbs_private *priv = dev->priv; | ||
61 | int ret = -1; | 62 | int ret = -1; |
62 | struct txpd localtxpd; | 63 | struct txpd localtxpd; |
63 | struct txpd *plocaltxpd = &localtxpd; | 64 | struct txpd *plocaltxpd = &localtxpd; |
@@ -70,12 +71,21 @@ static int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb) | |||
70 | 71 | ||
71 | lbs_deb_hex(LBS_DEB_TX, "TX Data", skb->data, min_t(unsigned int, skb->len, 100)); | 72 | lbs_deb_hex(LBS_DEB_TX, "TX Data", skb->data, min_t(unsigned int, skb->len, 100)); |
72 | 73 | ||
74 | netif_stop_queue(priv->dev); | ||
75 | if (priv->mesh_dev) | ||
76 | netif_stop_queue(priv->mesh_dev); | ||
77 | |||
73 | if (priv->dnld_sent) { | 78 | if (priv->dnld_sent) { |
74 | lbs_pr_alert( "TX error: dnld_sent = %d, not sending\n", | 79 | lbs_pr_alert( "TX error: dnld_sent = %d, not sending\n", |
75 | priv->dnld_sent); | 80 | priv->dnld_sent); |
76 | goto done; | 81 | goto done; |
77 | } | 82 | } |
78 | 83 | ||
84 | if (priv->currenttxskb) { | ||
85 | lbs_pr_err("%s while TX skb pending\n", __func__); | ||
86 | goto done; | ||
87 | } | ||
88 | |||
79 | if ((priv->psstate == PS_STATE_SLEEP) || | 89 | if ((priv->psstate == PS_STATE_SLEEP) || |
80 | (priv->psstate == PS_STATE_PRE_SLEEP)) { | 90 | (priv->psstate == PS_STATE_PRE_SLEEP)) { |
81 | lbs_pr_alert("TX error: packet xmit in %ssleep mode\n", | 91 | lbs_pr_alert("TX error: packet xmit in %ssleep mode\n", |
@@ -154,6 +164,8 @@ done_tx: | |||
154 | if (!ret) { | 164 | if (!ret) { |
155 | priv->stats.tx_packets++; | 165 | priv->stats.tx_packets++; |
156 | priv->stats.tx_bytes += skb->len; | 166 | priv->stats.tx_bytes += skb->len; |
167 | |||
168 | dev->trans_start = jiffies; | ||
157 | } else { | 169 | } else { |
158 | priv->stats.tx_dropped++; | 170 | priv->stats.tx_dropped++; |
159 | priv->stats.tx_errors++; | 171 | priv->stats.tx_errors++; |
@@ -179,37 +191,6 @@ done: | |||
179 | return ret; | 191 | return ret; |
180 | } | 192 | } |
181 | 193 | ||
182 | int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | ||
183 | { | ||
184 | int ret = 0; | ||
185 | struct lbs_private *priv = dev->priv; | ||
186 | |||
187 | lbs_deb_enter(LBS_DEB_TX); | ||
188 | |||
189 | /* We could return NETDEV_TX_BUSY here, but I'd actually | ||
190 | like to get the point where we can BUG() */ | ||
191 | if (priv->dnld_sent) { | ||
192 | lbs_pr_err("%s while dnld_sent\n", __func__); | ||
193 | priv->stats.tx_dropped++; | ||
194 | goto done; | ||
195 | } | ||
196 | if (priv->currenttxskb) { | ||
197 | lbs_pr_err("%s while TX skb pending\n", __func__); | ||
198 | priv->stats.tx_dropped++; | ||
199 | goto done; | ||
200 | } | ||
201 | |||
202 | netif_stop_queue(priv->dev); | ||
203 | if (priv->mesh_dev) | ||
204 | netif_stop_queue(priv->mesh_dev); | ||
205 | |||
206 | if (lbs_process_tx(priv, skb) == 0) | ||
207 | dev->trans_start = jiffies; | ||
208 | done: | ||
209 | lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret); | ||
210 | return ret; | ||
211 | } | ||
212 | |||
213 | /** | 194 | /** |
214 | * @brief This function sends to the host the last transmitted packet, | 195 | * @brief This function sends to the host the last transmitted packet, |
215 | * filling the radiotap headers with transmission information. | 196 | * filling the radiotap headers with transmission information. |