+++ /dev/null
-#
-# 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.
-#
-
-ifneq ($(TARGET_SIMULATOR),true)
- include $(all-subdir-makefiles)
-endif
+++ /dev/null
-include $(call all-subdir-makefiles)
+++ /dev/null
-include $(call all-subdir-makefiles)
+++ /dev/null
-CLI_STATIC_LIB ?= y
-CLI_DEBUG ?= y
-FIRMWARE_DYNAMIC_LOAD ?= y
-BUILD_SUPPL ?= n
-SG ?= n
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-TARGET = wlan_cu
-LOCAL_MODULE = $(TARGET)
-
-ifeq ($(CLI_DEBUG),y)
- CLI_DEBUGFLAGS = -O0 -g -fno-builtin -DDEBUG -D TI_DBG # "-O" is needed to expand inlines
-else
- CLI_DEBUGFLAGS = -O2
-endif
-
-CLI_STA_DK_ROOT = $(LOCAL_PATH)/../..
-CLI_DK_ROOT = $(CLI_STA_DK_ROOT)
-CLI_COMMON = $(CLI_DK_ROOT)/common
-CLI_COMSRC = $(CLI_COMMON)/src
-CLI_TESTSRC = $(CLI_DK_ROOT)/Test
-CLI_CUDK_ROOT = $(LOCAL_PATH)/..
-CLI_IPC_SRC = $(CLI_CUDK_ROOT)/IPC/Linux
-
-DK_INCS = $(CLI_COMMON)/inc \
- $(CLI_COMSRC)/inc \
- $(CLI_COMSRC)/utils \
- $(CLI_COMSRC)/hal/inc \
- $(CLI_COMSRC)/hal/hl_data \
- $(CLI_COMSRC)/hal/hl_ctrl \
- $(CLI_COMSRC)/hal/hw_data \
- $(CLI_COMSRC)/hal/hw_ctrl \
- $(CLI_COMSRC)/hal/security \
- $(CLI_COMSRC)/core/inc \
- $(CLI_COMSRC)/core/data_ctrl/Tx \
- $(CLI_COMSRC)/core/data_ctrl/Ctrl \
- $(CLI_COMSRC)/core/data_ctrl/Ctrl/4X \
- $(CLI_COMSRC)/core/sme/Inc \
- $(CLI_COMSRC)/core/sme/siteMgr \
- $(CLI_COMSRC)/core/sme/configMgr \
- $(CLI_COMSRC)/core/sme/conn \
- $(CLI_COMSRC)/core/rsn \
- $(CLI_COMSRC)/core/rsn/mainKeysSm \
- $(CLI_COMSRC)/core/rsn/mainKeysSm/keyDerive \
- $(CLI_COMSRC)/core/rsn/inc \
- $(CLI_COMSRC)/core/mlme \
- $(CLI_COMSRC)/core/NetworkCtrl/inc \
- $(CLI_COMSRC)/core/NetworkCtrl/Measurement \
- $(CLI_COMSRC)/core/NetworkCtrl/RegulatoryDomain \
- $(CLI_COMSRC)/core/NetworkCtrl/QOS \
- $(CLI_CUDK_ROOT)/CLI \
- $(CLI_CUDK_ROOT)/UtilityAdapter \
- $(CLI_COMSRC)/hal/FirmwareApi \
- $(CLI_COMSRC)/hal/TnetwServices \
- $(CLI_COMSRC)/hal/TnetwServices/TNETW1251
-
-ifeq ($(SG), y)
-DK_INCS += $(CLI_COMSRC)/core/NetworkCtrl/BThWlanCombo
-endif
-
-DK_DEFINES = \
- -D __BYTE_ORDER_LITTLE_ENDIAN \
- -D INCLUDE_DEFRAGMENTATION \
- -D CONFIGURE_BSS_TYPE_STA \
- -D TNETW1150=1 \
- -D DOT11_A_G=1 \
- -D ELP_NO_PDA_SCREEN_VIBRATE
-
-ifeq ($(SG), y)
-DK_DEFINES += -D BTH_COEXISTENCE
-endif
-
-LOCAL_SRC_FILES := ticon.c console.c cu_cmd.c ipc.c wipp_ctrl.c eth_utils.c g_tester.c dbg_module.c
-
-ifeq ($(CLI_STATIC_LIB),y)
-LOCAL_STATIC_LIBRARIES := libWifiApi
-else
-LOCAL_SHARED_LIBRARIES := libWifiApi
-endif
-
-INCLUDES = $(DK_INCS) $(CLI_STA_DK_ROOT)/pform/linux/inc \
- $(CLI_CUDK_ROOT)/Inc \
- $(CLI_STA_DK_ROOT)/pform/common/inc
-
-LOCAL_CFLAGS = -Wall -Wstrict-prototypes $(CLI_DEBUGFLAGS) -D__LINUX__ $(DK_DEFINES) -mabi=aapcs-linux
-LOCAL_CFLAGS += -DDRV_NAME='"tiwlan"' -DHOST_COMPILE
-
-ifeq ($(FIRMWARE_DYNAMIC_LOAD), y)
- LOCAL_CFLAGS += -DFIRMWARE_DYNAMIC_LOAD
-endif
-
-LOCAL_C_INCLUDES = $(INCLUDES)
-LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
-LOCAL_MODULE_TAGS := debug
-include $(BUILD_EXECUTABLE)
+++ /dev/null
-CLI_DEBUG ?= y
-CLI_STATIC_LIB ?= y
-SG ?= n
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE = libWifiApi
-
-ifeq ($(CLI_DEBUG),y)
- CLI_DEBUGFLAGS = -O0 -g -fno-builtin -DDEBUG -D TI_DBG # "-O" is needed to expand inlines
-else
- CLI_DEBUGFLAGS = -O2
-endif
-
-CLI_STA_DK_ROOT = $(LOCAL_PATH)/../..
-CLI_CUDK_ROOT = $(LOCAL_PATH)/..
-
-
-LOCAL_SRC_FILES := \
- ../OAL/Common/TI_OAL.cpp \
- ../OAL/Pform/Linux/TILibLinux.cpp \
- TI_AdapterApi.cpp \
- TI_Adapter.cpp \
- CTI_Adapter.cpp \
- ../IPC/Linux/ipc_event.c \
- ../IPC/Linux/cu_ipc.c \
- ../IPC/Linux/ipc_user.c
-
-ifeq ($(SG), y)
-LOCAL_CFLAGS += -D BTH_COEXISTENCE
-endif
-
-INCLUDEDIR = $(CLI_CUDK_ROOT)/Inc \
- $(CLI_CUDK_ROOT)/OAL/Common \
- $(CLI_CUDK_ROOT)/UtilityAdapter \
- $(CLI_STA_DK_ROOT)/common/inc \
- $(CLI_STA_DK_ROOT)/pform/linux/inc \
- $(CLI_STA_DK_ROOT)/pform/common/inc \
- $(CLI_CUDK_ROOT)/IPC/Linux \
- $(CLI_STA_DK_ROOT)/common/src/hal/FirmwareApi \
- $(CLI_CUDK_ROOT)/CLI
-
-LOCAL_CFLAGS += -Wall -D__LINUX__ $(CLI_DEBUGFLAGS) -mabi=aapcs-linux -DHOST_COMPILE
-
-LOCAL_C_INCLUDES := $(INCLUDEDIR)
-LOCAL_MODULE_TAGS := tests
-
-ifeq ($(CLI_STATIC_LIB),y)
-include $(BUILD_STATIC_LIBRARY)
-else
-include $(BUILD_SHARED_LIBRARY)
-endif
+++ /dev/null
-CLI_STATIC_LIB ?= y
-CLI_DEBUG ?= y
-FIRMWARE_DYNAMIC_LOAD ?= y
-BUILD_SUPPL ?= n
-SG ?= n
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-TARGET = wlan_loader
-LOCAL_MODULE = $(TARGET)
-
-ifeq ($(CLI_DEBUG),y)
- CLI_DEBUGFLAGS = -O0 -g -fno-builtin -DDEBUG -D TI_DBG # "-O" is needed to expand inlines
-else
- CLI_DEBUGFLAGS = -O2
-endif
-
-CLI_STA_DK_ROOT = $(LOCAL_PATH)/../..
-CLI_DK_ROOT = $(CLI_STA_DK_ROOT)
-CLI_COMMON = $(CLI_DK_ROOT)/common
-CLI_COMSRC = $(CLI_COMMON)/src
-CLI_TESTSRC = $(CLI_DK_ROOT)/Test
-CLI_CUDK_ROOT = $(LOCAL_PATH)/..
-CLI_IPC_SRC = $(CLI_CUDK_ROOT)/IPC/Linux
-
-DK_INCS = $(CLI_COMMON)/inc \
- $(CLI_COMSRC)/inc \
- $(CLI_COMSRC)/utils \
- $(CLI_COMSRC)/hal/inc \
- $(CLI_COMSRC)/hal/hl_data \
- $(CLI_COMSRC)/hal/hl_ctrl \
- $(CLI_COMSRC)/hal/hw_data \
- $(CLI_COMSRC)/hal/hw_ctrl \
- $(CLI_COMSRC)/hal/security \
- $(CLI_COMSRC)/core/inc \
- $(CLI_COMSRC)/core/data_ctrl/Tx \
- $(CLI_COMSRC)/core/data_ctrl/Ctrl \
- $(CLI_COMSRC)/core/data_ctrl/Ctrl/4X \
- $(CLI_COMSRC)/core/sme/Inc \
- $(CLI_COMSRC)/core/sme/siteMgr \
- $(CLI_COMSRC)/core/sme/configMgr \
- $(CLI_COMSRC)/core/sme/conn \
- $(CLI_COMSRC)/core/rsn \
- $(CLI_COMSRC)/core/rsn/mainKeysSm \
- $(CLI_COMSRC)/core/rsn/mainKeysSm/keyDerive \
- $(CLI_COMSRC)/core/rsn/inc \
- $(CLI_COMSRC)/core/mlme \
- $(CLI_COMSRC)/core/NetworkCtrl/inc \
- $(CLI_COMSRC)/core/NetworkCtrl/Measurement \
- $(CLI_COMSRC)/core/NetworkCtrl/RegulatoryDomain \
- $(CLI_COMSRC)/core/NetworkCtrl/QOS \
- $(CLI_CUDK_ROOT)/CLI \
- $(CLI_CUDK_ROOT)/UtilityAdapter \
- $(CLI_COMSRC)/hal/FirmwareApi \
- $(CLI_COMSRC)/hal/TnetwServices \
- $(CLI_COMSRC)/hal/TnetwServices/TNETW1251
-
-ifeq ($(SG), y)
-DK_INCS += $(CLI_COMSRC)/core/NetworkCtrl/BThWlanCombo
-endif
-
-DK_DEFINES = \
- -D __BYTE_ORDER_LITTLE_ENDIAN \
- -D INCLUDE_DEFRAGMENTATION \
- -D CONFIGURE_BSS_TYPE_STA \
- -D TNETW1150=1 \
- -D DOT11_A_G=1 \
- -D ELP_NO_PDA_SCREEN_VIBRATE
-
-ifeq ($(SG), y)
-DK_DEFINES += -D BTH_COEXISTENCE
-endif
-
-LOCAL_SRC_FILES := tiwlan_loader.c
-
-ifeq ($(CLI_STATIC_LIB),y)
-LOCAL_STATIC_LIBRARIES := libWifiApi
-else
-LOCAL_SHARED_LIBRARIES := libWifiApi
-endif
-LOCAL_SHARED_LIBRARIES += libc libhardware
-
-INCLUDES = $(DK_INCS) $(CLI_STA_DK_ROOT)/pform/linux/inc \
- $(CLI_CUDK_ROOT)/Inc \
- $(CLI_STA_DK_ROOT)/pform/common/inc
-
-LOCAL_CFLAGS = -Wall -Wstrict-prototypes $(CLI_DEBUGFLAGS) -D__LINUX__ $(DK_DEFINES) -mabi=aapcs-linux
-LOCAL_CFLAGS += -DDRV_NAME='"tiwlan"' -DHOST_COMPILE
-
-ifeq ($(FIRMWARE_DYNAMIC_LOAD), y)
- LOCAL_CFLAGS += -DFIRMWARE_DYNAMIC_LOAD
-endif
-
-LOCAL_C_INCLUDES = $(INCLUDES)
-
-include $(BUILD_EXECUTABLE)
+++ /dev/null
-/*
- * tiwlan driver loader - utility to load firmware and calibration data
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- */
-
-/* Copyright © Texas Instruments Incorporated (Oct 2005)
- * THIS CODE/PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
- * EITHER EXPRESS OR IMPLIED, INCLUDED BUT NOT LIMITED TO , THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * This program has been modified from its original operation by Texas
- * Instruments Incorporated. These changes are covered under version 2
- * of the GNU General Public License, dated June 1991.
- *
- * Copyright © Google Inc (Feb 2008)
-*/
-/*-------------------------------------------------------------------*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-
-#ifdef __LINUX__
-#ifdef EEPROM_MEMORY_SUPPORT
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#endif
-#endif
-
-#ifdef ANDROID
-#include <cutils/properties.h>
-
-#define LOG_TAG "wlan_loader"
-
-#include <cutils/log.h>
-#include <hardware/power.h>
-#define PROGRAM_NAME "wlan_loader"
-#endif
-
-#include "paramOut.h"
-#include "linux_ioctl_common.h"
-#include "osApi.h"
-#include "tiioctl.h"
-#include "TI_AdapterApiC.h"
-#include "TI_IPC_Api.h"
-#include "osTIType.h"
-#include "cli_cu_common.h"
-/*---------------------------------------------------------*/
-#ifndef offsetof
-#define offsetof(type, field) ((unsigned int) (&(((type *)(0))->field)))
-#endif
-
-#ifndef IFNAMSIZ
-#define IFNAMSIZ 16
-#endif
-
-#ifdef ANDROID
-
-#define ENABLE_LOG_ERROR
-#define ENABLE_LOG_DEBUG
-
-#ifdef ENABLE_LOG_ERROR
-#define print_error(fmt, args...) \
- { LOGE(fmt , ## args); }
-#else
-#define print_error(fmt, args...) \
- do { } while (0)
-#endif /* ENABLE_LOG_ERROR */
-
-#ifdef ENABLE_LOG_DEBUG
-#define print_debug(fmt, args...) \
- { LOGD(fmt , ## args); }
-#else
-#define print_debug(fmt, args...) \
- do { } while (0)
-#endif /* ENABLE_LOG_MOUNT */
-
-#else /* !ANDROID */
-
-#define print_error printf
-#define print_debug printf
-
-#endif /* ifdef ANDROID */
-
-
-/*---------------------------------------------------------*/
-char g_drv_name[IFNAMSIZ + 1];
-TI_HANDLE g_id_adapter = 0;
-/*---------------------------------------------------------*/
-int print_usage(void)
-{
- printf("Usage: ./wlan_loader [driver_name] [options]\n");
-#ifdef HOST_PLATFORM_WIPP
- printf(" -e <filename> - eeprom image file name. default=/var/run/nvs_map.bin\n");
-#else
- printf(" -e <filename> - eeprom image file name. default=./nvs_map.bin\n");
-#endif
- printf(" -i <filename> - init file name. default=tiwlan.ini\n");
- printf(" -f <filename> - firmware image file name. default=firmware.bin\n");
- return 1;
-}
-
-/* Return '0' if success */
-int init_driver( char *adapter_name, char *eeprom_file_name, char *init_file_name, char *firmware_file_name )
-{
-#ifdef __LINUX__
- FILE *f1 = NULL, *f2 = NULL, *f3 = NULL;
- UINT32 eeprom_image_length = 0;
- UINT32 init_file_length = 0;
- UINT32 firmware_image_length = 0;
- UINT32 req_size = 0;
- tiwlan_dev_init_t *init_info = NULL;
-#ifdef EEPROM_MEMORY_SUPPORT
- volatile unsigned long *nvsPtr = NULL;
- int fd = -1;
-#endif
-#endif
- int rc = -1, count = 0;
- tiUINT32 tmpData = 1;
-
- print_debug("adapter %s, eeprom %s, init %s, firmware %s\n",
- adapter_name, eeprom_file_name, init_file_name, firmware_file_name);
-
- if( !adapter_name || !*adapter_name )
- return rc;
-
- g_id_adapter = TI_AdapterInit( adapter_name );
-
- if( g_id_adapter == 0 ) {
- print_error("wlan_loader: failed to initialize Utility-Adapter interface...aborting...\n");
- goto init_driver_end;
- }
-
-#ifdef __LINUX__
- /* Send init request to the driver */
- if (eeprom_file_name) {
- if ((f1 = fopen(eeprom_file_name, "r")) == NULL) {
- print_error("Cannot open eeprom image file <%s>: %s\n",
- eeprom_file_name, strerror(errno));
- goto init_driver_end;
- }
- if (fseek(f1, 0, SEEK_END)) {
- print_error("Cannot seek eeprom image file <%s>: %s\n",
- eeprom_file_name, strerror(errno));
- goto init_driver_end;
- }
- eeprom_image_length = ftell(f1);
- rewind(f1);
- }
-#ifdef EEPROM_MEMORY_SUPPORT
- else {
- fd = open("/dev/mem", O_RDWR | O_SYNC);
- if( fd == -1 ) {
- print_error("Cannot access /dev/mem\n");
- goto init_driver_end;
- }
- nvsPtr = (volatile unsigned long *)mmap(0,0x1000,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x13F13000);
- eeprom_image_length = *(nvsPtr + (0xE0C >> 2));
- print_debug("---Eeprom from Memory Size = %u\n", eeprom_image_length);
- }
-#endif
-#ifdef FIRMWARE_DYNAMIC_LOAD
- if( firmware_file_name) {
- if ((f2 = fopen(firmware_file_name, "r")) == NULL ) {
- print_error("Cannot open firmware file <%s>: %s\n",
- firmware_file_name, strerror(errno));
- goto init_driver_end;
- }
- if( fseek(f2, 0, SEEK_END) ) {
- print_error( "Cannot seek firmware file <%s>: %s\n",
- firmware_file_name, strerror(errno));
- goto init_driver_end;
- }
- firmware_image_length = ftell(f2);
- rewind(f2);
- }
-#endif
- if( init_file_name) {
- if ((f3 = fopen(init_file_name, "r")) == NULL ) {
- print_error( "Cannot open init file <%s>: %s\n",
- init_file_name, strerror(errno));
- goto init_driver_end;
- }
- if( fseek(f3, 0, SEEK_END) ) {
- print_error("Cannot seek init file <%s>: %s\n",
- init_file_name, strerror(errno));
- goto init_driver_end;
- }
- init_file_length = ftell(f3);
- rewind(f3);
- }
-
- /* Now when we can calculate the request length. allocate it and read the files */
- req_size = offsetof(tiwlan_dev_init_t, data)+ eeprom_image_length + (init_file_length+1) + firmware_image_length;
- init_info = (tiwlan_dev_init_t *)malloc(req_size);
- if( !init_info ) {
- print_error("No memory to allocate init request (%d bytes)\n", req_size);
- goto init_driver_end;
- }
- init_info->eeprom_image_length = eeprom_image_length;
- init_info->firmware_image_length = firmware_image_length;
- init_info->init_file_length = init_file_length;
-#ifdef EEPROM_MEMORY_SUPPORT
- if( (nvsPtr != NULL) && eeprom_image_length ) {
- memcpy(&init_info->data[0], (void *)(nvsPtr + (0xE40 >> 2)), eeprom_image_length);
- munmap( (void *)nvsPtr, 0x1000 );
- close( fd );
- }
- else
-#endif
- if( eeprom_image_length &&
- fread(&init_info->data[0], 1, eeprom_image_length, f1) < eeprom_image_length ) {
- print_error("Error reading eeprom image %s: %s\n", eeprom_file_name, strerror(errno));
- goto init_driver_end;
- }
- if( firmware_image_length &&
- fread(&init_info->data[eeprom_image_length], 1, firmware_image_length, f2) < firmware_image_length ) {
- print_error("Error reading firmware image %s: %s\n", firmware_file_name, strerror(errno));
- goto init_driver_end;
- }
- if( init_file_length &&
- fread(&init_info->data[eeprom_image_length+firmware_image_length], 1, init_file_length, f3) < init_file_length ) {
- print_error("Error reading init_file %s: %s\n", init_file_name, strerror(errno));
- goto init_driver_end;
- }
-
- do { /* Need to wait till driver will be created in sdio_probe() */
- print_debug("Configuring adapter\n");
- rc = IPC_DeviceIoControl(adapter_name, TIWLN_SET_INIT_INFO, init_info, req_size, NULL, 0, NULL);
- print_debug("Adapter configuration rc = %d\n", rc);
- if( rc != 0 ) {
- if( count > 4 ) {
- break;
- }
- count++;
- sleep(1);
- }
- } while( rc != 0 );
-
- /* Send configMge start command as the cli is started */
- if( rc == 0 ) {
- print_debug("Starting configMge\n");
- rc = IPC_DeviceIoControl(adapter_name, TIWLN_DRIVER_STATUS_SET, &tmpData, sizeof(tiUINT32), NULL, 0, NULL);
- print_debug("ConfigMge start rc = %d\n", rc);
- }
-
-init_driver_end:
- if( f1 )
- fclose(f1);
- if( f2 )
- fclose(f2);
- if( f3 )
- fclose(f3);
- if( init_info )
- free(init_info);
-#endif
- if( rc == 0 ) {
- print_debug("Driver configured\n");
- } else {
- print_debug("Driver configuration failed (%d)\n", rc);
- }
- return rc;
-}
-
-#ifdef ANDROID
-int check_and_set_property(char *prop_name, char *prop_val)
-{
- char prop_status[PROPERTY_VALUE_MAX];
- int count;
-
- for(count=4;( count != 0 );count--) {
- property_set(prop_name, prop_val);
- if( property_get(prop_name, prop_status, NULL) &&
- (strcmp(prop_status, prop_val) == 0) )
- break;
- }
- if( count ) {
- print_debug("Set property %s = %s - Ok\n", prop_name, prop_val);
- }
- else {
- print_debug("Set property %s = %s - Fail\n", prop_name, prop_val);
- }
- return( count );
-}
-#endif
-
-#ifdef __LINUX__
-int main(int argc, char ** argv)
-{
- int i;
-#ifdef HOST_PLATFORM_WIPP
- char *eeprom_file_name = "/NVS/nvs_map.bin";
- char *init_file_name = "/voice/tiwlan.ini";
- char *firmware_file_name = "/apps/firmware.bin";
-#else
- char *eeprom_file_name = "./nvs_map.bin";
- char *init_file_name = "./tiwlan.ini";
- char *firmware_file_name = "./firmware.bin";
-#endif
-
- if( argc > 1 ) {
- i=1;
- if( argv[i][0] != '-' ) {
- strcpy( g_drv_name, argv[i++] );
- }
- for(;( i < argc );i++) {
- if( !strcmp(argv[i], "-h" ) || !strcmp(argv[i], "--help") )
- return print_usage();
- else if( !strcmp(argv[i], "-f" ) ) {
- firmware_file_name = argv[++i];
- }
- else if( !strcmp(argv[i], "-e") && ((i+1) < argc) ) {
- eeprom_file_name = argv[++i];
- }
- else if( !strcmp(argv[i], "-i") && ((i+1) < argc) ) {
- init_file_name = argv[++i];
- }
- else if( !strcmp(argv[i], "-n" ) ) {
- eeprom_file_name = NULL;
- }
- else {
- printf("ticon: unknown parameter '%s'\n", argv[i] );
-#ifdef ANDROID
- check_and_set_property("wlan.driver.status", "failed");
-#endif
- return -1;
- }
- }
- }
-#else
-int start_cli()
-{
- char *eeprom_file_name = NULL;
- char *init_file_name = NULL;
- char *firmware_file_name = NULL;
-#endif
- if( !g_drv_name[0] ) {
-#if defined(__LINUX__)
- strcpy(g_drv_name, TIWLAN_DRV_NAME "0" );
-#else
- strcpy(g_drv_name, TIWLAN_DRV_NAME );
-#endif
- }
-
-#ifdef ANDROID
- acquire_wake_lock(PARTIAL_WAKE_LOCK, PROGRAM_NAME);
-#endif
-
- if( init_driver(g_drv_name, eeprom_file_name, init_file_name, firmware_file_name) != 0 ) {
- print_error("init_driver() failed\n");
-#ifdef ANDROID
- check_and_set_property("wlan.driver.status", "failed");
- release_wake_lock(PROGRAM_NAME);
-#endif
- return -1;
- }
-
- TI_AdapterDeinit(g_id_adapter);
-#ifdef ANDROID
- print_debug("Firmware loaded and running OK\n");
- check_and_set_property("wlan.driver.status", "ok");
- release_wake_lock(PROGRAM_NAME);
-#endif
- return 0;
-}
+++ /dev/null
-##
-## Flags
-##
-export FIRMWARE_DYNAMIC_LOAD ?= y
-
-##
-##
-## File lists and locations
-##
-##
-
-#
-# DK_ROOT must be set prior to including common.inc
-#
-DK_ROOT := .
-ifeq ($(M),)
- M = drivers/net/wireless/tiwlan1251
-endif
-DK_ROOT_INC = $(M)
-
-#
-# Includes common definitions and source file list
-#
-ifneq ($(KERNELRELEASE),)
- include $(M)/common.inc
- include $(M)/drv_sources.inc
- include $(M)/os_sources.inc
-else
-ifeq ($(KERNEL_DIR),)
- KERNEL_DIR = .
-endif
- include common.inc
- include drv_sources.inc
- include os_sources.inc
-endif
-
-#
-# OS include paths required for compilation.
-#
-OS_INCS = $(DK_ROOT)/pform/linux/inc $(DK_ROOT)/pform/common/inc
-OS_INCS += $(DK_ROOT)/common/src/core/EvHandler
-
-#
-# Location and filename of the driver .lib file created by this makefile.
-#
-OUTPUT_DIR = $(DK_ROOT)
-OUTPUT_FILE = $(OUTPUT_DIR)/libestadrv.a
-
-OS_SRCS = \
- $(DK_ROOT)/pform/common/src/osCmd.c \
- $(DK_ROOT)/pform/common/src/osUtil.c \
- $(DK_ROOT)/pform/common/src/osClsfr.c \
- $(DK_ROOT)/pform/common/src/osRgstry.c \
- $(DK_ROOT)/pform/linux/src/esta_drv.c \
- $(DK_ROOT)/pform/linux/src/mmc_tnetw1150_api.c \
- $(DK_ROOT)/pform/linux/src/tnetw_sdio.c \
- $(DK_ROOT)/pform/linux/src/osapi.c \
- $(DK_ROOT)/pform/linux/src/osmemapi.c \
- $(DK_ROOT)/pform/linux/src/env_tst.c \
- $(DK_ROOT)/pform/linux/src/ioctl_list.c \
- $(DK_ROOT)/pform/linux/src/ioctl_utils.c \
- $(DK_ROOT)/pform/linux/src/osRgstry_parser.c \
- $(DK_ROOT)/pform/linux/src/ipc_k.c \
- $(DK_ROOT)/pform/linux/src/proc_stat.c
-
-ifeq ($(DRIVER_PROFILING),y)
- OS_SRCS += $(DK_ROOT)/pform/linux/src/tiwlan_profile.c
-endif
-
-ifeq ($(STACK_PROFILING_ON),y)
- OS_SRCS += $(DK_ROOT)/pform/linux/src/stack_profile.c
- EXTRA_CFLAGS += -D STACK_PROFILE
-endif
-
-ifeq ($(NO_ARCH_STRCMP),y)
- OS_SRCS += $(DK_ROOT)/pform/linux/src/string.c
-endif
-
-OS_OBJS = $(patsubst %.c, %.o, $(OS_SRCS))
-
-#
-# Remove debug info
-#
-EXTRA_LDFLAGS += --strip-debug
-
-##
-##
-## Build process
-##
-##
-
-ifneq ($(KERNELRELEASE),)
-
-
- ##
- ##
- ## This is the kernel build phase - set the appropriate arguments
- ##
- ##
-
- #
- # Adds the current directory as a prefix to all include directories.
- #
- EXTRA_CFLAGS += $(addprefix -I$(DK_ROOT_INC)/, $(DK_INCS) $(OS_INCS))
-
- #
- # Intermediate object name - this should be converted to the appropriate library file
- # after the kernel makefile finishes its work.
- #
- obj-$(CONFIG_TIWLAN1251) += wlan.o
-
- #
- # List of object files the kernel makefile needs to compile.
- #
- wlan-objs := $(DK_OBJS) $(OS_OBJS)
-
-
-else # ifneq ($(KERNELRELEASE),)
-
- #
- # Adds the current directory as a prefix to all include directories.
- #
- EXTRA_CFLAGS += $(addprefix -I$(M)/, $(DK_INCS) $(OS_INCS))
-
-
-##
-##
-## This is the regular build phase - act according to the make actions
-##
-##
-
-#
-# The location of the kernel makefile
-#
-KERNEL_DIR ?= /vobs/wlan_linux2.6/kernel-2.6/
-
-
-#
-# Build the driver lib file
-#
-.PHONY: all
-all: .depend $(OUTPUT_FILE)
-
-
-#
-# Prints variables
-#
-.PHONY: help
-help:
- @echo Default Compilation: BOARD=$(WIFI_BOARD) PLATFORM=$(PLATFORM) DEBUG=$(DEBUG) INTR=$(INTR) WSPI=$(WSPI) EXC=$(EXC) EXTRA CFLAGS: $(EXTRA_CFLAGS)
-
-
-#
-# Recursively cleans the driver files.
-#
-.PHONY: clean
-clean:
- $(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) clean
- @rm -f *.o *.a *~ *.~* core .depend dep $(DK_OBJS) $(OS_OBJS) $(DEPS)
-
-
-#
-# Causes the library file to get rebuilt.
-#
-.depend:
- rm -f $(OUTPUT_FILE)
-
-
-#
-# Recursively builds the library file.
-#
-$(OUTPUT_FILE):
- $(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules
- @$(CROSS_COMPILE)$(AR) rcs $@ $(DK_OBJS) $(OS_OBJS)
-
-
-endif # ifneq ($(KERNELRELEASE),)
+++ /dev/null
-##
-##
-## Directory Locations
-##
-##
-
-HAL_ROOT := $(DK_ROOT)
-COMMON := $(DK_ROOT)/common
-COMSRC := $(COMMON)/src
-HALSRCR := $(HAL_ROOT)/common
-HALSRC := $(HALSRCR)/src
-DRV_BYPASS := $(COMSRC)/driver_bypass
-LINUX_PFORM := $(DK_ROOT)/pform/linux
-PFORM := $(DK_ROOT)/pform
-
-##
-##
-## Make Flags
-##
-##
-
-#
-# Choose an interface (CRTWIPP)
-#
-WIFI_BOARD ?= MSM_DREAM
-
-#
-# Choose the TNET type (1251)
-#
-PLATFORM ?= 1251
-
-#
-# Compile with EXC support or not
-#
-EXC ?= n
-
-#
-# Choose the bus type (n for SDIO, y for WSPI)
-#
-WSPI ?= n
-
-#
-# Use periodic interrupt
-#
-INTR ?= y
-
-#
-# Use work queues
-#
-WORKQUEUE ?= y
-
-#
-# Enable or disable debugging
-#
-DEBUG ?= n
-
-#
-# Enable or disable OS and init messages
-#
-INFO ?= n
-
-#
-# Archtecture Type
-#
-ARCH ?= arm
-
-#
-# Cross Compiler Prefix
-#
-CROSS_COMPILE ?= arm-eabi-
-
-#
-# Enable driver profiling
-#
-DRIVER_PROFILING ?= n
-
-
-
-
-##
-##
-## Driver Compilation Directives
-##
-##
-
-ifeq ($(EXC),y)
- DK_DEFINES += -D EXC_MODULE_INCLUDED
-endif
-
-ifeq ($(INTR),n)
- DK_DEFINES += -D PRIODIC_INTERRUPT
-endif
-
-ifeq ($(WORKQUEUE),y)
- DK_DEFINES += -D DM_USE_WORKQUEUE
-endif
-
-ifeq ($(DEBUG),y)
- DK_DEFINES += -D TI_DBG
- DK_DEFINES += -D REPORT_LOG
-else
- DK_DEFINES += -U REPORT_LOG
-endif
-
-DK_DEFINES += -D __BYTE_ORDER_LITTLE_ENDIAN
-DK_DEFINES += -D CONFIGURE_BSS_TYPE_STA
-DK_DEFINES += -D PERIODIC_WAKEUP
-
-ifeq ($(DRIVER_PROFILING),y)
- DK_DEFINES += -D DRIVER_PROFILING
-endif
-
-
-##
-##
-## Platform Compilation Directives
-##
-##
-
-ifeq ($(WIFI_BOARD),CRTWIPP)
- TIWLAN_OMAP1610_CRTWIPP ?= y
- PFORM_DEFINES += -D TIWLAN_OMAP1610_CRTWIPP
-endif
-
-ifeq ($(PLATFORM),1251)
- PFORM_DEFINES += -D TNETW1150=1
- PFORM_DEFINES += -D TNETW1251=1
-endif
-
-ifeq ($(WSPI),y)
- PFORM_DEFINES += -D HW_ACCESS_WSPI
-else
- PFORM_DEFINES += -D HW_ACCESS_SDIO
- PFORM_DEFINES += -D USE_SYNC_API
- PFORM_DEFINES += -D USE_RECOVERY
-endif
-
-ifeq ($(INFO),y)
- PFORM_DEFINES += -D OS_INFO_MESSAGES
- PFORM_DEFINES += -D INIT_MESSAGES
-endif
-
-ifeq ($(WIFI_BOARD),CRTWIPP)
-PFORM_DEFINES += -D TIWLAN_OMAP1610
-endif
-
-ifeq ($(WIFI_BOARD),MSM_DREAM)
-PFORM_DEFINES += -D TIWLAN_MSM7000
-endif
-
-# PFORM_DEFINES += -D DEBUG_MESSAGES
-PFORM_DEFINES += -D HOST_COMPILE
-PFORM_DEFINES += -D FW_RUNNING_AS_STA
-PFORM_DEFINES += -D NOT_SUPPORT_08_BIT_ACCESS_COMMAND
-PFORM_DEFINES += -D FOUR_ALIGNMENT
-PFORM_DEFINES += -D USE_INIT_FILE
-
-ifeq ($(FIRMWARE_DYNAMIC_LOAD),y)
-PFORM_DEFINES += -D FIRMWARE_DYNAMIC_LOAD
-endif
-
-##
-##
-## Miscellaneous Compilation Directivcs
-##
-##
-
-EXTRA_CFLAGS += -fsigned-char
-EXTRA_CFLAGS += -D __int64="long long"
-EXTRA_CFLAGS += -D __LINUX__
-EXTRA_CFLAGS += -D TIWLN_MAJOR_VERSION=5
-EXTRA_CFLAGS += -D TIWLN_MINOR_VERSION=1
-EXTRA_CFLAGS += $(DK_DEFINES)
-EXTRA_CFLAGS += $(PFORM_DEFINES)
+++ /dev/null
-#start of TNETW_INCS# do not remove or change this comment
-TNETW_INCS = \
- $(COMMON)/inc \
- $(COMSRC)/inc \
- $(COMSRC)/utils \
- $(HALSRC)/hal/inc \
- $(HALSRC)/hal/TnetwServices \
- $(COMSRC)/TNETW_Driver/Export_Inc \
- $(COMSRC)/TNETW_Driver/Data_Srv/inc \
- $(COMSRC)/TNETW_Driver/FW_Transfer/inc \
- $(COMSRC)/TNETW_Driver/Ctrl/Export_Inc \
- $(COMSRC)/TNETW_Driver/MacServices/inc \
- $(COMSRC)/TNETW_Driver \
- $(COMSRC)/TNETW_Driver/MacServices/Export_Inc \
- $(COMSRC)/TNETW_Driver/MacServices/src/ScanServer \
- $(COMSRC)/TNETW_Driver/MacServices/src/PowerSaveServer \
- $(COMSRC)/TNETW_Driver/MacServices/src/MeasurementSRV \
- $(COMSRC)/TNETW_Driver/TNETWIF/Export_Inc \
- $(COMSRC)/TNETW_Driver/Data_Srv/Tx_Ctrl_Blk \
- $(COMSRC)/TNETW_Driver/TNETWIF/Inc
-
-ifeq ($(PLATFORM),1251)
- TNETW_INCS += \
- $(HALSRC)/hal/TnetwServices/TNETW1251
-else
- ifeq ($(PLATFORM),1150)
- TNETW_INCS += \
- $(HALSRC)/hal/TnetwServices/TNETW1150
- else
- TNETW_INCS += \
- $(HALSRC)/hal/TnetwServices/TNETW1130
- endif
-endif
-
-TNETW_INCS += \
- $(HALSRC)/hal/hl_data \
- $(HALSRC)/hal/hl_ctrl \
- $(HALSRC)/hal/hw_ctrl \
- $(HALSRC)/hal/security \
- $(HALSRC)/hal/Export_Inc \
- $(HALSRC)/hal/FirmwareApi \
- $(HALSRC)/BusAccess/Shm_Common \
- $(HALSRC)/BusAccess/Export_Inc
-
-ifeq ($(EXC),y)
-#end of TNETW_INCS_EXC# do not remove or change this comment
-endif
-
-#end of TNETW_INCS# do not remove or change this comment
-
-
-#end of GWSI_INCS# do not remove or change this comment
-
-
-#start of CORE_INCS# do not remove or change this comment
-CORE_INCS = \
- $(COMSRC)/core/inc \
- $(COMSRC)/core/ExpInc \
- $(COMSRC)/core/data_ctrl/Tx \
- $(COMSRC)/core/data_ctrl/Ctrl \
- $(COMSRC)/core/data_ctrl/Ctrl/TrafficMonitor \
- $(COMSRC)/core/data_ctrl/Ctrl/4X \
- $(COMSRC)/core/data_ctrl/Rx \
- $(COMSRC)/core/Core_Adapt/Export_Inc \
- $(COMSRC)/core/EvHandler \
- $(COMSRC)/core/sme/Inc \
- $(COMSRC)/core/sme/smeSm/ \
- $(COMSRC)/core/sme/siteMgr \
- $(COMSRC)/core/sme/configMgr \
- $(COMSRC)/core/sme/conn \
- $(COMSRC)/core/sme/HealthMonitor \
- $(COMSRC)/core/srv/inc \
- $(COMSRC)/core/srv/scanSrv \
- $(COMSRC)/core/srv/scr \
- $(COMSRC)/core/rsn \
- $(COMSRC)/core/rsn/inc \
- $(COMSRC)/core/mlme \
- $(COMSRC)/core/mlme/Assoc \
- $(COMSRC)/core/mlme/Auth/open \
- $(COMSRC)/core/mlme/Auth/shared \
- $(COMSRC)/Management/QOS/Inc/ \
- $(COMSRC)/Management/Roaming/Inc \
- $(COMSRC)/core/NetworkCtrl/inc \
- $(COMSRC)/Management/AirLink/Measurement \
- $(COMSRC)/Management/AirLink/Measurement/dot11h \
- $(COMSRC)/Management/AirLink/inc \
- $(COMSRC)/Management/scan/inc \
- $(COMSRC)/Management/SoftGemini/inc \
- $(COMSRC)/Management/scan/scanCncn \
- $(COMSRC)/Management/SoftGemini/src \
- $(COMSRC)/core/NetworkCtrl/RegulatoryDomain \
- $(COMSRC)/Management/PowerMgr/ \
- $(COMSRC)/Management/RecoveryMgr/ \
- $(COMSRC)/core/NetworkCtrl/QOS \
- $(COMSRC)/Application/inc \
- $(COMSRC)/Application/ExpInc \
- $(COMSRC)/Application/ScanMngr \
- $(COMSRC)/Management/apConn \
- $(COMSRC)/core/currBss \
- $(COMSRC)/Management/scan/inc \
- $(DBG_MDL)/inc
-
-#end of CORE_INCS_EXC# do not remove or change this comment
-
-#end of CORE_INCS# do not remove or change this comment
-
-
-#start of UTIL_SRCS# do not remove or change this comment
-UTIL_SRCS = \
- $(COMSRC)/utils/fsm.c \
- $(COMSRC)/utils/nrfsm.c \
- $(COMSRC)/utils/report.c \
- $(COMSRC)/utils/utils.c \
- $(COMSRC)/utils/bufferPool.c \
- $(COMSRC)/utils/memMngrEx.c \
-#end of UTIL_SRCS# do not remove or change this comment
-
-
-#start of TNETW_SRCS# do not remove or change this comment
-TNETW_SRCS = \
- $(COMSRC)/TNETW_Driver/MacServices/src/MacServices.c \
- $(COMSRC)/TNETW_Driver/MacServices/src/ScanServer/ScanSrv.c \
- $(COMSRC)/TNETW_Driver/MacServices/src/ScanServer/ScanSrvSM.c \
- $(COMSRC)/TNETW_Driver/MacServices/src/PowerSaveServer/PowerSrv.c \
- $(COMSRC)/TNETW_Driver/MacServices/src/PowerSaveServer/PowerSrvSM.c \
- $(COMSRC)/TNETW_Driver/MacServices/src/MeasurementSRV/MeasurementSrv.c \
- $(COMSRC)/TNETW_Driver/MacServices/src/MeasurementSRV/MeasurementSrvSM.c \
- $(COMSRC)/TNETW_Driver/MacServices/src/MeasurementSRV/measurementSrvDbgPrint.c \
- $(COMSRC)/TNETW_Driver/Data_Srv/Tx_Ctrl_Blk/TNETW_Driver.c \
- $(COMSRC)/TNETW_Driver/Data_Srv/Tx_Ctrl_Blk/TNETW_Driver_Tx.c \
- $(COMSRC)/TNETW_Driver/Ctrl/Cmd_Queue/CmdQueue.c \
- $(COMSRC)/TNETW_Driver/Data_Srv/Tx_HW_Queue/txHwQueue.c \
- $(COMSRC)/TNETW_Driver/Data_Srv/Tx_HW_Queue/txHwQueueCalc.c \
- $(COMSRC)/TNETW_Driver/Data_Srv/Tx_Ctrl_Blk/txCtrlBlk.c \
- $(COMSRC)/TNETW_Driver/FW_Transfer/Cmd_MBox/CmdMBox.c \
- $(COMSRC)/TNETW_Driver/FW_Transfer/Tx_Result/txResult.c \
- $(COMSRC)/TNETW_Driver/FW_Transfer/Tx_Xfer/Slave_Dbl_Buf/txXfer.c \
- $(COMSRC)/TNETW_Driver/FW_Transfer/FwEvent/FwEvent.c \
- $(COMSRC)/TNETW_Driver/FW_Transfer/Rx_Xfer/RxXfer.c \
- $(COMSRC)/TNETW_Driver/FW_Transfer/EventMbox/eventMbox.c \
- $(COMSRC)/TNETW_Driver/MacServices/src/PowerAuthorization/PowerAuthorization.c \
- $(COMSRC)/TNETW_Driver/TNETWIF/TNETWIF.c \
- $(COMSRC)/TNETW_Driver/TNETWIF/ELP_Controller/ElpCtrl.c \
- $(COMSRC)/TNETW_Driver/TNETWIF/BusTxn/whalHwAccess.c \
- $(COMSRC)/TNETW_Driver/TNETWIF/TNETWArbiter/TNETWArb.c \
- $(COMSRC)/TNETW_Driver/TNETWIF/TNETWArbiter/TNETWArbSM.c \
- $(COMSRC)/TNETW_Driver/TNETWIF/TNETWArbiter/TNETWArb_buffer.c \
- $(HALSRC)/hal/hl_ctrl/whalCtrl.c \
- $(HALSRC)/hal/hl_ctrl/whalParams.c \
- $(HALSRC)/hal/hl_data/whalDefrag.c \
- $(HALSRC)/hal/hl_data/whalEndpntEnt.c \
- $(HALSRC)/BusAccess/Shm_Common/shmBus.c \
- $(HALSRC)/BusAccess/Shm_Common/shmFwCtrl.c \
- $(HALSRC)/BusAccess/Shm_Common/shmDebug.c \
- $(HALSRC)/BusAccess/Shm_Common/shmUtils.c \
- $(HALSRC)/hal/hw_ctrl/whalHwCtrl.c \
- $(HALSRC)/BusAccess/Shm_Common/whalHwEeprom.c \
- $(HALSRC)/hal/hw_ctrl/whalHwMboxConfig.c \
- $(HALSRC)/hal/hw_ctrl/whalHwMboxCmd.c \
- $(HALSRC)/hal/hw_ctrl/whalHwMboxCmdBit.c \
- $(HALSRC)/hal/hl_ctrl/whalRecovery.c \
- $(HALSRC)/hal/hl_ctrl/whalRadio.c \
- $(HALSRC)/hal/hl_ctrl/whalDebug.c \
- $(HALSRC)/hal/security/whalSecurity.c \
- $(HALSRC)/hal/security/whalWep.c \
- $(HALSRC)/hal/security/whalWpa.c
-
-ifndef GWSI_SA
- TNETW_SRCS += \
- $(COMSRC)/TNETW_Driver/FW_Transfer/HwInit/HwInit.c \
- $(COMSRC)/TNETW_Driver/Ctrl/RecoverCtrl/recoveryCtrl.c
-endif
-
-ifeq ($(WSPI),y)
- TNETW_SRCS += \
- $(COMSRC)/TNETW_Driver/TNETWIF/BusTxn/wspi.c \
- $(COMSRC)/TNETW_Driver/TNETWIF/BusTxn/tiwlanspi.c
-endif
-
-ifeq ($(DEBUG),y)
- TNETW_SRCS += \
- $(HALSRC)/BusAccess/Shm_Common/whalTrace.c \
- $(COMSRC)/TNETW_Driver/FW_Transfer/DebugTrace_Xfer/DebugTraceXfer.c
-endif
-
-#end of TNETW_SRCS_EXC# do not remove or change this comment
-
-#end of TNETW_SRCS# do not remove or change this comment
-
-#end of GWSI_SRCS# do not remove or change this comment
-
-#start of CORE_SRCS# do not remove or change this comment
-CORE_SRCS = \
- $(COMSRC)/core/data_ctrl/Tx/MsduList.c \
- $(COMSRC)/core/data_ctrl/Tx/tx.c \
- $(COMSRC)/core/data_ctrl/Ctrl/Ctrl.c \
- $(COMSRC)/core/data_ctrl/Ctrl/Clsfr.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/Concatenator.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/DeConcatenator.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/ackEmulDb.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/ackEmulUtil.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/fourX.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/fourXManager.c \
- $(COMSRC)/Management/PowerMgr/PowerMgr.c \
- $(COMSRC)/Management/PowerMgr/PowerMgrDbgPrint.c \
- $(COMSRC)/Management/RecoveryMgr/recoveryMgr.c \
- $(COMSRC)/core/data_ctrl/Ctrl/RateAdaptation.c \
- $(COMSRC)/core/data_ctrl/Ctrl/TrafficMonitor/GeneralUtil.c \
- $(COMSRC)/core/data_ctrl/Ctrl/TrafficMonitor/TrafficMonitor.c \
- $(COMSRC)/core/data_ctrl/Rx/rx.c \
- $(COMSRC)/core/sme/conn/conn.c \
- $(COMSRC)/core/sme/conn/connIbss.c \
- $(COMSRC)/core/sme/conn/connInfra.c \
- $(COMSRC)/core/sme/configMgr/configMgr.c \
- $(COMSRC)/core/sme/smeSm/smeSmApi.c \
- $(COMSRC)/core/sme/smeSm/smeSm.c \
- $(COMSRC)/core/sme/HealthMonitor/healthMonitor.c \
- $(COMSRC)/core/sme/siteMgr/siteMgr.c \
- $(COMSRC)/core/sme/siteMgr/siteHash.c \
- $(COMSRC)/core/sme/siteMgr/select.c \
- $(COMSRC)/core/sme/siteMgr/templates.c \
- $(COMSRC)/core/mlme/mlmeBuilder.c \
- $(COMSRC)/core/mlme/mlmeParser.c \
- $(COMSRC)/core/mlme/mlmeSm.c \
- $(COMSRC)/core/mlme/Assoc/assocSM.c \
- $(COMSRC)/core/mlme/Auth/authSm.c \
- $(COMSRC)/core/mlme/Auth/open/openAuthSm.c \
- $(COMSRC)/core/mlme/Auth/shared/sharedKeyAuthSm.c \
- $(COMSRC)/core/rsn/rsn.c \
- $(COMSRC)/core/rsn/mainSecSm.c \
- $(COMSRC)/core/rsn/mainSecNull.c \
- $(COMSRC)/core/rsn/mainSecKeysOnly.c \
- $(COMSRC)/core/rsn/admCtrl.c \
- $(COMSRC)/core/rsn/admCtrlWep.c \
- $(COMSRC)/core/rsn/admCtrlNone.c \
- $(COMSRC)/core/rsn/admCtrlWpa.c \
- $(COMSRC)/core/rsn/admCtrlWpa2.c \
- $(COMSRC)/core/srv/scr/scr.c \
- $(COMSRC)/core/EvHandler/EvHandler.c \
- $(COMSRC)/Management/AirLink/SwitchChannel/SwitchChannel.c \
- $(COMSRC)/Management/AirLink/Measurement/measurementMgr.c \
- $(COMSRC)/Management/AirLink/Measurement/measurementMgrSM.c \
- $(COMSRC)/Management/AirLink/Measurement/dot11h/spectrumMngmntMgr.c \
- $(COMSRC)/Management/AirLink/Measurement/requestHandler.c \
- $(COMSRC)/Management/scan/scanCncn/ScanCncn.c \
- $(COMSRC)/Management/scan/scanCncn/ScanCncnAppSM.c \
- $(COMSRC)/Management/scan/scanCncn/ScanCncnDrvSM.c \
- $(COMSRC)/Management/scan/scanCncn/ScanCncnOidSM.c \
- $(COMSRC)/Management/scan/scanCncn/ScanCncnRoamingContSM.c \
- $(COMSRC)/Management/scan/scanCncn/ScanCncnRoamingImmedSM.c \
- $(COMSRC)/Management/scan/scanCncn/ScanCncnAppApi.c \
- $(COMSRC)/Management/apConn/apConn.c \
- $(COMSRC)/Management/SoftGemini/src/SoftGemini.c \
- $(COMSRC)/core/NetworkCtrl/RegulatoryDomain/regulatoryDomain.c \
- $(COMSRC)/core/rsn/keyDerive.c \
- $(COMSRC)/core/rsn/keyDeriveWep.c \
- $(COMSRC)/core/rsn/keyDeriveTkip.c \
- $(COMSRC)/core/rsn/keyDeriveAes.c \
- $(COMSRC)/core/rsn/keyParser.c \
- $(COMSRC)/core/rsn/broadcastKeySM.c \
- $(COMSRC)/core/rsn/unicastKeySM.c \
- $(COMSRC)/core/rsn/broadcastKey802_1x.c \
- $(COMSRC)/core/rsn/unicastKey802_1x.c \
- $(COMSRC)/core/rsn/broadcastKeyNone.c \
- $(COMSRC)/core/rsn/unicastKeyNone.c \
- $(COMSRC)/core/rsn/keyParserExternal.c \
- $(COMSRC)/core/rsn/keyParserWep.c \
- $(COMSRC)/core/rsn/mainKeysSm.c \
- $(COMSRC)/core/currBss/currBss.c \
- $(COMSRC)/Application/ScanMngr/scanMngr.c \
- $(COMSRC)/Application/Roaming/roamingMngr.c \
- $(COMSRC)/core/Core_Adapt/Core_AdaptTx.c \
- $(COMSRC)/Management/QOS/qosMngr.c \
- $(COMSRC)/Management/QOS/trafficAdmControl.c
-
-ifeq ($(SUPPORT_4X),y)
- CORE_SRCS += \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/Concatenator.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/DeConcatenator.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/ackEmulDb.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/ackEmulUtil.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/fourX.c \
- $(COMSRC)/core/data_ctrl/Ctrl/4X/fourXManager.c
-endif
-
-#end of CORE_SRCS_EXC# do not remove or change this comment
-
-#end of CORE_SRCS# do not remove or change this comment
-
-
-ifdef GWSI_SA
- DK_INCS = \
- $(TNETW_INCS) \
- $(GWSI_INCS)
-
- DK_SRCS = \
- $(GWSI_SRCS) \
- $(TNETW_SRCS) \
- $(UTIL_SRCS)
-
-else
- DK_INCS = \
- $(TNETW_INCS) \
- $(CORE_INCS)
-
- DK_SRCS = \
- $(CORE_SRCS) \
- $(TNETW_SRCS)
-endif
-
-
-
-DK_OBJS = $(patsubst %.c, %.o, $(DK_SRCS) $(UTIL_SRCS))
-
+++ /dev/null
-
-#start of OS_DK_INCS_FILES# do not remove or change this comment
-OS_DK_INCS_FILES = \
- $(COMSRC)/inc/802_11Defs.h \
- $(COMSRC)/inc/Ethernet.h \
- $(COMSRC)/inc/paramIn.h \
- $(COMMON)/inc/srcApi.h \
- $(COMMON)/inc/TI_IPC_Api.h \
- $(COMMON)/inc/memMngrEx.h \
- $(COMMON)/inc/paramOut.h \
- $(COMMON)/inc/osDot11.h \
- $(COMMON)/inc/tiwlnif.h \
- $(COMMON)/inc/ratesTypes.h \
- $(COMMON)/inc/scanTypes.h \
- $(COMMON)/inc/bssTypes.h \
- $(COMMON)/inc/roamingMngrTypes.h \
- $(COMMON)/inc/paramMng.h \
- $(COMMON)/inc/commonTypes.h \
- $(COMMON)/inc/coreDefaultParams.h \
- $(COMMON)/inc/tiQosTypes.h \
- $(COMMON)/inc/whalDefaultParams.h \
- $(COMMON)/inc/TI_Results.h \
- $(COMMON)/inc/tiioctl.h \
- $(COMMON)/inc/wspVer.h \
- $(COMSRC)/core/inc/mlmeApi.h \
- $(COMSRC)/core/sme/configMgr/configMgr.h \
- $(COMSRC)/core/sme/HealthMonitor/healthMonitor.h \
- $(COMSRC)/utils/fsm.h \
- $(COMSRC)/utils/report.h \
- $(COMSRC)/utils/utils.h \
- $(COMSRC)/driver_bypass/driver_bypass.h \
- $(COMSRC)/TNETW_Driver/Export_Inc/TNETW_Driver_types.h \
- $(COMSRC)/TNETW_Driver/Export_Inc/TNETW_Driver_api.h \
- $(COMSRC)/TNETW_Driver/Ctrl/Export_Inc/CmdQueue_api.h \
- $(COMSRC)/TNETW_Driver/MacServices/Export_Inc/MacServices_api.h \
- $(COMSRC)/TNETW_Driver/MacServices/Export_Inc/measurementTypes.h \
- $(COMSRC)/TNETW_Driver/FW_Transfer/inc/rxXfer_api.h \
- $(COMSRC)/BusAccess/Export_Inc/whalBus_Defs.h \
- $(COMSRC)/BusAccess/Export_Inc/whalBus_Api.h \
- $(COMSRC)/hal/inc/whalCommon.h \
- $(COMSRC)/hal/FirmwareApi/public_descriptors.h \
- $(COMSRC)/hal/FirmwareApi/public_infoele.h \
- $(COMSRC)/hal/FirmwareApi/public_types.h \
- $(COMSRC)/hal/FirmwareApi/public_host_int.h \
- $(COMSRC)/hal/FirmwareApi/public_radio.h \
- $(COMSRC)/hal/FirmwareApi/public_commands.h \
- $(COMSRC)/hal/FirmwareApi/public_event_mbox.h \
- $(COMSRC)/hal/FirmwareApi/whalHwDefs.h \
- $(COMSRC)/hal/TnetwServices/tnetwCommon.h \
- $(COMSRC)/hal/TnetwServices/TNETW1251/whalHwRegs.h \
- $(COMSRC)/hal/TnetwServices/TNETW1251/TnetwRegisters.h \
- $(COMSRC)/hal/Export_Inc/whalCtrl_api.h \
- $(COMSRC)/hal/Export_Inc/whalCtrl_prm.h \
- $(COMSRC)/hal/hw_ctrl/whalHwMboxCmdBit.h \
- $(COMSRC)/hal/hw_ctrl/whalHwMboxCmd.h \
- $(COMSRC)/hal/hw_ctrl/whalHwMboxConfig.h \
- $(COMSRC)/hal/hw_ctrl/whalHwCtrl.h \
- $(COMSRC)/hal/hl_ctrl/whalCtrl.h \
- $(COMSRC)/hal/hl_ctrl/whalParams.h
-
-#start of OS_DK_INCS_FILES_CCX# do not remove or change this comment
-ifeq ($(CCX),y)
- OS_DK_INCS_FILES_CCX = \
- $(COMMON)/inc/CCX/paramOutCcx.h \
- $(COMMON)/inc/CCX/osDot11Ccx.h
-
- OS_DK_INCS_FILES += $(OS_DK_INCS_FILES_CCX)
-endif
-#end of OS_DK_INCS_FILES_CCX# do not remove or change this comment
-
-#start of OS_DK_INCS_FILES# do not remove or change this comment
-
-
-#start of OS_DK_INCS# do not remove or change this comment
-OS_DK_INCS = \
- $(COMMON)/inc \
- $(COMSRC)/inc \
- $(COMSRC)/core/inc \
- $(COMSRC)/core/sme/configMgr \
- $(COMSRC)/core/sme/HealthMonitor \
- $(COMSRC)/utils \
- $(COMSRC)/driver_bypass \
- $(COMSRC)/TNETW_Driver/Export_Inc \
- $(COMSRC)/TNETW_Driver/Ctrl/Export_Inc \
- $(COMSRC)/TNETW_Driver/MacServices/Export_Inc \
- $(COMSRC)/TNETW_Driver/FW_Transfer/inc \
- $(COMSRC)/BusAccess/Export_Inc \
- $(COMSRC)/hal/inc \
- $(COMSRC)/hal/FirmwareApi \
- $(COMSRC)/hal/TnetwServices \
- $(COMSRC)/hal/TnetwServices/TNETW1251 \
- $(COMSRC)/hal/Export_Inc \
- $(COMSRC)/hal/hw_ctrl \
- $(COMSRC)/hal/hl_ctrl
-
-#start of OS_DK_INCS_CCX# do not remove or change this comment
-ifeq ($(EXC),y)
- OS_DK_INCS_CCX = \
- $(COMMON)/inc/CCX
-
- OS_DK_INCS += $(OS_DK_INCS_CCX)
-endif
-#end of OS_DK_INCS_CCX# do not remove or change this comment
-
-#start of OS_DK_INCS# do not remove or change this comment
+++ /dev/null
-/* mmc_tnetw1150_api.c
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Copyright © Texas Instruments Incorporated (Oct 2005)
- * THIS CODE/PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
- * EITHER EXPRESS OR IMPLIED, INCLUDED BUT NOT LIMITED TO , THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * This program has been modified from its original operation by Texas
- * Instruments Incorporated. These changes are covered under version 2
- * of the GNU General Public License, dated June 1991.
- *
- * Copyright © Google Inc (Feb 2008)
- */
-/*-------------------------------------------------------------------*/
-#ifdef TIWLAN_MSM7000
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/version.h>
-#include "mmc_tnetw1150_api.h"
-#include <linux/mmc/core.h>
-
-#include <linux/mmc/card.h>
-#include <linux/mmc/sdio_func.h>
-
-#define SDIO_INVALID_PERIPHERAL_ADDRESS 0x1FFFF
-
-/* CCCR 0x000000 - 0x0000ff */
-/* Function Basic Register (Function 1) 0x000100 - 0x0001ff */
- /* 0x101 - Function 1 Extended standard I/O device type code */
- /* 0x102 - RFU[4-0] EnableHighPower Supports High-Power[1-0] SHP[0] */
- /* 0x103 - 0x108 - RFU */
- /* 0x109 - 0x10b - Pointer to Function 1 Card Information Structure */
- /* 0x10c - 0x10e - Pointer to Function 1 Code Storage Area */
- /* 0x10f - Data access window to Function 1 Code Storage Area */
- /* 0x110 - 0x111 - I/O block size for Function 1 */
- /* 0x112 - 0x1ff - RFU */
-/* Function Basic Register (Function 2) 0x000200 - 0x0002ff */
-/* Function Basic Register (Function 3) 0x000300 - 0x0003ff */
-/* Function Basic Register (Function 4) 0x000400 - 0x0004ff */
-/* Function Basic Register (Function 5) 0x000500 - 0x0005ff */
-/* Function Basic Register (Function 6) 0x000600 - 0x0006ff */
-/* Function Basic Register (Function 7) 0x000700 - 0x0007ff */
-/* RFU 0x000800 - 0x000fff */
-/* CIS common and per-function area 0x001000 - 0x017fff */
-/* RFU 0x018000 - 0x01ffff */
-#define SDIO_FUNC1_OFFSET 0x1FFC0
-
-typedef struct
-{
- Peripheral_Address mem_start_addr;
- Peripheral_Address mem_part_size;
- Peripheral_Address mem_end_addr;
- Peripheral_Address reg_start_addr;
- Peripheral_Address reg_part_size;
- Peripheral_Address reg_end_addr;
-} SDIO_TNETW_partitions;
-static SDIO_TNETW_partitions TNETW_table;
-
-static SDIO_TNETWConfigParams TNETW_params;
-
-#ifdef CONFIG_MMC_TNET_INFO
-typedef struct {
- u8 scr_space[SDIO_FUNC1_OFFSET]; /* 0x000000 - 0x01ffbf;
- 131072B(128kB)-64B=131008B(0x01ffc0) */
- u32 amap_size1; /* 0x01ffc0 */
- u32 amap_offset1; /* 0x01ffc4 */
- u32 amap_size2; /* 0x01ffc8 */
- u32 amap_offset2; /* 0x01ffcc */
- u32 amap_size3; /* 0x01ffd0 */
- u32 amap_offset3; /* 0x01ffd4 */
- u32 amap_offset4; /* 0x01ffd8 */
- u32 cis_offset; /* 0x01ffdc - Card Information Structure */
- u32 csa_offset; /* 0x01ffe0 - Code Storage Area */
- u8 filler[16]; /* 0x01ffe4 - 0x01fff3 */
- u32 wr_err_len; /* 0x01fff4 */
- u32 wr_err_addr; /* 0x01fff8 */
- u32 status; /* 0x01fffc */
-} SDIO_FUNC1AddressMap;
-SDIO_FUNC1AddressMap mapping;
-
-int sdio_tnetw1150_dump(int count)
-{
- unsigned long from;
- unsigned long br_offset;
- unsigned long offset=0;
- unsigned long p1_offset=0;
- unsigned long p2_offset=0;
- struct mmc_request request;
- int lines;
- int i=0;
- int second_part=0;
-
- printk("%s:\n", __FUNCTION__);
-#define TNETW1150_OFFSET 1024
- from=TNETW1150_OFFSET*count;
- if((from+TNETW1150_OFFSET)>(SDIO_FUNC1_OFFSET+64))
- return -1;
- br_offset=TNETW1150_OFFSET*count;
- if(br_offset>=TNETW_params.map_reg[0].reg_size) {
- second_part=1;
- p2_offset = SDIO_DRIVER_REG_PARTITION_START;
- offset = TNETW_params.map_reg[1].scr_offset - TNETW_params.map_reg[0].reg_size;
- }
- else {
- p1_offset += SDIO_DOWNLOAD_PARTITION_START;
- offset = TNETW_params.map_reg[0].scr_offset;
- }
-
- request.cmd=SD_IO_RW_DIRECT;
- request.buffer_len=1;
- request.nob=0;
- request.block_len=0;
- request.buffer=&mapping.scr_space[from];
- printk(" TNETW1150 try br_offset:0x%08lx offset:0x%08lx):\n", br_offset, offset);
- do {
- request.arg = SDIO_CMD52_READ(0,FUNCTION_SELECT_1,0,br_offset);
- if(__submit_control_request(omap_mmc_dev_get_handle(), &request)!=SDIO_SUCCESS)
- return SDIO_FAILURE;
- udelay(1);
- *request.buffer = (char)omap_readw(OMAP_MMC_RSP6);
- i++;
- request.buffer++;
- br_offset++;
- } while(i<TNETW1150_OFFSET);
-
- printk(" TNETW1150 SCR Address Space (start:0x%08lx end:0x%08lx part:%d offset:0x%08lx):\n", from, from+TNETW1150_OFFSET-1, second_part+1, (!second_part)?p1_offset:p2_offset);
-
- lines=TNETW1150_OFFSET/16;
- for(i=0; i<lines;i++, from+=16)
- printk("SDIO:0x%04lx(SCR:0x%04lx): %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", from, (!second_part)?(from+p1_offset):(from-p2_offset+SDIO_REG_PARTITION_START), mapping.scr_space[from], mapping.scr_space[from+1], mapping.scr_space[from+2], mapping.scr_space[from+3], mapping.scr_space[from+4], mapping.scr_space[from+5], mapping.scr_space[from+6], mapping.scr_space[from+7], mapping.scr_space[from+8], mapping.scr_space[from+9], mapping.scr_space[from+10], mapping.scr_space[from+11], mapping.scr_space[from+12], mapping.scr_space[from+13], mapping.scr_space[from+14], mapping.scr_space[from+15]);
-
- return 0;
-}
-EXPORT_SYMBOL(sdio_tnetw1150_dump);
-
-int sdio_tnetw1150_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data)
-{
- int len=0;
- int br_offset = SDIO_FUNC1_OFFSET;
- struct mmc_request request;
- u8 buf[64];
- u8 buf3[3];
- int bytes_to_read=64;
- int i;
-#define CCCR_SIZE 17
- u8 buf_ccr[CCCR_SIZE];
- u8 buf_ccr_offset[CCCR_SIZE] = {
- CCCR_SDIO_REVISION, CCCR_SD_SPECIFICATION_REVISION, CCCR_IO_ENABLE,
- CCCR_IO_READY, CCCR_INT_ENABLE, CCCR_INT_PENDING,
- CCCR_IO_ABORT, CCCR_BUS_INTERFACE_CONTOROL, CCCR_CARD_CAPABILITY,
- CCCR_COMMON_CIS_POINTER, CCCR_COMMON_CIS_POINTER+1, CCCR_COMMON_CIS_POINTER+2,
- CCCR_BUS_SUSPEND, CCCR_FUNCTION_SELECT, CCCR_EXEC_FLAGS,
- CCCR_READY_FLAGS, CCCR_FNO_BLOCK_SIZE,
- };
-#define FBR_SIZE 9
- u8 buf_fbr[FBR_SIZE];
- u16 buf_fbr_offset[FBR_SIZE] = {
- FBR_PTR_F1_CIS, FBR_PTR_F1_CIS+1, FBR_PTR_F1_CIS+2,
- FBR_PTR_F1_CSA, FBR_PTR_F1_CSA+1, FBR_PTR_F1_CSA+2,
- FBR_WIN_F1_CSA, FBR_F1_IO_BLK_SIZE, FBR_F1_IO_BLK_SIZE+1,
- };
-
- request.cmd=SD_IO_RW_DIRECT;
- request.buffer_len=1;
- request.nob=0;
- request.block_len=0;
- request.buffer=&buf[0];
- for (i=0; i<bytes_to_read;i++,request.buffer++,br_offset++) {
- request.arg = SDIO_CMD52_READ(0,FUNCTION_SELECT_1,0,br_offset);
- if(__submit_control_request(omap_mmc_dev_get_handle(), &request)!=SDIO_SUCCESS)
- return SDIO_FAILURE;
- *request.buffer = (char)omap_readw(OMAP_MMC_RSP6);
- }
- memcpy(&mapping.amap_size1, &buf, 64);
-
- count -= 80; /* some reserve */
- len += (len<count)?sprintf(page+len, " TNETW1150 partitions:\n"):0;
- len += (len<count)?sprintf(page+len, " Memory: "):0;
- len += (len<count)?sprintf(page+len, " start:0x%08lx end:0x%08lx size:0x%08lx bytes\n", TNETW_table.mem_start_addr, TNETW_table.mem_end_addr, TNETW_table.mem_part_size):0;
- len += (len<count)?sprintf(page+len, " Registers: "):0;
- len += (len<count)?sprintf(page+len, " start:0x%08lx end:0x%08lx size:0x%08lx bytes\n", TNETW_table.reg_start_addr, TNETW_table.reg_end_addr, TNETW_table.reg_part_size):0;
-
- len += (len<count)?sprintf(page+len, " SDIO Function 1 Address Map:\n"):0;
- len += (len<count)?sprintf(page+len, " amap_size1:0x%08x amap_offset1:0x%08x\n", mapping.amap_size1, mapping.amap_offset1):0;
- len += (len<count)?sprintf(page+len, " amap_size2:0x%08x amap_offset2:0x%08x\n", mapping.amap_size2, mapping.amap_offset2):0;
- len += (len<count)?sprintf(page+len, " amap_size3:0x%08x amap_offset3:0x%08x\n", mapping.amap_size3, mapping.amap_offset3):0;
- len += (len<count)?sprintf(page+len, " amap_offset4:0x%08x\n", mapping.amap_offset4):0;
- len += (len<count)?sprintf(page+len, " cis_offset:0x%08x csa_offset :0x%08x\n", mapping.cis_offset, mapping.csa_offset):0;
- len += (len<count)?sprintf(page+len, " wr_err_len:0x%08x wr_err_addr :0x%08x\n", mapping.wr_err_len, mapping.wr_err_addr):0;
- len += (len<count)?sprintf(page+len, " status :0x%08x\n", mapping.status):0;
-
- request.cmd=SD_IO_RW_DIRECT;
- request.buffer_len=1;
- request.nob=0;
- request.block_len=0;
- request.buffer=&buf_ccr[0];
- for (i=0; i<CCCR_SIZE;i++,request.buffer++) {
- request.arg = SDIO_CMD52_READ(0,FUNCTION_SELECT_0,0,buf_ccr_offset[i]);
- if(__submit_control_request(omap_mmc_dev_get_handle(), &request)!=SDIO_SUCCESS)
- return SDIO_FAILURE;
- *request.buffer = (char)omap_readw(OMAP_MMC_RSP6);
- }
-
- len += (len<count)?sprintf(page+len, "\n Card Common Control Registers:\n"):0;
- len += (len<count)?sprintf(page+len, " \
- REVISION :0x%02x SD_SPEC_REVISION :0x%02x IO_ENABLE :0x%02x\n \
- IO_READY :0x%02x INT_ENABLE :0x%02x INT_PENDING :0x%02x\n \
- IO_ABORT :0x%02x BUS_INTERFACE_CONTOROL :0x%02x CARD_CAPABILITY :0x%02x\n \
- COMMON_CIS_POINTER[2]:0x%02x COMMON_CIS_POINTER[1] :0x%02x COMMON_CIS_POINTER[0]:0x%02x\n \
- BUS_SUSPEND :0x%02x FUNCTION_SELECT :0x%02x EXEC_FLAGS :0x%02x\n \
- READY_FLAGS :0x%02x FNO_BLOCK_SIZE :0x%02x\n" , buf_ccr[0], buf_ccr[1], buf_ccr[2], buf_ccr[3], buf_ccr[4], buf_ccr[5], buf_ccr[6], buf_ccr[7], buf_ccr[8], buf_ccr[11], buf_ccr[10], buf_ccr[9], buf_ccr[12], buf_ccr[13], buf_ccr[14], buf_ccr[15], buf_ccr[16]):0;
-
- request.cmd=SD_IO_RW_DIRECT;
- request.buffer_len=1;
- request.nob=0;
- request.block_len=0;
-
- request.buffer=&buf3[0];
- for (i=0; i<3;i++,request.buffer++) {
- request.arg = SDIO_CMD52_READ(0,FUNCTION_SELECT_1,0,FBR_PTR_F1_IO_DEV);
- if(__submit_control_request(omap_mmc_dev_get_handle(), &request)!=SDIO_SUCCESS)
- return SDIO_FAILURE;
- *request.buffer = (char)omap_readw(OMAP_MMC_RSP6);
- }
-
- request.buffer=&buf_fbr[0];
- for (i=0; i<FBR_SIZE;i++,request.buffer++) {
- request.arg = SDIO_CMD52_READ(0,FUNCTION_SELECT_1,0,buf_fbr_offset[i]);
- if(__submit_control_request(omap_mmc_dev_get_handle(), &request)!=SDIO_SUCCESS)
- return SDIO_FAILURE;
- *request.buffer = (char)omap_readw(OMAP_MMC_RSP6);
- }
-
- len += (len<count)?sprintf(page+len, "\n Function Basic Registers(Func 1):\n"):0;
- len += (len<count)?sprintf(page+len, " \
- Func 1 CSA enable and CSA support : 0x%02x 0x%02x\n \
- Func 1 Ext stand. I/O device i/f and type code : 0x%02x 0x%02x\n \
- EHP|SHP[1]|SHP[0] : 0x%02x\n \
- Pointer to Func 1 Card Information Structure :0x%02x 0x%02x 0x%02x\n \
- Pointer to Func 1 Code Storage Area :0x%02x 0x%02x 0x%02x\n \
- Data access window to Func 1 Code Storage Area : 0x%02x\n \
- I/O block size for Func 1 : 0x%02x 0x%02x\n", ((buf3[0]&0x80)>>7), ((buf3[0]&0x40)>>6), (buf3[1]&0x0f), buf3[1], (buf3[2]&0x07), buf_fbr[2], buf_fbr[1], buf_fbr[0], buf_fbr[5], buf_fbr[4], buf_fbr[3], buf_fbr[6], buf_fbr[8], buf_fbr[7]):0;
-
- *eof = 1;
- return len;
-}
-#endif /*CONFIG_MMC_TNET_STATISTICS*/
-
-
-/*
- Initialization of TNETW memory configuration.
-*/
-extern int debug_level;
-SDIO_Status SDIO_TNETWInit(SDIO_TNETWConfigParams *params)
-{
- /* debug_level=3; */
- /* printk("%s\n", __FUNCTION__); */
-
- memset(&TNETW_params, 0, sizeof(SDIO_TNETWConfigParams));
-
- if(!params) {
- /* printk("%s set to default\n", __FUNCTION__); */
- /* set to default value in case params is not presented */
- TNETW_params.num_of_parts = 2;
- /* First time initialization */
- TNETW_params.map_reg[0].reg_size = SDIO_DOWNLOAD_PARTITION_SIZE;
- TNETW_params.map_reg[0].scr_offset = SDIO_DOWNLOAD_PARTITION_START;
- /* After firmware has been downloaded, data memory region
- has to be re-initialized as following:
- TNETW_params.map_reg[0].reg_size = SDIO_MEM_PARTITION_START;
- TNETW_params.map_reg[0].scr_offset = SDIO_MEM_PARTITION_SIZE;
- */
- TNETW_params.map_reg[1].reg_size = SDIO_REG_PARTITION_SIZE;
- TNETW_params.map_reg[1].scr_offset = SDIO_REG_PARTITION_START;
- }
- else {
- /* printk("%s: params->num_of_parts=%d\n", __FUNCTION__, params->num_of_parts); */
- /* validate input parameters */
- switch(params->num_of_parts) {
- case 1:
- if(params->map_reg[0].reg_size > AMAP_ONE_REGION)
- return SDIO_FAILURE;
- break;
- case 2:
- if((params->map_reg[0].reg_size + params->map_reg[1].reg_size) > AMAP_ONE_REGION)
- return SDIO_FAILURE;
- break;
- case 3:
- if((params->map_reg[0].reg_size + params->map_reg[1].reg_size + params->map_reg[2].reg_size) > AMAP_ONE_REGION)
- return SDIO_FAILURE;
- break;
- case 4:
- if((params->map_reg[0].reg_size + params->map_reg[1].reg_size + params->map_reg[2].reg_size + params->map_reg[3].reg_size) > AMAP_ONE_REGION)
- return SDIO_FAILURE;
- break;
- default:
- return SDIO_FAILURE;
- }
- memcpy(&TNETW_params, params, sizeof(SDIO_TNETWConfigParams));
- }
-
-#ifdef CONFIG_PROC_FS
-#ifdef CONFIG_MMC_TNET_INFO
- create_proc_read_entry("sdio_tnetw1150", 0, NULL, sdio_tnetw1150_read_proc, NULL);
-#endif
-#endif
-
- /* printk("%s completed\n", __FUNCTION__); */
-
- return SDIO_SUCCESS;
-}
-
-SDIO_Status SDIO_TNETWReset(SDIO_TNETWConfigParams *params)
-{
- /* printk("%s\n", __FUNCTION__); */
-
- memset(&TNETW_params, 0, sizeof(SDIO_TNETWConfigParams));
-
- if(!params) {
- /* printk("%s set to default\n", __FUNCTION__); */
- /* set to default value in case params is not presented */
- TNETW_params.num_of_parts = 2;
-
- /* After firmware has been downloaded, data memory region
- has to be re-initialized as following */
- TNETW_params.map_reg[0].reg_size = SDIO_MEM_PARTITION_START;
- TNETW_params.map_reg[0].scr_offset = SDIO_MEM_PARTITION_SIZE;
- TNETW_params.map_reg[1].reg_size = SDIO_REG_PARTITION_SIZE;
- TNETW_params.map_reg[1].scr_offset = SDIO_REG_PARTITION_START;
- }
- else {
- /* printk("%s: params->num_of_parts=%d\n", __FUNCTION__, params->num_of_parts); */
- /* validate input parameters */
- switch(params->num_of_parts) {
- case 1:
- if(params->map_reg[0].reg_size > AMAP_ONE_REGION)
- return SDIO_FAILURE;
- break;
- case 2:
- if((params->map_reg[0].reg_size + params->map_reg[1].reg_size) > AMAP_ONE_REGION)
- return SDIO_FAILURE;
- break;
- case 3:
- if((params->map_reg[0].reg_size + params->map_reg[1].reg_size + params->map_reg[2].reg_size) > AMAP_ONE_REGION)
- return SDIO_FAILURE;
- break;
- case 4:
- if((params->map_reg[0].reg_size + params->map_reg[1].reg_size + params->map_reg[2].reg_size + params->map_reg[3].reg_size) > AMAP_ONE_REGION)
- return SDIO_FAILURE;
- break;
- default:
- return SDIO_FAILURE;
- }
- memcpy(&TNETW_params, params, sizeof(SDIO_TNETWConfigParams));
- }
-
- /* printk("%s completed\n", __FUNCTION__); */
-
- return SDIO_SUCCESS;
-}
-
-
-static SDIO_Status config_partition(SDIO_Handle sdioHandle, int partition_no, Peripheral_Address start_addr, SDIO_BufferLength part_size)
-{
- struct sdio_func *func = (struct sdio_func *) sdioHandle;
- u8 data;
- int br_offset = SDIO_FUNC1_OFFSET + (partition_no-1)*8;
- int i, rc;
-
- /* printk("%s: partition_no=%d\n", __FUNCTION__, partition_no); */
-
- /* Set size - write out 4 bytes by 4 requests */
- if (partition_no < AMAP_MAX_REGIONS)
- {
- for(i=0;i<4;i++,br_offset++) {
- data = (part_size>>(8*i))&0xFF;
-
- /* put R/W Flag (1 for write); Function Number(1), RAW Flag(0),
- Register Address - the address of the byte of data inside
- of the selected function that will be written
- (br_offset for func1),
- Write Data - for a direct write command, this is the byte=data,
- that will be written to the selected address=br_offset).
- */
- sdio_writeb(func, data, br_offset, &rc);
- if (rc < 0) {
- printk(KERN_ERR "%s: Error writing size\n", __FUNCTION__);
- return SDIO_FAILURE;
- }
- /* printk("%s: offset byte=%d data=0x%08x at=0x%08x\n", __FUNCTION__, i, data, br_offset); */
- }
-
- /* Set offset - write out 4 bytes by 4 requests */
- for(i=0;i<4;i++,br_offset++) {
- data = (start_addr>>(8*i))&0xFF;
- sdio_writeb(func, data, br_offset, &rc);
- if (rc < 0) {
- printk(KERN_ERR "%s: Error writing offset\n", __FUNCTION__);
- return SDIO_FAILURE;
- }
- /* printk("%s: offset byte=%d data=0x%08x at=0x%08x\n", __FUNCTION__, i, data, br_offset); */
- }
- }
-#if 0
- if( partition_no == 2 ) {
- unsigned long id1;
- for(i=0,br_offset=0x1ce34;i<4;i++,br_offset++) {
- data = sdio_readb(func, br_offset, &rc);
- if (rc < 0) {
- printk(KERN_ERR "%s: Error reading offset\n", __FUNCTION__);
- return SDIO_FAILURE;
- }
- printk("%s: offset byte=%d data=0x%08x at=0x%08x\n", __FUNCTION__, i, data, br_offset);
- }
- rc = sdio_memcpy_fromio(func, &id1, 0x1ce34, 4); /* Dm: Important - DO NOT REMOVE !!! */
- if (rc < 0) {
- printk(KERN_ERR "%s: Error reading offset\n", __FUNCTION__);
- return SDIO_FAILURE;
- }
- printk("%s: data=0x%08x at=0x%08x\n", __FUNCTION__, id1, br_offset);
- }
-#endif
- return SDIO_SUCCESS;
-}
-
-/*
- This function configures the slave SDIO device for the required
- operation mode.
-*/
-SDIO_Status SDIO_TNETWConfig(SDIO_Handle sdioHandle, Peripheral_ConfigParams **peripheral_info)
-{
- SDIO_Status rc;
-
- /* printk("%s\n", __FUNCTION__); */
-
- TNETW_table.mem_start_addr = TNETW_params.map_reg[0].scr_offset;
- TNETW_table.mem_part_size = TNETW_params.map_reg[0].reg_size;
- TNETW_table.mem_end_addr = TNETW_table.mem_start_addr + TNETW_table.mem_part_size - 1;
-
- TNETW_table.reg_start_addr = TNETW_params.map_reg[1].scr_offset;
- TNETW_table.reg_part_size = TNETW_params.map_reg[1].reg_size;
- TNETW_table.reg_end_addr = TNETW_table.reg_start_addr + TNETW_table.reg_part_size - 1;
-#if 0
- printk("%s: memory area: start_addr=0x%08lx end_addr=0x%08lx part_size=0x%08lx\n", __FUNCTION__, TNETW_table.mem_start_addr, TNETW_table.mem_end_addr, TNETW_table.mem_part_size);
- printk("%s: register area: start_addr=0x%08lx end_addr=0x%08lx part_size=0x%08lx\n", __FUNCTION__, TNETW_table.reg_start_addr, TNETW_table.reg_end_addr, TNETW_table.reg_part_size);
-#endif
- /* Configure 17-bits address range in peripheral */
- rc=config_partition(sdioHandle, 1, TNETW_table.mem_start_addr, TNETW_table.mem_part_size);
- rc = (rc==SDIO_SUCCESS)?config_partition(sdioHandle, 2, TNETW_table.reg_start_addr, TNETW_table.reg_part_size):rc;
-
- if(*peripheral_info)
- *peripheral_info = (void *)&TNETW_table;
-
- /* printk("%s: TNETW1150 partitions:\n", __FUNCTION__);
- printk("Memory : start:0x%08lx end:0x%08lx size:0x%08lx bytes\n", TNETW_table.mem_start_addr, TNETW_table.mem_end_addr, TNETW_table.mem_part_size);
- printk("Registers: start:0x%08lx end:0x%08lx size:0x%08lx bytes\n", TNETW_table.reg_start_addr, TNETW_table.reg_end_addr, TNETW_table.reg_part_size);
- */
-
- return rc;
-}
-
-/*
- This function performs convertion of peripheral adddress into 17 bits
- SDIO address. If found that the memory partition configuration must be
- changed, the memory is re-mapped in accordance to requested address.
-*/
-SDIO_Address SDIO_ConvertTNETWToSDIOMaster(Peripheral_Address in_tnetw_address, SDIO_BufferLength packet_size)
-{
- SDIO_Address out_sdio_address;
-
-#ifdef CONFIG_SDIO_ADDRESS_MAPPING_BY_APPLICATION
- out_sdio_address = in_tnetw_address;
-#else
- Peripheral_Address tnetw_last_address = in_tnetw_address + packet_size - 1;
-
- /* printk("%s:\n", __FUNCTION__); */
-
- if ((in_tnetw_address >= TNETW_table.mem_start_addr) && (tnetw_last_address <= TNETW_table.mem_end_addr)) {
- /* printk("%s part1 from=0x%08lx to 0x%08lx\n", __FUNCTION__, in_tnetw_address, tnetw_last_address); */
- /* address in the 1-st partition range (data memory space) */
- out_sdio_address = in_tnetw_address - TNETW_table.mem_start_addr;
- }
- else if ((in_tnetw_address >= TNETW_table.reg_start_addr) && (tnetw_last_address <= TNETW_table.reg_end_addr)) {
- /* printk("%s part2 from=0x%08lx to 0x%08lx\n", __FUNCTION__, in_tnetw_address, tnetw_last_address); */
- /* address in the 2-nd partition range (register memory space) */
- out_sdio_address = in_tnetw_address - TNETW_table.reg_start_addr + TNETW_table.mem_part_size;
- }
- else {
- /* printk("%s peripheral addresses from=0x%08lx to 0x%08lx is out of range\n", __FUNCTION__, in_tnetw_address, tnetw_last_address); */
- /* invalid address */
- return SDIO_INVALID_PERIPHERAL_ADDRESS;
- }
- /* printk("%s: in_tnetw_addr=0x%08lx out_sdio_addr=0x%08lx\n", __FUNCTION__, in_tnetw_address, out_sdio_address); */
-
-#endif /* CONFIG_SDIO_ADDRESS_MAPPING_BY_APPLICATION */
-
- return out_sdio_address;
-}
-
-SDIO_Status SDIO_TNETW_Set_ELP_Reg(SDIO_Handle sdioHandle, Peripheral_Address start_addr, unsigned int data)
-{
- struct sdio_func *func = (struct sdio_func *) sdioHandle;
- u8 data1 = 0;
- int br_offset = start_addr;
- int i, rc;
-
- /* Set size - write out 4 bytes by 4 requests */
- for(i=0;i<1;i++,br_offset++) {
- data1 = (data>>(8*i))&0xFF;
-
- /* put R/W Flag (1 for write); Function Number(1), RAW Flag(0),
- Register Address - the address of the byte of data inside
- of the selected function that will be written
- (br_offset for func1),
- Write Data - for a direct write command, this is the byte=data,
- that will be written to the selected address=br_offset).
- */
- sdio_writeb(func, data1, br_offset, &rc);
- if (rc < 0) {
- printk(KERN_ERR "%s: Error writing size\n", __FUNCTION__);
- return SDIO_FAILURE;
- }
- }
- return SDIO_SUCCESS;
-}
-
-SDIO_Status SDIO_TNETW_Get_ELP_Reg(SDIO_Handle sdioHandle, Peripheral_Address start_addr, unsigned int *data)
-{
- struct sdio_func *func = (struct sdio_func *) sdioHandle;
- int br_offset = start_addr;
- int rc;
-
- *(u8*)data = sdio_readb_ext(func, br_offset, &rc, 0x01);
- if (rc) {
- printk(KERN_ERR "%s: Error reading sdio register (%d)\n", __FUNCTION__, rc);
- return SDIO_FAILURE;
- }
- return SDIO_SUCCESS;
-}
-
-#endif /* TIWLAN_MSM7000 */
+++ /dev/null
-/* tnetw_sdio.c
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Copyright © Texas Instruments Incorporated (Oct 2005)
- * THIS CODE/PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
- * EITHER EXPRESS OR IMPLIED, INCLUDED BUT NOT LIMITED TO , THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * This program has been modified from its original operation by Texas
- * Instruments Incorporated. These changes are covered under version 2
- * of the GNU General Public License, dated June 1991.
- *
- * Copyright © Google Inc (Feb 2008)
- */
-/*-------------------------------------------------------------------*/
-#ifdef TIWLAN_MSM7000
-#include <linux/delay.h>
-#include <linux/mmc/core.h>
-#include <linux/mmc/card.h>
-#include <linux/mmc/host.h>
-#include <linux/mmc/sdio_func.h>
-#include <linux/mmc/sdio_ids.h>
-#include "esta_drv.h"
-#include "mmc_omap_api.h"
-#include "osApi.h"
-/*-------------------------------------------------------------------*/
-extern int tiwlan_sdio_init(struct sdio_func *func);
-extern int sdio_reset_comm(struct mmc_card *card);
-/*-------------------------------------------------------------------*/
-static struct sdio_func *tiwlan_func = NULL;
-static int sdio_reset_flag = 0;
-/*-------------------------------------------------------------------*/
-void SDIO_SetFunc( struct sdio_func *func )
-{
- tiwlan_func = func;
-}
-
-struct sdio_func *SDIO_GetFunc( void )
-{
- return( tiwlan_func );
-}
-
-SDIO_Status SDIO_Init(SDIO_ConfigParams *ConfigParams, SDIO_Handle *Handle)
-{
- if( Handle == NULL ) {
- printk(KERN_ERR "Error: SDIO_Init() called with NULL!\n");
- return SDIO_FAILURE;
- }
- *Handle = (SDIO_Handle)SDIO_GetFunc();
- if( (*Handle) == NULL ) {
- printk(KERN_ERR "Error: SDIO_Init() called before SDIO probe completed!\n");
- return SDIO_FAILURE;
- }
- return SDIO_SUCCESS;
-}
-
-SDIO_Status SDIO_Shutdown(SDIO_Handle Handle)
-{
- /* printk("%s:\n", __FUNCTION__); */
- return SDIO_SUCCESS;
-}
-
-SDIO_Status SDIO_Start(SDIO_Handle Handle)
-{
- struct sdio_func *func = (struct sdio_func *)Handle;
-
- /* printk("%s:\n", __FUNCTION__); */
- if( func ) {
- if( sdio_reset_flag ) {
- sdio_reset_flag = 0;
- if( tiwlan_sdio_init(func) ) {
- printk("TI: tiwlan_sdio_init Error !\n");
- return SDIO_FAILURE;
- }
- }
- }
- return SDIO_SUCCESS;
-}
-
-SDIO_Status SDIO_Reset(SDIO_Handle Handle)
-{
- struct sdio_func *func = (struct sdio_func *)Handle;
-
- /* printk("%s:\n", __FUNCTION__); */
- if( func && func->card ) {
- sdio_reset_comm(func->card);
- }
- return SDIO_SUCCESS;
-}
-
-SDIO_Status SDIO_Stop(SDIO_Handle Handle, unsigned long Wait_Window)
-{
- /* printk("%s:\n", __FUNCTION__); */
- sdio_reset_flag = 1;
- return SDIO_Reset( Handle );
-}
-
-static int read_direct(struct sdio_func *func, unsigned char *buf,
- unsigned long addr, unsigned len)
-{
- unsigned i;
- int rc0, rc = 0;
-
- for(i=0;( i < len );i++,addr++) {
- *buf++ = (unsigned char)sdio_readb(func, addr, &rc0);
- if( rc0 != 0 )
- rc = rc0;
- }
- return rc;
-}
-
-static int write_direct(struct sdio_func *func, unsigned long addr,
- unsigned char *buf, unsigned len)
-{
- unsigned i;
- int rc0, rc = 0;
-
- for(i=0;( i < len );i++,addr++) {
- sdio_writeb(func, *buf++, addr, &rc0);
- if( rc0 != 0 )
- rc = rc0;
- }
- return rc;
-}
-
-SDIO_Status SDIO_SyncRead(SDIO_Handle Handle, SDIO_Request_t *Req)
-{
- struct sdio_func *func = (struct sdio_func *)Handle;
- int rc;
- int retries = 5;
-
-#if 0
- printk("%s: p_addr = 0x%.8lx, sz = %d\n",
- __FUNCTION__,
- Req->peripheral_addr,
- Req->buffer_len);
-#endif
-
- while(retries) {
- if( retries > 2 )
- rc = sdio_memcpy_fromio(func, Req->buffer, Req->peripheral_addr, Req->buffer_len);
- else
- rc = read_direct(func, Req->buffer, Req->peripheral_addr, Req->buffer_len);
-
- if (rc) {
- printk(KERN_ERR "%s: Read operation failed (%d) (retries = %d)\n",
- __FUNCTION__, rc, retries);
- retries--;
- continue;
- }
- if (retries != 5)
- printk(KERN_ERR "%s: Retry succeeded\n", __FUNCTION__);
- return SDIO_SUCCESS;
- }
- printk(KERN_ERR "%s: Giving up\n", __FUNCTION__);
- return SDIO_FAILURE;
-}
-
-SDIO_Status SDIO_SyncWrite(SDIO_Handle Handle, SDIO_Request_t *Req)
-{
- struct sdio_func *func = (struct sdio_func *)Handle;
- int rc;
- int retries = 5;
-
-#if 0
- printk("%s: p_addr = 0x%.8lx, sz = %d\n",
- __FUNCTION__,
- Req->peripheral_addr,
- Req->buffer_len);
-#endif
-
- while(retries) {
- if( retries > 2 ) {
- rc = sdio_memcpy_toio(func, Req->peripheral_addr, Req->buffer, Req->buffer_len);
- }
- else
- rc = write_direct(func, Req->peripheral_addr, Req->buffer, Req->buffer_len);
-
- if (rc) {
- printk(KERN_ERR "%s: Write operation failed (%d) (retries = %d)\n",
- __FUNCTION__, rc, retries);
- retries--;
- continue;
- }
-
- if (retries != 5)
- printk(KERN_ERR "%s: Retry succeeded\n", __FUNCTION__);
- return SDIO_SUCCESS;
- }
- printk(KERN_ERR "%s: Giving up\n", __FUNCTION__);
- return SDIO_FAILURE;
-}
-#endif
+++ /dev/null
-LOCAL_PATH := $(call my-dir)
-WPA_BUILD_SUPPLICANT_LIB := false
-ifeq ($(HAVE_CUSTOM_WIFI_DRIVER_2),true)
-WPA_BUILD_SUPPLICANT_LIB := true
-STA_DK_ROOT = $(LOCAL_PATH)/../..
-endif
-
-DK_ROOT = $(STA_DK_ROOT)
-OS_ROOT = $(STA_DK_ROOT)/pform
-COMMON = $(DK_ROOT)/common
-COMSRC = $(COMMON)/src
-CUDK_ROOT = $(DK_ROOT)/CUDK
-
-include external/wpa_supplicant/.config
-
-# To force sizeof(enum) = 4
-ifneq ($(TARGET_SIMULATOR),true)
-L_CFLAGS += -mabi=aapcs-linux
-endif
-
-INCLUDES = $(COMMON)/inc \
- $(COMSRC)/inc \
- $(COMSRC)/utils \
- $(COMSRC)/hal/inc \
- $(COMSRC)/hal/TnetwServices \
- $(COMSRC)/hal/TnetwServices/TNETW1150 \
- $(COMSRC)/hal/FirmwareApi \
- $(COMSRC)/hal/hl_data \
- $(COMSRC)/hal/hl_ctrl \
- $(COMSRC)/hal/hl_ctrl/PowerCtrl \
- $(COMSRC)/hal/hw_data \
- $(COMSRC)/hal/hw_ctrl \
- $(COMSRC)/hal/security \
- $(COMSRC)/hal/security/CCX \
- $(COMSRC)/hal/security/Privacy \
- $(COMSRC)/hal/security/Privacy/Enc/Ckip \
- $(COMSRC)/hal/security/Privacy/Enc/KP \
- $(COMSRC)/hal/security/Privacy/Enc/KP/Ckip \
- $(COMSRC)/hal/security/Privacy/ICV \
- $(COMSRC)/hal/security/Privacy/IV \
- $(COMSRC)/hal/security/Privacy/IV/WEP \
- $(COMSRC)/hal/security/Privacy/MIC \
- $(COMSRC)/hal/security/Privacy/MIC/Michael \
- $(COMSRC)/hal/security/Privacy/MIC/MMH \
- $(COMSRC)/hal/security/Privacy/Seq \
- $(COMSRC)/hal/security/Privacy/Seq/CCX \
- $(COMSRC)/hal/Export_Inc \
- $(COMSRC)/BusAccess/Shm_Common \
- $(COMSRC)/BusAccess/Export_Inc \
- $(COMSRC)/BusAccess/Shm_Slave \
- $(COMSRC)/core/inc \
- $(COMSRC)/core/ExpInc \
- $(COMSRC)/core/data_ctrl/Tx \
- $(COMSRC)/core/data_ctrl/Ctrl \
- $(COMSRC)/core/data_ctrl/Ctrl/TrafficMonitor \
- $(COMSRC)/core/data_ctrl/Ctrl/4X \
- $(COMSRC)/core/data_ctrl/Rx \
- $(COMSRC)/core/EvHandler \
- $(COMSRC)/core/sme/Inc \
- $(COMSRC)/core/sme/smeSm/ \
- $(COMSRC)/core/sme/siteMgr \
- $(COMSRC)/core/sme/configMgr \
- $(COMSRC)/core/sme/conn \
- $(COMSRC)/core/sme/HealthMonitor \
- $(COMSRC)/core/srv/inc \
- $(COMSRC)/core/srv/scanSrv \
- $(COMSRC)/core/srv/scr \
- $(COMSRC)/core/rsn \
- $(COMSRC)/core/rsn/mainKeysSm \
- $(COMSRC)/core/rsn/mainKeysSm/keyDerive \
- $(COMSRC)/core/rsn/adm_ctrl/WPA \
- $(COMSRC)/core/rsn/adm_ctrl/WPA2 \
- $(COMSRC)/core/rsn/adm_ctrl/WEP/CCX \
- $(COMSRC)/core/rsn/inc \
- $(COMSRC)/core/rsn/algorithms \
- $(COMSRC)/core/mlme \
- $(COMSRC)/core/mlme/Assoc \
- $(COMSRC)/core/mlme/Auth/open \
- $(COMSRC)/core/mlme/Auth/shared \
- $(COMSRC)/Management/QOS/Inc/ \
- $(COMSRC)/Management/CCX/Inc/ \
- $(COMSRC)/Management/Roaming/Inc/ \
- $(COMSRC)/core/NetworkCtrl/inc \
- $(COMSRC)/Management/AirLink/Measurement \
- $(COMSRC)/Management/AirLink/Measurement/CCX \
- $(COMSRC)/Management/AirLink/Measurement/dot11h \
- $(COMSRC)/Management/AirLink/inc \
- $(COMSRC)/Management/scan/inc \
- $(COMSRC)/Management/scan/scanCncn \
- $(COMSRC)/core/NetworkCtrl/RegulatoryDomain \
- $(COMSRC)/core/NetworkCtrl/RegulatoryDomain/CCX \
- $(COMSRC)/Management/PowerMgr/ \
- $(COMSRC)/core/NetworkCtrl/QOS \
- $(COMSRC)/Application/inc \
- $(COMSRC)/Application/\ExpInc \
- $(COMSRC)/Application/ScanMngr \
- $(COMSRC)/Management/apConn \
- $(COMSRC)/core/currBss \
- $(COMSRC)/Management/scan/inc \
- $(CUDK_ROOT)/Inc \
- $(OS_ROOT)/common/inc \
- $(OS_ROOT)/linux/inc \
- $(OS_ROOT)/linux/src \
- $(COMSRC)/core/EvHandler \
- $(CUDK_ROOT)/IPC/Linux \
- $(CUDK_ROOT)/UtilityAdapter \
- external/openssl/include \
- external/wpa_supplicant
-
-L_CFLAGS += -DCONFIG_DRIVER_CUSTOM -DHOST_COMPILE
-ifeq ($(HAVE_CUSTOM_WIFI_DRIVER_0),true)
-L_CFLAGS += -DSTA_DK_VER_5_0_0_94
-endif
-OBJS = driver_ti.c
-
-ifdef CONFIG_NO_STDOUT_DEBUG
-L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
-endif
-
-ifdef CONFIG_DEBUG_FILE
-L_CFLAGS += -DCONFIG_DEBUG_FILE
-endif
-
-ifdef CONFIG_IEEE8021X_EAPOL
-L_CFLAGS += -DIEEE8021X_EAPOL
-endif
-
-ifneq ($(TARGET_SIMULATOR),true)
-ifeq ($(WPA_BUILD_SUPPLICANT_LIB),true)
-
-########################
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libCustomWifi
-LOCAL_STATIC_LIBRARIES := libWifiApi
-LOCAL_SHARED_LIBRARIES := libc
-LOCAL_CFLAGS := $(L_CFLAGS)
-LOCAL_SRC_FILES := $(OBJS)
-LOCAL_C_INCLUDES := $(INCLUDES)
-include $(BUILD_STATIC_LIBRARY)
-
-########################
-
-endif # ifeq ($(WPA_BUILD_SUPPLICANT_LIB),true)
-endif # ifneq ($(TARGET_SIMULATOR),true)
+++ /dev/null
-/*
- * WPA Supplicant - driver interaction with TI station
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- */
-
-/* Copyright © Texas Instruments Incorporated (Oct 2005)
- * THIS CODE/PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
- * EITHER EXPRESS OR IMPLIED, INCLUDED BUT NOT LIMITED TO , THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * This program has been modified from its original operation by Texas
- * Instruments Incorporated. These changes are covered under version 2
- * of the GNU General Public License, dated June 1991.
- *
- * Copyright © Google Inc (Feb 2008)
-*/
-/*-------------------------------------------------------------------*/
-#include "includes.h"
-#include <sys/ioctl.h>
-#include <net/route.h>
-#include <net/if.h>
-#include <fcntl.h>
-#include <netpacket/packet.h>
-#include <stddef.h>
-#include "common.h"
-#include "driver.h"
-#include "eloop.h"
-#include "wpa.h"
-#include "wpa_supplicant.h"
-#include "config.h"
-#include "wpa_supplicant_i.h"
-#include "wpa_i.h"
-#include "l2_packet.h"
-#include "wpa_ctrl.h"
-/*----- STA_DK files -----*/
-#include "wspVer.h"
-#include "driver_ti.h"
-#include "scanMngrTypes.h"
-/*-------------------------------------------------------------------*/
-#define TI_DRIVER_MSG_PORT 9000
-#define TI2WPA_STATUS(s) (((s) != OK) ? -1 : 0)
-#define TI_CHECK_DRIVER(f,r) \
- if( !(f) ) { \
- wpa_printf(MSG_ERROR,"TI: Driver not initialized yet...aborting..."); \
- return( r ); \
- }
-/*-------------------------------------------------------------------*/
-/* Lock file pointer - used to access pid-lock-file to prevent two instances of wpa_supplicant */
-#ifdef CONFIG_TI_LOCKFILE
-static int lfp;
-#endif
-/*-------------------------------------------------------------------*/
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_event_receive
-Routine Description: driver events callback, called from driver IPC
-Arguments:
- priv - pointer to private data structure
- pData - pointer to event information
-Return Value:
------------------------------------------------------------------------------*/
-void wpa_driver_tista_event_receive( IPC_EV_DATA *pData )
-{
- struct wpa_driver_ti_data *mySuppl;
- struct sockaddr_in echoserver;
- int res, msg_size;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_event_receive called: %d",
- pData->uBufferSize);
-
- mySuppl = pData->EvParams.hUserParam;
- msg_size = (int)(pData->uBufferSize + offsetof(IPC_EV_DATA, uBuffer));
-
- os_memset( &echoserver, 0, sizeof(echoserver) ); /* Clear struct */
- echoserver.sin_family = AF_INET; /* Internet/IP */
- echoserver.sin_addr.s_addr = inet_addr("127.0.0.1"); /* IP address */
- echoserver.sin_port = htons(TI_DRIVER_MSG_PORT); /* server port */
-
- res = sendto(mySuppl->driverEventsSocket, pData, msg_size, 0, (struct sockaddr *)&echoserver, sizeof(echoserver));
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_register_events
-Routine Description: register to driver events
-Arguments:
- ctx - pointer to private data structure
-Return Value: None
------------------------------------------------------------------------------*/
-void wpa_driver_tista_register_events( void *ctx )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)ctx;
- IPC_EVENT_PARAMS pEvent;
- int i;
-
- os_memset( myDrv->hEvents, 0, sizeof(ULONG) * IPC_EVENT_MAX );
- for(i=IPC_EVENT_ASSOCIATED;( i < IPC_EVENT_MAX );i++) {
- /* Register to receive driver events */
- pEvent.uEventType = i;
- pEvent.uDeliveryType = DELIVERY_PUSH;
- pEvent.hUserParam = (TI_HANDLE)myDrv;
- pEvent.pfEventCallback = (TI_EVENT_CALLBACK)wpa_driver_tista_event_receive;
- TI_RegisterEvent( myDrv->hDriver, &pEvent );
- myDrv->hEvents[i] = pEvent.uEventID;
- }
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_unregister_events
-Routine Description: unregister driver events
-Arguments:
- ctx - pointer to private data structure
-Return Value: None
------------------------------------------------------------------------------*/
-void wpa_driver_tista_unregister_events( void *ctx )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)ctx;
- IPC_EVENT_PARAMS pEvent;
- int idx;
-
- for(idx=0;( idx < IPC_EVENT_MAX );idx++) {
- if( myDrv->hEvents[idx] ) {
- pEvent.uEventType = idx;
- pEvent.uEventID = myDrv->hEvents[idx];
- TI_UnRegisterEvent( myDrv->hDriver, &pEvent );
- }
- }
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_get_bssid
-Routine Description: get current BSSID from driver
-Arguments:
- priv - pointer to private data structure
- bssid - pointer to hold bssid
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_get_bssid( void *priv, u8 *bssid )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- OS_802_11_MAC_ADDRESS tiAPMacAddr;
- TI_STATUS retValue;
-
- wpa_printf(MSG_DEBUG, "wpa_driver_tista_get_bssid called");
-
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- /* Get MAC address of current AP */
- if( TI_GetBSSID( myDrv->hDriver, &tiAPMacAddr ) != TI_RESULT_OK )
- return( -1 );
-
- /* Copy BSSID into caller pointer provided in routine parameters */
- os_memcpy( (void *)bssid, (void *)&tiAPMacAddr, MAC_ADDR_LEN );
- wpa_hexdump(MSG_DEBUG, "get_bssid:", bssid, MAC_ADDR_LEN);
- return( 0 );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_get_ssid
-Routine Description: get current SSID
-Arguments:
- priv - pointer to private data structure
- ssid - pointer to hold current bssid
-Return Value: Length of SSID string
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_get_ssid( void *priv, u8 *ssid )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- OS_802_11_SSID myssid;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_get_ssid called");
-
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- /* Get current SSID from driver */
- if( TI_GetCurrentSSID(myDrv->hDriver, &myssid) != TI_RESULT_OK )
- return( -1 );
-
- /* Copy to user supplied pointer */
- os_memcpy( (void *)ssid, (void *)&myssid.Ssid, myssid.SsidLength );
-
- /* Return length of SSID */
- return( myssid.SsidLength );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_set_ssid
-Routine Description: sets current SSID (Associates)
-Arguments:
- priv - pointer to private data structure
- ssid - pointer to ssid
- ssid_len - length of ssid
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_set_ssid( void *priv, const u8 *ssid, size_t ssid_len )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- char ssidBuf[MAX_SSID_LEN];
- int ret;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_set_ssid called: %s", ssid);
-
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- /* Copy user supplied SSID into local buffer */
- os_memset( ssidBuf, 0, MAX_SSID_LEN );
- os_memcpy( ssidBuf, ssid, ssid_len );
-
- /* Set local SSID buffer to driver - triggering connection process in driver */
- wpa_printf(MSG_DEBUG,"Associate: SSID = %s", ssidBuf); /* Dm: */
-#ifdef STA_DK_VER_5_0_0_94
- ret = (int)TI_SetSSID( myDrv->hDriver, (char *)ssidBuf );
-#else
- ret = (int)TI_SetSSID( myDrv->hDriver, (u8 *)ssidBuf );
-#endif
- return( TI2WPA_STATUS(ret) );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_set_wpa
-Routine Description: enable/disable WPA support in driver - not implemented since not supported in driver. also obselete for wpa-suppl core
-Arguments:
- priv - pointer to private data structure
- enabled - enable/disable flag
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_set_wpa(void *priv, int enabled)
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_set_wpa called: %d",enabled);
- return( 0 );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_set_proto
-Routine Description: set authentication protocol (WPA/WPA2(RSN))
-Arguments:
- priv - pointer to private data structure
- proto - authentication suite
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_set_proto( void *priv, int proto )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_set_proto called: %d", proto);
- myDrv->proto = proto;
-
- return( 0 );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_set_wpa_options
-Routine Description: set wpa_options
-Arguments:
- priv - pointer to private data structure
- wpa_options - WPA options (0 - disable, 3 - enable)
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_set_wpa_options( void *priv, int key_mgmt_suite )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- UINT32 wpa_opt = WPA_OPTIONS_DISABLE;
- int ret;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_set_wpa_options called: %d", key_mgmt_suite);
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- myDrv->key_mgmt = key_mgmt_suite;
-
- switch( key_mgmt_suite ) {
- case KEY_MGMT_802_1X: /* Dm: EAP */
- wpa_opt = WPA_OPTIONS_ENABLE; /* wpa_auth = 1; */
- break;
-
- case KEY_MGMT_PSK: /* Dm: PSK */
- wpa_opt = WPA_OPTIONS_ENABLE; /* wpa_auth = 2; */
- break;
-
- case KEY_MGMT_802_1X_NO_WPA: /* Dm: ??? */
- break;
-
- case KEY_MGMT_WPA_NONE: /* Dm: ??? */
- break;
-
- case KEY_MGMT_NONE:
- default:
- wpa_opt = WPA_OPTIONS_DISABLE; /* wpa_auth = 255; */
- break;
- }
-
- /* Set WPA Options */
- ret = TI_SetWpaOptions( myDrv->hDriver, wpa_opt );
- return( TI2WPA_STATUS(ret) );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_set_encryption
-Routine Description: set authentication protocol (WPA/WPA2(RSN))
-Arguments:
- priv - pointer to private data structure
- proto - authentication suite
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_set_encryption( void *priv, int encryption )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- int ret = -1;
- OS_802_11_ENCRYPTION_TYPES wpa_cipher = OS_ENCRYPTION_TYPE_NONE;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_set_encryption called: %d",encryption);
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- myDrv->encryption = encryption;
- switch( encryption ) {
- case CIPHER_WEP40:
- case CIPHER_WEP104:
- wpa_printf(MSG_DEBUG, "encryption: OS_ENCRYPTION_TYPE_WEP");
- wpa_cipher = OS_ENCRYPTION_TYPE_WEP;
- break;
-
- case CIPHER_TKIP:
- wpa_printf(MSG_DEBUG, "encryption: OS_ENCRYPTION_TYPE_TKIP");
- wpa_cipher = OS_ENCRYPTION_TYPE_TKIP;
- break;
-
- case CIPHER_CCMP:
- wpa_printf(MSG_DEBUG, "encryption: OS_ENCRYPTION_TYPE_AES");
- wpa_cipher = OS_ENCRYPTION_TYPE_AES;
- break;
-
- case CIPHER_NONE:
- default:
- wpa_printf(MSG_DEBUG, "encryption: OS_ENCRYPTION_TYPE_NONE");
- wpa_cipher = OS_ENCRYPTION_TYPE_NONE;
- break;
- }
- ret = TI_SetEncryptionType( myDrv->hDriver, wpa_cipher );
- return( TI2WPA_STATUS(ret) );
-}
-
-/*---------------------------------------------------------------------------*/
-void wpa_driver_tista_print_auth_mode( OS_802_11_AUTHENTICATION_MODE myAuth )
-{
- char *mode_name = NULL;
-
- switch( myAuth ) {
- case os802_11AuthModeOpen:
- mode_name = "os802_11AuthModeOpen";
- break;
- case os802_11AuthModeShared:
- mode_name = "os802_11AuthModeShared";
- break;
- case os802_11AuthModeAutoSwitch:
- mode_name = "os802_11AuthModeAutoSwitch";
- break;
- case os802_11AuthModeWPA:
- mode_name = "os802_11AuthModeWPA";
- break;
- case os802_11AuthModeWPAPSK:
- mode_name = "os802_11AuthModeWPAPSK";
- break;
- case os802_11AuthModeWPANone:
- mode_name = "os802_11AuthModeWPANone";
- break;
- case os802_11AuthModeWPA2:
- mode_name = "os802_11AuthModeWPA2";
- break;
- case os802_11AuthModeWPA2PSK:
- mode_name = "os802_11AuthModeWPA2PSK";
- break;
- case os802_11AuthModeMax:
- default:
- mode_name = "Unknown";
- break;
- }
- wpa_printf(MSG_DEBUG, "Selected AuthMode: %s", mode_name);
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_set_auth_mode
-Routine Description:
-Arguments:
- priv - pointer to private data structure
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_set_auth_mode( void *priv )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- OS_802_11_AUTHENTICATION_MODE myAuth = os802_11AuthModeAutoSwitch;
- int ret;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_set_auth_mode called");
-
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- wpa_driver_tista_set_proto( priv, ((struct wpa_supplicant *)myDrv->hWpaSupplicant)->wpa->proto );
- wpa_printf(MSG_DEBUG, "proto: %d", myDrv->proto); /* should be set BEFORE */
- wpa_printf(MSG_DEBUG, "auth_alg: %d",myDrv->auth_alg);
-
- if( myDrv->auth_alg == AUTH_ALG_OPEN_SYSTEM ) {
- switch( myDrv->key_mgmt ) {
- case KEY_MGMT_802_1X:
- if( myDrv->proto & WPA_PROTO_WPA ) {
- myAuth = os802_11AuthModeWPA;
- }
- else if( myDrv->proto & WPA_PROTO_RSN ) {
- myAuth = os802_11AuthModeWPA2;
- }
- break;
- case KEY_MGMT_PSK:
- if( myDrv->proto & WPA_PROTO_WPA ) {
- myAuth = os802_11AuthModeWPAPSK;
- }
- else if( myDrv->proto & WPA_PROTO_RSN ) {
- myAuth = os802_11AuthModeWPA2PSK;
- }
- break;
- case KEY_MGMT_802_1X_NO_WPA:
- case KEY_MGMT_WPA_NONE:
- myAuth = os802_11AuthModeWPANone;
- break;
- case KEY_MGMT_NONE:
- default:
- myAuth = os802_11AuthModeOpen;
- break;
- }
- }
- else if( myDrv->auth_alg == AUTH_ALG_SHARED_KEY ) {
- myAuth = os802_11AuthModeShared;
- }
- else if( myDrv->auth_alg == AUTH_ALG_LEAP ) { /* Dm: ??? */
- myAuth = os802_11AuthModeWPA;
- }
- wpa_driver_tista_print_auth_mode( myAuth );
- ret = TI_SetAuthenticationMode( myDrv->hDriver, myAuth );
- return( TI2WPA_STATUS(ret) );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_del_key
-Routine Description: remove key from driver
-Arguments:
- priv - pointer to private data structure
- key_idx - key index
- addr - key address (unicast/broadcast)
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_del_key(void *priv, int key_idx,
- const unsigned char *addr)
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- OS_802_11_REMOVE_KEY myKey;
- int ret;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_del_key called");
- wpa_printf(MSG_DEBUG,"key_idx = %d, addr = " TIMACSTR, key_idx, MAC2STR(addr));
-
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- /* copy parameters (MAC of key to remove, etc) to local structure */
- myKey.Length = sizeof(OS_802_11_REMOVE_KEY);
- os_memcpy(&myKey.BSSID,addr,MAC_ADDR_LEN);
- myKey.KeyIndex = key_idx;
-
- /* Call Utility adapter to remove the key */
- ret = TI_RemoveKey( myDrv->hDriver, &myKey );
- return( TI2WPA_STATUS(ret) );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_set_key
-Routine Description: set key in driver
-Arguments:
- priv - pointer to private data structure
- alg - type of key
- addr - key address (unicast/broadcast)
- key_idx - key index
- set_tx - use key for immidiate tx
- seq - sequence counter (for replay detection)
- seq_len - sequence counter buffer len
- key - key content
- key_len - length of key (32 for TKIP, 16 for AES)
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_set_key(void *priv, wpa_alg alg,
- const unsigned char *addr, int key_idx, int set_tx,
- const u8 *seq, size_t seq_len,
- const u8 *key, size_t key_len)
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- OS_802_11_KEY myKey;
- OS_802_11_WEP myWepKey;
- UINT8 temp[TKIP_KEY_LENGTH];
- int ret = -1;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_set_key called");
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- wpa_printf(MSG_DEBUG, "add_key (addr): " MACSTR, MAC2STR(addr));
- wpa_printf(MSG_DEBUG, "add_key (key_idx): %d", key_idx);
- wpa_printf(MSG_DEBUG, "add_key (alg): %d", alg);
- wpa_printf(MSG_DEBUG, "add_key (set_tx): %d", set_tx);
- wpa_hexdump(MSG_DEBUG, "add_key (seq):", seq, seq_len);
- wpa_hexdump(MSG_DEBUG, "add_key (key):", key, key_len);
-
- switch( key_len ) {
- case TKIP_KEY_LENGTH: /* 32 */
- case AES_KEY_LENGTH: /* 16 */
- /* Set key index */
- myKey.KeyIndex = key_idx;
- /* Set key length and content */
- myKey.KeyLength = key_len;
- /* Set structure size */
- myKey.Length = sizeof(OS_802_11_KEY);
- /* set key MAC address - FF:FF:FF:FF:FF:FF for broadcast, other for unicast */
- os_memcpy( &myKey.BSSID, addr, MAC_ADDR_LEN );
-
- if( seq_len ) {
- /* Set key RSC */
- os_memcpy( &myKey.KeyRSC, seq, seq_len );
- myKey.KeyIndex |= TIWLAN_KEY_FLAGS_SET_KEY_RSC;
- }
-
- if( set_tx ) {
- myKey.KeyIndex |= TIWLAN_KEY_FLAGS_TRANSMIT;
- }
-
- if( myKey.BSSID[0] != 0xFF ) {
- myKey.KeyIndex |= TIWLAN_KEY_FLAGS_PAIRWISE;
- }
-
- os_memcpy( &temp, key, AES_KEY_LENGTH );
- if( key_len == TKIP_KEY_LENGTH ) {
- /* need to switch RX and TX MIC set with key (to match driver API) */
- os_memcpy( (UINT8*)(((UINT8*)&temp)+24), (UINT8*)(((UINT8*)key)+16), 8 );
- os_memcpy( (UINT8*)(((UINT8*)&temp)+16), (UINT8*)(((UINT8*)key)+24), 8 );
- }
- os_memcpy( &myKey.KeyMaterial, &temp, key_len );
- ret = TI_AddKey( myDrv->hDriver, &myKey );
- break;
-
- case WEP_KEY_LENGTH_40: /* 5 */
- case WEP_KEY_LENGTH_104: /* 13 */
- if( key_len != 0 ) {
- /* Set key index */
- myWepKey.KeyIndex = key_idx;
- /* Set key length and content */
- myWepKey.KeyLength = key_len;
- /* Set structure size */
- myWepKey.Length = sizeof(OS_802_11_WEP);
-
- if( set_tx ) {
- myWepKey.KeyIndex |= TIWLAN_KEY_FLAGS_TRANSMIT;
- wpa_printf(MSG_DEBUG, "setting this key to be the index: 0x%x", myWepKey.KeyIndex);
- }
-
- os_memcpy( &myWepKey.KeyMaterial, key, key_len );
- wpa_printf(MSG_DEBUG, "Adding WEP key index: 0x%x", key_idx);
- ret = TI_AddWEPKey( myDrv->hDriver, &myWepKey );
- }
- else {
- wpa_printf(MSG_DEBUG, "Removing WEP key index: 0x%x", key_idx);
- ret = TI_RemoveWEPKey( myDrv->hDriver, key_idx );
- }
- break;
-
- default:
- wpa_printf(MSG_ERROR,"Set_key: Wrong Key\n");
- break;
- }
- return( TI2WPA_STATUS(ret) );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_set_countermeasures
-Routine Description: start/stop countermeasures (drop packets due to replay attack detection)
-Arguments:
- priv - pointer to private data structure
- enabled - enable/disable flag
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_set_countermeasures(void *priv, int enabled)
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_set_countermeasures called: %d", enabled);
- return( 0 );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_set_drop_unencrypted
-Routine Description: enable/disable EAPOL-only tx by driver
-Arguments:
- priv - pointer to private data structure
- enabled - enable/disable flag
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_set_drop_unencrypted(void *priv, int enabled)
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
-
- wpa_printf(MSG_DEBUG,"TI: wpa_driver_tista_set_drop_unencrypted called: %d - not implemented", enabled);
- return( 0 );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_deauthenticate
-Routine Description: send deauthentication packet
-Arguments:
- priv - pointer to private data structure
- addr - address to send deauth packet to
- reason_code - reason code supplied in deauth packet
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_deauthenticate(void *priv, const UINT8 *addr, int reason_code)
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- int ret;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_deauthenticate called");
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- /* Block any pending disassoc event until successfully connected */
- if( myDrv->block_disassoc_events == NO_BLOCK )
- myDrv->block_disassoc_events = NO_BLOCK_DISASSOC_IN_PROGRESS;
-
- ret = TI_Disassociate( myDrv->hDriver );
- return( TI2WPA_STATUS(ret) );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_disassociate
-Routine Description: disassociate from AP
-Arguments:
- priv - pointer to private data structure
- addr - address to send deauth packet to
- reason_code - reason code supplied in deauth packet
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_disassociate(void *priv, const UINT8 *addr, int reason_code)
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- int ret;
-
- wpa_printf(MSG_DEBUG,"TI: wpa_driver_tista_disassociate called");
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- /* Block any pending disassoc event until successfully connected */
- if( myDrv->block_disassoc_events == NO_BLOCK )
- myDrv->block_disassoc_events = NO_BLOCK_DISASSOC_IN_PROGRESS;
-
- ret = TI_Disassociate( myDrv->hDriver );
- return( TI2WPA_STATUS(ret) );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_associate
-Routine Description: associate with AP
-Arguments:
- priv - pointer to private data structure
- params - struct wpa_driver_associate_params (ssid, bssid, etc)
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_associate(void *priv, struct wpa_driver_associate_params *params)
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- OS_802_11_MAC_ADDRESS bssid = { 0xff,0xff,0xff,0xff,0xff,0xff };
- int wpa_opt, wpa_cipher, ret;
-
- wpa_printf(MSG_DEBUG,"TI: wpa_driver_tista_associate called");
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- if( myDrv->block_disassoc_events == NO_BLOCK_DISASSOC_IN_PROGRESS )
- myDrv->block_disassoc_events = BLOCK_DISASSOC;
-
- if( params->bssid ) {
- wpa_printf(MSG_DEBUG, "TI: BSSID=" MACSTR, MAC2STR(params->bssid));
- /* if there is bssid -> set it */
- if( os_memcmp( params->bssid, "\x00\x00\x00\x00\x00\x00", ETH_ALEN ) != 0 ) {
- os_memcpy( &bssid, params->bssid, ETH_ALEN );
- TI_SetBSSID( myDrv->hDriver, &bssid );
- }
- }
- else {
- /* else set it to {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} */
- TI_SetBSSID( myDrv->hDriver, &bssid );
- }
-
- /* Set driver network mode (Adhoc/Infrastructure) according to supplied parameters */
- if( params->mode == IEEE80211_MODE_INFRA ) {
- wpa_printf(MSG_DEBUG,"TI: setting os802_11Infrastructure mode...");
- TI_SetBSSType( myDrv->hDriver, os802_11Infrastructure );
- }
- else if( params->mode == IEEE80211_MODE_IBSS ) {
- wpa_printf(MSG_DEBUG,"TI: setting os802_11IBSS mode...");
- TI_SetBSSType( myDrv->hDriver, os802_11IBSS );
- }
- else {
- wpa_printf(MSG_ERROR,"TI: Associate: invalid mode specified...");
- }
-
- wpa_driver_tista_set_wpa_options( priv, params->key_mgmt_suite );
- wpa_driver_tista_set_auth_mode( priv );
- wpa_driver_tista_set_encryption( priv, params->pairwise_suite );
-
- /* And trigger connection/association process in driver by setting SSID */
- ret = wpa_driver_tista_set_ssid( priv, params->ssid, params->ssid_len);
- return( ret );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: ti_init_scan_params
-Routine Description: int scan parameters before scan command
-Arguments:
- pScanParams - pointer to scan paramters structure
- pScanPolicy - pointer to scan policy structure
- scanType - scan type
- noOfChan - number of allowed channels
-Return Value: None
------------------------------------------------------------------------------*/
-static void ti_init_scan_params( scan_Params_t *pScanParams, scan_Policy_t *pScanPolicy,
- int scanType, int noOfChan )
-{
- int i, j;
-
- if( noOfChan > MAX_NUMBER_OF_CHANNELS_PER_SCAN )
- noOfChan = MAX_NUMBER_OF_CHANNELS_PER_SCAN;
- /* init application scan default params */
- pScanParams->desiredSsid.len = 0;
- pScanParams->scanType = scanType;
- pScanParams->band = RADIO_BAND_2_4_GHZ;
- pScanParams->probeReqNumber = 3;
- pScanParams->probeRequestRate = DRV_RATE_MASK_2_BARKER;
- pScanParams->numOfChannels = (UINT8)noOfChan;
- for(i=0;( i < noOfChan );i++) {
- for(j=0;( j < MAC_ADDR_LEN );j++) {
- pScanParams->channelEntry[ i ].normalChannelEntry.bssId.addr[ j ] = 0xff;
- }
- pScanParams->channelEntry[ i ].normalChannelEntry.earlyTerminationEvent = SCAN_ET_COND_DISABLE;
- pScanParams->channelEntry[ i ].normalChannelEntry.ETMaxNumOfAPframes = 0;
- pScanParams->channelEntry[ i ].normalChannelEntry.maxChannelDwellTime = 60000;
- pScanParams->channelEntry[ i ].normalChannelEntry.minChannelDwellTime = 30000;
-#ifdef STA_DK_VER_5_0_0_94
- pScanParams->channelEntry[ i ].normalChannelEntry.txPowerLevel = 1;
-#else
- pScanParams->channelEntry[ i ].normalChannelEntry.txPowerDbm = MAX_TX_POWER;
-#endif
- pScanParams->channelEntry[ i ].normalChannelEntry.channel = i + 1;
- }
-
- /* init default scan policy */
- pScanPolicy->normalScanInterval = 10000;
- pScanPolicy->deterioratingScanInterval = 5000;
- pScanPolicy->maxTrackFailures = 3;
- pScanPolicy->BSSListSize = 4;
- pScanPolicy->BSSNumberToStartDiscovery = 1;
- pScanPolicy->numOfBands = 1;
- pScanPolicy->bandScanPolicy[ 0 ].band = RADIO_BAND_2_4_GHZ;
- pScanPolicy->bandScanPolicy[ 0 ].rxRSSIThreshold = -80;
- pScanPolicy->bandScanPolicy[ 0 ].numOfChannles = (UINT8)noOfChan;
- pScanPolicy->bandScanPolicy[ 0 ].numOfChannlesForDiscovery = 3;
- for(i=0;( i < noOfChan );i++) {
- pScanPolicy->bandScanPolicy[ 0 ].channelList[ i ] = i + 1;
- }
- pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.scanType = scanType;
- pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.earlyTerminationEvent = SCAN_ET_COND_DISABLE;
- pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.ETMaxNumberOfApFrames = 0;
- pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.maxChannelDwellTime = 30000;
- pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.minChannelDwellTime = 15000;
- pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.probReqParams.bitrate = DRV_RATE_MASK_1_BARKER;
- pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.probReqParams.numOfProbeReqs = 3;
-#ifdef STA_DK_VER_5_0_0_94
- pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.probReqParams.txLevel = 1;
-#else
- pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.probReqParams.txPowerDbm = MAX_TX_POWER;
-#endif
- pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.scanType = scanType;
- pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.earlyTerminationEvent = SCAN_ET_COND_DISABLE;
- pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.ETMaxNumberOfApFrames = 0;
- pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.maxChannelDwellTime = 30000;
- pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.minChannelDwellTime = 15000;
- pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.probReqParams.bitrate = DRV_RATE_MASK_2_BARKER;
- pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.probReqParams.numOfProbeReqs = 3;
-#ifdef STA_DK_VER_5_0_0_94
- pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.probReqParams.txLevel = 1;
-#else
- pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.probReqParams.txPowerDbm = MAX_TX_POWER;
-#endif
- pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.scanType = scanType;
- pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.earlyTerminationEvent = SCAN_ET_COND_DISABLE;
- pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.ETMaxNumberOfApFrames = 0;
- pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.maxChannelDwellTime = 30000;
- pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.minChannelDwellTime = 15000;
- pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.probReqParams.bitrate = DRV_RATE_MASK_5_5_CCK;
- pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.probReqParams.numOfProbeReqs = 3;
-#ifdef STA_DK_VER_5_0_0_94
- pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.probReqParams.txLevel = 1;
-#else
- pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.probReqParams.txPowerDbm = MAX_TX_POWER;
-#endif
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_scan
-Routine Description: request scan from driver
-Arguments:
- priv - pointer to private data structure
- ssid - ssid buffer
- ssid_len - length of ssid
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_scan( void *priv, const UINT8 *ssid, size_t ssid_len )
-{
- scan_Params_t scanParams;
- scan_Policy_t scanPolicy;
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- int ret;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_scan called");
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- ti_init_scan_params( &scanParams, &scanPolicy, myDrv->scan_type,
- myDrv->scan_channels );
- if (ssid && ssid_len > 0 && ssid_len <= sizeof(scanParams.desiredSsid.ssidString)) {
- os_memcpy(scanParams.desiredSsid.ssidString, ssid, ssid_len);
- scanParams.desiredSsid.len = ssid_len;
- }
- TI_SetScanPolicy( myDrv->hDriver, (UINT8 *)&scanPolicy, sizeof(scan_Policy_t) );
- ret = TI_StartScan( myDrv->hDriver, (scan_Params_t *)&scanParams );
- return( TI2WPA_STATUS(ret) );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_set_auth_alg
-Routine Description: set authentication in driver
-Arguments:
- priv - pointer to private data structure
- auth_alg - Open/Shared/LEAP
-Return Value: 0 on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_set_auth_alg( void *priv, int auth_alg )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_set_auth_alg called: %d", auth_alg);
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
- myDrv->auth_alg = auth_alg;
- return( 0 );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_get_bssid_info
-Routine Description: retrieve bssid full info
-Arguments:
- hDriver - pointer to driver structure
-Return Value: pointer to BSSID structure or NULL
------------------------------------------------------------------------------*/
-static OS_802_11_BSSID_EX *wpa_driver_tista_get_bssid_info( TI_HANDLE hDriver )
-{
- OS_802_11_BSSID_EX mySelectedBssidInfo;
- OS_802_11_BSSID_LIST_EX *bssid_list;
- OS_802_11_BSSID_EX *pBssid, *nBssid = NULL;
- int i, number_items, res;
-
- res = TI_GetSelectedBSSIDInfo( hDriver, &mySelectedBssidInfo );
- if( res != TI_RESULT_OK )
- return( nBssid );
-
- if( TI_GetBSSIDList( hDriver, &bssid_list ) || !bssid_list )
- return( nBssid );
-
- pBssid = &bssid_list->Bssid[0];
- number_items = (int)(bssid_list->NumberOfItems);
- for(i=0;( i < number_items );i++) {
- if( os_memcmp( mySelectedBssidInfo.Ssid.Ssid, pBssid->Ssid.Ssid, pBssid->Ssid.SsidLength ) == 0 ) {
- nBssid = (OS_802_11_BSSID_EX *)os_malloc( pBssid->Length );
- if( nBssid != NULL )
- os_memcpy( nBssid, pBssid, pBssid->Length );
- break;
- }
- pBssid = (OS_802_11_BSSID_EX *)(((char *)pBssid) + pBssid->Length);
- }
- os_free( bssid_list );
- return( nBssid );
-}
-
-/*-----------------------------------------------------------------------------
-Compare function for sorting scan results. Return >0 if @b is considered better.
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_scan_result_compare(const void *a, const void *b)
-{
- const struct wpa_scan_result *wa = a;
- const struct wpa_scan_result *wb = b;
-
- return( wb->level - wa->level );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_get_scan_results
-Routine Description: retrieve driver scan results
-Arguments:
- priv - pointer to private data structure
- results - pointer to buffer
- max_size - maximum size of results buffer
-Return Value: number of SSID on success, -1 on failure
------------------------------------------------------------------------------*/
-static int wpa_driver_tista_get_scan_results( void *priv,
- struct wpa_scan_result *results,
- size_t max_size )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- OS_802_11_BSSID_LIST_EX *bssid_list;
- OS_802_11_BSSID_EX *pBssid;
- OS_802_11_FIXED_IEs *pFixedIes;
- OS_802_11_VARIABLE_IEs *pVarIes;
- unsigned int number_items, i, index;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_get_scan_results called");
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- if( TI_GetBSSIDList(myDrv->hDriver, &bssid_list) || !bssid_list )
- return( -1 );
-
- pBssid = &bssid_list->Bssid[0];
- number_items = (int)(bssid_list->NumberOfItems);
-
- wpa_printf(MSG_MSGDUMP, "Received %d bytes of scan results (%d BSSes)",
- number_items * sizeof(OS_802_11_BSSID_EX), number_items);
-
- os_memset( results, 0, max_size * sizeof(struct wpa_scan_result) );
- number_items = MIN( number_items, max_size );
-
- for(index=0; index < number_items; index++) {
- os_memcpy( results[index].bssid, &pBssid->MacAddress, ETH_ALEN );
- os_memcpy( results[index].ssid, pBssid->Ssid.Ssid, pBssid->Ssid.SsidLength );
- results[index].ssid_len = pBssid->Ssid.SsidLength;
-#ifdef STA_DK_VER_5_0_0_94
- results[index].freq = pBssid->Configuration.channel / 1000;
- results[index].caps = pBssid->Capabilities;
-#else
- results[index].freq = pBssid->Configuration.Union.channel / 1000;
- results[index].caps = pBssid->Union.Capabilities;
-#endif
- results[index].level = pBssid->Rssi;
- results[index].maxrate = 0; /* In units of 0.5 Mb/s */
- for (i = 0; i < sizeof(pBssid->SupportedRates); i++) {
- if (pBssid->SupportedRates[i] > (unsigned)results[index].maxrate) {
- results[index].maxrate = pBssid->SupportedRates[i];
- }
- }
- wpa_printf(MSG_DEBUG,"TI: Net: %s Cap: 0x%04x Priv: 0x%x NetType: 0x%x InfraMode: 0x%x IELen: %d",
-#ifdef STA_DK_VER_5_0_0_94
- pBssid->Ssid.Ssid, pBssid->Capabilities, pBssid->Privacy, pBssid->NetworkTypeInUse,
-#else
- pBssid->Ssid.Ssid, pBssid->Union.Capabilities, pBssid->Privacy, pBssid->NetworkTypeInUse,
-#endif
- pBssid->InfrastructureMode, pBssid->IELength );
-
- /* Fixed IEs from site entry - same Capabilities */
- pFixedIes = (OS_802_11_FIXED_IEs *)&pBssid->IEs[0];
- wpa_printf(MSG_DEBUG,"TI: Fixed IEs: Beacon: 0x%x Cap: 0x%x", pFixedIes->BeaconInterval, pFixedIes->Capabilities);
- for(i=sizeof(OS_802_11_FIXED_IEs); i < pBssid->IELength;) {
- pVarIes = (OS_802_11_VARIABLE_IEs *)&pBssid->IEs[i];
- wpa_printf(MSG_DEBUG,"TI: Variable IEs: ID: 0x%x Len: %d", pVarIes->ElementID, pVarIes->Length);
- wpa_hexdump(MSG_DEBUG,"TI: oui:", pVarIes->data, pVarIes->Length);
- switch( pVarIes->ElementID ) {
- case GENERIC_INFO_ELEM: /* 0xdd */
- if( (pVarIes->Length > 3) && (os_memcmp(pVarIes->data, WPA_OUI, 4) == 0) ) {
- results[index].wpa_ie_len = MIN((pVarIes->Length + 2), SSID_MAX_WPA_IE_LEN);
- os_memcpy( results[index].wpa_ie, pVarIes, results[index].wpa_ie_len );
- }
- break;
-
- case RSN_INFO_ELEM: /* 0x30 */
- results[index].rsn_ie_len = MIN((pVarIes->Length + 2), SSID_MAX_WPA_IE_LEN);
- os_memcpy( results[index].rsn_ie, pVarIes, results[index].rsn_ie_len );
- break;
- }
- i += (pVarIes->Length + (2 * sizeof(tiUINT8)));
- }
- pBssid = (OS_802_11_BSSID_EX *)(((u8 *)pBssid) + pBssid->Length);
- }
-
- qsort(results, number_items, sizeof(struct wpa_scan_result),
- wpa_driver_tista_scan_result_compare);
-
- os_free( bssid_list );
- return( number_items );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_get_scan_results
-Routine Description: retrieve driver scan results
-Arguments:
- sock - socket
- priv - pointer to private data structure
- sock_ctx - pointer to other private data
-Return Value: None
------------------------------------------------------------------------------*/
-static void wpa_driver_tista_receive_driver_event( int sock, void *priv, void *sock_ctx )
-{
- IPC_EV_DATA myBuf;
- UINT8 *buf;
- UINT32 *bufLong;
- union wpa_event_data myEventData;
- struct wpa_driver_ti_data *mySuppl;
- OS_802_11_ASSOCIATION_INFORMATION *pInfo = NULL;
- OS_802_11_AUTHENTICATION_REQUEST *pMediaSpecificBuf;
- OS_802_11_BSSID_EX *pSelectedBssidInfo = NULL;
- OS_802_11_NETWORK_MODE myBssType;
- IPC_EV_DATA *pData = &myBuf;
- int res;
-#ifndef STA_DK_VER_5_0_0_94
- btCoexStatus_t *btCoexStatus;
-#endif
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_receive_driver_event...");
-
- res = recv( sock, &myBuf, sizeof(myBuf), 0 );
- if( res < 0 ) {
- wpa_printf(MSG_ERROR,"l2_packet_receive - recvfrom");
- return;
- }
-
- mySuppl = pData->EvParams.hUserParam;
-
- switch( ((IPC_EVENT_PARAMS*)pData)->uEventType ) {
- case IPC_EVENT_ASSOCIATED:
- /* Associated event is called after successfull ASSOC_RSP packet is received */
- wpa_printf(MSG_INFO,"wpa_supplicant - Associated");
-
- TI_GetBSSType( mySuppl->hDriver, &myBssType );
- wpa_printf(MSG_DEBUG,"myBssType = %d",myBssType);
-
- if( myBssType == os802_11Infrastructure ) {
- /* Get ASSOC_REQ and ASSOC_RSP IE */
- res = TI_GetAssociationInfo( mySuppl->hDriver, &pInfo );
- buf = (UINT8 *)pInfo;
-
- if( buf != NULL ) {
- myEventData.assoc_info.req_ies = buf + pInfo->OffsetRequestIEs;
- myEventData.assoc_info.req_ies_len = pInfo->RequestIELength;
- myEventData.assoc_info.resp_ies = buf + pInfo->OffsetResponseIEs;
- myEventData.assoc_info.resp_ies_len = pInfo->ResponseIELength;
- myEventData.assoc_info.beacon_ies = NULL;
- myEventData.assoc_info.beacon_ies_len = 0;
-
- /* Get AP Beacon IEs - especially WPA/RSN IE */
- pSelectedBssidInfo = wpa_driver_tista_get_bssid_info( mySuppl->hDriver );
- if( pSelectedBssidInfo ) {
- if( pSelectedBssidInfo->IELength && pSelectedBssidInfo->IEs ) { // Dm: Fixed IEs ???
- myEventData.assoc_info.beacon_ies = (UINT8 *)pSelectedBssidInfo->IEs + sizeof(OS_802_11_FIXED_IEs);
- myEventData.assoc_info.beacon_ies_len = pSelectedBssidInfo->IELength - sizeof(OS_802_11_FIXED_IEs);
- }
- }
- wpa_printf(MSG_DEBUG,"myEventData.assoc_info.req_ies = 0x%x",(unsigned)myEventData.assoc_info.req_ies);
- wpa_printf(MSG_DEBUG,"myEventData.assoc_info.req_ies_len = %d",myEventData.assoc_info.req_ies_len);
- wpa_printf(MSG_DEBUG,"myEventData.assoc_info.resp_ies = 0x%x",(unsigned)myEventData.assoc_info.resp_ies);
- wpa_printf(MSG_DEBUG,"myEventData.assoc_info.resp_ies_len = %d",myEventData.assoc_info.resp_ies_len);
- wpa_printf(MSG_DEBUG,"myEventData.assoc_info.beacon_ies = 0x%x",(unsigned)myEventData.assoc_info.beacon_ies);
- wpa_printf(MSG_DEBUG,"myEventData.assoc_info.beacon_ies_len = %d",myEventData.assoc_info.beacon_ies_len);
- wpa_hexdump(MSG_DEBUG, "WPA: beacon_ies", myEventData.assoc_info.beacon_ies, myEventData.assoc_info.beacon_ies_len);
-
- /* First we notify wpa_supplicant and give it all the above IEs */
- wpa_supplicant_event( mySuppl->hWpaSupplicant, EVENT_ASSOCINFO, &myEventData );
-
- /* Since both ASSOC_REQ/RSP and beacon IEs are allocated dynamically by the Utility Adapter - we need to free the buffers */
- os_free( pInfo );
- if( pSelectedBssidInfo ) {
- os_free( pSelectedBssidInfo );
- }
- }
- }
- else {
- myEventData.assoc_info.req_ies = NULL;
- myEventData.assoc_info.req_ies_len = 0;
- myEventData.assoc_info.resp_ies = NULL;
- myEventData.assoc_info.resp_ies_len = 0;
- myEventData.assoc_info.beacon_ies = NULL;
- myEventData.assoc_info.beacon_ies_len = 0;
- wpa_supplicant_event( mySuppl->hWpaSupplicant, EVENT_ASSOCINFO, &myEventData );
- }
- /* We now can notify wpa_supplicant of the association event so it could start key negotiation (if needed) */
- wpa_supplicant_event( mySuppl->hWpaSupplicant, EVENT_ASSOC, NULL );
- /* Allow Disassociation */
- mySuppl->block_disassoc_events = NO_BLOCK;
- break;
-
- case IPC_EVENT_DISASSOCIATED:
- if( mySuppl->block_disassoc_events != BLOCK_DISASSOC ) {
- wpa_printf(MSG_INFO,"wpa_supplicant - Disassociated");
- wpa_supplicant_event( mySuppl->hWpaSupplicant, EVENT_DISASSOC, NULL );
- }
- else {
- wpa_printf(MSG_INFO,"wpa_supplicant - Disassociated (blocked)");
- }
- break;
-
- case IPC_EVENT_SCAN_COMPLETE:
- wpa_printf(MSG_INFO,"wpa_supplicant - IPC_EVENT_SCAN_COMPLETE");
- wpa_supplicant_event( mySuppl->hWpaSupplicant, EVENT_SCAN_RESULTS, NULL );
- break;
-
- case IPC_EVENT_AUTH_SUCC:
- wpa_printf(MSG_INFO,"wpa_supplicant - IPC_EVENT_AUTH_SUCC");
- break;
-
- case IPC_EVENT_EAPOL:
- wpa_printf(MSG_INFO,"wpa_supplicant - EAPOL");
- buf = pData->uBuffer;
- wpa_supplicant_rx_eapol( mySuppl->hWpaSupplicant, (UINT8 *)(buf + MAC_ADDR_LEN),
- (UINT8 *)(buf + ETHERNET_HDR_LEN), (pData->uBufferSize - ETHERNET_HDR_LEN) );
- break;
-
- case IPC_EVENT_MEDIA_SPECIFIC:
- wpa_printf(MSG_INFO,"wpa_supplicant - Media_Specific");
- bufLong = (UINT32 *)pData->uBuffer;
- /* Check for Authentication type messages from driver */
- if( (*bufLong) == os802_11StatusType_Authentication ) {
- pMediaSpecificBuf = (OS_802_11_AUTHENTICATION_REQUEST *)(bufLong + 1);
- wpa_printf(MSG_DEBUG,"wpa_supplicant - Media_Specific - Authentication message detected: %u", pMediaSpecificBuf->Flags);
- /* Check for MIC failure event */
- if( (pMediaSpecificBuf->Flags == OS_802_11_REQUEST_PAIRWISE_ERROR) || (pMediaSpecificBuf->Flags == OS_802_11_REQUEST_GROUP_ERROR)) {
- /* Notify wpa_supplicant of MIC failure */
- myEventData.michael_mic_failure.unicast = 1;
- wpa_supplicant_event( mySuppl->hWpaSupplicant, EVENT_MICHAEL_MIC_FAILURE, &myEventData );
- }
- /* OS_802_11_REQUEST_REAUTH - is handled automatically */
- /* OS_802_11_REQUEST_KEYUPDATE - no event of this type */
- }
- break;
-
- case IPC_EVENT_LINK_SPEED:
- bufLong = (UINT32 *)pData->uBuffer;
- wpa_printf(MSG_INFO,"wpa_supplicant - Link Speed = %u MB/s", ((*bufLong) / 2));
- /* wpa_msg(mySuppl->hWpaSupplicant, MSG_INFO, WPA_EVENT_LINK_SPEED "%u MB/s", ((*bufLong) / 2)); */
- mySuppl->link_speed = (unsigned)((*bufLong) / 2);
- break;
-
- case IPC_EVENT_WPA2_PREAUTHENTICATION:
- wpa_printf(MSG_INFO,"wpa_supplicant - WPA2_PREAUTHENTICATION");
- bufLong = (UINT32 *)pData->uBuffer;
- wpa_printf(MSG_INFO,"Preauth Status Code = %u",*bufLong);
- /* Dm: wpa_supplicant_event( mySuppl->hWpaSupplicant, EVENT_PMKID_CANDIDATE, &data); */
- break;
-
-#ifndef STA_DK_VER_5_0_0_94
- case IPC_EVENT_BT_COEX_MODE:
- btCoexStatus = (btCoexStatus_t *)pData->uBuffer;
- if( (btCoexStatus != NULL) && btCoexStatus->state ) {
- wpa_printf(MSG_INFO,"wpa_supplicant - BT_COEX_MODE (SG is ON, minTxRate = %d)\n", btCoexStatus->minTxRate);
- }
- else {
- wpa_printf(MSG_INFO,"wpa_supplicant - BT_COEX_MODE (SG is OFF)\n");
- }
- break;
-#endif
-
- default:
- wpa_printf(MSG_ERROR,"wpa_supplicant - Unhandled driver event: %d", ((IPC_EVENT_PARAMS*)pData)->uEventType);
- break;
- }
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_init
-Routine Description: init driver interface
-Arguments:
- priv - pointer to private data structure
- ifname - return interface name
-Return Value: pointer to driver structure (to be supplied later by supplicant to wrappers)
------------------------------------------------------------------------------*/
-static void *wpa_driver_tista_init( void *priv, const char *ifname )
-{
- struct wpa_driver_ti_data *myDrv;
- int status;
- UINT32 driverStatus,res;
- struct sockaddr_in echoserver;
- OS_802_11_MAC_ADDRESS myMac;
-#ifdef CONFIG_TI_LOCKFILE
- char str[10];
-#endif
-
- wpa_printf(MSG_DEBUG,"Initializing STA-DK %s interface...",SW_VERSION_STR);
-#ifdef CONFIG_TI_LOCKFILE
- /* Try to open the lock file */
- lfp = open("./.wpa_supplicant_lockfile.pid", (O_RDWR | O_CREAT | O_EXCL), 0640);
- if( lfp < 0 ) {
- wpa_printf(MSG_ERROR,"Cannot open pid-file...Aborting...\n");
- return( NULL );
- }
- /* Try to get a file lock on the pid-file. If another instance is running and already has a lock - we will fail */
-#ifndef ANDROID /* Dm: !!! lockf is not implemented in Android */
- if( lockf(lfp,F_TLOCK,0) < 0 ) {
- wpa_printf(MSG_ERROR,"Another instance of wpa_supplicant is running...Aborting...\n");
- return( NULL );
- }
-#endif
- /* If we got here - it means that no other instance is running - write process id to pid_file */
- sprintf(str, "%d\n", getpid());
- write(lfp,str,os_strlen(str)); /* record pid to lockfile */
-#endif
-
- /* Allocate internal data structure to manage driver */
- myDrv = os_malloc( sizeof(struct wpa_driver_ti_data) );
-
- /* If failed to allocate */
- if( myDrv == NULL ) {
- wpa_printf(MSG_ERROR,"Failed to allocate memory for control structure...Aborting...");
- goto label_init_error_file;
- }
-
- /* Zero memory */
- os_memset( myDrv, 0, sizeof(struct wpa_driver_ti_data) );
-
- /* Initialize Utility Adapter module */
- myDrv->hDriver = TI_AdapterInit( TIWLAN_DRV_NAME );
-
- /* If couldn't initialize - return NULL to indicate error */
- if( myDrv->hDriver == 0 ) {
- wpa_printf(MSG_ERROR,"Error: failed to initialize Utility Adapter interface...");
- goto label_init_error_free;
- }
-
- /* Get WLAN interface mac address through Utility Adapter */
- res = TI_GetCurrentAddress( myDrv->hDriver, &myMac );
-
- if( res == (UINT32)-1 ) {
- wpa_printf(MSG_ERROR,"Error: failed to initialize Utility Adapter interface...");
- goto label_init_error_free;
- }
-
- os_memcpy( &myDrv->own_addr, &myMac, MAC_ADDR_LEN );
-
- wpa_driver_tista_register_events( myDrv );
-
- /* Block disassoc events until connected */
- if( myDrv->block_disassoc_events == NO_BLOCK )
- myDrv->block_disassoc_events = NO_BLOCK_DISASSOC_IN_PROGRESS;
-
- /* Store wpa_supplicant context */
- myDrv->hWpaSupplicant = priv;
-
- myDrv->driverEventsSocket = socket( PF_INET, SOCK_DGRAM, IPPROTO_UDP );
-
- if( myDrv->driverEventsSocket < 0 ) {
- wpa_printf(MSG_ERROR,"Error: failed to create driver events socket...");
- goto label_init_error_free;
- }
-
- os_memset( &echoserver, 0, sizeof(echoserver) ); /* Clear struct */
- echoserver.sin_family = AF_INET; /* Internet/IP */
- echoserver.sin_addr.s_addr = htonl(INADDR_ANY); /* IP address */
- echoserver.sin_port = htons(TI_DRIVER_MSG_PORT); /* server port */
-
- if( bind(myDrv->driverEventsSocket, (struct sockaddr *) &echoserver, sizeof(echoserver)) < 0 ) {
- wpa_printf(MSG_ERROR,"Error: failed to create driver events socket...");
- close(myDrv->driverEventsSocket);
- goto label_init_error_free;
- }
-
- status = eloop_register_read_sock( myDrv->driverEventsSocket, wpa_driver_tista_receive_driver_event, priv, myDrv );
-
- if( status != 0 ) {
- wpa_printf(MSG_ERROR,"Error: failed to register socket handler...");
- }
-
- wpa_printf(MSG_DEBUG,"driver events socket is 0x%x...",myDrv->driverEventsSocket);
-
- /* Signal that driver is not loaded yet */
- myDrv->driver_is_loaded = TRUE;
-
- /* Set default scan type */
- myDrv->scan_type = SCAN_TYPE_NORMAL_ACTIVE;
-
- /* Set default amount of channels */
- myDrv->scan_channels = NUMBER_SCAN_CHANNELS_FCC;
-
- /* Link Speed will be set by the message from the driver */
- myDrv->link_speed = 0;
-
- /* BtCoex mode is read from tiwlan.ini file */
- myDrv->btcoex_mode = 1; /* SG_DISABLE */
-
- /* Return pointer to our driver structure */
- return( myDrv );
-
-label_init_error_free:
- os_free( myDrv );
-label_init_error_file:
-#ifdef CONFIG_TI_LOCKFILE
- /* Close and delete the pid-lock-file */
- close(lfp);
- unlink("./wpa_supplicant_lockfile.pid");
-#endif
- return( NULL );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_unload
-Routine Description: unload driver
-Arguments:
- priv - pointer to private data structure
-Return Value: None
------------------------------------------------------------------------------*/
-static void wpa_driver_tista_unload( void *priv )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
-
- wpa_printf(MSG_INFO,"wpa_driver_tista_unload called");
- /* Unregister driver events */
- wpa_driver_tista_unregister_events( priv );
- /* Close connection socket */
- close(myDrv->driverEventsSocket);
- /* Unload Utility Adapter */
- TI_AdapterDeinit( myDrv->hDriver );
- /* Free all allocated memory */
- os_free( myDrv );
-#ifdef CONFIG_TI_LOCKFILE
- /* Close and delete the pid-lock-file */
- close(lfp);
- unlink("./wpa_supplicant_lockfile.pid");
-#endif
- wpa_printf(MSG_DEBUG,"STA-DK %s interface Deinitialized...bye!", SW_VERSION_STR);
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_get_mac_addr
-Routine Description: return WLAN MAC address
-Arguments:
- priv - pointer to private data structure
-Return Value: pointer to BSSID
------------------------------------------------------------------------------*/
-const u8 *wpa_driver_tista_get_mac_addr( void *priv )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
-
- wpa_printf(MSG_DEBUG,"wpa_driver_tista_get_mac_addr called");
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, NULL );
- return( (const u8 *)&myDrv->own_addr );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_send_eapol
-Routine Description: transmit EAPOL
-Arguments:
- priv - pointer to private data structure
- data - pointer to EAPOL data
- data_len - length of EAPOL data
-Return Value: None
------------------------------------------------------------------------------*/
-static int ti_send_eapol( void *priv, const u8 *dest, u16 proto,
- const u8 *data, size_t data_len )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- u8* DataWithHeader = NULL;
- u16 protoNetwork;
- int ret = 0;
-
- wpa_printf(MSG_DEBUG,"TI send_eapol called");
-#ifdef IEEE8021X_EAPOL
- DataWithHeader = os_malloc(data_len + ETHERNET_HDR_LEN); /* 14 bytes */
- if( DataWithHeader == NULL ) {
- wpa_printf(MSG_ERROR,"TI send_eapol failed to alloc full buffer");
- return( -1 );
- }
-
- os_memcpy(DataWithHeader, dest, MAC_ADDR_LEN); /* 6 bytes */
- os_memcpy(DataWithHeader+MAC_ADDR_LEN, myDrv->own_addr, MAC_ADDR_LEN);
- protoNetwork = htons(proto);
- os_memcpy(DataWithHeader+(MAC_ADDR_LEN<<1), &protoNetwork, sizeof(u16)); /* 2 bytes */
-
- os_memcpy(DataWithHeader+ETHERNET_HDR_LEN, data, data_len);
- data_len += ETHERNET_HDR_LEN;
-
- wpa_hexdump(MSG_DEBUG, "WPA: FULL TX EAPOL-Key", DataWithHeader, data_len);
-
- /* Transmit EAPOL packet */
- ret = TI_Send_EAPOL_Packet( myDrv->hDriver, (void *)DataWithHeader, data_len );
- os_free(DataWithHeader);
-#endif
- return( TI2WPA_STATUS(ret) );
-}
-
-/*-----------------------------------------------------------------------------
-Routine Name: wpa_driver_tista_driver_cmd
-Routine Description: executes driver-specific commands
-Arguments:
- priv - pointer to private data structure
- cmd - command
- buf - return buffer
- buf_len - buffer length
-Return Value: actual buffer length - success, -1 - failure
------------------------------------------------------------------------------*/
-int wpa_driver_tista_driver_cmd( void *priv, char *cmd, char *buf, size_t buf_len )
-{
- struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv;
- int ret = -1, prev_events;
-
- wpa_printf(MSG_DEBUG, "%s %s", __func__, cmd);
-
- if( os_strcasecmp(cmd, "start") == 0 ) {
- wpa_printf(MSG_DEBUG,"Start command");
- prev_events = myDrv->block_disassoc_events;
- myDrv->block_disassoc_events = myDrv->block_disassoc_prev;
- ret = TI_Start( myDrv->hDriver );
- if( ret == OK ) {
- /* Signal that driver is not loaded yet */
- myDrv->driver_is_loaded = TRUE;
- wpa_msg(myDrv->hWpaSupplicant, MSG_INFO, WPA_EVENT_DRIVER_STATE "STARTED");
- }
- else
- myDrv->block_disassoc_events = prev_events;
- return( TI2WPA_STATUS(ret) );
- }
-
- /* If driver is not initialized yet - we cannot access it so return */
- TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 );
-
- if( os_strcasecmp(cmd, "stop") == 0 ) {
- wpa_printf(MSG_DEBUG,"Stop command");
- myDrv->block_disassoc_prev = myDrv->block_disassoc_events;
- myDrv->block_disassoc_events = BLOCK_DISASSOC; /* Block message */
- ret = TI_Stop( myDrv->hDriver );
- if( ret == OK ) {
- /* Signal that driver is not loaded yet */
- myDrv->driver_is_loaded = FALSE;
- wpa_msg(myDrv->hWpaSupplicant, MSG_INFO, WPA_EVENT_DRIVER_STATE "STOPPED");
- }
- else
- myDrv->block_disassoc_events = myDrv->block_disassoc_prev;
- }
- else if( os_strcasecmp(cmd, "macaddr") == 0 ) {
- u8 *macaddr = (u8 *)wpa_driver_tista_get_mac_addr(priv);
- wpa_printf(MSG_DEBUG,"Macaddr command");
- wpa_printf(MSG_DEBUG, " Macaddr = " MACSTR, MAC2STR(macaddr));
- ret = sprintf(buf, "Macaddr = " MACSTR "\n", MAC2STR(macaddr));
- return( ret );
- }
- else if( os_strcasecmp(cmd, "scan-passive") == 0 ) {
- wpa_printf(MSG_DEBUG,"Scan Passive command");
- myDrv->scan_type = SCAN_TYPE_NORMAL_PASSIVE;
- ret = 0;
- }
- else if( os_strcasecmp(cmd, "scan-active") == 0 ) {
- wpa_printf(MSG_DEBUG,"Scan Active command");
- myDrv->scan_type = SCAN_TYPE_NORMAL_ACTIVE;
- ret = 0;
- }
- else if( os_strcasecmp(cmd, "linkspeed") == 0 ) {
- wpa_printf(MSG_DEBUG,"Link Speed command");
- ret = sprintf(buf,"LinkSpeed %u\n", myDrv->link_speed);
- return( ret );
- }
- else if( os_strncasecmp(cmd, "scan-channels", 13) == 0 ) {
- int noOfChan;
-
- noOfChan = atoi(cmd + 13);
- wpa_printf(MSG_DEBUG,"Scan Channels command = %d", noOfChan);
- if( (noOfChan > 0) && (noOfChan <= MAX_NUMBER_OF_CHANNELS_PER_SCAN) )
- myDrv->scan_channels = noOfChan;
- ret = sprintf(buf,"Scan-Channels = %d\n", myDrv->scan_channels);
- return( ret );
- }
- else if( os_strcasecmp(cmd, "rssi") == 0 ) {
-#if 1
- u8 ssid[MAX_SSID_LEN];
- int rssi, len;
-
- wpa_printf(MSG_DEBUG,"rssi command");
-
- ret = TI_GetRSSI( myDrv->hDriver, &rssi );
- if( ret == OK ) {
- len = wpa_driver_tista_get_ssid( priv, (u8 *)ssid );
- if( (len > 0) && (len <= MAX_SSID_LEN) ) {
- os_memcpy( (void *)buf, (void *)ssid, len );
- ret = len;
- ret += sprintf(&buf[ret], " rssi %d\n", rssi);
- return( ret );
- }
- }
- else {
- ret = -1;
- }
-#else
- OS_802_11_BSSID_EX bssidInfo;
-
- wpa_printf(MSG_DEBUG,"rssi command");
-
- ret = TI_GetSelectedBSSIDInfo( myDrv->hDriver, (OS_802_11_BSSID_EX *)&bssidInfo );
- if( ret == OK ) {
- if( bssidInfo.Ssid.SsidLength != 0 ) {
- os_memcpy( (void *)buf, (void *)(bssidInfo.Ssid.Ssid), bssidInfo.Ssid.SsidLength );
- ret = bssidInfo.Ssid.SsidLength;
- ret += sprintf(&buf[ret]," rssi %d\n", bssidInfo.Rssi);
- return( ret );
- }
- ret = -1;
- }
-#endif
- }
- else if( os_strncasecmp(cmd, "powermode", 9) == 0 ) {
- u32 mode;
-
- mode = (u32)atoi(cmd + 9);
- wpa_printf(MSG_DEBUG,"Power Mode command = %u", mode);
- if( mode <= OS_POWER_MODE_LONG_DOZE )
- ret = TI_ConfigPowerManagement( myDrv->hDriver, mode );
- }
- else if (os_strncasecmp(cmd, "getpower", 8) == 0 ) {
- u32 mode;
-
- ret = TI_GetPowerMode( myDrv->hDriver, (OS_802_11_POWER_PROFILE *)&mode);
- if( ret == OK ) {
- ret = sprintf(buf, "powermode = %u\n", mode);
- return( ret );
- }
- ret = -1;
- }
-#ifndef STA_DK_VER_5_0_0_94
- else if( os_strncasecmp(cmd, "btcoexmode", 10) == 0 ) {
- u32 mode;
-
- mode = (u32)atoi(cmd + 10);
- wpa_printf(MSG_DEBUG,"BtCoex Mode command = %u", mode);
- ret = TI_SetBtCoeEnable( myDrv->hDriver, mode );
- if( ret == OK ) {
- myDrv->btcoex_mode = mode;
- }
- }
- else if( os_strcasecmp(cmd, "btcoexstat") == 0 ) {
- u32 status = myDrv->btcoex_mode;
-
- wpa_printf(MSG_DEBUG,"BtCoex Status");
- ret = TI_SetBtCoeGetStatus( myDrv->hDriver, (tiUINT32 *)&status );
- if( ret == OK ) {
- ret = sprintf(buf, "btcoexstatus = 0x%x\n", status);
- return( ret );
- }
- ret = -1;
- }
-#endif
- else {
- wpa_printf(MSG_DEBUG,"Unsupported command");
- }
- return( TI2WPA_STATUS(ret) );
-}
-
-/* Fill driver_ops structure to provide wpa_supplicant core with wrapper routines */
-struct wpa_driver_ops wpa_driver_custom_ops = {
- .name = TIWLAN_DRV_NAME,
- .desc = "TI Station Driver",
- .init = wpa_driver_tista_init,
- .deinit = wpa_driver_tista_unload,
- .get_bssid = wpa_driver_tista_get_bssid,
- .get_ssid = wpa_driver_tista_get_ssid,
- .set_wpa = wpa_driver_tista_set_wpa,
- .set_key = wpa_driver_tista_set_key,
- .set_param = NULL,
- .set_countermeasures = wpa_driver_tista_set_countermeasures,
- .set_drop_unencrypted = wpa_driver_tista_set_drop_unencrypted,
- .scan = wpa_driver_tista_scan,
- .get_scan_results = wpa_driver_tista_get_scan_results,
- .deauthenticate = wpa_driver_tista_deauthenticate,
- .disassociate = wpa_driver_tista_disassociate,
- .associate = wpa_driver_tista_associate,
- .set_auth_alg = wpa_driver_tista_set_auth_alg,
- .get_mac_addr = wpa_driver_tista_get_mac_addr,
- .send_eapol = ti_send_eapol,
- .add_pmkid = NULL,
- .remove_pmkid = NULL,
- .flush_pmkid = NULL,
- .get_capa = NULL,
- .poll = NULL,
- .get_ifname = NULL, /* Not nesessary */
- .set_operstate = NULL,
-#ifdef CONFIG_CLIENT_MLME
- .get_hw_modes = NULL,
- .set_channel = NULL,
- .set_ssid = wpa_driver_tista_set_ssid,
- .set_bssid = NULL,
- .send_mlme = NULL,
- .mlme_add_sta = NULL,
- .mlme_remove_sta = NULL,
- .mlme_setprotection = NULL,
-#endif /* CONFIG_CLIENT_MLME */
- .driver_cmd = wpa_driver_tista_driver_cmd
-};
+++ /dev/null
-/*
- * WPA Supplicant - driver interaction with TI station
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- */
-
-/* Copyright © Texas Instruments Incorporated (Oct 2005)
- * THIS CODE/PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
- * EITHER EXPRESS OR IMPLIED, INCLUDED BUT NOT LIMITED TO , THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- * This program has been modified from its original operation by Texas
- * Instruments Incorporated. These changes are covered under version 2
- * of the GNU General Public License, dated June 1991.
- *
- * Copyright © Google Inc (Feb 2008)
-*/
-/*-------------------------------------------------------------------*/
-#ifndef _DRIVER_TI_H_
-#define _DRIVER_TI_H_
-
-#include "wpa.h"
-#include "config.h"
-#include "osDot11.h"
-#include "802_11Defs.h"
-#include "TI_AdapterApiC.h"
-#include "tiioctl.h"
-/*-------------------------------------------------------------------*/
-#define TIWLAN_DRV_NAME "tiwlan0"
-#define TKIP_KEY_LENGTH 32
-#define AES_KEY_LENGTH 16
-#define WEP_KEY_LENGTH_40 5
-#define WEP_KEY_LENGTH_104 13
-
-#define TIMAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
-#define TIMACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
-
-typedef enum _TIWLAN_KEY_FLAGS
-{
- TIWLAN_KEY_FLAGS_TRANSMIT = 0x80000000, /* Used whenever key should be immidiately used for TX */
- TIWLAN_KEY_FLAGS_PAIRWISE = 0x40000000, /* Used to indicate pairwise key */
- TIWLAN_KEY_FLAGS_SET_KEY_RSC = 0x20000000, /* Used to set RSC (receive sequence counter) to driver */
- TIWLAN_KEY_FLAGS_AUTHENTICATOR = 0x10000000 /* Not used currently */
-} TIWLAN_KEY_FLAGS;
-
-#define NO_BLOCK 0
-#define NO_BLOCK_DISASSOC_IN_PROGRESS 1
-#define BLOCK_DISASSOC 2
-#define NO_BLOCK_WPS 3
-
-#ifndef WPA_OUI
-/* { 0x00, 0x50, 0xf2, 0x01 } */
-#define WPA_OUI "\x00\x50\xf2\x01"
-#endif
-
-#define NUMBER_SCAN_CHANNELS_FCC 11
-
-#ifndef ETHERNET_HDR_LEN
-#define ETHERNET_HDR_LEN 14
-#endif
-
-#define WPA_OPTIONS_DISABLE 0
-#define WPA_OPTIONS_ENABLE 3
-
-#ifndef MIN
-#define MIN(x,y) (((x) < (y)) ? (x) : (y))
-#endif
-
-/* TI station control structure */
-struct wpa_driver_ti_data {
- UINT8 own_addr[ETH_ALEN]; /* MAC address of WLAN interface */
- void *hWpaSupplicant; /* Handle to wpa_supplicant */
- TI_HANDLE hDriver; /* Handle to self */
- TI_HANDLE hEvents[IPC_EVENT_MAX]; /* Event handles - needed to register to driver events */
- int key_mgmt; /* Key Management: 802_1X/PSK/NONE/802_1X_NO_WPA/WPA_NONE */
- int proto; /* Protocol (WPA/WPA2/RSN) */
- int encryption; /* Encryption type */
- int auth_alg; /* Authentication Alg: Open, Shared or LEAP */
- int driver_is_loaded; /* TRUE/FALSE flag if driver is already loaded and can be accessed */
- int scan_type; /* SCAN_TYPE_NORMAL_ACTIVE or SCAN_TYPE_NORMAL_PASSIVE */
- int scan_channels; /* Number of allowed scan channels */
- unsigned link_speed; /* Link Speed */
- unsigned btcoex_mode; /* BtCoex Mode */
- int driverEventsSocket;
- int block_disassoc_events;
- int block_disassoc_prev;
-};
-
-/* external symbols from common.c - will be used to dynamically change debug level by IOCTLs */
-extern int wpa_debug_level;
-extern int wpa_debug_show_keys;
-extern int wpa_debug_timestamp;
-#endif /* _DRIVER_TI_H_ */