hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_pcie.c
....@@ -3557,17 +3557,28 @@
35573557 void
35583558 dhd_set_bus_params(struct dhd_bus *bus)
35593559 {
3560
- if (bus->dhd->conf->dhd_poll >= 0) {
3561
- bus->poll = bus->dhd->conf->dhd_poll;
3560
+ struct dhd_conf *conf = bus->dhd->conf;
3561
+
3562
+ if (conf->dhd_poll >= 0) {
3563
+ bus->poll = conf->dhd_poll;
35623564 if (!bus->pollrate)
35633565 bus->pollrate = 1;
3564
- printf("%s: set polling mode %d\n", __FUNCTION__, bus->dhd->conf->dhd_poll);
3566
+ printf("%s: set polling mode %d\n", __FUNCTION__, conf->dhd_poll);
35653567 }
3566
- if (bus->dhd->conf->d2h_intr_control >= 0)
3567
- bus->d2h_intr_control = bus->dhd->conf->d2h_intr_control;
3568
+ if (conf->d2h_intr_control >= 0)
3569
+ bus->d2h_intr_control = conf->d2h_intr_control;
35683570 printf("d2h_intr_method -> %s(%d); d2h_intr_control -> %s(%d)\n",
35693571 bus->d2h_intr_method ? "PCIE_MSI" : "PCIE_INTX", bus->d2h_intr_method,
35703572 bus->d2h_intr_control ? "HOST_IRQ" : "D2H_INTMASK", bus->d2h_intr_control);
3573
+
3574
+ if (conf->aspm != -1) {
3575
+ bool aspm = conf->aspm ? TRUE : FALSE;
3576
+ dhd_bus_aspm_enable_rc_ep(bus, aspm);
3577
+ }
3578
+ if (conf->l1ss != -1) {
3579
+ bool l1ss = conf->l1ss ? TRUE : FALSE;
3580
+ dhd_bus_l1ss_enable_rc_ep(bus, l1ss);
3581
+ }
35713582 }
35723583
35733584 /**
....@@ -17803,3 +17814,25 @@
1780317814 val = 1;
1780417815 dhd_sbreg_op(dhd, addr, &val, FALSE);
1780517816 }
17817
+
17818
+#define BUS_SLEEP_WAIT_CNT 3
17819
+#define BUS_SLEEP_WAIT_MS 20
17820
+int
17821
+dhd_bus_sleep(dhd_pub_t *dhdp, bool sleep, uint32 *intstatus)
17822
+{
17823
+ dhd_bus_t *bus = dhdp->bus;
17824
+ int active, cnt = 0;
17825
+
17826
+ if (bus) {
17827
+ while ((active = dhd_os_check_wakelock_all(bus->dhd)) &&
17828
+ (cnt < BUS_SLEEP_WAIT_CNT)) {
17829
+ OSL_SLEEP(BUS_SLEEP_WAIT_MS);
17830
+ cnt++;
17831
+ }
17832
+ } else {
17833
+ DHD_ERROR(("bus is NULL\n"));
17834
+ active = -1;
17835
+ }
17836
+
17837
+ return active;
17838
+}