Commit 7a9b48b3 authored by Brett Rudley's avatar Brett Rudley Committed by Greg Kroah-Hartman

staging: brcm80211: Move osl_pub into osl

Signed-off-by: default avatarBrett Rudley <brudley@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 98ede2ed
...@@ -17,14 +17,10 @@ ...@@ -17,14 +17,10 @@
#ifndef _osl_h_ #ifndef _osl_h_
#define _osl_h_ #define _osl_h_
struct osl_pubinfo {
uint pktalloced; /* Number of allocated packet buffers */
bool mmbus; /* Bus supports memory-mapped registers */
};
/* osl handle type forward declaration */ /* osl handle type forward declaration */
struct osl_info { struct osl_info {
struct osl_pubinfo pub; uint pktalloced; /* Number of allocated packet buffers */
bool mmbus; /* Bus supports memory-mapped registers */
uint magic; uint magic;
void *pdev; void *pdev;
uint bustype; uint bustype;
...@@ -106,10 +102,10 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size, ...@@ -106,10 +102,10 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
#if defined(BCMSDIO) #if defined(BCMSDIO)
#define SELECT_BUS_WRITE(osh, mmap_op, bus_op) \ #define SELECT_BUS_WRITE(osh, mmap_op, bus_op) \
if (((struct osl_pubinfo *)(osh))->mmbus) \ if ((osh)->mmbus) \
mmap_op else bus_op mmap_op else bus_op
#define SELECT_BUS_READ(osh, mmap_op, bus_op) \ #define SELECT_BUS_READ(osh, mmap_op, bus_op) \
(((struct osl_pubinfo *)(osh))->mmbus) ? mmap_op : bus_op ((osh)->mmbus) ? mmap_op : bus_op
#else #else
#define SELECT_BUS_WRITE(osh, mmap_op, bus_op) mmap_op #define SELECT_BUS_WRITE(osh, mmap_op, bus_op) mmap_op
#define SELECT_BUS_READ(osh, mmap_op, bus_op) mmap_op #define SELECT_BUS_READ(osh, mmap_op, bus_op) mmap_op
...@@ -255,7 +251,7 @@ extern void osl_pktfree(struct osl_info *osh, void *skb, bool send); ...@@ -255,7 +251,7 @@ extern void osl_pktfree(struct osl_info *osh, void *skb, bool send);
#ifdef BRCM_FULLMAC #ifdef BRCM_FULLMAC
static inline void * static inline void *
osl_pkt_frmnative(struct osl_pubinfo *osh, struct sk_buff *skb) osl_pkt_frmnative(struct osl_info *osh, struct sk_buff *skb)
{ {
struct sk_buff *nskb; struct sk_buff *nskb;
...@@ -265,10 +261,10 @@ osl_pkt_frmnative(struct osl_pubinfo *osh, struct sk_buff *skb) ...@@ -265,10 +261,10 @@ osl_pkt_frmnative(struct osl_pubinfo *osh, struct sk_buff *skb)
return (void *)skb; return (void *)skb;
} }
#define PKTFRMNATIVE(osh, skb) \ #define PKTFRMNATIVE(osh, skb) \
osl_pkt_frmnative(((struct osl_pubinfo *)osh), (struct sk_buff*)(skb)) osl_pkt_frmnative((osh), (struct sk_buff *)(skb))
static inline struct sk_buff * static inline struct sk_buff *
osl_pkt_tonative(struct osl_pubinfo *osh, void *pkt) osl_pkt_tonative(struct osl_info *osh, void *pkt)
{ {
struct sk_buff *nskb; struct sk_buff *nskb;
...@@ -278,7 +274,7 @@ osl_pkt_tonative(struct osl_pubinfo *osh, void *pkt) ...@@ -278,7 +274,7 @@ osl_pkt_tonative(struct osl_pubinfo *osh, void *pkt)
return (struct sk_buff *)pkt; return (struct sk_buff *)pkt;
} }
#define PKTTONATIVE(osh, pkt) \ #define PKTTONATIVE(osh, pkt) \
osl_pkt_tonative((struct osl_pubinfo *)(osh), (pkt)) osl_pkt_tonative((osh), (pkt))
#else /* !BRCM_FULLMAC */ #else /* !BRCM_FULLMAC */
#define PKTSETSKIPCT(osh, skb) #define PKTSETSKIPCT(osh, skb)
#define PKTCLRSKIPCT(osh, skb) #define PKTCLRSKIPCT(osh, skb)
......
...@@ -128,7 +128,7 @@ extern uint si_coreid(si_t *sih); ...@@ -128,7 +128,7 @@ extern uint si_coreid(si_t *sih);
extern uint si_flag(si_t *sih); extern uint si_flag(si_t *sih);
extern uint si_coreidx(si_t *sih); extern uint si_coreidx(si_t *sih);
extern uint si_corerev(si_t *sih); extern uint si_corerev(si_t *sih);
extern void *si_osh(si_t *sih); struct osl_info *si_osh(si_t *sih);
extern uint si_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, extern uint si_corereg(si_t *sih, uint coreidx, uint regoff, uint mask,
uint val); uint val);
extern void si_write_wrapperreg(si_t *sih, u32 offset, u32 val); extern void si_write_wrapperreg(si_t *sih, u32 offset, u32 val);
......
...@@ -2733,9 +2733,9 @@ uint wlc_down(wlc_info_t *wlc) ...@@ -2733,9 +2733,9 @@ uint wlc_down(wlc_info_t *wlc)
/* Verify all packets are flushed from the driver */ /* Verify all packets are flushed from the driver */
if (wlc->osh->pub.pktalloced != 0) { if (wlc->osh->pktalloced != 0) {
WL_ERROR(("%d packets not freed at wlc_down!!!!!!\n", WL_ERROR(("%d packets not freed at wlc_down!!!!!!\n",
wlc->osh->pub.pktalloced)); wlc->osh->pktalloced));
} }
#ifdef BCMDBG #ifdef BCMDBG
/* Since all the packets should have been freed, /* Since all the packets should have been freed,
...@@ -6935,7 +6935,7 @@ wlc_recvctl(wlc_info_t *wlc, struct osl_info *osh, d11rxhdr_t *rxh, ...@@ -6935,7 +6935,7 @@ wlc_recvctl(wlc_info_t *wlc, struct osl_info *osh, d11rxhdr_t *rxh,
ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p); ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p);
WLCNTINCR(wlc->pub->_cnt->ieee_rx); WLCNTINCR(wlc->pub->_cnt->ieee_rx);
osh->pub.pktalloced--; osh->pktalloced--;
return; return;
} }
......
...@@ -53,14 +53,14 @@ struct osl_info *osl_attach(void *pdev, uint bustype) ...@@ -53,14 +53,14 @@ struct osl_info *osl_attach(void *pdev, uint bustype)
case PCI_BUS: case PCI_BUS:
case SI_BUS: case SI_BUS:
case PCMCIA_BUS: case PCMCIA_BUS:
osh->pub.mmbus = true; osh->mmbus = true;
break; break;
case JTAG_BUS: case JTAG_BUS:
case SDIO_BUS: case SDIO_BUS:
case USB_BUS: case USB_BUS:
case SPI_BUS: case SPI_BUS:
case RPC_BUS: case RPC_BUS:
osh->pub.mmbus = false; osh->mmbus = false;
break; break;
default: default:
ASSERT(false); ASSERT(false);
...@@ -88,7 +88,7 @@ void *BCMFASTPATH osl_pktget(struct osl_info *osh, uint len) ...@@ -88,7 +88,7 @@ void *BCMFASTPATH osl_pktget(struct osl_info *osh, uint len)
skb_put(skb, len); skb_put(skb, len);
skb->priority = 0; skb->priority = 0;
osh->pub.pktalloced++; osh->pktalloced++;
} }
return (void *)skb; return (void *)skb;
...@@ -119,7 +119,7 @@ void BCMFASTPATH osl_pktfree(struct osl_info *osh, void *p, bool send) ...@@ -119,7 +119,7 @@ void BCMFASTPATH osl_pktfree(struct osl_info *osh, void *p, bool send)
*/ */
dev_kfree_skb(skb); dev_kfree_skb(skb);
osh->pub.pktalloced--; osh->pktalloced--;
nest++; nest++;
skb = nskb; skb = nskb;
} }
......
...@@ -729,7 +729,7 @@ void si_detach(si_t *sih) ...@@ -729,7 +729,7 @@ void si_detach(si_t *sih)
kfree(sii); kfree(sii);
} }
void *si_osh(si_t *sih) struct osl_info *si_osh(si_t *sih)
{ {
si_info_t *sii; si_info_t *sii;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment