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/bcmsdh_sdmmc.c | 33 +++++----------------------------
1 files changed, 5 insertions(+), 28 deletions(-)
diff --git a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmsdh_sdmmc.c b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmsdh_sdmmc.c
old mode 100644
new mode 100755
index dc38371..2ac448c
--- a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmsdh_sdmmc.c
+++ b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmsdh_sdmmc.c
@@ -103,8 +103,6 @@
#define CUSTOM_SDIO_F1_BLKSIZE DEFAULT_SDIO_F1_BLKSIZE
#endif
-#define COPY_BUF_SIZE (SDPCM_MAXGLOM_SIZE * 1600)
-
#define MAX_IO_RW_EXTENDED_BLK 511
uint sd_sdmode = SDIOH_MODE_SD4; /* Use SD4 mode by default */
@@ -211,14 +209,6 @@
return NULL;
}
bzero((char *)sd, sizeof(sdioh_info_t));
-#if defined(BCMSDIOH_TXGLOM) && defined(BCMSDIOH_STATIC_COPY_BUF)
- sd->copy_buf = MALLOC(osh, COPY_BUF_SIZE);
- if (sd->copy_buf == NULL) {
- sd_err(("%s: MALLOC of %d-byte copy_buf failed\n",
- __FUNCTION__, COPY_BUF_SIZE));
- goto fail;
- }
-#endif
sd->osh = osh;
sd->fake_func0.num = 0;
sd->fake_func0.card = func->card;
@@ -283,9 +273,6 @@
return sd;
fail:
-#if defined(BCMSDIOH_TXGLOM) && defined(BCMSDIOH_STATIC_COPY_BUF)
- MFREE(sd->osh, sd->copy_buf, COPY_BUF_SIZE);
-#endif
MFREE(sd->osh, sd, sizeof(sdioh_info_t));
return NULL;
}
@@ -314,9 +301,6 @@
sd->func[1] = NULL;
sd->func[2] = NULL;
-#if defined(BCMSDIOH_TXGLOM) && defined(BCMSDIOH_STATIC_COPY_BUF)
- MFREE(sd->osh, sd->copy_buf, COPY_BUF_SIZE);
-#endif
MFREE(sd->osh, sd, sizeof(sdioh_info_t));
}
return SDIOH_API_RC_SUCCESS;
@@ -1372,8 +1356,7 @@
return SDIOH_API_RC_FAIL;
}
}
- }
- else if(sd->txglom_mode == SDPCM_TXGLOM_CPY) {
+ } else if(sd->txglom_mode == SDPCM_TXGLOM_CPY) {
for (pnext = pkt; pnext; pnext = PKTNEXT(sd->osh, pnext)) {
ttl_len += PKTLEN(sd->osh, pnext);
}
@@ -1382,20 +1365,16 @@
for (pnext = pkt; pnext; pnext = PKTNEXT(sd->osh, pnext)) {
uint8 *buf = (uint8*)PKTDATA(sd->osh, pnext);
pkt_len = PKTLEN(sd->osh, pnext);
+
if (!localbuf) {
-#ifdef BCMSDIOH_STATIC_COPY_BUF
- if (ttl_len <= COPY_BUF_SIZE)
- localbuf = sd->copy_buf;
-#else
localbuf = (uint8 *)MALLOC(sd->osh, ttl_len);
-#endif
if (localbuf == NULL) {
- sd_err(("%s: %s localbuf malloc FAILED ttl_len=%d\n",
- __FUNCTION__, (write) ? "TX" : "RX", ttl_len));
- ttl_len -= pkt_len;
+ sd_err(("%s: %s TXGLOM: localbuf malloc FAILED\n",
+ __FUNCTION__, (write) ? "TX" : "RX"));
goto txglomfail;
}
}
+
bcopy(buf, (localbuf + local_plen), pkt_len);
local_plen += pkt_len;
if (PKTNEXT(sd->osh, pnext))
@@ -1440,10 +1419,8 @@
return SDIOH_API_RC_FAIL;
}
-#ifndef BCMSDIOH_STATIC_COPY_BUF
if (localbuf)
MFREE(sd->osh, localbuf, ttl_len);
-#endif
#ifndef PKT_STATICS
if (sd_msglevel & SDH_COST_VAL)
--
Gitblit v1.6.2