wifi:enable scatter-gather function
authorJiamin Miao <jiamin.miao@amlogic.com>
Fri, 26 Jun 2015 09:03:32 +0000 (17:03 +0800)
committerJiamin Miao <jiamin.miao@amlogic.com>
Fri, 26 Jun 2015 09:07:11 +0000 (17:07 +0800)
Change-Id: Icd7fff35055fea490b5a9d3267f32d9814e81132

bcmdhd_1_201_59_x/dhd.h
bcmdhd_1_201_59_x/dhd_config.c
bcmdhd_1_201_59_x/dhd_sdio.c

index 0bb4d481efe206ad0225f4ed749b7de5af6a9654..7a6f6ab168d7a537018fa6b67f5d983d8f73e336 100644 (file)
@@ -159,8 +159,12 @@ enum dhd_prealloc_index {
 
 /* Packet alignment for most efficient SDIO (can change based on platform) */
 #ifndef DHD_SDALIGN
+#ifdef CUSTOM_SDIO_F2_BLKSIZE
+#define DHD_SDALIGN    CUSTOM_SDIO_F2_BLKSIZE
+#else
 #define DHD_SDALIGN    32
 #endif
+#endif
 
 /* host reordering packts logic */
 /* followed the structure to hold the reorder buffers (void **p) */
index ea62fced3e5e0d29036e67fe5ed1635e1d739b8a..4e8113e4b1516ac9d498a573ff398bae95f61c64 100644 (file)
@@ -1992,8 +1992,7 @@ dhd_conf_preinit(dhd_pub_t *dhd)
        conf->disable_proptx = 0;
        conf->bus_txglom = 0;
        conf->use_rxchain = 1;
-       conf->bus_rxglom = FALSE;
-       conf->use_rxchain = 0;
+       conf->bus_rxglom = TRUE;
        conf->txglomsize = -1;
        conf->ampdu_ba_wsize = 0;
        conf->dpc_cpucore = 0;
index 0c823e5a9ad958ac19c488046182d357159df98a..625dd353b6cd4aa02eb62485f7cdcf14ab6e6b0e 100644 (file)
@@ -367,6 +367,8 @@ typedef struct dhd_bus {
 #ifdef DHDENABLE_TAILPAD
        void            *pad_pkt;
 #endif /* DHDENABLE_TAILPAD */
+       uint        txglomframes;       /* Number of tx glom frames (superframes) */
+       uint        txglompkts;         /* Number of packets from tx glom frames */
 } dhd_bus_t;
 
 /* clkstate */
@@ -2119,8 +2121,11 @@ dhdsdio_sendfromq(dhd_bus_t *bus, uint maxframes)
                        break;
                if (dhdsdio_txpkt(bus, SDPCM_DATA_CHANNEL, pkts, i, TRUE) != BCME_OK)
                        dhd->tx_errors++;
-               else
+               else {
                        dhd->dstats.tx_bytes += datalen;
+                       bus->txglomframes++;
+                       bus->txglompkts += num_pkt;
+               }
                cnt += i;
 
                /* In poll mode, need to check for other events */
@@ -2620,6 +2625,11 @@ dhd_bus_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf)
 #endif /* DHD_DEBUG */
        bcm_bprintf(strbuf, "clkstate %d activity %d idletime %d idlecount %d sleeping %d\n",
                    bus->clkstate, bus->activity, bus->idletime, bus->idlecount, bus->sleeping);
+       dhd_dump_pct(strbuf, "Tx: glom pct", (100 * bus->txglompkts), bus->dhd->tx_packets);
+       dhd_dump_pct(strbuf, ", pkts/glom", bus->txglompkts, bus->txglomframes);
+       bcm_bprintf(strbuf, "\n");
+       bcm_bprintf(strbuf, "txglomframes %u, txglompkts %u\n", bus->txglomframes, bus->txglompkts);
+       bcm_bprintf(strbuf, "\n");
 }
 
 void
@@ -2636,6 +2646,7 @@ dhd_bus_clearcounts(dhd_pub_t *dhdp)
        bus->tx_sderrs = bus->fc_rcvd = bus->fc_xoff = bus->fc_xon = 0;
        bus->rxglomfail = bus->rxglomframes = bus->rxglompkts = 0;
        bus->f2rxhdrs = bus->f2rxdata = bus->f2txdata = bus->f1regdata = 0;
+       bus->txglomframes = bus->txglompkts = 0;
 }
 
 #ifdef SDTEST