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 @@
#ifndef _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 */
struct osl_info {
struct osl_pubinfo pub;
uint pktalloced; /* Number of allocated packet buffers */
bool mmbus; /* Bus supports memory-mapped registers */
uint magic;
void *pdev;
uint bustype;
......@@ -106,10 +102,10 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
#if defined(BCMSDIO)
#define SELECT_BUS_WRITE(osh, mmap_op, bus_op) \
if (((struct osl_pubinfo *)(osh))->mmbus) \
if ((osh)->mmbus) \
mmap_op else 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
#define SELECT_BUS_WRITE(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);
#ifdef BRCM_FULLMAC
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;
......@@ -265,10 +261,10 @@ osl_pkt_frmnative(struct osl_pubinfo *osh, struct sk_buff *skb)
return (void *)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 *
osl_pkt_tonative(struct osl_pubinfo *osh, void *pkt)
osl_pkt_tonative(struct osl_info *osh, void *pkt)
{
struct sk_buff *nskb;
......@@ -278,7 +274,7 @@ osl_pkt_tonative(struct osl_pubinfo *osh, void *pkt)
return (struct sk_buff *)pkt;
}
#define PKTTONATIVE(osh, pkt) \
osl_pkt_tonative((struct osl_pubinfo *)(osh), (pkt))
osl_pkt_tonative((osh), (pkt))
#else /* !BRCM_FULLMAC */
#define PKTSETSKIPCT(osh, skb)
#define PKTCLRSKIPCT(osh, skb)
......
......@@ -128,7 +128,7 @@ extern uint si_coreid(si_t *sih);
extern uint si_flag(si_t *sih);
extern uint si_coreidx(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,
uint val);
extern void si_write_wrapperreg(si_t *sih, u32 offset, u32 val);
......
......@@ -2733,9 +2733,9 @@ uint wlc_down(wlc_info_t *wlc)
/* 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",
wlc->osh->pub.pktalloced));
wlc->osh->pktalloced));
}
#ifdef BCMDBG
/* 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,
ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p);
WLCNTINCR(wlc->pub->_cnt->ieee_rx);
osh->pub.pktalloced--;
osh->pktalloced--;
return;
}
......
......@@ -53,14 +53,14 @@ struct osl_info *osl_attach(void *pdev, uint bustype)
case PCI_BUS:
case SI_BUS:
case PCMCIA_BUS:
osh->pub.mmbus = true;
osh->mmbus = true;
break;
case JTAG_BUS:
case SDIO_BUS:
case USB_BUS:
case SPI_BUS:
case RPC_BUS:
osh->pub.mmbus = false;
osh->mmbus = false;
break;
default:
ASSERT(false);
......@@ -88,7 +88,7 @@ void *BCMFASTPATH osl_pktget(struct osl_info *osh, uint len)
skb_put(skb, len);
skb->priority = 0;
osh->pub.pktalloced++;
osh->pktalloced++;
}
return (void *)skb;
......@@ -119,7 +119,7 @@ void BCMFASTPATH osl_pktfree(struct osl_info *osh, void *p, bool send)
*/
dev_kfree_skb(skb);
osh->pub.pktalloced--;
osh->pktalloced--;
nest++;
skb = nskb;
}
......
......@@ -729,7 +729,7 @@ void si_detach(si_t *sih)
kfree(sii);
}
void *si_osh(si_t *sih)
struct osl_info *si_osh(si_t *sih)
{
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