hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
/******************************************************************************
 *
 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
 *                                        
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
 *
  *******************************************************************************/
 #define _USB_OPS_C_
 
#include <rtl8723b_hal.h>
 
#ifdef CONFIG_SUPPORT_USB_INT
void interrupt_handler_8723bu(_adapter *padapter,u16 pkt_len,u8 *pbuf)
{
   HAL_DATA_TYPE    *pHalData=GET_HAL_DATA(padapter);
   struct reportpwrstate_parm pwr_rpt;
 
   if ( pkt_len != INTERRUPT_MSG_FORMAT_LEN )
   {
       DBG_8192C("%s Invalid interrupt content length (%d)!\n", __FUNCTION__, pkt_len);
       return ;
   }
 
   // HISR 
   _rtw_memcpy(&(pHalData->IntArray[0]), &(pbuf[USB_INTR_CONTENT_HISR_OFFSET]), 4);
   _rtw_memcpy(&(pHalData->IntArray[1]), &(pbuf[USB_INTR_CONTENT_HISRE_OFFSET]), 4);
 
   #if 0 //DBG
   {
       u32 hisr=0 ,hisr_ex=0;
       _rtw_memcpy(&hisr,&(pHalData->IntArray[0]),4);
       hisr = le32_to_cpu(hisr);    
       
       _rtw_memcpy(&hisr_ex,&(pHalData->IntArray[1]),4);
       hisr_ex = le32_to_cpu(hisr_ex);
       
       if((hisr != 0) || (hisr_ex!=0))
           DBG_871X("===> %s hisr:0x%08x ,hisr_ex:0x%08x \n",__FUNCTION__,hisr,hisr_ex);
   }
   #endif
 
 
#ifdef CONFIG_LPS_LCLK
   if(  pHalData->IntArray[0]  & IMR_CPWM_88E )
   {
       _rtw_memcpy(&pwr_rpt.state, &(pbuf[USB_INTR_CONTENT_CPWM1_OFFSET]), 1);
       //_rtw_memcpy(&pwr_rpt.state2, &(pbuf[USB_INTR_CONTENT_CPWM2_OFFSET]), 1);
 
       //88e's cpwm value only change BIT0, so driver need to add PS_STATE_S2 for LPS flow.        
       pwr_rpt.state |= PS_STATE_S2;        
       _set_workitem(&(adapter_to_pwrctl(padapter)->cpwm_event));
   }
#endif//CONFIG_LPS_LCLK
 
#ifdef CONFIG_INTERRUPT_BASED_TXBCN
 
   #ifdef  CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
   if (pHalData->IntArray[0] & IMR_BCNDMAINT0_88E)
   #endif
   #ifdef  CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
   if (pHalData->IntArray[0] & (IMR_TBDER_88E|IMR_TBDOK_88E))
   #endif    
   {
       struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
       #if 0
       if(pHalData->IntArray[0] & IMR_BCNDMAINT0_88E)
           DBG_8192C("%s: HISR_BCNERLY_INT\n", __func__);
       if(pHalData->IntArray[0] & IMR_TBDOK_88E)
           DBG_8192C("%s: HISR_TXBCNOK\n", __func__);
       if(pHalData->IntArray[0] & IMR_TBDER_88E)
           DBG_8192C("%s: HISR_TXBCNERR\n", __func__);
       #endif
       
 
       if(check_fwstate(pmlmepriv, WIFI_AP_STATE))
   {
           //send_beacon(padapter);
           if(pmlmepriv->update_bcn == _TRUE)
   {
               //tx_beacon_hdl(padapter, NULL);
               set_tx_beacon_cmd(padapter);
   }
   }
#ifdef CONFIG_CONCURRENT_MODE
       if(check_buddy_fwstate(padapter, WIFI_AP_STATE))
   {
           //send_beacon(padapter);
           if(padapter->pbuddy_adapter->mlmepriv.update_bcn == _TRUE)
   {
               //tx_beacon_hdl(padapter, NULL);
               set_tx_beacon_cmd(padapter->pbuddy_adapter);
   }
   }
#endif
 
   }
#endif //CONFIG_INTERRUPT_BASED_TXBCN
 
 
 
 
#ifdef DBG_CONFIG_ERROR_DETECT_INT
   if(  pHalData->IntArray[1]  & IMR_TXERR_8723B )
       DBG_871X("===> %s Tx Error Flag Interrupt Status \n",__FUNCTION__);
   if(  pHalData->IntArray[1]  & IMR_RXERR_8723B )
       DBG_871X("===> %s Rx Error Flag INT Status \n",__FUNCTION__);
   if(  pHalData->IntArray[1]  & IMR_TXFOVW_8723B )
       DBG_871X("===> %s Transmit FIFO Overflow \n",__FUNCTION__);
   if(  pHalData->IntArray[1]  & IMR_RXFOVW_8723B )
       DBG_871X("===> %s Receive FIFO Overflow \n",__FUNCTION__);
#endif//DBG_CONFIG_ERROR_DETECT_INT
 
 
   // C2H Event 
   if(pbuf[0]!= 0){
       _rtw_memcpy(&(pHalData->C2hArray[0]), &(pbuf[USB_INTR_CONTENT_C2H_OFFSET]), 16);        
       //rtw_c2h_wk_cmd(padapter); to do..
   }        
 
       }
#endif
 
static s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status)
{
   s32 ret=_SUCCESS;
#ifdef CONFIG_CONCURRENT_MODE
   u8 *secondary_myid, *paddr1;
   union recv_frame    *precvframe_if2 = NULL;
   _adapter *primary_padapter = precvframe->u.hdr.adapter;
   _adapter *secondary_padapter = primary_padapter->pbuddy_adapter;
   struct recv_priv *precvpriv = &primary_padapter->recvpriv;
   _queue *pfree_recv_queue = &precvpriv->free_recv_queue;
   HAL_DATA_TYPE    *pHalData = GET_HAL_DATA(primary_padapter);
 
   if(!secondary_padapter)
       return ret;
 
   paddr1 = GetAddr1Ptr(precvframe->u.hdr.rx_data);
 
   if(IS_MCAST(paddr1) == _FALSE)//unicast packets
   {
       secondary_myid = adapter_mac_addr(secondary_padapter);
 
       if(_rtw_memcmp(paddr1, secondary_myid, ETH_ALEN))
       {
           //change to secondary interface
           precvframe->u.hdr.adapter = secondary_padapter;
       }
 
       //ret = recv_entry(precvframe);
 
   }
   else // Handle BC/MC Packets
   {
       //clone/copy to if2
       _pkt     *pkt_copy = NULL;
       struct rx_pkt_attrib *pattrib = NULL;
 
       precvframe_if2 = rtw_alloc_recvframe(pfree_recv_queue);
 
       if(!precvframe_if2)
           return _FAIL;
 
       precvframe_if2->u.hdr.adapter = secondary_padapter;
       _rtw_memcpy(&precvframe_if2->u.hdr.attrib, &precvframe->u.hdr.attrib, sizeof(struct rx_pkt_attrib));
       pattrib = &precvframe_if2->u.hdr.attrib;
 
       //driver need to set skb len for skb_copy().
       //If skb->len is zero, skb_copy() will not copy data from original skb.
       skb_put(precvframe->u.hdr.pkt, pattrib->pkt_len);
 
       pkt_copy = rtw_skb_copy( precvframe->u.hdr.pkt);
       if (pkt_copy == NULL)
       {
           if((pattrib->mfrag == 1)&&(pattrib->frag_num == 0))
           {
               DBG_8192C("pre_recv_entry(): rtw_skb_copy fail , drop frag frame \n");
               rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
               return ret;
           }
 
           pkt_copy = rtw_skb_clone( precvframe->u.hdr.pkt);
           if(pkt_copy == NULL)
           {
               DBG_8192C("pre_recv_entry(): rtw_skb_clone fail , drop frame\n");
               rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
               return ret;
           }
       }
 
       pkt_copy->dev = secondary_padapter->pnetdev;
 
       precvframe_if2->u.hdr.pkt = pkt_copy;
       precvframe_if2->u.hdr.rx_head = pkt_copy->head;
       precvframe_if2->u.hdr.rx_data = pkt_copy->data;
       precvframe_if2->u.hdr.rx_tail = skb_tail_pointer(pkt_copy);
       precvframe_if2->u.hdr.rx_end = skb_end_pointer(pkt_copy);
       precvframe_if2->u.hdr.len = pkt_copy->len;
 
       //recvframe_put(precvframe_if2, pattrib->pkt_len);
 
       if ( pHalData->ReceiveConfig & RCR_APPFCS)
           recvframe_pull_tail(precvframe_if2, IEEE80211_FCS_LEN);
 
       if (pattrib->physt)
           rx_query_phy_status(precvframe_if2, pphy_status);
 
       if(rtw_recv_entry(precvframe_if2) != _SUCCESS)
       {
           RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
               ("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
       }
   }
 
   //if (precvframe->u.hdr.attrib.physt)
   //    rx_query_phy_status(precvframe, pphy_status);
 
   //ret = rtw_recv_entry(precvframe);
#endif
 
   return ret;
 
}
 
#if 0
static s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status)
{    
   s32 ret=_SUCCESS;
#ifdef CONFIG_CONCURRENT_MODE    
   u8 *secondary_myid, *paddr1;
   union recv_frame    *precvframe_if2 = NULL;
   _adapter *primary_padapter = precvframe->u.hdr.adapter;
   _adapter *secondary_padapter = primary_padapter->pbuddy_adapter;
   struct recv_priv *precvpriv = &primary_padapter->recvpriv;
   _queue *pfree_recv_queue = &precvpriv->free_recv_queue;
   u8    *pbuf = precvframe->u.hdr.rx_data;
   
   if(!secondary_padapter)
       return ret;
   
   paddr1 = GetAddr1Ptr(pbuf);
 
   if(IS_MCAST(paddr1) == _FALSE)//unicast packets
   {
       secondary_myid = adapter_mac_addr(secondary_padapter);
 
       if(_rtw_memcmp(paddr1, secondary_myid, ETH_ALEN))
       {            
           //change to secondary interface
           precvframe->u.hdr.adapter = secondary_padapter;
       }    
 
       //ret = recv_entry(precvframe);
 
   }
   else // Handle BC/MC Packets    
   {
       
       u8 clone = _TRUE;
#if 0        
       u8 type, subtype, *paddr2, *paddr3;
   
       type =  GetFrameType(pbuf);
       subtype = GetFrameSubType(pbuf); //bit(7)~bit(2)
       
       switch (type)
       {
           case WIFI_MGT_TYPE: //Handle BC/MC mgnt Packets
               if(subtype == WIFI_BEACON)
               {
                   paddr3 = GetAddr3Ptr(precvframe->u.hdr.rx_data);
               
                   if (check_fwstate(&secondary_padapter->mlmepriv, _FW_LINKED) &&
                       _rtw_memcmp(paddr3, get_bssid(&secondary_padapter->mlmepriv), ETH_ALEN))
                   {
                       //change to secondary interface
                       precvframe->u.hdr.adapter = secondary_padapter;
                       clone = _FALSE;
                   }
 
                   if(check_fwstate(&primary_padapter->mlmepriv, _FW_LINKED) &&
                       _rtw_memcmp(paddr3, get_bssid(&primary_padapter->mlmepriv), ETH_ALEN))
                   {
                       if(clone==_FALSE)
                       {
                           clone = _TRUE;                                    
                       }    
                       else
                       {
                           clone = _FALSE;
                       }
 
                       precvframe->u.hdr.adapter = primary_padapter;    
                   }
 
                   if(check_fwstate(&primary_padapter->mlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) ||
                       check_fwstate(&secondary_padapter->mlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING))
                   {
                       clone = _TRUE;
                       precvframe->u.hdr.adapter = primary_padapter;    
                   }
               
               }
               else if(subtype == WIFI_PROBEREQ)
               {
                   //probe req frame is only for interface2
                   //change to secondary interface
                   precvframe->u.hdr.adapter = secondary_padapter;
                   clone = _FALSE;
               }            
               break;
           case WIFI_CTRL_TYPE: // Handle BC/MC ctrl Packets
           
               break;
           case WIFI_DATA_TYPE: //Handle BC/MC data Packets
                   //Notes: AP MODE never rx BC/MC data packets
           
               paddr2 = GetAddr2Ptr(precvframe->u.hdr.rx_data);
 
               if(_rtw_memcmp(paddr2, get_bssid(&secondary_padapter->mlmepriv), ETH_ALEN))
               {
                   //change to secondary interface
                   precvframe->u.hdr.adapter = secondary_padapter;
                   clone = _FALSE;
               }
 
               break;
           default:
           
               break;            
       }
#endif
 
       if(_TRUE == clone)
       {
           //clone/copy to if2        
           struct rx_pkt_attrib *pattrib = NULL;
       
           precvframe_if2 = rtw_alloc_recvframe(pfree_recv_queue);
           if(precvframe_if2)
           {
               precvframe_if2->u.hdr.adapter = secondary_padapter;
       
               _rtw_init_listhead(&precvframe_if2->u.hdr.list);    
               precvframe_if2->u.hdr.precvbuf = NULL;    //can't access the precvbuf for new arch.
               precvframe_if2->u.hdr.len=0;
 
               _rtw_memcpy(&precvframe_if2->u.hdr.attrib, &precvframe->u.hdr.attrib, sizeof(struct rx_pkt_attrib));
 
               pattrib = &precvframe_if2->u.hdr.attrib;
 
               if(rtw_os_alloc_recvframe(secondary_padapter, precvframe_if2, pbuf, NULL) == _SUCCESS)                
               {                        
                   recvframe_put(precvframe_if2, pattrib->pkt_len);
                   //recvframe_pull(precvframe_if2, drvinfo_sz + RXDESC_SIZE);
 
                   if (pattrib->physt && pphy_status)
                       rx_query_phy_status(precvframe_if2, pphy_status);
   
                   ret = rtw_recv_entry(precvframe_if2);                
               }    
               else
               {
                   rtw_free_recvframe(precvframe_if2, pfree_recv_queue);
                   DBG_8192C("%s()-%d: alloc_skb() failed!\n", __FUNCTION__, __LINE__);    
               }
 
           }
           
       }
       
   }
   //if (precvframe->u.hdr.attrib.physt)
   //    rx_query_phy_status(precvframe, pphy_status);
 
   //ret = rtw_recv_entry(precvframe);
 
#endif
 
   return ret;
 
}
#endif
 
int recvbuf2recvframe(PADAPTER padapter, void *ptr)
{
   u8 *pbuf;
   u8 pkt_cnt = 0;
   u32 pkt_offset;
   s32 transfer_len;
   u8 *pdata, *pphy_status;
   union recv_frame *precvframe = NULL;
   struct rx_pkt_attrib *pattrib = NULL;
   PHAL_DATA_TYPE pHalData;
   struct recv_priv *precvpriv;
   _queue *pfree_recv_queue;
   _pkt *pskb;
 
 
   pHalData = GET_HAL_DATA(padapter);
   precvpriv = &padapter->recvpriv;
   pfree_recv_queue = &precvpriv->free_recv_queue;
 
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
   pskb = NULL;
   transfer_len = (s32)((struct recv_buf*)ptr)->transfer_len;
   pbuf = ((struct recv_buf*)ptr)->pbuf;
#else // !CONFIG_USE_USB_BUFFER_ALLOC_RX
   pskb = (_pkt*)ptr;
   transfer_len = (s32)pskb->len;
   pbuf = pskb->data;
#endif // !CONFIG_USE_USB_BUFFER_ALLOC_RX
 
#ifdef CONFIG_USB_RX_AGGREGATION
   pkt_cnt = GET_RX_STATUS_DESC_USB_AGG_PKTNUM_8723B(pbuf);
#endif
 
   do {
       precvframe = rtw_alloc_recvframe(pfree_recv_queue);
       if (precvframe == NULL) {
           DBG_8192C("%s: rtw_alloc_recvframe() failed! RX Drop!\n", __FUNCTION__);
           goto _exit_recvbuf2recvframe;
       }
 
       if (transfer_len >1500)
           _rtw_init_listhead(&precvframe->u.hdr.list);
       precvframe->u.hdr.precvbuf = NULL;    //can't access the precvbuf for new arch.
       precvframe->u.hdr.len = 0;
 
       rtl8723b_query_rx_desc_status(precvframe, pbuf);
 
       pattrib = &precvframe->u.hdr.attrib;
 
       if ((padapter->registrypriv.mp_mode == 0)
          && ((pattrib->crc_err) || (pattrib->icv_err))) {
           DBG_8192C("%s: RX Warning! crc_err=%d icv_err=%d, skip!\n",
               __FUNCTION__, pattrib->crc_err, pattrib->icv_err);
 
           rtw_free_recvframe(precvframe, pfree_recv_queue);
           goto _exit_recvbuf2recvframe;
       }
 
       pkt_offset = RXDESC_SIZE + pattrib->drvinfo_sz + pattrib->shift_sz + pattrib->pkt_len;
       if ((pattrib->pkt_len <= 0) || (pkt_offset > transfer_len)) {
           DBG_8192C("%s: RX Error! pkt_len=%d pkt_offset=%d transfer_len=%d\n",
               __FUNCTION__, pattrib->pkt_len, pkt_offset, transfer_len);
 
           rtw_free_recvframe(precvframe, pfree_recv_queue);
           goto _exit_recvbuf2recvframe;
       }
 
       pdata = pbuf + RXDESC_SIZE + pattrib->drvinfo_sz + pattrib->shift_sz;
       if (rtw_os_alloc_recvframe(padapter, precvframe, pdata, pskb) == _FAIL) {
           DBG_8192C("%s: RX Error! rtw_os_alloc_recvframe FAIL!\n", __FUNCTION__);
 
           rtw_free_recvframe(precvframe, pfree_recv_queue);
           goto _exit_recvbuf2recvframe;
       }
 
       recvframe_put(precvframe, pattrib->pkt_len);
 
       if (pattrib->pkt_rpt_type == NORMAL_RX) {
           if (pattrib->physt)
               pphy_status = pbuf + RXDESC_OFFSET;
           else
               pphy_status = NULL;
 
#ifdef CONFIG_CONCURRENT_MODE
           if (rtw_buddy_adapter_up(padapter)) {
               if (pre_recv_entry(precvframe, pphy_status) != _SUCCESS) {
                   // Return fail except data frame
                   //DBG_8192C("%s: RX Error! (concurrent)pre_recv_entry FAIL!\n", __FUNCTION__);
               }
           }
#endif // CONFIG_CONCURRENT_MODE
 
           if (pphy_status)
               rx_query_phy_status(precvframe, pphy_status);
 
           if (rtw_recv_entry(precvframe) != _SUCCESS) {
               // Return fail except data frame
               //DBG_8192C("%s: RX Error! rtw_recv_entry FAIL!\n", __FUNCTION__);
           }
       }
       else {
#ifdef CONFIG_C2H_PACKET_EN
           if (pattrib->pkt_rpt_type == C2H_PACKET) {
               rtl8723b_c2h_packet_handler(padapter, precvframe->u.hdr.rx_data, pattrib->pkt_len);
           }
           else {
               DBG_8192C("%s: [WARNNING] RX type(%d) not be handled!\n",
                   __FUNCTION__, pattrib->pkt_rpt_type);
           }
#endif // CONFIG_C2H_PACKET_EN
           rtw_free_recvframe(precvframe, pfree_recv_queue);
       }
 
#ifdef CONFIG_USB_RX_AGGREGATION
       // jaguar 8-byte alignment
       pkt_offset = (u16)_RND8(pkt_offset);
       pkt_cnt--;
       pbuf += pkt_offset;
#endif
       transfer_len -= pkt_offset;
       precvframe = NULL;
   } while (transfer_len > 0);
 
_exit_recvbuf2recvframe:
 
   return _SUCCESS;    
}
 
 
void rtl8723bu_xmit_tasklet(void *priv)
{    
   int ret = _FALSE;
   _adapter *padapter = (_adapter*)priv;
   struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
   while(1)
   {
       if (RTW_CANNOT_TX(padapter))
       {
           DBG_8192C("xmit_tasklet => bDriverStopped or bSurpriseRemoved or bWritePortCancel\n");
           break;
       }
 
       if (rtw_xmit_ac_blocked(padapter) == _TRUE)
           break;
 
       ret = rtl8723bu_xmitframe_complete(padapter, pxmitpriv, NULL);
 
       if(ret==_FALSE)
           break;
       
   }
   
}
 
 
 
void rtl8723bu_set_intf_ops(struct _io_ops    *pops)
{
   _func_enter_;
   
   _rtw_memset((u8 *)pops, 0, sizeof(struct _io_ops));    
 
   pops->_read8 = &usb_read8;
   pops->_read16 = &usb_read16;
   pops->_read32 = &usb_read32;
   pops->_read_mem = &usb_read_mem;
   pops->_read_port = &usb_read_port;
   
   pops->_write8 = &usb_write8;
   pops->_write16 = &usb_write16;
   pops->_write32 = &usb_write32;
   pops->_writeN = &usb_writeN;
   
#ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ    
   pops->_write8_async= &usb_async_write8;
   pops->_write16_async = &usb_async_write16;
   pops->_write32_async = &usb_async_write32;
#endif    
   pops->_write_mem = &usb_write_mem;
   pops->_write_port = &usb_write_port;
 
   pops->_read_port_cancel = &usb_read_port_cancel;
   pops->_write_port_cancel = &usb_write_port_cancel;
 
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
   pops->_read_interrupt = &usb_read_interrupt;
#endif
 
   _func_exit_;
 
}
void rtl8723bu_set_hw_type(struct dvobj_priv *pdvobj)
{
   pdvobj->HardwareType = HARDWARE_TYPE_RTL8723BU;
   DBG_871X("CHIP TYPE: RTL8723BU\n");
}