]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
staging: brcm80211: replaced typedef by struct for several sdio types
[mv-sheeva.git] / drivers / staging / brcm80211 / brcmfmac / dhd_sdio.c
index 905afbc92b4a80dc038d875f3287ad26d7d2bbc5..c00f0f2507be9e4b88e4a18ad778464268ceff5e 100644 (file)
@@ -460,7 +460,7 @@ struct chip_info {
 typedef struct dhd_bus {
        dhd_pub_t *dhd;
 
-       bcmsdh_info_t *sdh;     /* Handle for BCMSDH calls */
+       struct brcmf_sdio *sdh; /* Handle for BCMSDH calls */
        struct chip_info *ci;   /* Chip info struct */
        char *vars;             /* Variables (from CIS and/or other) */
        uint varsz;             /* Size of variables buffer */
@@ -650,16 +650,16 @@ static int tx_packets[NUMPRIO];
 #endif                         /* DHD_DEBUG */
 
 /* Deferred transmit */
-const uint dhd_deferred_tx = 1;
+const uint brcmf_deferred_tx = 1;
 
 /* Tx/Rx bounds */
-uint dhd_txbound;
-uint dhd_rxbound;
+uint brcmf_txbound;
+uint brcmf_rxbound;
 uint dhd_txminmax;
 
 /* override the RAM size if possible */
 #define DONGLE_MIN_MEMSIZE (128 * 1024)
-int dhd_dongle_memsize;
+int brcmf_dongle_memsize;
 
 static bool dhd_alignctl;
 
@@ -786,9 +786,9 @@ static int  _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus);
 static int
 brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *image_path);
 static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus);
-static void brcmf_sdbrcm_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase);
+static void brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase);
 static int brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs);
-static void brcmf_sdbrcm_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase);
+static void brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase);
 static void brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus,
                                        u32 drivestrength);
 static void brcmf_sdbrcm_chip_detach(struct dhd_bus *bus);
@@ -807,10 +807,10 @@ static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size)
        s32 min_size = DONGLE_MIN_MEMSIZE;
        /* Restrict the memsize to user specified limit */
        DHD_ERROR(("user: Restrict the dongle ram size to %d, min %d\n",
-               dhd_dongle_memsize, min_size));
-       if ((dhd_dongle_memsize > min_size) &&
-           (dhd_dongle_memsize < (s32) bus->orig_ramsize))
-               bus->ramsize = dhd_dongle_memsize;
+               brcmf_dongle_memsize, min_size));
+       if ((brcmf_dongle_memsize > min_size) &&
+           (brcmf_dongle_memsize < (s32) bus->orig_ramsize))
+               bus->ramsize = brcmf_dongle_memsize;
 }
 
 static int brcmf_sdbrcm_set_siaddr_window(dhd_bus_t *bus, u32 address)
@@ -835,7 +835,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
 {
        int err;
        u8 clkctl, clkreq, devctl;
-       bcmsdh_info_t *sdh;
+       struct brcmf_sdio *sdh;
 
        DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -1044,7 +1044,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
 
 int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
 {
-       bcmsdh_info_t *sdh = bus->sdh;
+       struct brcmf_sdio *sdh = bus->sdh;
        struct sdpcmd_regs *regs = bus->regs;
        uint retries = 0;
 
@@ -1177,7 +1177,7 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
        u16 len, pad = 0;
        u32 swheader;
        uint retries = 0;
-       bcmsdh_info_t *sdh;
+       struct brcmf_sdio *sdh;
        struct sk_buff *new;
        int i;
 
@@ -1363,7 +1363,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
 
        /* Check for existing queue, current flow-control,
                         pending event, or pending clock */
-       if (dhd_deferred_tx || bus->fcstate || pktq_len(&bus->txq)
+       if (brcmf_deferred_tx || bus->fcstate || pktq_len(&bus->txq)
            || bus->dpc_sched || (!DATAOK(bus))
            || (bus->flowcontrol & NBITVAL(prec))
            || (bus->clkstate != CLK_AVAIL)) {
@@ -1392,7 +1392,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
                        qcount[prec] = pktq_plen(&bus->txq, prec);
 #endif
                /* Schedule DPC if needed to send queued packet(s) */
-               if (dhd_deferred_tx && !bus->dpc_sched) {
+               if (brcmf_deferred_tx && !bus->dpc_sched) {
                        bus->dpc_sched = true;
                        brcmf_sched_dpc(bus->dhd);
                }
@@ -1496,7 +1496,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
        u16 len;
        u32 swheader;
        uint retries = 0;
-       bcmsdh_info_t *sdh = bus->sdh;
+       struct brcmf_sdio *sdh = bus->sdh;
        u8 doff = 0;
        int ret = -1;
        int i;
@@ -2703,21 +2703,21 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
                break;
 
        case IOV_GVAL(IOV_TXBOUND):
-               int_val = (s32) dhd_txbound;
+               int_val = (s32) brcmf_txbound;
                memcpy(arg, &int_val, val_size);
                break;
 
        case IOV_SVAL(IOV_TXBOUND):
-               dhd_txbound = (uint) int_val;
+               brcmf_txbound = (uint) int_val;
                break;
 
        case IOV_GVAL(IOV_RXBOUND):
-               int_val = (s32) dhd_rxbound;
+               int_val = (s32) brcmf_rxbound;
                memcpy(arg, &int_val, val_size);
                break;
 
        case IOV_SVAL(IOV_RXBOUND):
-               dhd_rxbound = (uint) int_val;
+               brcmf_rxbound = (uint) int_val;
                break;
 
        case IOV_GVAL(IOV_TXMINMAX):
@@ -3199,7 +3199,7 @@ exit:
 
 static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
 {
-       bcmsdh_info_t *sdh = bus->sdh;
+       struct brcmf_sdio *sdh = bus->sdh;
        struct sdpcmd_regs *regs = bus->regs;
        uint retries = 0;
        u16 lastrbc;
@@ -3263,7 +3263,7 @@ static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
 static void
 brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
 {
-       bcmsdh_info_t *sdh = bus->sdh;
+       struct brcmf_sdio *sdh = bus->sdh;
        uint rdlen, pad;
 
        int sdret;
@@ -3771,7 +3771,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
 static uint
 brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 {
-       bcmsdh_info_t *sdh = bus->sdh;
+       struct brcmf_sdio *sdh = bus->sdh;
 
        u16 len, check; /* Extracted hardware header fields */
        u8 chan, seq, doff;     /* Extracted software header fields */
@@ -4439,12 +4439,12 @@ static u32 brcmf_sdbrcm_hostmail(dhd_bus_t *bus)
 
 bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
 {
-       bcmsdh_info_t *sdh = bus->sdh;
+       struct brcmf_sdio *sdh = bus->sdh;
        struct sdpcmd_regs *regs = bus->regs;
        u32 intstatus, newstatus = 0;
        uint retries = 0;
-       uint rxlimit = dhd_rxbound;     /* Rx frames to read before resched */
-       uint txlimit = dhd_txbound;     /* Tx frames to send before resched */
+       uint rxlimit = brcmf_rxbound;   /* Rx frames to read before resched */
+       uint txlimit = brcmf_txbound;   /* Tx frames to send before resched */
        uint framecnt = 0;      /* Temporary counter of tx/rx frames */
        bool rxdone = true;     /* Flag for no more read data */
        bool resched = false;   /* Flag indicating resched wanted */
@@ -4706,7 +4706,7 @@ bool dhd_bus_dpc(struct dhd_bus *bus)
 void brcmf_sdbrcm_isr(void *arg)
 {
        dhd_bus_t *bus = (dhd_bus_t *) arg;
-       bcmsdh_info_t *sdh;
+       struct brcmf_sdio *sdh;
 
        DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -5201,13 +5201,13 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
         * first time that the driver is initialized vs subsequent
         * initializations.
         */
-       dhd_txbound = DHD_TXBOUND;
-       dhd_rxbound = DHD_RXBOUND;
+       brcmf_txbound = DHD_TXBOUND;
+       brcmf_rxbound = DHD_RXBOUND;
        dhd_alignctl = true;
        sd1idle = true;
        dhd_readahead = true;
        retrydata = false;
-       dhd_dongle_memsize = 0;
+       brcmf_dongle_memsize = 0;
        dhd_txminmax = DHD_TXMINMAX;
 
        forcealign = true;
@@ -5402,8 +5402,8 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
                        goto fail;
                }
                bus->ramsize = bus->orig_ramsize;
-               if (dhd_dongle_memsize)
-                       brcmf_sdbrcm_setmemsize(bus, dhd_dongle_memsize);
+               if (brcmf_dongle_memsize)
+                       brcmf_sdbrcm_setmemsize(bus, brcmf_dongle_memsize);
 
                DHD_ERROR(("DHD: dongle ram size is set to %d(orig %d)\n",
                           bus->ramsize, bus->orig_ramsize));
@@ -5632,7 +5632,7 @@ static void brcmf_sdbrcm_disconnect(void *ptr)
  * order to look for or await the device.
  */
 
-static bcmsdh_driver_t dhd_sdio = {
+static struct brcmf_sdioh_driver dhd_sdio = {
        brcmf_sdbrcm_probe,
        brcmf_sdbrcm_disconnect
 };
@@ -6000,7 +6000,7 @@ int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
 }
 
 static int
-brcmf_sdbrcm_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci,
+brcmf_sdbrcm_chip_recognition(struct brcmf_sdio *sdh, struct chip_info *ci,
                            void *regs)
 {
        u32 regdata;
@@ -6059,7 +6059,7 @@ brcmf_sdbrcm_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci,
 }
 
 static void
-brcmf_sdbrcm_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase)
+brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase)
 {
        u32 regdata;
 
@@ -6235,7 +6235,7 @@ fail:
 }
 
 static void
-brcmf_sdbrcm_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase)
+brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase)
 {
        u32 regdata;