• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright(c) 2007 - 2011 Realtek Corporation. */
3 
4 #ifndef __OSDEP_INTF_H_
5 #define __OSDEP_INTF_H_
6 
7 #include "osdep_service.h"
8 #include "drv_types.h"
9 
10 struct intf_priv {
11 	u8 *intf_dev;
12 	u32	max_iosz;	/* USB2.0: 128, USB1.1: 64, SDIO:64 */
13 	u32	max_xmitsz; /* USB2.0: unlimited, SDIO:512 */
14 	u32	max_recvsz; /* USB2.0: unlimited, SDIO:512 */
15 
16 	u8 *io_rwmem;
17 	u8 *allocated_io_rwmem;
18 	u32	io_wsz; /* unit: 4bytes */
19 	u32	io_rsz;/* unit: 4bytes */
20 	u8 intf_status;
21 
22 	void (*_bus_io)(u8 *priv);
23 
24 /*
25 Under Sync. IRP (SDIO/USB)
26 A protection mechanism is necessary for the io_rwmem(read/write protocol)
27 
28 Under Async. IRP (SDIO/USB)
29 The protection mechanism is through the pending queue.
30 */
31 	struct mutex ioctl_mutex;
32 	/*  when in USB, IO is through interrupt in/out endpoints */
33 	struct usb_device	*udev;
34 	struct urb *piorw_urb;
35 	u8 io_irp_cnt;
36 	u8 bio_irp_pending;
37 	struct semaphore  io_retevt;
38 	struct timer_list io_timer;
39 	u8 bio_irp_timeout;
40 	u8 bio_timer_cancel;
41 };
42 
43 u8 rtw_init_drv_sw(struct adapter *padapter);
44 u8 rtw_free_drv_sw(struct adapter *padapter);
45 u8 rtw_reset_drv_sw(struct adapter *padapter);
46 
47 u32 rtw_start_drv_threads(struct adapter *padapter);
48 void rtw_stop_drv_threads (struct adapter *padapter);
49 void rtw_cancel_all_timer(struct adapter *padapter);
50 
51 int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
52 struct net_device *rtw_init_netdev(struct adapter *padapter);
53 u16 rtw_recv_select_queue(struct sk_buff *skb);
54 void rtw_proc_init_one(struct net_device *dev);
55 void rtw_proc_remove_one(struct net_device *dev);
56 
57 void rtw_ips_dev_unload(struct adapter *padapter);
58 
59 int rtw_ips_pwr_up(struct adapter *padapter);
60 void rtw_ips_pwr_down(struct adapter *padapter);
61 int rtw_hw_suspend(struct adapter *padapter);
62 int rtw_hw_resume(struct adapter *padapter);
63 
64 #endif	/* _OSDEP_INTF_H_ */
65