Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236171
b: refs/heads/master
c: 371d72a
h: refs/heads/master
i:
  236169: fee84e1
  236167: 75cf0ca
v: v3
  • Loading branch information
Brett Rudley authored and Greg Kroah-Hartman committed Mar 1, 2011
1 parent 0a06a5c commit fd93143
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 49 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: 235742ae4da1c8398a3968b2d5110256fc33d536
refs/heads/master: 371d72a1776bae3289cc984e656ef91172f2e925
5 changes: 5 additions & 0 deletions trunk/drivers/staging/brcm80211/include/bcmutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ extern struct sk_buff *pktq_penq_head(struct pktq *pq, int prec,
extern struct sk_buff *pktq_pdeq(struct pktq *pq, int prec);
extern struct sk_buff *pktq_pdeq_tail(struct pktq *pq, int prec);

/* packet primitives */
extern struct sk_buff *pkt_buf_get_skb(struct osl_info *osh, uint len);
extern void pkt_buf_free_skb(struct osl_info *osh,
struct sk_buff *skb, bool send);

/* Empty the queue at particular precedence level */
#ifdef BRCM_FULLMAC
extern void pktq_pflush(struct osl_info *osh, struct pktq *pq, int prec,
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/staging/brcm80211/include/osl.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,5 @@ extern uint osl_pci_slot(struct osl_info *osh);
} while (0)
#endif /* IL_BIGENDIAN */

/* packet primitives */
extern struct sk_buff *pkt_buf_get_skb(struct osl_info *osh, uint len);
extern void pkt_buf_free_skb(struct osl_info *osh, struct sk_buff *skb, bool send);

#endif /* _osl_h_ */
46 changes: 46 additions & 0 deletions trunk/drivers/staging/brcm80211/util/bcmutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,52 @@
#include <proto/802.1d.h>
#include <proto/802.11.h>

struct sk_buff *BCMFASTPATH pkt_buf_get_skb(struct osl_info *osh, uint len)
{
struct sk_buff *skb;

skb = dev_alloc_skb(len);
if (skb) {
skb_put(skb, len);
skb->priority = 0;

osh->pktalloced++;
}

return skb;
}

/* Free the driver packet. Free the tag if present */
void BCMFASTPATH pkt_buf_free_skb(struct osl_info *osh,
struct sk_buff *skb, bool send)
{
struct sk_buff *nskb;
int nest = 0;

ASSERT(skb);

/* perversion: we use skb->next to chain multi-skb packets */
while (skb) {
nskb = skb->next;
skb->next = NULL;

if (skb->destructor)
/* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if
* destructor exists
*/
dev_kfree_skb_any(skb);
else
/* can free immediately (even in_irq()) if destructor
* does not exist
*/
dev_kfree_skb(skb);

osh->pktalloced--;
nest++;
skb = nskb;
}
}

/* copy a buffer into a pkt buffer chain */
uint pktfrombuf(struct osl_info *osh, struct sk_buff *p, uint offset, int len,
unsigned char *buf)
Expand Down
45 changes: 0 additions & 45 deletions trunk/drivers/staging/brcm80211/util/linux_osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,51 +78,6 @@ void osl_detach(struct osl_info *osh)
kfree(osh);
}

struct sk_buff *BCMFASTPATH pkt_buf_get_skb(struct osl_info *osh, uint len)
{
struct sk_buff *skb;

skb = dev_alloc_skb(len);
if (skb) {
skb_put(skb, len);
skb->priority = 0;

osh->pktalloced++;
}

return skb;
}

/* Free the driver packet. Free the tag if present */
void BCMFASTPATH pkt_buf_free_skb(struct osl_info *osh, struct sk_buff *skb, bool send)
{
struct sk_buff *nskb;
int nest = 0;

ASSERT(skb);

/* perversion: we use skb->next to chain multi-skb packets */
while (skb) {
nskb = skb->next;
skb->next = NULL;

if (skb->destructor)
/* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if
* destructor exists
*/
dev_kfree_skb_any(skb);
else
/* can free immediately (even in_irq()) if destructor
* does not exist
*/
dev_kfree_skb(skb);

osh->pktalloced--;
nest++;
skb = nskb;
}
}

/* return bus # for the pci device pointed by osh->pdev */
uint osl_pci_bus(struct osl_info *osh)
{
Expand Down

0 comments on commit fd93143

Please sign in to comment.