From b22da3d8526a935aa31e086e63f60ff3246cb61c Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Sat, 09 Dec 2023 07:24:11 +0000
Subject: [PATCH] add stmac read mac form eeprom
---
kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dbus_usb.c | 64 +++++++++++--------------------
1 files changed, 23 insertions(+), 41 deletions(-)
diff --git a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dbus_usb.c b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dbus_usb.c
old mode 100644
new mode 100755
index 9683483..edc4109
--- a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dbus_usb.c
+++ b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dbus_usb.c
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Dongle BUS interface for USB, OS independent
*
@@ -54,9 +55,6 @@
#define USB_DEV_ISBAD(u) (u->pub->attrib.devid == 0xDEAD)
#define USB_DLGO_SPINWAIT 100 /* wait after DL_GO (ms) */
#define TEST_CHIP 0x4328
-
-/* driver info, initialized when bcmsdh_register is called */
-static dbus_driver_t drvinfo = {NULL, NULL, NULL, NULL};
typedef struct {
dbus_pub_t *pub;
@@ -150,6 +148,10 @@
* attach() is not called at probe and detach()
* can be called inside disconnect()
*/
+static probe_cb_t probe_cb = NULL;
+static disconnect_cb_t disconnect_cb = NULL;
+static void *probe_arg = NULL;
+static void *disc_arg = NULL;
static dbus_intf_t *g_dbusintf = NULL;
static dbus_intf_t dbus_usb_intf; /** functions called by higher layer DBUS into lower layer */
@@ -159,7 +161,8 @@
*/
static void *dbus_usb_attach(dbus_pub_t *pub, void *cbarg, dbus_intf_callbacks_t *cbs);
static void dbus_usb_detach(dbus_pub_t *pub, void *info);
-static void * dbus_usb_probe(uint16 bus_no, uint16 slot, uint32 hdrlen);
+static void * dbus_usb_probe(void *arg, const char *desc, uint32 bustype,
+ uint16 bus_no, uint16 slot, uint32 hdrlen);
/* functions */
@@ -168,10 +171,12 @@
* lower level DBUS functions to call (in both dbus_usb.c and dbus_usb_os.c).
*/
static void *
-dbus_usb_probe(uint16 bus_no, uint16 slot, uint32 hdrlen)
+dbus_usb_probe(void *arg, const char *desc, uint32 bustype, uint16 bus_no,
+ uint16 slot, uint32 hdrlen)
{
DBUSTRACE(("%s(): \n", __FUNCTION__));
- if (drvinfo.probe) {
+ if (probe_cb) {
+
if (g_dbusintf != NULL) {
/* First, initialize all lower-level functions as default
* so that dbus.c simply calls directly to dbus_usb_os.c.
@@ -187,55 +192,32 @@
dbus_usb_intf.dlrun = dbus_usb_dlrun;
}
- return drvinfo.probe(bus_no, slot, hdrlen);
+ disc_arg = probe_cb(probe_arg, "DBUS USB", USB_BUS, bus_no, slot, hdrlen);
+ return disc_arg;
}
return NULL;
}
-
-static int
-dbus_usb_suspend(void *handle)
-{
- DBUSTRACE(("%s(): \n", __FUNCTION__));
-
- if (drvinfo.suspend)
- return drvinfo.suspend(handle);
-
- return BCME_OK;
-}
-
-static int
-dbus_usb_resume(void *handle)
-{
- DBUSTRACE(("%s(): \n", __FUNCTION__));
-
- if (drvinfo.resume)
- drvinfo.resume(handle);
-
- return 0;
-}
-
-static dbus_driver_t dhd_usb_dbus = {
- dbus_usb_probe,
- dbus_usb_disconnect,
- dbus_usb_suspend,
- dbus_usb_resume
-};
/**
* On return, *intf contains this or lower-level DBUS functions to be called by higher
* level (dbus.c)
*/
int
-dbus_bus_register(dbus_driver_t *driver, dbus_intf_t **intf)
+dbus_bus_register(int vid, int pid, probe_cb_t prcb,
+ disconnect_cb_t discb, void *prarg, dbus_intf_t **intf, void *param1, void *param2)
{
int err;
DBUSTRACE(("%s(): \n", __FUNCTION__));
- drvinfo = *driver;
+ probe_cb = prcb;
+ disconnect_cb = discb;
+ probe_arg = prarg;
+
*intf = &dbus_usb_intf;
- err = dbus_bus_osl_register(&dhd_usb_dbus, &g_dbusintf);
+ err = dbus_bus_osl_register(vid, pid, dbus_usb_probe,
+ dbus_usb_disconnect, NULL, &g_dbusintf, param1, param2);
ASSERT(g_dbusintf);
return err;
@@ -311,8 +293,8 @@
dbus_usb_disconnect(void *handle)
{
DBUSTRACE(("%s(): \n", __FUNCTION__));
- if (drvinfo.remove)
- drvinfo.remove(handle);
+ if (disconnect_cb)
+ disconnect_cb(disc_arg);
}
/**
--
Gitblit v1.6.2