| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: ISC |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2010 Broadcom Corporation |
|---|
| 3 | | - * |
|---|
| 4 | | - * Permission to use, copy, modify, and/or distribute this software for any |
|---|
| 5 | | - * purpose with or without fee is hereby granted, provided that the above |
|---|
| 6 | | - * copyright notice and this permission notice appear in all copies. |
|---|
| 7 | | - * |
|---|
| 8 | | - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|---|
| 9 | | - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|---|
| 10 | | - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
|---|
| 11 | | - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|---|
| 12 | | - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION |
|---|
| 13 | | - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
|---|
| 14 | | - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|---|
| 15 | 4 | */ |
|---|
| 16 | 5 | |
|---|
| 17 | 6 | #ifndef BRCMFMAC_BUS_H |
|---|
| .. | .. |
|---|
| 91 | 80 | int (*get_fwname)(struct device *dev, const char *ext, |
|---|
| 92 | 81 | unsigned char *fw_name); |
|---|
| 93 | 82 | void (*debugfs_create)(struct device *dev); |
|---|
| 83 | + int (*reset)(struct device *dev); |
|---|
| 94 | 84 | }; |
|---|
| 95 | 85 | |
|---|
| 96 | 86 | |
|---|
| .. | .. |
|---|
| 245 | 235 | return bus->ops->debugfs_create(bus->dev); |
|---|
| 246 | 236 | } |
|---|
| 247 | 237 | |
|---|
| 238 | +static inline |
|---|
| 239 | +int brcmf_bus_reset(struct brcmf_bus *bus) |
|---|
| 240 | +{ |
|---|
| 241 | + if (!bus->ops->reset) |
|---|
| 242 | + return -EOPNOTSUPP; |
|---|
| 243 | + |
|---|
| 244 | + return bus->ops->reset(bus->dev); |
|---|
| 245 | +} |
|---|
| 246 | + |
|---|
| 248 | 247 | /* |
|---|
| 249 | 248 | * interface functions from common layer |
|---|
| 250 | 249 | */ |
|---|
| 251 | 250 | |
|---|
| 252 | 251 | /* Receive frame for delivery to OS. Callee disposes of rxp. */ |
|---|
| 253 | | -void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp, bool handle_event); |
|---|
| 252 | +void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp, bool handle_event, |
|---|
| 253 | + bool inirq); |
|---|
| 254 | 254 | /* Receive async event packet from firmware. Callee disposes of rxp. */ |
|---|
| 255 | 255 | void brcmf_rx_event(struct device *dev, struct sk_buff *rxp); |
|---|
| 256 | 256 | |
|---|
| 257 | +int brcmf_alloc(struct device *dev, struct brcmf_mp_device *settings); |
|---|
| 257 | 258 | /* Indication from bus module regarding presence/insertion of dongle. */ |
|---|
| 258 | | -int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings); |
|---|
| 259 | +int brcmf_attach(struct device *dev); |
|---|
| 259 | 260 | /* Indication from bus module regarding removal/absence of dongle */ |
|---|
| 260 | 261 | void brcmf_detach(struct device *dev); |
|---|
| 262 | +void brcmf_free(struct device *dev); |
|---|
| 261 | 263 | /* Indication from bus module that dongle should be reset */ |
|---|
| 262 | 264 | void brcmf_dev_reset(struct device *dev); |
|---|
| 263 | 265 | /* Request from bus module to initiate a coredump */ |
|---|
| 264 | 266 | void brcmf_dev_coredump(struct device *dev); |
|---|
| 267 | +/* Indication that firmware has halted or crashed */ |
|---|
| 268 | +void brcmf_fw_crashed(struct device *dev); |
|---|
| 265 | 269 | |
|---|
| 266 | 270 | /* Configure the "global" bus state used by upper layers */ |
|---|
| 267 | 271 | void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state); |
|---|
| .. | .. |
|---|
| 271 | 275 | |
|---|
| 272 | 276 | #ifdef CONFIG_BRCMFMAC_SDIO |
|---|
| 273 | 277 | void brcmf_sdio_exit(void); |
|---|
| 274 | | -void brcmf_sdio_register(void); |
|---|
| 278 | +int brcmf_sdio_register(void); |
|---|
| 279 | +#else |
|---|
| 280 | +static inline void brcmf_sdio_exit(void) { } |
|---|
| 281 | +static inline int brcmf_sdio_register(void) { return 0; } |
|---|
| 275 | 282 | #endif |
|---|
| 283 | + |
|---|
| 276 | 284 | #ifdef CONFIG_BRCMFMAC_USB |
|---|
| 277 | 285 | void brcmf_usb_exit(void); |
|---|
| 278 | | -void brcmf_usb_register(void); |
|---|
| 286 | +int brcmf_usb_register(void); |
|---|
| 287 | +#else |
|---|
| 288 | +static inline void brcmf_usb_exit(void) { } |
|---|
| 289 | +static inline int brcmf_usb_register(void) { return 0; } |
|---|
| 290 | +#endif |
|---|
| 291 | + |
|---|
| 292 | +#ifdef CONFIG_BRCMFMAC_PCIE |
|---|
| 293 | +void brcmf_pcie_exit(void); |
|---|
| 294 | +int brcmf_pcie_register(void); |
|---|
| 295 | +#else |
|---|
| 296 | +static inline void brcmf_pcie_exit(void) { } |
|---|
| 297 | +static inline int brcmf_pcie_register(void) { return 0; } |
|---|
| 279 | 298 | #endif |
|---|
| 280 | 299 | |
|---|
| 281 | 300 | #endif /* BRCMFMAC_BUS_H */ |
|---|