aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/p54usb.c
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@web.de>2008-12-14 09:05:42 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-19 15:23:19 -0500
commit0a5ec96ad68516582023a877aceff9db7636d141 (patch)
tree8a8346aabff7306d2b13a36d756f14000e629595 /drivers/net/wireless/p54/p54usb.c
parent69ba3e5d74a467a64248cd90ccafb524b1fddcb5 (diff)
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)
138 } 138 }
139} 139}
140 140
141static void p54u_tx_reuse_skb_cb(struct urb *urb) 141static void p54u_tx_cb(struct urb *urb)
142{
143 struct sk_buff *skb = urb->context;
144 struct p54u_priv *priv = (struct p54u_priv *)((struct ieee80211_hw *)
145 usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)))->priv;
146
147 skb_pull(skb, priv->common.tx_hdr_len);
148}
149
150static void p54u_tx_free_skb_cb(struct urb *urb)
151{ 142{
152 struct sk_buff *skb = urb->context; 143 struct sk_buff *skb = urb->context;
153 struct ieee80211_hw *dev = (struct ieee80211_hw *) 144 struct ieee80211_hw *dev = (struct ieee80211_hw *)
154 usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); 145 usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0));
146 struct p54u_priv *priv = dev->priv;
155 147
156 p54_free_skb(dev, skb); 148 skb_pull(skb, priv->common.tx_hdr_len);
149 if (FREE_AFTER_TX(skb))
150 p54_free_skb(dev, skb);
157} 151}
158 152
159static void p54u_tx_dummy_cb(struct urb *urb) { } 153static void p54u_tx_dummy_cb(struct urb *urb) { }
@@ -213,8 +207,7 @@ static int p54u_init_urbs(struct ieee80211_hw *dev)
213 return ret; 207 return ret;
214} 208}
215 209
216static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb, 210static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb)
217 int free_on_tx)
218{ 211{
219 struct p54u_priv *priv = dev->priv; 212 struct p54u_priv *priv = dev->priv;
220 struct urb *addr_urb, *data_urb; 213 struct urb *addr_urb, *data_urb;
@@ -236,9 +229,7 @@ static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb,
236 p54u_tx_dummy_cb, dev); 229 p54u_tx_dummy_cb, dev);
237 usb_fill_bulk_urb(data_urb, priv->udev, 230 usb_fill_bulk_urb(data_urb, priv->udev,
238 usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), 231 usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA),
239 skb->data, skb->len, 232 skb->data, skb->len, p54u_tx_cb, skb);
240 free_on_tx ? p54u_tx_free_skb_cb :
241 p54u_tx_reuse_skb_cb, skb);
242 233
243 usb_anchor_urb(addr_urb, &priv->submitted); 234 usb_anchor_urb(addr_urb, &priv->submitted);
244 err = usb_submit_urb(addr_urb, GFP_ATOMIC); 235 err = usb_submit_urb(addr_urb, GFP_ATOMIC);
@@ -273,8 +264,7 @@ static __le32 p54u_lm87_chksum(const __le32 *data, size_t length)
273 return cpu_to_le32(chk); 264 return cpu_to_le32(chk);
274} 265}
275 266
276static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb, 267static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb)
277 int free_on_tx)
278{ 268{
279 struct p54u_priv *priv = dev->priv; 269 struct p54u_priv *priv = dev->priv;
280 struct urb *data_urb; 270 struct urb *data_urb;
@@ -293,9 +283,7 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb,
293 283
294 usb_fill_bulk_urb(data_urb, priv->udev, 284 usb_fill_bulk_urb(data_urb, priv->udev,
295 usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), 285 usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA),
296 skb->data, skb->len, 286 skb->data, skb->len, p54u_tx_cb, skb);
297 free_on_tx ? p54u_tx_free_skb_cb :
298 p54u_tx_reuse_skb_cb, skb);
299 287
300 usb_anchor_urb(data_urb, &priv->submitted); 288 usb_anchor_urb(data_urb, &priv->submitted);
301 if (usb_submit_urb(data_urb, GFP_ATOMIC)) { 289 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,
306 usb_free_urb(data_urb); 294 usb_free_urb(data_urb);
307} 295}
308 296
309static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb, 297static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb)
310 int free_on_tx)
311{ 298{
312 struct p54u_priv *priv = dev->priv; 299 struct p54u_priv *priv = dev->priv;
313 struct urb *int_urb, *data_urb; 300 struct urb *int_urb, *data_urb;
@@ -354,9 +341,7 @@ static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb,
354 341
355 usb_fill_bulk_urb(data_urb, priv->udev, 342 usb_fill_bulk_urb(data_urb, priv->udev,
356 usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), 343 usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA),
357 skb->data, skb->len, 344 skb->data, skb->len, p54u_tx_cb, skb);
358 free_on_tx ? p54u_tx_free_skb_cb :
359 p54u_tx_reuse_skb_cb, skb);
360 345
361 usb_anchor_urb(int_urb, &priv->submitted); 346 usb_anchor_urb(int_urb, &priv->submitted);
362 err = usb_submit_urb(int_urb, GFP_ATOMIC); 347 err = usb_submit_urb(int_urb, GFP_ATOMIC);