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