summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2010-02-01 10:46:13 -0800
committerDmitry Shmidt <dimitrysh@google.com>2010-02-01 10:46:13 -0800
commit358ae72d314bf9df7050908541f30b78a2871c8a (patch)
tree63e15397a1fd07c7a25b9b53a2b34062d59b53c2
parentddac9c138c5b4b16b99fb8bc5f0f10418efa1029 (diff)
downloadwlan-358ae72d314bf9df7050908541f30b78a2871c8a.tar.gz
wl1271: Fix Android utility compilation
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--lib/scanmerge.c343
-rw-r--r--lib/scanmerge.h58
-rw-r--r--lib/shlist.c185
-rw-r--r--lib/shlist.h34
-rw-r--r--wl1271/CUDK/configurationutility/Android.mk35
-rw-r--r--wl1271/CUDK/configurationutility/src/wpa_core.c4
-rw-r--r--wl1271/CUDK/os/common/inc/cu_osapi.h6
-rw-r--r--wl1271/CUDK/os/linux/src/Android.mk65
-rw-r--r--wl1271/CUDK/tiwlan_loader/Android.mk9
-rw-r--r--wl1271/wpa_supplicant_lib/Android.mk7
10 files changed, 701 insertions, 45 deletions
diff --git a/lib/scanmerge.c b/lib/scanmerge.c
new file mode 100644
index 0000000..36f17a2
--- /dev/null
+++ b/lib/scanmerge.c
@@ -0,0 +1,343 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*-------------------------------------------------------------------*/
+#include "includes.h"
+#include "scanmerge.h"
+#include "shlist.h"
+
+#define IS_HIDDEN_AP(a) (((a)->ssid_len == 0) || ((a)->ssid[0] == '\0'))
+
+scan_ssid_t *scan_get_ssid( scan_result_t *res_ptr )
+{
+ static scan_ssid_t ssid_temp;
+#ifdef WPA_SUPPLICANT_VER_0_6_X
+ const u8 *res_ie;
+
+ res_ie = wpa_scan_get_ie(res_ptr, WLAN_EID_SSID);
+ if (!res_ie)
+ return NULL;
+ ssid_temp.ssid_len = (size_t)res_ie[1];
+ os_memcpy(ssid_temp.ssid, (res_ie + 2), ssid_temp.ssid_len);
+#else
+ ssid_temp.ssid_len = res_ptr->ssid_len;
+ os_memcpy(ssid_temp.ssid, res_ptr->ssid, ssid_temp.ssid_len);
+#endif
+ return &ssid_temp;
+}
+
+/*-----------------------------------------------------------------------------
+Routine Name: scan_init
+Routine Description: Inits scan merge list
+Arguments:
+ mydrv - pointer to private driver data structure
+Return Value:
+-----------------------------------------------------------------------------*/
+void scan_init( struct wpa_driver_ti_data *mydrv )
+{
+ mydrv->last_scan = -1;
+ shListInitList(&(mydrv->scan_merge_list));
+}
+
+/*-----------------------------------------------------------------------------
+Routine Name: scan_free
+Routine Description: Frees scan structure private data
+Arguments:
+ ptr - pointer to private data structure
+Return Value:
+-----------------------------------------------------------------------------*/
+static void scan_free( void *ptr )
+{
+ os_free(ptr);
+}
+
+/*-----------------------------------------------------------------------------
+Routine Name: scan_exit
+Routine Description: Cleans scan merge list
+Arguments:
+ mydrv - pointer to private driver data structure
+Return Value:
+-----------------------------------------------------------------------------*/
+void scan_exit( struct wpa_driver_ti_data *mydrv )
+{
+ shListDelAllItems(&(mydrv->scan_merge_list), scan_free);
+}
+
+/*-----------------------------------------------------------------------------
+Routine Name: scan_count
+Routine Description: Gives number of list elements
+Arguments:
+ mydrv - pointer to private driver data structure
+Return Value: Number of elements in the list
+-----------------------------------------------------------------------------*/
+unsigned long scan_count( struct wpa_driver_ti_data *mydrv )
+{
+ return shListGetCount(&(mydrv->scan_merge_list));
+}
+
+/*-----------------------------------------------------------------------------
+Routine Name: scan_equal
+Routine Description: Compares bssid of scan result and scan merge structure
+Arguments:
+ val - pointer to scan result structure
+ idata - pointer to scan merge structure
+Return Value: 1 - if equal, 0 - if not
+-----------------------------------------------------------------------------*/
+static int scan_equal( void *val, void *idata )
+{
+ scan_ssid_t n_ssid, l_ssid, *p_ssid;
+ scan_result_t *new_res = (scan_result_t *)val;
+ scan_result_t *lst_res =
+ (scan_result_t *)(&(((scan_merge_t *)idata)->scanres));
+ int ret;
+ size_t len;
+
+ p_ssid = scan_get_ssid(new_res);
+ if (!p_ssid)
+ return 0;
+ os_memcpy(&n_ssid, p_ssid, sizeof(scan_ssid_t));
+ p_ssid = scan_get_ssid(lst_res);
+ if (!p_ssid)
+ return 0;
+ os_memcpy(&l_ssid, p_ssid, sizeof(scan_ssid_t));
+
+ len = (IS_HIDDEN_AP(&n_ssid) || IS_HIDDEN_AP(&l_ssid)) ?
+ 0 : n_ssid.ssid_len;
+ ret = ((l_ssid.ssid_len != n_ssid.ssid_len) && (len != 0)) ||
+ (os_memcmp(new_res->bssid, lst_res->bssid, ETH_ALEN) ||
+ os_memcmp(n_ssid.ssid, l_ssid.ssid, len));
+ return !ret;
+}
+
+/*-----------------------------------------------------------------------------
+Routine Name: copy_scan_res
+Routine Description: copies scan result structure to scan merge list item
+Arguments:
+ dst - pointer to scan result structure in the list
+ src - source pointer to scan result structure
+Return Value: NONE
+-----------------------------------------------------------------------------*/
+void copy_scan_res( scan_result_t *dst, scan_result_t *src )
+{
+#ifdef WPA_SUPPLICANT_VER_0_5_X
+ if( IS_HIDDEN_AP(src) ) {
+ os_memcpy(src->ssid, dst->ssid, dst->ssid_len);
+ src->ssid_len = dst->ssid_len;
+ }
+#endif
+ os_memcpy(dst, src, sizeof(scan_result_t));
+}
+
+/*-----------------------------------------------------------------------------
+Routine Name: scan_add
+Routine Description: adds scan result structure to scan merge list
+Arguments:
+ head - pointer to scan merge list head
+ res_ptr - pointer to scan result structure
+Return Value: Pointer to scan merge item
+-----------------------------------------------------------------------------*/
+static scan_merge_t *scan_add( SHLIST *head, scan_result_t *res_ptr )
+{
+ scan_merge_t *scan_ptr;
+ unsigned size = 0;
+
+#ifdef WPA_SUPPLICANT_VER_0_6_X
+ size += res_ptr->ie_len;
+#endif
+ scan_ptr = (scan_merge_t *)os_malloc(sizeof(scan_merge_t) + size);
+ if( !scan_ptr )
+ return( NULL );
+ os_memcpy(&(scan_ptr->scanres), res_ptr, sizeof(scan_result_t) + size);
+ scan_ptr->count = SCAN_MERGE_COUNT;
+ shListInsLastItem(head, (void *)scan_ptr);
+ return scan_ptr;
+}
+
+/*-----------------------------------------------------------------------------
+Routine Name: scan_find
+Routine Description: Looks for scan merge item in scan results array
+Arguments:
+ scan_ptr - pointer to scan merge item
+ results - pointer to scan results array
+ number_items - current number of items
+Return Value: 1 - if item was found, 0 - otherwise
+-----------------------------------------------------------------------------*/
+static int scan_find( scan_merge_t *scan_ptr, scan_result_t *results,
+ unsigned int number_items )
+{
+ unsigned int i;
+
+ for(i=0;( i < number_items );i++) {
+ if( scan_equal(&(results[i]), scan_ptr) )
+ return 1;
+ }
+ return 0;
+}
+
+#ifdef WPA_SUPPLICANT_VER_0_6_X
+/*-----------------------------------------------------------------------------
+Routine Name: scan_dup
+Routine Description: Create copy of scan results entry
+Arguments:
+ res_ptr - pointer to scan result item
+Return Value: pointer to new scan result item, or NULL
+-----------------------------------------------------------------------------*/
+static scan_result_t *scan_dup( scan_result_t *res_ptr )
+{
+ unsigned size;
+ scan_result_t *new_ptr;
+
+ if (!res_ptr)
+ return NULL;
+
+ size = sizeof(scan_result_t) + res_ptr->ie_len;
+ new_ptr = os_malloc(size);
+ if (!new_ptr)
+ return NULL;
+ if (res_ptr) {
+ os_memcpy(new_ptr, res_ptr, size);
+ }
+ return new_ptr;
+}
+#endif
+
+/*-----------------------------------------------------------------------------
+Routine Name: scan_merge
+Routine Description: Merges current scan results with previous
+Arguments:
+ mydrv - pointer to private driver data structure
+ results - pointer to scan results array
+ number_items - current number of items
+ max_size - maximum namber of items
+Return Value: Merged number of items
+-----------------------------------------------------------------------------*/
+#ifdef WPA_SUPPLICANT_VER_0_6_X
+unsigned int scan_merge( struct wpa_driver_ti_data *mydrv,
+ scan_result_t **results, int force_flag,
+ unsigned int number_items, unsigned int max_size )
+#else
+unsigned int scan_merge( struct wpa_driver_ti_data *mydrv,
+ scan_result_t *results, int force_flag,
+ unsigned int number_items, unsigned int max_size )
+#endif
+{
+ SHLIST *head = &(mydrv->scan_merge_list);
+ SHLIST *item, *del_item;
+ scan_result_t *res_ptr;
+ scan_merge_t *scan_ptr;
+ unsigned int i;
+
+ /* Prepare items for removal */
+ item = shListGetFirstItem(head);
+ while( item != NULL ) {
+ scan_ptr = (scan_merge_t *)(item->data);
+ if( scan_ptr->count != 0 )
+ scan_ptr->count--;
+ item = shListGetNextItem(head, item);
+ }
+
+ for(i=0;( i < number_items );i++) { /* Find/Add new items */
+#ifdef WPA_SUPPLICANT_VER_0_6_X
+ res_ptr = results[i];
+#else
+ res_ptr = &(results[i]);
+#endif
+ item = shListFindItem( head, res_ptr, scan_equal );
+ if( item ) {
+#ifdef WPA_SUPPLICANT_VER_0_6_X
+ scan_ssid_t *p_ssid;
+ scan_result_t *new_ptr;
+#endif
+ scan_ptr = (scan_merge_t *)(item->data);
+ copy_scan_res(&(scan_ptr->scanres), res_ptr);
+ scan_ptr->count = SCAN_MERGE_COUNT;
+#ifdef WPA_SUPPLICANT_VER_0_6_X
+ p_ssid = scan_get_ssid(res_ptr);
+ if (p_ssid && IS_HIDDEN_AP(p_ssid)) {
+ new_ptr = scan_dup(res_ptr);
+ if (new_ptr) {
+ results[i] = new_ptr;
+ os_free(res_ptr);
+ }
+ }
+#endif
+ }
+ else {
+ scan_add(head, res_ptr);
+ }
+ }
+
+ item = shListGetFirstItem( head ); /* Add/Remove missing items */
+ while( item != NULL ) {
+ del_item = NULL;
+ scan_ptr = (scan_merge_t *)(item->data);
+ if( scan_ptr->count != SCAN_MERGE_COUNT ) {
+ if( !force_flag && ((scan_ptr->count == 0) ||
+ (mydrv->last_scan == SCAN_TYPE_NORMAL_ACTIVE)) ) {
+ del_item = item;
+ }
+ else {
+ if( number_items < max_size ) {
+#ifdef WPA_SUPPLICANT_VER_0_6_X
+ res_ptr = scan_dup(&(scan_ptr->scanres));
+ if (res_ptr) {
+ results[number_items] = res_ptr;
+ number_items++;
+ }
+#else
+ os_memcpy(&(results[number_items]),
+ &(scan_ptr->scanres), sizeof(scan_result_t));
+ number_items++;
+#endif
+ }
+ }
+ }
+ item = shListGetNextItem(head, item);
+ shListDelItem(head, del_item, scan_free);
+ }
+
+ return( number_items );
+}
+
+/*-----------------------------------------------------------------------------
+Routine Name: scan_get_by_bssid
+Routine Description: Gets scan_result pointer to item by bssid
+Arguments:
+ mydrv - pointer to private driver data structure
+ bssid - pointer to bssid value
+Return Value: pointer to scan_result item
+-----------------------------------------------------------------------------*/
+scan_result_t *scan_get_by_bssid( struct wpa_driver_ti_data *mydrv, u8 *bssid )
+{
+ SHLIST *head = &(mydrv->scan_merge_list);
+ SHLIST *item;
+ scan_result_t *cur_res;
+ scan_ssid_t *p_ssid;
+
+ item = shListGetFirstItem(head);
+ if( item == NULL )
+ return( NULL );
+ do {
+ cur_res = (scan_result_t *)&(((scan_merge_t *)(item->data))->scanres);
+ p_ssid = scan_get_ssid(cur_res);
+ if( (!os_memcmp(cur_res->bssid, bssid, ETH_ALEN)) &&
+ (!IS_HIDDEN_AP(p_ssid)) ) {
+ return( cur_res );
+ }
+ item = shListGetNextItem(head, item);
+ } while( item != NULL );
+
+ return( NULL );
+}
diff --git a/lib/scanmerge.h b/lib/scanmerge.h
new file mode 100644
index 0000000..35843bc
--- /dev/null
+++ b/lib/scanmerge.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*-------------------------------------------------------------------*/
+#ifndef _SCANMERGE_H_
+#define _SCANMERGE_H_
+
+#include "common.h"
+#include "driver.h"
+#include "driver_ti.h"
+
+#define SCAN_MERGE_COUNT 4
+
+typedef
+#ifdef WPA_SUPPLICANT_VER_0_6_X
+ struct wpa_scan_res
+#else
+ struct wpa_scan_result
+#endif
+scan_result_t;
+
+typedef struct {
+ u8 ssid[MAX_SSID_LEN];
+ size_t ssid_len;
+} scan_ssid_t;
+
+typedef struct SCANMERGE_STRUCT {
+ unsigned long count;
+ scan_result_t scanres;
+} scan_merge_t;
+
+void scan_init( struct wpa_driver_ti_data *mydrv );
+void scan_exit( struct wpa_driver_ti_data *mydrv );
+unsigned long scan_count( struct wpa_driver_ti_data *mydrv );
+scan_ssid_t *scan_get_ssid( scan_result_t *res_ptr );
+#ifdef WPA_SUPPLICANT_VER_0_6_X
+unsigned int scan_merge( struct wpa_driver_ti_data *mydrv,
+ scan_result_t **results, int force_flag,
+ unsigned int number_items, unsigned int max_size );
+#else
+unsigned int scan_merge( struct wpa_driver_ti_data *mydrv,
+ scan_result_t *results, int force_flag,
+ unsigned int number_items, unsigned int max_size );
+#endif
+scan_result_t *scan_get_by_bssid( struct wpa_driver_ti_data *mydrv, u8 *bssid );
+#endif
diff --git a/lib/shlist.c b/lib/shlist.c
new file mode 100644
index 0000000..44919ef
--- /dev/null
+++ b/lib/shlist.c
@@ -0,0 +1,185 @@
+/*-------------------------------------------------------------------*/
+/* List Functionality */
+/*-------------------------------------------------------------------*/
+/* #define SH_LIST_DEBUG */
+/*-------------------------------------------------------------------*/
+#include <stdio.h>
+#include <stdlib.h>
+#include "shlist.h"
+/*-------------------------------------------------------------------*/
+void shListInitList( SHLIST *listPtr )
+{
+ listPtr->data = (void *)0L;
+ listPtr->next = listPtr;
+ listPtr->prev = listPtr;
+}
+
+SHLIST *shListFindItem( SHLIST *head, void *val, shListEqual func )
+{
+ SHLIST *item;
+
+ for(item=head->next;( item != head );item=item->next)
+ if( func ) {
+ if( func( val, item->data ) ) {
+ return( item );
+ }
+ }
+ else {
+ if( item->data == val ) {
+ return( item );
+ }
+ }
+ return( NULL );
+}
+
+SHLIST *shListGetLastItem( SHLIST *head )
+{
+ if( head->prev != head )
+ return( head->prev );
+ return( NULL );
+}
+
+SHLIST *shListGetFirstItem( SHLIST *head )
+{
+ if( head->next != head )
+ return( head->next );
+ return( NULL );
+}
+
+SHLIST *shListGetNItem( SHLIST *head, unsigned long num )
+{
+ SHLIST *item;
+ unsigned long i;
+
+ for(i=0,item=head->next;( (i < num) && (item != head) );i++,item=item->next);
+ if( item != head )
+ return( item );
+ return( NULL );
+}
+
+SHLIST *shListGetNextItem( SHLIST *head, SHLIST *item )
+{
+ if( item == NULL )
+ return( NULL );
+ if( item->next != head )
+ return( item->next );
+ return( NULL );
+}
+
+SHLIST *shListGetPrevItem( SHLIST *head, SHLIST *item )
+{
+ if( item == NULL )
+ return( NULL );
+ if( item->prev != head )
+ return( item->prev );
+ return( NULL );
+}
+
+void shListDelItem( SHLIST *head, SHLIST *item, shListFree func )
+{
+ if( item == NULL )
+ return;
+#ifdef SH_LIST_DEBUG
+ fprintf(stderr, "Del %lx\n", (unsigned long)(item->data));
+#endif
+ (item->prev)->next = item->next;
+ (item->next)->prev = item->prev;
+ if( func && item->data ) {
+ func( (void *)(item->data) );
+ }
+ free( item );
+ head->data = (void *)((unsigned long)(head->data) - 1);
+}
+
+void shListInsFirstItem( SHLIST *head, void *val )
+{ /* Insert to the beginning of the list */
+ SHLIST *item;
+
+ item = (SHLIST *)malloc( sizeof(SHLIST) );
+ if( item == NULL )
+ return;
+ item->data = val;
+ item->next = head->next;
+ item->prev = head;
+ (head->next)->prev = item;
+ head->next = item;
+#ifdef SH_LIST_DEBUG
+ fprintf(stderr, "Ins First %lx\n", (unsigned long)(item->data));
+#endif
+ head->data = (void *)((unsigned long)(head->data) + 1);
+}
+
+void shListInsLastItem( SHLIST *head, void *val )
+{ /* Insert to the end of the list */
+ SHLIST *item;
+
+ item = (SHLIST *)malloc( sizeof(SHLIST) );
+ if( item == NULL )
+ return;
+ item->data = val;
+ item->next = head;
+ item->prev = head->prev;
+ (head->prev)->next = item;
+ head->prev = item;
+#ifdef SH_LIST_DEBUG
+ fprintf(stderr, "Ins Last %lx\n", (unsigned long)(item->data));
+#endif
+ head->data = (void *)((unsigned long)(head->data) + 1);
+}
+
+void shListInsBeforeItem( SHLIST *head, void *val, void *etal,
+ shListCmp func )
+{
+ SHLIST *item, *iptr;
+
+ if( func == NULL )
+ shListInsFirstItem( head, val );
+ else {
+ item = (SHLIST *)malloc( sizeof(SHLIST) );
+ if( item == NULL )
+ return;
+ item->data = val;
+ for(iptr=head->next;( iptr != head );iptr=iptr->next)
+ if( func( val, iptr->data, etal ) )
+ break;
+ item->next = iptr;
+ item->prev = iptr->prev;
+ (iptr->prev)->next = item;
+ iptr->prev = item;
+#ifdef SH_LIST_DEBUG
+ fprintf(stderr, "Ins Before %lx\n", (unsigned long)(item->data));
+#endif
+ head->data = (void *)((unsigned long)(head->data) + 1);
+ }
+}
+
+void shListDelAllItems( SHLIST *head, shListFree func )
+{
+ SHLIST *item;
+
+ for(item=head->next;( item != head );) {
+ shListDelItem( head, item, func );
+ item = head->next;
+ }
+ head->data = (void *)0L;
+}
+
+void shListPrintAllItems( SHLIST *head, shListPrint func )
+{
+#ifdef SH_LIST_DEBUG
+ SHLIST *item;
+
+ for(item=head->next;( item != head );item=item->next)
+ if( func ) {
+ func(item->data);
+ }
+ else {
+ fprintf(stderr, "Item: %lx\n",(unsigned long)(item->data));
+ }
+#endif
+}
+
+unsigned long shListGetCount( SHLIST *head )
+{
+ return( (unsigned long)(head->data) );
+}
diff --git a/lib/shlist.h b/lib/shlist.h
new file mode 100644
index 0000000..0a9b07b
--- /dev/null
+++ b/lib/shlist.h
@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------*/
+/* List Functionality */
+/*-------------------------------------------------------------------*/
+#ifndef _SHLIST_H_
+#define _SHLIST_H_
+
+typedef struct SHLIST_STRUC {
+ void *data;
+ struct SHLIST_STRUC *next;
+ struct SHLIST_STRUC *prev;
+} SHLIST;
+
+typedef int (*shListCmp)( void *valo, void *valn, void *etalon );
+typedef int (*shListPrint)( void *val );
+typedef void (*shListFree)( void *val );
+typedef int (*shListEqual)( void *val, void *idata );
+
+void shListInitList( SHLIST *listPtr );
+SHLIST *shListFindItem( SHLIST *head, void *val, shListEqual func );
+SHLIST *shListGetFirstItem( SHLIST *head );
+SHLIST *shListGetNItem( SHLIST *head, unsigned long num );
+SHLIST *shListGetLastItem( SHLIST *head );
+SHLIST *shListGetNextItem( SHLIST *head, SHLIST *item );
+SHLIST *shListGetPrevItem( SHLIST *head, SHLIST *item );
+void shListDelItem( SHLIST *head, SHLIST *item, shListFree func );
+void shListInsFirstItem( SHLIST *head, void *val );
+void shListInsBeforeItem( SHLIST *head, void *val, void *etalon,
+ shListCmp func );
+void shListInsLastItem( SHLIST *head, void *val );
+void shListDelAllItems( SHLIST *head, shListFree func );
+void shListPrintAllItems( SHLIST *head, shListPrint func );
+unsigned long shListGetCount( SHLIST *head );
+
+#endif
diff --git a/wl1271/CUDK/configurationutility/Android.mk b/wl1271/CUDK/configurationutility/Android.mk
index 5d9c541..93450b6 100644
--- a/wl1271/CUDK/configurationutility/Android.mk
+++ b/wl1271/CUDK/configurationutility/Android.mk
@@ -11,17 +11,36 @@ WILINK_ROOT = ../..
CUDK_ROOT ?= $(WILINK_ROOT)/CUDK
CU_ROOT = $(CUDK_ROOT)/configurationutility
+ifndef WPA_SUPPLICANT_VERSION
+WPA_SUPPLICANT_VERSION := VER_0_5_X
+endif
+
+ifeq ($(WPA_SUPPLICANT_VERSION),VER_0_5_X)
+WPA_SUPPL_DIR = external/wpa_supplicant
+else
+WPA_SUPPL_DIR = external/wpa_supplicant_6/wpa_supplicant
+endif
+WPA_SUPPL_DIR_INCLUDE = $(WPA_SUPPL_DIR)
+ifeq ($(WPA_SUPPLICANT_VERSION),VER_0_6_X)
+WPA_SUPPL_DIR_INCLUDE += $(WPA_SUPPL_DIR)/src \
+ $(WPA_SUPPL_DIR)/src/common \
+ $(WPA_SUPPL_DIR)/src/drivers \
+ $(WPA_SUPPL_DIR)/src/l2_packet \
+ $(WPA_SUPPL_DIR)/src/utils \
+ $(WPA_SUPPL_DIR)/src/wps
+endif
+
ifeq ($(DEBUG),y)
- DEBUGFLAGS = -O2 -g -DDEBUG -DTI_DBG -fno-builtin
+DEBUGFLAGS = -O2 -g -DDEBUG -DTI_DBG -fno-builtin
else
- DEBUGFLAGS = -O2
+DEBUGFLAGS = -O2
endif
ifeq ($(DEBUG),y)
- DEBUGFLAGS = -O2 -g -DDEBUG -DTI_DBG -fno-builtin # "-O" is needed to expand inlines
+DEBUGFLAGS = -O2 -g -DDEBUG -DTI_DBG -fno-builtin # "-O" is needed to expand inlines
# DEBUGFLAGS+= -DDEBUG_MESSAGES
else
- DEBUGFLAGS = -O2
+DEBUGFLAGS = -O2
endif
DEBUGFLAGS += -DHOST_COMPILE
@@ -36,13 +55,13 @@ endif
#Supplicant image building
ifeq ($(BUILD_SUPPL), y)
DK_DEFINES += -D WPA_SUPPLICANT -D CONFIG_CTRL_IFACE -D CONFIG_CTRL_IFACE_UNIX
- -include external/wpa_supplicant/.config
+-include external/wpa_supplicant/.config
ifeq ($(CONFIG_WPS), y)
-DK_DEFINES += -DCONFIG_WPS
+ DK_DEFINES += -DCONFIG_WPS
endif
endif
-ARMFLAGS = -fno-common -g #-fno-builtin -Wall #-pipe
+ARMFLAGS = -fno-common -g #-fno-builtin -Wall #-pipe
LOCAL_C_INCLUDES = \
$(LOCAL_PATH)/inc \
@@ -60,7 +79,7 @@ LOCAL_C_INCLUDES = \
$(LOCAL_PATH)/$(WILINK_ROOT)/platforms/os/common/inc \
$(LOCAL_PATH)/$(KERNEL_DIR)/include \
$(LOCAL_PATH)/$(WILINK_ROOT)/TWD/FW_Transfer/Export_Inc \
- external/wpa_supplicant
+ $(WPA_SUPPL_DIR_INCLUDE)
LOCAL_SRC_FILES = \
src/console.c \
diff --git a/wl1271/CUDK/configurationutility/src/wpa_core.c b/wl1271/CUDK/configurationutility/src/wpa_core.c
index 9506c75..f4b0a86 100644
--- a/wl1271/CUDK/configurationutility/src/wpa_core.c
+++ b/wl1271/CUDK/configurationutility/src/wpa_core.c
@@ -35,10 +35,10 @@
#include <unistd.h>
#endif
-#include <string.h>
+#include <netinet/if_ether.h>
+
#include "cu_osapi.h"
#include "TWDriver.h"
-#include "common.h"
#include "config_ssid.h"
#include "driver.h"
#include "ipc_wpa.h"
diff --git a/wl1271/CUDK/os/common/inc/cu_osapi.h b/wl1271/CUDK/os/common/inc/cu_osapi.h
index 665af07..f22e8f2 100644
--- a/wl1271/CUDK/os/common/inc/cu_osapi.h
+++ b/wl1271/CUDK/os/common/inc/cu_osapi.h
@@ -48,11 +48,15 @@
* be specifically declared here, and only if they weren't defined before by someone
* including common.h
*/
-#ifndef ANDROID
+#ifndef COMMON_H
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
typedef unsigned long long u64;
+
+#ifndef BIT
+#define BIT(x) (1 << (x))
+#endif
#endif
#ifndef NULL
diff --git a/wl1271/CUDK/os/linux/src/Android.mk b/wl1271/CUDK/os/linux/src/Android.mk
index 3ae1e40..ec1e47e 100644
--- a/wl1271/CUDK/os/linux/src/Android.mk
+++ b/wl1271/CUDK/os/linux/src/Android.mk
@@ -14,19 +14,36 @@ endif
WILINK_ROOT = ../../../..
CUDK_ROOT = $(WILINK_ROOT)/CUDK
-TI_SUPP_LIB_DIR = $(WILINK_ROOT)/../../../../external/wpa_supplicant
+ifndef WPA_SUPPLICANT_VERSION
+WPA_SUPPLICANT_VERSION := VER_0_5_X
+endif
+
+ifeq ($(WPA_SUPPLICANT_VERSION),VER_0_5_X)
+WPA_SUPPL_DIR = external/wpa_supplicant
+else
+WPA_SUPPL_DIR = external/wpa_supplicant_6/wpa_supplicant
+endif
+WPA_SUPPL_DIR_INCLUDE = $(WPA_SUPPL_DIR)
+ifeq ($(WPA_SUPPLICANT_VERSION),VER_0_6_X)
+WPA_SUPPL_DIR_INCLUDE += $(WPA_SUPPL_DIR)/src \
+ $(WPA_SUPPL_DIR)/src/common \
+ $(WPA_SUPPL_DIR)/src/drivers \
+ $(WPA_SUPPL_DIR)/src/l2_packet \
+ $(WPA_SUPPL_DIR)/src/utils \
+ $(WPA_SUPPL_DIR)/src/wps
+endif
DK_DEFINES =
ifeq ($(WPA_ENTERPRISE), y)
- DK_DEFINES += -D WPA_ENTERPRISE
+DK_DEFINES += -D WPA_ENTERPRISE
endif
ifeq ($(BUILD_SUPPL), y)
- DK_DEFINES += -D WPA_SUPPLICANT -D CONFIG_CTRL_IFACE -D CONFIG_CTRL_IFACE_UNIX
- -include external/wpa_supplicant/.config
- ifeq ($(CONFIG_WPS), y)
- DK_DEFINES += -DCONFIG_WPS
- endif
+DK_DEFINES += -D WPA_SUPPLICANT -D CONFIG_CTRL_IFACE -D CONFIG_CTRL_IFACE_UNIX
+-include $(WPA_SUPPL_DIR)/.config
+ ifeq ($(CONFIG_WPS), y)
+ DK_DEFINES += -DCONFIG_WPS
+ endif
endif
LOCAL_CFLAGS += \
@@ -42,29 +59,31 @@ LOCAL_SRC_FILES:= \
osapi.c
ifeq ($(BUILD_SUPPL), y)
-LOCAL_SRC_FILES += \
- $(TI_SUPP_LIB_DIR)/wpa_ctrl.c
+ ifeq ($(WPA_SUPPLICANT_VERSION),VER_0_5_X)
+ LOCAL_SRC_FILES += $(WPA_SUPPL_DIR)/wpa_ctrl.c
+ else
+ LOCAL_SRC_FILES += $(WPA_SUPPL_DIR)/common/src/wpa_ctrl.c
+ endif
endif
LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/../inc \
- $(LOCAL_PATH)/../../common/inc \
- $(LOCAL_PATH)/$(WILINK_ROOT)/stad/Export_Inc \
- $(LOCAL_PATH)/$(WILINK_ROOT)/stad/src/Sta_Management \
- $(LOCAL_PATH)/$(WILINK_ROOT)/stad/src/Application \
- $(LOCAL_PATH)/$(WILINK_ROOT)/utils \
- $(LOCAL_PATH)/$(WILINK_ROOT)/Txn \
- $(LOCAL_PATH)/$(WILINK_ROOT)/TWD/TWDriver \
+ $(LOCAL_PATH)/../inc \
+ $(LOCAL_PATH)/../../common/inc \
+ $(LOCAL_PATH)/$(WILINK_ROOT)/stad/Export_Inc \
+ $(LOCAL_PATH)/$(WILINK_ROOT)/stad/src/Sta_Management \
+ $(LOCAL_PATH)/$(WILINK_ROOT)/stad/src/Application \
+ $(LOCAL_PATH)/$(WILINK_ROOT)/utils \
+ $(LOCAL_PATH)/$(WILINK_ROOT)/Txn \
+ $(LOCAL_PATH)/$(WILINK_ROOT)/TWD/TWDriver \
$(LOCAL_PATH)/$(WILINK_ROOT)/TWD/FirmwareApi \
$(LOCAL_PATH)/$(WILINK_ROOT)/TWD/FW_Transfer/Export_Inc \
$(LOCAL_PATH)/$(WILINK_ROOT)/TWD/TwIf \
- $(LOCAL_PATH)/$(WILINK_ROOT)/platforms/os/linux/inc \
- $(LOCAL_PATH)/$(WILINK_ROOT)/platforms/os/common/inc \
- $(LOCAL_PATH)/$(WILINK_ROOT)/TWD/FirmwareApi \
- external/wpa_supplicant \
- $(LOCAL_PATH)/$(CUDK_ROOT)/configurationutility/inc
+ $(LOCAL_PATH)/$(WILINK_ROOT)/platforms/os/linux/inc \
+ $(LOCAL_PATH)/$(WILINK_ROOT)/platforms/os/common/inc \
+ $(LOCAL_PATH)/$(WILINK_ROOT)/TWD/FirmwareApi \
+ $(LOCAL_PATH)/$(CUDK_ROOT)/configurationutility/inc \
+ $(WPA_SUPPL_DIR_INCLUDE)
LOCAL_MODULE := libtiOsLib
include $(BUILD_STATIC_LIBRARY)
-
diff --git a/wl1271/CUDK/tiwlan_loader/Android.mk b/wl1271/CUDK/tiwlan_loader/Android.mk
index 00b0476..b7cfc93 100644
--- a/wl1271/CUDK/tiwlan_loader/Android.mk
+++ b/wl1271/CUDK/tiwlan_loader/Android.mk
@@ -9,15 +9,15 @@ WILINK_ROOT = ../..
CUDK_ROOT = $(WILINK_ROOT)/CUDK
ifeq ($(DEBUG),y)
- DEBUGFLAGS = -O2 -g -DDEBUG -DTI_DBG -fno-builtin # "-O" is needed to expand inlines
+DEBUGFLAGS = -O2 -g -DDEBUG -DTI_DBG -fno-builtin # "-O" is needed to expand inlines
# DEBUGFLAGS+= -DDEBUG_MESSAGES
else
- DEBUGFLAGS = -O2
+DEBUGFLAGS = -O2
endif
-COMMON = $(WILINK_ROOT)/stad
+COMMON = $(WILINK_ROOT)/stad
-ARMFLAGS = -fno-common -g -fno-builtin -Wall #-pipe
+ARMFLAGS = -fno-common -g -fno-builtin -Wall #-pipe
LOCAL_C_INCLUDES = \
$(LOCAL_PATH)/$(CUDK_ROOT)/os/common/inc \
@@ -54,4 +54,3 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_MODULE:= wlan_loader
include $(BUILD_EXECUTABLE)
-
diff --git a/wl1271/wpa_supplicant_lib/Android.mk b/wl1271/wpa_supplicant_lib/Android.mk
index cd1d4c2..d0b756f 100644
--- a/wl1271/wpa_supplicant_lib/Android.mk
+++ b/wl1271/wpa_supplicant_lib/Android.mk
@@ -15,11 +15,6 @@
#
LOCAL_PATH := $(call my-dir)
-# This makefile is only included if BOARD_WLAN_TI_STA_DK_ROOT is set,
-# and if we're not building for the simulator.
-ifndef BOARD_WLAN_TI_STA_DK_ROOT
- $(error BOARD_WLAN_TI_STA_DK_ROOT must be defined when including this makefile)
-endif
ifeq ($(TARGET_SIMULATOR),true)
$(error This makefile must not be included when building the simulator)
endif
@@ -43,7 +38,7 @@ WPA_SUPPL_DIR_INCLUDE += $(WPA_SUPPL_DIR)/src \
$(WPA_SUPPL_DIR)/src/wps
endif
-DK_ROOT = $(BOARD_WLAN_TI_STA_DK_ROOT)
+DK_ROOT = hardware/ti/wlan/$(BOARD_WLAN_DEVICE)
OS_ROOT = $(DK_ROOT)/platforms
STAD = $(DK_ROOT)/stad
UTILS = $(DK_ROOT)/utils