Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79135
b: refs/heads/master
c: 6b4a7e0
h: refs/heads/master
i:
  79133: 219115b
  79131: f6ba5c7
  79127: b17d8aa
  79119: 4cf2d94
  79103: e53a420
v: v3
  • Loading branch information
David Woodhouse authored and David S. Miller committed Jan 28, 2008
1 parent 9a0aa40 commit 09b5ed8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 43 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: 2abdc0b7756ece70b1f0fd65a651bf8ce487a223
refs/heads/master: 6b4a7e0fbd772495572e038d296853a741e0454b
66 changes: 24 additions & 42 deletions trunk/drivers/net/wireless/libertas/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ static u32 convert_radiotap_rate_to_mv(u8 rate)
}

/**
* @brief This function processes a single packet and sends
* to IF layer
* @brief This function checks the conditions and sends packet to IF
* layer if everything is ok.
*
* @param priv A pointer to struct lbs_private structure
* @param skb A pointer to skb which includes TX packet
* @return 0 or -1
*/
static int SendSinglePacket(struct lbs_private *priv, struct sk_buff *skb)
int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)
{
int ret = 0;
int ret = -1;
struct txpd localtxpd;
struct txpd *plocaltxpd = &localtxpd;
u8 *p802x_hdr;
Expand All @@ -68,16 +68,31 @@ static int SendSinglePacket(struct lbs_private *priv, struct sk_buff *skb)

lbs_deb_enter(LBS_DEB_TX);

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

if (priv->dnld_sent) {
lbs_pr_alert( "TX error: dnld_sent = %d, not sending\n",
priv->dnld_sent);
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",
priv->psstate == PS_STATE_SLEEP?"":"pre-");
goto done;
}

if (priv->surpriseremoved)
return -1;

if (!skb->len || (skb->len > MRVDRV_ETH_TX_PACKET_BUFFER_SIZE)) {
lbs_deb_tx("tx err: skb length %d 0 or > %zd\n",
skb->len, MRVDRV_ETH_TX_PACKET_BUFFER_SIZE);
ret = -1;
goto done;
goto done_tx;
}

ret = 0;
memset(plocaltxpd, 0, sizeof(struct txpd));

plocaltxpd->tx_packet_length = cpu_to_le16(skb->len);
Expand Down Expand Up @@ -130,12 +145,12 @@ static int SendSinglePacket(struct lbs_private *priv, struct sk_buff *skb)

if (ret) {
lbs_deb_tx("tx err: hw_host_to_card returned 0x%X\n", ret);
goto done;
goto done_tx;
}

lbs_deb_tx("SendSinglePacket succeeds\n");
lbs_deb_tx("%s succeeds\n", __func__);

done:
done_tx:
if (!ret) {
priv->stats.tx_packets++;
priv->stats.tx_bytes += skb->len;
Expand All @@ -159,39 +174,6 @@ static int SendSinglePacket(struct lbs_private *priv, struct sk_buff *skb)
dev_kfree_skb_any(skb);
}

lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret);
return ret;
}


/**
* @brief This function checks the conditions and sends packet to IF
* layer if everything is ok.
*
* @param priv A pointer to struct lbs_private structure
* @return n/a
*/
int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)
{
int ret = -1;

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

if (priv->dnld_sent) {
lbs_pr_alert( "TX error: dnld_sent = %d, not sending\n",
priv->dnld_sent);
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",
priv->psstate == PS_STATE_SLEEP?"":"pre-");
goto done;
}

ret = SendSinglePacket(priv, skb);
done:
lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret);
return ret;
Expand Down

0 comments on commit 09b5ed8

Please sign in to comment.