summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/p54usb.c
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@web.de>2008-12-14 15:05:42 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-12-19 15:23:19 -0500
commit0a5ec96ad68516582023a877aceff9db7636d141 (patch)
tree8a8346aabff7306d2b13a36d756f14000e629595 /drivers/net/wireless/p54/p54usb.c
parent69ba3e5d74a467a64248cd90ccafb524b1fddcb5 (diff)
downloadblackbird-op-linux-0a5ec96ad68516582023a877aceff9db7636d141.tar.gz
blackbird-op-linux-0a5ec96ad68516582023a877aceff9db7636d141.zip
p54: remove free_on_tx parameter
This patch simplifies the tx code a bit and will be necessary for the upcoming stlc45xx<->p54 port. In detail: we no longer have to tell all back-end drivers directly, if we want to free a frame right after it was send to the firmware, or if we do it in the library callback later. Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54/p54usb.c')
-rw-r--r--drivers/net/wireless/p54/p54usb.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index c2789e53b984..17f89c7eb098 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -138,22 +138,16 @@ static void p54u_rx_cb(struct urb *urb)
}
}
-static void p54u_tx_reuse_skb_cb(struct urb *urb)
-{
- struct sk_buff *skb = urb->context;
- struct p54u_priv *priv = (struct p54u_priv *)((struct ieee80211_hw *)
- usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)))->priv;
-
- skb_pull(skb, priv->common.tx_hdr_len);
-}
-
-static void p54u_tx_free_skb_cb(struct urb *urb)
+static void p54u_tx_cb(struct urb *urb)
{
struct sk_buff *skb = urb->context;
struct ieee80211_hw *dev = (struct ieee80211_hw *)
usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0));
+ struct p54u_priv *priv = dev->priv;
- p54_free_skb(dev, skb);
+ skb_pull(skb, priv->common.tx_hdr_len);
+ if (FREE_AFTER_TX(skb))
+ p54_free_skb(dev, skb);
}
static void p54u_tx_dummy_cb(struct urb *urb) { }
@@ -213,8 +207,7 @@ static int p54u_init_urbs(struct ieee80211_hw *dev)
return ret;
}
-static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb,
- int free_on_tx)
+static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb)
{
struct p54u_priv *priv = dev->priv;
struct urb *addr_urb, *data_urb;
@@ -236,9 +229,7 @@ static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb,
p54u_tx_dummy_cb, dev);
usb_fill_bulk_urb(data_urb, priv->udev,
usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA),
- skb->data, skb->len,
- free_on_tx ? p54u_tx_free_skb_cb :
- p54u_tx_reuse_skb_cb, skb);
+ skb->data, skb->len, p54u_tx_cb, skb);
usb_anchor_urb(addr_urb, &priv->submitted);
err = usb_submit_urb(addr_urb, GFP_ATOMIC);
@@ -273,8 +264,7 @@ static __le32 p54u_lm87_chksum(const __le32 *data, size_t length)
return cpu_to_le32(chk);
}
-static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb,
- int free_on_tx)
+static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb)
{
struct p54u_priv *priv = dev->priv;
struct urb *data_urb;
@@ -293,9 +283,7 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb,
usb_fill_bulk_urb(data_urb, priv->udev,
usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA),
- skb->data, skb->len,
- free_on_tx ? p54u_tx_free_skb_cb :
- p54u_tx_reuse_skb_cb, skb);
+ skb->data, skb->len, p54u_tx_cb, skb);
usb_anchor_urb(data_urb, &priv->submitted);
if (usb_submit_urb(data_urb, GFP_ATOMIC)) {
@@ -306,8 +294,7 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb,
usb_free_urb(data_urb);
}
-static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb,
- int free_on_tx)
+static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb)
{
struct p54u_priv *priv = dev->priv;
struct urb *int_urb, *data_urb;
@@ -354,9 +341,7 @@ static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb,
usb_fill_bulk_urb(data_urb, priv->udev,
usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA),
- skb->data, skb->len,
- free_on_tx ? p54u_tx_free_skb_cb :
- p54u_tx_reuse_skb_cb, skb);
+ skb->data, skb->len, p54u_tx_cb, skb);
usb_anchor_urb(int_urb, &priv->submitted);
err = usb_submit_urb(int_urb, GFP_ATOMIC);
OpenPOWER on IntegriCloud