WE310F5  39.00.000
m2mb_wlan_driver.h
Go to the documentation of this file.
1 /*===============================================================================================*/
2 /* >>> Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved.<<< */
26 /* GLOBAL DECLARATIONS ==========================================================================*/
27 #ifndef M2MB_WLAN_DRIVER_H_
28 #define M2MB_WLAN_DRIVER_H_
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
53 /*-----------------------------------------------------------------------------------------------*/
54 
59 /*-----------------------------------------------------------------------------------------------*/
60 
61 /*===============================================================================================*/
62 
63 /* Global typedefs ==============================================================================*/
64 
65 
66 #define M2MB_WLAN_MAC_LEN 6
67 #define M2MB_WLAN_MAX_SSID_LEN 32
69 #define M2MB_WLAN_MIN_PASSPHRASE_LEN 8
70 #define M2MB_WLAN_MAX_PASSPHRASE_LEN 64
72 #define M2MB_WLAN_NUM_OF_DEVICES 2
75 #define M2MB_WLAN_MIN_WEP_KEY_SIZE 10
76 #define M2MB_WLAN_MAX_WEP_KEY_SIZE 26
78 #define M2MB_WLAN_WPS_MAX_KEY_LEN 64
80 #define DEV_NUM 2
89 typedef struct M2MB_WLAN_BSS_SCAN_INFO_S
90 {
91  UINT8 channel;
92  UINT8 ssid_Length;
93  INT8 rssi;
95  UINT8 security_Enabled;
97  UINT16 beacon_Period;
98  UINT8 preamble;
99  UINT8 bss_type;
102  UINT8 rsn_Cipher;
103  UINT8 rsn_Auth;
104  UINT8 wpa_Cipher;
105  UINT8 wpa_Auth;
106  UINT16 caps;
107  UINT8 wep_Support;
108  UINT8 reserved;
119 typedef struct M2MB_WLAN_BSS_SCAN_CB_INFO_S
120 {
122  VOID *scan_info;
125 
132 typedef struct M2MB_WEP_KEY_INFO_S
133 {
138 
147 typedef struct M2MB_STA_BMISS_CONFIG_S
148 {
155 
156 
165 typedef struct M2MB_CONNECTION_DATA_S
166 {
183  UINT32 bssCon;
203 
215 typedef enum
216 {
239 typedef enum
240 {
258 typedef enum
259 {
268 
278 typedef struct M2MB_WLAN_PROFILE_PNO_S
279 {
288  UINT8 ssid_len;
301 typedef enum
302 {
409 
411 
413 
415 
417 
419 
421 
423 
425 
427 
428  /*This flag is used to enable or disable the UAPSD support in STA mode.
429  1 is to enable and 0 is to disable*/
431  /* This is used to Turn ON the RADIO or Turn OFF */
433  /* This is used to Register User Callback in wlan CTX */
443 typedef enum
444 {
467 typedef enum
468 {
470  M2MB_WLAN_11N_HT20 = 0x2,
479 typedef enum
480 {
482  M2MB_WLAN_11G_MODE = 0x2,
491 
492 typedef struct M2MB_WLAN_PHY_DATA_RATE_S
493 {
505 typedef enum
506 {
524 typedef enum
525 {
532 typedef enum
533 {
544 typedef struct M2MB_WLAN_WPS_CREDENTIALS_S
545 {
557 typedef struct
558 {
559  UINT8 eap_flag;
560  M2MB_WLAN_8021X_METHOD_E method;
561  UINT8 id[32];
562  UINT8 username[32];
563  UINT8 password[32];
564  UINT8 ca_name[32];
565  UINT8 cert_name[32];
574 typedef struct M2MB_WLAN_WPS_CB_INFO_S
575 {
577  UINT8 error;
588 typedef enum {
603 typedef enum
604 {
615 
622 typedef struct M2MB_WLAN_RAW_SEND_PARAMS_S
623 {
629  UINT32 channel;
649 typedef enum
650 {
657 
659 
665 typedef enum
666 {
671 
673 
680 typedef struct M2MB_WLAN_POWER_MODE_SETTING_S
681 {
686 
692 typedef enum
693 {
699 
705 typedef struct
706 {
707  UINT16 idle_period_in_ms;
711  UINT16 ps_poll_num;
718  M2MB_WLAN_DTIM_POLICY_E dtim_policy;
724  UINT16 num_tx_to_wakeup;
729 
730 #define M2MB_WLAN_PROM_FILTER_SRC_ADDR 0x01
731 #define M2MB_WLAN_PROM_FILTER_DST_ADDR 0x02
732 #define M2MB_WLAN_PROM_FILTER_FRAME_TYPE 0x04
733 #define M2MB_WLAN_PROM_FILTER_FRAME_SUB_TYPE 0x08
741 typedef struct
742 {
743  UINT8 channel;
745  UINT8 filter_number;
747  UINT8 filter_flags;
750  UINT8 src_Mac[M2MB_WLAN_MAC_LEN];
754  UINT8 promisc_frametype;
756  UINT8 promisc_subtype;
759 
760 typedef struct
761 {
762  UINT8 en_dis_flag;
763  UINT8 filter_num;
766 typedef enum
767 {
769  M2MB_WLAN_MODE_STA_UP = 0x01,
774 #define ALBANIA "AL"
775 #define ARUBA "AW"
776 #define AUSTRIA "AT"
777 #define BELARUS "BY"
778 #define BELGIUM "BE"
779 #define BOSNIA_HERZEGOWANIA "BA"
780 #define BULGARIA "BG"
781 #define CAMBODIA "KH"
782 #define CROATIA "HR"
783 #define CYPRUS "CY"
785 #define CZECH "CZ"
786 #define DENMARK "DK"
787 #define ESTONIA "EE"
788 #define FINLAND "FI"
789 #define FRANCE "FR"
790 #define GERMANY "DE"
791 #define GREECE "GR"
792 #define GREENLAND "GL"
793 #define GAUTEMALA "GT"
794 #define HUNGARY "HU"
796 #define ICELAND "IS"
797 #define IRELAND "IE"
798 #define ITALY "IT"
799 #define LATVIA "LV"
800 #define LIECHTENSTEIN "LI"
801 #define LITHUANIA "LT"
802 #define LUXEMBOURG "LU"
803 #define MACEDONIA "MK"
804 #define MALAWI "MW"
805 #define MALTA "MT"
807 #define MONACO "MC"
808 #define NETHERLANDS "NL"
809 #define NETHERLAND_ANTILLES "AN"
810 #define NORWAY "NO"
811 #define OMAN "OM"
812 #define POLAND "PL"
813 #define PORTUGAL "PT"
814 #define ROMANIA "RO"
815 #define MONTENEGRO "ME"
816 #define SERBIA "RS"
817 
818 #define SLOVAKIA "SK"
819 #define SLOVENIA "SI"
820 #define SPAIN "ES"
821 #define SWEDEN "SE"
822 #define SWITZERLAND "CH"
823 #define TURKEY "TR"
824 #define UNITED_KINGDOM "GB"
825 #define ZIMBABWE "ZW"
826 #define AFGHANISTAN "AF"
827 #define BHUTAN "BT"
829 #define CHAD "TD"
830 #define ETHIOPIA "ET"
831 #define FRENCH_GUIANA "GF"
832 #define FRENCH_POLYNESIA "PF"
833 #define GUADELOUPE "GP"
834 #define LESOTHO "LS"
835 #define MARTINIQUE "MQ"
836 #define MAYOTTE "YT"
837 #define MOLDOVA "MD"
838 #define MONTENEGRO "ME"
840 #define REUNION "RE"
841 #define SAINT_BARTHELEMY "BL"
842 #define SAINT_MARTIN "MF"
843 #define SAINT_PIERRE_AND_MIQUELON "PM"
844 #define SAINT_VINCENT_AND_THE_GRENADIENS "VC"
845 #define SAMOA "WS"
846 #define SURINAME "SR"
847 #define TOGO "TG"
848 #define WALLIS_AND_FUTUNA "WF"
849 #define EGYPT "EG"
851 #define ISRAEL "IL"
852 #define KUWAIT "KW"
853 #define MOROCCO "MA"
854 #define TUNISIA "TN"
855 #define UZBEKISTAN "UZ"
856 #define ARMENIA "AM"
857 #define AZERBAIJAN "AZ"
858 #define GEORGIA "GE"
859 #define BELIZE "BZ"
860 #define RUSSIA "RU"
862 #define UKRAINE "UA"
863 #define DOMINICAN_REPUBLIC "DO"
864 #define EL_SALVADOR "SV"
865 #define PANAMA "PA"
866 #define DOMINICA "DM"
867 #define BARBADOS "BB"
868 #define CHINA "CN"
869 #define URUGUAY "UY"
870 #define VENEZUELA "VE"
871 #define ARGENTINA "AR"
873 #define AUSTRALIA "AU"
874 #define BRAZIL "BR"
875 #define CANADA "CA"
876 #define COLOMBIA "CO"
877 #define COSTA_RICA "CR"
878 #define ECUADOR "EC"
879 #define GRENADA "GD"
880 #define GUAM "GU"
881 #define HAITI "HT"
882 #define HONDURAS "HN"
884 #define HONG_KONG "HK"
885 #define JAMAICA "JM"
886 #define LEBANON "LB"
887 #define MACAU "MO"
888 #define MEXICO "MX"
889 #define NEW_ZEALAND "NZ"
890 #define PERU "PE"
891 #define PHILIPPINES "PH"
892 #define PUERTO_RICO "PR"
893 #define RWANDA "RW"
895 #define SAUDI_ARABIA "SA"
896 #define SINGAPORE "SG"
897 #define SOUTH_AFRICA "ZA"
898 #define TAIWAN "TW"
899 #define THAILAND "TH"
900 #define TRINIDAD_Y_TOBAGO "TT"
901 #define UGANDA "UG"
902 #define UAE "AE"
903 #define UNITED_STATES "US"
904 #define VIET_NAM "VN"
906 #define AMERICAN_SAMOA "AS"
907 #define BAHAMAS "BS"
908 #define BERMUDA "BM"
909 #define BURKINA_FASO "BF"
910 #define CAYMAN_ISLANDS "KY"
911 #define CENTRAL_AFRICA_REPUBLIC "CF"
912 #define CHRISTMAS_ISLAND "CX"
913 #define DIVOIRE "CI"
914 #define GHANA "GH"
915 #define MARSHAL_ISLANDS "MH"
917 #define MAURITIUS "MU"
918 #define MICRONESIA "FM"
919 #define MONGOLIA "MN"
920 #define NICARAGUA "NI"
921 #define NORTHERN_MARIANA_ISLANDS "MP"
922 #define PALAU "PW"
923 #define PARAGUAY "PY"
924 #define SENEGAL "SN"
925 #define TURKS_AND_CAICOS "TC"
926 #define VANUATU "VU"
928 #define US_VIRGIN_ISLANDS "VI"
929 #define AUSTRALIA_AP "AU"
930 #define MALAYSIA "MY"
931 #define BANGLADESH "BD"
932 #define PAKISTAN "PK"
933 #define QATAR "QA"
934 #define GUYANA "GY"
935 #define TANZANIA "TZ"
936 #define INDONESIA "ID"
937 #define JORDAN "JO"
939 #define BAHRAIN "BH"
940 #define BRUNEI_DARUSSALAM "BN"
941 #define CHILE "CL"
942 #define INDIA "IN"
943 #define NEPAL "NP"
944 #define MALDIVES "MV"
945 #define BOLIVIA "BO"
946 #define NIGERIA "NG"
947 #define KOREA_ROC "KR"
948 #define SAINT_KITTS_AND_NEVIS "KN"
950 #define SAINT_LUCIA "LC"
951 #define KENYA "KE"
952 #define ALGERIA "DZ"
953 #define JAPAN "JP"
954 /*===============================================================================================*/
963 typedef VOID (* M2MB_WLAN_CALLBACK)(UINT8 device_id, UINT8 event_id, INT32 status, VOID *data, VOID* usr_ctx );
964 
965 #endif
966 
967 /* External variables ===========================================================================*/
968 
969 /* External functions ===========================================================================*/
970 
971 
972 /* Global functions =============================================================================*/
973 
974 /*-----------------------------------------------------------------------------------------------*/
975 
1003 /*-----------------------------------------------------------------------------------------------*/
1005 
1006 /*-----------------------------------------------------------------------------------------------*/
1072 /*-----------------------------------------------------------------------------------------------*/
1074  M2MB_WLAN_CALLBACK m2m_wlan_user_cb, VOID *appCtx, UINT8 *device_id);
1075 
1076 /*-----------------------------------------------------------------------------------------------*/
1077 
1170 /*-----------------------------------------------------------------------------------------------*/
1171 INT8 m2mb_wlan_scan(UINT8 device_id, UINT8 *ssid, UINT8 no_of_channels,
1172  UINT8 *channel_list, UINT8 scan_type,
1173  UINT32 num_of_scan_entries, M2MB_WLAN_BSS_SCAN_INFO_T *result_buff,
1174  M2MB_WLAN_CALLBACK m2mb_user_cb, VOID *ctx );
1175 
1176 /*-----------------------------------------------------------------------------------------------*/
1177 
1254 /*-----------------------------------------------------------------------------------------------*/
1255 INT8 m2mb_wlan_connect ( UINT8 device_id, UINT8 *ssid );
1256 
1257 /*-----------------------------------------------------------------------------------------------*/
1258 
1315 /*-----------------------------------------------------------------------------------------------*/
1316 INT8 m2mb_wlan_disconnect( UINT8 device_id );
1317 
1318 /*-----------------------------------------------------------------------------------------------*/
1319 
1377 /*-----------------------------------------------------------------------------------------------*/
1378 INT32 m2mb_wlan_get_param( UINT8 device_id, M2MB_WLAN_PARAM_FLAG_E flag, void *data );
1379 
1380 /*-----------------------------------------------------------------------------------------------*/
1381 
1440 /*-----------------------------------------------------------------------------------------------*/
1441 INT32 m2mb_wlan_set_param ( UINT8 device_id, M2MB_WLAN_PARAM_FLAG_E flag, VOID *data );
1442 
1443 /*-----------------------------------------------------------------------------------------------*/
1444 
1478 /*-----------------------------------------------------------------------------------------------*/
1480 
1481 /*-----------------------------------------------------------------------------------------------*/
1482 
1528 /*-----------------------------------------------------------------------------------------------*/
1530 
1531 /*-----------------------------------------------------------------------------------------------*/
1532 
1615 /*-----------------------------------------------------------------------------------------------*/
1616 INT8 m2mb_wlan_create( UINT8 device_id );
1617 
1618 /*-----------------------------------------------------------------------------------------------*/
1619 
1676 /*-----------------------------------------------------------------------------------------------*/
1677 INT8 m2mb_wlan_register_cb(UINT8 device_id, M2MB_WLAN_CALLBACK m2m_wlan_cb,
1678  VOID *ctx);
1679 
1680 /*-----------------------------------------------------------------------------------------------*/
1681 
1741 /*-----------------------------------------------------------------------------------------------*/
1743  VOID *ctx);
1744 
1745 /*-----------------------------------------------------------------------------------------------*/
1746 
1827 /*-----------------------------------------------------------------------------------------------*/
1829  M2MB_WLAN_WPS_CONNECT_ACTION_E connect_action, UINT8 *pin, UINT8 *ssid);
1830 /*-----------------------------------------------------------------------------------------------*/
1866 /*-----------------------------------------------------------------------------------------------*/
1867 INT8 m2mb_wlan_status_get(INT8 device_id);
1868 
1869 /*-----------------------------------------------------------------------------------------------*/
1922 /*-----------------------------------------------------------------------------------------------*/
1924  M2MB_WLAN_MGMT_FRAME_TYPE_E frame_type, INT8* oui, INT8* vndr_spefc_data);
1925 /*-----------------------------------------------------------------------------------------------*/
1971 /*-----------------------------------------------------------------------------------------------*/
1973 /*-----------------------------------------------------------------------------------------------*/
1974 
2023 /*-----------------------------------------------------------------------------------------------*/
2025 /*-----------------------------------------------------------------------------------------------*/
2026 
2027 
2029 
2033 /*-----------------------------------------------------------------------------------------------*/
2034 
M2MB_WLAN_ENCRYPT_TYPE_E encryption_type
VOID(* M2MB_WLAN_CALLBACK)(UINT8 device_id, UINT8 event_id, INT32 status, VOID *data, VOID *usr_ctx)
WLAN call back prototype.
M2MB_WLAN_PARAM_FLAG_E
WLAN interface set or get flags.
#define M2MB_WLAN_WPS_MAX_KEY_LEN
Beacon miss parameters setting in firmware.
UINT8 m2mb_wlan_get_active_mode(VOID)
Structure of members for scan results.
#define M2MB_WLAN_MAC_LEN
M2MB_WLAN_WPS_CONNECT_ACTION_E
action after WPS procedure success.
M2MB_WLAN_RAW_MODE_HEADER_TYPE_E header_Type
unsigned char UINT8
Definition: m2mb_types.h:86
struct M2MB_WLAN_WPS_CREDENTIALS_S M2MB_WLAN_WPS_CREDENTIALS_T
WPS credentials information.
M2MB_WLAN_AUTH_TYPE_E auth_type
WEP key info structure.
struct M2MB_WLAN_BSS_SCAN_CB_INFO_S M2MB_WLAN_BSS_SCAN_CB_INFO_T
Structure to get the count for scan results.
INT8 m2mb_wlan_scan(UINT8 device_id, UINT8 *ssid, UINT8 no_of_channels, UINT8 *channel_list, UINT8 scan_type, UINT32 num_of_scan_entries, M2MB_WLAN_BSS_SCAN_INFO_T *result_buff, M2MB_WLAN_CALLBACK m2mb_user_cb, VOID *ctx)
This API is used to initiate a wireless scan to find nearby access points m2mb_wlan_init and m2mb_wla...
M2MB_WLAN_MODE_E
WLAN interface operating modes.
M2MB_WLAN_POWER_MODE_E power_mode
struct M2MB_WLAN_BSS_SCAN_INFO_S M2MB_WLAN_BSS_SCAN_INFO_T
Structure of members for scan results.
UINT8 key[M2MB_WLAN_WPS_MAX_KEY_LEN+1]
struct M2MB_WEP_KEY_INFO_S M2MB_WEP_KEY_INFO_T
WEP key info structure.
M2MB_WLAN_MGMT_FRAME_TYPE_E
MGMT frame types.
Connection event info for both AP and STA modes.
INT32 m2mb_wlan_send_raw_packet(UINT8 device_id, M2MB_WLAN_RAW_SEND_PARAMS_T *params)
API to send raw packets in the air.
M2MB_WLAN_RAW_MODE_HEADER_TYPE_E
802.11 header types.
M2MB_WLAN_AUTH_TYPE_E
Different authentication modes supported by WLAN.
UINT8 addr4[M2MB_WLAN_MAC_LEN]
INT32 m2mb_wlan_set_param(UINT8 device_id, M2MB_WLAN_PARAM_FLAG_E flag, VOID *data)
Setting the value[M2M_WLAN_PARAM_FLAG_E] to WLAN.
UINT8 peer_dev_addr[M2MB_WLAN_MAC_LEN]
struct M2MB_WLAN_RAW_SEND_PARAMS_S M2MB_WLAN_RAW_SEND_PARAMS_T
802.11 RAW frame.
struct M2MB_STA_BMISS_CONFIG_S M2MB_STA_BMISS_CONFIG_T
Beacon miss parameters setting in firmware.
unsigned short UINT16
Definition: m2mb_types.h:87
WPS cb information.
#define M2MB_WLAN_MAX_WEP_KEY_SIZE
UINT8 ssid[M2MB_WLAN_MAX_SSID_LEN]
INT8 m2mb_wlan_register_wps_cb(UINT8 device_id, M2MB_WLAN_CALLBACK m2m_wlan_cb, VOID *ctx)
Registering a call back for handling WPS events.
struct M2MB_WLAN_WPS_CB_INFO_S M2MB_WLAN_WPS_CB_INFO_T
WPS cb information.
M2MB_WLAN_POWER_MODE_E
power save modes.
INT8 m2mb_wlan_register_cb(UINT8 device_id, M2MB_WLAN_CALLBACK m2m_wlan_cb, VOID *ctx)
Registering a call back in WLAN driver to handle events.
INT8 m2mb_wlan_create(UINT8 device_id)
This API is part of create process in soft-AP mode.
struct M2MB_CONNECTION_DATA_S M2MB_CONNECTION_DATA_T
Connection event info for both AP and STA modes.
INT8 m2mb_wlan_init(M2MB_WLAN_11N_HT_E mode)
WLAN module initialization.
M2MB_WLAN_AUTH_TYPE_E auth_Mode
UINT8 addr2[M2MB_WLAN_MAC_LEN]
signed char INT8
Definition: m2mb_types.h:80
M2MB_WLAN_POWER_MODULE_E power_module
UINT8 mac_Addr[M2MB_WLAN_MAC_LEN]
M2MB_WLAN_WPS_CREDENTIALS_T credential
void VOID
Definition: m2mb_types.h:74
struct M2MB_WLAN_POWER_MODE_SETTING_S M2MB_WLAN_POWER_MODE_SETTING_T
Data structure for power mode setting.
M2MB_WLAN_8021X_METHOD_E
Different 802.1x methods supported by WLAN firmware.
INT8 m2mb_wlan_connect(UINT8 device_id, UINT8 *ssid)
This API is part of connect process in non-AP station mode.
INT32 m2mb_wlan_add_ie_mgmt_frames(UINT8 device_id, M2MB_WLAN_MGMT_FRAME_TYPE_E frame_type, INT8 *oui, INT8 *vndr_spefc_data)
Adding information element for mgmt frames.
INT8 m2mb_wlan_interface_init(M2MB_WLAN_MODE_E mode, M2MB_WLAN_CALLBACK m2m_wlan_user_cb, VOID *appCtx, UINT8 *device_id)
WLAN Interface Initialization.
INT8 m2mb_wlan_deinit(VOID)
Disables the WLAN module.
Data structure for power mode setting.
INT8 m2mb_wlan_disconnect(UINT8 device_id)
Disconnects a device from a network.
M2MB_WLAN_DTIM_POLICY_E
DTIM policies.
struct M2MB_WLAN_PHY_DATA_RATE_S M2MB_WLAN_PHY_DATA_RATE_T
UINT8 key[M2MB_WLAN_MAX_WEP_KEY_SIZE]
Preferred Network Offload setting in firmware.
#define M2MB_WLAN_MAX_SSID_LEN
M2MB_WLAN_CB_ID_E
Events for an application registered CB functions.
unsigned long int UINT32
Definition: m2mb_types.h:88
signed int INT32
Definition: m2mb_types.h:82
promiscuous mode filter setting.
M2MB_WLAN_ENCRYPT_TYPE_E encryption_Type
M2MB_WLAN_ENCRYPT_TYPE_E
Different encryption modes supported by WLAN.
INT8 m2mb_wlan_deregister_cb(UINT8 device_id)
Deregister the cb in WLAN driver.
WPS credentials information.
M2MB_WLAN_POWER_MODULE_E
power save modes.
M2MB_WLAN_PHY_MODE_E mode
INT8 m2mb_wlan_interface_deinit(UINT8 device_id)
Removes the interface from the WLAN driver.
INT32 m2mb_wlan_wps_start(UINT8 device_id, M2MB_WLAN_WPS_MODE_E method, M2MB_WLAN_WPS_CONNECT_ACTION_E connect_action, UINT8 *pin, UINT8 *ssid)
This API is part of WPS procedure.
INT32 m2mb_wlan_get_param(UINT8 device_id, M2MB_WLAN_PARAM_FLAG_E flag, void *data)
Getting the value[M2M_WLAN_PARAM_FLAG_E] from WLAN.
M2MB_WLAN_MODE_UP_E
UINT8 addr1[M2MB_WLAN_MAC_LEN]
M2MB_WLAN_PHY_MODE_E
802.11 PHY modes.
UINT8 mac_addr[M2MB_WLAN_MAC_LEN]
struct M2MB_WLAN_PROFILE_PNO_S M2MB_WLAN_PROFILE_PNO_T
Preferred Network Offload setting in firmware.
INT8 m2mb_wlan_status_get(INT8 device_id)
L2 association status for both STA and AP modes.
Structure to get the count for scan results.
UINT8 ssid[M2MB_WLAN_MAX_SSID_LEN]
M2MB_WLAN_WPS_MODE_E
WPS methods.
UINT8 addr3[M2MB_WLAN_MAC_LEN]
M2MB_WLAN_11N_HT_E
11n HT configurations.