From 3c9d4c3749a712fa370289b54f40b157c336c8f3 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Wed, 2 Mar 2011 21:18:48 +0100 Subject: [PATCH] staging: brcm80211: remove struct osl_info from driver sources The struct osl_info was being used only in attach functions but previous changes make the entire usage of this structure obsolete. Reviewed-by: Brett Rudley Reviewed-by: Henry Ptasinski Reviewed-by: Roland Vossen Signed-off-by: Arend van Spriel Signed-off-by: Greg Kroah-Hartman --- drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 2 +- drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 7 +-- drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 21 ++----- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 3 +- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 4 +- drivers/staging/brcm80211/brcmfmac/dhd.h | 7 +-- drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 14 +---- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 68 ++++++++--------------- drivers/staging/brcm80211/brcmsmac/wl_mac80211.c | 2 +- drivers/staging/brcm80211/brcmsmac/wlc_bmac.c | 10 ++-- drivers/staging/brcm80211/brcmsmac/wlc_main.c | 5 +- drivers/staging/brcm80211/brcmsmac/wlc_main.h | 1 - drivers/staging/brcm80211/brcmsmac/wlc_pub.h | 5 +- drivers/staging/brcm80211/include/bcmsdh.h | 6 +- drivers/staging/brcm80211/include/hnddma.h | 3 +- drivers/staging/brcm80211/include/siutils.h | 6 +- drivers/staging/brcm80211/util/hnddma.c | 8 +-- 17 files changed, 52 insertions(+), 120 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h index 99e075b..53c3291 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h @@ -46,7 +46,7 @@ typedef void (*sdioh_cb_fn_t) (void *); * The handler shall be provided by all subsequent calls. No local cache * cfghdl points to the starting address of pci device mapped memory */ -extern sdioh_info_t *sdioh_attach(struct osl_info *osh, void *cfghdl, uint irq); +extern sdioh_info_t *sdioh_attach(void *cfghdl, uint irq); extern SDIOH_API_RC sdioh_detach(sdioh_info_t *si); extern SDIOH_API_RC sdioh_interrupt_register(sdioh_info_t *si, sdioh_cb_fn_t fn, void *argh); diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c index 22c8f8d..6180f64 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c @@ -38,7 +38,6 @@ struct bcmsdh_info { bool init_success; /* underlying driver successfully attached */ void *sdioh; /* handler for sdioh */ u32 vendevid; /* Target Vendor and Device ID on SD bus */ - struct osl_info *osh; bool regfail; /* Save status of last reg_read/reg_write call */ u32 sbwad; /* Save backplane window address */ @@ -55,8 +54,7 @@ void bcmsdh_enable_hw_oob_intr(bcmsdh_info_t *sdh, bool enable) } #endif -bcmsdh_info_t *bcmsdh_attach(struct osl_info *osh, void *cfghdl, - void **regsva, uint irq) +bcmsdh_info_t *bcmsdh_attach(void *cfghdl, void **regsva, uint irq) { bcmsdh_info_t *bcmsdh; @@ -69,13 +67,12 @@ bcmsdh_info_t *bcmsdh_attach(struct osl_info *osh, void *cfghdl, /* save the handler locally */ l_bcmsdh = bcmsdh; - bcmsdh->sdioh = sdioh_attach(osh, cfghdl, irq); + bcmsdh->sdioh = sdioh_attach(cfghdl, irq); if (!bcmsdh->sdioh) { bcmsdh_detach(bcmsdh); return NULL; } - bcmsdh->osh = osh; bcmsdh->init_success = true; *regsva = (u32 *) SI_ENUM_BASE; diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c index 6292f4f..6842e73 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c @@ -56,7 +56,6 @@ struct bcmsdh_hc { #else struct pci_dev *dev; /* pci device handle */ #endif /* BCMPLATFORM_BUS */ - struct osl_info *osh; void *regs; /* SDIO Host Controller address */ bcmsdh_info_t *sdh; /* SDIO Host Controller handle */ void *ch; @@ -142,7 +141,6 @@ static #endif /* BCMLXSDMMC */ int bcmsdh_probe(struct device *dev) { - struct osl_info *osh = NULL; bcmsdh_hc_t *sdhc = NULL; unsigned long regs = 0; bcmsdh_info_t *sdh = NULL; @@ -177,28 +175,21 @@ int bcmsdh_probe(struct device *dev) } #endif /* defined(OOB_INTR_ONLY) */ /* allocate SDIO Host Controller state info */ - osh = osl_attach(dev, PCI_BUS); - if (!osh) { - SDLX_MSG(("%s: osl_attach failed\n", __func__)); - goto err; - } sdhc = kzalloc(sizeof(bcmsdh_hc_t), GFP_ATOMIC); if (!sdhc) { SDLX_MSG(("%s: out of memory\n", __func__)); goto err; } - sdhc->osh = osh; - sdhc->dev = (void *)dev; #ifdef BCMLXSDMMC - sdh = bcmsdh_attach(osh, (void *)0, (void **)®s, irq); + sdh = bcmsdh_attach((void *)0, (void **)®s, irq); if (!sdh) { SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__)); goto err; } #else - sdh = bcmsdh_attach(osh, (void *)r->start, (void **)®s, irq); + sdh = bcmsdh_attach((void *)r->start, (void **)®s, irq); if (!sdh) { SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__)); goto err; @@ -220,7 +211,7 @@ int bcmsdh_probe(struct device *dev) /* try to attach to the target device */ sdhc->ch = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF), - 0, 0, 0, 0, (void *)regs, NULL, sdh); + 0, 0, 0, 0, (void *)regs, sdh); if (!sdhc->ch) { SDLX_MSG(("%s: device attach failed\n", __func__)); goto err; @@ -235,8 +226,7 @@ err: bcmsdh_detach(sdhc->sdh); kfree(sdhc); } - if (osh) - osl_detach(osh); + return -ENODEV; } @@ -246,7 +236,6 @@ static int bcmsdh_remove(struct device *dev) { bcmsdh_hc_t *sdhc, *prev; - struct osl_info *osh; sdhc = sdhcinfo; drvinfo.detach(sdhc->ch); @@ -269,9 +258,7 @@ int bcmsdh_remove(struct device *dev) } /* release SDIO Host Controller info */ - osh = sdhc->osh; kfree(sdhc); - osl_detach(osh); #if !defined(BCMLXSDMMC) dev_set_drvdata(dev, NULL); diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c index ef75219..e69b77f 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c @@ -111,7 +111,7 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd) /* * Public entry points & extern's */ -extern sdioh_info_t *sdioh_attach(struct osl_info *osh, void *bar0, uint irq) +sdioh_info_t *sdioh_attach(void *bar0, uint irq) { sdioh_info_t *sd; int err_ret; @@ -128,7 +128,6 @@ extern sdioh_info_t *sdioh_attach(struct osl_info *osh, void *bar0, uint irq) sd_err(("sdioh_attach: out of memory\n")); return NULL; } - sd->osh = osh; if (sdioh_sdmmc_osinit(sd) != 0) { sd_err(("%s:sdioh_sdmmc_osinit() failed\n", __func__)); kfree(sd); diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h index 50470f6..3ef42b3 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h @@ -118,8 +118,8 @@ extern void sdioh_sdmmc_devintr_off(sdioh_info_t *sd); */ /* Register mapping routines */ -extern u32 *sdioh_sdmmc_reg_map(struct osl_info *osh, s32 addr, int size); -extern void sdioh_sdmmc_reg_unmap(struct osl_info *osh, s32 addr, int size); +extern u32 *sdioh_sdmmc_reg_map(s32 addr, int size); +extern void sdioh_sdmmc_reg_unmap(s32 addr, int size); /* Interrupt (de)registration routines */ extern int sdioh_sdmmc_register_irq(sdioh_info_t *sd, uint irq); diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h index a78b20a..60cf782 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd.h +++ b/drivers/staging/brcm80211/brcmfmac/dhd.h @@ -52,7 +52,6 @@ enum dhd_bus_state { /* Common structure for module and instance linkage */ typedef struct dhd_pub { /* Linkage ponters */ - struct osl_info *osh; /* OSL handle */ struct dhd_bus *bus; /* Bus module handle */ struct dhd_prot *prot; /* Protocol module handle */ struct dhd_info *info; /* Info module handle */ @@ -213,16 +212,12 @@ typedef struct dhd_if_event { * Exported from dhd OS modules (dhd_linux/dhd_ndis) */ -/* To allow osl_attach/detach calls from os-independent modules */ -struct osl_info *dhd_osl_attach(void *pdev, uint bustype); -void dhd_osl_detach(struct osl_info *osh); - /* Indication from bus module regarding presence/insertion of dongle. * Return dhd_pub_t pointer, used as handle to OS module in later calls. * Returned structure should have bus and prot pointers filled in. * bus_hdrlen specifies required headroom for bus module header. */ -extern dhd_pub_t *dhd_attach(struct osl_info *osh, struct dhd_bus *bus, +extern dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen); extern int dhd_net_attach(dhd_pub_t *dhdp, int idx); diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c index 4962650..870f3be 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c @@ -1858,16 +1858,6 @@ static int dhd_open(struct net_device *net) return ret; } -struct osl_info *dhd_osl_attach(void *pdev, uint bustype) -{ - return osl_attach(pdev, bustype); -} - -void dhd_osl_detach(struct osl_info *osh) -{ - osl_detach(osh); -} - int dhd_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name, u8 *mac_addr, u32 flags, u8 bssidx) @@ -1921,8 +1911,7 @@ void dhd_del_if(dhd_info_t *dhd, int ifidx) up(&dhd->sysioc_sem); } -dhd_pub_t *dhd_attach(struct osl_info *osh, struct dhd_bus *bus, - uint bus_hdrlen) +dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen) { dhd_info_t *dhd = NULL; struct net_device *net; @@ -1955,7 +1944,6 @@ dhd_pub_t *dhd_attach(struct osl_info *osh, struct dhd_bus *bus, * Save the dhd_info into the priv */ memcpy(netdev_priv(net), &dhd, sizeof(dhd)); - dhd->pub.osh = osh; /* Set network interface name if it was provided as module parameter */ if (iface_name[0]) { diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c index 060a5e0..bb62576 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c @@ -362,7 +362,7 @@ extern void bcmsdh_enable_hw_oob_intr(void *sdh, bool enable); #if defined(OOB_INTR_ONLY) && defined(SDIO_ISR_THREAD) #error OOB_INTR_ONLY is NOT working with SDIO_ISR_THREAD #endif /* defined(OOB_INTR_ONLY) && defined(SDIO_ISR_THREAD) */ -#define PKTALIGN(_osh, _p, _len, _align) \ +#define PKTALIGN(_p, _len, _align) \ do { \ uint datalign; \ datalign = (unsigned long)((_p)->data); \ @@ -436,7 +436,7 @@ static int dhdsdio_mem_dump(dhd_bus_t *bus); #endif /* DHD_DEBUG */ static int dhdsdio_download_state(dhd_bus_t *bus, bool enter); -static void dhdsdio_release(dhd_bus_t *bus, struct osl_info *osh); +static void dhdsdio_release(dhd_bus_t *bus); static void dhdsdio_release_malloc(dhd_bus_t *bus); static void dhdsdio_disconnect(void *ptr); static bool dhdsdio_chipmatch(u16 chipid); @@ -911,7 +911,6 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan, bool free_pkt) { int ret; - struct osl_info *osh; u8 *frame; u16 len, pad = 0; u32 swheader; @@ -923,7 +922,6 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan, DHD_TRACE(("%s: Enter\n", __func__)); sdh = bus->sdh; - osh = bus->dhd->osh; if (bus->dhd->dongle_reset) { ret = BCME_NOTREADY; @@ -948,7 +946,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan, goto done; } - PKTALIGN(osh, new, pkt->len, DHD_SDALIGN); + PKTALIGN(new, pkt->len, DHD_SDALIGN); memcpy(new->data, pkt->data, pkt->len); if (free_pkt) pkt_buf_free_skb(pkt); @@ -1073,12 +1071,10 @@ done: int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt) { int ret = BCME_ERROR; - struct osl_info *osh; uint datalen, prec; DHD_TRACE(("%s: Enter\n", __func__)); - osh = bus->dhd->osh; datalen = pkt->len; #ifdef SDTEST @@ -2484,9 +2480,6 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid, __func__, bool_val, bus->dhd->dongle_reset, bus->dhd->busstate)); - ASSERT(bus->dhd->osh); - /* ASSERT(bus->cl_devid); */ - dhd_bus_devreset(bus->dhd, (u8) bool_val); break; @@ -3259,7 +3252,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq) } /* Adhere to start alignment requirements */ - PKTALIGN(osh, pnext, sublen, DHD_SDALIGN); + PKTALIGN(pnext, sublen, DHD_SDALIGN); } /* If all allocations succeeded, save packet chain @@ -3739,7 +3732,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) bus->usebufpool = true; ASSERT(!(pkt->prev)); - PKTALIGN(osh, pkt, rdlen, DHD_SDALIGN); + PKTALIGN(pkt, rdlen, DHD_SDALIGN); rxbuf = (u8 *) (pkt->data); /* Read the entire frame */ sdret = @@ -4108,7 +4101,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) /* Leave room for what we already read, and align remainder */ ASSERT(firstread < pkt->len); skb_pull(pkt, firstread); - PKTALIGN(osh, pkt, rdlen, DHD_SDALIGN); + PKTALIGN(pkt, rdlen, DHD_SDALIGN); /* Read the remaining frame data */ sdret = @@ -4635,7 +4628,6 @@ static void dhdsdio_pktgen(dhd_bus_t *bus) u8 *data; uint pktcount; uint fillbyte; - struct osl_info *osh = bus->dhd->osh; u16 len; /* Display current count if appropriate */ @@ -4663,14 +4655,14 @@ static void dhdsdio_pktgen(dhd_bus_t *bus) /* Allocate an appropriate-sized packet */ len = bus->pktgen_len; - pkt = pkt_buf_get_skb(osh, + pkt = pkt_buf_get_skb( (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN), true); if (!pkt) { DHD_ERROR(("%s: pkt_buf_get_skb failed!\n", __func__)); break; } - PKTALIGN(osh, pkt, (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN), + PKTALIGN(pkt, (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN), DHD_SDALIGN); data = (u8 *) (pkt->data) + SDPCM_HDRLEN; @@ -4694,7 +4686,7 @@ static void dhdsdio_pktgen(dhd_bus_t *bus) default: DHD_ERROR(("Unrecognized pktgen mode %d\n", bus->pktgen_mode)); - pkt_buf_free_skb(osh, pkt, true); + pkt_buf_free_skb(pkt, true); bus->pktgen_count = 0; return; } @@ -4740,16 +4732,15 @@ static void dhdsdio_sdtest_set(dhd_bus_t *bus, bool start) { struct sk_buff *pkt; u8 *data; - struct osl_info *osh = bus->dhd->osh; /* Allocate the packet */ - pkt = pkt_buf_get_skb(osh, SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN, + pkt = pkt_buf_get_skb(SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN, true); if (!pkt) { DHD_ERROR(("%s: pkt_buf_get_skb failed!\n", __func__)); return; } - PKTALIGN(osh, pkt, (SDPCM_HDRLEN + SDPCM_TEST_HDRLEN), DHD_SDALIGN); + PKTALIGN(pkt, (SDPCM_HDRLEN + SDPCM_TEST_HDRLEN), DHD_SDALIGN); data = (u8 *) (pkt->data) + SDPCM_HDRLEN; /* Fill in the test header */ @@ -4765,7 +4756,6 @@ static void dhdsdio_sdtest_set(dhd_bus_t *bus, bool start) static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) { - struct osl_info *osh = bus->dhd->osh; u8 *data; uint pktlen; @@ -4779,7 +4769,7 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) if (pktlen < SDPCM_TEST_HDRLEN) { DHD_ERROR(("dhdsdio_restrcv: toss runt frame, pktlen %d\n", pktlen)); - pkt_buf_free_skb(osh, pkt, false); + pkt_buf_free_skb(pkt, false); return; } @@ -4797,7 +4787,7 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) DHD_ERROR(("dhdsdio_testrcv: frame length mismatch, " "pktlen %d seq %d" " cmd %d extra %d len %d\n", pktlen, seq, cmd, extra, len)); - pkt_buf_free_skb(osh, pkt, false); + pkt_buf_free_skb(pkt, false); return; } } @@ -4812,14 +4802,14 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) bus->pktgen_sent++; } else { bus->pktgen_fail++; - pkt_buf_free_skb(osh, pkt, false); + pkt_buf_free_skb(pkt, false); } bus->pktgen_rcvd++; break; case SDPCM_TEST_ECHORSP: if (bus->ext_loop) { - pkt_buf_free_skb(osh, pkt, false); + pkt_buf_free_skb(pkt, false); bus->pktgen_rcvd++; break; } @@ -4832,12 +4822,12 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) break; } } - pkt_buf_free_skb(osh, pkt, false); + pkt_buf_free_skb(pkt, false); bus->pktgen_rcvd++; break; case SDPCM_TEST_DISCARD: - pkt_buf_free_skb(osh, pkt, false); + pkt_buf_free_skb(pkt, false); bus->pktgen_rcvd++; break; @@ -4847,7 +4837,7 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) DHD_INFO(("dhdsdio_testrcv: unsupported or unknown command, " "pktlen %d seq %d" " cmd %d extra %d len %d\n", pktlen, seq, cmd, extra, len)); - pkt_buf_free_skb(osh, pkt, false); + pkt_buf_free_skb(pkt, false); break; } @@ -5066,7 +5056,7 @@ static bool dhdsdio_chipmatch(u16 chipid) static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no, u16 slot, u16 func, uint bustype, void *regsva, - struct osl_info *osh, void *sdh) + void *sdh) { int ret; dhd_bus_t *bus; @@ -5143,15 +5133,6 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no, return NULL; } - if (osh == NULL) { - /* Ask the OS interface part for an OSL handle */ - osh = dhd_osl_attach(sdh, DHD_BUS); - if (!osh) { - DHD_ERROR(("%s: osl_attach failed!\n", __func__)); - return NULL; - } - } - /* Allocate private bus interface state */ bus = kzalloc(sizeof(dhd_bus_t), GFP_ATOMIC); if (!bus) { @@ -5172,7 +5153,7 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no, } /* Attach to the dhd/OS/network interface */ - bus->dhd = dhd_attach(osh, bus, SDPCM_RESERVE); + bus->dhd = dhd_attach(bus, SDPCM_RESERVE); if (!bus->dhd) { DHD_ERROR(("%s: dhd_attach failed\n", __func__)); goto fail; @@ -5220,7 +5201,7 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no, return bus; fail: - dhdsdio_release(bus, osh); + dhdsdio_release(bus); return NULL; } @@ -5527,7 +5508,7 @@ dhdsdio_download_firmware(struct dhd_bus *bus, void *sdh) } /* Detach and free everything */ -static void dhdsdio_release(dhd_bus_t *bus, struct osl_info *osh) +static void dhdsdio_release(dhd_bus_t *bus) { DHD_TRACE(("%s: Enter\n", __func__)); @@ -5549,9 +5530,6 @@ static void dhdsdio_release(dhd_bus_t *bus, struct osl_info *osh) kfree(bus); } - if (osh) - dhd_osl_detach(osh); - DHD_TRACE(("%s: Disconnected\n", __func__)); } @@ -5604,7 +5582,7 @@ static void dhdsdio_disconnect(void *ptr) if (bus) { ASSERT(bus->dhd); - dhdsdio_release(bus, bus->dhd->osh); + dhdsdio_release(bus); } DHD_TRACE(("%s: Disconnected\n", __func__)); diff --git a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c index 2b2d1c2..9fdd775 100644 --- a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +++ b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c @@ -790,7 +790,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs, } /* common load-time initialization */ - wl->wlc = wlc_attach((void *)wl, vendor, device, unit, wl->piomode, osh, + wl->wlc = wlc_attach((void *)wl, vendor, device, unit, wl->piomode, wl->regsva, wl->bcm_bustype, btparam, &err); wl_release_fw(wl); if (!wl->wlc) { diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c b/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c index ca12d26..e419da5 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c @@ -531,8 +531,6 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme) if (wlc_hw->di[0] == 0) { /* Init FIFOs */ uint addrwidth; int dma_attach_err = 0; - struct osl_info *osh = wlc->osh; - /* Find out the DMA addressing capability and let OS know * All the channels within one DMA core have 'common-minimum' same * capability @@ -553,7 +551,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme) */ ASSERT(TX_AC_BK_FIFO == 0); ASSERT(RX_FIFO == 0); - wlc_hw->di[0] = dma_attach(osh, name, wlc_hw->sih, + wlc_hw->di[0] = dma_attach(name, wlc_hw->sih, (wme ? DMAREG(wlc_hw, DMA_TX, 0) : NULL), DMAREG(wlc_hw, DMA_RX, 0), (wme ? tune->ntxd : 0), tune->nrxd, @@ -569,7 +567,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme) */ ASSERT(TX_AC_BE_FIFO == 1); ASSERT(TX_DATA_FIFO == 1); - wlc_hw->di[1] = dma_attach(osh, name, wlc_hw->sih, + wlc_hw->di[1] = dma_attach(name, wlc_hw->sih, DMAREG(wlc_hw, DMA_TX, 1), NULL, tune->ntxd, 0, 0, -1, 0, 0, &wl_msg_level); @@ -581,7 +579,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme) * RX: UNUSED */ ASSERT(TX_AC_VI_FIFO == 2); - wlc_hw->di[2] = dma_attach(osh, name, wlc_hw->sih, + wlc_hw->di[2] = dma_attach(name, wlc_hw->sih, DMAREG(wlc_hw, DMA_TX, 2), NULL, tune->ntxd, 0, 0, -1, 0, 0, &wl_msg_level); @@ -593,7 +591,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme) */ ASSERT(TX_AC_VO_FIFO == 3); ASSERT(TX_CTL_FIFO == 3); - wlc_hw->di[3] = dma_attach(osh, name, wlc_hw->sih, + wlc_hw->di[3] = dma_attach(name, wlc_hw->sih, DMAREG(wlc_hw, DMA_TX, 3), NULL, tune->ntxd, 0, 0, -1, 0, 0, &wl_msg_level); diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_main.c b/drivers/staging/brcm80211/brcmsmac/wlc_main.c index e046727..4527fe2 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_main.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_main.c @@ -1722,8 +1722,7 @@ struct wlc_pub *wlc_pub(void *wlc) * The common driver entry routine. Error codes should be unique */ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, - struct osl_info *osh, void *regsva, uint bustype, - void *btparam, uint *perr) + void *regsva, uint bustype, void *btparam, uint *perr) { struct wlc_info *wlc; uint err = 0; @@ -1772,7 +1771,6 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, wlc = (struct wlc_info *) wlc_attach_malloc(unit, &err, device); if (wlc == NULL) goto fail; - wlc->osh = osh; pub = wlc->pub; #if defined(BCMDBG) @@ -1783,7 +1781,6 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, wlc->core = wlc->corestate; wlc->wl = wl; pub->unit = unit; - pub->osh = osh; wlc->btparam = btparam; pub->_piomode = piomode; wlc->bandinit_pending = false; diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_main.h b/drivers/staging/brcm80211/brcmsmac/wlc_main.h index b2b52d2..7c5d7e1 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_main.h +++ b/drivers/staging/brcm80211/brcmsmac/wlc_main.h @@ -488,7 +488,6 @@ struct wlc_txq_info { */ struct wlc_info { struct wlc_pub *pub; /* pointer to wlc public state */ - struct osl_info *osh; /* pointer to os handle */ struct wl_info *wl; /* pointer to os-specific private state */ d11regs_t *regs; /* pointer to device registers */ diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_pub.h b/drivers/staging/brcm80211/brcmsmac/wlc_pub.h index 0cd9891..5536f51 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_pub.h +++ b/drivers/staging/brcm80211/brcmsmac/wlc_pub.h @@ -241,7 +241,6 @@ struct wlc_pub { uint mac80211_state; uint unit; /* device instance number */ uint corerev; /* core revision */ - struct osl_info *osh; /* pointer to os handle */ si_t *sih; /* SB handle (cookie for siutils calls) */ char *vars; /* "environment" name=value */ bool up; /* interface up and running */ @@ -480,8 +479,8 @@ extern const u8 wme_fifo2ac[]; /* common functions for every port */ extern void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, - bool piomode, struct osl_info *osh, void *regsva, - uint bustype, void *btparam, uint *perr); + bool piomode, void *regsva, uint bustype, void *btparam, + uint *perr); extern uint wlc_detach(struct wlc_info *wlc); extern int wlc_up(struct wlc_info *wlc); extern uint wlc_down(struct wlc_info *wlc); diff --git a/drivers/staging/brcm80211/include/bcmsdh.h b/drivers/staging/brcm80211/include/bcmsdh.h index d27d1cb..3b57dc1 100644 --- a/drivers/staging/brcm80211/include/bcmsdh.h +++ b/drivers/staging/brcm80211/include/bcmsdh.h @@ -49,8 +49,7 @@ typedef void (*bcmsdh_cb_fn_t) (void *); * implementation may maintain a single "default" handle (e.g. the first or * most recent one) to enable single-instance implementations to pass NULL. */ -extern bcmsdh_info_t *bcmsdh_attach(struct osl_info *osh, void *cfghdl, - void **regsva, uint irq); +extern bcmsdh_info_t *bcmsdh_attach(void *cfghdl, void **regsva, uint irq); /* Detach - freeup resources allocated in attach */ extern int bcmsdh_detach(void *sdh); @@ -183,8 +182,7 @@ extern void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh); typedef struct { /* attach to device */ void *(*attach) (u16 vend_id, u16 dev_id, u16 bus, u16 slot, - u16 func, uint bustype, void *regsva, - struct osl_info *osh, void *param); + u16 func, uint bustype, void *regsva, void *param); /* detach from device */ void (*detach) (void *ch); } bcmsdh_driver_t; diff --git a/drivers/staging/brcm80211/include/hnddma.h b/drivers/staging/brcm80211/include/hnddma.h index 3638983..121768e 100644 --- a/drivers/staging/brcm80211/include/hnddma.h +++ b/drivers/staging/brcm80211/include/hnddma.h @@ -148,8 +148,7 @@ struct hnddma_pub { uint txnobuf; /* tx out of dma descriptors */ }; -extern struct hnddma_pub *dma_attach(struct osl_info *osh, char *name, - si_t *sih, +extern struct hnddma_pub *dma_attach(char *name, si_t *sih, void *dmaregstx, void *dmaregsrx, uint ntxd, uint nrxd, uint rxbufsize, int rxextheadroom, uint nrxpost, uint rxoffset, uint *msg_level); diff --git a/drivers/staging/brcm80211/include/siutils.h b/drivers/staging/brcm80211/include/siutils.h index a95e925..101e9a4 100644 --- a/drivers/staging/brcm80211/include/siutils.h +++ b/drivers/staging/brcm80211/include/siutils.h @@ -328,9 +328,9 @@ extern void si_epa_4313war(si_t *sih); char *si_getnvramflvar(si_t *sih, const char *name); /* AMBA Interconnect exported externs */ -extern si_t *ai_attach(uint pcidev, struct osl_info *osh, void *regs, - uint bustype, void *sdh, char **vars, uint *varsz); -extern si_t *ai_kattach(struct osl_info *osh); +extern si_t *ai_attach(uint pcidev, void *regs, uint bustype, + void *sdh, char **vars, uint *varsz); +extern si_t *ai_kattach(void); extern void ai_scan(si_t *sih, void *regs, uint devid); extern uint ai_flag(si_t *sih); diff --git a/drivers/staging/brcm80211/util/hnddma.c b/drivers/staging/brcm80211/util/hnddma.c index c82de14..5508147 100644 --- a/drivers/staging/brcm80211/util/hnddma.c +++ b/drivers/staging/brcm80211/util/hnddma.c @@ -80,7 +80,6 @@ typedef struct dma_info { uint *msg_level; /* message level pointer */ char name[MAXNAMEL]; /* callers name for diag msgs */ - struct osl_info *osh; /* os handle */ void *pbus; /* bus handle */ bool dma64; /* this dma engine is operating in 64-bit mode */ @@ -276,7 +275,7 @@ const di_fcn_t dma64proc = { 39 }; -struct hnddma_pub *dma_attach(struct osl_info *osh, char *name, si_t *sih, +struct hnddma_pub *dma_attach(char *name, si_t *sih, void *dmaregstx, void *dmaregsrx, uint ntxd, uint nrxd, uint rxbufsize, int rxextheadroom, uint nrxpost, uint rxoffset, uint *msg_level) @@ -324,9 +323,9 @@ struct hnddma_pub *dma_attach(struct osl_info *osh, char *name, si_t *sih, di->hnddma.di_fn->ctrlflags(&di->hnddma, DMA_CTRL_ROC | DMA_CTRL_PEN, 0); - DMA_TRACE(("%s: dma_attach: %s osh %p flags 0x%x ntxd %d nrxd %d " + DMA_TRACE(("%s: dma_attach: %s flags 0x%x ntxd %d nrxd %d " "rxbufsize %d rxextheadroom %d nrxpost %d rxoffset %d " - "dmaregstx %p dmaregsrx %p\n", name, "DMA64", osh, + "dmaregstx %p dmaregsrx %p\n", name, "DMA64", di->hnddma.dmactrlflags, ntxd, nrxd, rxbufsize, rxextheadroom, nrxpost, rxoffset, dmaregstx, dmaregsrx)); @@ -334,7 +333,6 @@ struct hnddma_pub *dma_attach(struct osl_info *osh, char *name, si_t *sih, strncpy(di->name, name, MAXNAMEL); di->name[MAXNAMEL - 1] = '\0'; - di->osh = osh; di->pbus = ((struct si_info *)sih)->pbus; /* save tunables */ -- 2.7.4