forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: ISC
12 /*
23 * 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.
154 */
165
176 #ifndef BRCMFMAC_BUS_H
....@@ -91,6 +80,7 @@
9180 int (*get_fwname)(struct device *dev, const char *ext,
9281 unsigned char *fw_name);
9382 void (*debugfs_create)(struct device *dev);
83
+ int (*reset)(struct device *dev);
9484 };
9585
9686
....@@ -245,23 +235,37 @@
245235 return bus->ops->debugfs_create(bus->dev);
246236 }
247237
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
+
248247 /*
249248 * interface functions from common layer
250249 */
251250
252251 /* 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);
254254 /* Receive async event packet from firmware. Callee disposes of rxp. */
255255 void brcmf_rx_event(struct device *dev, struct sk_buff *rxp);
256256
257
+int brcmf_alloc(struct device *dev, struct brcmf_mp_device *settings);
257258 /* 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);
259260 /* Indication from bus module regarding removal/absence of dongle */
260261 void brcmf_detach(struct device *dev);
262
+void brcmf_free(struct device *dev);
261263 /* Indication from bus module that dongle should be reset */
262264 void brcmf_dev_reset(struct device *dev);
263265 /* Request from bus module to initiate a coredump */
264266 void brcmf_dev_coredump(struct device *dev);
267
+/* Indication that firmware has halted or crashed */
268
+void brcmf_fw_crashed(struct device *dev);
265269
266270 /* Configure the "global" bus state used by upper layers */
267271 void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state);
....@@ -271,11 +275,26 @@
271275
272276 #ifdef CONFIG_BRCMFMAC_SDIO
273277 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; }
275282 #endif
283
+
276284 #ifdef CONFIG_BRCMFMAC_USB
277285 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; }
279298 #endif
280299
281300 #endif /* BRCMFMAC_BUS_H */