diff options
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/sdio.h')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/sdio.h | 47 |
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 | /** |
159 | enum 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 | */ | ||
165 | enum brcmf_sdiod_state { | ||
166 | BRCMF_SDIOD_DOWN, | ||
167 | BRCMF_SDIOD_DATA, | ||
168 | BRCMF_SDIOD_NOMEDIUM | ||
163 | }; | 169 | }; |
164 | 170 | ||
165 | struct brcmf_sdreg { | 171 | struct brcmf_sdreg { |
@@ -169,15 +175,13 @@ struct brcmf_sdreg { | |||
169 | }; | 175 | }; |
170 | 176 | ||
171 | struct brcmf_sdio; | 177 | struct brcmf_sdio; |
178 | struct brcmf_sdiod_freezer; | ||
172 | 179 | ||
173 | struct brcmf_sdio_dev { | 180 | struct 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 */ |
339 | int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn); | 344 | int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn); |
345 | void brcmf_sdiod_change_state(struct brcmf_sdio_dev *sdiodev, | ||
346 | enum brcmf_sdiod_state state); | ||
347 | #ifdef CONFIG_PM_SLEEP | ||
348 | bool brcmf_sdiod_freezing(struct brcmf_sdio_dev *sdiodev); | ||
349 | void brcmf_sdiod_try_freeze(struct brcmf_sdio_dev *sdiodev); | ||
350 | void brcmf_sdiod_freezer_count(struct brcmf_sdio_dev *sdiodev); | ||
351 | void brcmf_sdiod_freezer_uncount(struct brcmf_sdio_dev *sdiodev); | ||
352 | #else | ||
353 | static inline bool brcmf_sdiod_freezing(struct brcmf_sdio_dev *sdiodev) | ||
354 | { | ||
355 | return false; | ||
356 | } | ||
357 | static inline void brcmf_sdiod_try_freeze(struct brcmf_sdio_dev *sdiodev) | ||
358 | { | ||
359 | } | ||
360 | static inline void brcmf_sdiod_freezer_count(struct brcmf_sdio_dev *sdiodev) | ||
361 | { | ||
362 | } | ||
363 | static inline void brcmf_sdiod_freezer_uncount(struct brcmf_sdio_dev *sdiodev) | ||
364 | { | ||
365 | } | ||
366 | #endif /* CONFIG_PM_SLEEP */ | ||
340 | 367 | ||
341 | struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev); | 368 | struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev); |
342 | void brcmf_sdio_remove(struct brcmf_sdio *bus); | 369 | void brcmf_sdio_remove(struct brcmf_sdio *bus); |
@@ -344,5 +371,7 @@ void brcmf_sdio_isr(struct brcmf_sdio *bus); | |||
344 | 371 | ||
345 | void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, uint wdtick); | 372 | void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, uint wdtick); |
346 | void brcmf_sdio_wowl_config(struct device *dev, bool enabled); | 373 | void brcmf_sdio_wowl_config(struct device *dev, bool enabled); |
374 | int brcmf_sdio_sleep(struct brcmf_sdio *bus, bool sleep); | ||
375 | void brcmf_sdio_trigger_dpc(struct brcmf_sdio *bus); | ||
347 | 376 | ||
348 | #endif /* BRCMFMAC_SDIO_H */ | 377 | #endif /* BRCMFMAC_SDIO_H */ |