Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/next/external/cache/sources/wl/include/bcmsdh_sdmmc.h
Views: 3960
/*1* BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel2*3* Copyright (C) 1999-2013, Broadcom Corporation4*5* Unless you and Broadcom execute a separate written software license6* agreement governing use of this software, this software is licensed to you7* under the terms of the GNU General Public License version 2 (the "GPL"),8* available at http://www.broadcom.com/licenses/GPLv2.php, with the9* following added to such license:10*11* As a special exception, the copyright holders of this software give you12* permission to link this software with independent modules, and to copy and13* distribute the resulting executable under terms of your choice, provided that14* you also meet, for each linked independent module, the terms and conditions of15* the license of that module. An independent module is a module which is not16* derived from this software. The special exception does not apply to any17* modifications of the software.18*19* Notwithstanding the above, under no circumstances may you combine this20* software in any way with any other Broadcom software provided under a license21* other than the GPL, without Broadcom's express prior written consent.22*23* $Id: bcmsdh_sdmmc.h 294363 2011-11-06 23:02:20Z $24*/2526#ifndef __BCMSDH_SDMMC_H__27#define __BCMSDH_SDMMC_H__2829#define sd_err(x)30#define sd_trace(x)31#define sd_info(x)32#define sd_debug(x)33#define sd_data(x)34#define sd_ctrl(x)3536#define sd_sync_dma(sd, read, nbytes)37#define sd_init_dma(sd)38#define sd_ack_intr(sd)39#define sd_wakeup(sd);4041/* Allocate/init/free per-OS private data */42extern int sdioh_sdmmc_osinit(sdioh_info_t *sd);43extern void sdioh_sdmmc_osfree(sdioh_info_t *sd);4445#define sd_log(x)4647#define SDIOH_ASSERT(exp) \48do { if (!(exp)) \49printf("!!!ASSERT fail: file %s lines %d", __FILE__, __LINE__); \50} while (0)5152#define BLOCK_SIZE_4318 6453#define BLOCK_SIZE_4328 5125455/* internal return code */56#define SUCCESS 057#define ERROR 15859/* private bus modes */60#define SDIOH_MODE_SD4 261#define CLIENT_INTR 0x100 /* Get rid of this! */6263struct sdioh_info {64osl_t *osh; /* osh handler */65bool client_intr_enabled; /* interrupt connnected flag */66bool intr_handler_valid; /* client driver interrupt handler valid */67sdioh_cb_fn_t intr_handler; /* registered interrupt handler */68void *intr_handler_arg; /* argument to call interrupt handler */69uint16 intmask; /* Current active interrupts */70void *sdos_info; /* Pointer to per-OS private data */7172uint irq; /* Client irq */73int intrcount; /* Client interrupts */7475bool sd_use_dma; /* DMA on CMD53 */76bool sd_blockmode; /* sd_blockmode == FALSE => 64 Byte Cmd 53s. */77/* Must be on for sd_multiblock to be effective */78bool use_client_ints; /* If this is false, make sure to restore */79int sd_mode; /* SD1/SD4/SPI */80int client_block_size[SDIOD_MAX_IOFUNCS]; /* Blocksize */81uint8 num_funcs; /* Supported funcs on client */82uint32 com_cis_ptr;83uint32 func_cis_ptr[SDIOD_MAX_IOFUNCS];84uint max_dma_len;85uint max_dma_descriptors; /* DMA Descriptors supported by this controller. */86// SDDMA_DESCRIPTOR SGList[32]; /* Scatter/Gather DMA List */87};8889/************************************************************90* Internal interfaces: per-port references into bcmsdh_sdmmc.c91*/9293/* Global message bits */94extern uint sd_msglevel;9596/* OS-independent interrupt handler */97extern bool check_client_intr(sdioh_info_t *sd);9899/* Core interrupt enable/disable of device interrupts */100extern void sdioh_sdmmc_devintr_on(sdioh_info_t *sd);101extern void sdioh_sdmmc_devintr_off(sdioh_info_t *sd);102103104/**************************************************************105* Internal interfaces: bcmsdh_sdmmc.c references to per-port code106*/107108/* Register mapping routines */109extern uint32 *sdioh_sdmmc_reg_map(osl_t *osh, int32 addr, int size);110extern void sdioh_sdmmc_reg_unmap(osl_t *osh, int32 addr, int size);111112/* Interrupt (de)registration routines */113extern int sdioh_sdmmc_register_irq(sdioh_info_t *sd, uint irq);114extern void sdioh_sdmmc_free_irq(uint irq, sdioh_info_t *sd);115116typedef struct _BCMSDH_SDMMC_INSTANCE {117sdioh_info_t *sd;118struct sdio_func *func[SDIOD_MAX_IOFUNCS];119} BCMSDH_SDMMC_INSTANCE, *PBCMSDH_SDMMC_INSTANCE;120121#endif /* __BCMSDH_SDMMC_H__ */122123124