aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/sdio.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/sdio.h')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/sdio.h47
1 files changed, 38 insertions, 9 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio.h b/drivers/net/wireless/brcm80211/brcmfmac/sdio.h
index ec2586a8425c..7328478b2d7b 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.h
@@ -155,11 +155,17 @@
155/* watchdog polling interval in ms */ 155/* watchdog polling interval in ms */
156#define BRCMF_WD_POLL_MS 10 156#define BRCMF_WD_POLL_MS 10
157 157
158/* The state of the bus */ 158/**
159enum brcmf_sdio_state { 159 * enum brcmf_sdiod_state - the state of the bus.
160 BRCMF_STATE_DOWN, /* Device available, still initialising */ 160 *
161 BRCMF_STATE_DATA, /* Ready for data transfers, DPC enabled */ 161 * @BRCMF_SDIOD_DOWN: Device can be accessed, no DPC.
162 BRCMF_STATE_NOMEDIUM /* No medium access to dongle possible */ 162 * @BRCMF_SDIOD_DATA: Ready for data transfers, DPC enabled.
163 * @BRCMF_SDIOD_NOMEDIUM: No medium access to dongle possible.
164 */
165enum brcmf_sdiod_state {
166 BRCMF_SDIOD_DOWN,
167 BRCMF_SDIOD_DATA,
168 BRCMF_SDIOD_NOMEDIUM
163}; 169};
164 170
165struct brcmf_sdreg { 171struct brcmf_sdreg {
@@ -169,15 +175,13 @@ struct brcmf_sdreg {
169}; 175};
170 176
171struct brcmf_sdio; 177struct brcmf_sdio;
178struct brcmf_sdiod_freezer;
172 179
173struct brcmf_sdio_dev { 180struct brcmf_sdio_dev {
174 struct sdio_func *func[SDIO_MAX_FUNCS]; 181 struct sdio_func *func[SDIO_MAX_FUNCS];
175 u8 num_funcs; /* Supported funcs on client */ 182 u8 num_funcs; /* Supported funcs on client */
176 u32 sbwad; /* Save backplane window address */ 183 u32 sbwad; /* Save backplane window address */
177 struct brcmf_sdio *bus; 184 struct brcmf_sdio *bus;
178 atomic_t suspend; /* suspend flag */
179 bool sleeping;
180 wait_queue_head_t idle_wait;
181 struct device *dev; 185 struct device *dev;
182 struct brcmf_bus *bus_if; 186 struct brcmf_bus *bus_if;
183 struct brcmfmac_sdio_platform_data *pdata; 187 struct brcmfmac_sdio_platform_data *pdata;
@@ -194,7 +198,8 @@ struct brcmf_sdio_dev {
194 char fw_name[BRCMF_FW_PATH_LEN + BRCMF_FW_NAME_LEN]; 198 char fw_name[BRCMF_FW_PATH_LEN + BRCMF_FW_NAME_LEN];
195 char nvram_name[BRCMF_FW_PATH_LEN + BRCMF_FW_NAME_LEN]; 199 char nvram_name[BRCMF_FW_PATH_LEN + BRCMF_FW_NAME_LEN];
196 bool wowl_enabled; 200 bool wowl_enabled;
197 enum brcmf_sdio_state state; 201 enum brcmf_sdiod_state state;
202 struct brcmf_sdiod_freezer *freezer;
198}; 203};
199 204
200/* sdio core registers */ 205/* sdio core registers */
@@ -337,6 +342,28 @@ int brcmf_sdiod_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address,
337 342
338/* Issue an abort to the specified function */ 343/* Issue an abort to the specified function */
339int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn); 344int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn);
345void brcmf_sdiod_change_state(struct brcmf_sdio_dev *sdiodev,
346 enum brcmf_sdiod_state state);
347#ifdef CONFIG_PM_SLEEP
348bool brcmf_sdiod_freezing(struct brcmf_sdio_dev *sdiodev);
349void brcmf_sdiod_try_freeze(struct brcmf_sdio_dev *sdiodev);
350void brcmf_sdiod_freezer_count(struct brcmf_sdio_dev *sdiodev);
351void brcmf_sdiod_freezer_uncount(struct brcmf_sdio_dev *sdiodev);
352#else
353static inline bool brcmf_sdiod_freezing(struct brcmf_sdio_dev *sdiodev)
354{
355 return false;
356}
357static inline void brcmf_sdiod_try_freeze(struct brcmf_sdio_dev *sdiodev)
358{
359}
360static inline void brcmf_sdiod_freezer_count(struct brcmf_sdio_dev *sdiodev)
361{
362}
363static inline void brcmf_sdiod_freezer_uncount(struct brcmf_sdio_dev *sdiodev)
364{
365}
366#endif /* CONFIG_PM_SLEEP */
340 367
341struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev); 368struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev);
342void brcmf_sdio_remove(struct brcmf_sdio *bus); 369void brcmf_sdio_remove(struct brcmf_sdio *bus);
@@ -344,5 +371,7 @@ void brcmf_sdio_isr(struct brcmf_sdio *bus);
344 371
345void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, uint wdtick); 372void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, uint wdtick);
346void brcmf_sdio_wowl_config(struct device *dev, bool enabled); 373void brcmf_sdio_wowl_config(struct device *dev, bool enabled);
374int brcmf_sdio_sleep(struct brcmf_sdio *bus, bool sleep);
375void brcmf_sdio_trigger_dpc(struct brcmf_sdio *bus);
347 376
348#endif /* BRCMFMAC_SDIO_H */ 377#endif /* BRCMFMAC_SDIO_H */