1 /* 2 * WPA Supplicant - driver interaction with TI station 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 7 * 8 * Alternatively, this software may be distributed under the terms of BSD 9 * license. 10 * 11 */ 12 13 /* Copyright Texas Instruments Incorporated (Oct 2005) 14 * THIS CODE/PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 15 * EITHER EXPRESS OR IMPLIED, INCLUDED BUT NOT LIMITED TO , THE IMPLIED 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 17 * This program has been modified from its original operation by Texas 18 * Instruments Incorporated. These changes are covered under version 2 19 * of the GNU General Public License, dated June 1991. 20 * 21 * Copyright Google Inc (Feb 2008) 22 */ 23 /*-------------------------------------------------------------------*/ 24 #ifndef _DRIVER_TI_H_ 25 #define _DRIVER_TI_H_ 26 27 #include "wpa.h" 28 #include "config.h" 29 #include "osDot11.h" 30 #include "802_11Defs.h" 31 #include "TI_AdapterApiC.h" 32 #include "tiioctl.h" 33 #include "shlist.h" 34 /*-------------------------------------------------------------------*/ 35 #define TIWLAN_DRV_NAME "tiwlan0" 36 #define TKIP_KEY_LENGTH 32 37 #define AES_KEY_LENGTH 16 38 #define WEP_KEY_LENGTH_40 5 39 #define WEP_KEY_LENGTH_104 13 40 41 #define TIMAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] 42 #define TIMACSTR "%02x:%02x:%02x:%02x:%02x:%02x" 43 44 typedef enum _TIWLAN_KEY_FLAGS 45 { 46 TIWLAN_KEY_FLAGS_TRANSMIT = 0x80000000, /* Used whenever key should be immidiately used for TX */ 47 TIWLAN_KEY_FLAGS_PAIRWISE = 0x40000000, /* Used to indicate pairwise key */ 48 TIWLAN_KEY_FLAGS_SET_KEY_RSC = 0x20000000, /* Used to set RSC (receive sequence counter) to driver */ 49 TIWLAN_KEY_FLAGS_AUTHENTICATOR = 0x10000000 /* Not used currently */ 50 } TIWLAN_KEY_FLAGS; 51 52 #define NO_BLOCK 0 53 #define NO_BLOCK_DISASSOC_IN_PROGRESS 1 54 #define BLOCK_DISASSOC 2 55 #define NO_BLOCK_WPS 3 56 57 #ifndef WPA_OUI 58 /* { 0x00, 0x50, 0xf2, 0x01 } */ 59 #define WPA_OUI "\x00\x50\xf2\x01" 60 #endif 61 62 #define NUMBER_SCAN_CHANNELS_FCC 11 63 #define NUMBER_SCAN_CHANNELS_ETSI 13 64 #define NUMBER_SCAN_CHANNELS_MKK1 14 65 66 #ifndef ETHERNET_HDR_LEN 67 #define ETHERNET_HDR_LEN 14 68 #endif 69 70 #define WPA_OPTIONS_DISABLE 0 71 #define WPA_OPTIONS_ENABLE 3 72 73 #ifndef MIN 74 #define MIN(x,y) (((x) < (y)) ? (x) : (y)) 75 #endif 76 77 /* TI station control structure */ 78 struct wpa_driver_ti_data { 79 UINT8 own_addr[ETH_ALEN]; /* MAC address of WLAN interface */ 80 void *hWpaSupplicant; /* Handle to wpa_supplicant */ 81 TI_HANDLE hDriver; /* Handle to self */ 82 TI_HANDLE hEvents[IPC_EVENT_MAX]; /* Event handles - needed to register to driver events */ 83 int key_mgmt; /* Key Management: 802_1X/PSK/NONE/802_1X_NO_WPA/WPA_NONE */ 84 int proto; /* Protocol (WPA/WPA2/RSN) */ 85 int encryption; /* Encryption type */ 86 int auth_alg; /* Authentication Alg: Open, Shared or LEAP */ 87 int driver_is_loaded; /* TRUE/FALSE flag if driver is already loaded and can be accessed */ 88 int scan_type; /* SCAN_TYPE_NORMAL_ACTIVE or SCAN_TYPE_NORMAL_PASSIVE */ 89 int scan_channels; /* Number of allowed scan channels */ 90 unsigned link_speed; /* Link Speed */ 91 unsigned btcoex_mode; /* BtCoex Mode */ 92 int btcoex_scan; /* BtCoex Scan */ 93 unsigned rts_threshold; /* RTS Threshold */ 94 int last_scan; /* Last scan type */ 95 int force_merge_flag; /* Force scan results merge */ 96 SHLIST scan_merge_list; /* Previous scan list */ 97 int driverEventsSocket; 98 int block_disassoc_events; 99 int block_disassoc_prev; 100 }; 101 102 /* external symbols from common.c - will be used to dynamically change debug level by IOCTLs */ 103 extern int wpa_debug_level; 104 extern int wpa_debug_show_keys; 105 extern int wpa_debug_timestamp; 106 #endif /* _DRIVER_TI_H_ */ 107