Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24721
b: refs/heads/master
c: 512a809
h: refs/heads/master
i:
  24719: 0ffb672
v: v3
  • Loading branch information
Pete Zaitcev authored and John W. Linville committed Mar 27, 2006
1 parent 1b4f2cc commit 356b6c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 41 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: 367f899ac3b52cf4611cd291ec2bfbf774b15bc7
refs/heads/master: 512a80916b8d04529c0915534c63529144f74e10
44 changes: 8 additions & 36 deletions trunk/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,6 @@ void sync_descbuffer_for_device(struct bcm43xx_dmaring *ring,
addr, len, DMA_FROM_DEVICE);
}

static inline
void mark_skb_mustfree(struct sk_buff *skb,
char mustfree)
{
skb->cb[0] = mustfree;
}

static inline
int skb_mustfree(struct sk_buff *skb)
{
return (skb->cb[0] != 0);
}

/* Unmap and free a descriptor buffer. */
static inline
void free_descriptor_buffer(struct bcm43xx_dmaring *ring,
Expand All @@ -191,17 +178,11 @@ void free_descriptor_buffer(struct bcm43xx_dmaring *ring,
int irq_context)
{
assert(meta->skb);
if (skb_mustfree(meta->skb)) {
if (irq_context)
dev_kfree_skb_irq(meta->skb);
else
dev_kfree_skb(meta->skb);
}
if (irq_context)
dev_kfree_skb_irq(meta->skb);
else
dev_kfree_skb(meta->skb);
meta->skb = NULL;
if (meta->txb) {
ieee80211_txb_free(meta->txb);
meta->txb = NULL;
}
}

static int alloc_ringmemory(struct bcm43xx_dmaring *ring)
Expand Down Expand Up @@ -334,7 +315,6 @@ static int setup_rx_descbuffer(struct bcm43xx_dmaring *ring,
meta->skb = skb;
meta->dmaaddr = dmaaddr;
skb->dev = ring->bcm->net_dev;
mark_skb_mustfree(skb, 1);
desc_addr = (u32)(dmaaddr + ring->memoffset);
desc_ctl = (BCM43xx_DMADTOR_BYTECNT_MASK &
(u32)(ring->rx_buffersize - ring->frameoffset));
Expand Down Expand Up @@ -457,7 +437,6 @@ static void free_all_descbuffers(struct bcm43xx_dmaring *ring)

if (!meta->skb) {
assert(ring->tx);
assert(!meta->txb);
continue;
}
if (ring->tx) {
Expand Down Expand Up @@ -726,7 +705,6 @@ static void dmacontroller_poke_tx(struct bcm43xx_dmaring *ring,

static int dma_tx_fragment(struct bcm43xx_dmaring *ring,
struct sk_buff *skb,
struct ieee80211_txb *txb,
u8 cur_frag)
{
int slot;
Expand All @@ -741,11 +719,6 @@ static int dma_tx_fragment(struct bcm43xx_dmaring *ring,
desc = ring->vbase + slot;
meta = ring->meta + slot;

if (cur_frag == 0) {
/* Save the txb pointer for freeing in xmitstatus IRQ */
meta->txb = txb;
}

/* Add a device specific TX header. */
assert(skb_headroom(skb) >= sizeof(struct bcm43xx_txhdr));
/* Reserve enough headroom for the device tx header. */
Expand Down Expand Up @@ -810,13 +783,12 @@ int bcm43xx_dma_tx(struct bcm43xx_private *bcm,

for (i = 0; i < txb->nr_frags; i++) {
skb = txb->fragments[i];
/* We do not free the skb, as it is freed as
* part of the txb freeing.
*/
mark_skb_mustfree(skb, 0);
dma_tx_fragment(ring, skb, txb, i);
/* Take skb from ieee80211_txb_free */
txb->fragments[i] = NULL;
dma_tx_fragment(ring, skb, i);
//TODO: handle failure of dma_tx_fragment
}
ieee80211_txb_free(txb);

return 0;
}
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/net/wireless/bcm43xx/bcm43xx_dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ struct bcm43xx_dmadesc_meta {
struct sk_buff *skb;
/* DMA base bus-address of the descriptor buffer. */
dma_addr_t dmaaddr;
/* Pointer to our txb (can be NULL).
* This should be freed in completion IRQ.
*/
struct ieee80211_txb *txb;
};

struct bcm43xx_dmaring {
Expand Down

0 comments on commit 356b6c8

Please sign in to comment.