123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- #ifndef __WFD_IF_H__
- #define __WFD_IF_H__
- #include <pthread.h>
- #include "types.h"
- #include "netsetting_if.h"
- typedef struct MIRACAST_MessageBody_t_ {
- UINT32 dMessage;
- void *dParam;
- } MIRACAST_MessageBody_t;
- typedef enum
- {
- MIRACAST_FINDING,
- MIRACAST_FIND_DEVICES,
- MIRACAST_FIND_RETRY,
- MIRACAST_CONNECTING,
- MIRACAST_CONNECT_SUCCESS,
- MIRACAST_CONNECT_INACTIVE,
- MIRACAST_CONNECT_RETRY,
- MIRACAST_CONNECT_FAIL,
- MIRACAST_HDCP_FAIL,
- MIRACAST_DISCONNECT_RECEIVED,
- MIRACAST_EXIT_SUCCESS,
- MIRACAST_NO_DONGLE,
- }MIRACAST_Message_t;
- typedef int (*MIRACAST_ModCbk_pf)(MIRACAST_Message_t message, void *arg);
- typedef struct MIRACAST_ModualCfg_t_
- {
- MIRACAST_ModCbk_pf pfCallBack;
- } MIRACAST_ModualCfg_t;
- //typedef void (*cb_handler_t)(int event_id, void *arg);
- typedef struct _WIFI_WFD_Info_t
- {
- char pszDeviceName[32];
- char pszMAC[17];
- INT32 sdTcpPort;
- INT32 sdMaxThroughput;
- INT32 sdDeviceType;
- char pszPeerAddr[20];
- //cb_handler_t callback;
- }WIFI_WFD_Info_t;
- #if 0
- extern WIFI_WFD_Info_t *info;
- static inline void send_event(int event_id, void *arg)
- {
- if(info->callback)
- info->callback(event_id, arg);
- }
- #endif
- typedef struct WFD_Config_t
- {
- pthread_t tid;
- INT32 sdTcpPort;
- char peerIpAddr[17];
- }WFD_Config_t;
- typedef struct WFD_AV_FMT_t
- {
- char wfd_video_resolution[15];
- char wfd_audio_codec[15];
- }WFD_AV_FMT_t, *p_WFD_AV_FMT_t;
- typedef enum
- {
- WFD_CBK_SOURCE_KNOCK,
- WFD_CBK_LINK_SUCCESS,
- WFD_CBK_LINK_SUCCESS_NO_VIDEO,
- WFD_CBK_LINK_DISCONNECTED,
- WFD_CBK_SOURCE_SOURCE_TEARDOWN
- } WFD_CallbackType_e;
- #ifdef CONFIG_SUPPORT_MTK7601
- typedef unsigned char UCHAR;
- typedef unsigned short USHORT;
- typedef unsigned int UINT;
- /* START ---- For persistent group table ---- */
- #define IWSC_MAX_SUB_MASK_LIST_COUNT 3
- #define P2P_DEVICE_NAME_LEN 32
- #define OID_P2P_OFFSET 0x0000
- #define OID_802_11_P2P_PERSISTENT_TABLE (0x0846 + OID_P2P_OFFSET)
- #define OID_GET_SET_TOGGLE 0x8000
- #define NDIS_802_11_LENGTH_SSID 32
- #define MAC_ADDR_LEN 6
- #define MAX_P2P_TABLE_SIZE 9
- #define RT_PRIV_IOCTL (SIOCIWFIRSTPRIV + 0x01)
- #define P2P_IF "p2p0"
- typedef struct _NDIS_802_11_SSID {
- UINT SsidLength; /* length of SSID field below, in bytes; */
- /* this can be zero. */
- UCHAR Ssid[NDIS_802_11_LENGTH_SSID]; /* SSID information field */
- } NDIS_802_11_SSID, *PNDIS_802_11_SSID;
- typedef struct _WSC_CREDENTIAL {
- NDIS_802_11_SSID SSID; /* mandatory */
- USHORT AuthType; /* mandatory, 1: open, 2: wpa-psk, 4: shared, 8:wpa, 0x10: wpa2, 0x20: wpa2-psk */
- USHORT EncrType; /* mandatory, 1: none, 2: wep, 4: tkip, 8: aes */
- UCHAR Key[64]; /* mandatory, Maximum 64 byte */
- USHORT KeyLength;
- UCHAR MacAddr[MAC_ADDR_LEN]; /* mandatory, AP MAC address */
- UCHAR KeyIndex; /* optional, default is 1 */
- UCHAR bFromUPnP; /* TRUE: This credential is from external UPnP registrar */
- UCHAR Rsvd[2]; /* Make alignment */
- USHORT IpConfigMethod;
- UINT32 RegIpv4Addr;
- UINT32 Ipv4SubMask;
- UINT32 EnrIpv4Addr;
- UINT32 AvaIpv4SubmaskList[IWSC_MAX_SUB_MASK_LIST_COUNT];
- } WSC_CREDENTIAL, *PWSC_CREDENTIAL;
- typedef struct _RT_P2P_PERSISTENT_ENTRY
- {
- BOOLEAN bValid;
- UCHAR MyRule; /* My rule is GO or Client */
- UCHAR Addr[MAC_ADDR_LEN]; /* this addr is to distinguish this persistent entry is for which mac addr */
- UCHAR DeviceName[P2P_DEVICE_NAME_LEN+1];
- WSC_CREDENTIAL Profile; /* profile's bssid is always the GO's bssid. */
- } RT_P2P_PERSISTENT_ENTRY, *PRT_P2P_PERSISTENT_ENTRY;
- typedef struct {
- char wfd_if_name[8];
- RT_P2P_PERSISTENT_ENTRY wfd_profiles[MAX_P2P_TABLE_SIZE];
- } ralink_private_t;
- #endif
- #define MIRACASE_DEV_NAME "RDA_Miracast" /*Max Length of Device name is 13 (the max length of DEV_NAME+MAC is 32)*/
- enum HDCP_VERSION
- {
- HDCP_VERSION_2_0,
- HDCP_VERSION_2_1,
- HDCP_VERSION_2_2,
- };
- #ifdef CONFIG_SUPPORT_MIRACAST_HDCP
- #ifdef CONFIG_SUPPORT_STORE_HDCP2X_TO_FLASH
- #define MIRACASE_SUPPORT_HDCP HDCP_VERSION_2_2
- #else
- #define MIRACASE_SUPPORT_HDCP HDCP_VERSION_2_1
- #endif
- #else
- #define MIRACASE_SUPPORT_HDCP 0
- #endif
- typedef struct
- {
- Dongle_e eDongle;
- char* P2PName;
- char* Dev_Name;
- char bHDCP;
- } Miracast_Info_t;
- void WFD_send_event(MIRACAST_Message_t message, void *arg);
- //API
- void Miracast_SetChannel(int channel);
- void Miracast_Startup(MIRACAST_ModCbk_pf pfCallBack,Miracast_Info_t *pMiracastInfo);
- BOOL Miracast_Check();
- void Miracast_Exit(void);
- typedef int (*WFD_CBK_Func)(WFD_CallbackType_e eSCCBKType, UINT32 dparam);
- void WFD_Init_AP_CBKFunc(WFD_CBK_Func pfEventCallBack);
- #endif
|