diff options
-rw-r--r-- | drivers/net/wireless/p54/p54pci.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index a72f7c2577de..4bf4c213baec 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c | |||
@@ -157,6 +157,14 @@ static void p54p_refill_rx_ring(struct ieee80211_hw *dev, | |||
157 | skb_tail_pointer(skb), | 157 | skb_tail_pointer(skb), |
158 | priv->common.rx_mtu + 32, | 158 | priv->common.rx_mtu + 32, |
159 | PCI_DMA_FROMDEVICE); | 159 | PCI_DMA_FROMDEVICE); |
160 | |||
161 | if (pci_dma_mapping_error(priv->pdev, mapping)) { | ||
162 | dev_kfree_skb_any(skb); | ||
163 | dev_err(&priv->pdev->dev, | ||
164 | "RX DMA Mapping error\n"); | ||
165 | break; | ||
166 | } | ||
167 | |||
160 | desc->host_addr = cpu_to_le32(mapping); | 168 | desc->host_addr = cpu_to_le32(mapping); |
161 | desc->device_addr = 0; // FIXME: necessary? | 169 | desc->device_addr = 0; // FIXME: necessary? |
162 | desc->len = cpu_to_le16(priv->common.rx_mtu + 32); | 170 | desc->len = cpu_to_le16(priv->common.rx_mtu + 32); |
@@ -325,14 +333,20 @@ static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
325 | u32 device_idx, idx, i; | 333 | u32 device_idx, idx, i; |
326 | 334 | ||
327 | spin_lock_irqsave(&priv->lock, flags); | 335 | spin_lock_irqsave(&priv->lock, flags); |
328 | |||
329 | device_idx = le32_to_cpu(ring_control->device_idx[1]); | 336 | device_idx = le32_to_cpu(ring_control->device_idx[1]); |
330 | idx = le32_to_cpu(ring_control->host_idx[1]); | 337 | idx = le32_to_cpu(ring_control->host_idx[1]); |
331 | i = idx % ARRAY_SIZE(ring_control->tx_data); | 338 | i = idx % ARRAY_SIZE(ring_control->tx_data); |
332 | 339 | ||
333 | priv->tx_buf_data[i] = skb; | ||
334 | mapping = pci_map_single(priv->pdev, skb->data, skb->len, | 340 | mapping = pci_map_single(priv->pdev, skb->data, skb->len, |
335 | PCI_DMA_TODEVICE); | 341 | PCI_DMA_TODEVICE); |
342 | if (pci_dma_mapping_error(priv->pdev, mapping)) { | ||
343 | spin_unlock_irqrestore(&priv->lock, flags); | ||
344 | p54_free_skb(dev, skb); | ||
345 | dev_err(&priv->pdev->dev, "TX DMA mapping error\n"); | ||
346 | return ; | ||
347 | } | ||
348 | priv->tx_buf_data[i] = skb; | ||
349 | |||
336 | desc = &ring_control->tx_data[i]; | 350 | desc = &ring_control->tx_data[i]; |
337 | desc->host_addr = cpu_to_le32(mapping); | 351 | desc->host_addr = cpu_to_le32(mapping); |
338 | desc->device_addr = ((struct p54_hdr *)skb->data)->req_id; | 352 | desc->device_addr = ((struct p54_hdr *)skb->data)->req_id; |