2 * DHD Protocol Module for CDC and BDC.
4 * Copyright (C) 1999-2016, Broadcom Corporation
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
25 * <<Broadcom-WL-IPTag/Open:>>
27 * $Id: dhd_cdc.c 596022 2015-10-29 11:02:47Z $
29 * BDC is like CDC, except it includes a header for data packets to convey
30 * packet priority over the bus, and flags (e.g. to indicate checksum status
31 * for dongle offload.)
39 #include <bcmendian.h>
41 #include <dngl_stats.h>
43 #include <dhd_proto.h>
49 #include <wlfc_proto.h>
54 #define RETRIES 2 /* # of retries to retrieve matching ioctl response */
55 #define BUS_HEADER_LEN (24+DHD_SDALIGN) /* Must be at least SDPCM_RESERVE
56 * defined in dhd_sdio.c (amount of header tha might be added)
57 * plus any space that might be needed for alignment padding.
59 #define ROUND_UP_MARGIN 2048 /* Biggest SDIO block size possible for
60 * round off at the end of buffer
63 typedef struct dhd_prot {
67 uint8 bus_header[BUS_HEADER_LEN];
69 unsigned char buf[WLC_IOCTL_MAXLEN + ROUND_UP_MARGIN];
74 dhdcdc_msg(dhd_pub_t *dhd)
77 dhd_prot_t *prot = dhd->prot;
78 int len = ltoh32(prot->msg.len) + sizeof(cdc_ioctl_t);
80 DHD_TRACE(("%s: Enter\n", __FUNCTION__));
82 DHD_OS_WAKE_LOCK(dhd);
84 /* NOTE : cdc->msg.len holds the desired length of the buffer to be
85 * returned. Only up to CDC_MAX_MSG_SIZE of this buffer area
86 * is actually sent to the dongle
88 if (len > CDC_MAX_MSG_SIZE)
89 len = CDC_MAX_MSG_SIZE;
92 err = dhd_bus_txctl(dhd->bus, (uchar*)&prot->msg, len);
94 DHD_OS_WAKE_UNLOCK(dhd);
99 dhdcdc_cmplt(dhd_pub_t *dhd, uint32 id, uint32 len)
102 int cdc_len = len + sizeof(cdc_ioctl_t);
103 dhd_prot_t *prot = dhd->prot;
105 DHD_TRACE(("%s: Enter\n", __FUNCTION__));
108 ret = dhd_bus_rxctl(dhd->bus, (uchar*)&prot->msg, cdc_len);
111 } while (CDC_IOC_ID(ltoh32(prot->msg.flags)) != id);
117 dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len, uint8 action)
119 dhd_prot_t *prot = dhd->prot;
120 cdc_ioctl_t *msg = &prot->msg;
121 int ret = 0, retries = 0;
122 uint32 id, flags = 0;
124 DHD_TRACE(("%s: Enter\n", __FUNCTION__));
125 DHD_CTL(("%s: cmd %d len %d\n", __FUNCTION__, cmd, len));
128 /* Respond "bcmerror" and "bcmerrorstr" with local cache */
129 if (cmd == WLC_GET_VAR && buf)
131 if (!strcmp((char *)buf, "bcmerrorstr"))
133 strncpy((char *)buf, bcmerrorstr(dhd->dongle_error), BCME_STRLEN);
136 else if (!strcmp((char *)buf, "bcmerror"))
138 *(int *)buf = dhd->dongle_error;
143 memset(msg, 0, sizeof(cdc_ioctl_t));
145 msg->cmd = htol32(cmd);
146 msg->len = htol32(len);
147 msg->flags = (++prot->reqid << CDCF_IOC_ID_SHIFT);
148 CDC_SET_IF_IDX(msg, ifidx);
149 /* add additional action bits */
150 action &= WL_IOCTL_ACTION_MASK;
151 msg->flags |= (action << CDCF_IOC_ACTION_SHIFT);
152 msg->flags = htol32(msg->flags);
155 memcpy(prot->buf, buf, len);
157 if ((ret = dhdcdc_msg(dhd)) < 0) {
158 if (!dhd->hang_was_sent)
159 DHD_ERROR(("dhdcdc_query_ioctl: dhdcdc_msg failed w/status %d\n", ret));
164 /* wait for interrupt and get first fragment */
165 if ((ret = dhdcdc_cmplt(dhd, prot->reqid, len)) < 0)
168 flags = ltoh32(msg->flags);
169 id = (flags & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT;
171 if ((id < prot->reqid) && (++retries < RETRIES))
173 if (id != prot->reqid) {
174 DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
175 dhd_ifname(dhd, ifidx), __FUNCTION__, id, prot->reqid));
180 /* Copy info buffer */
185 memcpy(buf, (void*) prot->buf, len);
188 /* Check the ERROR flag */
189 if (flags & CDCF_IOC_ERROR)
191 ret = ltoh32(msg->status);
192 /* Cache error from dongle */
193 dhd->dongle_error = ret;
202 dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len, uint8 action)
204 dhd_prot_t *prot = dhd->prot;
205 cdc_ioctl_t *msg = &prot->msg;
209 DHD_TRACE(("%s: Enter\n", __FUNCTION__));
210 DHD_CTL(("%s: cmd %d len %d\n", __FUNCTION__, cmd, len));
212 if (dhd->busstate == DHD_BUS_DOWN) {
213 DHD_ERROR(("%s : bus is down. we have nothing to do\n", __FUNCTION__));
217 /* don't talk to the dongle if fw is about to be reloaded */
218 if (dhd->hang_was_sent) {
219 DHD_ERROR(("%s: HANG was sent up earlier. Not talking to the chip\n",
224 if (cmd == WLC_SET_PM) {
225 DHD_TRACE_HW4(("%s: SET PM to %d\n", __FUNCTION__, *(char *)buf));
228 memset(msg, 0, sizeof(cdc_ioctl_t));
230 msg->cmd = htol32(cmd);
231 msg->len = htol32(len);
232 msg->flags = (++prot->reqid << CDCF_IOC_ID_SHIFT);
233 CDC_SET_IF_IDX(msg, ifidx);
234 /* add additional action bits */
235 action &= WL_IOCTL_ACTION_MASK;
236 msg->flags |= (action << CDCF_IOC_ACTION_SHIFT) | CDCF_IOC_SET;
237 msg->flags = htol32(msg->flags);
240 memcpy(prot->buf, buf, len);
242 if ((ret = dhdcdc_msg(dhd)) < 0) {
243 DHD_ERROR(("%s: dhdcdc_msg failed w/status %d\n", __FUNCTION__, ret));
247 if ((ret = dhdcdc_cmplt(dhd, prot->reqid, len)) < 0)
250 flags = ltoh32(msg->flags);
251 id = (flags & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT;
253 if (id != prot->reqid) {
254 DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
255 dhd_ifname(dhd, ifidx), __FUNCTION__, id, prot->reqid));
260 /* Check the ERROR flag */
261 if (flags & CDCF_IOC_ERROR)
263 ret = ltoh32(msg->status);
264 /* Cache error from dongle */
265 dhd->dongle_error = ret;
274 dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t * ioc, void * buf, int len)
276 dhd_prot_t *prot = dhd->prot;
279 static int error_cnt = 0;
281 if ((dhd->busstate == DHD_BUS_DOWN) || dhd->hang_was_sent) {
282 DHD_ERROR(("%s : bus is down. we have nothing to do\n", __FUNCTION__));
286 DHD_TRACE(("%s: Enter\n", __FUNCTION__));
288 ASSERT(len <= WLC_IOCTL_MAXLEN);
290 if (len > WLC_IOCTL_MAXLEN)
293 if (prot->pending == TRUE) {
294 DHD_ERROR(("CDC packet is pending!!!! cmd=0x%x (%lu) lastcmd=0x%x (%lu)\n",
295 ioc->cmd, (unsigned long)ioc->cmd, prot->lastcmd,
296 (unsigned long)prot->lastcmd));
297 if ((ioc->cmd == WLC_SET_VAR) || (ioc->cmd == WLC_GET_VAR)) {
298 DHD_TRACE(("iovar cmd=%s\n", (char*)buf));
303 prot->pending = TRUE;
304 prot->lastcmd = ioc->cmd;
306 if (action & WL_IOCTL_ACTION_SET)
307 ret = dhdcdc_set_ioctl(dhd, ifidx, ioc->cmd, buf, len, action);
309 ret = dhdcdc_query_ioctl(dhd, ifidx, ioc->cmd, buf, len, action);
311 ioc->used = ret - sizeof(cdc_ioctl_t);
313 // terence 20130805: send hang event to wpa_supplicant
321 /* Too many programs assume ioctl() returns 0 on success */
325 cdc_ioctl_t *msg = &prot->msg;
326 ioc->needed = ltoh32(msg->len); /* len == needed when set/query fails from dongle */
329 /* Intercept the wme_dp ioctl here */
330 if ((!ret) && (ioc->cmd == WLC_SET_VAR) && (!strcmp(buf, "wme_dp"))) {
333 slen = strlen("wme_dp") + 1;
334 if (len >= (int)(slen + sizeof(int)))
335 bcopy(((char *)buf + slen), &val, sizeof(int));
336 dhd->wme_dp = (uint8) ltoh32(val);
339 prot->pending = FALSE;
347 dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
348 void *params, int plen, void *arg, int len, bool set)
350 return BCME_UNSUPPORTED;
354 dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf)
356 if (!dhdp || !dhdp->prot)
358 bcm_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
360 dhd_wlfc_dump(dhdp, strbuf);
364 /* The FreeBSD PKTPUSH could change the packet buf pinter
365 so we need to make it changable
367 #define PKTBUF pktbuf
369 dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, void *PKTBUF)
372 struct bdc_header *h;
375 DHD_TRACE(("%s: Enter\n", __FUNCTION__));
378 /* Push BDC header used to convey priority for buses that don't */
380 PKTPUSH(dhd->osh, PKTBUF, BDC_HEADER_LEN);
382 h = (struct bdc_header *)PKTDATA(dhd->osh, PKTBUF);
384 h->flags = (BDC_PROTO_VER << BDC_FLAG_VER_SHIFT);
385 if (PKTSUMNEEDED(PKTBUF))
386 h->flags |= BDC_FLAG_SUM_NEEDED;
389 h->priority = (PKTPRIO(PKTBUF) & BDC_PRIORITY_MASK);
393 BDC_SET_IF_IDX(h, ifidx);
395 #undef PKTBUF /* Only defined in the above routine */
398 dhd_prot_hdrlen(dhd_pub_t *dhd, void *PKTBUF)
402 /* Length of BDC(+WLFC) headers pushed */
403 hdrlen = BDC_HEADER_LEN + (((struct bdc_header *)PKTBUF)->dataOffset * 4);
409 dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, void *pktbuf, uchar *reorder_buf_info,
410 uint *reorder_info_len)
413 struct bdc_header *h;
415 uint8 data_offset = 0;
417 DHD_TRACE(("%s: Enter\n", __FUNCTION__));
420 if (reorder_info_len)
421 *reorder_info_len = 0;
422 /* Pop BDC header used to convey priority for buses that don't */
424 if (PKTLEN(dhd->osh, pktbuf) < BDC_HEADER_LEN) {
425 DHD_ERROR(("%s: rx data too short (%d < %d)\n", __FUNCTION__,
426 PKTLEN(dhd->osh, pktbuf), BDC_HEADER_LEN));
430 h = (struct bdc_header *)PKTDATA(dhd->osh, pktbuf);
433 /* for tx packet, skip the analysis */
434 data_offset = h->dataOffset;
435 PKTPULL(dhd->osh, pktbuf, BDC_HEADER_LEN);
439 *ifidx = BDC_GET_IF_IDX(h);
441 if (((h->flags & BDC_FLAG_VER_MASK) >> BDC_FLAG_VER_SHIFT) != BDC_PROTO_VER) {
442 DHD_ERROR(("%s: non-BDC packet received, flags = 0x%x\n",
443 dhd_ifname(dhd, *ifidx), h->flags));
444 if (((h->flags & BDC_FLAG_VER_MASK) >> BDC_FLAG_VER_SHIFT) == BDC_PROTO_VER_1)
450 if (h->flags & BDC_FLAG_SUM_GOOD) {
451 DHD_INFO(("%s: BDC packet received with good rx-csum, flags 0x%x\n",
452 dhd_ifname(dhd, *ifidx), h->flags));
453 PKTSETSUMGOOD(pktbuf, TRUE);
456 PKTSETPRIO(pktbuf, (h->priority & BDC_PRIORITY_MASK));
457 data_offset = h->dataOffset;
458 PKTPULL(dhd->osh, pktbuf, BDC_HEADER_LEN);
463 if (!DHD_PKTTAG_PKTDIR(PKTTAG(pktbuf))) {
465 - parse txstatus only for packets that came from the firmware
467 dhd_wlfc_parse_header_info(dhd, pktbuf, (data_offset << 2),
468 reorder_buf_info, reorder_info_len);
471 #endif /* PROP_TXSTATUS */
474 PKTPULL(dhd->osh, pktbuf, (data_offset << 2));
480 dhd_prot_attach(dhd_pub_t *dhd)
484 if (!(cdc = (dhd_prot_t *)DHD_OS_PREALLOC(dhd, DHD_PREALLOC_PROT, sizeof(dhd_prot_t)))) {
485 DHD_ERROR(("%s: kmalloc failed\n", __FUNCTION__));
488 memset(cdc, 0, sizeof(dhd_prot_t));
490 /* ensure that the msg buf directly follows the cdc msg struct */
491 if ((uintptr)(&cdc->msg + 1) != (uintptr)cdc->buf) {
492 DHD_ERROR(("dhd_prot_t is not correctly defined\n"));
498 dhd->hdrlen += BDC_HEADER_LEN;
500 dhd->maxctl = WLC_IOCTL_MAXLEN + sizeof(cdc_ioctl_t) + ROUND_UP_MARGIN;
505 DHD_OS_PREFREE(dhd, cdc, sizeof(dhd_prot_t));
509 /* ~NOTE~ What if another thread is waiting on the semaphore? Holding it? */
511 dhd_prot_detach(dhd_pub_t *dhd)
514 dhd_wlfc_deinit(dhd);
516 DHD_OS_PREFREE(dhd, dhd->prot, sizeof(dhd_prot_t));
521 dhd_prot_dstats(dhd_pub_t *dhd)
525 dhd->dstats.tx_packets = dhd->tx_packets;
526 dhd->dstats.tx_errors = dhd->tx_errors;
527 dhd->dstats.rx_packets = dhd->rx_packets;
528 dhd->dstats.rx_errors = dhd->rx_errors;
529 dhd->dstats.rx_dropped = dhd->rx_dropped;
530 dhd->dstats.multicast = dhd->rx_multicast;
535 dhd_sync_with_dongle(dhd_pub_t *dhd)
538 wlc_rev_info_t revinfo;
539 DHD_TRACE(("%s: Enter\n", __FUNCTION__));
542 dhd_get_assert_info(dhd);
543 #endif /* BCMASSERT_LOG */
545 /* Get the device rev info */
546 memset(&revinfo, 0, sizeof(revinfo));
547 ret = dhd_wl_ioctl_cmd(dhd, WLC_GET_REVINFO, &revinfo, sizeof(revinfo), FALSE, 0);
552 dhd_process_cid_mac(dhd, TRUE);
554 ret = dhd_preinit_ioctls(dhd);
557 dhd_process_cid_mac(dhd, FALSE);
559 /* Always assumes wl for now */
566 int dhd_prot_init(dhd_pub_t *dhd)
572 dhd_prot_stop(dhd_pub_t *dhd)
574 /* Nothing to do for CDC */
579 dhd_get_hostreorder_pkts(void *osh, struct reorder_info *ptr, void **pkt,
580 uint32 *pkt_count, void **pplast, uint8 start, uint8 end)
582 void *plast = NULL, *p;
585 if (ptr->pend_pkts == 0) {
586 DHD_REORDER(("%s: no packets in reorder queue \n", __FUNCTION__));
593 p = (void *)(ptr->p[start]);
594 ptr->p[start] = NULL;
600 PKTSETNEXT(osh, plast, p);
606 if (start > ptr->max_idx)
608 } while (start != end);
610 *pkt_count = pkt_cnt;
611 ptr->pend_pkts -= (uint8)pkt_cnt;
615 dhd_process_pkt_reorder_info(dhd_pub_t *dhd, uchar *reorder_info_buf, uint reorder_info_len,
616 void **pkt, uint32 *pkt_count)
618 uint8 flow_id, max_idx, cur_idx, exp_idx;
619 struct reorder_info *ptr;
621 void *cur_pkt, *plast = NULL;
625 if (pkt_count != NULL)
630 flow_id = reorder_info_buf[WLHOST_REORDERDATA_FLOWID_OFFSET];
631 flags = reorder_info_buf[WLHOST_REORDERDATA_FLAGS_OFFSET];
633 DHD_REORDER(("flow_id %d, flags 0x%02x, idx(%d, %d, %d)\n", flow_id, flags,
634 reorder_info_buf[WLHOST_REORDERDATA_CURIDX_OFFSET],
635 reorder_info_buf[WLHOST_REORDERDATA_EXPIDX_OFFSET],
636 reorder_info_buf[WLHOST_REORDERDATA_MAXIDX_OFFSET]));
638 /* validate flags and flow id */
640 DHD_ERROR(("%s: invalid flags...so ignore this packet\n", __FUNCTION__));
648 ptr = dhd->reorder_bufs[flow_id];
649 if (flags & WLHOST_REORDERDATA_DEL_FLOW) {
650 uint32 buf_size = sizeof(struct reorder_info);
652 DHD_REORDER(("%s: Flags indicating to delete a flow id %d\n",
653 __FUNCTION__, flow_id));
656 DHD_REORDER(("%s: received flags to cleanup, but no flow (%d) yet\n",
657 __FUNCTION__, flow_id));
663 dhd_get_hostreorder_pkts(dhd->osh, ptr, pkt, &cnt, &plast,
664 ptr->exp_idx, ptr->exp_idx);
665 /* set it to the last packet */
667 PKTSETNEXT(dhd->osh, plast, cur_pkt);
672 DHD_ERROR(("%s: del flow: something fishy, pending packets %d\n",
678 buf_size += ((ptr->max_idx + 1) * sizeof(void *));
679 MFREE(dhd->osh, ptr, buf_size);
680 dhd->reorder_bufs[flow_id] = NULL;
684 /* all the other cases depend on the existance of the reorder struct for that flow id */
686 uint32 buf_size_alloc = sizeof(reorder_info_t);
687 max_idx = reorder_info_buf[WLHOST_REORDERDATA_MAXIDX_OFFSET];
689 buf_size_alloc += ((max_idx + 1) * sizeof(void*));
690 /* allocate space to hold the buffers, index etc */
692 DHD_REORDER(("%s: alloc buffer of size %d size, reorder info id %d, maxidx %d\n",
693 __FUNCTION__, buf_size_alloc, flow_id, max_idx));
694 ptr = (struct reorder_info *)MALLOC(dhd->osh, buf_size_alloc);
696 DHD_ERROR(("%s: Malloc failed to alloc buffer\n", __FUNCTION__));
700 bzero(ptr, buf_size_alloc);
701 dhd->reorder_bufs[flow_id] = ptr;
702 ptr->p = (void *)(ptr+1);
703 ptr->max_idx = max_idx;
705 if (flags & WLHOST_REORDERDATA_NEW_HOLE) {
706 DHD_REORDER(("%s: new hole, so cleanup pending buffers\n", __FUNCTION__));
707 if (ptr->pend_pkts) {
708 dhd_get_hostreorder_pkts(dhd->osh, ptr, pkt, &cnt, &plast,
709 ptr->exp_idx, ptr->exp_idx);
712 ptr->cur_idx = reorder_info_buf[WLHOST_REORDERDATA_CURIDX_OFFSET];
713 ptr->exp_idx = reorder_info_buf[WLHOST_REORDERDATA_EXPIDX_OFFSET];
714 ptr->max_idx = reorder_info_buf[WLHOST_REORDERDATA_MAXIDX_OFFSET];
715 ptr->p[ptr->cur_idx] = cur_pkt;
719 else if (flags & WLHOST_REORDERDATA_CURIDX_VALID) {
720 cur_idx = reorder_info_buf[WLHOST_REORDERDATA_CURIDX_OFFSET];
721 exp_idx = reorder_info_buf[WLHOST_REORDERDATA_EXPIDX_OFFSET];
724 if ((exp_idx == ptr->exp_idx) && (cur_idx != ptr->exp_idx)) {
725 /* still in the current hole */
726 /* enqueue the current on the buffer chain */
727 if (ptr->p[cur_idx] != NULL) {
728 DHD_REORDER(("%s: HOLE: ERROR buffer pending..free it\n",
730 PKTFREE(dhd->osh, ptr->p[cur_idx], TRUE);
731 ptr->p[cur_idx] = NULL;
733 ptr->p[cur_idx] = cur_pkt;
735 ptr->cur_idx = cur_idx;
736 DHD_REORDER(("%s: fill up a hole..pending packets is %d\n",
737 __FUNCTION__, ptr->pend_pkts));
741 else if (ptr->exp_idx == cur_idx) {
742 /* got the right one ..flush from cur to exp and update exp */
743 DHD_REORDER(("%s: got the right one now, cur_idx is %d\n",
744 __FUNCTION__, cur_idx));
745 if (ptr->p[cur_idx] != NULL) {
746 DHD_REORDER(("%s: Error buffer pending..free it\n",
748 PKTFREE(dhd->osh, ptr->p[cur_idx], TRUE);
749 ptr->p[cur_idx] = NULL;
751 ptr->p[cur_idx] = cur_pkt;
754 ptr->cur_idx = cur_idx;
755 ptr->exp_idx = exp_idx;
757 dhd_get_hostreorder_pkts(dhd->osh, ptr, pkt, &cnt, &plast,
760 DHD_REORDER(("%s: freeing up buffers %d, still pending %d\n",
761 __FUNCTION__, cnt, ptr->pend_pkts));
765 bool flush_current = FALSE;
766 /* both cur and exp are moved now .. */
767 DHD_REORDER(("%s:, flow %d, both moved, cur %d(%d), exp %d(%d)\n",
768 __FUNCTION__, flow_id, ptr->cur_idx, cur_idx,
769 ptr->exp_idx, exp_idx));
770 if (flags & WLHOST_REORDERDATA_FLUSH_ALL)
771 end_idx = ptr->exp_idx;
775 /* flush pkts first */
776 dhd_get_hostreorder_pkts(dhd->osh, ptr, pkt, &cnt, &plast,
777 ptr->exp_idx, end_idx);
779 if (cur_idx == ptr->max_idx) {
781 flush_current = TRUE;
783 if (exp_idx == cur_idx + 1)
784 flush_current = TRUE;
788 PKTSETNEXT(dhd->osh, plast, cur_pkt);
794 ptr->p[cur_idx] = cur_pkt;
797 ptr->exp_idx = exp_idx;
798 ptr->cur_idx = cur_idx;
804 /* no real packet but update to exp_seq...that means explicit window move */
805 exp_idx = reorder_info_buf[WLHOST_REORDERDATA_EXPIDX_OFFSET];
807 DHD_REORDER(("%s: move the window, cur_idx is %d, exp is %d, new exp is %d\n",
808 __FUNCTION__, ptr->cur_idx, ptr->exp_idx, exp_idx));
809 if (flags & WLHOST_REORDERDATA_FLUSH_ALL)
810 end_idx = ptr->exp_idx;
814 dhd_get_hostreorder_pkts(dhd->osh, ptr, pkt, &cnt, &plast, ptr->exp_idx, end_idx);
816 PKTSETNEXT(dhd->osh, plast, cur_pkt);
821 /* set the new expected idx */
822 ptr->exp_idx = exp_idx;