staging: csr: remove driver

This driver is not being updated as the specifications are not able to
be gotten from CSR or anyone else.  Without those, getting this driver
into proper mergable shape is going to be impossible.  So remove the
driver from the tree.

If the specifications ever become available, this patch can be reverted
and the driver fixed up properly.

Reported-by: Lidza Louina <lidza.louina@gmail.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Greg Kroah-Hartman 2013-07-16 22:37:09 -07:00
parent ad81f0545e
commit ade7615de0
146 changed files with 0 additions and 91599 deletions

View file

@ -118,8 +118,6 @@ source "drivers/staging/ozwpan/Kconfig"
source "drivers/staging/gdm72xx/Kconfig"
source "drivers/staging/csr/Kconfig"
source "drivers/staging/silicom/Kconfig"
source "drivers/staging/ced1401/Kconfig"

View file

@ -52,7 +52,6 @@ obj-$(CONFIG_MFD_NVEC) += nvec/
obj-$(CONFIG_ANDROID) += android/
obj-$(CONFIG_USB_WPAN_HCD) += ozwpan/
obj-$(CONFIG_WIMAX_GDM72XX) += gdm72xx/
obj-$(CONFIG_CSR_WIFI) += csr/
obj-$(CONFIG_NET_VENDOR_SILICOM) += silicom/
obj-$(CONFIG_CED1401) += ced1401/
obj-$(CONFIG_DRM_IMX) += imx-drm/

View file

@ -1,9 +0,0 @@
config CSR_WIFI
tristate "CSR wireless driver"
depends on MMC && CFG80211_WEXT && INET
select WIRELESS_EXT
select WEXT_PRIV
help
Driver for the CSR wireless SDIO device.
If unsure, select N.

View file

@ -1,39 +0,0 @@
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Except as contained in this notice, the names of above-listed
copyright holders and the names of any contributors shall not be used
in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
CONTRIBUTORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Alternatively, this software may be distributed under the terms of the
GNU General Public License ("GPL") version 2 as published
by the Free Software Foundation.
As a special exception, if other files instantiate templates or use
macros or inline functions from this file, or you compile this file
and link it with other works to produce a work based on this file,
this file does not by itself cause the resulting work to be covered by
the GNU General Public License. However the source code for this file
must still be made available in accordance with section (3) of the GNU
General Public License.
This exception does not invalidate any other reasons why a work based
on this file might be covered by the GNU General Public License.

View file

@ -1,73 +0,0 @@
ccflags-y := -DCSR_SME_USERSPACE -DCSR_SUPPORT_SME -DREMOTE_SYS_SAP -DCSR_WIFI_SECURITY_WAPI_ENABLE -DENABLE_SHUTDOWN -DUNIFI_DEBUG
ccflags-y += -DSDIO_EXPORTS_STRUCT_DEVICE -DCSR_WIFI_SUPPORT_MMC_DRIVER -DCSR_WIFI_SINGLE_FUNCTION -DCSR_WIFI_SPLIT_PATCH
ccflags-y += -DCSR_SUPPORT_WEXT -DREMOTE_SYS_SAP -DREMOTE_MGT_SAP -DCSR_WIFI_SECURITY_WAPI_ENABLE -DCSR_WIFI_SECURITY_WAPI_QOSCTRL_MIC_WORKAROUND -DENABLE_SHUTDOWN -DCSR_WIFI_NME_ENABLE -DCSR_WIFI_AP_ENABLE -DCSR_SUPPORT_WEXT_AP -DCSR_WIFI_REQUEUE_PACKET_TO_HAL
obj-$(CONFIG_CSR_WIFI) += csr_wifi.o
obj-$(CONFIG_CSR_WIFI) += csr_helper.o
csr_wifi-y := bh.o \
data_tx.o \
drv.o \
firmware.o \
inet.o \
init_hw.o \
io.o \
monitor.o \
netdev.o \
os.o \
putest.o \
sdio_events.o \
sdio_mmc.o \
sdio_stubs.o \
sme_blocking.o \
ul_int.o \
unifi_dbg.o \
unifi_event.o \
unifi_pdu_processing.o \
unifi_sme.o \
csr_wifi_hip_card_sdio.o \
csr_wifi_hip_card_sdio_intr.o \
csr_wifi_hip_card_sdio_mem.o \
csr_wifi_hip_chiphelper.o \
csr_wifi_hip_download.o \
csr_wifi_hip_dump.o \
csr_wifi_hip_packing.o \
csr_wifi_hip_send.o \
csr_wifi_hip_signals.o \
csr_wifi_hip_ta_sampling.o \
csr_wifi_hip_udi.o \
csr_wifi_hip_unifi_signal_names.o \
csr_wifi_hip_xbv.o \
csr_wifi_nme_ap_converter_init.o \
csr_wifi_nme_ap_free_downstream_contents.o \
csr_wifi_nme_ap_free_upstream_contents.o \
csr_wifi_nme_ap_serialize.o \
csr_wifi_nme_ap_sef.o \
csr_wifi_router_ctrl_sef.o \
csr_wifi_router_sef.o \
csr_wifi_router_transport.o \
csr_wifi_sme_sef.o \
csr_wifi_sme_converter_init.o \
csr_wifi_sme_free_downstream_contents.o \
csr_wifi_sme_free_upstream_contents.o \
csr_wifi_sme_serialize.o \
csr_wifi_router_ctrl_converter_init.o \
csr_wifi_router_ctrl_free_downstream_contents.o \
csr_wifi_router_ctrl_free_upstream_contents.o \
csr_wifi_router_ctrl_serialize.o \
csr_wifi_router_converter_init.o \
csr_wifi_router_free_downstream_contents.o \
csr_wifi_router_free_upstream_contents.o \
csr_wifi_router_serialize.o \
sme_mgt.o \
sme_sys.o \
sme_userspace.o \
sme_wext.o \
wext_events.o
csr_helper-y := csr_time.o \
csr_util.o \
csr_framework_ext.o \
csr_wifi_serialize_primitive_types.o \
csr_serialize_primitive_types.o \
csr_msgconv.o

View file

@ -1,404 +0,0 @@
/*
* ---------------------------------------------------------------------------
* FILE: bh.c
*
* PURPOSE:
* Provides an implementation for the driver bottom-half.
* It is part of the porting exercise in Linux.
*
* Copyright (C) 2005-2009 by Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*
* ---------------------------------------------------------------------------
*/
#include "csr_wifi_hip_unifi.h"
#include "unifi_priv.h"
#include <linux/sched/rt.h>
/*
* ---------------------------------------------------------------------------
* uf_start_thread
*
* Helper function to start a new thread.
*
* Arguments:
* priv Pointer to OS driver structure for the device.
* thread Pointer to the thread object
* func The thread function
*
* Returns:
* 0 on success or else a Linux error code.
* ---------------------------------------------------------------------------
*/
int uf_start_thread(unifi_priv_t *priv,
struct uf_thread *thread, int (*func)(void *))
{
if (thread->thread_task != NULL) {
unifi_error(priv, "%s thread already started\n", thread->name);
return 0;
}
/* Start the kernel thread that handles all h/w accesses. */
thread->thread_task = kthread_run(func, priv, "%s", thread->name);
if (IS_ERR(thread->thread_task))
return PTR_ERR(thread->thread_task);
/* Module parameter overides the thread priority */
if (bh_priority != -1) {
if (bh_priority >= 0 && bh_priority <= MAX_RT_PRIO) {
struct sched_param param;
priv->bh_thread.prio = bh_priority;
unifi_trace(priv, UDBG1,
"%s thread (RT) priority = %d\n",
thread->name, bh_priority);
param.sched_priority = bh_priority;
sched_setscheduler(thread->thread_task,
SCHED_FIFO, &param);
} else if (bh_priority > MAX_RT_PRIO &&
bh_priority <= MAX_PRIO) {
priv->bh_thread.prio = bh_priority;
unifi_trace(priv, UDBG1, "%s thread priority = %d\n",
thread->name,
PRIO_TO_NICE(bh_priority));
set_user_nice(thread->thread_task,
PRIO_TO_NICE(bh_priority));
} else {
priv->bh_thread.prio = DEFAULT_PRIO;
unifi_warning(priv,
"%s thread unsupported (%d) priority\n",
thread->name, bh_priority);
}
} else
priv->bh_thread.prio = DEFAULT_PRIO;
unifi_trace(priv, UDBG2, "Started %s thread\n", thread->name);
return 0;
} /* uf_start_thread() */
/*
* ---------------------------------------------------------------------------
* uf_stop_thread
*
* Helper function to stop a thread.
*
* Arguments:
* priv Pointer to OS driver structure for the device.
* thread Pointer to the thread object
*
* Returns:
*
* ---------------------------------------------------------------------------
*/
void uf_stop_thread(unifi_priv_t *priv, struct uf_thread *thread)
{
if (!thread->thread_task) {
unifi_notice(priv, "%s thread is already stopped\n",
thread->name);
return;
}
unifi_trace(priv, UDBG2, "Stopping %s thread\n", thread->name);
kthread_stop(thread->thread_task);
thread->thread_task = NULL;
} /* uf_stop_thread() */
/*
* ---------------------------------------------------------------------------
* uf_wait_for_thread_to_stop
*
* Helper function to wait until a thread is stopped.
*
* Arguments:
* priv Pointer to OS driver structure for the device.
*
* Returns:
*
* ---------------------------------------------------------------------------
*/
void
uf_wait_for_thread_to_stop(unifi_priv_t *priv, struct uf_thread *thread)
{
/*
* kthread_stop() cannot handle the thread exiting while
* kthread_should_stop() is false, so sleep until kthread_stop()
* wakes us up
*/
unifi_trace(priv, UDBG2, "%s waiting for the stop signal.\n",
thread->name);
set_current_state(TASK_INTERRUPTIBLE);
if (!kthread_should_stop()) {
unifi_trace(priv, UDBG2, "%s schedule....\n", thread->name);
schedule();
}
thread->thread_task = NULL;
unifi_trace(priv, UDBG2, "%s exiting....\n", thread->name);
} /* uf_wait_for_thread_to_stop() */
/*
* ---------------------------------------------------------------------------
* handle_bh_error
*
* This function reports an error returned from the HIP core bottom-half.
* Normally, implemented during the porting exercise, passing the error
* to the SME using unifi_sys_wifi_off_ind().
* The SME will try to reset the device and go through
* the initialisation of the UniFi.
*
* Arguments:
* priv Pointer to OS driver structure for the device.
*
* Returns:
* None.
* ---------------------------------------------------------------------------
*/
static void
handle_bh_error(unifi_priv_t *priv)
{
netInterface_priv_t *interfacePriv;
u8 conf_param = CONFIG_IND_ERROR;
u8 interfaceTag;
/* Block unifi_run_bh() until the error has been handled. */
priv->bh_thread.block_thread = 1;
/* Consider UniFi to be uninitialised */
priv->init_progress = UNIFI_INIT_NONE;
/* Stop the network traffic */
for (interfaceTag = 0;
interfaceTag < CSR_WIFI_NUM_INTERFACES; interfaceTag++) {
interfacePriv = priv->interfacePriv[interfaceTag];
if (interfacePriv->netdev_registered)
netif_carrier_off(priv->netdev[interfaceTag]);
}
#ifdef CSR_NATIVE_LINUX
/* Force any client waiting on an mlme_wait_for_reply() to abort. */
uf_abort_mlme(priv);
/* Cancel any pending workqueue tasks */
flush_workqueue(priv->unifi_workqueue);
#endif /* CSR_NATIVE_LINUX */
unifi_error(priv,
"handle_bh_error: fatal error is reported to the SME.\n");
/* Notify the clients (SME or unifi_manager) for the error. */
ul_log_config_ind(priv, &conf_param, sizeof(u8));
} /* handle_bh_error() */
/*
* ---------------------------------------------------------------------------
* bh_thread_function
*
* All hardware access happens in this thread.
* This means there is no need for locks on the hardware and we don't need
* to worry about reentrancy with the SDIO library.
* Provides and example implementation on how to call unifi_bh(), which
* is part of the HIP core API.
*
* It processes the events generated by unifi_run_bh() to serialise calls
* to unifi_bh(). It also demonstrates how the timeout parameter passed in
* and returned from unifi_bh() needs to be handled.
*
* Arguments:
* arg Pointer to OS driver structure for the device.
*
* Returns:
* None.
*
* Notes:
* When the bottom half of the driver needs to process signals, events,
* or simply the host status (i.e sleep mode), it invokes unifi_run_bh().
* Since we need all SDIO transaction to be in a single thread, the
* unifi_run_bh() will wake up this thread to process it.
*
* ---------------------------------------------------------------------------
*/
static int bh_thread_function(void *arg)
{
unifi_priv_t *priv = (unifi_priv_t *)arg;
CsrResult csrResult;
long ret;
u32 timeout, t;
struct uf_thread *this_thread;
unifi_trace(priv, UDBG2, "bh_thread_function starting\n");
this_thread = &priv->bh_thread;
t = timeout = 0;
while (!kthread_should_stop()) {
/*
* wait until an error occurs,
* or we need to process something.
*/
unifi_trace(priv, UDBG3, "bh_thread goes to sleep.\n");
if (timeout > 0) {
/* Convert t in ms to jiffies */
t = msecs_to_jiffies(timeout);
ret = wait_event_interruptible_timeout(
this_thread->wakeup_q,
(this_thread->wakeup_flag && !this_thread->block_thread) ||
kthread_should_stop(),
t);
timeout = (ret > 0) ? jiffies_to_msecs(ret) : 0;
} else {
ret = wait_event_interruptible(this_thread->wakeup_q,
(this_thread->wakeup_flag && !this_thread->block_thread) ||
kthread_should_stop());
}
if (kthread_should_stop()) {
unifi_trace(priv, UDBG2,
"bh_thread: signalled to exit\n");
break;
}
if (ret < 0) {
unifi_notice(priv,
"bh_thread: wait_event returned %d, thread will exit\n",
ret);
uf_wait_for_thread_to_stop(priv, this_thread);
break;
}
this_thread->wakeup_flag = 0;
unifi_trace(priv, UDBG3, "bh_thread calls unifi_bh().\n");
CsrSdioClaim(priv->sdio);
csrResult = unifi_bh(priv->card, &timeout);
if (csrResult != CSR_RESULT_SUCCESS) {
if (csrResult == CSR_WIFI_HIP_RESULT_NO_DEVICE) {
CsrSdioRelease(priv->sdio);
uf_wait_for_thread_to_stop(priv, this_thread);
break;
}
/* Errors must be delivered to the error task */
handle_bh_error(priv);
}
CsrSdioRelease(priv->sdio);
}
/*
* I would normally try to call csr_sdio_remove_irq() here to make sure
* that we do not get any interrupts while this thread is not running.
* However, the MMC/SDIO driver tries to kill its' interrupt thread.
* The kernel threads implementation does not allow to kill threads
* from a signalled to stop thread.
* So, instead call csr_sdio_linux_remove_irq() always after calling
* uf_stop_thread() to kill this thread.
*/
unifi_trace(priv, UDBG2, "bh_thread exiting....\n");
return 0;
} /* bh_thread_function() */
/*
* ---------------------------------------------------------------------------
* uf_init_bh
*
* Helper function to start the bottom half of the driver.
* All we need to do here is start the I/O bh thread.
*
* Arguments:
* priv Pointer to OS driver structure for the device.
*
* Returns:
* 0 on success or else a Linux error code.
* ---------------------------------------------------------------------------
*/
int
uf_init_bh(unifi_priv_t *priv)
{
int r;
/* Enable mlme interface. */
priv->io_aborted = 0;
/* Start the BH thread */
r = uf_start_thread(priv, &priv->bh_thread, bh_thread_function);
if (r) {
unifi_error(priv,
"uf_init_bh: failed to start the BH thread.\n");
return r;
}
/* Allow interrupts */
r = csr_sdio_linux_install_irq(priv->sdio);
if (r) {
unifi_error(priv,
"uf_init_bh: failed to install the IRQ.\n");
uf_stop_thread(priv, &priv->bh_thread);
}
return r;
} /* uf_init_bh() */
/*
* ---------------------------------------------------------------------------
* unifi_run_bh
*
* Part of the HIP core lib API, implemented in the porting exercise.
* The bottom half of the driver calls this function when
* it wants to process anything that requires access to unifi.
* We need to call unifi_bh() which in this implementation is done
* by waking up the I/O thread.
*
* Arguments:
* ospriv Pointer to OS driver structure for the device.
*
* Returns:
* 0 on success or else a Linux error code.
*
* Notes:
* ---------------------------------------------------------------------------
*/
CsrResult unifi_run_bh(void *ospriv)
{
unifi_priv_t *priv = ospriv;
/*
* If an error has occurred, we discard silently all messages from the bh
* until the error has been processed and the unifi has been
* reinitialised.
*/
if (priv->bh_thread.block_thread == 1) {
unifi_trace(priv, UDBG3, "unifi_run_bh: discard message.\n");
/*
* Do not try to acknowledge a pending interrupt here.
* This function is called by unifi_send_signal()
* which in turn can be running in an atomic or 'disabled irq'
* level if a signal is sent from a workqueue task
* (i.e multicass addresses set). We can not hold the SDIO lock
* because it might sleep.
*/
return CSR_RESULT_FAILURE;
}
priv->bh_thread.wakeup_flag = 1;
/* wake up I/O thread */
wake_up_interruptible(&priv->bh_thread.wakeup_q);
return CSR_RESULT_SUCCESS;
} /* unifi_run_bh() */

View file

@ -1,40 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/module.h>
#include <linux/freezer.h>
#include <linux/semaphore.h>
#include <linux/slab.h>
#include <linux/bitops.h>
#include "csr_framework_ext.h"
/*----------------------------------------------------------------------------*
* NAME
* CsrThreadSleep
*
* DESCRIPTION
* Sleep for a given period.
*
* RETURNS
* void
*
*----------------------------------------------------------------------------*/
void CsrThreadSleep(u16 sleepTimeInMs)
{
unsigned long t;
/* Convert t in ms to jiffies and round up */
t = ((sleepTimeInMs * HZ) + 999) / 1000;
schedule_timeout_uninterruptible(t);
}
EXPORT_SYMBOL_GPL(CsrThreadSleep);

View file

@ -1,35 +0,0 @@
#ifndef CSR_FRAMEWORK_EXT_H__
#define CSR_FRAMEWORK_EXT_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include "csr_result.h"
#include "csr_framework_ext_types.h"
/* Result codes */
#define CSR_FE_RESULT_NO_MORE_EVENTS ((CsrResult) 0x0001)
#define CSR_FE_RESULT_INVALID_POINTER ((CsrResult) 0x0002)
#define CSR_FE_RESULT_INVALID_HANDLE ((CsrResult) 0x0003)
#define CSR_FE_RESULT_NO_MORE_MUTEXES ((CsrResult) 0x0004)
#define CSR_FE_RESULT_TIMEOUT ((CsrResult) 0x0005)
#define CSR_FE_RESULT_NO_MORE_THREADS ((CsrResult) 0x0006)
/* Thread priorities */
#define CSR_THREAD_PRIORITY_HIGHEST ((u16) 0)
#define CSR_THREAD_PRIORITY_HIGH ((u16) 1)
#define CSR_THREAD_PRIORITY_NORMAL ((u16) 2)
#define CSR_THREAD_PRIORITY_LOW ((u16) 3)
#define CSR_THREAD_PRIORITY_LOWEST ((u16) 4)
#define CSR_EVENT_WAIT_INFINITE ((u16) 0xFFFF)
void CsrThreadSleep(u16 sleepTimeInMs);
#endif

View file

@ -1,30 +0,0 @@
#ifndef CSR_FRAMEWORK_EXT_TYPES_H__
#define CSR_FRAMEWORK_EXT_TYPES_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifdef __KERNEL__
#include <linux/kthread.h>
#include <linux/semaphore.h>
#else
#include <pthread.h>
#endif
#ifdef __KERNEL__
typedef struct semaphore CsrMutexHandle;
#else /* __KERNEL __ */
typedef pthread_mutex_t CsrMutexHandle;
#endif /* __KERNEL__ */
#endif

View file

@ -1,223 +0,0 @@
#ifndef CSR_LOG_H__
#define CSR_LOG_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include "csr_sched.h"
#include "csr_prim_defs.h"
#include "csr_msgconv.h"
/*
* Log filtering
*/
/*----------------------------------------------------*/
/* Filtering on environment specific log levels */
/*----------------------------------------------------*/
typedef u32 CsrLogLevelEnvironment;
#define CSR_LOG_LEVEL_ENVIRONMENT_OFF ((CsrLogLevelEnvironment) 0x00000000) /* No environment data/events are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_BCI_ACL ((CsrLogLevelEnvironment) 0x00000001) /* BlueCore Channel Interface HCI Acl data are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_BCI_HCI ((CsrLogLevelEnvironment) 0x00000002) /* BlueCore Channel Interface HCI Cmd/Evt data are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_BCI_SCO ((CsrLogLevelEnvironment) 0x00000004) /* BlueCore Channel Interface HCI Sco data are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_BCI_VENDOR ((CsrLogLevelEnvironment) 0x00000008) /* BlueCore Channel Interface HCI Vendor specific data are logged (This includes BCCMD, HQ, VM etc) */
#define CSR_LOG_LEVEL_ENVIRONMENT_TRANSPORTS ((CsrLogLevelEnvironment) 0x00000010) /* Transport protocol data is logged (This includes transport protocols like BCSP, H4 etc.) */
#define CSR_LOG_LEVEL_ENVIRONMENT_BGINT_REG ((CsrLogLevelEnvironment) 0x00000020) /* Background Interrupt registration events are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_BGINT_UNREG ((CsrLogLevelEnvironment) 0x00000040) /* Background Interrupt unregistration events are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_BGINT_SET ((CsrLogLevelEnvironment) 0x00000080) /* Background Interrupt set events are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_BGINT_START ((CsrLogLevelEnvironment) 0x00000100) /* Background Interrupt start events are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_BGINT_DONE ((CsrLogLevelEnvironment) 0x00000200) /* Background Interrupt done events are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_PROTO ((CsrLogLevelEnvironment) 0x00000400) /* Transport protocol events are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_PROTO_LOC ((CsrLogLevelEnvironment) 0x00000800) /* The Location where the transport protocol event occurred are logged NB: This is a supplement to CSR_LOG_LEVEL_ENVIRONMENT_PROTO, it has no effect without it */
/* The bit masks between here are reserved for future usage */
#define CSR_LOG_LEVEL_ENVIRONMENT_ALL ((CsrLogLevelEnvironment) 0xFFFFFFFF) /* All possible environment data/events are logged WARNING: By using this define the application also accepts future possible environment data/events in the logs */
/*----------------------------------------------------*/
/* Filtering on task specific log levels */
/*----------------------------------------------------*/
typedef u32 CsrLogLevelTask;
#define CSR_LOG_LEVEL_TASK_OFF ((CsrLogLevelTask) 0x00000000) /* No events are logged for this task */
#define CSR_LOG_LEVEL_TASK_TEXT ((CsrLogLevelTask) 0x00000001) /* Text strings printed by a task are logged NB: This bit does not affect the CSR_LOG_TEXT_LEVEL interface. This has to be configured separately */
#define CSR_LOG_LEVEL_TASK_TEXT_LOC ((CsrLogLevelTask) 0x00000002) /* The locaction where the text string call occurred are logged. NB: This is a supplement to CSR_LOG_LEVEL_TASK_TEXT, it has no effect without it */
#define CSR_LOG_LEVEL_TASK_STATE ((CsrLogLevelTask) 0x00000004) /* FSM state transitions in a task are logged */
#define CSR_LOG_LEVEL_TASK_STATE_NAME ((CsrLogLevelTask) 0x00000008) /* The name of each state in a FSM state transition are logged. NB: This is a supplement to CSR_LOG_LEVEL_TASK_STATE, it has no effect without it */
#define CSR_LOG_LEVEL_TASK_STATE_LOC ((CsrLogLevelTask) 0x00000010) /* The location where the FSM state transition occurred are logged. NB: This is a supplement to CSR_LOG_LEVEL_TASK_STATE, it has no effect without it */
#define CSR_LOG_LEVEL_TASK_TASK_SWITCH ((CsrLogLevelTask) 0x00000020) /* Activation and deactiation of a task are logged */
#define CSR_LOG_LEVEL_TASK_MESSAGE_PUT ((CsrLogLevelTask) 0x00000080) /* Message put operations are logged */
#define CSR_LOG_LEVEL_TASK_MESSAGE_PUT_LOC ((CsrLogLevelTask) 0x00000100) /* The location where a message was sent are logged. NB: This is a supplement to CSR_LOG_LEVEL_TASK_MESSAGE_PUT, it has no effect without it */
#define CSR_LOG_LEVEL_TASK_MESSAGE_GET ((CsrLogLevelTask) 0x00000200) /* Message get operations are logged */
#define CSR_LOG_LEVEL_TASK_MESSAGE_QUEUE_PUSH ((CsrLogLevelTask) 0x00000400) /* Message push operations are logged */
#define CSR_LOG_LEVEL_TASK_MESSAGE_QUEUE_POP ((CsrLogLevelTask) 0x00000800) /* Message pop operations are logged */
#define CSR_LOG_LEVEL_TASK_PRIM_ONLY_TYPE ((CsrLogLevelTask) 0x00001000) /* Only the type of primitives in messages are logged. By default the entire primitive is serialized and logged */
#define CSR_LOG_LEVEL_TASK_PRIM_APPLY_LIMIT ((CsrLogLevelTask) 0x00002000) /* An upper limit (defined by CSR_LOG_PRIM_SIZE_UPPER_LIMIT) is applied to how much of a primitive in a message are logged. NB: This limit is only applied if CSR_LOG_LEVEL_TASK_PRIM_ONLY_TYPE is _not_ defined */
#define CSR_LOG_LEVEL_TASK_TIMER_IN ((CsrLogLevelTask) 0x00004000) /* TimedEventIn events are logged */
#define CSR_LOG_LEVEL_TASK_TIMER_IN_LOC ((CsrLogLevelTask) 0x00008000) /* The location where a timer was started are logged. NB: This is a supplement to CSR_LOG_LEVEL_TASK_TIMER_IN, it has no effect without it */
#define CSR_LOG_LEVEL_TASK_TIMER_CANCEL ((CsrLogLevelTask) 0x00010000) /* TimedEventCancel events are logged */
#define CSR_LOG_LEVEL_TASK_TIMER_CANCEL_LOC ((CsrLogLevelTask) 0x00020000) /* The location where a timer was cancelled are logged. NB: This is a supplement to CSR_LOG_LEVEL_TASK_TIMER_CANCEL, it has no effect without it */
#define CSR_LOG_LEVEL_TASK_TIMER_FIRE ((CsrLogLevelTask) 0x00040000) /* TimedEventFire events are logged */
#define CSR_LOG_LEVEL_TASK_TIMER_DONE ((CsrLogLevelTask) 0x00080000) /* TimedEventDone events are logged */
/* The bit masks between here are reserved for future usage */
#define CSR_LOG_LEVEL_TASK_ALL ((CsrLogLevelTask) 0xFFFFFFFF & ~(CSR_LOG_LEVEL_TASK_PRIM_ONLY_TYPE | CSR_LOG_LEVEL_TASK_PRIM_APPLY_LIMIT)) /* All info possible to log for a task are logged. WARNING: By using this define the application also accepts future possible task data/events in the logs */
u8 CsrLogEnvironmentIsFiltered(CsrLogLevelEnvironment level);
CsrLogLevelTask CsrLogTaskFilterGet(CsrSchedQid taskId);
u8 CsrLogTaskIsFiltered(CsrSchedQid taskId, CsrLogLevelTask level);
/*
* Logging stuff
*/
#define CSR_LOG_STRINGIFY_REAL(a) (#a)
#define CSR_LOG_STRINGIFY(a) CSR_LOG_STRINGIFY_REAL(a)
typedef struct {
u16 primitiveType;
const char *primitiveName;
CsrMsgConvMsgEntry *messageConv; /* Private - do not use */
} CsrLogPrimitiveInformation;
typedef struct {
const char *techVer;
u32 primitiveInfoCount;
CsrLogPrimitiveInformation *primitiveInfo;
} CsrLogTechInformation;
/*---------------------------------*/
/* Tech logging */
/*---------------------------------*/
typedef u8 bitmask8_t;
typedef u16 bitmask16_t;
typedef u32 bitmask32_t;
#ifdef CSR_LOG_ENABLE
#ifdef CSR_LOG_INCLUDE_FILE_NAME_AND_LINE_NUMBER
/* DEPRECATED - replaced by csr_log_text.h */
#define CSR_LOG_TEXT(text) \
do { \
if (!CsrLogTaskIsFiltered(CsrSchedTaskQueueGet(), CSR_LOG_LEVEL_TASK_TEXT)) { \
CsrLogTaskText(text, __LINE__, __FILE__); \
} \
} while (0)
#else
/* DEPRECATED - replaced by csr_log_text.h */
#define CSR_LOG_TEXT(text) \
do { \
if (!CsrLogTaskIsFiltered(CsrSchedTaskQueueGet(), CSR_LOG_LEVEL_TASK_TEXT)) { \
CsrLogTaskText(text, 0, NULL); \
} \
} while (0)
#endif
#else
#define CSR_LOG_TEXT(text)
#endif
/* DEPRECATED - replaced by csr_log_text.h */
void CsrLogTaskText(const char *text,
u32 line,
const char *file);
#define CSR_LOG_STATE_TRANSITION_MASK_FSM_NAME (0x001)
#define CSR_LOG_STATE_TRANSITION_MASK_NEXT_STATE (0x002)
#define CSR_LOG_STATE_TRANSITION_MASK_NEXT_STATE_STR (0x004)
#define CSR_LOG_STATE_TRANSITION_MASK_PREV_STATE (0x008)
#define CSR_LOG_STATE_TRANSITION_MASK_PREV_STATE_STR (0x010)
#define CSR_LOG_STATE_TRANSITION_MASK_EVENT (0x020)
#define CSR_LOG_STATE_TRANSITION_MASK_EVENT_STR (0x040)
/* DEPRECATED - replaced by csr_log_text.h */
void CsrLogStateTransition(bitmask16_t mask,
u32 identifier,
const char *fsm_name,
u32 prev_state,
const char *prev_state_str,
u32 in_event,
const char *in_event_str,
u32 next_state,
const char *next_state_str,
u32 line,
const char *file);
/*---------------------------------*/
/* BSP logging */
/*---------------------------------*/
void CsrLogSchedInit(u8 thread_id);
void CsrLogSchedDeinit(u8 thread_id);
void CsrLogSchedStart(u8 thread_id);
void CsrLogSchedStop(u8 thread_id);
void CsrLogInitTask(u8 thread_id, CsrSchedQid tskid, const char *tskName);
void CsrLogDeinitTask(u16 task_id);
void CsrLogActivate(CsrSchedQid tskid);
void CsrLogDeactivate(CsrSchedQid tskid);
#define SYNERGY_SERIALIZER_TYPE_DUMP (0x000)
#define SYNERGY_SERIALIZER_TYPE_SER (0x001)
void CsrLogMessagePut(u32 line,
const char *file,
CsrSchedQid src_task_id,
CsrSchedQid dst_taskid,
CsrSchedMsgId msg_id,
u16 prim_type,
const void *msg);
void CsrLogMessageGet(CsrSchedQid src_task_id,
CsrSchedQid dst_taskid,
u8 get_res,
CsrSchedMsgId msg_id,
u16 prim_type,
const void *msg);
void CsrLogTimedEventIn(u32 line,
const char *file,
CsrSchedQid task_id,
CsrSchedTid tid,
u32 requested_delay,
u16 fniarg,
const void *fnvarg);
void CsrLogTimedEventFire(CsrSchedQid task_id,
CsrSchedTid tid);
void CsrLogTimedEventDone(CsrSchedQid task_id,
CsrSchedTid tid);
void CsrLogTimedEventCancel(u32 line,
const char *file,
CsrSchedQid task_id,
CsrSchedTid tid,
u8 cancel_res);
void CsrLogBgintRegister(u8 thread_id,
CsrSchedBgint irq,
const char *callback,
const void *ptr);
void CsrLogBgintUnregister(CsrSchedBgint irq);
void CsrLogBgintSet(CsrSchedBgint irq);
void CsrLogBgintServiceStart(CsrSchedBgint irq);
void CsrLogBgintServiceDone(CsrSchedBgint irq);
void CsrLogExceptionStateEvent(u16 prim_type,
CsrPrim msg_type,
u16 state,
u32 line,
const char *file);
void CsrLogExceptionGeneral(u16 prim_type,
u16 state,
const char *text,
u32 line,
const char *file);
void CsrLogExceptionWarning(u16 prim_type,
u16 state,
const char *text,
u32 line,
const char *file);
#endif

View file

@ -1,39 +0,0 @@
#ifndef CSR_LOG_CONFIGURE_H__
#define CSR_LOG_CONFIGURE_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include "csr_log.h"
/*--------------------------------------------*/
/* Filtering on log text warning levels */
/*--------------------------------------------*/
typedef u32 CsrLogLevelText;
#define CSR_LOG_LEVEL_TEXT_OFF ((CsrLogLevelText) 0x0000)
#define CSR_LOG_LEVEL_TEXT_CRITICAL ((CsrLogLevelText) 0x0001)
#define CSR_LOG_LEVEL_TEXT_ERROR ((CsrLogLevelText) 0x0002)
#define CSR_LOG_LEVEL_TEXT_WARNING ((CsrLogLevelText) 0x0004)
#define CSR_LOG_LEVEL_TEXT_INFO ((CsrLogLevelText) 0x0008)
#define CSR_LOG_LEVEL_TEXT_DEBUG ((CsrLogLevelText) 0x0010)
#define CSR_LOG_LEVEL_TEXT_ALL ((CsrLogLevelText) 0xFFFF)
/* The log text interface is used by both scheduler tasks and components outside the scheduler context.
* Therefore a CsrLogTextTaskId is introduced. It is effectively considered as two u16's. The lower
* 16 bits corresponds one2one with the scheduler queueId's (CsrSchedQid) and as such these bits can not be used
* by components outside scheduler tasks. The upper 16 bits are allocated for use of components outside the
* scheduler like drivers etc. Components in this range is defined independently by each technology. To avoid
* clashes the technologies are only allowed to assign values within the same restrictive range as allies to
* primitive identifiers. eg. for the framework components outside the scheduler is only allowed to assign
* taskId's in the range 0x0600xxxx to 0x06FFxxxx. And so on for other technologies. */
typedef u32 CsrLogTextTaskId;
#endif

View file

@ -1,124 +0,0 @@
#ifndef CSR_LOG_TEXT_H__
#define CSR_LOG_TEXT_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include "csr_log_configure.h"
typedef struct CsrLogSubOrigin
{
u16 subOriginNumber; /* Id of the given SubOrigin */
const char *subOriginName; /* Prefix Text for this SubOrigin */
} CsrLogSubOrigin;
/* Register a task which is going to use the CSR_LOG_TEXT_XXX interface */
#ifdef CSR_LOG_ENABLE
void CsrLogTextRegister(CsrLogTextTaskId taskId, const char *taskName, u16 subOriginsLength, const CsrLogSubOrigin *subOrigins);
#else
#define CsrLogTextRegister(taskId, taskName, subOriginsLength, subOrigins)
#endif
/* CRITICAL: Conditions that are threatening to the integrity/stability of the
system as a whole. */
#if defined(CSR_LOG_ENABLE) && !defined(CSR_LOG_LEVEL_TEXT_CRITICAL_DISABLE)
void CsrLogTextCritical(CsrLogTextTaskId taskId, u16 subOrigin, const char *formatString, ...);
void CsrLogTextBufferCritical(CsrLogTextTaskId taskId, u16 subOrigin, size_t bufferLength, const void *buffer, const char *formatString, ...);
#define CSR_LOG_TEXT_CRITICAL(taskId_subOrigin_formatString_varargs) CsrLogTextCritical taskId_subOrigin_formatString_varargs
#define CSR_LOG_TEXT_CONDITIONAL_CRITICAL(condition, logtextargs) {if (condition) {CSR_LOG_TEXT_CRITICAL(logtextargs);}}
#define CSR_LOG_TEXT_BUFFER_CRITICAL(taskId_subOrigin_length_buffer_formatString_varargs) CsrLogTextBufferCritical taskId_subOrigin_length_buffer_formatString_varargs
#define CSR_LOG_TEXT_BUFFER_CONDITIONAL_CRITICAL(condition, logtextbufferargs) {if (condition) {CSR_LOG_TEXT_BUFFER_CRITICAL(logtextbufferargs);}}
#else
#define CSR_LOG_TEXT_CRITICAL(taskId_subOrigin_formatString_varargs)
#define CSR_LOG_TEXT_CONDITIONAL_CRITICAL(condition, logtextargs)
#define CSR_LOG_TEXT_BUFFER_CRITICAL(taskId_subOrigin_length_buffer_formatString_varargs)
#define CSR_LOG_TEXT_BUFFER_CONDITIONAL_CRITICAL(condition, logtextbufferargs)
#endif
/* ERROR: Malfunction of a component rendering it unable to operate correctly,
causing lack of functionality but not loss of system integrity/stability. */
#if defined(CSR_LOG_ENABLE) && !defined(CSR_LOG_LEVEL_TEXT_ERROR_DISABLE)
void CsrLogTextError(CsrLogTextTaskId taskId, u16 subOrigin, const char *formatString, ...);
void CsrLogTextBufferError(CsrLogTextTaskId taskId, u16 subOrigin, size_t bufferLength, const void *buffer, const char *formatString, ...);
#define CSR_LOG_TEXT_ERROR(taskId_subOrigin_formatString_varargs) CsrLogTextError taskId_subOrigin_formatString_varargs
#define CSR_LOG_TEXT_CONDITIONAL_ERROR(condition, logtextargs) {if (condition) {CSR_LOG_TEXT_ERROR(logtextargs);}}
#define CSR_LOG_TEXT_BUFFER_ERROR(taskId_subOrigin_length_buffer_formatString_varargs) CsrLogTextBufferError taskId_subOrigin_length_buffer_formatString_varargs
#define CSR_LOG_TEXT_BUFFER_CONDITIONAL_ERROR(condition, logtextbufferargs) {if (condition) {CSR_LOG_TEXT_BUFFER_ERROR(logtextbufferargs);}}
#else
#define CSR_LOG_TEXT_ERROR(taskId_subOrigin_formatString_varargs)
#define CSR_LOG_TEXT_CONDITIONAL_ERROR(condition, logtextargs)
#define CSR_LOG_TEXT_BUFFER_ERROR(taskId_subOrigin_length_buffer_formatString_varargs)
#define CSR_LOG_TEXT_BUFFER_CONDITIONAL_ERROR(condition, logtextbufferargs)
#endif
/* WARNING: Conditions that are unexpected and indicative of possible problems
or violations of specifications, where the result of such deviations does not
lead to malfunction of the component. */
#if defined(CSR_LOG_ENABLE) && !defined(CSR_LOG_LEVEL_TEXT_WARNING_DISABLE)
void CsrLogTextWarning(CsrLogTextTaskId taskId, u16 subOrigin, const char *formatString, ...);
void CsrLogTextBufferWarning(CsrLogTextTaskId taskId, u16 subOrigin, size_t bufferLength, const void *buffer, const char *formatString, ...);
#define CSR_LOG_TEXT_WARNING(taskId_subOrigin_formatString_varargs) CsrLogTextWarning taskId_subOrigin_formatString_varargs
#define CSR_LOG_TEXT_CONDITIONAL_WARNING(condition, logtextargs) {if (condition) {CSR_LOG_TEXT_WARNING(logtextargs);}}
#define CSR_LOG_TEXT_BUFFER_WARNING(taskId_subOrigin_length_buffer_formatString_varargs) CsrLogTextBufferWarning taskId_subOrigin_length_buffer_formatString_varargs
#define CSR_LOG_TEXT_BUFFER_CONDITIONAL_WARNING(condition, logtextbufferargs) {if (condition) {CSR_LOG_TEXT_BUFFER_WARNING(logtextbufferargs);}}
#else
#define CSR_LOG_TEXT_WARNING(taskId_subOrigin_formatString_varargs)
#define CSR_LOG_TEXT_CONDITIONAL_WARNING(condition, logtextargs)
#define CSR_LOG_TEXT_BUFFER_WARNING(taskId_subOrigin_length_buffer_formatString_varargs)
#define CSR_LOG_TEXT_BUFFER_CONDITIONAL_WARNING(condition, logtextbufferargs)
#endif
/* INFO: Important events that may aid in determining the conditions under which
the more severe conditions are encountered. */
#if defined(CSR_LOG_ENABLE) && !defined(CSR_LOG_LEVEL_TEXT_INFO_DISABLE)
void CsrLogTextInfo(CsrLogTextTaskId taskId, u16 subOrigin, const char *formatString, ...);
void CsrLogTextBufferInfo(CsrLogTextTaskId taskId, u16 subOrigin, size_t bufferLength, const void *buffer, const char *formatString, ...);
#define CSR_LOG_TEXT_INFO(taskId_subOrigin_formatString_varargs) CsrLogTextInfo taskId_subOrigin_formatString_varargs
#define CSR_LOG_TEXT_CONDITIONAL_INFO(condition, logtextargs) {if (condition) {CSR_LOG_TEXT_INFO(logtextargs);}}
#define CSR_LOG_TEXT_BUFFER_INFO(taskId_subOrigin_length_buffer_formatString_varargs) CsrLogTextBufferInfo taskId_subOrigin_length_buffer_formatString_varargs
#define CSR_LOG_TEXT_BUFFER_CONDITIONAL_INFO(condition, logtextbufferargs) {if (condition) {CSR_LOG_TEXT_BUFFER_INFO(logtextbufferargs);}}
#else
#define CSR_LOG_TEXT_INFO(taskId_subOrigin_formatString_varargs)
#define CSR_LOG_TEXT_CONDITIONAL_INFO(condition, logtextargs)
#define CSR_LOG_TEXT_BUFFER_INFO(taskId_subOrigin_length_buffer_formatString_varargs)
#define CSR_LOG_TEXT_BUFFER_CONDITIONAL_INFO(condition, logtextbufferargs)
#endif
/* DEBUG: Similar to INFO, but dedicated to events that occur more frequently. */
#if defined(CSR_LOG_ENABLE) && !defined(CSR_LOG_LEVEL_TEXT_DEBUG_DISABLE)
void CsrLogTextDebug(CsrLogTextTaskId taskId, u16 subOrigin, const char *formatString, ...);
void CsrLogTextBufferDebug(CsrLogTextTaskId taskId, u16 subOrigin, size_t bufferLength, const void *buffer, const char *formatString, ...);
#define CSR_LOG_TEXT_DEBUG(taskId_subOrigin_formatString_varargs) CsrLogTextDebug taskId_subOrigin_formatString_varargs
#define CSR_LOG_TEXT_CONDITIONAL_DEBUG(condition, logtextargs) {if (condition) {CSR_LOG_TEXT_DEBUG(logtextargs);}}
#define CSR_LOG_TEXT_BUFFER_DEBUG(taskId_subOrigin_length_buffer_formatString_varargs) CsrLogTextBufferDebug taskId_subOrigin_length_buffer_formatString_varargs
#define CSR_LOG_TEXT_BUFFER_CONDITIONAL_DEBUG(condition, logtextbufferargs) {if (condition) {CSR_LOG_TEXT_BUFFER_DEBUG(logtextbufferargs);}}
#else
#define CSR_LOG_TEXT_DEBUG(taskId_subOrigin_formatString_varargs)
#define CSR_LOG_TEXT_CONDITIONAL_DEBUG(condition, logtextargs)
#define CSR_LOG_TEXT_BUFFER_DEBUG(taskId_subOrigin_length_buffer_formatString_varargs)
#define CSR_LOG_TEXT_BUFFER_CONDITIONAL_DEBUG(condition, logtextbufferargs)
#endif
/* CSR_LOG_TEXT_ASSERT (CRITICAL) */
#ifdef CSR_LOG_ENABLE
#define CSR_LOG_TEXT_ASSERT(origin, suborigin, condition) \
{if (!(condition)) {CSR_LOG_TEXT_CRITICAL((origin, suborigin, "Assertion \"%s\" failed at %s:%u", #condition, __FILE__, __LINE__));}}
#else
#define CSR_LOG_TEXT_ASSERT(origin, suborigin, condition)
#endif
/* CSR_LOG_TEXT_UNHANDLED_PRIM (CRITICAL) */
#ifdef CSR_LOG_ENABLE
#define CSR_LOG_TEXT_UNHANDLED_PRIMITIVE(origin, suborigin, primClass, primType) \
CSR_LOG_TEXT_CRITICAL((origin, suborigin, "Unhandled primitive 0x%04X:0x%04X at %s:%u", primClass, primType, __FILE__, __LINE__))
#else
#define CSR_LOG_TEXT_UNHANDLED_PRIMITIVE(origin, suborigin, primClass, primType)
#endif
#endif

View file

@ -1,39 +0,0 @@
#ifndef CSR_MACRO_H__
#define CSR_MACRO_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/types.h>
#define FALSE (0)
#define TRUE (1)
/*------------------------------------------------------------------*/
/* Endian conversion */
/*------------------------------------------------------------------*/
#define CSR_GET_UINT16_FROM_LITTLE_ENDIAN(ptr) (((u16) ((u8 *) (ptr))[0]) | ((u16) ((u8 *) (ptr))[1]) << 8)
#define CSR_GET_UINT32_FROM_LITTLE_ENDIAN(ptr) (((u32) ((u8 *) (ptr))[0]) | ((u32) ((u8 *) (ptr))[1]) << 8 | \
((u32) ((u8 *) (ptr))[2]) << 16 | ((u32) ((u8 *) (ptr))[3]) << 24)
#define CSR_COPY_UINT16_TO_LITTLE_ENDIAN(uint, ptr) ((u8 *) (ptr))[0] = ((u8) ((uint) & 0x00FF)); \
((u8 *) (ptr))[1] = ((u8) ((uint) >> 8))
#define CSR_COPY_UINT32_TO_LITTLE_ENDIAN(uint, ptr) ((u8 *) (ptr))[0] = ((u8) ((uint) & 0x000000FF)); \
((u8 *) (ptr))[1] = ((u8) (((uint) >> 8) & 0x000000FF)); \
((u8 *) (ptr))[2] = ((u8) (((uint) >> 16) & 0x000000FF)); \
((u8 *) (ptr))[3] = ((u8) (((uint) >> 24) & 0x000000FF))
/*------------------------------------------------------------------*/
/* Misc */
/*------------------------------------------------------------------*/
/* Use this macro on unused local variables that cannot be removed (such as
unused function parameters). This will quell warnings from certain compilers
and static code analysis tools like Lint and Valgrind. */
#define CSR_UNUSED(x) ((void) (x))
#endif

View file

@ -1,17 +0,0 @@
#ifndef CSR_MSG_TRANSPORT_H__
#define CSR_MSG_TRANSPORT_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CsrMsgTransport
#define CsrMsgTransport CsrSchedMessagePut
#endif
#endif /* CSR_MSG_TRANSPORT */

View file

@ -1,291 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/slab.h>
#include "csr_sched.h"
#include "csr_msgconv.h"
#include "csr_macro.h"
static CsrMsgConvEntry *converter;
CsrMsgConvPrimEntry *CsrMsgConvFind(u16 primType)
{
CsrMsgConvPrimEntry *ptr = NULL;
if (converter)
{
ptr = converter->profile_converters;
while (ptr)
{
if (ptr->primType == primType)
{
break;
}
else
{
ptr = ptr->next;
}
}
}
return ptr;
}
static const CsrMsgConvMsgEntry *find_msg_converter(CsrMsgConvPrimEntry *ptr, u16 msgType)
{
const CsrMsgConvMsgEntry *cv = ptr->conv;
if (ptr->lookupFunc)
{
return (const CsrMsgConvMsgEntry *) ptr->lookupFunc((CsrMsgConvMsgEntry *) cv, msgType);
}
while (cv)
{
if (cv->serFunc == NULL)
{
/* We've reached the end of the chain */
cv = NULL;
break;
}
if (cv->msgType == msgType)
{
break;
}
else
{
cv++;
}
}
return cv;
}
static void *deserialize_data(u16 primType,
size_t length,
u8 *data)
{
CsrMsgConvPrimEntry *ptr;
u8 *ret;
ptr = CsrMsgConvFind(primType);
if (ptr)
{
const CsrMsgConvMsgEntry *cv;
u16 msgId = 0;
size_t offset = 0;
CsrUint16Des(&msgId, data, &offset);
cv = find_msg_converter(ptr, msgId);
if (cv)
{
ret = cv->deserFunc(data, length);
}
else
{
ret = NULL;
}
}
else
{
ret = NULL;
}
return ret;
}
static size_t sizeof_message(u16 primType, void *msg)
{
CsrMsgConvPrimEntry *ptr = CsrMsgConvFind(primType);
size_t ret;
if (ptr)
{
const CsrMsgConvMsgEntry *cv;
u16 msgId = *(u16 *) msg;
cv = find_msg_converter(ptr, msgId);
if (cv)
{
ret = cv->sizeofFunc(msg);
}
else
{
ret = 0;
}
}
else
{
ret = 0;
}
return ret;
}
static u8 free_message(u16 primType, u8 *data)
{
CsrMsgConvPrimEntry *ptr;
u8 ret;
ptr = CsrMsgConvFind(primType);
if (ptr)
{
const CsrMsgConvMsgEntry *cv;
u16 msgId = *(u16 *) data;
cv = find_msg_converter(ptr, msgId);
if (cv)
{
cv->freeFunc(data);
ret = TRUE;
}
else
{
ret = FALSE;
}
}
else
{
ret = FALSE;
}
return ret;
}
static u8 *serialize_message(u16 primType,
void *msg,
size_t *length,
u8 *buffer)
{
CsrMsgConvPrimEntry *ptr;
u8 *ret;
ptr = CsrMsgConvFind(primType);
*length = 0;
if (ptr)
{
const CsrMsgConvMsgEntry *cv;
cv = find_msg_converter(ptr, *(u16 *) msg);
if (cv)
{
ret = cv->serFunc(buffer, length, msg);
}
else
{
ret = NULL;
}
}
else
{
ret = NULL;
}
return ret;
}
size_t CsrMsgConvSizeof(u16 primType, void *msg)
{
return sizeof_message(primType, msg);
}
u8 *CsrMsgConvSerialize(u8 *buffer, size_t maxBufferOffset, size_t *offset, u16 primType, void *msg)
{
if (converter)
{
size_t serializedLength;
u8 *bufSerialized;
u8 *bufOffset = &buffer[*offset];
bufSerialized = converter->serialize_message(primType, msg, &serializedLength, bufOffset);
*offset += serializedLength;
return bufSerialized;
}
else
{
return NULL;
}
}
/* Insert profile converter at head of converter list. */
void CsrMsgConvInsert(u16 primType, const CsrMsgConvMsgEntry *ce)
{
CsrMsgConvPrimEntry *pc;
pc = CsrMsgConvFind(primType);
if (pc)
{
/* Already registered. Do nothing */
}
else
{
pc = kmalloc(sizeof(*pc), GFP_KERNEL);
pc->primType = primType;
pc->conv = ce;
pc->lookupFunc = NULL;
pc->next = converter->profile_converters;
converter->profile_converters = pc;
}
}
EXPORT_SYMBOL_GPL(CsrMsgConvInsert);
CsrMsgConvMsgEntry *CsrMsgConvFindEntry(u16 primType, u16 msgType)
{
CsrMsgConvPrimEntry *ptr = CsrMsgConvFind(primType);
if (ptr)
{
return (CsrMsgConvMsgEntry *) find_msg_converter(ptr, msgType);
}
return NULL;
}
EXPORT_SYMBOL_GPL(CsrMsgConvFindEntry);
CsrMsgConvMsgEntry *CsrMsgConvFindEntryByMsg(u16 primType, const void *msg)
{
CsrMsgConvPrimEntry *ptr = CsrMsgConvFind(primType);
if (ptr && msg)
{
u16 msgType = *((u16 *) msg);
return (CsrMsgConvMsgEntry *) find_msg_converter(ptr, msgType);
}
return NULL;
}
void CsrMsgConvCustomLookupRegister(u16 primType, CsrMsgCustomLookupFunc *lookupFunc)
{
CsrMsgConvPrimEntry *ptr = CsrMsgConvFind(primType);
if (ptr)
{
ptr->lookupFunc = lookupFunc;
}
}
EXPORT_SYMBOL_GPL(CsrMsgConvCustomLookupRegister);
CsrMsgConvEntry *CsrMsgConvInit(void)
{
if (!converter)
{
converter = kmalloc(sizeof(CsrMsgConvEntry), GFP_KERNEL);
converter->profile_converters = NULL;
converter->free_message = free_message;
converter->sizeof_message = sizeof_message;
converter->serialize_message = serialize_message;
converter->deserialize_data = deserialize_data;
}
return converter;
}
EXPORT_SYMBOL_GPL(CsrMsgConvInit);

View file

@ -1,78 +0,0 @@
#ifndef CSR_MSGCONV_H__
#define CSR_MSGCONV_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/types.h>
#include "csr_prim_defs.h"
#include "csr_sched.h"
typedef size_t (CsrMsgSizeofFunc)(void *msg);
typedef u8 *(CsrMsgSerializeFunc)(u8 *buffer, size_t *length, void *msg);
typedef void (CsrMsgFreeFunc)(void *msg);
typedef void *(CsrMsgDeserializeFunc)(u8 *buffer, size_t length);
/* Converter entry for one message type */
typedef struct CsrMsgConvMsgEntry
{
u16 msgType;
CsrMsgSizeofFunc *sizeofFunc;
CsrMsgSerializeFunc *serFunc;
CsrMsgDeserializeFunc *deserFunc;
CsrMsgFreeFunc *freeFunc;
} CsrMsgConvMsgEntry;
/* Optional lookup function */
typedef CsrMsgConvMsgEntry *(CsrMsgCustomLookupFunc)(CsrMsgConvMsgEntry *ce, u16 msgType);
/* All converter entries for one specific primitive */
typedef struct CsrMsgConvPrimEntry
{
u16 primType;
const CsrMsgConvMsgEntry *conv;
CsrMsgCustomLookupFunc *lookupFunc;
struct CsrMsgConvPrimEntry *next;
} CsrMsgConvPrimEntry;
typedef struct
{
CsrMsgConvPrimEntry *profile_converters;
void *(*deserialize_data)(u16 primType, size_t length, u8 * data);
u8 (*free_message)(u16 primType, u8 *data);
size_t (*sizeof_message)(u16 primType, void *msg);
u8 *(*serialize_message)(u16 primType, void *msg,
size_t * length,
u8 * buffer);
} CsrMsgConvEntry;
size_t CsrMsgConvSizeof(u16 primType, void *msg);
u8 *CsrMsgConvSerialize(u8 *buffer, size_t maxBufferOffset, size_t *offset, u16 primType, void *msg);
void CsrMsgConvCustomLookupRegister(u16 primType, CsrMsgCustomLookupFunc *lookupFunc);
void CsrMsgConvInsert(u16 primType, const CsrMsgConvMsgEntry *ce);
CsrMsgConvPrimEntry *CsrMsgConvFind(u16 primType);
CsrMsgConvMsgEntry *CsrMsgConvFindEntry(u16 primType, u16 msgType);
CsrMsgConvMsgEntry *CsrMsgConvFindEntryByMsg(u16 primType, const void *msg);
CsrMsgConvEntry *CsrMsgConvInit(void);
/* Prototypes for primitive type serializers */
void CsrUint8Ser(u8 *buffer, size_t *offset, u8 value);
void CsrUint16Ser(u8 *buffer, size_t *offset, u16 value);
void CsrUint32Ser(u8 *buffer, size_t *offset, u32 value);
void CsrMemCpySer(u8 *buffer, size_t *offset, const void *value, size_t length);
void CsrCharStringSer(u8 *buffer, size_t *offset, const char *value);
void CsrUint8Des(u8 *value, u8 *buffer, size_t *offset);
void CsrUint16Des(u16 *value, u8 *buffer, size_t *offset);
void CsrUint32Des(u32 *value, u8 *buffer, size_t *offset);
void CsrMemCpyDes(void *value, u8 *buffer, size_t *offset, size_t length);
void CsrCharStringDes(char **value, u8 *buffer, size_t *offset);
#endif

View file

@ -1,55 +0,0 @@
#ifndef CSR_PRIM_DEFS_H__
#define CSR_PRIM_DEFS_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/************************************************************************************
* Segmentation of primitives in upstream and downstream segment
************************************************************************************/
typedef u16 CsrPrim;
#define CSR_PRIM_UPSTREAM ((CsrPrim) (0x8000))
/************************************************************************************
* Primitive definitions for Synergy framework
************************************************************************************/
#define CSR_SYNERGY_EVENT_CLASS_BASE ((u16) (0x0600))
#define CSR_HCI_PRIM ((u16) (0x0000 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_BCCMD_PRIM ((u16) (0x0001 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_HQ_PRIM ((u16) (0x0002 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_VM_PRIM ((u16) (0x0003 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_TM_BLUECORE_PRIM ((u16) (0x0004 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_FP_PRIM ((u16) (0x0005 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_IP_SOCKET_PRIM ((u16) (0x0006 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_IP_ETHER_PRIM ((u16) (0x0007 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_IP_IFCONFIG_PRIM ((u16) (0x0008 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_IP_INTERNAL_PRIM ((u16) (0x0009 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_FSAL_PRIM ((u16) (0x000A | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_DATA_STORE_PRIM ((u16) (0x000B | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_AM_PRIM ((u16) (0x000C | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_TLS_PRIM ((u16) (0x000D | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_DHCP_SERVER_PRIM ((u16) (0x000E | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_TFTP_PRIM ((u16) (0x000F | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_DSPM_PRIM ((u16) (0x0010 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define CSR_TLS_INTERNAL_PRIM ((u16) (0x0011 | CSR_SYNERGY_EVENT_CLASS_BASE))
#define NUMBER_OF_CSR_FW_EVENTS (CSR_DSPM_PRIM - CSR_SYNERGY_EVENT_CLASS_BASE + 1)
#define CSR_SYNERGY_EVENT_CLASS_MISC_BASE ((u16) (0x06A0))
#define CSR_UI_PRIM ((u16) (0x0000 | CSR_SYNERGY_EVENT_CLASS_MISC_BASE))
#define CSR_APP_PRIM ((u16) (0x0001 | CSR_SYNERGY_EVENT_CLASS_MISC_BASE))
#define CSR_SDIO_PROBE_PRIM ((u16) (0x0002 | CSR_SYNERGY_EVENT_CLASS_MISC_BASE))
#define NUMBER_OF_CSR_FW_MISC_EVENTS (CSR_SDIO_PROBE_PRIM - CSR_SYNERGY_EVENT_CLASS_MISC_BASE + 1)
#define CSR_ENV_PRIM ((u16) (0x00FF | CSR_SYNERGY_EVENT_CLASS_MISC_BASE))
#endif /* CSR_PRIM_DEFS_H__ */

View file

@ -1,17 +0,0 @@
#ifndef CSR_RESULT_H__
#define CSR_RESULT_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
typedef u16 CsrResult;
#define CSR_RESULT_SUCCESS ((CsrResult) 0x0000)
#define CSR_RESULT_FAILURE ((CsrResult) 0xFFFF)
#endif

View file

@ -1,85 +0,0 @@
#ifndef CSR_SCHED_H__
#define CSR_SCHED_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/types.h>
#include "csr_time.h"
/* An identifier issued by the scheduler. */
typedef u32 CsrSchedIdentifier;
/* A task identifier */
typedef u16 CsrSchedTaskId;
/* A queue identifier */
typedef u16 CsrSchedQid;
/* A message identifier */
typedef CsrSchedIdentifier CsrSchedMsgId;
/* A timer event identifier */
typedef CsrSchedIdentifier CsrSchedTid;
#define CSR_SCHED_TID_INVALID ((CsrSchedTid) 0)
/* Time constants. */
#define CSR_SCHED_TIME_MAX (0xFFFFFFFF)
#define CSR_SCHED_MILLISECOND (1000)
#define CSR_SCHED_SECOND (1000 * CSR_SCHED_MILLISECOND)
#define CSR_SCHED_MINUTE (60 * CSR_SCHED_SECOND)
/* Queue and primitive that identifies the environment */
#define CSR_SCHED_TASK_ID 0xFFFF
#define CSR_SCHED_PRIM (CSR_SCHED_TASK_ID)
#define CSR_SCHED_EXCLUDED_MODULE_QUEUE 0xFFFF
/*
* Background interrupt definitions
*/
typedef u16 CsrSchedBgint;
#define CSR_SCHED_BGINT_INVALID ((CsrSchedBgint) 0xFFFF)
/*----------------------------------------------------------------------------*
* NAME
* CsrSchedMessagePut
*
* DESCRIPTION
* Sends a message consisting of the integer "mi" and the void * pointer
* "mv" to the message queue "q".
*
* "mi" and "mv" are neither inspected nor changed by the scheduler - the
* task that owns "q" is expected to make sense of the values. "mv" may
* be null.
*
* NOTE
* If "mv" is not null then it will typically be a chunk of kmalloc()ed
* memory, though there is no need for it to be so. Tasks should normally
* obey the convention that when a message built with kmalloc()ed memory
* is given to CsrSchedMessagePut() then ownership of the memory is ceded to the
* scheduler - and eventually to the recipient task. I.e., the receiver of
* the message will be expected to kfree() the message storage.
*
* RETURNS
* void.
*
*----------------------------------------------------------------------------*/
#if defined(CSR_LOG_ENABLE) && defined(CSR_LOG_INCLUDE_FILE_NAME_AND_LINE_NUMBER)
void CsrSchedMessagePutStringLog(CsrSchedQid q,
u16 mi,
void *mv,
u32 line,
const char *file);
#define CsrSchedMessagePut(q, mi, mv) CsrSchedMessagePutStringLog((q), (mi), (mv), __LINE__, __FILE__)
#else
void CsrSchedMessagePut(CsrSchedQid q,
u16 mi,
void *mv);
#endif
#endif

View file

@ -1,723 +0,0 @@
#ifndef CSR_SDIO_H__
#define CSR_SDIO_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include "csr_result.h"
/* Result Codes */
#define CSR_SDIO_RESULT_INVALID_VALUE ((CsrResult) 1) /* Invalid argument value */
#define CSR_SDIO_RESULT_NO_DEVICE ((CsrResult) 2) /* The specified device is no longer present */
#define CSR_SDIO_RESULT_CRC_ERROR ((CsrResult) 3) /* The transmitted/received data or command response contained a CRC error */
#define CSR_SDIO_RESULT_TIMEOUT ((CsrResult) 4) /* No command response or data received from device, or function enable/disable did not succeed within timeout period */
#define CSR_SDIO_RESULT_NOT_RESET ((CsrResult) 5) /* The device was not reset */
/* Features (for use in features member of CsrSdioFunction) */
#define CSR_SDIO_FEATURE_BYTE_MODE 0x00000001 /* Transfer sizes do not have to be a multiple of block size */
#define CSR_SDIO_FEATURE_DMA_CAPABLE_MEM_REQUIRED 0x00000002 /* Bulk operations require DMA friendly memory */
/* CsrSdioFunctionId wildcards (for use in CsrSdioFunctionId members) */
#define CSR_SDIO_ANY_MANF_ID 0xFFFF
#define CSR_SDIO_ANY_CARD_ID 0xFFFF
#define CSR_SDIO_ANY_SDIO_FUNCTION 0xFF
#define CSR_SDIO_ANY_SDIO_INTERFACE 0xFF
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioFunctionId
*
* DESCRIPTION
* This structure describes one or more functions of a device, based on
* four qualitative measures. The CsrSdioFunctionId wildcard defines can be
* used for making the CsrSdioFunctionId match more than one function.
*
* MEMBERS
* manfId - Vendor ID (or CSR_SDIO_ANY_MANF_ID).
* cardId - Device ID (or CSR_SDIO_ANY_CARD_ID).
* sdioFunction - SDIO Function number (or CSR_SDIO_ANY_SDIO_FUNCTION).
* sdioInterface - SDIO Standard Interface Code (or CSR_SDIO_ANY_SDIO_INTERFACE)
*
*----------------------------------------------------------------------------*/
typedef struct
{
u16 manfId; /* Vendor ID to match or CSR_SDIO_ANY_MANF_ID */
u16 cardId; /* Device ID to match or CSR_SDIO_ANY_CARD_ID */
u8 sdioFunction; /* SDIO Function number to match or CSR_SDIO_ANY_SDIO_FUNCTION */
u8 sdioInterface; /* SDIO Standard Interface Code to match or CSR_SDIO_ANY_SDIO_INTERFACE */
} CsrSdioFunctionId;
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioFunction
*
* DESCRIPTION
* This structure represents a single function on a device.
*
* MEMBERS
* sdioId - A CsrSdioFunctionId describing this particular function. The
* subfield shall not contain any CsrSdioFunctionId wildcards. The
* subfields shall describe the specific single function
* represented by this structure.
* blockSize - Actual configured block size, or 0 if unconfigured.
* features - Bit mask with any of CSR_SDIO_FEATURE_* set.
* device - Handle of device containing the function. If two functions have
* the same device handle, they reside on the same device.
* driverData - For use by the Function Driver. The SDIO Driver shall not
* attempt to dereference the pointer.
* priv - For use by the SDIO Driver. The Function Driver shall not attempt
* to dereference the pointer.
*
*
*----------------------------------------------------------------------------*/
typedef struct
{
CsrSdioFunctionId sdioId;
u16 blockSize; /* Actual configured block size, or 0 if unconfigured */
u32 features; /* Bit mask with any of CSR_SDIO_FEATURE_* set */
void *device; /* Handle of device containing the function */
void *driverData; /* For use by the Function Driver */
void *priv; /* For use by the SDIO Driver */
} CsrSdioFunction;
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioInsertedCallback, CsrSdioRemovedCallback
*
* DESCRIPTION
* CsrSdioInsertedCallback is called when a function becomes available to
* a registered Function Driver that supports the function.
* CsrSdioRemovedCallback is called when a function is no longer available
* to a Function Driver, either because the device has been removed, or the
* Function Driver has been unregistered.
*
* NOTE: These functions are implemented by the Function Driver, and are
* passed as function pointers in the CsrSdioFunctionDriver struct.
*
* PARAMETERS
* function - Pointer to struct representing the function.
*
*----------------------------------------------------------------------------*/
typedef void (*CsrSdioInsertedCallback)(CsrSdioFunction *function);
typedef void (*CsrSdioRemovedCallback)(CsrSdioFunction *function);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioInterruptDsrCallback, CsrSdioInterruptCallback
*
* DESCRIPTION
* CsrSdioInterruptCallback is called when an interrupt occurs on the
* the device associated with the specified function.
*
* NOTE: These functions are implemented by the Function Driver, and are
* passed as function pointers in the CsrSdioFunctionDriver struct.
*
* PARAMETERS
* function - Pointer to struct representing the function.
*
* RETURNS (only CsrSdioInterruptCallback)
* A pointer to a CsrSdioInterruptDsrCallback function.
*
*----------------------------------------------------------------------------*/
typedef void (*CsrSdioInterruptDsrCallback)(CsrSdioFunction *function);
typedef CsrSdioInterruptDsrCallback (*CsrSdioInterruptCallback)(CsrSdioFunction *function);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioSuspendCallback, CsrSdioResumeCallback
*
* DESCRIPTION
* CsrSdioSuspendCallback is called when the system is preparing to go
* into a suspended state. CsrSdioResumeCallback is called when the system
* has entered an active state again.
*
* NOTE: These functions are implemented by the Function Driver, and are
* passed as function pointers in the CsrSdioFunctionDriver struct.
*
* PARAMETERS
* function - Pointer to struct representing the function.
*
*----------------------------------------------------------------------------*/
typedef void (*CsrSdioSuspendCallback)(CsrSdioFunction *function);
typedef void (*CsrSdioResumeCallback)(CsrSdioFunction *function);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioAsyncCallback, CsrSdioAsyncDsrCallback
*
* DESCRIPTION
* CsrSdioAsyncCallback is called when an asynchronous operation completes.
*
* NOTE: These functions are implemented by the Function Driver, and are
* passed as function pointers in the function calls that initiate
* the operation.
*
* PARAMETERS
* function - Pointer to struct representing the function.
* result - The result of the operation that completed. See the description
* of the initiating function for possible result values.
*
* RETURNS (only CsrSdioAsyncCallback)
* A pointer to a CsrSdioAsyncDsrCallback function.
*
*----------------------------------------------------------------------------*/
typedef void (*CsrSdioAsyncDsrCallback)(CsrSdioFunction *function, CsrResult result);
typedef CsrSdioAsyncDsrCallback (*CsrSdioAsyncCallback)(CsrSdioFunction *function, CsrResult result);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioFunctionDriver
*
* DESCRIPTION
* Structure representing a Function Driver.
*
* MEMBERS
* inserted - Callback, see description of CsrSdioInsertedCallback.
* removed - Callback, see description of CsrSdioRemovedCallback.
* intr - Callback, see description of CsrSdioInterruptCallback.
* suspend - Callback, see description of CsrSdioSuspendCallback.
* resume - Callback, see description of CsrSdioResumeCallback.
* ids - Array of CsrSdioFunctionId describing one or more functions that
* are supported by the Function Driver.
* idsCount - Length of the ids array.
* priv - For use by the SDIO Driver. The Function Driver may initialise
* it to NULL, but shall otherwise not access the pointer or attempt
* to dereference it.
*
*----------------------------------------------------------------------------*/
typedef struct
{
CsrSdioInsertedCallback inserted;
CsrSdioRemovedCallback removed;
CsrSdioInterruptCallback intr;
CsrSdioSuspendCallback suspend;
CsrSdioResumeCallback resume;
CsrSdioFunctionId *ids;
u8 idsCount;
void *priv; /* For use by the SDIO Driver */
} CsrSdioFunctionDriver;
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioFunctionDriverRegister
*
* DESCRIPTION
* Register a Function Driver.
*
* PARAMETERS
* functionDriver - Pointer to struct describing the Function Driver.
*
* RETURNS
* CSR_RESULT_SUCCESS - The Function Driver was successfully
* registered.
* CSR_RESULT_FAILURE - Unable to register the function driver,
* because of an unspecified/unknown error. The
* Function Driver has not been registered.
* CSR_SDIO_RESULT_INVALID_VALUE - The specified Function Driver pointer
* does not point at a valid Function
* Driver structure, or some of the members
* contain invalid entries.
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioFunctionDriverRegister(CsrSdioFunctionDriver *functionDriver);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioFunctionDriverUnregister
*
* DESCRIPTION
* Unregister a previously registered Function Driver.
*
* PARAMETERS
* functionDriver - pointer to struct describing the Function Driver.
*
*----------------------------------------------------------------------------*/
void CsrSdioFunctionDriverUnregister(CsrSdioFunctionDriver *functionDriver);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioFunctionEnable, CsrSdioFunctionDisable
*
* DESCRIPTION
* Enable/disable the specified function by setting/clearing the
* corresponding bit in the I/O Enable register in function 0, and then
* periodically reading the related bit in the I/O Ready register until it
* is set/clear, limited by an implementation defined timeout.
*
* PARAMETERS
* function - Pointer to struct representing the function.
*
* RETURNS
* CSR_RESULT_SUCCESS - The specified function was enabled/disabled.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
* CSR_SDIO_RESULT_NO_DEVICE - The device does not exist anymore.
* CSR_SDIO_RESULT_CRC_ERROR - A CRC error occurred. The state of the
* related bit in the I/O Enable register is
* undefined.
* CSR_SDIO_RESULT_TIMEOUT - No response from the device, or the related
* bit in the I/O ready register was not
* set/cleared within the timeout period.
*
* NOTE: If the SDIO R5 response is available, and either of the
* FUNCTION_NUMBER or OUT_OF_RANGE bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE shall be returned. If the ERROR bit
* is set (but none of FUNCTION_NUMBER or OUT_OF_RANGE),
* CSR_RESULT_FAILURE shall be returned. The ILLEGAL_COMMAND and
* COM_CRC_ERROR bits shall be ignored.
*
* If the CSPI response is available, and any of the
* FUNCTION_DISABLED or CLOCK_DISABLED bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE will be returned.
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioFunctionEnable(CsrSdioFunction *function);
CsrResult CsrSdioFunctionDisable(CsrSdioFunction *function);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioInterruptEnable, CsrSdioInterruptDisable
*
* DESCRIPTION
* Enable/disable the interrupt for the specified function by
* setting/clearing the corresponding bit in the INT Enable register in
* function 0.
*
* PARAMETERS
* function - Pointer to struct representing the function.
*
* RETURNS
* CSR_RESULT_SUCCESS - The specified function was enabled/disabled.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
* CSR_SDIO_RESULT_NO_DEVICE - The device does not exist anymore.
* CSR_SDIO_RESULT_CRC_ERROR - A CRC error occurred. The state of the
* related bit in the INT Enable register is
* unchanged.
* CSR_SDIO_RESULT_INVALID_VALUE - The specified function cannot be
* enabled/disabled, because it either
* does not exist or it is not possible to
* individually enable/disable functions.
* CSR_SDIO_RESULT_TIMEOUT - No response from the device.
*
* NOTE: If the SDIO R5 response is available, and either of the
* FUNCTION_NUMBER or OUT_OF_RANGE bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE shall be returned. If the ERROR bit
* is set (but none of FUNCTION_NUMBER or OUT_OF_RANGE),
* CSR_RESULT_FAILURE shall be returned. The ILLEGAL_COMMAND and
* COM_CRC_ERROR bits shall be ignored.
*
* If the CSPI response is available, and any of the
* FUNCTION_DISABLED or CLOCK_DISABLED bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE will be returned.
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioInterruptEnable(CsrSdioFunction *function);
CsrResult CsrSdioInterruptDisable(CsrSdioFunction *function);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioInterruptAcknowledge
*
* DESCRIPTION
* Acknowledge that a signalled interrupt has been handled. Shall only
* be called once, and exactly once for each signalled interrupt to the
* corresponding function.
*
* PARAMETERS
* function - Pointer to struct representing the function to which the
* event was signalled.
*
*----------------------------------------------------------------------------*/
void CsrSdioInterruptAcknowledge(CsrSdioFunction *function);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioInsertedAcknowledge, CsrSdioRemovedAcknowledge
*
* DESCRIPTION
* Acknowledge that a signalled inserted/removed event has been handled.
* Shall only be called once, and exactly once for each signalled event to
* the corresponding function.
*
* PARAMETERS
* function - Pointer to struct representing the function to which the
* inserted was signalled.
* result (CsrSdioInsertedAcknowledge only)
* CSR_RESULT_SUCCESS - The Function Driver has accepted the
* function, and the function is attached to
* the Function Driver until the
* CsrSdioRemovedCallback is called and
* acknowledged.
* CSR_RESULT_FAILURE - Unable to accept the function. The
* function is not attached to the Function
* Driver, and it may be passed to another
* Function Driver which supports the
* function.
*
*----------------------------------------------------------------------------*/
void CsrSdioInsertedAcknowledge(CsrSdioFunction *function, CsrResult result);
void CsrSdioRemovedAcknowledge(CsrSdioFunction *function);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioSuspendAcknowledge, CsrSdioResumeAcknowledge
*
* DESCRIPTION
* Acknowledge that a signalled suspend event has been handled. Shall only
* be called once, and exactly once for each signalled event to the
* corresponding function.
*
* PARAMETERS
* function - Pointer to struct representing the function to which the
* event was signalled.
* result
* CSR_RESULT_SUCCESS - Successfully suspended/resumed.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
*
*----------------------------------------------------------------------------*/
void CsrSdioSuspendAcknowledge(CsrSdioFunction *function, CsrResult result);
void CsrSdioResumeAcknowledge(CsrSdioFunction *function, CsrResult result);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioBlockSizeSet
*
* DESCRIPTION
* Set the block size to use for the function. The actual configured block
* size shall be the minimum of:
* 1) Maximum block size supported by the function.
* 2) Maximum block size supported by the host controller.
* 3) The block size specified by the blockSize argument.
*
* When this function returns, the actual configured block size is
* available in the blockSize member of the function struct.
*
* PARAMETERS
* function - Pointer to struct representing the function.
* blockSize - Block size to use for the function. Valid range is 1 to
* 2048.
*
* RETURNS
* CSR_RESULT_SUCCESS - The block size register on the chip
* was updated.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
* CSR_SDIO_RESULT_INVALID_VALUE - One or more arguments were invalid.
* CSR_SDIO_RESULT_NO_DEVICE - The device does not exist anymore.
* CSR_SDIO_RESULT_CRC_ERROR - A CRC error occurred. The configured block
* size is undefined.
* CSR_SDIO_RESULT_TIMEOUT - No response from the device.
*
* NOTE: If the SDIO R5 response is available, and the FUNCTION_NUMBER
* bits is set, CSR_SDIO_RESULT_INVALID_VALUE shall be returned.
* If the ERROR bit is set (but not FUNCTION_NUMBER),
* CSR_RESULT_FAILURE shall be returned. The ILLEGAL_COMMAND and
* COM_CRC_ERROR bits shall be ignored.
*
* If the CSPI response is available, and any of the
* FUNCTION_DISABLED or CLOCK_DISABLED bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE will be returned.
*
* NOTE: Setting the block size requires two individual operations. The
* implementation shall ignore the OUT_OF_RANGE bit of the SDIO R5
* response for the first operation, as the partially configured
* block size may be out of range, even if the final block size
* (after the second operation) is in the valid range.
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioBlockSizeSet(CsrSdioFunction *function, u16 blockSize);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioMaxBusClockFrequencySet
*
* DESCRIPTION
* Set the maximum clock frequency to use for the device associated with
* the specified function. The actual configured clock frequency for the
* device shall be the minimum of:
* 1) Maximum clock frequency supported by the device.
* 2) Maximum clock frequency supported by the host controller.
* 3) Maximum clock frequency specified for any function on the same
* device.
*
* If the clock frequency exceeds 25MHz, it is the responsibility of the
* SDIO driver to enable high speed mode on the device, using the standard
* defined procedure, before increasing the frequency beyond the limit.
*
* Note that the clock frequency configured affects all functions on the
* same device.
*
* PARAMETERS
* function - Pointer to struct representing the function.
* maxFrequency - The maximum clock frequency for the function in Hertz.
*
* RETURNS
* CSR_RESULT_SUCCESS - The maximum clock frequency was successfully
* set for the function.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
* CSR_SDIO_RESULT_INVALID_VALUE - One or more arguments were invalid.
* CSR_SDIO_RESULT_NO_DEVICE - The device does not exist anymore.
*
* NOTE: If the SDIO R5 response is available, and the FUNCTION_NUMBER
* bits is set, CSR_SDIO_RESULT_INVALID_VALUE shall be returned.
* If the ERROR bit is set (but not FUNCTION_NUMBER),
* CSR_RESULT_FAILURE shall be returned. The ILLEGAL_COMMAND and
* COM_CRC_ERROR bits shall be ignored.
*
* If the CSPI response is available, and any of the
* FUNCTION_DISABLED or CLOCK_DISABLED bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE will be returned.
*
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioMaxBusClockFrequencySet(CsrSdioFunction *function, u32 maxFrequency);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioRead8, CsrSdioWrite8, CsrSdioRead8Async, CsrSdioWrite8Async
*
* DESCRIPTION
* Read/write an 8bit value from/to the specified register address.
*
* PARAMETERS
* function - Pointer to struct representing the function.
* address - Register address within the function.
* data - The data to read/write.
* callback - The function to call on operation completion.
*
* RETURNS
* CSR_RESULT_SUCCESS - The data was successfully read/written.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
* CSR_SDIO_RESULT_INVALID_VALUE - One or more arguments were invalid.
* CSR_SDIO_RESULT_NO_DEVICE - The device does not exist anymore.
* CSR_SDIO_RESULT_CRC_ERROR - A CRC error occurred. No data read/written.
* CSR_SDIO_RESULT_TIMEOUT - No response from the device.
*
* NOTE: If the SDIO R5 response is available, and either of the
* FUNCTION_NUMBER or OUT_OF_RANGE bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE shall be returned. If the ERROR bit
* is set (but none of FUNCTION_NUMBER or OUT_OF_RANGE),
* CSR_RESULT_FAILURE shall be returned. The ILLEGAL_COMMAND and
* COM_CRC_ERROR bits shall be ignored.
*
* If the CSPI response is available, and any of the
* FUNCTION_DISABLED or CLOCK_DISABLED bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE will be returned.
*
* NOTE: The CsrSdioRead8Async and CsrSdioWrite8Async functions return
* immediately, and the supplied callback function is called when the
* operation is complete. The result value is given as an argument to
* the callback function.
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioRead8(CsrSdioFunction *function, u32 address, u8 *data);
CsrResult CsrSdioWrite8(CsrSdioFunction *function, u32 address, u8 data);
void CsrSdioRead8Async(CsrSdioFunction *function, u32 address, u8 *data, CsrSdioAsyncCallback callback);
void CsrSdioWrite8Async(CsrSdioFunction *function, u32 address, u8 data, CsrSdioAsyncCallback callback);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioRead16, CsrSdioWrite16, CsrSdioRead16Async, CsrSdioWrite16Async
*
* DESCRIPTION
* Read/write a 16bit value from/to the specified register address.
*
* PARAMETERS
* function - Pointer to struct representing the function.
* address - Register address within the function.
* data - The data to read/write.
* callback - The function to call on operation completion.
*
* RETURNS
* CSR_RESULT_SUCCESS - The data was successfully read/written.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
* CSR_SDIO_RESULT_INVALID_VALUE - One or more arguments were invalid.
* CSR_SDIO_RESULT_NO_DEVICE - The device does not exist anymore.
* CSR_SDIO_RESULT_CRC_ERROR - A CRC error occurred. Data may have been
* partially read/written.
* CSR_SDIO_RESULT_TIMEOUT - No response from the device.
*
* NOTE: If the SDIO R5 response is available, and either of the
* FUNCTION_NUMBER or OUT_OF_RANGE bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE shall be returned. If the ERROR bit
* is set (but none of FUNCTION_NUMBER or OUT_OF_RANGE),
* CSR_RESULT_FAILURE shall be returned. The ILLEGAL_COMMAND and
* COM_CRC_ERROR bits shall be ignored.
*
* If the CSPI response is available, and any of the
* FUNCTION_DISABLED or CLOCK_DISABLED bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE will be returned.
*
* NOTE: The CsrSdioRead16Async and CsrSdioWrite16Async functions return
* immediately, and the supplied callback function is called when the
* operation is complete. The result value is given as an argument to
* the callback function.
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioRead16(CsrSdioFunction *function, u32 address, u16 *data);
CsrResult CsrSdioWrite16(CsrSdioFunction *function, u32 address, u16 data);
void CsrSdioRead16Async(CsrSdioFunction *function, u32 address, u16 *data, CsrSdioAsyncCallback callback);
void CsrSdioWrite16Async(CsrSdioFunction *function, u32 address, u16 data, CsrSdioAsyncCallback callback);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioF0Read8, CsrSdioF0Write8, CsrSdioF0Read8Async,
* CsrSdioF0Write8Async
*
* DESCRIPTION
* Read/write an 8bit value from/to the specified register address in
* function 0.
*
* PARAMETERS
* function - Pointer to struct representing the function.
* address - Register address within the function.
* data - The data to read/write.
* callback - The function to call on operation completion.
*
* RETURNS
* CSR_RESULT_SUCCESS - The data was successfully read/written.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
* CSR_SDIO_RESULT_INVALID_VALUE - One or more arguments were invalid.
* CSR_SDIO_RESULT_NO_DEVICE - The device does not exist anymore.
* CSR_SDIO_RESULT_CRC_ERROR - A CRC error occurred. No data read/written.
* CSR_SDIO_RESULT_TIMEOUT - No response from the device.
*
* NOTE: If the SDIO R5 response is available, and either of the
* FUNCTION_NUMBER or OUT_OF_RANGE bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE shall be returned. If the ERROR bit
* is set (but none of FUNCTION_NUMBER or OUT_OF_RANGE),
* CSR_RESULT_FAILURE shall be returned. The ILLEGAL_COMMAND and
* COM_CRC_ERROR bits shall be ignored.
*
* If the CSPI response is available, and any of the
* FUNCTION_DISABLED or CLOCK_DISABLED bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE will be returned.
*
* NOTE: The CsrSdioF0Read8Async and CsrSdioF0Write8Async functions return
* immediately, and the supplied callback function is called when the
* operation is complete. The result value is given as an argument to
* the callback function.
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioF0Read8(CsrSdioFunction *function, u32 address, u8 *data);
CsrResult CsrSdioF0Write8(CsrSdioFunction *function, u32 address, u8 data);
void CsrSdioF0Read8Async(CsrSdioFunction *function, u32 address, u8 *data, CsrSdioAsyncCallback callback);
void CsrSdioF0Write8Async(CsrSdioFunction *function, u32 address, u8 data, CsrSdioAsyncCallback callback);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioRead, CsrSdioWrite, CsrSdioReadAsync, CsrSdioWriteAsync
*
* DESCRIPTION
* Read/write a specified number of bytes from/to the specified register
* address.
*
* PARAMETERS
* function - Pointer to struct representing the function.
* address - Register address within the function.
* data - The data to read/write.
* length - Number of byte to read/write.
* callback - The function to call on operation completion.
*
* RETURNS
* CSR_RESULT_SUCCESS - The data was successfully read/written.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
* CSR_SDIO_RESULT_INVALID_VALUE - One or more arguments were invalid.
* CSR_SDIO_RESULT_NO_DEVICE - The device does not exist anymore.
* CSR_SDIO_RESULT_CRC_ERROR - A CRC error occurred. Data may have been
* partially read/written.
* CSR_SDIO_RESULT_TIMEOUT - No response from the device.
*
* NOTE: If the SDIO R5 response is available, and either of the
* FUNCTION_NUMBER or OUT_OF_RANGE bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE shall be returned. If the ERROR bit
* is set (but none of FUNCTION_NUMBER or OUT_OF_RANGE),
* CSR_RESULT_FAILURE shall be returned. The ILLEGAL_COMMAND and
* COM_CRC_ERROR bits shall be ignored.
*
* If the CSPI response is available, and any of the
* FUNCTION_DISABLED or CLOCK_DISABLED bits are set,
* CSR_SDIO_RESULT_INVALID_VALUE will be returned.
*
* NOTE: The CsrSdioF0Read8Async and CsrSdioF0Write8Async functions return
* immediately, and the supplied callback function is called when the
* operation is complete. The result value is given as an argument to
* the callback function.
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioRead(CsrSdioFunction *function, u32 address, void *data, u32 length);
CsrResult CsrSdioWrite(CsrSdioFunction *function, u32 address, const void *data, u32 length);
void CsrSdioReadAsync(CsrSdioFunction *function, u32 address, void *data, u32 length, CsrSdioAsyncCallback callback);
void CsrSdioWriteAsync(CsrSdioFunction *function, u32 address, const void *data, u32 length, CsrSdioAsyncCallback callback);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioPowerOn, CsrSdioPowerOff
*
* DESCRIPTION
* Power on/off the device.
*
* PARAMETERS
* function - Pointer to struct representing the function that resides on
* the device to power on/off.
*
* RETURNS (only CsrSdioPowerOn)
* CSR_RESULT_SUCCESS - Power was successfully reapplied and the device
* has been reinitialised.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
* CSR_SDIO_RESULT_NO_DEVICE - The device does not exist anymore.
* CSR_SDIO_RESULT_CRC_ERROR - A CRC error occurred during reinitialisation.
* CSR_SDIO_RESULT_TIMEOUT - No response from the device during
* reinitialisation.
* CSR_SDIO_RESULT_NOT_RESET - The power was not removed by the
* CsrSdioPowerOff call. The state of the
* device is unchanged.
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioPowerOn(CsrSdioFunction *function);
void CsrSdioPowerOff(CsrSdioFunction *function);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioHardReset
*
* DESCRIPTION
* Perform a hardware reset of the device.
*
* PARAMETERS
* function - Pointer to struct representing the function that resides on
* the device to hard reset.
*
* RETURNS
* CSR_RESULT_SUCCESS - Reset was successfully performed and the device
* has been reinitialised.
* CSR_RESULT_FAILURE - Unspecified/unknown error.
* CSR_SDIO_RESULT_NO_DEVICE - The device does not exist anymore.
* CSR_SDIO_RESULT_CRC_ERROR - A CRC error occurred during reinitialisation.
* CSR_SDIO_RESULT_TIMEOUT - No response from the device during
* reinitialisation.
* CSR_SDIO_RESULT_NOT_RESET - The reset was not applied because it is not
* supported. The state of the device is
* unchanged.
*
*----------------------------------------------------------------------------*/
CsrResult CsrSdioHardReset(CsrSdioFunction *function);
/*----------------------------------------------------------------------------*
* NAME
* CsrSdioFunctionActive, CsrSdioFunctionIdle
*
* DESCRIPTION
*
* PARAMETERS
* function - Pointer to struct representing the function.
*
*----------------------------------------------------------------------------*/
void CsrSdioFunctionActive(CsrSdioFunction *function);
void CsrSdioFunctionIdle(CsrSdioFunction *function);
#endif

View file

@ -1,100 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/module.h>
#include <linux/slab.h>
#include "csr_prim_defs.h"
#include "csr_msgconv.h"
#include "csr_macro.h"
void CsrUint8Des(u8 *value, u8 *buffer, size_t *offset)
{
*value = buffer[*offset];
*offset += sizeof(*value);
}
EXPORT_SYMBOL_GPL(CsrUint8Des);
void CsrUint16Des(u16 *value, u8 *buffer, size_t *offset)
{
*value = (buffer[*offset + 0] << 0) |
(buffer[*offset + 1] << 8);
*offset += sizeof(*value);
}
EXPORT_SYMBOL_GPL(CsrUint16Des);
void CsrUint32Des(u32 *value, u8 *buffer, size_t *offset)
{
*value = (buffer[*offset + 0] << 0) |
(buffer[*offset + 1] << 8) |
(buffer[*offset + 2] << 16) |
(buffer[*offset + 3] << 24);
*offset += sizeof(*value);
}
EXPORT_SYMBOL_GPL(CsrUint32Des);
void CsrMemCpyDes(void *value, u8 *buffer, size_t *offset, size_t length)
{
memcpy(value, &buffer[*offset], length);
*offset += length;
}
EXPORT_SYMBOL_GPL(CsrMemCpyDes);
void CsrCharStringDes(char **value, u8 *buffer, size_t *offset)
{
*value = kstrdup((char *) &buffer[*offset], GFP_KERNEL);
*offset += strlen(*value) + 1;
}
EXPORT_SYMBOL_GPL(CsrCharStringDes);
void CsrUint8Ser(u8 *buffer, size_t *offset, u8 value)
{
buffer[*offset] = value;
*offset += sizeof(value);
}
EXPORT_SYMBOL_GPL(CsrUint8Ser);
void CsrUint16Ser(u8 *buffer, size_t *offset, u16 value)
{
buffer[*offset + 0] = (u8) ((value >> 0) & 0xFF);
buffer[*offset + 1] = (u8) ((value >> 8) & 0xFF);
*offset += sizeof(value);
}
EXPORT_SYMBOL_GPL(CsrUint16Ser);
void CsrUint32Ser(u8 *buffer, size_t *offset, u32 value)
{
buffer[*offset + 0] = (u8) ((value >> 0) & 0xFF);
buffer[*offset + 1] = (u8) ((value >> 8) & 0xFF);
buffer[*offset + 2] = (u8) ((value >> 16) & 0xFF);
buffer[*offset + 3] = (u8) ((value >> 24) & 0xFF);
*offset += sizeof(value);
}
EXPORT_SYMBOL_GPL(CsrUint32Ser);
void CsrMemCpySer(u8 *buffer, size_t *offset, const void *value, size_t length)
{
memcpy(&buffer[*offset], value, length);
*offset += length;
}
EXPORT_SYMBOL_GPL(CsrMemCpySer);
void CsrCharStringSer(u8 *buffer, size_t *offset, const char *value)
{
if (value)
{
strcpy(((char *) &buffer[*offset]), value);
*offset += strlen(value) + 1;
}
else
{
CsrUint8Ser(buffer, offset, 0);
}
}
EXPORT_SYMBOL_GPL(CsrCharStringSer);

View file

@ -1,33 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/kernel.h>
#include <linux/time.h>
#include <linux/module.h>
#include "csr_time.h"
u32 CsrTimeGet(u32 *high)
{
struct timespec ts;
u64 time;
u32 low;
ts = current_kernel_time();
time = (u64) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
if (high != NULL)
*high = (u32) ((time >> 32) & 0xFFFFFFFF);
low = (u32) (time & 0xFFFFFFFF);
return low;
}
EXPORT_SYMBOL_GPL(CsrTimeGet);

View file

@ -1,76 +0,0 @@
#ifndef CSR_TIME_H__
#define CSR_TIME_H__
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/types.h>
/*******************************************************************************
NAME
CsrTimeGet
DESCRIPTION
Returns the current system time in a low and a high part. The low part
is expressed in microseconds. The high part is incremented when the low
part wraps to provide an extended range.
The caller may provide a NULL pointer as the high parameter.
In this case the function just returns the low part and ignores the
high parameter.
Although the time is expressed in microseconds the actual resolution is
platform dependent and can be less. It is recommended that the
resolution is at least 10 milliseconds.
PARAMETERS
high - Pointer to variable that will receive the high part of the
current system time. Passing NULL is valid.
RETURNS
Low part of current system time in microseconds.
*******************************************************************************/
u32 CsrTimeGet(u32 *high);
/*------------------------------------------------------------------*/
/* CsrTime Macros */
/*------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*
* NAME
* CsrTimeAdd
*
* DESCRIPTION
* Add two time values. Adding the numbers can overflow the range of a
* CsrTime, so the user must be cautious.
*
* RETURNS
* CsrTime - the sum of "t1" and "t2".
*
*----------------------------------------------------------------------------*/
#define CsrTimeAdd(t1, t2) ((t1) + (t2))
/*----------------------------------------------------------------------------*
* NAME
* CsrTimeSub
*
* DESCRIPTION
* Subtract two time values. Subtracting the numbers can provoke an
* underflow, so the user must be cautious.
*
* RETURNS
* CsrTime - "t1" - "t2".
*
*----------------------------------------------------------------------------*/
#define CsrTimeSub(t1, t2) ((s32) (t1) - (s32) (t2))
#endif

View file

@ -1,15 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/module.h>
MODULE_DESCRIPTION("CSR Operating System Kernel Abstraction");
MODULE_AUTHOR("Cambridge Silicon Radio Ltd.");
MODULE_LICENSE("GPL and additional rights");

View file

@ -1,101 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_COMMON_H__
#define CSR_WIFI_COMMON_H__
#include <linux/types.h>
#include "csr_result.h"
/* MAC address */
typedef struct
{
u8 a[6];
} CsrWifiMacAddress;
/* IPv4 address */
typedef struct
{
u8 a[4];
} CsrWifiIp4Address;
/* IPv6 address */
typedef struct
{
u8 a[16];
} CsrWifiIp6Address;
typedef struct
{
u8 ssid[32];
u8 length;
} CsrWifiSsid;
/*******************************************************************************
DESCRIPTION
Result values used on the Wifi Interfaces
VALUES
CSR_RESULT_SUCCESS
- The request/procedure succeeded
CSR_RESULT_FAILURE
- The request/procedure did not succeed because of an error
CSR_WIFI_RESULT_NOT_FOUND
- The request did not succeed because some resource was not
found.
CSR_WIFI_RESULT_TIMED_OUT
- The request/procedure did not succeed because of a time out
CSR_WIFI_RESULT_CANCELLED
- The request was canceled due to another conflicting
request that was issued before this one was completed
CSR_WIFI_RESULT_INVALID_PARAMETER
- The request/procedure did not succeed because it had an
invalid parameter
CSR_WIFI_RESULT_NO_ROOM
- The request did not succeed due to a lack of resources,
e.g. out of memory problem.
CSR_WIFI_RESULT_UNSUPPORTED
- The request/procedure did not succeed because the feature
is not supported yet
CSR_WIFI_RESULT_UNAVAILABLE
- The request cannot be processed at this time
CSR_WIFI_RESULT_WIFI_OFF
- The requested action is not available because Wi-Fi is
currently off
CSR_WIFI_RESULT_SECURITY_ERROR
- The request/procedure did not succeed because of a security
error
CSR_WIFI_RESULT_MIB_SET_FAILURE
- MIB Set Failure: either the MIB OID to be written to does
not exist or the MIB Value is invalid.
CSR_WIFI_RESULT_INVALID_INTERFACE_TAG
- The supplied Interface Tag is not valid.
CSR_WIFI_RESULT_P2P_NOA_CONFIG_CONFLICT
- The new NOA configuration conflicts with the existing NOA configuration
hence not accepted"
*******************************************************************************/
#define CSR_WIFI_RESULT_NOT_FOUND ((CsrResult) 0x0001)
#define CSR_WIFI_RESULT_TIMED_OUT ((CsrResult) 0x0002)
#define CSR_WIFI_RESULT_CANCELLED ((CsrResult) 0x0003)
#define CSR_WIFI_RESULT_INVALID_PARAMETER ((CsrResult) 0x0004)
#define CSR_WIFI_RESULT_NO_ROOM ((CsrResult) 0x0005)
#define CSR_WIFI_RESULT_UNSUPPORTED ((CsrResult) 0x0006)
#define CSR_WIFI_RESULT_UNAVAILABLE ((CsrResult) 0x0007)
#define CSR_WIFI_RESULT_WIFI_OFF ((CsrResult) 0x0008)
#define CSR_WIFI_RESULT_SECURITY_ERROR ((CsrResult) 0x0009)
#define CSR_WIFI_RESULT_MIB_SET_FAILURE ((CsrResult) 0x000A)
#define CSR_WIFI_RESULT_INVALID_INTERFACE_TAG ((CsrResult) 0x000B)
#define CSR_WIFI_RESULT_P2P_NOA_CONFIG_CONFLICT ((CsrResult) 0x000C)
#define CSR_WIFI_VERSION "5.1.0.0"
#endif

View file

@ -1,240 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_FSM_H
#define CSR_WIFI_FSM_H
#include "csr_prim_defs.h"
#include "csr_log_text.h"
#include "csr_wifi_fsm_event.h"
/* including this file for CsrWifiInterfaceMode*/
#include "csr_wifi_common.h"
#define CSR_WIFI_FSM_ENV (0xFFFF)
/**
* @brief
* Toplevel FSM context data
*
* @par Description
* Holds ALL FSM static and dynamic data for a FSM
*/
typedef struct CsrWifiFsmContext CsrWifiFsmContext;
/**
* @brief
* FSM External Wakeup CallbackFunction Pointer
*
* @par Description
* Defines the external wakeup function for the FSM
* to call when an external event is injected into the systen
*
* @param[in] context : External context
*
* @return
* void
*/
typedef void (*CsrWifiFsmExternalWakupCallbackPtr)(void *context);
/**
* @brief
* Initialises a top level FSM context
*
* @par Description
* Initialises the FSM Context to an initial state and allocates
* space for "maxProcesses" number of instances
*
* @param[in] osaContext : OSA context
* @param[in] applicationContext : Internal fsm application context
* @param[in] externalContext : External context
* @param[in] maxProcesses : Max processes to allocate room for
*
* @return
* CsrWifiFsmContext* fsm context
*/
extern CsrWifiFsmContext* CsrWifiFsmInit(void *applicationContext, void *externalContext, u16 maxProcesses, CsrLogTextTaskId loggingTaskId);
/**
* @brief
* Resets the FSM's back to first conditions
*
* @par Description
* This function is used to free any dynamic resources allocated for the
* given context by CsrWifiFsmInit().
* The FSM's reset function is called to cleanup any fsm specific memory
* The reset function does NOT need to free the fsm data pointer as
* CsrWifiFsmShutdown() will do it.
* the FSM's init function is call again to reinitialise the FSM context.
* CsrWifiFsmReset() should NEVER be called when CsrWifiFsmExecute() is running.
*
* @param[in] context : FSM context
*
* @return
* void
*/
extern void CsrWifiFsmReset(CsrWifiFsmContext *context);
/**
* @brief
* Frees resources allocated by CsrWifiFsmInit
*
* @par Description
* This function is used to free any dynamic resources allocated for the
* given context by CsrWifiFsmInit(), prior to complete termination of
* the program.
* The FSM's reset function is called to cleanup any fsm specific memory.
* The reset function does NOT need to free the fsm data pointer as
* CsrWifiFsmShutdown() will do it.
* CsrWifiFsmShutdown() should NEVER be called when CsrWifiFsmExecute() is running.
*
* @param[in] context : FSM context
*
* @return
* void
*/
extern void CsrWifiFsmShutdown(CsrWifiFsmContext *context);
/**
* @brief
* Executes the fsm context
*
* @par Description
* Executes the FSM context and runs until ALL events in the context are processed.
* When no more events are left to process then CsrWifiFsmExecute() returns to a time
* specifying when to next call the CsrWifiFsmExecute()
* Scheduling, threading, blocking and external event notification are outside
* the scope of the FSM and CsrWifiFsmExecute().
*
* @param[in] context : FSM context
*
* @return
* u32 Time in ms until next timeout or 0xFFFFFFFF for no timer set
*/
extern u32 CsrWifiFsmExecute(CsrWifiFsmContext *context);
/**
* @brief
* Adds an event to the FSM context's external event queue for processing
*
* @par Description
* Adds an event to the contexts external queue
* This is thread safe and adds an event to the fsm's external event queue.
*
* @param[in] context : FSM context
* @param[in] event : event to add to the event queue
* @param[in] source : source of the event (this can be a synergy task queue or an fsm instance id)
* @param[in] destination : destination of the event (This can be a fsm instance id or CSR_WIFI_FSM_ENV)
* @param[in] id : event id
*
* @return
* void
*/
extern void CsrWifiFsmSendEventExternal(CsrWifiFsmContext *context, CsrWifiFsmEvent *event, u16 source, u16 destination, CsrPrim primtype, u16 id);
/**
* @brief
* Adds an Alien event to the FSM context's external event queue for processing
*
* @par Description
* Adds an event to the contexts external queue
* This is thread safe and adds an event to the fsm's external event queue.
*
* @param[in] context : FSM context
* @param[in] event : event to add to the event queue
* @param[in] source : source of the event (this can be a synergy task queue or an fsm instance id)
* @param[in] destination : destination of the event (This can be a fsm instance id or CSR_WIFI_FSM_ENV)
* @param[in] id : event id
*/
#define CsrWifiFsmSendAlienEventExternal(_context, _alienEvent, _source, _destination, _primtype, _id) \
{ \
CsrWifiFsmAlienEvent *_evt = kmalloc(sizeof(CsrWifiFsmAlienEvent), GFP_KERNEL); \
_evt->alienEvent = _alienEvent; \
CsrWifiFsmSendEventExternal(_context, (CsrWifiFsmEvent *)_evt, _source, _destination, _primtype, _id); \
}
/**
* @brief
* Current time of day in ms
*
* @param[in] context : FSM context
*
* @return
* u32 32 bit ms tick
*/
extern u32 CsrWifiFsmGetTimeOfDayMs(CsrWifiFsmContext *context);
/**
* @brief
* Gets the time until the next FSM timer expiry
*
* @par Description
* Returns the next timeout time or 0 if no timers are set.
*
* @param[in] context : FSM context
*
* @return
* u32 Time in ms until next timeout or 0xFFFFFFFF for no timer set
*/
extern u32 CsrWifiFsmGetNextTimeout(CsrWifiFsmContext *context);
/**
* @brief
* Fast forwards the fsm timers by ms Milliseconds
*
* @param[in] context : FSM context
* @param[in] ms : Milliseconds to fast forward by
*
* @return
* void
*/
extern void CsrWifiFsmFastForward(CsrWifiFsmContext *context, u16 ms);
/**
* @brief
* shift the current time of day by ms amount
*
* @par Description
* useful to speed up tests where time needs to pass
*
* @param[in] context : FSM context
* @param[in] ms : ms to adjust time by
*
* @return
* void
*/
extern void CsrWifiFsmTestAdvanceTime(CsrWifiFsmContext *context, u32 ms);
/**
* @brief
* Check if the fsm has events to process
*
* @param[in] context : FSM context
*
* @return
* u8 returns TRUE if there are events for the FSM to process
*/
extern u8 CsrWifiFsmHasEvents(CsrWifiFsmContext *context);
/**
* @brief
* function that installs the contexts wakeup function
*
* @param[in] context : FSM context
* @param[in] callback : Callback function pointer
*
* @return
* void
*/
extern void CsrWifiFsmInstallWakeupCallback(CsrWifiFsmContext *context, CsrWifiFsmExternalWakupCallbackPtr callback);
#endif /* CSR_WIFI_FSM_H */

View file

@ -1,42 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_FSM_EVENT_H
#define CSR_WIFI_FSM_EVENT_H
#include "csr_prim_defs.h"
#include "csr_sched.h"
/**
* @brief
* FSM event header.
*
* @par Description
* All events MUST have this struct as the FIRST member.
* The next member is used internally for linked lists
*/
typedef struct CsrWifiFsmEvent
{
CsrPrim type;
u16 primtype;
CsrSchedQid destination;
CsrSchedQid source;
/* Private pointer to allow an optimal Event list */
/* NOTE: Ignore this pointer.
* Do not waste code initializing OR freeing it.
* The pointer is used internally in the CsrWifiFsm code
* to avoid a second malloc when queuing events.
*/
struct CsrWifiFsmEvent *next;
} CsrWifiFsmEvent;
#endif /* CSR_WIFI_FSM_EVENT_H */

View file

@ -1,430 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_FSM_TYPES_H
#define CSR_WIFI_FSM_TYPES_H
#include <linux/types.h>
#include "csr_macro.h"
#include "csr_sched.h"
#ifdef CSR_WIFI_FSM_MUTEX_ENABLE
#include "csr_framework_ext.h"
#endif
#include "csr_wifi_fsm.h"
#define CSR_WIFI_FSM_MAX_TRANSITION_HISTORY 10
/**
* @brief
* FSM event list header.
*
* @par Description
* Singly linked list of events.
*/
typedef struct CsrWifiFsmEventList
{
CsrWifiFsmEvent *first;
CsrWifiFsmEvent *last;
} CsrWifiFsmEventList;
/**
* @brief
* FSM timer id.
*
* @par Description
* Composite Id made up of the type, dest and a unique id so
* CsrWifiFsmRemoveTimer knows where to look when removing the timer
*/
typedef struct CsrWifiFsmTimerId
{
CsrPrim type;
u16 primtype;
CsrSchedQid destination;
u16 uniqueid;
} CsrWifiFsmTimerId;
/**
* @brief
* FSM timer header.
*
* @par Description
* All timer MUST have this struct as the FIRST member.
* The first members of the structure MUST remain compatable
* with the CsrWifiFsmEvent so that timers are just specialised events
*/
typedef struct CsrWifiFsmTimer
{
CsrPrim type;
u16 primtype;
CsrSchedQid destination;
CsrSchedQid source;
/* Private pointer to allow an optimal Event list */
struct CsrWifiFsmTimer *next;
CsrWifiFsmTimerId timerid;
u32 timeoutTimeMs;
} CsrWifiFsmTimer;
/**
* @brief
* Fsm Alien Event
*
* @par Description
* Allows the wrapping of alien events that do not use CsrWifiFsmEvent
* as the first member of the Event struct
*/
typedef struct
{
CsrWifiFsmEvent event;
void *alienEvent;
} CsrWifiFsmAlienEvent;
/**
* @brief
* FSM timer list header.
*
* @par Description
* Singly linked list of timers.
*/
typedef struct CsrWifiFsmTimerList
{
CsrWifiFsmTimer *first;
CsrWifiFsmTimer *last;
u16 nexttimerid;
} CsrWifiFsmTimerList;
/**
* @brief
* Process Entry Function Pointer
*
* @par Description
* Defines the entry function for a processes.
* Called at process initialisation.
*
* @param[in] context : FSM context
*
* @return
* void
*/
typedef void (*CsrWifiFsmProcEntryFnPtr)(CsrWifiFsmContext *context);
/**
* @brief
* Process Transition Function Pointer
*
* @par Description
* Defines a transition function for a processes.
* Called when an event causes a transition on a process
*
* @param[in] CsrWifiFsmContext* : FSM context
* @param[in] void* : FSM data (can be NULL)
* @param[in] const CsrWifiFsmEvent* : event to process
*
* @return
* void
*/
typedef void (*CsrWifiFsmTransitionFnPtr)(CsrWifiFsmContext *context, void *fsmData, const CsrWifiFsmEvent *event);
/**
* @brief
* Process reset/shutdown Function Pointer
*
* @par Description
* Defines the reset/shutdown function for a processes.
* Called to reset or shutdown an fsm.
*
* @param[in] context : FSM context
*
* @return
* void
*/
typedef void (*CsrWifiFsmProcResetFnPtr)(CsrWifiFsmContext *context);
/**
* @brief
* FSM Default Destination CallbackFunction Pointer
*
* @par Description
* Defines the default destination function for the FSM
* to call when an event does not have a valid destination.
* This
*
* @param[in] context : External context
*
* @return
* u16 a valid destination OR CSR_WIFI_FSM_ENV
*/
typedef u16 (*CsrWifiFsmDestLookupCallbackPtr)(void *context, const CsrWifiFsmEvent *event);
#ifdef CSR_WIFI_FSM_DUMP_ENABLE
/**
* @brief
* Trace Dump Function Pointer
*
* @par Description
* Called when we want to trace the FSM
*
* @param[in] context : FSM context
* @param[in] id : fsm id
*
* @return
* void
*/
typedef void (*CsrWifiFsmDumpFnPtr)(CsrWifiFsmContext *context, void *fsmData);
#endif
/**
* @brief
* Event ID to transition function entry
*
* @par Description
* Event ID to Transition Entry in a state table.
*/
typedef struct
{
u32 eventid;
CsrWifiFsmTransitionFnPtr transition;
#ifdef CSR_LOG_ENABLE
const char *transitionName;
#endif
} CsrWifiFsmEventEntry;
/**
* @brief
* Single State's Transition Table
*
* @par Description
* Stores Data for a single State's event to
* transition functions mapping
*/
typedef struct
{
const u8 numEntries;
const u8 saveAll;
const CsrWifiFsmEventEntry *eventEntryArray; /* array of transition function pointers for state */
#ifdef CSR_LOG_ENABLE
u16 stateNumber;
const char *stateName;
#endif
} CsrWifiFsmTableEntry;
/**
* @brief
* Process State Transtion table
*
* @par Description
* Stores Data for a processes State to transition table
*/
typedef struct
{
u16 numStates; /* number of states */
const CsrWifiFsmTableEntry *aStateEventMatrix; /* state event matrix */
} CsrWifiFsmTransitionFunctionTable;
/**
* @brief
* Const Process definition
*
* @par Description
* Constant process specification.
* This is ALL the non dynamic data that defines
* a process.
*/
typedef struct
{
const char *processName;
const u32 processId;
const CsrWifiFsmTransitionFunctionTable transitionTable;
const CsrWifiFsmTableEntry unhandledTransitions;
const CsrWifiFsmTableEntry ignoreFunctions;
const CsrWifiFsmProcEntryFnPtr entryFn;
const CsrWifiFsmProcResetFnPtr resetFn;
#ifdef CSR_WIFI_FSM_DUMP_ENABLE
const CsrWifiFsmDumpFnPtr dumpFn; /* Called to dump fsm specific trace if not NULL */
#endif
} CsrWifiFsmProcessStateMachine;
#ifdef CSR_WIFI_FSM_DUMP_ENABLE
/**
* @brief
* Storage for state transition info
*/
typedef struct
{
u16 transitionNumber;
CsrWifiFsmEvent event;
u16 fromState;
u16 toState;
CsrWifiFsmTransitionFnPtr transitionFn;
u16 transitionCount; /* number consecutive of times this transition was seen */
#ifdef CSR_LOG_ENABLE
const char *transitionName;
#endif
} CsrWifiFsmTransitionRecord;
/**
* @brief
* Storage for the last state X transitions
*/
typedef struct
{
u16 numTransitions;
CsrWifiFsmTransitionRecord records[CSR_WIFI_FSM_MAX_TRANSITION_HISTORY];
} CsrWifiFsmTransitionRecords;
#endif
/**
* @brief
* Dynamic Process data
*
* @par Description
* Dynamic process data that is used to keep track of the
* state and data for a process instance
*/
typedef struct
{
const CsrWifiFsmProcessStateMachine *fsmInfo; /* state machine info that is constant regardless of context */
u16 instanceId; /* Runtime process id */
u16 state; /* Current state */
void *params; /* Instance user data */
CsrWifiFsmEventList savedEventQueue; /* The saved event queue */
struct CsrWifiFsmInstanceEntry *subFsm; /* Sub Fsm instance data */
struct CsrWifiFsmInstanceEntry *subFsmCaller; /* The Fsm instance that created the SubFsm and should be used for callbacks*/
#ifdef CSR_WIFI_FSM_DUMP_ENABLE
CsrWifiFsmTransitionRecords transitionRecords; /* Last X transitions in the FSM */
#endif
} CsrWifiFsmInstanceEntry;
/**
* @brief
* OnCreate Callback Function Pointer
*
* @par Description
* Called when an fsm is created.
*
* @param[in] extContext : External context
* @param[in] instance : FSM instance
*
* @return
* void
*/
typedef void (*CsrWifiFsmOnCreateFnPtr)(void *extContext, const CsrWifiFsmInstanceEntry *instance);
/**
* @brief
* OnTransition Callback Function Pointer
*
* @par Description
* Called when an event is processed by a fsm
*
* @param[in] extContext : External context
* @param[in] eventEntryArray : Entry data
* @param[in] event : Event
*
* @return
* void
*/
typedef void (*CsrWifiFsmOnTransitionFnPtr)(void *extContext, const CsrWifiFsmEventEntry *eventEntryArray, const CsrWifiFsmEvent *event);
/**
* @brief
* OnStateChange Callback Function Pointer
*
* @par Description
* Called when CsrWifiFsmNextState is called
*
* @param[in] extContext : External context
*
* @return
* void
*/
typedef void (*CsrWifiFsmOnStateChangeFnPtr)(void *extContext, u16 nextstate);
/**
* @brief
* OnIgnore,OnError or OnInvalid Callback Function Pointer
*
* @par Description
* Called when an event is processed by a fsm
*
* @param[in] extContext : External context
* @param[in] event : Event
*
* @return
* void
*/
typedef void (*CsrWifiFsmOnEventFnPtr)(void *extContext, const CsrWifiFsmEvent *event);
/**
* @brief
* Toplevel FSM context data
*
* @par Description
* Holds ALL FSM static and dynamic data for a FSM
*/
struct CsrWifiFsmContext
{
CsrWifiFsmEventList eventQueue; /* The internal event queue */
CsrWifiFsmEventList externalEventQueue; /* The external event queue */
#ifdef CSR_WIFI_FSM_MUTEX_ENABLE
CsrMutexHandle externalEventQueueLock; /* The external event queue mutex */
#endif
u32 timeOffset; /* Amount to adjust the TimeOfDayMs by */
CsrWifiFsmTimerList timerQueue; /* The internal timer queue */
u8 useTempSaveList; /* Should the temp save list be used */
CsrWifiFsmEventList tempSaveList; /* The temp save event queue */
CsrWifiFsmEvent *eventForwardedOrSaved; /* The event that was forwarded or Saved */
u16 maxProcesses; /* Size of instanceArray */
u16 numProcesses; /* Current number allocated in instanceArray */
CsrWifiFsmInstanceEntry *instanceArray; /* Array of processes for this component */
CsrWifiFsmInstanceEntry *ownerInstance; /* The Process that owns currentInstance (SubFsm support) */
CsrWifiFsmInstanceEntry *currentInstance; /* Current Process that is executing */
CsrWifiFsmExternalWakupCallbackPtr externalEventFn; /* External event Callback */
CsrWifiFsmOnEventFnPtr appIgnoreCallback; /* Application Ignore event Callback */
CsrWifiFsmDestLookupCallbackPtr appEvtDstCallback; /* Application Lookup event Destination Function*/
void *applicationContext; /* Internal fsm application context */
void *externalContext; /* External context (set by the user of the fsm)*/
CsrLogTextTaskId loggingTaskId; /* Task Id to use in any logging output */
#ifndef CSR_WIFI_FSM_SCHEDULER_DISABLED
CsrSchedTid schedTimerId; /* Scheduler TimerId for use in Scheduler Tasks */
u32 schedTimerNexttimeoutMs; /* Next timeout time for the current timer */
#endif
#ifdef CSR_WIFI_FSM_MUTEX_ENABLE
#ifdef CSR_WIFI_FSM_TRANSITION_LOCK
CsrMutexHandle transitionLock; /* Lock when calling transition functions */
#endif
#endif
#ifdef CSR_LOG_ENABLE
CsrWifiFsmOnCreateFnPtr onCreate; /* Debug Transition Callback */
CsrWifiFsmOnTransitionFnPtr onTransition; /* Debug Transition Callback */
CsrWifiFsmOnTransitionFnPtr onUnhandedCallback; /* Unhanded event Callback */
CsrWifiFsmOnStateChangeFnPtr onStateChange; /* Debug State Change Callback */
CsrWifiFsmOnEventFnPtr onIgnoreCallback; /* Ignore event Callback */
CsrWifiFsmOnEventFnPtr onSaveCallback; /* Save event Callback */
CsrWifiFsmOnEventFnPtr onErrorCallback; /* Error event Callback */
CsrWifiFsmOnEventFnPtr onInvalidCallback; /* Invalid event Callback */
#endif
#ifdef CSR_WIFI_FSM_DUMP_ENABLE
u16 masterTransitionNumber; /* Increments on every transition */
#endif
};
#endif /* CSR_WIFI_FSM_TYPES_H */

View file

@ -1,114 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
******************************************************************************
* FILE : csr_wifi_hip_card.h
*
* PURPOSE : Defines abstract interface for hardware specific functions.
* Note, this is a different file from one of the same name in the
* Windows driver.
*
*****************************************************************************
*/
#ifndef __CARD_H__
#define __CARD_H__
#include "csr_wifi_hip_card_sdio.h"
#include "csr_wifi_hip_signals.h"
#include "csr_wifi_hip_unifi_udi.h"
/*****************************************************************************
* CardEnableInt -
*/
CsrResult CardEnableInt(card_t *card);
/*****************************************************************************
* CardGenInt -
*/
CsrResult CardGenInt(card_t *card);
/*****************************************************************************
* CardPendingInt -
*/
CsrResult CardPendingInt(card_t *card, u8 *pintr);
/*****************************************************************************
* CardDisableInt -
*/
CsrResult CardDisableInt(card_t *card);
/*****************************************************************************
* CardClearInt -
*/
CsrResult CardClearInt(card_t *card);
/*****************************************************************************
* CardDisable -
*/
void CardDisable(card_t *card);
/*****************************************************************************
* CardIntEnabled -
*/
CsrResult CardIntEnabled(card_t *card, u8 *enabled);
/*****************************************************************************
* CardGetDataSlotSize
*/
u16 CardGetDataSlotSize(card_t *card);
/*****************************************************************************
* CardWriteBulkData -
*/
CsrResult CardWriteBulkData(card_t *card, card_signal_t *csptr, unifi_TrafficQueue queue);
/*****************************************************************************
* CardClearFromHostDataSlot -
*/
void CardClearFromHostDataSlot(card_t *card, const s16 aSlotNum);
#ifdef CSR_WIFI_REQUEUE_PACKET_TO_HAL
/*****************************************************************************
* CardClearFromHostDataSlotWithoutFreeingBulkData - Clear the data stot
* without freeing the bulk data
*/
void CardClearFromHostDataSlotWithoutFreeingBulkData(card_t *card, const s16 aSlotNum);
#endif
/*****************************************************************************
* CardGetFreeFromHostDataSlots -
*/
u16 CardGetFreeFromHostDataSlots(card_t *card);
u16 CardAreAllFromHostDataSlotsEmpty(card_t *card);
CsrResult card_start_processor(card_t *card, enum unifi_dbg_processors_select which);
CsrResult card_wait_for_firmware_to_start(card_t *card, u32 *paddr);
CsrResult unifi_dl_firmware(card_t *card, void *arg);
CsrResult unifi_dl_patch(card_t *card, void *arg, u32 boot_ctrl);
CsrResult unifi_do_loader_op(card_t *card, u32 op_addr, u8 opcode);
void* unifi_dl_fw_read_start(card_t *card, s8 is_fw);
CsrResult unifi_coredump_handle_request(card_t *card);
CsrResult ConvertCsrSdioToCsrHipResult(card_t *card, CsrResult csrResult);
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
void unifi_debug_log_to_buf(const char *fmt, ...);
void unifi_debug_string_to_buf(const char *str);
void unifi_debug_hex_to_buf(const char *buff, u16 length);
#endif
#endif /* __CARD_H__ */

File diff suppressed because it is too large Load diff

View file

@ -1,694 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
*
* FILE: csr_wifi_hip_card_sdio.h
*
* PURPOSE:
* Internal header for Card API for SDIO.
* ---------------------------------------------------------------------------
*/
#ifndef __CARD_SDIO_H__
#define __CARD_SDIO_H__
#include "csr_wifi_hip_unifi.h"
#include "csr_wifi_hip_unifi_udi.h"
#include "csr_wifi_hip_unifihw.h"
#include "csr_wifi_hip_unifiversion.h"
#ifndef CSR_WIFI_HIP_TA_DISABLE
#include "csr_wifi_hip_ta_sampling.h"
#endif
#include "csr_wifi_hip_xbv.h"
#include "csr_wifi_hip_chiphelper.h"
/*
*
* Configuration items.
* Which of these should go in a platform unifi_config.h file?
*
*/
/*
* When the traffic queues contain more signals than there is space for on
* UniFi, a limiting algorithm comes into play.
* If a traffic queue has enough slots free to buffer more traffic from the
* network stack, then the following check is applied. The number of free
* slots is RESUME_XMIT_THRESHOLD.
*/
#define RESUME_XMIT_THRESHOLD 4
/*
* When reading signals from UniFi, the host processes pending all signals
* and then acknowledges them together in a single write to update the
* to-host-chunks-read location.
* When there is more than one bulk data transfer (e.g. one received data
* packet and a request for the payload data of a transmitted packet), the
* update can be delayed significantly. This ties up resources on chip.
*
* To remedy this problem, to-host-chunks-read is updated after processing
* a signal if TO_HOST_FLUSH_THRESHOLD bytes of bulk data have been
* transferred since the last update.
*/
#define TO_HOST_FLUSH_THRESHOLD (500 * 5)
/* SDIO Card Common Control Registers */
#define SDIO_CCCR_SDIO_REVISION (0x00)
#define SDIO_SD_SPEC_REVISION (0x01)
#define SDIO_IO_ENABLE (0x02)
#define SDIO_IO_READY (0x03)
#define SDIO_INT_ENABLE (0x04)
#define SDIO_INT_PENDING (0x05)
#define SDIO_IO_ABORT (0x06)
#define SDIO_BUS_IFACE_CONTROL (0x07)
#define SDIO_CARD_CAPABILOTY (0x08)
#define SDIO_COMMON_CIS_POINTER (0x09)
#define SDIO_BUS_SUSPEND (0x0C)
#define SDIO_FUNCTION_SELECT (0x0D)
#define SDIO_EXEC_FLAGS (0x0E)
#define SDIO_READY_FLAGS (0x0F)
#define SDIO_FN0_BLOCK_SIZE (0x10)
#define SDIO_POWER_CONTROL (0x12)
#define SDIO_VENDOR_START (0xF0)
#define SDIO_CSR_HOST_WAKEUP (0xf0)
#define SDIO_CSR_HOST_INT_CLEAR (0xf1)
#define SDIO_CSR_FROM_HOST_SCRATCH0 (0xf2)
#define SDIO_CSR_FROM_HOST_SCRATCH1 (0xf3)
#define SDIO_CSR_TO_HOST_SCRATCH0 (0xf4)
#define SDIO_CSR_TO_HOST_SCRATCH1 (0xf5)
#define SDIO_CSR_FUNC_EN (0xf6)
#define SDIO_CSR_CSPI_MODE (0xf7)
#define SDIO_CSR_CSPI_STATUS (0xf8)
#define SDIO_CSR_CSPI_PADDING (0xf9)
#define UNIFI_SD_INT_ENABLE_IENM 0x0001 /* Master INT Enable */
#ifdef CSR_PRE_ALLOC_NET_DATA
#define BULK_DATA_PRE_ALLOC_NUM 16
#endif
/*
* Structure to hold configuration information read from UniFi.
*/
typedef struct
{
/*
* The version of the SDIO signal queues and bulk data pools
* configuration structure. The MSB is the major version number, used to
* indicate incompatible changes. The LSB gives the minor revision number,
* used to indicate changes that maintain backwards compatibility.
*/
u16 version;
/*
* offset from the start of the shared data memory to the SD IO
* control structure.
*/
u16 sdio_ctrl_offset;
/* Buffer handle of the from-host signal queue */
u16 fromhost_sigbuf_handle;
/* Buffer handle of the to-host signal queue */
u16 tohost_sigbuf_handle;
/*
* Maximum number of signal primitive or bulk data command fragments that may be
* pending in the to-hw signal queue.
*/
u16 num_fromhost_sig_frags;
/*
* Number of signal primitive or bulk data command fragments that must be pending
* in the to-host signal queue before the host will generate an interrupt
* to indicate that it has read a signal. This will usually be the total
* capacity of the to-host signal buffer less the size of the largest signal
* primitive divided by the signal primitive fragment size, but may be set
* to 1 to request interrupts every time that the host read a signal.
* Note that the hw may place more signals in the to-host signal queue
* than indicated by this field.
*/
u16 num_tohost_sig_frags;
/*
* Number of to-hw bulk data slots. Slots are numbered from 0 (zero) to
* one less than the value in this field
*/
u16 num_fromhost_data_slots;
/*
* Number of frm-hw bulk data slots. Slots are numbered from 0 (zero) to
* one less than the value in this field
*/
u16 num_tohost_data_slots;
/*
* Size of the bulk data slots (2 octets)
* The size of the bulk data slots in octets. This will usually be
* the size of the largest MSDU. The value should always be even.
*/
u16 data_slot_size;
/*
* Indicates that the host has finished the initialisation sequence.
* Initialised to 0x0000 by the firmware, and set to 0x0001 by us.
*/
u16 initialised;
/* Added by protocol version 0x0001 */
u32 overlay_size;
/* Added by protocol version 0x0300 */
u16 data_slot_round;
u16 sig_frag_size;
/* Added by protocol version 0x0500 */
u16 tohost_signal_padding;
} sdio_config_data_t;
/*
* These values may change with versions of the Host Interface Protocol.
*/
/*
* Size of config info block pointed to by the CSR_SLT_SDIO_SLOT_CONFIG
* entry in the f/w symbol table
*/
#define SDIO_CONFIG_DATA_SIZE 30
/* Offset of the INIT flag in the config info block. */
#define SDIO_INIT_FLAG_OFFSET 0x12
#define SDIO_TO_HOST_SIG_PADDING_OFFSET 0x1C
/* Structure for a bulk data transfer command */
typedef struct
{
u16 cmd_and_len; /* bits 12-15 cmd, bits 0-11 len */
u16 data_slot; /* slot number, perhaps OR'd with SLOT_DIR_TO_HOST */
u16 offset;
u16 buffer_handle;
} bulk_data_cmd_t;
/* Bulk Data signal command values */
#define SDIO_CMD_SIGNAL 0x00
#define SDIO_CMD_TO_HOST_TRANSFER 0x01
#define SDIO_CMD_TO_HOST_TRANSFER_ACK 0x02 /*deprecated*/
#define SDIO_CMD_FROM_HOST_TRANSFER 0x03
#define SDIO_CMD_FROM_HOST_TRANSFER_ACK 0x04 /*deprecated*/
#define SDIO_CMD_CLEAR_SLOT 0x05
#define SDIO_CMD_OVERLAY_TRANSFER 0x06
#define SDIO_CMD_OVERLAY_TRANSFER_ACK 0x07 /*deprecated*/
#define SDIO_CMD_FROM_HOST_AND_CLEAR 0x08
#define SDIO_CMD_PADDING 0x0f
#define SLOT_DIR_TO_HOST 0x8000
/* Initialise bulkdata slot
* params:
* bulk_data_desc_t *bulk_data_slot
*/
#define UNIFI_INIT_BULK_DATA(bulk_data_slot) \
{ \
(bulk_data_slot)->os_data_ptr = NULL; \
(bulk_data_slot)->data_length = 0; \
(bulk_data_slot)->os_net_buf_ptr = NULL; \
(bulk_data_slot)->net_buf_length = 0; \
}
/*
* Structure to contain a SIGNAL datagram.
* This is used to build signal queues between the main driver and the
* i/o thread.
* The fields are:
* sigbuf Contains the HIP signal is wire-format (i.e. packed,
* little-endian)
* bulkdata Contains a copy of any associated bulk data
* signal_length The size of the signal in the sigbuf
*/
typedef struct card_signal
{
u8 sigbuf[UNIFI_PACKED_SIGBUF_SIZE];
/* Length of the SIGNAL inside sigbuf */
u16 signal_length;
bulk_data_desc_t bulkdata[UNIFI_MAX_DATA_REFERENCES];
} card_signal_t;
/*
* Control structure for a generic ring buffer.
*/
#define UNIFI_QUEUE_NAME_MAX_LENGTH 16
typedef struct
{
card_signal_t *q_body;
/* Num elements in queue (capacity is one less than this!) */
u16 q_length;
u16 q_wr_ptr;
u16 q_rd_ptr;
char name[UNIFI_QUEUE_NAME_MAX_LENGTH];
} q_t;
#define UNIFI_RESERVED_COMMAND_SLOTS 2
/* Considering approx 500 us per packet giving 0.5 secs */
#define UNIFI_PACKETS_INTERVAL 1000
/*
* Dynamic slot reservation for QoS
*/
typedef struct
{
u16 from_host_used_slots[UNIFI_NO_OF_TX_QS];
u16 from_host_max_slots[UNIFI_NO_OF_TX_QS];
u16 from_host_reserved_slots[UNIFI_NO_OF_TX_QS];
/* Parameters to determine if a queue was active.
If number of packets sent is greater than the threshold
for the queue, the queue is considered active and no
re reservation is done, it is important not to keep this
value too low */
/* Packets sent during this interval */
u16 packets_txed[UNIFI_NO_OF_TX_QS];
u16 total_packets_txed;
/* Number of packets to see if slots need to be reassigned */
u16 packets_interval;
/* Once a queue reaches a stable state, avoid processing */
u8 queue_stable[UNIFI_NO_OF_TX_QS];
} card_dynamic_slot_t;
/* These are type-safe and don't write incorrect values to the
* structure. */
/* Return queue slots used count
* params:
* const q_t *q
* returns:
* u16
*/
#define CSR_WIFI_HIP_Q_SLOTS_USED(q) \
(((q)->q_wr_ptr - (q)->q_rd_ptr < 0)? \
((q)->q_wr_ptr - (q)->q_rd_ptr + (q)->q_length) : ((q)->q_wr_ptr - (q)->q_rd_ptr))
/* Return queue slots free count
* params:
* const q_t *q
* returns:
* u16
*/
#define CSR_WIFI_HIP_Q_SLOTS_FREE(q) \
((q)->q_length - CSR_WIFI_HIP_Q_SLOTS_USED((q)) - 1)
/* Return slot signal data pointer
* params:
* const q_t *q
* u16 slot
* returns:
* card_signal_t *
*/
#define CSR_WIFI_HIP_Q_SLOT_DATA(q, slot) \
((q)->q_body + slot)
/* Return queue next read slot
* params:
* const q_t *q
* returns:
* u16 slot offset
*/
#define CSR_WIFI_HIP_Q_NEXT_R_SLOT(q) \
((q)->q_rd_ptr)
/* Return queue next write slot
* params:
* const q_t *q
* returns:
* u16 slot offset
*/
#define CSR_WIFI_HIP_Q_NEXT_W_SLOT(q) \
((q)->q_wr_ptr)
/* Return updated queue pointer wrapped around its length
* params:
* const q_t *q
* u16 x amount to add to queue pointer
* returns:
* u16 wrapped queue pointer
*/
#define CSR_WIFI_HIP_Q_WRAP(q, x) \
((((x) >= (q)->q_length)?((x) % (q)->q_length) : (x)))
/* Advance queue read pointer
* params:
* const q_t *q
*/
#define CSR_WIFI_HIP_Q_INC_R(q) \
((q)->q_rd_ptr = CSR_WIFI_HIP_Q_WRAP((q), (q)->q_rd_ptr + 1))
/* Advance queue write pointer
* params:
* const q_t *q
*/
#define CSR_WIFI_HIP_Q_INC_W(q) \
((q)->q_wr_ptr = CSR_WIFI_HIP_Q_WRAP((q), (q)->q_wr_ptr + 1))
enum unifi_host_state
{
UNIFI_HOST_STATE_AWAKE = 0,
UNIFI_HOST_STATE_DROWSY = 1,
UNIFI_HOST_STATE_TORPID = 2
};
typedef struct
{
bulk_data_desc_t bd;
unifi_TrafficQueue queue; /* Used for dynamic slot reservation */
} slot_desc_t;
/*
* Structure describing a UniFi SDIO card.
*/
struct card
{
/*
* Back pointer for the higher level OS code. This is passed as
* an argument to callbacks (e.g. for received data and indications).
*/
void *ospriv;
/*
* mapping of HIP slot to MA-PACKET.req host tag, the
* array is indexed by slot numbers and each index stores
* information of the last host tag it was used for
*/
u32 *fh_slot_host_tag_record;
/* Info read from Symbol Table during probe */
u32 build_id;
char build_id_string[128];
/* Retrieve from SDIO driver. */
u16 chip_id;
/* Read from GBL_CHIP_VERSION. */
u16 chip_version;
/* From the SDIO driver (probably 1) */
u8 function;
/* This is sused to get the register addresses and things. */
ChipDescript *helper;
/*
* Bit mask of PIOs for the loader to waggle during download.
* We assume these are connected to LEDs. The main firmware gets
* the mask from a MIB entry.
*/
s32 loader_led_mask;
/*
* Support for flow control. When the from-host queue of signals
* is full, we ask the host upper layer to stop sending packets. When
* the queue drains we tell it that it can send packets again.
* We use this flag to remember the current state.
*/
#define card_is_tx_q_paused(card, q) (card->tx_q_paused_flag[q])
#define card_tx_q_unpause(card, q) (card->tx_q_paused_flag[q] = 0)
#define card_tx_q_pause(card, q) (card->tx_q_paused_flag[q] = 1)
u16 tx_q_paused_flag[UNIFI_TRAFFIC_Q_MAX + 1 + UNIFI_NO_OF_TX_QS]; /* defensive more than big enough */
/* UDI callback for logging UniFi interactions */
udi_func_t udi_hook;
u8 bh_reason_host;
u8 bh_reason_unifi;
/* SDIO clock speed request from OS layer */
u8 request_max_clock;
/* Last SDIO clock frequency set */
u32 sdio_clock_speed;
/*
* Current host state (copy of value in IOABORT register and
* spinlock to protect it.
*/
enum unifi_host_state host_state;
enum unifi_low_power_mode low_power_mode;
enum unifi_periodic_wake_mode periodic_wake_mode;
/*
* Ring buffer of signal structs for a queue of data packets from
* the host.
* The queue is empty when fh_data_q_num_rd == fh_data_q_num_wr.
* To add a packet to the queue, copy it to index given by
* (fh_data_q_num_wr%UNIFI_SOFT_Q_LENGTH) and advance fh_data_q_num_wr.
* To take a packet from the queue, copy data from index given by
* (fh_data_q_num_rd%UNIFI_SOFT_Q_LENGTH) and advance fh_data_q_num_rd.
* fh_data_q_num_rd and fh_data_q_num_rd are both modulo 256.
*/
card_signal_t fh_command_q_body[UNIFI_SOFT_COMMAND_Q_LENGTH];
q_t fh_command_queue;
card_signal_t fh_traffic_q_body[UNIFI_NO_OF_TX_QS][UNIFI_SOFT_TRAFFIC_Q_LENGTH];
q_t fh_traffic_queue[UNIFI_NO_OF_TX_QS];
/*
* Signal counts from UniFi SDIO Control Data Structure.
* These are cached and synchronised with the UniFi before and after
* a batch of operations.
*
* These are the modulo-256 count of signals written to or read from UniFi
* The value is incremented for every signal.
*/
s32 from_host_signals_w;
s32 from_host_signals_r;
s32 to_host_signals_r;
s32 to_host_signals_w;
/* Should specify buffer size as a number of signals */
/*
* Enough for 10 th and 10 fh data slots:
* 1 * 10 * 8 = 80
* 2 * 10 * 8 = 160
*/
#define UNIFI_FH_BUF_SIZE 1024
struct sigbuf
{
u8 *buf; /* buffer area */
u8 *ptr; /* current pos */
u16 count; /* signal count */
u16 bufsize;
} fh_buffer;
struct sigbuf th_buffer;
/*
* Field to use for the incrementing value to write to the UniFi
* SHARED_IO_INTERRUPT register.
* Flag to say we need to generate an interrupt at end of processing.
*/
u32 unifi_interrupt_seq;
u8 generate_interrupt;
/* Pointers to the bulk data slots */
slot_desc_t *from_host_data;
bulk_data_desc_t *to_host_data;
/*
* Index of the next (hopefully) free data slot.
* This is an optimisation that starts searching at a more likely point
* than the beginning.
*/
s16 from_host_data_head;
/* Dynamic slot allocation for queues */
card_dynamic_slot_t dynamic_slot_data;
/*
* SDIO specific fields
*/
/* Interface pointer for the SDIO library */
CsrSdioFunction *sdio_if;
/* Copy of config_data struct from the card */
sdio_config_data_t config_data;
/* SDIO address of the Initialised flag and Control Data struct */
u32 init_flag_addr;
u32 sdio_ctrl_addr;
/* The last value written to the Shared Data Memory Page register */
u32 proc_select;
u32 dmem_page;
u32 pmem_page;
/* SDIO traffic counters limited to 32 bits for Synergy compatibility */
u32 sdio_bytes_read;
u32 sdio_bytes_written;
u8 memory_resources_allocated;
/* UniFi SDIO I/O Block size. */
u16 sdio_io_block_size;
/* Pad transfer sizes to SDIO block boundaries */
u8 sdio_io_block_pad;
/* Read from the XBV */
struct FWOV fwov;
#ifndef CSR_WIFI_HIP_TA_DISABLE
/* TA sampling */
ta_data_t ta_sampling;
#endif
/* Auto-coredump */
s16 request_coredump_on_reset; /* request coredump on next reset */
struct coredump_buf *dump_buf; /* root node */
struct coredump_buf *dump_next_write; /* node to fill at next dump */
struct coredump_buf *dump_cur_read; /* valid node to read, or NULL */
#ifdef CSR_WIFI_HIP_DATA_PLANE_PROFILE
struct cmd_profile
{
u32 cmd52_count;
u32 cmd53_count;
u32 tx_count;
u32 tx_cfm_count;
u32 rx_count;
u32 bh_count;
u32 process_count;
u32 protocol_count;
u32 cmd52_f0_r_count;
u32 cmd52_f0_w_count;
u32 cmd52_r8or16_count;
u32 cmd52_w8or16_count;
u32 cmd52_r16_count;
u32 cmd52_w16_count;
u32 cmd52_r32_count;
u32 sdio_cmd_signal;
u32 sdio_cmd_clear_slot;
u32 sdio_cmd_to_host;
u32 sdio_cmd_from_host;
u32 sdio_cmd_from_host_and_clear;
} hip_prof;
struct cmd_profile cmd_prof;
#endif
/* Interrupt processing mode flags */
u32 intmode;
#ifdef UNIFI_DEBUG
u8 lsb;
#endif
/* Historic firmware panic codes */
u32 panic_data_phy_addr;
u32 panic_data_mac_addr;
u16 last_phy_panic_code;
u16 last_phy_panic_arg;
u16 last_mac_panic_code;
u16 last_mac_panic_arg;
#ifdef CSR_PRE_ALLOC_NET_DATA
bulk_data_desc_t bulk_data_desc_list[BULK_DATA_PRE_ALLOC_NUM];
u16 prealloc_netdata_r;
u16 prealloc_netdata_w;
#endif
}; /* struct card */
/* Reset types */
enum unifi_reset_type
{
UNIFI_COLD_RESET = 1,
UNIFI_WARM_RESET = 2
};
/*
* unifi_set_host_state() implements signalling for waking UniFi from
* deep sleep. The host indicates to UniFi that it is in one of three states:
* Torpid - host has nothing to send, UniFi can go to sleep.
* Drowsy - host has data to send to UniFi. UniFi will respond with an
* SDIO interrupt. When hosts responds it moves to Awake.
* Awake - host has data to transfer, UniFi must stay awake.
* When host has finished, it moves to Torpid.
*/
CsrResult unifi_set_host_state(card_t *card, enum unifi_host_state state);
CsrResult unifi_set_proc_select(card_t *card, enum unifi_dbg_processors_select select);
s32 card_read_signal_counts(card_t *card);
bulk_data_desc_t* card_find_data_slot(card_t *card, s16 slot);
CsrResult unifi_read32(card_t *card, u32 unifi_addr, u32 *pdata);
CsrResult unifi_readnz(card_t *card, u32 unifi_addr,
void *pdata, u16 len);
s32 unifi_read_shared_count(card_t *card, u32 addr);
CsrResult unifi_writen(card_t *card, u32 unifi_addr, void *pdata, u16 len);
CsrResult unifi_bulk_rw(card_t *card, u32 handle,
void *pdata, u32 len, s16 direction);
CsrResult unifi_bulk_rw_noretry(card_t *card, u32 handle,
void *pdata, u32 len, s16 direction);
#define UNIFI_SDIO_READ 0
#define UNIFI_SDIO_WRITE 1
CsrResult unifi_read_8_or_16(card_t *card, u32 unifi_addr, u8 *pdata);
CsrResult unifi_write_8_or_16(card_t *card, u32 unifi_addr, u8 data);
CsrResult unifi_read_direct_8_or_16(card_t *card, u32 addr, u8 *pdata);
CsrResult unifi_write_direct_8_or_16(card_t *card, u32 addr, u8 data);
CsrResult unifi_read_direct16(card_t *card, u32 addr, u16 *pdata);
CsrResult unifi_read_direct32(card_t *card, u32 addr, u32 *pdata);
CsrResult unifi_read_directn(card_t *card, u32 addr, void *pdata, u16 len);
CsrResult unifi_write_direct16(card_t *card, u32 addr, u16 data);
CsrResult unifi_write_directn(card_t *card, u32 addr, void *pdata, u16 len);
CsrResult sdio_read_f0(card_t *card, u32 addr, u8 *pdata);
CsrResult sdio_write_f0(card_t *card, u32 addr, u8 data);
void unifi_read_panic(card_t *card);
#ifdef CSR_PRE_ALLOC_NET_DATA
void prealloc_netdata_free(card_t *card);
CsrResult prealloc_netdata_alloc(card_t *card);
#endif
/* For diagnostic use */
void dump(void *mem, u16 len);
void dump16(void *mem, u16 len);
#endif /* __CARD_SDIO_H__ */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,793 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include "csr_macro.h"
#include "csr_wifi_hip_chiphelper_private.h"
#ifndef nelem
#define nelem(a) (sizeof(a) / sizeof(a[0]))
#endif
#define counted(foo) { nelem(foo), foo }
#define null_counted() { 0, NULL }
/* The init values are a set of register writes that we must
perform when we first connect to the chip to get it working.
They swicth on the correct clocks and possibly set the host
interface as a wkaeup source. They should not be used if
proper HIP opperation is required, but are useful before we
do a code download. */
static const struct chip_helper_init_values init_vals_v1[] = {
{ 0xFDBB, 0xFFFF },
{ 0xFDB6, 0x03FF },
{ 0xFDB1, 0x01E3 },
{ 0xFDB3, 0x0FFF },
{ 0xFEE3, 0x08F0 },
{ 0xFEE7, 0x3C3F },
{ 0xFEE6, 0x0050 },
{ 0xFDBA, 0x0000 }
};
static const struct chip_helper_init_values init_vals_v2[] = {
{ 0xFDB6, 0x0FFF },
{ 0xF023, 0x3F3F },
{ 0xFDB1, 0x01E3 },
{ 0xFDB3, 0x0FFF },
{ 0xF003, 0x08F0 },
{ 0xF007, 0x3C3F },
{ 0xF006, 0x0050 }
};
static const struct chip_helper_init_values init_vals_v22_v23[] = {
{ 0xF81C, 0x00FF },
/*{ 0x????, 0x???? }, */
{ 0xF80C, 0x1FFF },
{ 0xFA25, 0x001F },
{ 0xF804, 0x00FF },
{ 0xF802, 0x0FFF },
/*{ 0x????, 0x???? },
{ 0x????, 0x???? },
{ 0x????, 0x???? }*/
};
static const u16 reset_program_a_v1_or_v2[] = {
0x0000
};
static const u16 reset_program_b_v1_or_v2[] = {
0x0010, 0xFE00, 0xA021, 0xFF00, 0x8111, 0x0009, 0x0CA4, 0x0114,
0x0280, 0x04F8, 0xFE00, 0x6F25, 0x06E0, 0x0010, 0xFC00, 0x0121,
0xFC00, 0x0225, 0xFE00, 0x7125, 0xFE00, 0x6D11, 0x03F0, 0xFE00,
0x6E25, 0x0008, 0x00E0
};
static const struct chip_helper_reset_values reset_program_v1_or_v2[] =
{
{
MAKE_GP(REGISTERS, 0x000C),
nelem(reset_program_a_v1_or_v2),
reset_program_a_v1_or_v2
},
{
MAKE_GP(MAC_PMEM, 0x000000),
nelem(reset_program_b_v1_or_v2),
reset_program_b_v1_or_v2
}
};
static const struct chip_map_address_t unifi_map_address_v1_v2[] =
{
{ 0xFE9F, 0xFE7B }, /* PM1_BANK_SELECT */
{ 0xFE9E, 0xFE78 }, /* PM2_BANK_SELECT */
{ 0xFE9D, 0xFE7E }, /* SHARED_DMEM_PAGE */
{ 0xFE91, 0xFE90 }, /* PROC_SELECT */
{ 0xFE8D, 0xFE8C }, /* STOP_STATUS */
};
static const struct chip_map_address_t unifi_map_address_v22_v23[] =
{
{ 0xF8F9, 0xF8AC }, /* GW1_CONFIG */
{ 0xF8FA, 0xF8AD }, /* GW2_CONFIG */
{ 0xF8FB, 0xF8AE }, /* GW3_CONFIG */
{ 0xF830, 0xF81E }, /* PROC_SELECT */
{ 0xF831, 0xF81F }, /* STOP_STATUS */
{ 0xF8FC, 0xF8AF }, /* IO_LOG_ADDRESS */
};
static const struct chip_device_regs_t unifi_device_regs_null =
{
0xFE81, /* GBL_CHIP_VERSION */
0x0000, /* GBL_MISC_ENABLES */
0x0000, /* DBG_EMU_CMD */
{
0x0000, /* HOST.DBG_PROC_SELECT */
0x0000, /* HOST.DBG_STOP_STATUS */
0x0000, /* HOST.WINDOW1_PAGE */
0x0000, /* HOST.WINDOW2_PAGE */
0x0000, /* HOST.WINDOW3_PAGE */
0x0000 /* HOST.IO_LOG_ADDR */
},
{
0x0000, /* SPI.DBG_PROC_SELECT */
0x0000, /* SPI.DBG_STOP_STATUS */
0x0000, /* SPI.WINDOW1_PAGE */
0x0000, /* SPI.WINDOW2_PAGE */
0x0000, /* SPI.WINDOW3_PAGE */
0x0000 /* SPI.IO_LOG_ADDR */
},
0x0000, /* DBG_RESET */
0x0000, /* > DBG_RESET_VALUE */
0x0000, /* DBG_RESET_WARN */
0x0000, /* DBG_RESET_WARN_VALUE */
0x0000, /* DBG_RESET_RESULT */
0xFFE9, /* XAP_PCH */
0xFFEA, /* XAP_PCL */
0x0000, /* PROC_PC_SNOOP */
0x0000, /* WATCHDOG_DISABLE */
0x0000, /* MAILBOX0 */
0x0000, /* MAILBOX1 */
0x0000, /* MAILBOX2 */
0x0000, /* MAILBOX3 */
0x0000, /* SDIO_HOST_INT */
0x0000, /* SHARED_IO_INTERRUPT */
0x0000, /* SDIO HIP HANDSHAKE */
0x0000 /* COEX_STATUS */
};
/* UF105x */
static const struct chip_device_regs_t unifi_device_regs_v1 =
{
0xFE81, /* GBL_CHIP_VERSION */
0xFE87, /* GBL_MISC_ENABLES */
0xFE9C, /* DBG_EMU_CMD */
{
0xFE90, /* HOST.DBG_PROC_SELECT */
0xFE8C, /* HOST.DBG_STOP_STATUS */
0xFE7B, /* HOST.WINDOW1_PAGE */
0xFE78, /* HOST.WINDOW2_PAGE */
0xFE7E, /* HOST.WINDOW3_PAGE */
0x0000 /* HOST.IO_LOG_ADDR */
},
{
0xFE91, /* SPI.DBG_PROC_SELECT */
0xFE8D, /* SPI.DBG_STOP_STATUS */
0xFE9F, /* SPI.WINDOW1_PAGE */
0xFE9E, /* SPI.WINDOW2_PAGE */
0xFE9D, /* SPI.WINDOW3_PAGE */
0x0000 /* SPI.IO_LOG_ADDR */
},
0xFE92, /* DBG_RESET */
0x0001, /* > DBG_RESET_VALUE */
0xFDA0, /* DBG_RESET_WARN (HOST_SELECT) */
0x0000, /* DBG_RESET_WARN_VALUE */
0xFE92, /* DBG_RESET_RESULT */
0xFFE9, /* XAP_PCH */
0xFFEA, /* XAP_PCL */
0x0051, /* PROC_PC_SNOOP */
0xFE70, /* WATCHDOG_DISABLE */
0xFE6B, /* MAILBOX0 */
0xFE6A, /* MAILBOX1 */
0xFE69, /* MAILBOX2 */
0xFE68, /* MAILBOX3 */
0xFE67, /* SDIO_HOST_INT */
0xFE65, /* SHARED_IO_INTERRUPT */
0xFDE9, /* SDIO HIP HANDSHAKE */
0x0000 /* COEX_STATUS */
};
/* UF2... */
static const struct chip_device_regs_t unifi_device_regs_v2 =
{
0xFE81, /* GBL_CHIP_VERSION */
0xFE87, /* GBL_MISC_ENABLES */
0xFE9C, /* DBG_EMU_CMD */
{
0xFE90, /* HOST.DBG_PROC_SELECT */
0xFE8C, /* HOST.DBG_STOP_STATUS */
0xFE7B, /* HOST.WINDOW1_PAGE */
0xFE78, /* HOST.WINDOW2_PAGE */
0xFE7E, /* HOST.WINDOW3_PAGE */
0x0000 /* HOST.IO_LOG_ADDR */
},
{
0xFE91, /* SPI.DBG_PROC_SELECT */
0xFE8D, /* SPI.DBG_STOP_STATUS */
0xFE9F, /* SPI.WINDOW1_PAGE */
0xFE9E, /* SPI.WINDOW2_PAGE */
0xFE9D, /* SPI.WINDOW3_PAGE */
0x0000 /* SPI.IO_LOG_ADDR */
},
0xFE92, /* DBG_RESET */
0x0000, /* > DBG_RESET_VALUE */
0xFDE9, /* DBG_RESET_WARN (TEST_FLASH_DATA - SHARED_MAILBOX2B) */
0xFFFF, /* DBG_RESET_WARN_VALUE */
0xFDE9, /* DBG_RESET_RESULT (TEST_FLASH_DATA) */
0xFFE9, /* XAP_PCH */
0xFFEA, /* XAP_PCL */
0x0051, /* PROC_PC_SNOOP */
0xFE70, /* WATCHDOG_DISABLE */
0xFE6B, /* MAILBOX0 */
0xFE6A, /* MAILBOX1 */
0xFE69, /* MAILBOX2 */
0xFE68, /* MAILBOX3 */
0xFE67, /* SDIO_HOST_INT */
0xFE65, /* SHARED_IO_INTERRUPT */
0xFE69, /* SDIO HIP HANDSHAKE */
0x0000 /* COEX_STATUS */
};
/* UF60xx */
static const struct chip_device_regs_t unifi_device_regs_v22_v23 =
{
0xFE81, /* GBL_CHIP_VERSION */
0xF84F, /* GBL_MISC_ENABLES */
0xF81D, /* DBG_EMU_CMD */
{
0xF81E, /* HOST.DBG_PROC_SELECT */
0xF81F, /* HOST.DBG_STOP_STATUS */
0xF8AC, /* HOST.WINDOW1_PAGE */
0xF8AD, /* HOST.WINDOW2_PAGE */
0xF8AE, /* HOST.WINDOW3_PAGE */
0xF8AF /* HOST.IO_LOG_ADDR */
},
{
0xF830, /* SPI.DBG_PROC_SELECT */
0xF831, /* SPI.DBG_STOP_STATUS */
0xF8F9, /* SPI.WINDOW1_PAGE */
0xF8FA, /* SPI.WINDOW2_PAGE */
0xF8FB, /* SPI.WINDOW3_PAGE */
0xF8FC /* SPI.IO_LOG_ADDR */
},
0xF82F, /* DBG_RESET */
0x0001, /* > DBG_RESET_VALUE */
0x0000, /* DBG_RESET_WARN */
0x0000, /* DBG_RESET_WARN_VALUE */
0xF82F, /* DBG_RESET_RESULT */
0xFFE9, /* XAP_PCH */
0xFFEA, /* XAP_PCL */
0x001B, /* PROC_PC_SNOOP */
0x0055, /* WATCHDOG_DISABLE */
0xF84B, /* MAILBOX0 */
0xF84C, /* MAILBOX1 */
0xF84D, /* MAILBOX2 */
0xF84E, /* MAILBOX3 */
0xF92F, /* SDIO_HOST_INT */
0xF92B, /* SDIO_FROMHOST_SCRTACH0 / SHARED_IO_INTERRUPT */
0xF84D, /* SDIO HIP HANDSHAKE (MAILBOX2) */
0xF9FB /* COEX_STATUS */
};
/* Program memory window on UF105x. */
static const struct window_shift_info_t prog_window_array_unifi_v1_v2[CHIP_HELPER_WT_COUNT] =
{
{ TRUE, 11, 0x0200 }, /* CODE RAM */
{ TRUE, 11, 0x0000 }, /* FLASH */
{ TRUE, 11, 0x0400 }, /* External SRAM */
{ FALSE, 0, 0 }, /* ROM */
{ FALSE, 0, 0 } /* SHARED */
};
/* Shared memory window on UF105x. */
static const struct window_shift_info_t shared_window_array_unifi_v1_v2[CHIP_HELPER_WT_COUNT] =
{
{ FALSE, 0, 0 }, /* CODE RAM */
{ FALSE, 0, 0 }, /* FLASH */
{ FALSE, 0, 0 }, /* External SRAM */
{ FALSE, 0, 0 }, /* ROM */
{ TRUE, 11, 0x0000 } /* SHARED */
};
/* One of the Generic Windows on UF60xx and later. */
static const struct window_shift_info_t generic_window_array_unifi_v22_v23[CHIP_HELPER_WT_COUNT] =
{
{ TRUE, 11, 0x3800 }, /* CODE RAM */
{ FALSE, 0, 0 }, /* FLASH */
{ FALSE, 0, 0 }, /* External SRAM */
{ TRUE, 11, 0x2000 }, /* ROM */
{ TRUE, 11, 0x0000 } /* SHARED */
};
/* The three windows on UF105x. */
static const struct window_info_t prog1_window_unifi_v1_v2 = { 0x0000, 0x2000, 0x0080, prog_window_array_unifi_v1_v2 };
static const struct window_info_t prog2_window_unifi_v1_v2 = { 0x2000, 0x2000, 0x0000, prog_window_array_unifi_v1_v2 };
static const struct window_info_t shared_window_unifi_v1_v2 = { 0x4000, 0x2000, 0x0000, shared_window_array_unifi_v1_v2 };
/* The three windows on UF60xx and later. */
static const struct window_info_t generic1_window_unifi_v22_v23 = { 0x0000, 0x2000, 0x0080, generic_window_array_unifi_v22_v23 };
static const struct window_info_t generic2_window_unifi_v22_v23 = { 0x2000, 0x2000, 0x0000, generic_window_array_unifi_v22_v23 };
static const struct window_info_t generic3_window_unifi_v22_v23 = { 0x4000, 0x2000, 0x0000, generic_window_array_unifi_v22_v23 };
static const struct chip_device_desc_t chip_device_desc_null =
{
{ FALSE, 0x0000, 0x0000, 0x00 },
"",
"",
null_counted(), /* init */
null_counted(), /* reset_prog */
&unifi_device_regs_null, /* regs */
{
FALSE, /* has_flash */
FALSE, /* has_ext_sram */
FALSE, /* has_rom */
FALSE, /* has_bt */
FALSE, /* has_wlan */
},
null_counted(),
/* prog_offset */
{
0x00000000,
0x00000000,
0x00000000,
0x00000000
},
/* data_offset */
{
0x0000 /* ram */
},
/* windows */
{
NULL,
NULL,
NULL
}
};
static const struct chip_device_desc_t unifi_device_desc_v1 =
{
{ FALSE, 0xf0ff, 0x1001, 0x01 }, /* UF105x R01 */
"UF105x",
"UniFi-1",
counted(init_vals_v1), /* init */
counted(reset_program_v1_or_v2), /* reset_prog */
&unifi_device_regs_v1, /* regs */
{
TRUE, /* has_flash */
TRUE, /* has_ext_sram */
FALSE, /* has_rom */
FALSE, /* has_bt */
TRUE, /* has_wlan */
},
counted(unifi_map_address_v1_v2), /* map */
/* prog_offset */
{
0x00100000, /* ram */
0x00000000, /* rom (invalid) */
0x00000000, /* flash */
0x00200000, /* ext_ram */
},
/* data_offset */
{
0x8000 /* ram */
},
/* windows */
{
&prog1_window_unifi_v1_v2,
&prog2_window_unifi_v1_v2,
&shared_window_unifi_v1_v2
}
};
static const struct chip_device_desc_t unifi_device_desc_v2 =
{
{ FALSE, 0xf0ff, 0x2001, 0x02 }, /* UF2... R02 */
"UF2...",
"UniFi-2",
counted(init_vals_v2), /* init */
counted(reset_program_v1_or_v2), /* reset_prog */
&unifi_device_regs_v2, /* regs */
{
TRUE, /* has_flash */
TRUE, /* has_ext_sram */
FALSE, /* has_rom */
FALSE, /* has_bt */
TRUE, /* has_wlan */
},
counted(unifi_map_address_v1_v2), /* map */
/* prog_offset */
{
0x00100000, /* ram */
0x00000000, /* rom (invalid) */
0x00000000, /* flash */
0x00200000, /* ext_ram */
},
/* data_offset */
{
0x8000 /* ram */
},
/* windows */
{
&prog1_window_unifi_v1_v2,
&prog2_window_unifi_v1_v2,
&shared_window_unifi_v1_v2
}
};
static const struct chip_device_desc_t unifi_device_desc_v3 =
{
{ FALSE, 0xf0ff, 0x3001, 0x02 }, /* UF2... R03 */
"UF2...",
"UniFi-3",
counted(init_vals_v2), /* init */
counted(reset_program_v1_or_v2), /* reset_prog */
&unifi_device_regs_v2, /* regs */
{
TRUE, /* has_flash */
TRUE, /* has_ext_sram */
FALSE, /* has_rom */
FALSE, /* has_bt */
TRUE, /* has_wlan */
},
counted(unifi_map_address_v1_v2), /* map */
/* prog_offset */
{
0x00100000, /* ram */
0x00000000, /* rom (invalid) */
0x00000000, /* flash */
0x00200000, /* ext_ram */
},
/* data_offset */
{
0x8000 /* ram */
},
/* windows */
{
&prog1_window_unifi_v1_v2,
&prog2_window_unifi_v1_v2,
&shared_window_unifi_v1_v2
}
};
static const struct chip_device_desc_t unifi_device_desc_v22 =
{
{ FALSE, 0x00ff, 0x0022, 0x07 }, /* UF60xx */
"UF60xx",
"UniFi-4",
counted(init_vals_v22_v23), /* init */
null_counted(), /* reset_prog */
&unifi_device_regs_v22_v23, /* regs */
{
FALSE, /* has_flash */
FALSE, /* has_ext_sram */
TRUE, /* has_rom */
FALSE, /* has_bt */
TRUE, /* has_wlan */
},
counted(unifi_map_address_v22_v23), /* map */
/* prog_offset */
{
0x00C00000, /* ram */
0x00000000, /* rom */
0x00000000, /* flash (invalid) */
0x00000000, /* ext_ram (invalid) */
},
/* data_offset */
{
0x8000 /* ram */
},
/* windows */
{
&generic1_window_unifi_v22_v23,
&generic2_window_unifi_v22_v23,
&generic3_window_unifi_v22_v23
}
};
static const struct chip_device_desc_t unifi_device_desc_v23 =
{
{ FALSE, 0x00ff, 0x0023, 0x08 }, /* UF.... */
"UF....",
"UF.... (5)",
counted(init_vals_v22_v23), /* init */
null_counted(), /* reset_prog */
&unifi_device_regs_v22_v23, /* regs */
{
FALSE, /* has_flash */
FALSE, /* has_ext_sram */
TRUE, /* has_rom */
TRUE, /* has_bt */
TRUE, /* has_wlan */
},
counted(unifi_map_address_v22_v23),
/* prog_offset */
{
0x00C00000, /* ram */
0x00000000, /* rom */
0x00000000, /* flash (invalid) */
0x00000000, /* ext_sram (invalid) */
},
/* data_offset */
{
0x8000 /* ram */
},
/* windows */
{
&generic1_window_unifi_v22_v23,
&generic2_window_unifi_v22_v23,
&generic3_window_unifi_v22_v23
}
};
static const struct chip_device_desc_t hyd_wlan_subsys_desc_v1 =
{
{ FALSE, 0x00ff, 0x0044, 0x00 }, /* UF.... */
"HYD...",
"HYD... ",
counted(init_vals_v22_v23), /* init */
null_counted(), /* reset_prog */
&unifi_device_regs_v22_v23, /* regs */
{
FALSE, /* has_flash */
FALSE, /* has_ext_sram */
TRUE, /* has_rom */
FALSE, /* has_bt */
TRUE, /* has_wlan */
},
counted(unifi_map_address_v22_v23),
/* prog_offset */
{
0x00C00000, /* ram */
0x00000000, /* rom */
0x00000000, /* flash (invalid) */
0x00000000, /* ext_sram (invalid) */
},
/* data_offset */
{
0x8000 /* ram */
},
/* windows */
{
&generic1_window_unifi_v22_v23,
&generic2_window_unifi_v22_v23,
&generic3_window_unifi_v22_v23
}
};
/* This is the list of all chips that we know about. I'm
assuming that the order here will be important - we
might have multiple entries witrh the same SDIO id for
instance. The first one in this list will be the one
that is returned if a search is done on only that id.
The client will then have to call GetVersionXXX again
but with more detailed info.
I don't know if we need to signal this up to the client
in some way?
(We get the SDIO id before we know anything else about
the chip. We might not be able to read any of the other
registers at first, but we still need to know about the
chip). */
static const struct chip_device_desc_t *chip_ver_to_desc[] =
{
&unifi_device_desc_v1, /* UF105x R01 */
&unifi_device_desc_v2, /* UF2... R02 */
&unifi_device_desc_v3, /* UF2... R03 */
&unifi_device_desc_v22, /* UF60xx */
&unifi_device_desc_v23, /* UF.... */
&hyd_wlan_subsys_desc_v1
};
ChipDescript* ChipHelper_GetVersionSdio(u8 sdio_ver)
{
u32 i;
for (i = 0; i < nelem(chip_ver_to_desc); i++)
{
if (chip_ver_to_desc[i]->chip_version.sdio == sdio_ver)
{
return chip_ver_to_desc[i];
}
}
return &chip_device_desc_null;
}
ChipDescript* ChipHelper_GetVersionAny(u16 from_FF9A, u16 from_FE81)
{
u32 i;
if ((from_FF9A & 0xFF00) != 0)
{
for (i = 0; i < nelem(chip_ver_to_desc); i++)
{
if (chip_ver_to_desc[i]->chip_version.pre_bc7 &&
((from_FF9A & chip_ver_to_desc[i]->chip_version.mask) ==
chip_ver_to_desc[i]->chip_version.result))
{
return chip_ver_to_desc[i];
}
}
}
else
{
for (i = 0; i < nelem(chip_ver_to_desc); i++)
{
if (!chip_ver_to_desc[i]->chip_version.pre_bc7 &&
((from_FE81 & chip_ver_to_desc[i]->chip_version.mask) ==
chip_ver_to_desc[i]->chip_version.result))
{
return chip_ver_to_desc[i];
}
}
}
return &chip_device_desc_null;
}
ChipDescript* ChipHelper_GetVersionUniFi(u16 ver)
{
return ChipHelper_GetVersionAny(0x0000, ver);
}
ChipDescript *ChipHelper_Null(void)
{
return &chip_device_desc_null;
}
ChipDescript* ChipHelper_GetVersionBlueCore(enum chip_helper_bluecore_age bc_age, u16 version)
{
if (bc_age == chip_helper_bluecore_pre_bc7)
{
return ChipHelper_GetVersionAny(version, 0x0000);
}
else
{
return ChipHelper_GetVersionAny(0x0000, version);
}
}
/* Expand the DEF0 functions into simple code to return the
correct thing. The DEF1 functions expand to nothing in
this X macro expansion. */
#define CHIP_HELPER_DEF0_C_DEF(ret_type, name, info) \
ret_type ChipHelper_ ## name(ChipDescript * chip_help) \
{ \
return chip_help->info; \
}
#define CHIP_HELPER_DEF1_C_DEF(ret_type, name, type1, name1)
CHIP_HELPER_LIST(C_DEF)
/*
* Map register addresses between HOST and SPI access.
*/
u16 ChipHelper_MapAddress_SPI2HOST(ChipDescript *chip_help, u16 addr)
{
u32 i;
for (i = 0; i < chip_help->map.len; i++)
{
if (chip_help->map.vals[i].spi == addr)
{
return chip_help->map.vals[i].host;
}
}
return addr;
}
u16 ChipHelper_MapAddress_HOST2SPI(ChipDescript *chip_help, u16 addr)
{
u32 i;
for (i = 0; i < chip_help->map.len; i++)
{
if (chip_help->map.vals[i].host == addr)
{
return chip_help->map.vals[i].spi;
}
}
return addr;
}
/* The address returned by this function is the start of the
window in the address space, that is where we can start
accessing data from. If a section of the window at the
start is unusable because something else is cluttering up
the address map then that is taken into account and this
function returns that address justt past that. */
u16 ChipHelper_WINDOW_ADDRESS(ChipDescript *chip_help,
enum chip_helper_window_index window)
{
if (window < CHIP_HELPER_WINDOW_COUNT &&
chip_help->windows[window] != NULL)
{
return chip_help->windows[window]->address + chip_help->windows[window]->blocked;
}
return 0;
}
/* This returns the size of the window minus any blocked section */
u16 ChipHelper_WINDOW_SIZE(ChipDescript *chip_help,
enum chip_helper_window_index window)
{
if (window < CHIP_HELPER_WINDOW_COUNT &&
chip_help->windows[window] != NULL)
{
return chip_help->windows[window]->size - chip_help->windows[window]->blocked;
}
return 0;
}
/* Get the register writes we should do to make sure that
the chip is running with most clocks on. */
u32 ChipHelper_ClockStartupSequence(ChipDescript *chip_help,
const struct chip_helper_init_values **val)
{
*val = chip_help->init.vals;
return chip_help->init.len;
}
/* Get the set of values tat we should write to the chip to perform a reset. */
u32 ChipHelper_HostResetSequence(ChipDescript *chip_help,
const struct chip_helper_reset_values **val)
{
*val = chip_help->reset_prog.vals;
return chip_help->reset_prog.len;
}
/* Decode a windowed access to the chip. */
s32 ChipHelper_DecodeWindow(ChipDescript *chip_help,
enum chip_helper_window_index window,
enum chip_helper_window_type type,
u32 offset,
u16 *page, u16 *addr, u32 *len)
{
const struct window_info_t *win;
const struct window_shift_info_t *mode;
u16 of, pg;
if (window >= CHIP_HELPER_WINDOW_COUNT)
{
return FALSE;
}
if ((win = chip_help->windows[window]) == NULL)
{
return FALSE;
}
if (type >= CHIP_HELPER_WT_COUNT)
{
return FALSE;
}
if ((mode = &win->mode[type]) == NULL)
{
return FALSE;
}
if (!mode->allowed)
{
return FALSE;
}
pg = (u16)(offset >> mode->page_shift) + mode->page_offset;
of = (u16)(offset & ((1 << mode->page_shift) - 1));
/* If 'blocked' is zero this does nothing, else decrease
the page register and increase the offset until we aren't
in the blocked region of the window. */
while (of < win->blocked)
{
of += 1 << mode->page_shift;
pg--;
}
*page = pg;
*addr = win->address + of;
*len = win->size - of;
return TRUE;
}

View file

@ -1,407 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_HIP_CHIPHELPER_H__
#define CSR_WIFI_HIP_CHIPHELPER_H__
#include <linux/types.h>
/* The age of the BlueCore chip. This is probably not useful, if
you know the age then you can probably work out the version directly. */
enum chip_helper_bluecore_age
{
chip_helper_bluecore_pre_bc7,
chip_helper_bluecore_bc7_or_later
};
/* We support up to three windowed regions at the moment.
Don't reorder these - they're used to index into an array. */
enum chip_helper_window_index
{
CHIP_HELPER_WINDOW_1 = 0,
CHIP_HELPER_WINDOW_2 = 1,
CHIP_HELPER_WINDOW_3 = 2,
CHIP_HELPER_WINDOW_COUNT = 3
};
/* These are the things that we can access through a window.
Don't reorder these - they're used to index into an array. */
enum chip_helper_window_type
{
CHIP_HELPER_WT_CODE_RAM = 0,
CHIP_HELPER_WT_FLASH = 1,
CHIP_HELPER_WT_EXT_SRAM = 2,
CHIP_HELPER_WT_ROM = 3,
CHIP_HELPER_WT_SHARED = 4,
CHIP_HELPER_WT_COUNT = 5
};
/* Commands to stop and start the XAP */
enum chip_helper_dbg_emu_cmd_enum
{
CHIP_HELPER_DBG_EMU_CMD_XAP_STEP_MASK = 0x0001,
CHIP_HELPER_DBG_EMU_CMD_XAP_RUN_B_MASK = 0x0002,
CHIP_HELPER_DBG_EMU_CMD_XAP_BRK_MASK = 0x0004,
CHIP_HELPER_DBG_EMU_CMD_XAP_WAKEUP_MASK = 0x0008
};
/* Bitmasks for Stop and sleep status: DBG_SPI_STOP_STATUS & DBG_HOST_STOP_STATUS */
enum chip_helper_dbg_stop_status_enum
{
CHIP_HELPER_DBG_STOP_STATUS_NONE_MASK = 0x0000,
CHIP_HELPER_DBG_STOP_STATUS_P0_MASK = 0x0001,
CHIP_HELPER_DBG_STOP_STATUS_P1_MASK = 0x0002,
CHIP_HELPER_DBG_STOP_STATUS_P2_MASK = 0x0004,
CHIP_HELPER_DBG_STOP_STATUS_SLEEP_STATUS_P0_MASK = 0x0008,
CHIP_HELPER_DBG_STOP_STATUS_SLEEP_STATUS_P1_MASK = 0x0010,
CHIP_HELPER_DBG_STOP_STATUS_SLEEP_STATUS_P2_MASK = 0x0020,
/* Legacy names/alias */
CHIP_HELPER_DBG_STOP_STATUS_MAC_MASK = 0x0001,
CHIP_HELPER_DBG_STOP_STATUS_PHY_MASK = 0x0002,
CHIP_HELPER_DBG_STOP_STATUS_BT_MASK = 0x0004,
CHIP_HELPER_DBG_STOP_STATUS_SLEEP_STATUS_MAC_MASK = 0x0008,
CHIP_HELPER_DBG_STOP_STATUS_SLEEP_STATUS_PHY_MASK = 0x0010,
CHIP_HELPER_DBG_STOP_STATUS_SLEEP_STATUS_BT_MASK = 0x0020
};
/* Codes to disable the watchdog */
enum chip_helper_watchdog_disable_enum
{
CHIP_HELPER_WATCHDOG_DISABLE_CODE1 = 0x6734,
CHIP_HELPER_WATCHDOG_DISABLE_CODE2 = 0xD6BF,
CHIP_HELPER_WATCHDOG_DISABLE_CODE3 = 0xC31E
};
/* Other bits have changed between versions */
enum chip_helper_gbl_misc_enum
{
CHIP_HELPER_GBL_MISC_SPI_STOP_OUT_EN_MASK = 0x0001,
CHIP_HELPER_GBL_MISC_MMU_INIT_DONE_MASK = 0x0004
};
/* Coex status register, contains interrupt status and reset pullup status.
* CHIP_HELPER_COEX_STATUS_RST_PULLS_MSB_MASK can be used to check
* for WAPI on R03 chips and later. */
enum chip_helper_coex_status_mask_enum
{
CHIP_HELPER_COEX_STATUS_RST_PULLS_LSB_MASK = 0x0001,
CHIP_HELPER_COEX_STATUS_RST_PULLS_MSB_MASK = 0x0008,
CHIP_HELPER_COEX_STATUS_WL_FEC_PINS_LSB_MASK = 0x0010,
CHIP_HELPER_COEX_STATUS_WL_FEC_PINS_MSB_MASK = 0x0080,
CHIP_HELPER_COEX_STATUS_INT_UART_MASK = 0x0100,
CHIP_HELPER_COEX_STATUS_INT_BT_LEG_MASK = 0x0200
};
/* How to select the different CPUs */
enum chip_helper_dbg_proc_sel_enum
{
CHIP_HELPER_DBG_PROC_SEL_MAC = 0,
CHIP_HELPER_DBG_PROC_SEL_PHY = 1,
CHIP_HELPER_DBG_PROC_SEL_BT = 2,
CHIP_HELPER_DBG_PROC_SEL_NONE = 2,
CHIP_HELPER_DBG_PROC_SEL_BOTH = 3
};
/* These are the only registers that we have to know the
address of before we know the chip version. */
enum chip_helper_fixed_registers
{
/* This is the address of GBL_CHIP_VERISON on BC7,
UF105x, UF60xx and
anything later than that. */
CHIP_HELPER_UNIFI_GBL_CHIP_VERSION = 0xFE81,
CHIP_HELPER_OLD_BLUECORE_GBL_CHIP_VERSION = 0xFF9A
/* This isn't used at the moment (but might be needed
to distinguish the BlueCore sub version?) */
/* CHIP_HELPER_OLD_BLUECORE_ANA_VERSION_ID = 0xFF7D */
};
/* Address-value pairs for defining initialisation values */
struct chip_helper_init_values
{
u16 addr;
u16 value;
};
/* A block of data that should be written to the device */
struct chip_helper_reset_values
{
u32 gp_address;
u32 len;
const u16 *data;
};
/*
* This is the C API.
*/
/* opaque type */
typedef const struct chip_device_desc_t ChipDescript;
/* Return a NULL descriptor */
ChipDescript* ChipHelper_Null(void);
/* This should get the correct version for any CSR chip.
The two parameters are what is read from addresses
0xFF9A and 0xFE81 (OLD_BLUECORE_GBL_CHIP_VERSION and
UNIFI_GBL_CHIP_VERSION). These should give a unique identity
for most (all?) chips.
FF9A is the old GBL_CHIP_VERSION register. If the high
eight bits are zero then the chip is a new (BC7 +) one
and FE81 is the _new_ GBL_CHIP_VERSION register. */
ChipDescript* ChipHelper_GetVersionAny(u16 from_FF9A, u16 from_FE81);
/* The chip is a UniFi, but we don't know which type
The parameter is the value of UNIFI_GBL_CHIP_VERSION (0xFE81) */
ChipDescript* ChipHelper_GetVersionUniFi(u16 version);
/* This gets the version from the SDIO device id. This only
gives quite a coarse grained version, so we should update once
we hav access to the function N registers. */
ChipDescript* ChipHelper_GetVersionSdio(u8 sdio_version);
/* The chip is some sort of BlueCore. If "age" is "pre_bc7" then
"version" is what was read from FF9A. If "age" is bc7_or_later
then "version" is read from FE81. If we don't know if we're pre
or post BC7 then we should use "GetVersionAny". */
ChipDescript* ChipHelper_GetVersionBlueCore(enum chip_helper_bluecore_age age,
u16 version);
/* The main functions of this class are built with an X macro. This
means we can generate the C and C++ versions from the same source
without the two diverging.
The DEF0 functions are simple and take no parameters. The first
parameter to the macro is the return type. The second parameter
is the function name and the third parameter is where to get the
info from (this is hidden from the user).
The DEF1 functions take one parameter. This time the third macro
parameter is the type of this parameter, and the fourth macro
parameter is the name of the parameter. The bodies of these
functions are hand written. */
#define CHIP_HELPER_LIST(m) \
CHIP_HELPER_DEF0(m, (const char *, FriendlyName, friendly_name)) \
CHIP_HELPER_DEF0(m, (const char *, MarketingName, marketing_name)) \
CHIP_HELPER_DEF0(m, (u16, DBG_EMU_CMD, regs->dbg_emu_cmd)) \
CHIP_HELPER_DEF0(m, (u16, DBG_HOST_PROC_SELECT, regs->host.dbg_proc_select)) \
CHIP_HELPER_DEF0(m, (u16, DBG_HOST_STOP_STATUS, regs->host.dbg_stop_status)) \
CHIP_HELPER_DEF0(m, (u16, HOST_WINDOW1_PAGE, regs->host.window1_page)) \
CHIP_HELPER_DEF0(m, (u16, HOST_WINDOW2_PAGE, regs->host.window2_page)) \
CHIP_HELPER_DEF0(m, (u16, HOST_WINDOW3_PAGE, regs->host.window3_page)) \
CHIP_HELPER_DEF0(m, (u16, HOST_IO_LOG_ADDR, regs->host.io_log_addr)) \
CHIP_HELPER_DEF0(m, (u16, DBG_SPI_PROC_SELECT, regs->spi.dbg_proc_select)) \
CHIP_HELPER_DEF0(m, (u16, DBG_SPI_STOP_STATUS, regs->spi.dbg_stop_status)) \
CHIP_HELPER_DEF0(m, (u16, SPI_WINDOW1_PAGE, regs->spi.window1_page)) \
CHIP_HELPER_DEF0(m, (u16, SPI_WINDOW2_PAGE, regs->spi.window2_page)) \
CHIP_HELPER_DEF0(m, (u16, SPI_WINDOW3_PAGE, regs->spi.window3_page)) \
CHIP_HELPER_DEF0(m, (u16, SPI_IO_LOG_ADDR, regs->spi.io_log_addr)) \
CHIP_HELPER_DEF0(m, (u16, DBG_RESET, regs->dbg_reset)) \
CHIP_HELPER_DEF0(m, (u16, DBG_RESET_VALUE, regs->dbg_reset_value)) \
CHIP_HELPER_DEF0(m, (u16, DBG_RESET_WARN, regs->dbg_reset_warn)) \
CHIP_HELPER_DEF0(m, (u16, DBG_RESET_WARN_VALUE, regs->dbg_reset_warn_value)) \
CHIP_HELPER_DEF0(m, (u16, DBG_RESET_RESULT, regs->dbg_reset_result)) \
CHIP_HELPER_DEF0(m, (u16, WATCHDOG_DISABLE, regs->watchdog_disable)) \
CHIP_HELPER_DEF0(m, (u16, PROC_PC_SNOOP, regs->proc_pc_snoop)) \
CHIP_HELPER_DEF0(m, (u16, GBL_CHIP_VERSION, regs->gbl_chip_version)) \
CHIP_HELPER_DEF0(m, (u16, GBL_MISC_ENABLES, regs->gbl_misc_enables)) \
CHIP_HELPER_DEF0(m, (u16, XAP_PCH, regs->xap_pch)) \
CHIP_HELPER_DEF0(m, (u16, XAP_PCL, regs->xap_pcl)) \
CHIP_HELPER_DEF0(m, (u16, MAILBOX0, regs->mailbox0)) \
CHIP_HELPER_DEF0(m, (u16, MAILBOX1, regs->mailbox1)) \
CHIP_HELPER_DEF0(m, (u16, MAILBOX2, regs->mailbox2)) \
CHIP_HELPER_DEF0(m, (u16, MAILBOX3, regs->mailbox3)) \
CHIP_HELPER_DEF0(m, (u16, SDIO_HIP_HANDSHAKE, regs->sdio_hip_handshake)) \
CHIP_HELPER_DEF0(m, (u16, SDIO_HOST_INT, regs->sdio_host_int)) \
CHIP_HELPER_DEF0(m, (u16, COEX_STATUS, regs->coex_status)) \
CHIP_HELPER_DEF0(m, (u16, SHARED_IO_INTERRUPT, regs->shared_io_interrupt)) \
CHIP_HELPER_DEF0(m, (u32, PROGRAM_MEMORY_RAM_OFFSET, prog_offset.ram)) \
CHIP_HELPER_DEF0(m, (u32, PROGRAM_MEMORY_ROM_OFFSET, prog_offset.rom)) \
CHIP_HELPER_DEF0(m, (u32, PROGRAM_MEMORY_FLASH_OFFSET, prog_offset.flash)) \
CHIP_HELPER_DEF0(m, (u32, PROGRAM_MEMORY_EXT_SRAM_OFFSET, prog_offset.ext_sram)) \
CHIP_HELPER_DEF0(m, (u16, DATA_MEMORY_RAM_OFFSET, data_offset.ram)) \
CHIP_HELPER_DEF0(m, (s32, HasFlash, bools.has_flash)) \
CHIP_HELPER_DEF0(m, (s32, HasExtSram, bools.has_ext_sram)) \
CHIP_HELPER_DEF0(m, (s32, HasRom, bools.has_rom)) \
CHIP_HELPER_DEF0(m, (s32, HasBt, bools.has_bt)) \
CHIP_HELPER_DEF0(m, (s32, HasWLan, bools.has_wlan)) \
CHIP_HELPER_DEF1(m, (u16, WINDOW_ADDRESS, enum chip_helper_window_index, window)) \
CHIP_HELPER_DEF1(m, (u16, WINDOW_SIZE, enum chip_helper_window_index, window)) \
CHIP_HELPER_DEF1(m, (u16, MapAddress_SPI2HOST, u16, addr)) \
CHIP_HELPER_DEF1(m, (u16, MapAddress_HOST2SPI, u16, addr)) \
CHIP_HELPER_DEF1(m, (u32, ClockStartupSequence, const struct chip_helper_init_values **, val)) \
CHIP_HELPER_DEF1(m, (u32, HostResetSequence, const struct chip_helper_reset_values **, val))
/* Some magic to help the expansion */
#define CHIP_HELPER_DEF0(a, b) \
CHIP_HELPER_DEF0_ ## a b
#define CHIP_HELPER_DEF1(a, b) \
CHIP_HELPER_DEF1_ ## a b
/* Macros so that when we expand the list we get "C" function prototypes. */
#define CHIP_HELPER_DEF0_C_DEC(ret_type, name, info) \
ret_type ChipHelper_ ## name(ChipDescript * chip_help);
#define CHIP_HELPER_DEF1_C_DEC(ret_type, name, type1, name1) \
ret_type ChipHelper_ ## name(ChipDescript * chip_help, type1 name1);
CHIP_HELPER_LIST(C_DEC)
/* FriendlyName
MarketingName
These two functions return human readable strings that describe
the chip. FriendlyName returns something that a software engineer
at CSR might understand. MarketingName returns something more like
an external name for a CSR chip.
*/
/* DBG_EMU_CMD
WATCHDOG_DISABLE
PROC_PC_SNOOP
GBL_CHIP_VERSION
XAP_PCH
XAP_PCL
These registers are used to control the XAPs.
*/
/* DBG_HOST_PROC_SELECT DBG_HOST_STOP_STATUS
HOST_WINDOW1_PAGE HOST_WINDOW2_PAGE HOST_WINDOW3_PAGE
HOST_IO_LOG_ADDR
DBG_SPI_PROC_SELECT DBG_SPI_STOP_STATUS
SPI_WINDOW1_PAGE SPI_WINDOW2_PAGE SPI_WINDOW3_PAGE
SPI_IO_LOG_ADDR
These register are used to control the XAPs and the memory
windows, normally while debugging the code on chip. There
are two versons of these registers, one for access via SPI
and another for access via the host interface.
*/
/* DBG_RESET
DBG_RESET_VALUE
DBG_RESET_WARN
DBG_RESET_WARN_VALUE
DBG_RESET_RESULT
These registers are used to reset the XAP. This can be
quite complex for some chips. If DBG_RESET_WARN is non
zero the DBG_RESET_WARN_VALUE should be written to address
DBG_RESET_WARN before the reset is perfeormed. DBG_RESET_VALUE
should then be written to DBG_RESET to make the reset happen.
The DBG_RESET_RESULT register should contain 0 if the reset
was successful.
*/
/* GBL_MISC_ENABLES
This register controls some special chip features. It
should be used with care is it changes quite a lot between
chip versions.
*/
/* MAILBOX0
MAILBOX1
MAILBOX2
MAILBOX3
The mailbox registers are for communication between the host
and the firmware. There use is described in part by the host
interface protcol specifcation.
*/
/* SDIO_HIP_HANDSHAKE
This is one of the more important SDIO HIP registers. On some
chips it has the same value as one of the mailbox registers
and on other chips it is different.
*/
/* SDIO_HOST_INT
SHARED_IO_INTERRUPT
These registers are used by some versions of the host interface
protocol specification. Their names should probably be changed
to hide the registers and to expose the functions more.
*/
/* COEX_STATUS
Coex status register, contains interrupt status and reset
pullup status. The latter is used to detect WAPI.
*/
/* PROGRAM_MEMORY_RAM_OFFSET
PROGRAM_MEMORY_ROM_OFFSET
PROGRAM_MEMORY_FLASH_OFFSET
PROGRAM_MEMORY_EXT_SRAM_OFFSET
DATA_MEMORY_RAM_OFFSET
These are constants that describe the offset of the different
memory types in the two different address spaces.
*/
/* HasFlash HasExtSram HasRom
HasBt HasWLan
These are a set of bools describing the chip.
*/
/* WINDOW_ADDRESS WINDOW_SIZE
These two functions return the size and address of the windows.
The address is the address of the lowest value in the address
map that is part of the window and the size is the number of
visible words.
Some of the windows have their lowest portion covered by
registers. For these windows address is the first address
after the registers and size is the siave excluding the part
covered by registers.
*/
/* MapAddress_SPI2HOST
MapAddress_HOST2SPI
The debugging interface is duplicated on UniFi and later chips
so that there are two versions - one over the SPI interaface and
the other over the SDIO interface. These functions map the
registers between these two interfaces.
*/
/* ClockStartupSequence
This function returns the list of register value pairs that
should be forced into UniFi to enable SPI communication. This
set of registers is not needed if the firmware is running, but
will be needed if the device is being booted from cold. These
register writes enable the clocks and setup the PLL to a basic
working state. SPI access might be unreliable until these writes
have occurred (And they may take mulitple goes).
*/
/* HostResetSequence
This returns a number of chunks of data and generic pointers.
All of the XAPs should be stopped. The data should be written
to the generic pointers. The instruction pointer for the MAC
should then be set to the start of program memory and then the
MAC should be "go"d. This will reset the chip in a reliable
and orderly manner without resetting the SDIO interface. It
is therefore not needed if the chip is being accessed by the
SPI interface (the DBG_RESET_ mechanism can be used instead).
*/
/* The Decode Window function is more complex. For the window
'window' it tries to return the address and page register
value needed to see offset 'offset' of memory type 'type'.
It return 1 on success and 0 on failure. 'page' is what
should be written to the page register. 'addr' is the
address in the XAPs 16 address map to read from. 'len'
is the length that we can read without having to change
the page registers. */
s32 ChipHelper_DecodeWindow(ChipDescript *chip_help,
enum chip_helper_window_index window,
enum chip_helper_window_type type,
u32 offset,
u16 *page, u16 *addr, u32 *len);
#endif

View file

@ -1,200 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_HIP_CHIPHELPER_PRIVATE_H__
#define CSR_WIFI_HIP_CHIPHELPER_PRIVATE_H__
#include "csr_wifi_hip_chiphelper.h"
/* This GP stuff should be somewhere else? */
/* Memory spaces encoded in top byte of Generic Pointer type */
#define UNIFI_SH_DMEM 0x01 /* Shared Data Memory */
#define UNIFI_EXT_FLASH 0x02 /* External FLASH */
#define UNIFI_EXT_SRAM 0x03 /* External SRAM */
#define UNIFI_REGISTERS 0x04 /* Registers */
#define UNIFI_PHY_DMEM 0x10 /* PHY Data Memory */
#define UNIFI_PHY_PMEM 0x11 /* PHY Program Memory */
#define UNIFI_PHY_ROM 0x12 /* PHY ROM */
#define UNIFI_MAC_DMEM 0x20 /* MAC Data Memory */
#define UNIFI_MAC_PMEM 0x21 /* MAC Program Memory */
#define UNIFI_MAC_ROM 0x22 /* MAC ROM */
#define UNIFI_BT_DMEM 0x30 /* BT Data Memory */
#define UNIFI_BT_PMEM 0x31 /* BT Program Memory */
#define UNIFI_BT_ROM 0x32 /* BT ROM */
#define MAKE_GP(R, O) (((UNIFI_ ## R) << 24) | (O))
#define GP_OFFSET(GP) ((GP) & 0xFFFFFF)
#define GP_SPACE(GP) (((GP) >> 24) & 0xFF)
/* Address value pairs */
struct val_array_t
{
u32 len;
const struct chip_helper_init_values *vals;
};
/* Just a (counted) u16 array */
struct data_array_t
{
u32 len;
const u16 *vals;
};
struct reset_prog_t
{
u32 len;
const struct chip_helper_reset_values *vals;
};
/* The addresses of registers that are equivalent but on
different host transports. */
struct chip_map_address_t
{
u16 spi, host;
};
struct map_array_t
{
u32 len;
const struct chip_map_address_t *vals;
};
struct chip_device_regs_per_transport_t
{
u16 dbg_proc_select;
u16 dbg_stop_status;
u16 window1_page; /* PROG_PMEM1 or GW1 */
u16 window2_page; /* PROG_PMEM2 or GW2 */
u16 window3_page; /* SHARED or GW3 */
u16 io_log_addr;
};
struct chip_device_regs_t
{
u16 gbl_chip_version;
u16 gbl_misc_enables;
u16 dbg_emu_cmd;
struct chip_device_regs_per_transport_t host;
struct chip_device_regs_per_transport_t spi;
u16 dbg_reset;
u16 dbg_reset_value;
u16 dbg_reset_warn;
u16 dbg_reset_warn_value;
u16 dbg_reset_result;
u16 xap_pch;
u16 xap_pcl;
u16 proc_pc_snoop;
u16 watchdog_disable;
u16 mailbox0;
u16 mailbox1;
u16 mailbox2;
u16 mailbox3;
u16 sdio_host_int;
u16 shared_io_interrupt;
u16 sdio_hip_handshake;
u16 coex_status; /* Allows WAPI detection */
};
/* If allowed is false then this window does not provide this
type of access.
This describes how addresses should be shifted to make the
"page" address. The address is shifted left by 'page_shift'
and then has 'page_offset' added. This value should then be
written to the page register. */
struct window_shift_info_t
{
s32 allowed;
u32 page_shift;
u16 page_offset;
};
/* Each window has an address and size. These are obvious. It then
has a description for each type of memory that might be accessed
through it. There might also be a start to the offset of the window.
This means that that number of addresses at the start of the window
are unusable. */
struct window_info_t
{
u16 address;
u16 size;
u16 blocked;
const struct window_shift_info_t *mode;
};
/* If GBL_CHIP_VERSION and'ed with 'mask' and is equal to 'result'
then this is the correct set of info. If pre_bc7 is true then the
address of GBL_CHIP_VERSION is FF9A, else its FE81. */
struct chip_version_t
{
s32 pre_bc7;
u16 mask;
u16 result;
u8 sdio;
};
struct chip_device_desc_t
{
struct chip_version_t chip_version;
/* This is a text string that a human might find useful (BC02, UF105x) */
const char *friendly_name;
/* This is what we show to customers */
const char *marketing_name;
/* Initialisation values to write following a reset */
struct val_array_t init;
/* Binary sequence for hard reset */
struct reset_prog_t reset_prog;
/* The register map */
const struct chip_device_regs_t *regs;
/* Some misc. info on the chip */
struct
{
u32 has_flash : 1;
u32 has_ext_sram : 1;
u32 has_rom : 1;
u32 has_bt : 1;
u32 has_wlan : 1;
} bools;
/* This table is used to remap register addresses depending on what
host interface is used. On the BC7 and later chips there are
multiple sets of memory window registers, on for each host
interafce (SDIO / SPI). The correct one is needed. */
struct map_array_t map;
/* The offsets into the program address space of the different types of memory.
The RAM offset is probably the most useful. */
struct
{
u32 ram;
u32 rom;
u32 flash;
u32 ext_sram;
} prog_offset;
/* The offsets into the data address space of interesting things. */
struct
{
u16 ram;
/* maybe add shared / page tables? */
} data_offset;
/* Information on the different windows */
const struct window_info_t *windows[CHIP_HELPER_WINDOW_COUNT];
};
#endif /* CSR_WIFI_HIP_CHIPHELPER_PRIVATE_H__ */

View file

@ -1,73 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
*
* FILE: csr_wifi_hip_conversions.h
*
* PURPOSE:
* This header file provides the macros for converting to and from
* wire format.
* These macros *MUST* work for little-endian AND big-endian hosts.
*
* ---------------------------------------------------------------------------
*/
#ifndef __CSR_WIFI_HIP_CONVERSIONS_H__
#define __CSR_WIFI_HIP_CONVERSIONS_H__
#define SIZEOF_UINT16 2
#define SIZEOF_UINT32 4
#define SIZEOF_UINT64 8
#define SIZEOF_SIGNAL_HEADER 6
#define SIZEOF_DATAREF 4
/*
* Macro to retrieve the signal ID from a wire-format signal.
*/
#define GET_SIGNAL_ID(_buf) CSR_GET_UINT16_FROM_LITTLE_ENDIAN((_buf))
/*
* Macros to retrieve and set the DATAREF fields in a packed (i.e. wire-format)
* HIP signal.
*/
#define GET_PACKED_DATAREF_SLOT(_buf, _ref) \
CSR_GET_UINT16_FROM_LITTLE_ENDIAN(((_buf) + SIZEOF_SIGNAL_HEADER + ((_ref) * SIZEOF_DATAREF) + 0))
#define GET_PACKED_DATAREF_LEN(_buf, _ref) \
CSR_GET_UINT16_FROM_LITTLE_ENDIAN(((_buf) + SIZEOF_SIGNAL_HEADER + ((_ref) * SIZEOF_DATAREF) + 2))
#define SET_PACKED_DATAREF_SLOT(_buf, _ref, _slot) \
CSR_COPY_UINT16_TO_LITTLE_ENDIAN((_slot), ((_buf) + SIZEOF_SIGNAL_HEADER + ((_ref) * SIZEOF_DATAREF) + 0))
#define SET_PACKED_DATAREF_LEN(_buf, _ref, _len) \
CSR_COPY_UINT16_TO_LITTLE_ENDIAN((_len), ((_buf) + SIZEOF_SIGNAL_HEADER + ((_ref) * SIZEOF_DATAREF) + 2))
#define GET_PACKED_MA_PACKET_REQUEST_FRAME_PRIORITY(_buf) \
CSR_GET_UINT16_FROM_LITTLE_ENDIAN(((_buf) + SIZEOF_SIGNAL_HEADER + UNIFI_MAX_DATA_REFERENCES * SIZEOF_DATAREF + 8))
#define GET_PACKED_MA_PACKET_REQUEST_HOST_TAG(_buf) \
CSR_GET_UINT32_FROM_LITTLE_ENDIAN(((_buf) + SIZEOF_SIGNAL_HEADER + UNIFI_MAX_DATA_REFERENCES * SIZEOF_DATAREF + 4))
#define GET_PACKED_MA_PACKET_CONFIRM_HOST_TAG(_buf) \
CSR_GET_UINT32_FROM_LITTLE_ENDIAN(((_buf) + SIZEOF_SIGNAL_HEADER + UNIFI_MAX_DATA_REFERENCES * SIZEOF_DATAREF + 8))
#define GET_PACKED_MA_PACKET_CONFIRM_TRANSMISSION_STATUS(_buf) \
CSR_GET_UINT16_FROM_LITTLE_ENDIAN(((_buf) + SIZEOF_SIGNAL_HEADER + UNIFI_MAX_DATA_REFERENCES * SIZEOF_DATAREF + 2))
s32 get_packed_struct_size(const u8 *buf);
CsrResult read_unpack_signal(const u8 *ptr, CSR_SIGNAL *sig);
CsrResult write_pack(const CSR_SIGNAL *sig, u8 *ptr, u16 *sig_len);
#endif /* __CSR_WIFI_HIP_CONVERSIONS_H__ */

View file

@ -1,819 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
* FILE: csr_wifi_hip_download.c
*
* PURPOSE:
* Routines for downloading firmware to UniFi.
*
* ---------------------------------------------------------------------------
*/
#include <linux/slab.h>
#include "csr_wifi_hip_unifi.h"
#include "csr_wifi_hip_unifiversion.h"
#include "csr_wifi_hip_card.h"
#include "csr_wifi_hip_xbv.h"
#undef CSR_WIFI_IGNORE_PATCH_VERSION_MISMATCH
static CsrResult do_patch_download(card_t *card, void *dlpriv,
xbv1_t *pfwinfo, u32 boot_ctrl_addr);
static CsrResult do_patch_convert_download(card_t *card,
void *dlpriv, xbv1_t *pfwinfo);
/*
* ---------------------------------------------------------------------------
* _find_in_slut
*
* Find the offset of the appropriate object in the SLUT of a card
*
* Arguments:
* card Pointer to card struct
* psym Pointer to symbol object.
* id set up by caller
* obj will be set up by this function
* pslut Pointer to SLUT address, if 0xffffffff then it must be
* read from the chip.
* Returns:
* CSR_RESULT_SUCCESS on success
* Non-zero on error,
* CSR_WIFI_HIP_RESULT_NOT_FOUND if not found
* ---------------------------------------------------------------------------
*/
static CsrResult _find_in_slut(card_t *card, symbol_t *psym, u32 *pslut)
{
u32 slut_address;
u16 finger_print;
CsrResult r;
CsrResult csrResult;
/* Get SLUT address */
if (*pslut == 0xffffffff)
{
r = card_wait_for_firmware_to_start(card, &slut_address);
if (r == CSR_WIFI_HIP_RESULT_NO_DEVICE)
{
return r;
}
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Firmware hasn't started\n");
return r;
}
*pslut = slut_address;
/*
* Firmware has started so set the SDIO bus clock to the initial speed,
* faster than UNIFI_SDIO_CLOCK_SAFE_HZ, to speed up the f/w download.
*/
csrResult = CsrSdioMaxBusClockFrequencySet(card->sdio_if, UNIFI_SDIO_CLOCK_INIT_HZ);
if (csrResult != CSR_RESULT_SUCCESS)
{
r = ConvertCsrSdioToCsrHipResult(card, csrResult);
return r;
}
card->sdio_clock_speed = UNIFI_SDIO_CLOCK_INIT_HZ;
}
else
{
slut_address = *pslut; /* Use previously discovered address */
}
unifi_trace(card->ospriv, UDBG4, "SLUT addr: 0x%lX\n", slut_address);
/*
* Check the SLUT fingerprint.
* The slut_address is a generic pointer so we must use unifi_card_read16().
*/
unifi_trace(card->ospriv, UDBG4, "Looking for SLUT finger print\n");
finger_print = 0;
r = unifi_card_read16(card, slut_address, &finger_print);
if (r == CSR_WIFI_HIP_RESULT_NO_DEVICE)
{
return r;
}
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to read SLUT finger print\n");
return r;
}
if (finger_print != SLUT_FINGERPRINT)
{
unifi_error(card->ospriv, "Failed to find SLUT fingerprint\n");
return CSR_RESULT_FAILURE;
}
/* Symbol table starts imedately after the fingerprint */
slut_address += 2;
while (1)
{
u16 id;
u32 obj;
r = unifi_card_read16(card, slut_address, &id);
if (r != CSR_RESULT_SUCCESS)
{
return r;
}
slut_address += 2;
if (id == CSR_SLT_END)
{
/* End of table reached: not found */
r = CSR_WIFI_HIP_RESULT_RANGE;
break;
}
r = unifi_read32(card, slut_address, &obj);
if (r != CSR_RESULT_SUCCESS)
{
return r;
}
slut_address += 4;
unifi_trace(card->ospriv, UDBG3, " found SLUT id %02d.%08lx\n", id, obj);
r = CSR_WIFI_HIP_RESULT_NOT_FOUND;
/* Found search term? */
if (id == psym->id)
{
unifi_trace(card->ospriv, UDBG1, " matched SLUT id %02d.%08lx\n", id, obj);
psym->obj = obj;
r = CSR_RESULT_SUCCESS;
break;
}
}
return r;
}
/*
* ---------------------------------------------------------------------------
* do_patch_convert_download
*
* Download the given firmware image to the UniFi, converting from FWDL
* to PTDL XBV format.
*
* Arguments:
* card Pointer to card struct
* dlpriv Pointer to source firmware image
* fwinfo Pointer to source firmware info struct
*
* Returns:
* CSR_RESULT_SUCCESS on success, CSR error code on error
*
* Notes:
* ---------------------------------------------------------------------------
*/
static CsrResult do_patch_convert_download(card_t *card, void *dlpriv, xbv1_t *pfwinfo)
{
CsrResult r;
u32 slut_base = 0xffffffff;
void *pfw;
u32 psize;
symbol_t sym;
/* Reset the chip to guarantee that the ROM loader is running */
r = unifi_init(card);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv,
"do_patch_convert_download: failed to re-init UniFi\n");
return r;
}
/* If no unifi_helper is running, the firmware version must be read */
if (card->build_id == 0)
{
u32 ver = 0;
sym.id = CSR_SLT_BUILD_ID_NUMBER;
sym.obj = 0; /* To be updated by _find_in_slut() */
unifi_trace(card->ospriv, UDBG1, "Need f/w version\n");
/* Find chip build id entry in SLUT */
r = _find_in_slut(card, &sym, &slut_base);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to find CSR_SLT_BUILD_ID_NUMBER\n");
return CSR_RESULT_FAILURE;
}
/* Read running f/w version */
r = unifi_read32(card, sym.obj, &ver);
if (r == CSR_WIFI_HIP_RESULT_NO_DEVICE)
{
return r;
}
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to read f/w id\n");
return CSR_RESULT_FAILURE;
}
card->build_id = ver;
}
/* Convert the ptest firmware to a patch against the running firmware */
pfw = xbv_to_patch(card, unifi_fw_read, dlpriv, pfwinfo, &psize);
if (!pfw)
{
unifi_error(card->ospriv, "Failed to convert f/w to patch");
return CSR_WIFI_HIP_RESULT_NO_MEMORY;
}
else
{
void *desc;
sym.id = CSR_SLT_BOOT_LOADER_CONTROL;
sym.obj = 0; /* To be updated by _find_in_slut() */
/* Find boot loader control entry in SLUT */
r = _find_in_slut(card, &sym, &slut_base);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to find BOOT_LOADER_CONTROL\n");
kfree(pfw);
return CSR_RESULT_FAILURE;
}
r = unifi_set_host_state(card, UNIFI_HOST_STATE_AWAKE);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to wake UniFi\n");
}
/* Get a dlpriv for the patch buffer so that unifi_fw_read() can
* access it.
*/
desc = unifi_fw_open_buffer(card->ospriv, pfw, psize);
if (!desc)
{
kfree(pfw);
return CSR_WIFI_HIP_RESULT_NO_MEMORY;
}
/* Download the patch */
unifi_info(card->ospriv, "Downloading converted f/w as patch\n");
r = unifi_dl_patch(card, desc, sym.obj);
kfree(pfw);
unifi_fw_close_buffer(card->ospriv, desc);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Converted patch download failed\n");
return r;
}
else
{
unifi_trace(card->ospriv, UDBG1, "Converted patch downloaded\n");
}
/* This command starts the firmware */
r = unifi_do_loader_op(card, sym.obj + 6, UNIFI_BOOT_LOADER_RESTART);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to write loader restart cmd\n");
}
return r;
}
}
/*
* ---------------------------------------------------------------------------
* unifi_dl_firmware
*
* Download the given firmware image to the UniFi.
*
* Arguments:
* card Pointer to card struct
* dlpriv A context pointer from the calling function to be
* passed when calling unifi_fw_read().
*
* Returns:
* CSR_RESULT_SUCCESS on success,
* CSR_WIFI_HIP_RESULT_NO_MEMORY memory allocation failed
* CSR_WIFI_HIP_RESULT_INVALID_VALUE error in XBV file
* CSR_RESULT_FAILURE SDIO error
*
* Notes:
* Stops and resets the chip, does the download and runs the new
* firmware.
* ---------------------------------------------------------------------------
*/
CsrResult unifi_dl_firmware(card_t *card, void *dlpriv)
{
xbv1_t *fwinfo;
CsrResult r;
fwinfo = kmalloc(sizeof(xbv1_t), GFP_KERNEL);
if (fwinfo == NULL)
{
unifi_error(card->ospriv, "Failed to allocate memory for firmware\n");
return CSR_WIFI_HIP_RESULT_NO_MEMORY;
}
/*
* Scan the firmware file to find the TLVs we are interested in.
* These are:
* - check we support the file format version in VERF
* - SLTP Symbol Lookup Table Pointer
* - FWDL firmware download segments
* - FWOV firmware overlay segment
* - VMEQ Register probe tests to verify matching h/w
*/
r = xbv1_parse(card, unifi_fw_read, dlpriv, fwinfo);
if (r != CSR_RESULT_SUCCESS || fwinfo->mode != xbv_firmware)
{
unifi_error(card->ospriv, "File type is %s, expected firmware.\n",
fwinfo->mode == xbv_patch?"patch" : "unknown");
kfree(fwinfo);
return CSR_WIFI_HIP_RESULT_INVALID_VALUE;
}
/* UF6xxx doesn't accept firmware, only patches. Therefore we convert
* the file to patch format with version numbers matching the current
* running firmware, and then download via the patch mechanism.
* The sole purpose of this is to support production test firmware across
* different ROM releases, the test firmware being provided in non-patch
* format.
*/
if (card->chip_id > SDIO_CARD_ID_UNIFI_2)
{
unifi_info(card->ospriv, "Must convert f/w to patch format\n");
r = do_patch_convert_download(card, dlpriv, fwinfo);
}
else
{
/* Older UniFi chips allowed firmware to be directly loaded onto the
* chip, which is no longer supported.
*/
unifi_error(card->ospriv, "Only patch downloading supported\n");
r = CSR_WIFI_HIP_RESULT_INVALID_VALUE;
}
kfree(fwinfo);
return r;
} /* unifi_dl_firmware() */
/*
* ---------------------------------------------------------------------------
* unifi_dl_patch
*
* Load the given patch set into UniFi.
*
* Arguments:
* card Pointer to card struct
* dlpriv The os specific handle to the firmware file.
* boot_ctrl The address of the boot loader control structure.
*
* Returns:
* CSR_RESULT_SUCCESS on success,
* CSR_WIFI_HIP_RESULT_NO_MEMORY memory allocation failed
* CSR_WIFI_HIP_RESULT_INVALID_VALUE error in XBV file
* CSR_RESULT_FAILURE SDIO error
*
* Notes:
* This ends up telling UniFi to restart.
* ---------------------------------------------------------------------------
*/
CsrResult unifi_dl_patch(card_t *card, void *dlpriv, u32 boot_ctrl)
{
xbv1_t *fwinfo;
CsrResult r;
unifi_info(card->ospriv, "unifi_dl_patch %p %08x\n", dlpriv, boot_ctrl);
fwinfo = kmalloc(sizeof(xbv1_t), GFP_KERNEL);
if (fwinfo == NULL)
{
unifi_error(card->ospriv, "Failed to allocate memory for patches\n");
return CSR_WIFI_HIP_RESULT_NO_MEMORY;
}
/*
* Scan the firmware file to find the TLVs we are interested in.
* These are:
* - check we support the file format version in VERF
* - FWID The build ID of the ROM that we can patch
* - PTDL patch download segments
*/
r = xbv1_parse(card, unifi_fw_read, dlpriv, fwinfo);
if (r != CSR_RESULT_SUCCESS || fwinfo->mode != xbv_patch)
{
kfree(fwinfo);
unifi_error(card->ospriv, "Failed to read in patch file\n");
return CSR_WIFI_HIP_RESULT_INVALID_VALUE;
}
/*
* We have to check the build id read from the SLUT against that
* for the patch file. They have to match exactly.
* "card->build_id" == XBV1.PTCH.FWID
*/
if (card->build_id != fwinfo->build_id)
{
unifi_error(card->ospriv, "Wrong patch file for chip (chip = %lu, file = %lu)\n",
card->build_id, fwinfo->build_id);
kfree(fwinfo);
#ifndef CSR_WIFI_IGNORE_PATCH_VERSION_MISMATCH
return CSR_WIFI_HIP_RESULT_INVALID_VALUE;
#else
fwinfo = NULL;
dlpriv = NULL;
return CSR_RESULT_SUCCESS;
#endif
}
r = do_patch_download(card, dlpriv, fwinfo, boot_ctrl);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to patch image\n");
}
kfree(fwinfo);
return r;
} /* unifi_dl_patch() */
void* unifi_dl_fw_read_start(card_t *card, s8 is_fw)
{
card_info_t card_info;
unifi_card_info(card, &card_info);
unifi_trace(card->ospriv, UDBG5,
"id=%d, ver=0x%x, fw_build=%u, fw_hip=0x%x, block_size=%d\n",
card_info.chip_id, card_info.chip_version,
card_info.fw_build, card_info.fw_hip_version,
card_info.sdio_block_size);
return unifi_fw_read_start(card->ospriv, is_fw, &card_info);
}
/*
* ---------------------------------------------------------------------------
* safe_read_shared_location
*
* Read a shared memory location repeatedly until we get two readings
* the same.
*
* Arguments:
* card Pointer to card context struct.
* unifi_addr UniFi shared-data-memory address to access.
* pdata Pointer to a byte variable for the value read.
*
*
* Returns:
* CSR_RESULT_SUCCESS on success, CSR error code on failure
* ---------------------------------------------------------------------------
*/
static CsrResult safe_read_shared_location(card_t *card, u32 address, u8 *pdata)
{
CsrResult r;
u16 limit = 1000;
u8 b, b2;
*pdata = 0;
r = unifi_read_8_or_16(card, address, &b);
if (r != CSR_RESULT_SUCCESS)
{
return r;
}
while (limit--)
{
r = unifi_read_8_or_16(card, address, &b2);
if (r != CSR_RESULT_SUCCESS)
{
return r;
}
/* When we have a stable value, return it */
if (b == b2)
{
*pdata = b;
return CSR_RESULT_SUCCESS;
}
b = b2;
}
return CSR_RESULT_FAILURE;
} /* safe_read_shared_location() */
/*
* ---------------------------------------------------------------------------
* unifi_do_loader_op
*
* Send a loader / boot_loader command to the UniFi and wait for
* it to complete.
*
* Arguments:
* card Pointer to card context struct.
* op_addr The address of the loader operation control word.
* opcode The operation to perform.
*
* Returns:
* CSR_RESULT_SUCCESS on success
* CSR_RESULT_FAILURE SDIO error or SDIO/XAP timeout
* ---------------------------------------------------------------------------
*/
/*
* Ideally instead of sleeping, we want to busy wait.
* Currently there is no framework API to do this. When it becomes available,
* we can use it to busy wait using usecs
*/
#define OPERATION_TIMEOUT_LOOPS (100) /* when OPERATION_TIMEOUT_DELAY==1, (500) otherwise */
#define OPERATION_TIMEOUT_DELAY 1 /* msec, or 200usecs */
CsrResult unifi_do_loader_op(card_t *card, u32 op_addr, u8 opcode)
{
CsrResult r;
s16 op_retries;
unifi_trace(card->ospriv, UDBG4, "Loader cmd 0x%0x -> 0x%08x\n", opcode, op_addr);
/* Set the Operation command byte to the opcode */
r = unifi_write_8_or_16(card, op_addr, opcode);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to write loader copy command\n");
return r;
}
/* Wait for Operation command byte to be Idle */
/* Typically takes ~100us */
op_retries = 0;
r = CSR_RESULT_SUCCESS;
while (1)
{
u8 op;
/*
* Read the memory location until two successive reads give
* the same value.
* Then handle it.
*/
r = safe_read_shared_location(card, op_addr, &op);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to read loader status\n");
break;
}
if (op == UNIFI_LOADER_IDLE)
{
/* Success */
break;
}
if (op != opcode)
{
unifi_error(card->ospriv, "Error reported by loader: 0x%X\n", op);
r = CSR_RESULT_FAILURE;
break;
}
/* Allow 500us timeout */
if (++op_retries >= OPERATION_TIMEOUT_LOOPS)
{
unifi_error(card->ospriv, "Timeout waiting for loader to ack transfer\n");
/* Stop XAPs to aid post-mortem */
r = unifi_card_stop_processor(card, UNIFI_PROC_BOTH);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to stop UniFi processors\n");
}
else
{
r = CSR_RESULT_FAILURE;
}
break;
}
CsrThreadSleep(OPERATION_TIMEOUT_DELAY);
} /* Loop exits with r != CSR_RESULT_SUCCESS on error */
return r;
} /* unifi_do_loader_op() */
/*
* ---------------------------------------------------------------------------
* send_ptdl_to_unifi
*
* Copy a patch block from userland to the UniFi.
* This function reads data, 2K at a time, from userland and writes
* it to the UniFi.
*
* Arguments:
* card A pointer to the card structure
* dlpriv The os specific handle for the firmware file
* ptdl A pointer ot the PTDL block
* handle The buffer handle to use for the xfer
* op_addr The address of the loader operation control word
*
* Returns:
* Number of bytes sent (Positive) or negative value indicating
* error code:
* CSR_WIFI_HIP_RESULT_NO_MEMORY memory allocation failed
* CSR_WIFI_HIP_RESULT_INVALID_VALUE error in XBV file
* CSR_RESULT_FAILURE SDIO error
* ---------------------------------------------------------------------------
*/
static CsrResult send_ptdl_to_unifi(card_t *card, void *dlpriv,
const struct PTDL *ptdl, u32 handle,
u32 op_addr)
{
u32 offset;
u8 *buf;
s32 data_len;
u32 write_len;
CsrResult r;
const u16 buf_size = 2 * 1024;
offset = ptdl->dl_offset;
data_len = ptdl->dl_size;
if (data_len > buf_size)
{
unifi_error(card->ospriv, "PTDL block is too large (%u)\n",
ptdl->dl_size);
return CSR_WIFI_HIP_RESULT_INVALID_VALUE;
}
buf = kmalloc(buf_size, GFP_KERNEL);
if (buf == NULL)
{
unifi_error(card->ospriv, "Failed to allocate transfer buffer for firmware download\n");
return CSR_WIFI_HIP_RESULT_NO_MEMORY;
}
r = CSR_RESULT_SUCCESS;
if (unifi_fw_read(card->ospriv, dlpriv, offset, buf, data_len) != data_len)
{
unifi_error(card->ospriv, "Failed to read from file\n");
}
else
{
/* We can always round these if the host wants to */
if (card->sdio_io_block_pad)
{
write_len = (data_len + (card->sdio_io_block_size - 1)) &
~(card->sdio_io_block_size - 1);
/* Zero out the rest of the buffer (This isn't needed, but it
* makes debugging things later much easier). */
memset(buf + data_len, 0, write_len - data_len);
}
else
{
write_len = data_len;
}
r = unifi_bulk_rw_noretry(card, handle, buf, write_len, UNIFI_SDIO_WRITE);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "CMD53 failed writing %d bytes to handle %ld\n",
data_len, handle);
}
else
{
/*
* Can change the order of things to overlap read from file
* with copy to unifi
*/
r = unifi_do_loader_op(card, op_addr, UNIFI_BOOT_LOADER_PATCH);
}
}
kfree(buf);
if (r != CSR_RESULT_SUCCESS && r != CSR_WIFI_HIP_RESULT_NO_DEVICE)
{
unifi_error(card->ospriv, "Failed to copy block of %u bytes to UniFi\n",
ptdl->dl_size);
}
return r;
} /* send_ptdl_to_unifi() */
/*
* ---------------------------------------------------------------------------
* do_patch_download
*
* This function downloads a set of patches to UniFi and then
* causes it to restart.
*
* Arguments:
* card Pointer to card struct.
* dlpriv A context pointer from the calling function to be
* used when reading the XBV file. This can be NULL
* in which case not patches are applied.
* pfwinfo Pointer to a fwinfo struct describing the f/w
* XBV file.
* boot_ctrl_addr The address of the boot loader control structure.
*
* Returns:
* 0 on success, or an error code
* CSR_WIFI_HIP_RESULT_INVALID_VALUE for a bad laoader version number
* ---------------------------------------------------------------------------
*/
static CsrResult do_patch_download(card_t *card, void *dlpriv, xbv1_t *pfwinfo, u32 boot_ctrl_addr)
{
CsrResult r;
s32 i;
u16 loader_version;
u16 handle;
u32 total_bytes;
/*
* Read info from the SDIO Loader Control Data Structure
*/
/* Check the loader version */
r = unifi_card_read16(card, boot_ctrl_addr, &loader_version);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Patch download: Failed to read loader version\n");
return r;
}
unifi_trace(card->ospriv, UDBG2, "Patch download: boot loader version 0x%04X\n", loader_version);
switch (loader_version)
{
case 0x0000:
break;
default:
unifi_error(card->ospriv, "Patch loader version (0x%04X) is not supported by this driver\n",
loader_version);
return CSR_WIFI_HIP_RESULT_INVALID_VALUE;
}
/* Retrieve the handle to use with CMD53 */
r = unifi_card_read16(card, boot_ctrl_addr + 4, &handle);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Patch download: Failed to read loader handle\n");
return r;
}
/* Set the mask of LEDs to flash */
if (card->loader_led_mask)
{
r = unifi_card_write16(card, boot_ctrl_addr + 2,
(u16)card->loader_led_mask);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Patch download: Failed to write LED mask\n");
return r;
}
}
total_bytes = 0;
/* Copy download data to UniFi memory */
for (i = 0; i < pfwinfo->num_ptdl; i++)
{
unifi_trace(card->ospriv, UDBG3, "Patch download: %d Downloading for %d from offset %d\n",
i,
pfwinfo->ptdl[i].dl_size,
pfwinfo->ptdl[i].dl_offset);
r = send_ptdl_to_unifi(card, dlpriv, &pfwinfo->ptdl[i],
handle, boot_ctrl_addr + 6);
if (r == CSR_WIFI_HIP_RESULT_NO_DEVICE)
{
return r;
}
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Patch failed after %u bytes\n",
total_bytes);
return r;
}
total_bytes += pfwinfo->ptdl[i].dl_size;
}
return CSR_RESULT_SUCCESS;
} /* do_patch_download() */

View file

@ -1,837 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
* FILE: csr_wifi_hip_dump.c
*
* PURPOSE:
* Routines for retrieving and buffering core status from the UniFi
*
* ---------------------------------------------------------------------------
*/
#include <linux/slab.h>
#include "csr_wifi_hip_unifi.h"
#include "csr_wifi_hip_unifiversion.h"
#include "csr_wifi_hip_card.h"
/* Locations to capture in dump (XAP words) */
#define HIP_CDUMP_FIRST_CPUREG (0xFFE0) /* First CPU register */
#define HIP_CDUMP_FIRST_LO (0) /* Start of low address range */
#define HIP_CDUMP_FIRST_HI_MAC (0x3C00) /* Start of MAC high area */
#define HIP_CDUMP_FIRST_HI_PHY (0x1C00) /* Start of PHY high area */
#define HIP_CDUMP_FIRST_SH (0) /* Start of shared memory area */
#define HIP_CDUMP_NCPUREGS (10) /* No. of 16-bit XAP registers */
#define HIP_CDUMP_NWORDS_LO (0x0100) /* Low area size in 16-bit words */
#define HIP_CDUMP_NWORDS_HI (0x0400) /* High area size in 16-bit words */
#define HIP_CDUMP_NWORDS_SH (0x0500) /* Shared memory area size, 16-bit words */
#define HIP_CDUMP_NUM_ZONES 7 /* Number of UniFi memory areas to capture */
/* Mini-coredump state */
typedef struct coredump_buf
{
u16 count; /* serial number of dump */
u32 timestamp; /* host's system time at capture */
s16 requestor; /* request: 0=auto dump, 1=manual */
u16 chip_ver;
u32 fw_ver;
u16 *zone[HIP_CDUMP_NUM_ZONES];
struct coredump_buf *next; /* circular list */
struct coredump_buf *prev; /* circular list */
} coredump_buffer;
/* Structure used to describe a zone of chip memory captured by mini-coredump */
struct coredump_zone
{
unifi_coredump_space_t space; /* XAP memory space this zone covers */
enum unifi_dbg_processors_select cpu; /* XAP CPU core selector */
u32 gp; /* Generic Pointer to memory zone on XAP */
u16 offset; /* 16-bit XAP word offset of zone in memory space */
u16 length; /* Length of zone in XAP words */
};
static CsrResult unifi_coredump_from_sdio(card_t *card, coredump_buffer *dump_buf);
static CsrResult unifi_coredump_read_zones(card_t *card, coredump_buffer *dump_buf);
static CsrResult unifi_coredump_read_zone(card_t *card, u16 *zone,
const struct coredump_zone *def);
static s32 get_value_from_coredump(const coredump_buffer *dump,
const unifi_coredump_space_t space, const u16 offset);
/* Table of chip memory zones we capture on mini-coredump */
static const struct coredump_zone zonedef_table[HIP_CDUMP_NUM_ZONES] = {
{ UNIFI_COREDUMP_MAC_REG, UNIFI_PROC_MAC, UNIFI_MAKE_GP(REGISTERS, HIP_CDUMP_FIRST_CPUREG * 2), HIP_CDUMP_FIRST_CPUREG, HIP_CDUMP_NCPUREGS },
{ UNIFI_COREDUMP_PHY_REG, UNIFI_PROC_PHY, UNIFI_MAKE_GP(REGISTERS, HIP_CDUMP_FIRST_CPUREG * 2), HIP_CDUMP_FIRST_CPUREG, HIP_CDUMP_NCPUREGS },
{ UNIFI_COREDUMP_SH_DMEM, UNIFI_PROC_INVALID, UNIFI_MAKE_GP(SH_DMEM, HIP_CDUMP_FIRST_SH * 2), HIP_CDUMP_FIRST_SH, HIP_CDUMP_NWORDS_SH },
{ UNIFI_COREDUMP_MAC_DMEM, UNIFI_PROC_MAC, UNIFI_MAKE_GP(MAC_DMEM, HIP_CDUMP_FIRST_LO * 2), HIP_CDUMP_FIRST_LO, HIP_CDUMP_NWORDS_LO },
{ UNIFI_COREDUMP_MAC_DMEM, UNIFI_PROC_MAC, UNIFI_MAKE_GP(MAC_DMEM, HIP_CDUMP_FIRST_HI_MAC * 2), HIP_CDUMP_FIRST_HI_MAC, HIP_CDUMP_NWORDS_HI },
{ UNIFI_COREDUMP_PHY_DMEM, UNIFI_PROC_PHY, UNIFI_MAKE_GP(PHY_DMEM, HIP_CDUMP_FIRST_LO * 2), HIP_CDUMP_FIRST_LO, HIP_CDUMP_NWORDS_LO },
{ UNIFI_COREDUMP_PHY_DMEM, UNIFI_PROC_PHY, UNIFI_MAKE_GP(PHY_DMEM, HIP_CDUMP_FIRST_HI_PHY * 2), HIP_CDUMP_FIRST_HI_PHY, HIP_CDUMP_NWORDS_HI },
};
/*
* ---------------------------------------------------------------------------
* unifi_coredump_request_at_next_reset
*
* Request that a mini-coredump is performed when the driver has
* completed resetting the UniFi device.
*
* Arguments:
* card Pointer to card struct
* enable If non-zero, sets the request.
* If zero, cancels any pending request.
*
* Returns:
* CSR_RESULT_SUCCESS or CSR HIP error code
*
* Notes:
* This function is typically called once the driver has detected that
* the UniFi device has become unresponsive due to crash, or internal
* watchdog reset. The driver must reset it to regain communication and,
* immediately after that, the mini-coredump can be captured.
* ---------------------------------------------------------------------------
*/
CsrResult unifi_coredump_request_at_next_reset(card_t *card, s8 enable)
{
CsrResult r;
if (enable)
{
unifi_trace(card->ospriv, UDBG2, "Mini-coredump requested after reset\n");
}
if (card == NULL)
{
r = CSR_WIFI_HIP_RESULT_INVALID_VALUE;
}
else
{
card->request_coredump_on_reset = enable?1 : 0;
r = CSR_RESULT_SUCCESS;
}
return r;
}
/*
* ---------------------------------------------------------------------------
* unifi_coredump_handle_request
*
* Performs a coredump now, if one was requested, and clears the request.
*
* Arguments:
* card Pointer to card struct
*
* Returns:
* CSR_RESULT_SUCCESS or CSR HIP error code
*
* Notes:
* ---------------------------------------------------------------------------
*/
CsrResult unifi_coredump_handle_request(card_t *card)
{
CsrResult r = CSR_RESULT_SUCCESS;
if (card == NULL)
{
r = CSR_WIFI_HIP_RESULT_INVALID_VALUE;
}
else
{
if (card->request_coredump_on_reset == 1)
{
card->request_coredump_on_reset = 0;
r = unifi_coredump_capture(card, NULL);
}
}
return r;
}
/*
* ---------------------------------------------------------------------------
* unifi_coredump_capture
*
* Capture the current status of the UniFi device.
* Various registers are buffered for future offline inspection.
*
* Arguments:
* card Pointer to card struct
* req Pointer to request struct, or NULL:
* A coredump requested manually by the user app
* will have a request struct pointer, an automatic
* coredump will have a NULL pointer.
* Returns:
* CSR_RESULT_SUCCESS on success,
* CSR_RESULT_FAILURE SDIO error
* CSR_WIFI_HIP_RESULT_INVALID_VALUE Initialisation not complete
*
* Notes:
* The result is a filled entry in the circular buffer of core dumps,
* values from which can be extracted to userland via an ioctl.
* ---------------------------------------------------------------------------
*/
CsrResult unifi_coredump_capture(card_t *card, struct unifi_coredump_req *req)
{
CsrResult r = CSR_RESULT_SUCCESS;
static u16 dump_seq_no = 1;
u32 time_of_capture;
if (card->dump_next_write == NULL)
{
r = CSR_RESULT_SUCCESS;
goto done;
}
/* Reject forced capture before initialisation has happened */
if (card->helper == NULL)
{
r = CSR_WIFI_HIP_RESULT_INVALID_VALUE;
goto done;
}
/*
* Force a mini-coredump capture right now
*/
time_of_capture = CsrTimeGet(NULL);
unifi_info(card->ospriv, "Mini-coredump capture at t=%u\n", time_of_capture);
/* Wake up the processors so we can talk to them */
r = unifi_set_host_state(card, UNIFI_HOST_STATE_AWAKE);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to wake UniFi\n");
goto done;
}
CsrThreadSleep(20);
/* Stop both XAPs */
unifi_trace(card->ospriv, UDBG4, "Stopping XAPs for coredump capture\n");
r = unifi_card_stop_processor(card, UNIFI_PROC_BOTH);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to stop UniFi XAPs\n");
goto done;
}
/* Dump core into the next available slot in the circular list */
r = unifi_coredump_from_sdio(card, card->dump_next_write);
if (r == CSR_RESULT_SUCCESS)
{
/* Record whether the dump was manual or automatic */
card->dump_next_write->requestor = (req?1 : 0);
card->dump_next_write->timestamp = time_of_capture;
/* Advance to the next buffer */
card->dump_next_write->count = dump_seq_no++;
card->dump_cur_read = card->dump_next_write;
card->dump_next_write = card->dump_next_write->next;
/* Sequence no. of zero indicates slot not in use, so handle wrap */
if (dump_seq_no == 0)
{
dump_seq_no = 1;
}
unifi_trace(card->ospriv, UDBG3,
"Coredump (%p), SeqNo=%d, cur_read=%p, next_write=%p\n",
req,
card->dump_cur_read->count,
card->dump_cur_read, card->dump_next_write);
}
/* Start both XAPs */
unifi_trace(card->ospriv, UDBG4, "Restart XAPs after coredump\n");
r = card_start_processor(card, UNIFI_PROC_BOTH);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Failed to start UniFi XAPs\n");
goto done;
}
done:
return r;
} /* unifi_coredump_capture() */
/*
* ---------------------------------------------------------------------------
* get_value_from_coredump
*
*
*
* Arguments:
* dump Pointer to buffered coredump data
* offset_in_space XAP memory space to retrieve from the buffer (there
* may be more than one zone covering the same memory
* space, but starting from different offsets).
* offset Offset within the XAP memory space to be retrieved
*
* Returns:
* >=0 Register value on success
* <0 Register out of range of any captured zones
*
* Notes:
* ---------------------------------------------------------------------------
*/
static s32 get_value_from_coredump(const coredump_buffer *coreDump,
const unifi_coredump_space_t space,
const u16 offset_in_space)
{
s32 r = -1;
u16 offset_in_zone;
u32 zone_end_offset;
s32 i;
const struct coredump_zone *def = &zonedef_table[0];
/* Search zone def table for a match with the requested memory space */
for (i = 0; i < HIP_CDUMP_NUM_ZONES; i++, def++)
{
if (space == def->space)
{
zone_end_offset = def->offset + def->length;
/* Is the space offset contained in this zone? */
if (offset_in_space < zone_end_offset &&
offset_in_space >= def->offset)
{
/* Calculate the offset of data within the zone buffer */
offset_in_zone = offset_in_space - def->offset;
r = (s32) * (coreDump->zone[i] + offset_in_zone);
unifi_trace(NULL, UDBG6,
"sp %d, offs 0x%04x = 0x%04x (in z%d 0x%04x->0x%04x)\n",
space, offset_in_space, r,
i, def->offset, zone_end_offset - 1);
break;
}
}
}
return r;
}
/*
* ---------------------------------------------------------------------------
* unifi_coredump_get_value
*
* Retrieve the value of a register buffered from a previous core dump,
* so that it may be reported back to application code.
*
* Arguments:
* card Pointer to card struct
* req_reg Pointer to request parameter partially filled. This
* function puts in the values retrieved from the dump.
*
* Returns:
* CSR_RESULT_SUCCESS on success, or:
* CSR_WIFI_HIP_RESULT_INVALID_VALUE Null parameter error
* CSR_WIFI_HIP_RESULT_RANGE Register out of range
* CSR_WIFI_HIP_RESULT_NOT_FOUND Dump index not (yet) captured
*
* Notes:
* ---------------------------------------------------------------------------
*/
CsrResult unifi_coredump_get_value(card_t *card, struct unifi_coredump_req *req)
{
CsrResult r;
s32 i = 0;
coredump_buffer *find_dump = NULL;
if (req == NULL || card == NULL)
{
r = CSR_WIFI_HIP_RESULT_INVALID_VALUE;
goto done;
}
req->value = -1;
if (card->dump_buf == NULL)
{
unifi_trace(card->ospriv, UDBG2, "No coredump buffers\n");
r = CSR_WIFI_HIP_RESULT_NOT_FOUND; /* Coredumping disabled */
goto done;
}
if (card->dump_cur_read == NULL)
{
unifi_trace(card->ospriv, UDBG4, "No coredumps captured\n");
r = CSR_WIFI_HIP_RESULT_NOT_FOUND; /* No coredump yet captured */
goto done;
}
/* Find the requested dump buffer */
switch (req->index)
{
case 0: /* Newest */
find_dump = card->dump_cur_read;
break;
case -1: /* Oldest: The next used slot forward */
for (find_dump = card->dump_cur_read->next;
(find_dump->count == 0) && (find_dump != card->dump_cur_read);
find_dump = card->dump_cur_read->next)
{
}
break;
default: /* Number of steps back from current read position */
for (i = 0, find_dump = card->dump_cur_read;
i < req->index;
i++, find_dump = find_dump->prev)
{
/* Walk the list for the index'th entry, but
* stop when about to wrap. */
unifi_trace(card->ospriv, UDBG6,
"%d: %d, @%p, p=%p, n=%p, cr=%p, h=%p\n",
i, find_dump->count, find_dump, find_dump->prev,
find_dump->next, card->dump_cur_read, card->dump_buf);
if (find_dump->prev == card->dump_cur_read)
{
/* Wrapped but still not found, index out of range */
if (i != req->index)
{
unifi_trace(card->ospriv, UDBG6,
"Dump index %d not found %d\n", req->index, i);
r = CSR_WIFI_HIP_RESULT_NOT_FOUND;
goto done;
}
break;
}
}
break;
}
/* Check if the slot is actually filled with a core dump */
if (find_dump->count == 0)
{
unifi_trace(card->ospriv, UDBG4, "Not captured %d\n", req->index);
r = CSR_WIFI_HIP_RESULT_NOT_FOUND;
goto done;
}
unifi_trace(card->ospriv, UDBG6, "Req index %d, found seq %d at step %d\n",
req->index, find_dump->count, i);
/* Find the appropriate entry in the buffer */
req->value = get_value_from_coredump(find_dump, req->space, (u16)req->offset);
if (req->value < 0)
{
r = CSR_WIFI_HIP_RESULT_RANGE; /* Un-captured register */
unifi_trace(card->ospriv, UDBG4,
"Can't read space %d, reg 0x%x from coredump buffer %d\n",
req->space, req->offset, req->index);
}
else
{
r = CSR_RESULT_SUCCESS;
}
/* Update the private request structure with the found values */
req->chip_ver = find_dump->chip_ver;
req->fw_ver = find_dump->fw_ver;
req->timestamp = find_dump->timestamp;
req->requestor = find_dump->requestor;
req->serial = find_dump->count;
done:
return r;
} /* unifi_coredump_get_value() */
/*
* ---------------------------------------------------------------------------
* unifi_coredump_read_zone
*
* Captures a UniFi memory zone into a buffer on the host
*
* Arguments:
* card Pointer to card struct
* zonebuf Pointer to on-host buffer to dump the memory zone into
* def Pointer to description of the memory zone to read from UniFi.
*
* Returns:
* CSR_RESULT_SUCCESS on success, or:
* CSR_RESULT_FAILURE SDIO error
* CSR_WIFI_HIP_RESULT_INVALID_VALUE Parameter error
*
* Notes:
* It is assumed that the caller has already stopped the XAPs
* ---------------------------------------------------------------------------
*/
static CsrResult unifi_coredump_read_zone(card_t *card, u16 *zonebuf, const struct coredump_zone *def)
{
CsrResult r;
if (zonebuf == NULL || def == NULL)
{
r = CSR_WIFI_HIP_RESULT_INVALID_VALUE;
goto done;
}
/* Select XAP CPU if necessary */
if (def->cpu != UNIFI_PROC_INVALID)
{
if (def->cpu != UNIFI_PROC_MAC && def->cpu != UNIFI_PROC_PHY)
{
r = CSR_WIFI_HIP_RESULT_INVALID_VALUE;
goto done;
}
r = unifi_set_proc_select(card, def->cpu);
if (r != CSR_RESULT_SUCCESS)
{
goto done;
}
}
unifi_trace(card->ospriv, UDBG4,
"Dump sp %d, offs 0x%04x, 0x%04x words @GP=%08x CPU %d\n",
def->space, def->offset, def->length, def->gp, def->cpu);
/* Read on-chip RAM (byte-wise) */
r = unifi_card_readn(card, def->gp, zonebuf, (u16)(def->length * 2));
if (r == CSR_WIFI_HIP_RESULT_NO_DEVICE)
{
goto done;
}
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Can't read UniFi shared data area\n");
goto done;
}
done:
return r;
}
/*
* ---------------------------------------------------------------------------
* unifi_coredump_read_zones
*
* Walks through the table of on-chip memory zones defined in zonedef_table,
* and reads each of them from the UniFi chip
*
* Arguments:
* card Pointer to card struct
* dump_buf Buffer into which register values will be dumped
*
* Returns:
* CSR_RESULT_SUCCESS on success, or:
* CSR_RESULT_FAILURE SDIO error
* CSR_WIFI_HIP_RESULT_INVALID_VALUE Parameter error
*
* Notes:
* It is assumed that the caller has already stopped the XAPs
* ---------------------------------------------------------------------------
*/
static CsrResult unifi_coredump_read_zones(card_t *card, coredump_buffer *dump_buf)
{
CsrResult r = CSR_RESULT_SUCCESS;
s32 i;
/* Walk the table of coredump zone definitions and read them from the chip */
for (i = 0;
(i < HIP_CDUMP_NUM_ZONES) && (r == 0);
i++)
{
r = unifi_coredump_read_zone(card, dump_buf->zone[i], &zonedef_table[i]);
}
return r;
}
/*
* ---------------------------------------------------------------------------
* unifi_coredump_from_sdio
*
* Capture the status of the UniFi processors, over SDIO
*
* Arguments:
* card Pointer to card struct
* reg_buffer Buffer into which register values will be dumped
*
* Returns:
* CSR_RESULT_SUCCESS on success, or:
* CSR_RESULT_FAILURE SDIO error
* CSR_WIFI_HIP_RESULT_INVALID_VALUE Parameter error
*
* Notes:
* ---------------------------------------------------------------------------
*/
static CsrResult unifi_coredump_from_sdio(card_t *card, coredump_buffer *dump_buf)
{
u16 val;
CsrResult r;
u32 sdio_addr;
if (dump_buf == NULL)
{
r = CSR_WIFI_HIP_RESULT_INVALID_VALUE;
goto done;
}
/* Chip and firmware version */
unifi_trace(card->ospriv, UDBG4, "Get chip version\n");
sdio_addr = 2 * ChipHelper_GBL_CHIP_VERSION(card->helper);
if (sdio_addr != 0)
{
r = unifi_read_direct16(card, sdio_addr, &val);
if (r == CSR_WIFI_HIP_RESULT_NO_DEVICE)
{
goto done;
}
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Can't read GBL_CHIP_VERSION\n");
goto done;
}
}
dump_buf->chip_ver = val;
dump_buf->fw_ver = card->build_id;
unifi_trace(card->ospriv, UDBG4, "chip_ver 0x%04x, fw_ver %u\n",
dump_buf->chip_ver, dump_buf->fw_ver);
/* Capture the memory zones required from UniFi */
r = unifi_coredump_read_zones(card, dump_buf);
if (r == CSR_WIFI_HIP_RESULT_NO_DEVICE)
{
goto done;
}
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "Can't read UniFi memory areas\n");
goto done;
}
done:
return r;
} /* unifi_coredump_from_sdio() */
#ifndef UNIFI_DISABLE_COREDUMP
/*
* ---------------------------------------------------------------------------
* new_coredump_node
*
* Allocates a coredump linked-list node, and links it to the previous.
*
* Arguments:
* ospriv OS context
* prevnode Previous node to link into
*
* Returns:
* Pointer to valid coredump_buffer on success
* NULL on memory allocation failure
*
* Notes:
* Allocates "all or nothing"
* ---------------------------------------------------------------------------
*/
static
coredump_buffer* new_coredump_node(void *ospriv, coredump_buffer *prevnode)
{
coredump_buffer *newnode = NULL;
u16 *newzone = NULL;
s32 i;
u32 zone_size;
/* Allocate node header */
newnode = kzalloc(sizeof(coredump_buffer), GFP_KERNEL);
if (newnode == NULL)
{
return NULL;
}
/* Allocate chip memory zone capture buffers */
for (i = 0; i < HIP_CDUMP_NUM_ZONES; i++)
{
zone_size = sizeof(u16) * zonedef_table[i].length;
newzone = kzalloc(zone_size, GFP_KERNEL);
newnode->zone[i] = newzone;
if (newzone == NULL)
{
unifi_error(ospriv, "Out of memory on coredump zone %d (%d words)\n",
i, zonedef_table[i].length);
break;
}
}
/* Clean up if any zone alloc failed */
if (newzone == NULL)
{
for (i = 0; newnode->zone[i] != NULL; i++)
{
kfree(newnode->zone[i]);
newnode->zone[i] = NULL;
}
}
/* Link to previous node */
newnode->prev = prevnode;
if (prevnode)
{
prevnode->next = newnode;
}
newnode->next = NULL;
return newnode;
}
#endif /* UNIFI_DISABLE_COREDUMP */
/*
* ---------------------------------------------------------------------------
* unifi_coredump_init
*
* Allocates buffers for the automatic SDIO core dump
*
* Arguments:
* card Pointer to card struct
* num_dump_buffers Number of buffers to reserve for coredumps
*
* Returns:
* CSR_RESULT_SUCCESS on success, or:
* CSR_WIFI_HIP_RESULT_NO_MEMORY memory allocation failed
*
* Notes:
* Allocates space in advance, to be used for the last n coredump buffers
* the intention being that the size is sufficient for at least one dump,
* probably several.
* It's probably advisable to have at least 2 coredump buffers to allow
* one to be enquired with the unifi_coredump tool, while leaving another
* free for capturing.
* ---------------------------------------------------------------------------
*/
CsrResult unifi_coredump_init(card_t *card, u16 num_dump_buffers)
{
#ifndef UNIFI_DISABLE_COREDUMP
void *ospriv = card->ospriv;
coredump_buffer *prev = NULL;
coredump_buffer *newnode = NULL;
u32 i = 0;
#endif
card->request_coredump_on_reset = 0;
card->dump_next_write = NULL;
card->dump_cur_read = NULL;
card->dump_buf = NULL;
#ifndef UNIFI_DISABLE_COREDUMP
unifi_trace(ospriv, UDBG1,
"Allocate buffers for %d core dumps\n", num_dump_buffers);
if (num_dump_buffers == 0)
{
goto done;
}
/* Root node */
card->dump_buf = new_coredump_node(ospriv, NULL);
if (card->dump_buf == NULL)
{
goto fail;
}
prev = card->dump_buf;
newnode = card->dump_buf;
/* Add each subsequent node at tail */
for (i = 1; i < num_dump_buffers; i++)
{
newnode = new_coredump_node(ospriv, prev);
if (newnode == NULL)
{
goto fail;
}
prev = newnode;
}
/* Link the first and last nodes to make the list circular */
card->dump_buf->prev = newnode;
newnode->next = card->dump_buf;
/* Set initial r/w access pointers */
card->dump_next_write = card->dump_buf;
card->dump_cur_read = NULL;
unifi_trace(ospriv, UDBG2, "Core dump configured (%d dumps max)\n", i);
done:
#endif
return CSR_RESULT_SUCCESS;
#ifndef UNIFI_DISABLE_COREDUMP
fail:
/* Unwind what we allocated so far */
unifi_error(ospriv, "Out of memory allocating core dump node %d\n", i);
unifi_coredump_free(card);
return CSR_WIFI_HIP_RESULT_NO_MEMORY;
#endif
} /* unifi_coreump_init() */
/*
* ---------------------------------------------------------------------------
* unifi_coredump_free
*
* Free all memory dynamically allocated for core dump
*
* Arguments:
* card Pointer to card struct
*
* Returns:
* None
*
* Notes:
* ---------------------------------------------------------------------------
*/
void unifi_coredump_free(card_t *card)
{
void *ospriv = card->ospriv;
coredump_buffer *node, *del_node;
s16 i = 0;
s16 j;
unifi_trace(ospriv, UDBG2, "Core dump de-configured\n");
if (card->dump_buf == NULL)
{
return;
}
node = card->dump_buf;
do
{
/* Free payload zones */
for (j = 0; j < HIP_CDUMP_NUM_ZONES; j++)
{
kfree(node->zone[j]);
node->zone[j] = NULL;
}
/* Detach */
del_node = node;
node = node->next;
/* Free header */
kfree(del_node);
i++;
} while ((node != NULL) && (node != card->dump_buf));
unifi_trace(ospriv, UDBG3, "Freed %d coredump buffers\n", i);
card->dump_buf = NULL;
card->dump_next_write = NULL;
card->dump_cur_read = NULL;
} /* unifi_coredump_free() */

File diff suppressed because it is too large Load diff

View file

@ -1,415 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ***************************************************************************
*
* FILE: csr_wifi_hip_send.c
*
* PURPOSE:
* Code for adding a signal request to the from-host queue.
* When the driver bottom-half is run, it will take requests from the
* queue and pass them to the UniFi.
*
* ***************************************************************************
*/
#include "csr_wifi_hip_unifi.h"
#include "csr_wifi_hip_conversions.h"
#include "csr_wifi_hip_sigs.h"
#include "csr_wifi_hip_card.h"
unifi_TrafficQueue unifi_frame_priority_to_queue(CSR_PRIORITY priority)
{
switch (priority)
{
case CSR_QOS_UP0:
case CSR_QOS_UP3:
return UNIFI_TRAFFIC_Q_BE;
case CSR_QOS_UP1:
case CSR_QOS_UP2:
return UNIFI_TRAFFIC_Q_BK;
case CSR_QOS_UP4:
case CSR_QOS_UP5:
return UNIFI_TRAFFIC_Q_VI;
case CSR_QOS_UP6:
case CSR_QOS_UP7:
case CSR_MANAGEMENT:
return UNIFI_TRAFFIC_Q_VO;
default:
return UNIFI_TRAFFIC_Q_BE;
}
}
CSR_PRIORITY unifi_get_default_downgrade_priority(unifi_TrafficQueue queue)
{
switch (queue)
{
case UNIFI_TRAFFIC_Q_BE:
return CSR_QOS_UP0;
case UNIFI_TRAFFIC_Q_BK:
return CSR_QOS_UP1;
case UNIFI_TRAFFIC_Q_VI:
return CSR_QOS_UP5;
case UNIFI_TRAFFIC_Q_VO:
return CSR_QOS_UP6;
default:
return CSR_QOS_UP0;
}
}
/*
* ---------------------------------------------------------------------------
* send_signal
*
* This function queues a signal for sending to UniFi. It first checks
* that there is space on the fh_signal_queue for another entry, then
* claims any bulk data slots required and copies data into them. Then
* increments the fh_signal_queue write count.
*
* The fh_signal_queue is later processed by the driver bottom half
* (in unifi_bh()).
*
* This function call unifi_pause_xmit() to pause the flow of data plane
* packets when:
* - the fh_signal_queue ring buffer is full
* - there are less than UNIFI_MAX_DATA_REFERENCES (2) bulk data
* slots available.
*
* Arguments:
* card Pointer to card context structure
* sigptr Pointer to the signal to write to UniFi.
* siglen Number of bytes pointer to by sigptr.
* bulkdata Array of pointers to an associated bulk data.
* sigq To which from-host queue to add the signal.
*
* Returns:
* CSR_RESULT_SUCCESS on success
* CSR_WIFI_HIP_RESULT_NO_SPACE if there were insufficient data slots or
* no free signal queue entry
*
* Notes:
* Calls unifi_pause_xmit() when the last slots are used.
* ---------------------------------------------------------------------------
*/
static CsrResult send_signal(card_t *card, const u8 *sigptr, u32 siglen,
const bulk_data_param_t *bulkdata,
q_t *sigq, u32 priority_q, u32 run_bh)
{
u16 i, data_slot_size;
card_signal_t *csptr;
s16 qe;
CsrResult r;
s16 debug_print = 0;
data_slot_size = CardGetDataSlotSize(card);
/* Check that the fh_data_queue has a free slot */
if (!CSR_WIFI_HIP_Q_SLOTS_FREE(sigq))
{
unifi_trace(card->ospriv, UDBG3, "send_signal: %s full\n", sigq->name);
return CSR_WIFI_HIP_RESULT_NO_SPACE;
}
/*
* Now add the signal to the From Host signal queue
*/
/* Get next slot on queue */
qe = CSR_WIFI_HIP_Q_NEXT_W_SLOT(sigq);
csptr = CSR_WIFI_HIP_Q_SLOT_DATA(sigq, qe);
/* Make up the card_signal struct */
csptr->signal_length = (u16)siglen;
memcpy((void *)csptr->sigbuf, (void *)sigptr, siglen);
for (i = 0; i < UNIFI_MAX_DATA_REFERENCES; ++i)
{
if ((bulkdata != NULL) && (bulkdata->d[i].data_length != 0))
{
u32 datalen = bulkdata->d[i].data_length;
/* Make sure data will fit in a bulk data slot */
if (bulkdata->d[i].os_data_ptr == NULL)
{
unifi_error(card->ospriv, "send_signal - NULL bulkdata[%d]\n", i);
debug_print++;
csptr->bulkdata[i].data_length = 0;
}
else
{
if (datalen > data_slot_size)
{
unifi_error(card->ospriv,
"send_signal - Invalid data length %u (@%p), "
"truncating\n",
datalen, bulkdata->d[i].os_data_ptr);
datalen = data_slot_size;
debug_print++;
}
/* Store the bulk data info in the soft queue. */
csptr->bulkdata[i].os_data_ptr = (u8 *)bulkdata->d[i].os_data_ptr;
csptr->bulkdata[i].os_net_buf_ptr = (u8 *)bulkdata->d[i].os_net_buf_ptr;
csptr->bulkdata[i].net_buf_length = bulkdata->d[i].net_buf_length;
csptr->bulkdata[i].data_length = datalen;
}
}
else
{
UNIFI_INIT_BULK_DATA(&csptr->bulkdata[i]);
}
}
if (debug_print)
{
const u8 *sig = sigptr;
unifi_error(card->ospriv, "Signal(%d): %*ph\n", siglen,
16, sig);
unifi_error(card->ospriv, "Bulkdata pointer %p(%d), %p(%d)\n",
bulkdata != NULL?bulkdata->d[0].os_data_ptr : NULL,
bulkdata != NULL?bulkdata->d[0].data_length : 0,
bulkdata != NULL?bulkdata->d[1].os_data_ptr : NULL,
bulkdata != NULL?bulkdata->d[1].data_length : 0);
}
/* Advance the written count to say there is a new entry */
CSR_WIFI_HIP_Q_INC_W(sigq);
/*
* Set the flag to say reason for waking was a host request.
* Then ask the OS layer to run the unifi_bh.
*/
if (run_bh == 1)
{
card->bh_reason_host = 1;
r = unifi_run_bh(card->ospriv);
if (r != CSR_RESULT_SUCCESS)
{
unifi_error(card->ospriv, "failed to run bh.\n");
card->bh_reason_host = 0;
/*
* The bulk data buffer will be freed by the caller.
* We need to invalidate the description of the bulk data in our
* soft queue, to prevent the core freeing the bulk data again later.
*/
for (i = 0; i < UNIFI_MAX_DATA_REFERENCES; ++i)
{
if (csptr->bulkdata[i].data_length != 0)
{
csptr->bulkdata[i].os_data_ptr = csptr->bulkdata[i].os_net_buf_ptr = NULL;
csptr->bulkdata[i].net_buf_length = csptr->bulkdata[i].data_length = 0;
}
}
return r;
}
}
else
{
unifi_error(card->ospriv, "run_bh=%d, bh not called.\n", run_bh);
}
/*
* Have we used up all the fh signal list entries?
*/
if (CSR_WIFI_HIP_Q_SLOTS_FREE(sigq) == 0)
{
/* We have filled the queue, so stop the upper layer. The command queue
* is an exception, as suspending due to that being full could delay
* resume/retry until new commands or data are received.
*/
if (sigq != &card->fh_command_queue)
{
/*
* Must call unifi_pause_xmit() *before* setting the paused flag.
* (the unifi_pause_xmit call should not be after setting the flag because of the possibility of being interrupted
* by the bh thread between our setting the flag and the call to unifi_pause_xmit()
* If bh thread then cleared the flag, we would end up paused, but without the flag set)
* Instead, setting it afterwards means that if this thread is interrupted by the bh thread
* the pause flag is still guaranteed to end up set
* However the potential deadlock now is that if bh thread emptied the queue and cleared the flag before this thread's
* call to unifi_pause_xmit(), then bh thread may not run again because it will be waiting for
* a packet to appear in the queue but nothing ever will because xmit is paused.
* So we will end up with the queue paused, and the flag set to say it is paused, but bh never runs to unpause it.
* (Note even this bad situation would not persist long in practice, because something else (eg rx, or tx in different queue)
* is likely to wake bh thread quite soon)
* But to avoid this deadlock completely, after setting the flag we check that there is something left in the queue.
* If there is, we know that bh thread has not emptied the queue yet.
* Since bh thread checks to unpause the queue *after* taking packets from the queue, we know that it is still going to make at
* least one more check to see whether it needs to unpause the queue. So all is well.
* If there are no packets in the queue, then the deadlock described above might happen. To make sure it does not, we
* unpause the queue here. A possible side effect is that unifi_restart_xmit() may (rarely) be called for second time
* unnecessarily, which is harmless
*/
#if defined (CSR_WIFI_HIP_DEBUG_OFFLINE) && defined (CSR_WIFI_HIP_DATA_PLANE_PROFILE)
unifi_debug_log_to_buf("P");
#endif
unifi_pause_xmit(card->ospriv, (unifi_TrafficQueue)priority_q);
card_tx_q_pause(card, priority_q);
if (CSR_WIFI_HIP_Q_SLOTS_USED(sigq) == 0)
{
card_tx_q_unpause(card, priority_q);
unifi_restart_xmit(card->ospriv, (unifi_TrafficQueue) priority_q);
}
}
else
{
unifi_warning(card->ospriv,
"send_signal: fh_cmd_q full, not pausing (run_bh=%d)\n",
run_bh);
}
}
return CSR_RESULT_SUCCESS;
} /* send_signal() */
/*
* ---------------------------------------------------------------------------
* unifi_send_signal
*
* Invokes send_signal() to queue a signal in the command or traffic queue
* If sigptr pointer is NULL, it pokes the bh to check if UniFi is responsive.
*
* Arguments:
* card Pointer to card context struct
* sigptr Pointer to signal from card.
* siglen Size of the signal
* bulkdata Pointer to the bulk data of the signal
*
* Returns:
* CSR_RESULT_SUCCESS on success
* CSR_WIFI_HIP_RESULT_NO_SPACE if there were insufficient data slots or no free signal queue entry
*
* Notes:
* unifi_send_signal() is used to queue signals, created by the driver,
* to the device. Signals are constructed using the UniFi packed structures.
* ---------------------------------------------------------------------------
*/
CsrResult unifi_send_signal(card_t *card, const u8 *sigptr, u32 siglen,
const bulk_data_param_t *bulkdata)
{
q_t *sig_soft_q;
u16 signal_id;
CsrResult r;
u32 run_bh;
u32 priority_q;
/* A NULL signal pointer is a request to check if UniFi is responsive */
if (sigptr == NULL)
{
card->bh_reason_host = 1;
return unifi_run_bh(card->ospriv);
}
priority_q = 0;
run_bh = 1;
signal_id = GET_SIGNAL_ID(sigptr);
/*
* If the signal is a CSR_MA_PACKET_REQUEST ,
* we send it using the traffic soft queue. Else we use the command soft queue.
*/
if (signal_id == CSR_MA_PACKET_REQUEST_ID)
{
u16 frame_priority;
if (card->periodic_wake_mode == UNIFI_PERIODIC_WAKE_HOST_ENABLED)
{
run_bh = 0;
}
#if defined (CSR_WIFI_HIP_DEBUG_OFFLINE) && defined (CSR_WIFI_HIP_DATA_PLANE_PROFILE)
unifi_debug_log_to_buf("D");
#endif
/* Sanity check: MA-PACKET.req must have a valid bulk data */
if ((bulkdata->d[0].data_length == 0) || (bulkdata->d[0].os_data_ptr == NULL))
{
unifi_error(card->ospriv, "MA-PACKET.req with empty bulk data (%d bytes in %p)\n",
bulkdata->d[0].data_length, bulkdata->d[0].os_data_ptr);
dump((void *)sigptr, siglen);
return CSR_RESULT_FAILURE;
}
/* Map the frame priority to a traffic queue index. */
frame_priority = GET_PACKED_MA_PACKET_REQUEST_FRAME_PRIORITY(sigptr);
priority_q = unifi_frame_priority_to_queue((CSR_PRIORITY)frame_priority);
sig_soft_q = &card->fh_traffic_queue[priority_q];
}
else
{
sig_soft_q = &card->fh_command_queue;
}
r = send_signal(card, sigptr, siglen, bulkdata, sig_soft_q, priority_q, run_bh);
/* On error, the caller must free or requeue bulkdata buffers */
return r;
} /* unifi_send_signal() */
/*
* ---------------------------------------------------------------------------
* unifi_send_resources_available
*
* Examines whether there is available space to queue
* a signal in the command or traffic queue
*
* Arguments:
* card Pointer to card context struct
* sigptr Pointer to signal.
*
* Returns:
* CSR_RESULT_SUCCESS if resources available
* CSR_WIFI_HIP_RESULT_NO_SPACE if there was no free signal queue entry
*
* Notes:
* ---------------------------------------------------------------------------
*/
CsrResult unifi_send_resources_available(card_t *card, const u8 *sigptr)
{
q_t *sig_soft_q;
u16 signal_id = GET_SIGNAL_ID(sigptr);
/*
* If the signal is a CSR_MA_PACKET_REQUEST ,
* we send it using the traffic soft queue. Else we use the command soft queue.
*/
if (signal_id == CSR_MA_PACKET_REQUEST_ID)
{
u16 frame_priority;
u32 priority_q;
/* Map the frame priority to a traffic queue index. */
frame_priority = GET_PACKED_MA_PACKET_REQUEST_FRAME_PRIORITY(sigptr);
priority_q = unifi_frame_priority_to_queue((CSR_PRIORITY)frame_priority);
sig_soft_q = &card->fh_traffic_queue[priority_q];
}
else
{
sig_soft_q = &card->fh_command_queue;
}
/* Check that the fh_data_queue has a free slot */
if (!CSR_WIFI_HIP_Q_SLOTS_FREE(sig_soft_q))
{
unifi_notice(card->ospriv, "unifi_send_resources_available: %s full\n",
sig_soft_q->name);
return CSR_WIFI_HIP_RESULT_NO_SPACE;
}
return CSR_RESULT_SUCCESS;
} /* unifi_send_resources_available() */

File diff suppressed because it is too large Load diff

View file

@ -1,128 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
*****************************************************************************
*
* FILE: csr_wifi_hip_signals.h
*
* PURPOSE:
* Header file wrapping the auto-generated code in csr_wifi_hip_sigs.h
* and csr_wifi_hip_signals.c -
* csr_wifi_hip_sigs.h provides structures defining UniFi signals and
* csr_wifi_hip_signals.c provides SigGetSize() and SigGetDataRefs().
*
*****************************************************************************
*/
#ifndef __CSR_WIFI_HIP_SIGNALS_H__
#define __CSR_WIFI_HIP_SIGNALS_H__
#include <linux/types.h>
#include "csr_wifi_hip_sigs.h"
/****************************************************************************/
/* INFORMATION ELEMENTS */
/****************************************************************************/
/* Information Element ID's - shouldn't be in here, but nowhere better yet */
#define IE_SSID_ID 0
#define IE_SUPPORTED_RATES_ID 1
#define IE_FH_PARAM_SET_ID 2
#define IE_DS_PARAM_SET_ID 3
#define IE_CF_PARAM_SET_ID 4
#define IE_TIM_ID 5
#define IE_IBSS_PARAM_SET_ID 6
#define IE_COUNTRY_ID 7
#define IE_HOPPING_PATTERN_PARAMS_ID 8
#define IE_HOPPING_PATTERN_TABLE_ID 9
#define IE_REQUEST_ID 10
#define IE_QBSS_LOAD_ID 11
#define IE_EDCA_PARAM_SET_ID 12
#define IE_TRAFFIC_SPEC_ID 13
#define IE_TRAFFIC_CLASS_ID 14
#define IE_SCHEDULE_ID 15
#define IE_CHALLENGE_TEXT_ID 16
#define IE_POWER_CONSTRAINT_ID 32
#define IE_POWER_CAPABILITY_ID 33
#define IE_TPC_REQUEST_ID 34
#define IE_TPC_REPORT_ID 35
#define IE_SUPPORTED_CHANNELS_ID 36
#define IE_CHANNEL_SWITCH_ANNOUNCE_ID 37
#define IE_MEASUREMENT_REQUEST_ID 38
#define IE_MEASUREMENT_REPORT_ID 39
#define IE_QUIET_ID 40
#define IE_IBSS_DFS_ID 41
#define IE_ERP_INFO_ID 42
#define IE_TS_DELAY_ID 43
#define IE_TCLAS_PROCESSING_ID 44
#define IE_QOS_CAPABILITY_ID 46
#define IE_RSN_ID 48
#define IE_EXTENDED_SUPPORTED_RATES_ID 50
#define IE_AP_CHANNEL_REPORT_ID 52
#define IE_RCPI_ID 53
#define IE_WPA_ID 221
/* The maximum number of data references in a signal structure */
#define UNIFI_MAX_DATA_REFERENCES 2
/* The space to allow for a wire-format signal structure */
#define UNIFI_PACKED_SIGBUF_SIZE 64
/******************************************************************************/
/* SIGNAL PARAMETER VALUES */
/******************************************************************************/
/* ifIndex */
#define UNIFI_IF_2G4 1
#define UNIFI_IF_5G 2
/* SendProcessId */
#define HOST_PROC_ID 0xc000
#define SIG_CAP_ESS 0x0001
#define SIG_CAP_IBSS 0x0002
#define SIG_CAP_CF_POLLABLE 0x0004
#define SIG_CAP_CF_POLL_REQUEST 0x0008
#define SIG_CAP_PRIVACY 0x0010
#define SIG_CAP_SHORT_PREAMBLE 0x0020
#define SIG_CAP_DSSSOFDM 0x2000
/******************************************************************************/
/* FUNCTION DECLARATIONS */
/******************************************************************************/
/******************************************************************************
* SigGetNumDataRefs - Retrieve pointers to data-refs from a signal.
*
* PARAMETERS:
* aSignal - Pointer to signal to retrieve the data refs of.
* aDataRef - Address of a pointer to the structure that the data refs
* pointers will be stored.
*
* RETURNS:
* The number of data-refs in the signal.
*/
s32 SigGetDataRefs(CSR_SIGNAL *aSignal, CSR_DATAREF **aDataRef);
/******************************************************************************
* SigGetSize - Retrieve the size (in bytes) of a given signal.
*
* PARAMETERS:
* aSignal - Pointer to signal to retrieve size of.
*
* RETURNS:
* The size (in bytes) of the given signal.
*/
s32 SigGetSize(const CSR_SIGNAL *aSignal);
#endif /* __CSR_WIFI_HIP_SIGNALS_H__ */

File diff suppressed because it is too large Load diff

View file

@ -1,541 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
* FILE: csr_wifi_hip_ta_sampling.c
*
* PURPOSE:
* The traffic analysis sampling module.
* This gathers data which is sent to the SME and used to analyse
* the traffic behaviour.
*
* Provides:
* unifi_ta_sampling_init - Initialise the internal state
* unifi_ta_sample - Sampling function, call this for every data packet
*
* Calls these external functions which must be provided:
* unifi_ta_indicate_sampling - Pass sample data to the SME.
* unifi_ta_indicate_protocol - Report certain data packet types to the SME.
* ---------------------------------------------------------------------------
*/
#include "csr_wifi_hip_card_sdio.h"
/* Maximum number of Tx frames we store each CYCLE_1, for detecting period */
#define TA_MAX_INTERVALS_IN_C1 100
/* Number of intervals in CYCLE_1 (one second), for detecting periodic */
/* Must match size of unifi_TrafficStats.intervals - 1 */
#define TA_INTERVALS_NUM 10
/* Step (in msecs) between intervals, for detecting periodic */
/* We are only interested in periods up to 100ms, i.e. between beacons */
/* This is correct for TA_INTERVALS_NUM=10 */
#define TA_INTERVALS_STEP 10
enum ta_frame_identity
{
TA_FRAME_UNKNOWN,
TA_FRAME_ETHERNET_UNINTERESTING,
TA_FRAME_ETHERNET_INTERESTING
};
#define TA_ETHERNET_TYPE_OFFSET 6
#define TA_LLC_HEADER_SIZE 8
#define TA_IP_TYPE_OFFSET 17
#define TA_UDP_SOURCE_PORT_OFFSET 28
#define TA_UDP_DEST_PORT_OFFSET (TA_UDP_SOURCE_PORT_OFFSET + 2)
#define TA_BOOTP_CLIENT_MAC_ADDR_OFFSET 64
#define TA_DHCP_MESSAGE_TYPE_OFFSET 278
#define TA_DHCP_MESSAGE_TYPE_ACK 0x05
#define TA_PROTO_TYPE_IP 0x0800
#define TA_PROTO_TYPE_EAP 0x888E
#define TA_PROTO_TYPE_WAI 0x8864
#define TA_PROTO_TYPE_ARP 0x0806
#define TA_IP_TYPE_TCP 0x06
#define TA_IP_TYPE_UDP 0x11
#define TA_UDP_PORT_BOOTPC 0x0044
#define TA_UDP_PORT_BOOTPS 0x0043
#define TA_EAPOL_TYPE_OFFSET 9
#define TA_EAPOL_TYPE_START 0x01
#define snap_802_2 0xAAAA0300
#define oui_rfc1042 0x00000000
#define oui_8021h 0x0000f800
static const u8 aironet_snap[5] = { 0x00, 0x40, 0x96, 0x00, 0x00 };
/*
* ---------------------------------------------------------------------------
* ta_detect_protocol
*
* Internal only.
* Detects a specific protocol in a frame and indicates a TA event.
*
* Arguments:
* ta The pointer to the TA module.
* direction The direction of the frame (tx or rx).
* data Pointer to the structure that contains the data.
*
* Returns:
* None
* ---------------------------------------------------------------------------
*/
static enum ta_frame_identity ta_detect_protocol(card_t *card, CsrWifiRouterCtrlProtocolDirection direction,
const bulk_data_desc_t *data,
const u8 *saddr,
const u8 *sta_macaddr)
{
ta_data_t *tad = &card->ta_sampling;
u16 proto;
u16 source_port, dest_port;
CsrWifiMacAddress srcAddress;
u32 snap_hdr, oui_hdr;
if (data->data_length < TA_LLC_HEADER_SIZE)
{
return TA_FRAME_UNKNOWN;
}
snap_hdr = (((u32)data->os_data_ptr[0]) << 24) |
(((u32)data->os_data_ptr[1]) << 16) |
(((u32)data->os_data_ptr[2]) << 8);
if (snap_hdr != snap_802_2)
{
return TA_FRAME_UNKNOWN;
}
if (tad->packet_filter & CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_CUSTOM)
{
/*
* Here we would use the custom filter to detect interesting frames.
*/
}
oui_hdr = (((u32)data->os_data_ptr[3]) << 24) |
(((u32)data->os_data_ptr[4]) << 16) |
(((u32)data->os_data_ptr[5]) << 8);
if ((oui_hdr == oui_rfc1042) || (oui_hdr == oui_8021h))
{
proto = (data->os_data_ptr[TA_ETHERNET_TYPE_OFFSET] * 256) +
data->os_data_ptr[TA_ETHERNET_TYPE_OFFSET + 1];
/* The only interesting IP frames are the DHCP */
if (proto == TA_PROTO_TYPE_IP)
{
if (data->data_length > TA_IP_TYPE_OFFSET)
{
if (tad->packet_filter & CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_CUSTOM)
{
ta_l4stats_t *ta_l4stats = &tad->ta_l4stats;
u8 l4proto = data->os_data_ptr[TA_IP_TYPE_OFFSET];
if (l4proto == TA_IP_TYPE_TCP)
{
if (direction == CSR_WIFI_ROUTER_CTRL_PROTOCOL_DIRECTION_TX)
{
ta_l4stats->txTcpBytesCount += data->data_length;
}
else
{
ta_l4stats->rxTcpBytesCount += data->data_length;
}
}
else if (l4proto == TA_IP_TYPE_UDP)
{
if (direction == CSR_WIFI_ROUTER_CTRL_PROTOCOL_DIRECTION_TX)
{
ta_l4stats->txUdpBytesCount += data->data_length;
}
else
{
ta_l4stats->rxUdpBytesCount += data->data_length;
}
}
}
/* detect DHCP frames */
if (tad->packet_filter & CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_DHCP)
{
/* DHCP frames are UDP frames with BOOTP ports */
if (data->os_data_ptr[TA_IP_TYPE_OFFSET] == TA_IP_TYPE_UDP)
{
if (data->data_length > TA_UDP_DEST_PORT_OFFSET)
{
source_port = (data->os_data_ptr[TA_UDP_SOURCE_PORT_OFFSET] * 256) +
data->os_data_ptr[TA_UDP_SOURCE_PORT_OFFSET + 1];
dest_port = (data->os_data_ptr[TA_UDP_DEST_PORT_OFFSET] * 256) +
data->os_data_ptr[TA_UDP_DEST_PORT_OFFSET + 1];
if (((source_port == TA_UDP_PORT_BOOTPC) && (dest_port == TA_UDP_PORT_BOOTPS)) ||
((source_port == TA_UDP_PORT_BOOTPS) && (dest_port == TA_UDP_PORT_BOOTPC)))
{
/* The DHCP should have at least a message type (request, ack, nack, etc) */
if (data->data_length > TA_DHCP_MESSAGE_TYPE_OFFSET + 6)
{
UNIFI_MAC_ADDRESS_COPY(srcAddress.a, saddr);
if (direction == CSR_WIFI_ROUTER_CTRL_PROTOCOL_DIRECTION_TX)
{
unifi_ta_indicate_protocol(card->ospriv,
CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_DHCP,
direction,
&srcAddress);
return TA_FRAME_ETHERNET_UNINTERESTING;
}
/* DHCPACK is a special indication */
if (UNIFI_MAC_ADDRESS_CMP(data->os_data_ptr + TA_BOOTP_CLIENT_MAC_ADDR_OFFSET, sta_macaddr) == TRUE)
{
if (data->os_data_ptr[TA_DHCP_MESSAGE_TYPE_OFFSET] == TA_DHCP_MESSAGE_TYPE_ACK)
{
unifi_ta_indicate_protocol(card->ospriv,
CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_DHCP_ACK,
direction,
&srcAddress);
}
else
{
unifi_ta_indicate_protocol(card->ospriv,
CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_DHCP,
direction,
&srcAddress);
}
}
}
}
}
}
}
}
return TA_FRAME_ETHERNET_INTERESTING;
}
/* detect protocol type EAPOL or WAI (treated as equivalent here) */
if (tad->packet_filter & CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_EAPOL)
{
if (TA_PROTO_TYPE_EAP == proto || TA_PROTO_TYPE_WAI == proto)
{
if ((TA_PROTO_TYPE_WAI == proto) || (direction != CSR_WIFI_ROUTER_CTRL_PROTOCOL_DIRECTION_TX) ||
(data->os_data_ptr[TA_EAPOL_TYPE_OFFSET] == TA_EAPOL_TYPE_START))
{
UNIFI_MAC_ADDRESS_COPY(srcAddress.a, saddr);
unifi_ta_indicate_protocol(card->ospriv,
CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_EAPOL,
direction, &srcAddress);
}
return TA_FRAME_ETHERNET_UNINTERESTING;
}
}
/* detect protocol type 0x0806 (ARP) */
if (tad->packet_filter & CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_ARP)
{
if (proto == TA_PROTO_TYPE_ARP)
{
UNIFI_MAC_ADDRESS_COPY(srcAddress.a, saddr);
unifi_ta_indicate_protocol(card->ospriv,
CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_ARP,
direction, &srcAddress);
return TA_FRAME_ETHERNET_UNINTERESTING;
}
}
return TA_FRAME_ETHERNET_INTERESTING;
}
else if (tad->packet_filter & CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_AIRONET)
{
/* detect Aironet frames */
if (!memcmp(data->os_data_ptr + 3, aironet_snap, 5))
{
UNIFI_MAC_ADDRESS_COPY(srcAddress.a, saddr);
unifi_ta_indicate_protocol(card->ospriv, CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_AIRONET,
direction, &srcAddress);
}
}
return TA_FRAME_ETHERNET_UNINTERESTING;
} /* ta_detect_protocol() */
static void tas_reset_data(ta_data_t *tad)
{
s16 i;
for (i = 0; i < (TA_INTERVALS_NUM + 1); i++)
{
tad->stats.intervals[i] = 0;
}
tad->stats.rxFramesNum = 0;
tad->stats.txFramesNum = 0;
tad->stats.rxBytesCount = 0;
tad->stats.txBytesCount = 0;
tad->stats.rxMeanRate = 0;
tad->rx_sum_rate = 0;
tad->ta_l4stats.rxTcpBytesCount = 0;
tad->ta_l4stats.txTcpBytesCount = 0;
tad->ta_l4stats.rxUdpBytesCount = 0;
tad->ta_l4stats.txUdpBytesCount = 0;
} /* tas_reset_data() */
/*
* ---------------------------------------------------------------------------
* API.
* unifi_ta_sampling_init
*
* (Re)Initialise the Traffic Analysis sampling module.
* Resets the counters and timestamps.
*
* Arguments:
* tad Pointer to a ta_data_t structure containing the
* context for this device instance.
* drv_priv An opaque pointer that the TA sampling module will
* pass in call-outs.
*
* Returns:
* None.
* ---------------------------------------------------------------------------
*/
void unifi_ta_sampling_init(card_t *card)
{
(void)unifi_ta_configure(card, CSR_WIFI_ROUTER_CTRL_TRAFFIC_CONFIG_TYPE_RESET, NULL);
card->ta_sampling.packet_filter = CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_NONE;
card->ta_sampling.traffic_type = CSR_WIFI_ROUTER_CTRL_TRAFFIC_TYPE_OCCASIONAL;
} /* unifi_ta_sampling_init() */
/*
* ---------------------------------------------------------------------------
* API.
* unifi_ta_sample
*
* Sample a data frame for the TA module.
* This function stores all the useful information it can extract from
* the frame and detects any specific protocols.
*
* Arguments:
* tad The pointer to the TA sampling context struct.
* direction The direction of the frame (rx, tx)
* data Pointer to the frame data
* saddr Source MAC address of frame.
* timestamp Time (in msecs) that the frame was received.
* rate Reported data rate for the rx frame (0 for tx frames)
*
* Returns:
* None
* ---------------------------------------------------------------------------
*/
void unifi_ta_sample(card_t *card,
CsrWifiRouterCtrlProtocolDirection direction,
const bulk_data_desc_t *data,
const u8 *saddr,
const u8 *sta_macaddr,
u32 timestamp,
u16 rate)
{
ta_data_t *tad = &card->ta_sampling;
enum ta_frame_identity identity;
u32 time_delta;
/* Step1: Check for specific frames */
if (tad->packet_filter != CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_NONE)
{
identity = ta_detect_protocol(card, direction, data, saddr, sta_macaddr);
}
else
{
identity = TA_FRAME_ETHERNET_INTERESTING;
}
/* Step2: Update the information in the current record */
if (direction == CSR_WIFI_ROUTER_CTRL_PROTOCOL_DIRECTION_RX)
{
/* Update the Rx packet count and the throughput count */
tad->stats.rxFramesNum++;
tad->stats.rxBytesCount += data->data_length;
/* Accumulate packet Rx rates for later averaging */
tad->rx_sum_rate += rate;
}
else
{
if (identity == TA_FRAME_ETHERNET_INTERESTING)
{
/*
* Store the period between the last and the current frame.
* There is not point storing more than TA_MAX_INTERVALS_IN_C1 periods,
* the traffic will be bursty or continuous.
*/
if (tad->stats.txFramesNum < TA_MAX_INTERVALS_IN_C1)
{
u32 interval;
u32 index_in_intervals;
interval = timestamp - tad->tx_last_ts;
tad->tx_last_ts = timestamp;
index_in_intervals = (interval + TA_INTERVALS_STEP / 2 - 1) / TA_INTERVALS_STEP;
/* If the interval is interesting, update the t1_intervals count */
if (index_in_intervals <= TA_INTERVALS_NUM)
{
unifi_trace(card->ospriv, UDBG5,
"unifi_ta_sample: TX interval=%d index=%d\n",
interval, index_in_intervals);
tad->stats.intervals[index_in_intervals]++;
}
}
}
/* Update the Tx packet count... */
tad->stats.txFramesNum++;
/* ... and the number of bytes for throughput. */
tad->stats.txBytesCount += data->data_length;
}
/*
* If more than one second has elapsed since the last report, send
* another one.
*/
/* Unsigned subtraction handles wrap-around from 0xFFFFFFFF to 0 */
time_delta = timestamp - tad->last_indication_time;
if (time_delta >= 1000)
{
/*
* rxFramesNum can be flashed in tas_reset_data() by another thread.
* Use a temp to avoid division by zero.
*/
u32 temp_rxFramesNum;
temp_rxFramesNum = tad->stats.rxFramesNum;
/* Calculate this interval's mean frame Rx rate from the sum */
if (temp_rxFramesNum)
{
tad->stats.rxMeanRate = tad->rx_sum_rate / temp_rxFramesNum;
}
unifi_trace(card->ospriv, UDBG5,
"unifi_ta_sample: RX fr=%lu, r=%u, sum=%lu, av=%lu\n",
tad->stats.rxFramesNum, rate,
tad->rx_sum_rate, tad->stats.rxMeanRate);
/*
* Send the information collected in the stats struct
* to the SME and reset the counters.
*/
if (tad->packet_filter & CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_CUSTOM)
{
u32 rxTcpThroughput = tad->ta_l4stats.rxTcpBytesCount / time_delta;
u32 txTcpThroughput = tad->ta_l4stats.txTcpBytesCount / time_delta;
u32 rxUdpThroughput = tad->ta_l4stats.rxUdpBytesCount / time_delta;
u32 txUdpThroughput = tad->ta_l4stats.txUdpBytesCount / time_delta;
unifi_ta_indicate_l4stats(card->ospriv,
rxTcpThroughput,
txTcpThroughput,
rxUdpThroughput,
txUdpThroughput
);
}
unifi_ta_indicate_sampling(card->ospriv, &tad->stats);
tas_reset_data(tad);
tad->last_indication_time = timestamp;
}
} /* unifi_ta_sample() */
/*
* ---------------------------------------------------------------------------
* External API.
* unifi_ta_configure
*
* Configures the TA module parameters.
*
* Arguments:
* ta The pointer to the TA module.
* config_type The type of the configuration request
* config Pointer to the configuration parameters.
*
* Returns:
* CSR_RESULT_SUCCESS on success, CSR error code otherwise
* ---------------------------------------------------------------------------
*/
CsrResult unifi_ta_configure(card_t *card,
CsrWifiRouterCtrlTrafficConfigType config_type,
const CsrWifiRouterCtrlTrafficConfig *config)
{
ta_data_t *tad = &card->ta_sampling;
/* Reinitialise our data when we are reset */
if (config_type == CSR_WIFI_ROUTER_CTRL_TRAFFIC_CONFIG_TYPE_RESET)
{
/* Reset the stats to zero */
tas_reset_data(tad);
/* Reset the timer variables */
tad->tx_last_ts = 0;
tad->last_indication_time = 0;
return CSR_RESULT_SUCCESS;
}
if (config_type == CSR_WIFI_ROUTER_CTRL_TRAFFIC_CONFIG_TYPE_FILTER)
{
tad->packet_filter = config->packetFilter;
if (tad->packet_filter & CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_CUSTOM)
{
tad->custom_filter = config->customFilter;
}
return CSR_RESULT_SUCCESS;
}
return CSR_RESULT_SUCCESS;
} /* unifi_ta_configure() */
/*
* ---------------------------------------------------------------------------
* External API.
* unifi_ta_classification
*
* Configures the current TA classification.
*
* Arguments:
* ta The pointer to the TA module.
* traffic_type The classification type
* period The traffic period if the type is periodic
*
* Returns:
* None
* ---------------------------------------------------------------------------
*/
void unifi_ta_classification(card_t *card,
CsrWifiRouterCtrlTrafficType traffic_type,
u16 period)
{
unifi_trace(card->ospriv, UDBG3,
"Changed current ta classification to: %d\n", traffic_type);
card->ta_sampling.traffic_type = traffic_type;
}

View file

@ -1,66 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
* FILE: csr_wifi_hip_ta_sampling.h
*
* PURPOSE:
* This file contains Traffic Analysis definitions common to the
* sampling and analysis modules.
*
* ---------------------------------------------------------------------------
*/
#ifndef __TA_SAMPLING_H__
#define __TA_SAMPLING_H__
#include "csr_wifi_hip_unifi.h"
typedef struct ta_l4stats
{
u32 rxTcpBytesCount;
u32 txTcpBytesCount;
u32 rxUdpBytesCount;
u32 txUdpBytesCount;
} ta_l4stats_t;
/*
* Context structure to preserve state between calls.
*/
typedef struct ta_data
{
/* Current packet filter configuration */
u16 packet_filter;
/* Current packet custom filter configuration */
CsrWifiRouterCtrlTrafficFilter custom_filter;
/* The timestamp of the last tx packet processed. */
u32 tx_last_ts;
/* The timestamp of the last packet processed. */
u32 last_indication_time;
/* Statistics */
CsrWifiRouterCtrlTrafficStats stats;
/* Current traffic classification */
CsrWifiRouterCtrlTrafficType traffic_type;
/* Sum of packet rx rates for this interval used to calculate mean */
u32 rx_sum_rate;
ta_l4stats_t ta_l4stats;
} ta_data_t;
void unifi_ta_sampling_init(card_t *card);
#endif /* __TA_SAMPLING_H__ */

View file

@ -1,173 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
* FILE: csr_wifi_hip_card_udi.c
*
* PURPOSE:
* Maintain a list of callbacks to log UniFi exchanges to one or more
* debug/monitoring client applications.
*
* NOTES:
* Just call the UDI driver log fn directly for now.
* When done properly, each open() on the UDI device will install
* a log function. We will call all log fns whenever a signal is written
* to or read form the UniFi.
*
* ---------------------------------------------------------------------------
*/
#include <linux/seq_file.h>
#include "csr_wifi_hip_unifi.h"
#include "csr_wifi_hip_card.h"
static void unifi_print_unsafe_sdio_status(card_t *card, struct seq_file *m)
{
#ifdef CSR_UNSAFE_SDIO_ACCESS
s32 iostate;
CsrResult r;
static const char *const states[] = {
"AWAKE", "DROWSY", "TORPID"
};
#define SHARED_READ_RETRY_LIMIT 10
u8 b;
seq_printf(m, "Host State: %s\n", states[card->host_state]);
r = unifi_check_io_status(card, &iostate);
if (iostate == 1) {
seq_puts(m, remaining, "I/O Check: F1 disabled\n");
} else {
if (iostate == 1) {
seq_puts(m, "I/O Check: pending interrupt\n");
seq_printf(m, "BH reason interrupt = %d\n", card->bh_reason_unifi);
seq_printf(m, "BH reason host = %d\n", card->bh_reason_host);
for (i = 0; i < SHARED_READ_RETRY_LIMIT; i++) {
r = unifi_read_8_or_16(card, card->sdio_ctrl_addr + 2, &b);
if (r == CSR_RESULT_SUCCESS && !(b & 0x80)) {
seq_printf(m, "fhsr: %u (driver thinks is %u)\n",
b, card->from_host_signals_r);
break;
}
}
iostate = unifi_read_shared_count(card, card->sdio_ctrl_addr + 4);
seq_printf(m, "thsw: %u (driver thinks is %u)\n",
iostate, card->to_host_signals_w);
}
#endif
}
/*
* ---------------------------------------------------------------------------
* unifi_print_status
*
* Print status info to given character buffer.
*
* Arguments:
* None.
*
* Returns:
* None.
* ---------------------------------------------------------------------------
*/
s32 unifi_print_status(card_t *card, struct seq_file *m)
{
sdio_config_data_t *cfg;
u16 i, n;
i = n = 0;
seq_printf(m, "Chip ID %u\n", card->chip_id);
seq_printf(m, "Chip Version %04X\n", card->chip_version);
seq_printf(m, "HIP v%u.%u\n",
(card->config_data.version >> 8) & 0xFF,
card->config_data.version & 0xFF);
seq_printf(m, "Build %u: %s\n", card->build_id, card->build_id_string);
cfg = &card->config_data;
seq_printf(m, "sdio ctrl offset %u\n", cfg->sdio_ctrl_offset);
seq_printf(m, "fromhost sigbuf handle %u\n", cfg->fromhost_sigbuf_handle);
seq_printf(m, "tohost_sigbuf_handle %u\n", cfg->tohost_sigbuf_handle);
seq_printf(m, "num_fromhost_sig_frags %u\n", cfg->num_fromhost_sig_frags);
seq_printf(m, "num_tohost_sig_frags %u\n", cfg->num_tohost_sig_frags);
seq_printf(m, "num_fromhost_data_slots %u\n", cfg->num_fromhost_data_slots);
seq_printf(m, "num_tohost_data_slots %u\n", cfg->num_tohost_data_slots);
seq_printf(m, "data_slot_size %u\n", cfg->data_slot_size);
/* Added by protocol version 0x0001 */
seq_printf(m, "overlay_size %u\n", cfg->overlay_size);
/* Added by protocol version 0x0300 */
seq_printf(m, "data_slot_round %u\n", cfg->data_slot_round);
seq_printf(m, "sig_frag_size %u\n", cfg->sig_frag_size);
/* Added by protocol version 0x0300 */
seq_printf(m, "tohost_sig_pad %u\n", cfg->tohost_signal_padding);
seq_puts(m, "\nInternal state:\n");
seq_printf(m, "Last PHY PANIC: %04x:%04x\n",
card->last_phy_panic_code, card->last_phy_panic_arg);
seq_printf(m, "Last MAC PANIC: %04x:%04x\n",
card->last_mac_panic_code, card->last_mac_panic_arg);
seq_printf(m, "fhsr: %hu\n", (u16)card->from_host_signals_r);
seq_printf(m, "fhsw: %hu\n", (u16)card->from_host_signals_w);
seq_printf(m, "thsr: %hu\n", (u16)card->to_host_signals_r);
seq_printf(m, "thsw: %hu\n", (u16)card->to_host_signals_w);
seq_printf(m, "fh buffer contains: %d signals, %td bytes\n",
card->fh_buffer.count,
card->fh_buffer.ptr - card->fh_buffer.buf);
seq_puts(m, "paused: ");
for (i = 0; i < ARRAY_SIZE(card->tx_q_paused_flag); i++)
seq_printf(m, card->tx_q_paused_flag[i] ? "1" : "0");
seq_putc(m, '\n');
seq_printf(m, "fh command q: %u waiting, %u free of %u:\n",
CSR_WIFI_HIP_Q_SLOTS_USED(&card->fh_command_queue),
CSR_WIFI_HIP_Q_SLOTS_FREE(&card->fh_command_queue),
UNIFI_SOFT_COMMAND_Q_LENGTH);
for (i = 0; i < UNIFI_NO_OF_TX_QS; i++)
seq_printf(m, "fh traffic q[%u]: %u waiting, %u free of %u:\n",
i,
CSR_WIFI_HIP_Q_SLOTS_USED(&card->fh_traffic_queue[i]),
CSR_WIFI_HIP_Q_SLOTS_FREE(&card->fh_traffic_queue[i]),
UNIFI_SOFT_TRAFFIC_Q_LENGTH);
seq_printf(m, "fh data slots free: %u\n",
card->from_host_data ? CardGetFreeFromHostDataSlots(card) : 0);
seq_puts(m, "From host data slots:");
n = card->config_data.num_fromhost_data_slots;
for (i = 0; i < n && card->from_host_data; i++)
seq_printf(m, " %hu", (u16)card->from_host_data[i].bd.data_length);
seq_putc(m, '\n');
seq_puts(m, "To host data slots:");
n = card->config_data.num_tohost_data_slots;
for (i = 0; i < n && card->to_host_data; i++)
seq_printf(m, " %hu", (u16)card->to_host_data[i].data_length);
seq_putc(m, '\n');
unifi_print_unsafe_sdio_status(card, m);
seq_puts(m, "\nStats:\n");
seq_printf(m, "Total SDIO bytes: R=%u W=%u\n",
card->sdio_bytes_read, card->sdio_bytes_written);
seq_printf(m, "Interrupts generated on card: %u\n", card->unifi_interrupt_seq);
return 0;
}

View file

@ -1,871 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
*
* FILE : csr_wifi_hip_unifi.h
*
* PURPOSE : Public API for the UniFi HIP core library.
*
* ---------------------------------------------------------------------------
*/
#ifndef __CSR_WIFI_HIP_UNIFI_H__
#define __CSR_WIFI_HIP_UNIFI_H__ 1
#ifndef CSR_WIFI_HIP_TA_DISABLE
#include "csr_wifi_router_ctrl_prim.h"
#include "csr_wifi_router_prim.h"
#else
#include "csr_time.h"
#endif
/* SDIO chip ID numbers */
/* Manufacturer id */
#define SDIO_MANF_ID_CSR 0x032a
/* Device id */
#define SDIO_CARD_ID_UNIFI_1 0x0001
#define SDIO_CARD_ID_UNIFI_2 0x0002
#define SDIO_CARD_ID_UNIFI_3 0x0007
#define SDIO_CARD_ID_UNIFI_4 0x0008
/* Function number for WLAN */
#define SDIO_WLAN_FUNC_ID_UNIFI_1 0x0001
#define SDIO_WLAN_FUNC_ID_UNIFI_2 0x0001
#define SDIO_WLAN_FUNC_ID_UNIFI_3 0x0001
#define SDIO_WLAN_FUNC_ID_UNIFI_4 0x0002
/* Maximum SDIO bus clock supported. */
#define UNIFI_SDIO_CLOCK_MAX_HZ 50000000 /* Hz */
/*
* Initialisation SDIO bus clock.
*
* The initialisation clock speed should be used from when the chip has been
* reset until the first MLME-reset has been received (i.e. during firmware
* initialisation), unless UNIFI_SDIO_CLOCK_SAFE_HZ applies.
*/
#define UNIFI_SDIO_CLOCK_INIT_HZ 12500000 /* Hz */
/*
* Safe SDIO bus clock.
*
* The safe speed should be used when the chip is in deep sleep or
* it's state is unknown (just after reset / power on).
*/
#define UNIFI_SDIO_CLOCK_SAFE_HZ 1000000 /* Hz */
/* I/O default block size to use for UniFi. */
#define UNIFI_IO_BLOCK_SIZE 64
#define UNIFI_WOL_OFF 0
#define UNIFI_WOL_SDIO 1
#define UNIFI_WOL_PIO 2
/* The number of Tx traffic queues */
#define UNIFI_NO_OF_TX_QS 4
#define CSR_WIFI_HIP_RESERVED_HOST_TAG 0xFFFFFFFF
/*
* The number of slots in the from-host queues.
*
* UNIFI_SOFT_TRAFFIC_Q_LENGTH is the number of slots in the traffic queues
* and there will be UNIFI_NO_OF_TX_QS of them.
* Traffic queues are used for data packets.
*
* UNIFI_SOFT_COMMAND_Q_LENGTH is the number of slots in the command queue.
* The command queue is used for MLME management requests.
*
* Queues are ring buffers and so must always have 1 unused slot.
*/
#define UNIFI_SOFT_TRAFFIC_Q_LENGTH (20 + 1)
#define UNIFI_SOFT_COMMAND_Q_LENGTH (16 + 1)
#include "csr_framework_ext.h" /* from the synergy porting folder */
#include "csr_sdio.h" /* from the synergy porting folder */
#include "csr_macro.h" /* from the synergy porting folder */
#include "csr_wifi_result.h"
/* Utility MACROS. Note that UNIFI_MAC_ADDRESS_CMP returns TRUE on success */
#define UNIFI_MAC_ADDRESS_COPY(dst, src) \
do { (dst)[0] = (src)[0]; (dst)[1] = (src)[1]; \
(dst)[2] = (src)[2]; (dst)[3] = (src)[3]; \
(dst)[4] = (src)[4]; (dst)[5] = (src)[5]; \
} while (0)
#define UNIFI_MAC_ADDRESS_CMP(addr1, addr2) \
(((addr1)[0] == (addr2)[0]) && ((addr1)[1] == (addr2)[1]) && \
((addr1)[2] == (addr2)[2]) && ((addr1)[3] == (addr2)[3]) && \
((addr1)[4] == (addr2)[4]) && ((addr1)[5] == (addr2)[5]))
/* Traffic queue ordered according to priority
* EAPOL/Uncontrolled port Queue should be the last
*/
typedef enum
{
UNIFI_TRAFFIC_Q_BK = 0,
UNIFI_TRAFFIC_Q_BE,
UNIFI_TRAFFIC_Q_VI,
UNIFI_TRAFFIC_Q_VO,
UNIFI_TRAFFIC_Q_EAPOL, /* Non existent in HIP */
UNIFI_TRAFFIC_Q_MAX, /* Non existent */
UNIFI_TRAFFIC_Q_MLME /* Non existent */
} unifi_TrafficQueue;
/*
* Structure describing a bulk data slot.
* This structure is shared between the HIP core library and the OS
* layer. See the definition of unifi_net_data_malloc() for more details.
*
* The data_length field is used to indicate empty/occupied state.
* Needs to be defined before #include "unifi_os.h".
*/
typedef struct _bulk_data_desc
{
const u8 *os_data_ptr;
u32 data_length;
const void *os_net_buf_ptr;
u32 net_buf_length;
} bulk_data_desc_t;
/* Structure of an entry in the Symbol Look Up Table (SLUT). */
typedef struct _symbol
{
u16 id;
u32 obj;
} symbol_t;
/*
* Header files need to be included from the current directory,
* the SME library, the synergy framework and the OS layer.
* A thin OS layer needs to be implemented in the porting exercise.
*
* Note that unifi_os.h should be included only in unifi.h
*/
#include "unifi_os.h"
/*
* Contains the HIP core definitions selected in the porting exercise, such as
* UNIFI_PAD_BULK_DATA_TO_BLOCK_SIZE and UNIFI_PAD_SIGNALS_TO_BLOCK_SIZE.
* Implemented in the OS layer, as part of the porting exersice.
*/
#include "unifi_config.h"
#include "csr_wifi_hip_signals.h" /* from this dir */
/*
* The card structure is an opaque pointer that is used to pass context
* to the upper-edge API functions.
*/
typedef struct card card_t;
/*
* This structure describes all of the bulk data that 'might' be
* associated with a signal.
*/
typedef struct _bulk_data_param
{
bulk_data_desc_t d[UNIFI_MAX_DATA_REFERENCES];
} bulk_data_param_t;
/*
* This structure describes the chip and HIP core lib
* information that exposed to the OS layer.
*/
typedef struct _card_info
{
u16 chip_id;
u16 chip_version;
u32 fw_build;
u16 fw_hip_version;
u32 sdio_block_size;
} card_info_t;
/*
* Mini-coredump definitions
*/
/* Definition of XAP memory ranges used by the mini-coredump system.
* Note that, these values are NOT the same as UNIFI_REGISTERS, etc
* in unifihw.h which don't allow selection of register areas for each XAP.
*/
typedef enum unifi_coredump_space
{
UNIFI_COREDUMP_MAC_REG,
UNIFI_COREDUMP_PHY_REG,
UNIFI_COREDUMP_SH_DMEM,
UNIFI_COREDUMP_MAC_DMEM,
UNIFI_COREDUMP_PHY_DMEM,
UNIFI_COREDUMP_TRIGGER_MAGIC = 0xFEED
} unifi_coredump_space_t;
/* Structure used to request a register value from a mini-coredump buffer */
typedef struct unifi_coredump_req
{
/* From user */
s32 index; /* 0=newest, -1=oldest */
unifi_coredump_space_t space; /* memory space */
u32 offset; /* register offset in space */
/* From driver */
u32 drv_build; /* Driver build id */
u32 chip_ver; /* Chip version */
u32 fw_ver; /* Firmware version */
s32 requestor; /* Requestor: 0=auto dump, 1=manual */
u32 timestamp; /* time of capture by driver */
u32 serial; /* capture serial number */
s32 value; /* register value */
} unifi_coredump_req_t; /* mini-coredumped reg value request */
/**
* @defgroup upperedge Upper edge API
*
* The following functions are implemented in the HIP core lib.
*/
/**
*
* Initialise the HIP core lib.
* Note that the OS layer must initialise the SDIO glue layer and obtain
* an SDIO function context, prior to this call.
*
* @param sdiopriv the SDIO function context.
*
* @param ospriv the OS layer context.
*
* @return \p card_t the HIP core lib API context.
*
* @ingroup upperedge
*/
card_t* unifi_alloc_card(CsrSdioFunction *sdiopriv, void *ospriv);
/**
*
* Initialise the UniFi chip.
*
* @param card the HIP core lib API context.
*
* @param led_mask the led mask to apply to UniFi.
*
* @return \b 0 if UniFi is initialized.
*
* @return \b -CSR_EIO if an I/O error occurred while initializing UniFi
*
* @return \b -CSR_ENODEV if the card is no longer present.
*
* @ingroup upperedge
*/
CsrResult unifi_init_card(card_t *card, s32 led_mask);
/**
*
* De-Initialise the HIP core lib.
*
* @param card the HIP core lib API context.
*
* @ingroup upperedge
*/
void unifi_free_card(card_t *card);
/**
*
* Cancel all the signals pending in the HIP core lib.
* Normally used during a system suspend when the power is retained on UniFi.
*
* @param card the HIP core lib API context.
*
* @ingroup upperedge
*/
void unifi_cancel_pending_signals(card_t *card);
/**
*
* Send a signal to UniFi.
* Normally it is called from unifi_sys_hip_req() and the OS layer
* Tx data plane.
*
* Note that the bulkdata buffers ownership is passed to the HIP core lib.
* These buffers must be allocated using unifi_net_data_malloc().
*
* @param card the HIP core lib API context.
*
* @param sigptr pointer to the signal.
*
* @param siglen size of the signal.
*
* @param bulkdata pointer to the bulk data associated with the signal.
*
* @return \b 0 signal is sent.
*
* @return \b -CSR_EIO if an error occurred while sending the signal
*
* @return \b -CSR_ENODEV if the card is no longer present.
*
* @ingroup upperedge
*/
CsrResult unifi_send_signal(card_t *card, const u8 *sigptr,
u32 siglen,
const bulk_data_param_t *bulkdata);
/**
*
* Check if the HIP core lib has resources to send a signal.
* Normally there no need to use this function.
*
* @param card the HIP core lib API context.
*
* @param sigptr pointer to the signal.
*
* @return \b 0 if there are resources for the signal.
*
* @return \b -CSR_ENOSPC if there are not enough resources
*
* @ingroup upperedge
*/
CsrResult unifi_send_resources_available(card_t *card, const u8 *sigptr);
/**
*
* Read the UniFi chip and the HIP core lib information.
*
* @param card the HIP core lib API context.
*
* @param card_info pointer to save the information.
*
* @ingroup upperedge
*/
void unifi_card_info(card_t *card, card_info_t *card_info);
/**
*
* Print the UniFi I/O and Interrupt status.
* Normally it is used for debug purposes only.
*
* @param card the HIP core lib API context.
* @param status buffer for the chip status
*
* @return \b 0 if the check was performed.
*
* @return \b -CSR_EIO if an error occurred while checking the status.
*
* @return \b -CSR_ENODEV if the card is no longer present.
*
* @ingroup upperedge
*/
CsrResult unifi_check_io_status(card_t *card, s32 *status);
/**
*
* Run the HIP core lib Botton-Half.
* Whenever the HIP core lib want this function to be called
* by the OS layer, it calls unifi_run_bh().
*
* @param card the HIP core lib API context.
*
* @param remaining pointer to return the time (in msecs) that this function
* should be re-scheduled. A return value of 0 means that no re-scheduling
* is required. If unifi_bh() is called before the timeout expires,
* the caller must pass in the remaining time.
*
* @return \b 0 if no error occurred.
*
* @return \b -CSR_ENODEV if the card is no longer present.
*
* @return \b -CSR_E* if an error occurred while running the bottom half.
*
* @ingroup upperedge
*/
CsrResult unifi_bh(card_t *card, u32 *remaining);
/**
* UniFi Low Power Mode (Deep Sleep Signaling)
*
* unifi_low_power_mode defines the UniFi Deep Sleep Signaling status.
* Use with unifi_configure_low_power_mode() to enable/disable
* the Deep Sleep Signaling.
*/
enum unifi_low_power_mode
{
UNIFI_LOW_POWER_DISABLED,
UNIFI_LOW_POWER_ENABLED
};
/**
* Periodic Wake Host Mode
*
* unifi_periodic_wake_mode defines the Periodic Wake Host Mode.
* It can only be set to UNIFI_PERIODIC_WAKE_HOST_ENABLED if
* low_power_mode == UNIFI_LOW_POWER_ENABLED.
*/
enum unifi_periodic_wake_mode
{
UNIFI_PERIODIC_WAKE_HOST_DISABLED,
UNIFI_PERIODIC_WAKE_HOST_ENABLED
};
/**
*
* Run the HIP core lib Botton-Half.
* Whenever the HIP core lib want this function to be called
* by the OS layer, it calls unifi_run_bh().
*
* Typically, the SME is responsible for configuring these parameters,
* so unifi_sys_configure_power_mode_req() is usually implemented
* as a direct call to unifi_configure_low_power_mode().
*
* Note: When polling mode is used instead of interrupts,
* low_power_mode must never be set to UNIFI_LOW_POWER_ENABLED.
*
* @param card the HIP core lib API context.
*
* @param low_power_mode the Low Power Mode.
*
* @param periodic_wake_mode the Periodic Wake Mode.
*
* @return \b 0 if no error occurred.
*
* @return \b -CSR_E* if the request failed.
*
* @ingroup upperedge
*/
CsrResult unifi_configure_low_power_mode(card_t *card,
enum unifi_low_power_mode low_power_mode,
enum unifi_periodic_wake_mode periodic_wake_mode);
/**
*
* Forces the UniFi chip to enter a Deep Sleep state.
* This is normally called by the OS layer when the platform suspends.
*
* Note that if the UniFi Low Power Mode is disabled this call fails.
*
* @param card the HIP core lib API context.
*
* @return \b 0 if no error occurred.
*
* @return \b -CSR_ENODEV if the card is no longer present.
*
* @return \b -CSR_E* if the request failed.
*
* @ingroup upperedge
*/
CsrResult unifi_force_low_power_mode(card_t *card);
#ifndef CSR_WIFI_HIP_TA_DISABLE
/**
* Configure the Traffic Analysis sampling
*
* Enable or disable statistics gathering.
* Enable or disable particular packet detection.
*
* @param card the HIP core context
* @param config_type the item to configure
* @param config pointer to struct containing config info
*
* @return \b 0 if configuration was successful
*
* @return \b -CSR_EINVAL if a parameter had an invalid value
*
* @ingroup upperedge
*/
CsrResult unifi_ta_configure(card_t *card,
CsrWifiRouterCtrlTrafficConfigType config_type,
const CsrWifiRouterCtrlTrafficConfig *config);
/**
* Pass a packet for Traffic Analysis sampling
*
* @param card the HIP core context
* @param direction the direction (Rx or Tx) of the frame.
* @param data pointer to bulkdata struct containing the packet
* @param saddr the source address of the packet
* @param sta_macaddr the MAC address of the UniFi chip
* @param timestamp the current time in msecs
*
* @ingroup upperedge
*/
void unifi_ta_sample(card_t *card,
CsrWifiRouterCtrlProtocolDirection direction,
const bulk_data_desc_t *data,
const u8 *saddr,
const u8 *sta_macaddr,
u32 timestamp,
u16 rate);
/**
* Notify the HIP core lib for a detected Traffic Classification.
* Typically, the SME is responsible for configuring these parameters,
* so unifi_sys_traffic_classification_req() is usually implemented
* as a direct call to unifi_ta_classification().
*
* @param card the HIP core context.
* @param traffic_type the detected traffic type.
* @param period The detected period of the traffic.
*
* @ingroup upperedge
*/
void unifi_ta_classification(card_t *card,
CsrWifiRouterCtrlTrafficType traffic_type,
u16 period);
#endif
/**
* Use software to hard reset the chip.
* This is a subset of the unifi_init_card() functionality and should
* only be used only to reset a paniced chip before a coredump is taken.
*
* @param card the HIP core context.
*
* @ingroup upperedge
*/
CsrResult unifi_card_hard_reset(card_t *card);
CsrResult unifi_card_readn(card_t *card, u32 unifi_addr, void *pdata, u16 len);
CsrResult unifi_card_read16(card_t *card, u32 unifi_addr, u16 *pdata);
CsrResult unifi_card_write16(card_t *card, u32 unifi_addr, u16 data);
enum unifi_dbg_processors_select
{
UNIFI_PROC_MAC,
UNIFI_PROC_PHY,
UNIFI_PROC_BT,
UNIFI_PROC_BOTH,
UNIFI_PROC_INVALID
};
CsrResult unifi_card_stop_processor(card_t *card, enum unifi_dbg_processors_select which);
/**
* Call-outs from the HIP core lib to the OS layer.
* The following functions need to be implemented during the porting exercise.
*/
/**
* Selects appropriate queue according to priority
* Helps maintain uniformity in queue selection between the HIP
* and the OS layers.
*
* @param priority priority of the packet
*
* @return \b Traffic queue to which a packet of this priority belongs
*
* @ingroup upperedge
*/
unifi_TrafficQueue
unifi_frame_priority_to_queue(CSR_PRIORITY priority);
/**
* Returns the priority corresponding to a particular Queue when that is used
* when downgrading a packet to a lower AC.
* Helps maintain uniformity in queue - priority mapping between the HIP
* and the OS layers.
*
* @param queue
*
* @return \b Highest priority corresponding to this queue
*
* @ingroup upperedge
*/
CSR_PRIORITY unifi_get_default_downgrade_priority(unifi_TrafficQueue queue);
/**
*
* Flow control callbacks.
* unifi_pause_xmit() is called when the HIP core lib does not have any
* resources to store data packets. The OS layer needs to pause
* the Tx data plane until unifi_restart_xmit() is called.
*
* @param ospriv the OS layer context.
*
* @ingroup upperedge
*/
void unifi_pause_xmit(void *ospriv, unifi_TrafficQueue queue);
void unifi_restart_xmit(void *ospriv, unifi_TrafficQueue queue);
/**
*
* Request to run the Bottom-Half.
* The HIP core lib calls this function to request that unifi_bh()
* needs to be run by the OS layer. It can be called anytime, i.e.
* when the unifi_bh() is running.
* Since unifi_bh() is not re-entrant, usually unifi_run_bh() sets
* an event to a thread that schedules a call to unifi_bh().
*
* @param ospriv the OS layer context.
*
* @ingroup upperedge
*/
CsrResult unifi_run_bh(void *ospriv);
/**
*
* Delivers a signal received from UniFi to the OS layer.
* Normally, the data signals should be delivered to the data plane
* and all the rest to the SME (unifi_sys_hip_ind()).
*
* Note that the OS layer is responsible for freeing the bulkdata
* buffers, using unifi_net_data_free().
*
* @param ospriv the OS layer context.
*
* @param sigptr pointer to the signal.
*
* @param siglen size of the signal.
*
* @param bulkdata pointer to the bulk data associated with the signal.
*
* @ingroup upperedge
*/
void unifi_receive_event(void *ospriv,
u8 *sigdata, u32 siglen,
const bulk_data_param_t *bulkdata);
#ifdef CSR_WIFI_REQUEUE_PACKET_TO_HAL
/**
*
* Used to reque the failed ma packet request back to hal queues
*
* @param ospriv the OS layer context.
*
* @param host_tag host tag for the packet to requeue.
*
* @param bulkDataDesc pointer to the bulk data.
*
* @ingroup upperedge
*/
CsrResult unifi_reque_ma_packet_request(void *ospriv, u32 host_tag,
u16 status,
bulk_data_desc_t *bulkDataDesc);
#endif
typedef struct
{
u16 free_fh_sig_queue_slots[UNIFI_NO_OF_TX_QS];
u16 free_fh_bulkdata_slots;
u16 free_fh_fw_slots;
} unifi_HipQosInfo;
void unifi_get_hip_qos_info(card_t *card, unifi_HipQosInfo *hipqosinfo);
/**
* Functions that read a portion of a firmware file.
*
* Note: If the UniFi chip runs the f/w from ROM, the HIP core may never
* call these functions. Also, the HIP core may call these functions even if
* a f/w file is not available. In this case, it is safe to fail the request.
*/
#define UNIFI_FW_STA 1 /* Identify STA firmware file */
/**
*
* Ask the OS layer to initialise a read from a f/w file.
*
* @param ospriv the OS layer context.
*
* @param is_fw if 0 the request if for the loader file, if 1 the request
* is for a f/w file.
*
* @param info a card_info_t structure containing versions information.
* Note that some members of the structure may not be initialised.
*
* @return \p NULL if the file is not available, or a pointer which contains
* OS specific information for the file (typically the contents of the file)
* that the HIP core uses when calling unifi_fw_read() and unifi_fw_read_stop()
*
* @ingroup upperedge
*/
void* unifi_fw_read_start(void *ospriv, s8 is_fw, const card_info_t *info);
/**
*
* Ask the OS layer to return a portion from a f/w file.
*
* @param ospriv the OS layer context.
*
* @param arg the OS pointer returned by unifi_fw_read_start().
*
* @param offset the offset in the f/w file to read the read from.
*
* @param buf the buffer to store the returned data.
*
* @param len the size in bytes of the requested read.
*
* @ingroup upperedge
*/
s32 unifi_fw_read(void *ospriv, void *arg, u32 offset, void *buf, u32 len);
/**
*
* Ask the OS layer to finish reading from a f/w file.
*
* @param ospriv the OS layer context.
*
* @param dlpriv the OS pointer returned by unifi_fw_read_start().
*
* @ingroup upperedge
*/
void unifi_fw_read_stop(void *ospriv, void *dlpriv);
/**
*
* Ask OS layer for a handle to a dynamically allocated firmware buffer
* (primarily intended for production test images which may need conversion)
*
* @param ospriv the OS layer context.
*
* @param fwbuf pointer to dynamically allocated buffer
*
* @param len length of provided buffer in bytes
*
* @ingroup upperedge
*/
void* unifi_fw_open_buffer(void *ospriv, void *fwbuf, u32 len);
/**
*
* Release a handle to a dynamically allocated firmware buffer
* (primarily intended for production test images which may need conversion)
*
* @param ospriv the OS layer context.
*
* @param fwbuf pointer to dynamically allocated buffer
*
* @ingroup upperedge
*/
void unifi_fw_close_buffer(void *ospriv, void *fwbuf);
#ifndef CSR_WIFI_HIP_TA_DISABLE
/*
* Driver must provide these.
*
* A simple implementation will just call
* unifi_sys_traffic_protocol_ind() or unifi_sys_traffic_classification_ind()
* respectively. See sme_csr_userspace/sme_userspace.c.
*/
/**
*
* Indicates a detected packet of type packet_type.
* Typically, this information is processed by the SME so
* unifi_ta_indicate_protocol() needs to schedule a call to
* unifi_sys_traffic_protocol_ind().
*
* @param ospriv the OS layer context.
*
* @param packet_type the detected packet type.
*
* @param direction the direction of the packet (Rx, Tx).
*
* @param src_addr the source address of the packet.
*
* @ingroup upperedge
*/
void unifi_ta_indicate_protocol(void *ospriv,
CsrWifiRouterCtrlTrafficPacketType packet_type,
CsrWifiRouterCtrlProtocolDirection direction,
const CsrWifiMacAddress *src_addr);
/**
*
* Indicates statistics for the sample data over a period.
* Typically, this information is processed by the SME so
* unifi_ta_indicate_sampling() needs to schedule a call to
* unifi_sys_traffic_sample_ind().
*
* @param ospriv the OS layer context.
*
* @param stats the pointer to the structure that contains the statistics.
*
* @ingroup upperedge
*/
void unifi_ta_indicate_sampling(void *ospriv, CsrWifiRouterCtrlTrafficStats *stats);
void unifi_ta_indicate_l4stats(void *ospriv,
u32 rxTcpThroughput,
u32 txTcpThroughput,
u32 rxUdpThroughput,
u32 txUdpThroughput);
#endif
void unifi_rx_queue_flush(void *ospriv);
/**
* Call-out from the SDIO glue layer.
*
* The glue layer needs to call unifi_sdio_interrupt_handler() every time
* an interrupts occurs.
*
* @param card the HIP core context.
*
* @ingroup bottomedge
*/
void unifi_sdio_interrupt_handler(card_t *card);
/* HELPER FUNCTIONS */
/*
* unifi_init() and unifi_download() implement a subset of unifi_init_card functionality
* that excludes HIP initialization.
*/
CsrResult unifi_init(card_t *card);
CsrResult unifi_download(card_t *card, s32 led_mask);
/*
* unifi_start_processors() ensures both on-chip processors are running
*/
CsrResult unifi_start_processors(card_t *card);
CsrResult unifi_capture_panic(card_t *card);
/*
* Configure HIP interrupt processing mode
*/
#define CSR_WIFI_INTMODE_DEFAULT 0
#define CSR_WIFI_INTMODE_RUN_BH_ONCE 1 /* Run BH once per interrupt */
void unifi_set_interrupt_mode(card_t *card, u32 mode);
/*
* unifi_request_max_clock() requests that max SDIO clock speed is set at the
* next suitable opportunity.
*/
void unifi_request_max_sdio_clock(card_t *card);
/* Functions to lookup bulk data command names. */
const char* lookup_bulkcmd_name(u16 id);
/* Function to log HIP's global debug buffer */
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
void unifi_debug_buf_dump(void);
void unifi_debug_log_to_buf(const char *fmt, ...);
void unifi_debug_hex_to_buf(const char *buff, u16 length);
#endif
/* Mini-coredump utility functions */
CsrResult unifi_coredump_get_value(card_t *card, struct unifi_coredump_req *req);
CsrResult unifi_coredump_capture(card_t *card, struct unifi_coredump_req *req);
CsrResult unifi_coredump_request_at_next_reset(card_t *card, s8 enable);
CsrResult unifi_coredump_init(card_t *card, u16 num_dump_buffers);
void unifi_coredump_free(card_t *card);
#endif /* __CSR_WIFI_HIP_UNIFI_H__ */

View file

@ -1,41 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include "csr_wifi_hip_unifi.h"
struct sig_name {
s16 id;
const char *name;
};
static const struct sig_name Unifi_bulkcmd_names[] = {
{ 0, "SignalCmd" },
{ 1, "CopyToHost" },
{ 2, "CopyToHostAck" },
{ 3, "CopyFromHost" },
{ 4, "CopyFromHostAck" },
{ 5, "ClearSlot" },
{ 6, "CopyOverlay" },
{ 7, "CopyOverlayAck" },
{ 8, "CopyFromHostAndClearSlot" },
{ 15, "Padding" }
};
const char *lookup_bulkcmd_name(u16 id)
{
if (id < 9)
return Unifi_bulkcmd_names[id].name;
if (id == 15)
return "Padding";
return "UNKNOWN";
}

View file

@ -1,52 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
* FILE: csr_wifi_hip_unifi_udi.h
*
* PURPOSE:
* Declarations and definitions for the UniFi Debug Interface.
*
* ---------------------------------------------------------------------------
*/
#ifndef __CSR_WIFI_HIP_UNIFI_UDI_H__
#define __CSR_WIFI_HIP_UNIFI_UDI_H__
#include "csr_wifi_hip_unifi.h"
#include "csr_wifi_hip_signals.h"
/*
* Support for tracing the wire protocol.
*/
enum udi_log_direction
{
UDI_LOG_FROM_HOST = 0x0000,
UDI_LOG_TO_HOST = 0x0001
};
typedef void (*udi_func_t)(void *ospriv, u8 *sigdata,
u32 signal_len,
const bulk_data_param_t *bulkdata,
enum udi_log_direction dir);
CsrResult unifi_set_udi_hook(card_t *card, udi_func_t udi_fn);
CsrResult unifi_remove_udi_hook(card_t *card, udi_func_t udi_fn);
/*
* Function to print current status info to a string.
* This is used in the linux /proc interface and might be useful
* in other systems.
*/
s32 unifi_print_status(card_t *card, struct seq_file *m);
#endif /* __CSR_WIFI_HIP_UNIFI_UDI_H__ */

View file

@ -1,59 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
*
* File: csr_wifi_hip_unifihw.h
*
* Definitions of various chip registers, addresses, values etc.
*
* ---------------------------------------------------------------------------
*/
#ifndef __UNIFIHW_H__
#define __UNIFIHW_H__ 1
/* Symbol Look Up Table fingerprint. IDs are in sigs.h */
#define SLUT_FINGERPRINT 0xD397
/* Values of LoaderOperation */
#define UNIFI_LOADER_IDLE 0x00
#define UNIFI_LOADER_COPY 0x01
#define UNIFI_LOADER_ERROR_MASK 0xF0
/* Values of BootLoaderOperation */
#define UNIFI_BOOT_LOADER_IDLE 0x00
#define UNIFI_BOOT_LOADER_RESTART 0x01
#define UNIFI_BOOT_LOADER_PATCH 0x02
#define UNIFI_BOOT_LOADER_LOAD_STA 0x10
#define UNIFI_BOOT_LOADER_LOAD_PTEST 0x11
/* Memory spaces encoded in top byte of Generic Pointer type */
#define UNIFI_SH_DMEM 0x01 /* Shared Data Memory */
#define UNIFI_EXT_FLASH 0x02 /* External FLASH */
#define UNIFI_EXT_SRAM 0x03 /* External SRAM */
#define UNIFI_REGISTERS 0x04 /* Registers */
#define UNIFI_PHY_DMEM 0x10 /* PHY Data Memory */
#define UNIFI_PHY_PMEM 0x11 /* PHY Program Memory */
#define UNIFI_PHY_ROM 0x12 /* PHY ROM */
#define UNIFI_MAC_DMEM 0x20 /* MAC Data Memory */
#define UNIFI_MAC_PMEM 0x21 /* MAC Program Memory */
#define UNIFI_MAC_ROM 0x22 /* MAC ROM */
#define UNIFI_BT_DMEM 0x30 /* BT Data Memory */
#define UNIFI_BT_PMEM 0x31 /* BT Program Memory */
#define UNIFI_BT_ROM 0x32 /* BT ROM */
#define UNIFI_MAKE_GP(R, O) (((UNIFI_ ## R) << 24) | (O))
#define UNIFI_GP_OFFSET(GP) ((GP) & 0xFFFFFF)
#define UNIFI_GP_SPACE(GP) (((GP) >> 24) & 0xFF)
#endif /* __UNIFIHW_H__ */

View file

@ -1,30 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
* FILE: unifiversion.h
*
* PURPOSE:
* Version information for the portable UniFi driver.
*
* ---------------------------------------------------------------------------
*/
#ifndef __UNIFIVERSION_H__
#define __UNIFIVERSION_H__
/*
* The minimum version of Host Interface Protocol required by the driver.
*/
#define UNIFI_HIP_MAJOR_VERSION 9
#define UNIFI_HIP_MINOR_VERSION 1
#endif /* __UNIFIVERSION_H__ */

File diff suppressed because it is too large Load diff

View file

@ -1,119 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/*
* ---------------------------------------------------------------------------
* FILE: csr_wifi_hip_xbv.h
*
* PURPOSE:
* Definitions and declarations for code to read XBV files - the UniFi
* firmware download file format.
*
* ---------------------------------------------------------------------------
*/
#ifndef __XBV_H__
#define __XBV_H__
#ifndef CSR_WIFI_XBV_TEST
/* Driver includes */
#include "csr_wifi_hip_unifi.h"
#endif
struct VMEQ
{
u32 addr;
u16 mask;
u16 value;
};
struct VAND
{
u32 first;
u32 count;
};
struct VERS
{
u32 num_vand;
};
struct FWDL
{
u32 dl_addr;
u32 dl_size;
u32 dl_offset;
};
struct FWOV
{
u32 dl_size;
u32 dl_offset;
};
struct PTDL
{
u32 dl_size;
u32 dl_offset;
};
#define MAX_VMEQ 64
#define MAX_VAND 64
#define MAX_FWDL 256
#define MAX_PTDL 256
/* An XBV1 file can either contain firmware or patches (at the
* moment). The 'mode' member of the xbv1_t structure tells us which
* one is the case. */
typedef enum
{
xbv_unknown,
xbv_firmware,
xbv_patch
} xbv_mode;
typedef struct
{
xbv_mode mode;
/* Parts of a Firmware XBV1 */
struct VMEQ vmeq[MAX_VMEQ];
u32 num_vmeq;
struct VAND vand[MAX_VAND];
struct VERS vers;
u32 slut_addr;
/* F/W download image, possibly more than one part */
struct FWDL fwdl[MAX_FWDL];
s16 num_fwdl;
/* F/W overlay image, add r not used */
struct FWOV fwov;
/* Parts of a Patch XBV1 */
u32 build_id;
struct PTDL ptdl[MAX_PTDL];
s16 num_ptdl;
} xbv1_t;
typedef s32 (*fwreadfn_t)(void *ospriv, void *dlpriv, u32 offset, void *buf, u32 len);
CsrResult xbv1_parse(card_t *card, fwreadfn_t readfn, void *dlpriv, xbv1_t *fwinfo);
s32 xbv1_read_slut(card_t *card, fwreadfn_t readfn, void *dlpriv, xbv1_t *fwinfo,
symbol_t *slut, u32 slut_len);
void* xbv_to_patch(card_t *card, fwreadfn_t readfn, const void *fw_buf, const xbv1_t *fwinfo,
u32 *size);
#endif /* __XBV_H__ */

View file

@ -1,18 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_HOSTIO_H
#define CSR_WIFI_HOSTIO_H
#define CSR_WIFI_HOSTIO_PRIM 0x0453
#endif /* CSR_WIFI_HOSTIO_H */

View file

@ -1,103 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_LIB_H__
#define CSR_WIFI_LIB_H__
#include "csr_wifi_fsm_event.h"
/*----------------------------------------------------------------------------*
* CsrWifiFsmEventInit
*
* DESCRIPTION
* Macro to initialise the members of a CsrWifiFsmEvent.
*----------------------------------------------------------------------------*/
#define CsrWifiFsmEventInit(evt, p_primtype, p_msgtype, p_dst, p_src) \
(evt)->primtype = p_primtype; \
(evt)->type = p_msgtype; \
(evt)->destination = p_dst; \
(evt)->source = p_src
/*----------------------------------------------------------------------------*
* CsrWifiEvent_struct
*
* DESCRIPTION
* Generic message creator.
* Allocates and fills in a message with the signature CsrWifiEvent
*
*----------------------------------------------------------------------------*/
CsrWifiFsmEvent* CsrWifiEvent_struct(u16 primtype, u16 msgtype, CsrSchedQid dst, CsrSchedQid src);
typedef struct
{
CsrWifiFsmEvent common;
u8 value;
} CsrWifiEventCsrUint8;
/*----------------------------------------------------------------------------*
* CsrWifiEventCsrUint8_struct
*
* DESCRIPTION
* Generic message creator.
* Allocates and fills in a message with the signature CsrWifiEventCsrUint8
*
*----------------------------------------------------------------------------*/
CsrWifiEventCsrUint8* CsrWifiEventCsrUint8_struct(u16 primtype, u16 msgtype, CsrSchedQid dst, CsrSchedQid src, u8 value);
typedef struct
{
CsrWifiFsmEvent common;
u16 value;
} CsrWifiEventCsrUint16;
/*----------------------------------------------------------------------------*
* CsrWifiEventCsrUint16_struct
*
* DESCRIPTION
* Generic message creator.
* Allocates and fills in a message with the signature CsrWifiEventCsrUint16
*
*----------------------------------------------------------------------------*/
CsrWifiEventCsrUint16* CsrWifiEventCsrUint16_struct(u16 primtype, u16 msgtype, CsrSchedQid dst, CsrSchedQid src, u16 value);
typedef struct
{
CsrWifiFsmEvent common;
u32 value;
} CsrWifiEventCsrUint32;
/*----------------------------------------------------------------------------*
* CsrWifiEventCsrUint32_struct
*
* DESCRIPTION
* Generic message creator.
* Allocates and fills in a message with the signature CsrWifiEventCsrUint32
*
*----------------------------------------------------------------------------*/
CsrWifiEventCsrUint32* CsrWifiEventCsrUint32_struct(u16 primtype, u16 msgtype, CsrSchedQid dst, CsrSchedQid src, u32 value);
typedef struct
{
CsrWifiFsmEvent common;
u16 value16;
u8 value8;
} CsrWifiEventCsrUint16CsrUint8;
/*----------------------------------------------------------------------------*
* CsrWifiEventCsrUint16CsrUint8_struct
*
* DESCRIPTION
* Generic message creator.
* Allocates and fills in a message with the signature CsrWifiEventCsrUint16CsrUint8
*
*----------------------------------------------------------------------------*/
CsrWifiEventCsrUint16CsrUint8* CsrWifiEventCsrUint16CsrUint8_struct(u16 primtype, u16 msgtype, CsrSchedQid dst, CsrSchedQid src, u16 value16, u8 value8);
#endif /* CSR_WIFI_LIB_H__ */

View file

@ -1,49 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_MSGCONV_H__
#define CSR_WIFI_MSGCONV_H__
#include "csr_prim_defs.h"
#include "csr_sched.h"
void CsrUint16SerBigEndian(u8 *ptr, size_t *len, u16 v);
void CsrUint24SerBigEndian(u8 *ptr, size_t *len, u32 v);
void CsrUint32SerBigEndian(u8 *ptr, size_t *len, u32 v);
void CsrUint16DesBigEndian(u16 *v, u8 *buffer, size_t *offset);
void CsrUint24DesBigEndian(u32 *v, u8 *buffer, size_t *offset);
void CsrUint32DesBigEndian(u32 *v, u8 *buffer, size_t *offset);
void CsrUint24Ser(u8 *ptr, size_t *len, u32 v);
void CsrUint24Des(u32 *v, u8 *buffer, size_t *offset);
size_t CsrWifiEventSizeof(void *msg);
u8* CsrWifiEventSer(u8 *ptr, size_t *len, void *msg);
void* CsrWifiEventDes(u8 *buffer, size_t length);
size_t CsrWifiEventCsrUint8Sizeof(void *msg);
u8* CsrWifiEventCsrUint8Ser(u8 *ptr, size_t *len, void *msg);
void* CsrWifiEventCsrUint8Des(u8 *buffer, size_t length);
size_t CsrWifiEventCsrUint16Sizeof(void *msg);
u8* CsrWifiEventCsrUint16Ser(u8 *ptr, size_t *len, void *msg);
void* CsrWifiEventCsrUint16Des(u8 *buffer, size_t length);
size_t CsrWifiEventCsrUint32Sizeof(void *msg);
u8* CsrWifiEventCsrUint32Ser(u8 *ptr, size_t *len, void *msg);
void* CsrWifiEventCsrUint32Des(u8 *buffer, size_t length);
size_t CsrWifiEventCsrUint16CsrUint8Sizeof(void *msg);
u8* CsrWifiEventCsrUint16CsrUint8Ser(u8 *ptr, size_t *len, void *msg);
void* CsrWifiEventCsrUint16CsrUint8Des(u8 *buffer, size_t length);
#endif /* CSR_WIFI_MSGCONV_H__ */

View file

@ -1,90 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include "csr_msgconv.h"
#include "csr_macro.h"
#ifdef CSR_WIFI_NME_ENABLE
#ifdef CSR_WIFI_AP_ENABLE
#ifdef CSR_LOG_ENABLE
#include "csr_log.h"
#endif
#ifndef EXCLUDE_CSR_WIFI_NME_AP_MODULE
#include "csr_wifi_nme_ap_serialize.h"
#include "csr_wifi_nme_ap_prim.h"
static CsrMsgConvMsgEntry csrwifinmeap_conv_lut[] = {
{ CSR_WIFI_NME_AP_CONFIG_SET_REQ, CsrWifiNmeApConfigSetReqSizeof, CsrWifiNmeApConfigSetReqSer, CsrWifiNmeApConfigSetReqDes, CsrWifiNmeApConfigSetReqSerFree },
{ CSR_WIFI_NME_AP_WPS_REGISTER_REQ, CsrWifiNmeApWpsRegisterReqSizeof, CsrWifiNmeApWpsRegisterReqSer, CsrWifiNmeApWpsRegisterReqDes, CsrWifiNmeApWpsRegisterReqSerFree },
{ CSR_WIFI_NME_AP_START_REQ, CsrWifiNmeApStartReqSizeof, CsrWifiNmeApStartReqSer, CsrWifiNmeApStartReqDes, CsrWifiNmeApStartReqSerFree },
{ CSR_WIFI_NME_AP_STOP_REQ, CsrWifiNmeApStopReqSizeof, CsrWifiNmeApStopReqSer, CsrWifiNmeApStopReqDes, CsrWifiNmeApStopReqSerFree },
{ CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_REQ, CsrWifiNmeApWmmParamUpdateReqSizeof, CsrWifiNmeApWmmParamUpdateReqSer, CsrWifiNmeApWmmParamUpdateReqDes, CsrWifiNmeApWmmParamUpdateReqSerFree },
{ CSR_WIFI_NME_AP_STA_REMOVE_REQ, CsrWifiNmeApStaRemoveReqSizeof, CsrWifiNmeApStaRemoveReqSer, CsrWifiNmeApStaRemoveReqDes, CsrWifiNmeApStaRemoveReqSerFree },
{ CSR_WIFI_NME_AP_CONFIG_SET_CFM, CsrWifiNmeApConfigSetCfmSizeof, CsrWifiNmeApConfigSetCfmSer, CsrWifiNmeApConfigSetCfmDes, CsrWifiNmeApConfigSetCfmSerFree },
{ CSR_WIFI_NME_AP_WPS_REGISTER_CFM, CsrWifiNmeApWpsRegisterCfmSizeof, CsrWifiNmeApWpsRegisterCfmSer, CsrWifiNmeApWpsRegisterCfmDes, CsrWifiNmeApWpsRegisterCfmSerFree },
{ CSR_WIFI_NME_AP_START_CFM, CsrWifiNmeApStartCfmSizeof, CsrWifiNmeApStartCfmSer, CsrWifiNmeApStartCfmDes, CsrWifiNmeApStartCfmSerFree },
{ CSR_WIFI_NME_AP_STOP_CFM, CsrWifiNmeApStopCfmSizeof, CsrWifiNmeApStopCfmSer, CsrWifiNmeApStopCfmDes, CsrWifiNmeApStopCfmSerFree },
{ CSR_WIFI_NME_AP_STOP_IND, CsrWifiNmeApStopIndSizeof, CsrWifiNmeApStopIndSer, CsrWifiNmeApStopIndDes, CsrWifiNmeApStopIndSerFree },
{ CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_CFM, CsrWifiNmeApWmmParamUpdateCfmSizeof, CsrWifiNmeApWmmParamUpdateCfmSer, CsrWifiNmeApWmmParamUpdateCfmDes, CsrWifiNmeApWmmParamUpdateCfmSerFree },
{ CSR_WIFI_NME_AP_STATION_IND, CsrWifiNmeApStationIndSizeof, CsrWifiNmeApStationIndSer, CsrWifiNmeApStationIndDes, CsrWifiNmeApStationIndSerFree },
{ 0, NULL, NULL, NULL, NULL },
};
CsrMsgConvMsgEntry* CsrWifiNmeApConverterLookup(CsrMsgConvMsgEntry *ce, u16 msgType)
{
if (msgType & CSR_PRIM_UPSTREAM)
{
u16 idx = (msgType & ~CSR_PRIM_UPSTREAM) + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_COUNT;
if (idx < (CSR_WIFI_NME_AP_PRIM_UPSTREAM_COUNT + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_COUNT) &&
csrwifinmeap_conv_lut[idx].msgType == msgType)
{
return &csrwifinmeap_conv_lut[idx];
}
}
else
{
if (msgType < CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_COUNT &&
csrwifinmeap_conv_lut[msgType].msgType == msgType)
{
return &csrwifinmeap_conv_lut[msgType];
}
}
return NULL;
}
void CsrWifiNmeApConverterInit(void)
{
CsrMsgConvInsert(CSR_WIFI_NME_AP_PRIM, csrwifinmeap_conv_lut);
CsrMsgConvCustomLookupRegister(CSR_WIFI_NME_AP_PRIM, CsrWifiNmeApConverterLookup);
}
#ifdef CSR_LOG_ENABLE
static const CsrLogPrimitiveInformation csrwifinmeap_conv_info = {
CSR_WIFI_NME_AP_PRIM,
(char *)"CSR_WIFI_NME_AP_PRIM",
csrwifinmeap_conv_lut
};
const CsrLogPrimitiveInformation* CsrWifiNmeApTechInfoGet(void)
{
return &csrwifinmeap_conv_info;
}
#endif /* CSR_LOG_ENABLE */
#endif /* EXCLUDE_CSR_WIFI_NME_AP_MODULE */
#endif /* CSR_WIFI_NME_ENABLE */
#endif /* CSR_WIFI_AP_ENABLE */

View file

@ -1,41 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_NME_AP_CONVERTER_INIT_H__
#define CSR_WIFI_NME_AP_CONVERTER_INIT_H__
#ifndef CSR_WIFI_NME_ENABLE
#error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_converter_init.h
#endif
#ifndef CSR_WIFI_AP_ENABLE
#error CSR_WIFI_AP_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_converter_init.h
#endif
#ifndef EXCLUDE_CSR_WIFI_NME_AP_MODULE
#include "csr_msgconv.h"
#ifdef CSR_LOG_ENABLE
#include "csr_log.h"
extern const CsrLogPrimitiveInformation* CsrWifiNmeApTechInfoGet(void);
#endif /* CSR_LOG_ENABLE */
extern void CsrWifiNmeApConverterInit(void);
#else /* EXCLUDE_CSR_WIFI_NME_AP_MODULE */
#define CsrWifiNmeApConverterInit()
#endif /* EXCLUDE_CSR_WIFI_NME_AP_MODULE */
#endif /* CSR_WIFI_NME_AP_CONVERTER_INIT_H__ */

View file

@ -1,84 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include <linux/slab.h>
#include "csr_wifi_nme_ap_prim.h"
#include "csr_wifi_nme_ap_lib.h"
/*----------------------------------------------------------------------------*
* NAME
* CsrWifiNmeApFreeDownstreamMessageContents
*
* DESCRIPTION
*
*
* PARAMETERS
* eventClass: only the value CSR_WIFI_NME_AP_PRIM will be handled
* message: the message to free
*----------------------------------------------------------------------------*/
void CsrWifiNmeApFreeDownstreamMessageContents(u16 eventClass, void *message)
{
if (eventClass != CSR_WIFI_NME_AP_PRIM)
{
return;
}
if (NULL == message)
{
return;
}
switch (*((CsrWifiNmeApPrim *) message))
{
case CSR_WIFI_NME_AP_CONFIG_SET_REQ:
{
CsrWifiNmeApConfigSetReq *p = (CsrWifiNmeApConfigSetReq *)message;
kfree(p->apMacConfig.macAddressList);
p->apMacConfig.macAddressList = NULL;
break;
}
case CSR_WIFI_NME_AP_START_REQ:
{
CsrWifiNmeApStartReq *p = (CsrWifiNmeApStartReq *)message;
switch (p->apCredentials.authType)
{
case CSR_WIFI_SME_AP_AUTH_TYPE_PERSONAL:
switch (p->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase)
{
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE:
kfree(p->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase);
p->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase = NULL;
break;
default:
break;
}
break;
default:
break;
}
{
u16 i3;
for (i3 = 0; i3 < p->p2pGoParam.operatingChanList.channelEntryListCount; i3++)
{
kfree(p->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel);
p->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel = NULL;
}
}
kfree(p->p2pGoParam.operatingChanList.channelEntryList);
p->p2pGoParam.operatingChanList.channelEntryList = NULL;
break;
}
default:
break;
}
}

View file

@ -1,39 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include "csr_wifi_nme_ap_prim.h"
#include "csr_wifi_nme_ap_lib.h"
/*----------------------------------------------------------------------------*
* NAME
* CsrWifiNmeApFreeUpstreamMessageContents
*
* DESCRIPTION
*
*
* PARAMETERS
* eventClass: only the value CSR_WIFI_NME_AP_PRIM will be handled
* message: the message to free
*----------------------------------------------------------------------------*/
void CsrWifiNmeApFreeUpstreamMessageContents(u16 eventClass, void *message)
{
if (eventClass != CSR_WIFI_NME_AP_PRIM)
{
return;
}
if (NULL == message)
{
return;
}
}

View file

@ -1,495 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_NME_AP_LIB_H__
#define CSR_WIFI_NME_AP_LIB_H__
#include "csr_sched.h"
#include "csr_macro.h"
#include "csr_msg_transport.h"
#include "csr_wifi_lib.h"
#include "csr_wifi_nme_ap_prim.h"
#include "csr_wifi_nme_task.h"
#ifndef CSR_WIFI_NME_ENABLE
#error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_lib.h
#endif
#ifndef CSR_WIFI_AP_ENABLE
#error CSR_WIFI_AP_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_lib.h
#endif
/*----------------------------------------------------------------------------*
* CsrWifiNmeApFreeUpstreamMessageContents
*
* DESCRIPTION
* Free the allocated memory in a CSR_WIFI_NME_AP upstream message. Does not
* free the message itself, and can only be used for upstream messages.
*
* PARAMETERS
* Deallocates the resources in a CSR_WIFI_NME_AP upstream message
*----------------------------------------------------------------------------*/
void CsrWifiNmeApFreeUpstreamMessageContents(u16 eventClass, void *message);
/*----------------------------------------------------------------------------*
* CsrWifiNmeApFreeDownstreamMessageContents
*
* DESCRIPTION
* Free the allocated memory in a CSR_WIFI_NME_AP downstream message. Does not
* free the message itself, and can only be used for downstream messages.
*
* PARAMETERS
* Deallocates the resources in a CSR_WIFI_NME_AP downstream message
*----------------------------------------------------------------------------*/
void CsrWifiNmeApFreeDownstreamMessageContents(u16 eventClass, void *message);
/*******************************************************************************
NAME
CsrWifiNmeApConfigSetReqSend
DESCRIPTION
This primitive passes AP configuration info for NME. This can be sent at
any time but will be acted upon when the AP is started again. This
information is common to both P2P GO and AP
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
apConfig - AP configuration for the NME.
apMacConfig - MAC configuration to be acted on when
CSR_WIFI_NME_AP_START.request is sent.
*******************************************************************************/
#define CsrWifiNmeApConfigSetReqCreate(msg__, dst__, src__, apConfig__, apMacConfig__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApConfigSetReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_CONFIG_SET_REQ, dst__, src__); \
msg__->apConfig = (apConfig__); \
msg__->apMacConfig = (apMacConfig__);
#define CsrWifiNmeApConfigSetReqSendTo(dst__, src__, apConfig__, apMacConfig__) \
{ \
CsrWifiNmeApConfigSetReq *msg__; \
CsrWifiNmeApConfigSetReqCreate(msg__, dst__, src__, apConfig__, apMacConfig__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApConfigSetReqSend(src__, apConfig__, apMacConfig__) \
CsrWifiNmeApConfigSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, apConfig__, apMacConfig__)
/*******************************************************************************
NAME
CsrWifiNmeApConfigSetCfmSend
DESCRIPTION
This primitive reports the result of the request.
PARAMETERS
queue - Destination Task Queue
status - Status of the request.
*******************************************************************************/
#define CsrWifiNmeApConfigSetCfmCreate(msg__, dst__, src__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApConfigSetCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_CONFIG_SET_CFM, dst__, src__); \
msg__->status = (status__);
#define CsrWifiNmeApConfigSetCfmSendTo(dst__, src__, status__) \
{ \
CsrWifiNmeApConfigSetCfm *msg__; \
CsrWifiNmeApConfigSetCfmCreate(msg__, dst__, src__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApConfigSetCfmSend(dst__, status__) \
CsrWifiNmeApConfigSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
/*******************************************************************************
NAME
CsrWifiNmeApStaRemoveReqSend
DESCRIPTION
This primitive disconnects a connected station. If keepBlocking is set to
TRUE, the station with the specified MAC address is not allowed to
connect. If the requested station is not already connected,it may be
blocked based on keepBlocking parameter.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an interface
staMacAddress - Mac Address of the station to be disconnected or blocked
keepBlocking - If TRUE, the station is blocked. If FALSE and the station is
connected, disconnect the station. If FALSE and the station
is not connected, no action is taken.
*******************************************************************************/
#define CsrWifiNmeApStaRemoveReqCreate(msg__, dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApStaRemoveReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STA_REMOVE_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->staMacAddress = (staMacAddress__); \
msg__->keepBlocking = (keepBlocking__);
#define CsrWifiNmeApStaRemoveReqSendTo(dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__) \
{ \
CsrWifiNmeApStaRemoveReq *msg__; \
CsrWifiNmeApStaRemoveReqCreate(msg__, dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApStaRemoveReqSend(src__, interfaceTag__, staMacAddress__, keepBlocking__) \
CsrWifiNmeApStaRemoveReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, staMacAddress__, keepBlocking__)
/*******************************************************************************
NAME
CsrWifiNmeApStartReqSend
DESCRIPTION
This primitive requests NME to started the AP operation.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface identifier; unique identifier of an interface
apType - AP Type specifies the Legacy AP or P2P GO operation
cloakSsid - Indicates whether the SSID should be cloaked (hidden and
not broadcast in beacon) or not
ssid - Service Set Identifier
ifIndex - Radio interface
channel - Channel number of the channel to use
apCredentials - Security credential configuration.
maxConnections - Maximum number of stations/P2P clients allowed
p2pGoParam - P2P specific GO parameters.
wpsEnabled - Indicates whether WPS should be enabled or not
*******************************************************************************/
#define CsrWifiNmeApStartReqCreate(msg__, dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApStartReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_START_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->apType = (apType__); \
msg__->cloakSsid = (cloakSsid__); \
msg__->ssid = (ssid__); \
msg__->ifIndex = (ifIndex__); \
msg__->channel = (channel__); \
msg__->apCredentials = (apCredentials__); \
msg__->maxConnections = (maxConnections__); \
msg__->p2pGoParam = (p2pGoParam__); \
msg__->wpsEnabled = (wpsEnabled__);
#define CsrWifiNmeApStartReqSendTo(dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \
{ \
CsrWifiNmeApStartReq *msg__; \
CsrWifiNmeApStartReqCreate(msg__, dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApStartReqSend(src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \
CsrWifiNmeApStartReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__)
/*******************************************************************************
NAME
CsrWifiNmeApStartCfmSend
DESCRIPTION
This primitive reports the result of CSR_WIFI_NME_AP_START.request.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface identifier; unique identifier of an interface
status - Status of the request.
ssid - Service Set Identifier
*******************************************************************************/
#define CsrWifiNmeApStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, ssid__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApStartCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_START_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); \
msg__->ssid = (ssid__);
#define CsrWifiNmeApStartCfmSendTo(dst__, src__, interfaceTag__, status__, ssid__) \
{ \
CsrWifiNmeApStartCfm *msg__; \
CsrWifiNmeApStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, ssid__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApStartCfmSend(dst__, interfaceTag__, status__, ssid__) \
CsrWifiNmeApStartCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, ssid__)
/*******************************************************************************
NAME
CsrWifiNmeApStationIndSend
DESCRIPTION
This primitive indicates that a station has joined or a previously joined
station has left the BSS/group
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
mediaStatus - Indicates whether the station is connected or
disconnected
peerMacAddress - MAC address of the station
peerDeviceAddress - P2P Device Address
*******************************************************************************/
#define CsrWifiNmeApStationIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApStationInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STATION_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->mediaStatus = (mediaStatus__); \
msg__->peerMacAddress = (peerMacAddress__); \
msg__->peerDeviceAddress = (peerDeviceAddress__);
#define CsrWifiNmeApStationIndSendTo(dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \
{ \
CsrWifiNmeApStationInd *msg__; \
CsrWifiNmeApStationIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApStationIndSend(dst__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \
CsrWifiNmeApStationIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__)
/*******************************************************************************
NAME
CsrWifiNmeApStopReqSend
DESCRIPTION
This primitive requests NME to stop the AP operation.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface identifier; unique identifier of an interface
*******************************************************************************/
#define CsrWifiNmeApStopReqCreate(msg__, dst__, src__, interfaceTag__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApStopReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__);
#define CsrWifiNmeApStopReqSendTo(dst__, src__, interfaceTag__) \
{ \
CsrWifiNmeApStopReq *msg__; \
CsrWifiNmeApStopReqCreate(msg__, dst__, src__, interfaceTag__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApStopReqSend(src__, interfaceTag__) \
CsrWifiNmeApStopReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
/*******************************************************************************
NAME
CsrWifiNmeApStopIndSend
DESCRIPTION
Indicates that AP operation had stopped because of some unrecoverable
error after AP operation was started successfully. NME sends this signal
after failing to restart the AP operation internally following an error
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
apType - Reports AP Type (P2PGO or AP)
status - Error Status
*******************************************************************************/
#define CsrWifiNmeApStopIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApStopInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->apType = (apType__); \
msg__->status = (status__);
#define CsrWifiNmeApStopIndSendTo(dst__, src__, interfaceTag__, apType__, status__) \
{ \
CsrWifiNmeApStopInd *msg__; \
CsrWifiNmeApStopIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApStopIndSend(dst__, interfaceTag__, apType__, status__) \
CsrWifiNmeApStopIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, apType__, status__)
/*******************************************************************************
NAME
CsrWifiNmeApStopCfmSend
DESCRIPTION
This primitive confirms that the AP operation is stopped. NME shall send
this primitive in response to the request even if AP operation has
already been stopped
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface identifier; unique identifier of an interface
status - Status of the request.
*******************************************************************************/
#define CsrWifiNmeApStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApStopCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__);
#define CsrWifiNmeApStopCfmSendTo(dst__, src__, interfaceTag__, status__) \
{ \
CsrWifiNmeApStopCfm *msg__; \
CsrWifiNmeApStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApStopCfmSend(dst__, interfaceTag__, status__) \
CsrWifiNmeApStopCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
/*******************************************************************************
NAME
CsrWifiNmeApWmmParamUpdateReqSend
DESCRIPTION
Application uses this primitive to update the WMM parameters
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
wmmApParams - WMM Access point parameters per access category. The array
index corresponds to the ACI
wmmApBcParams - WMM station parameters per access category to be advertised
in the beacons and probe response The array index
corresponds to the ACI
*******************************************************************************/
#define CsrWifiNmeApWmmParamUpdateReqCreate(msg__, dst__, src__, wmmApParams__, wmmApBcParams__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_REQ, dst__, src__); \
memcpy(msg__->wmmApParams, (wmmApParams__), sizeof(CsrWifiSmeWmmAcParams) * 4); \
memcpy(msg__->wmmApBcParams, (wmmApBcParams__), sizeof(CsrWifiSmeWmmAcParams) * 4);
#define CsrWifiNmeApWmmParamUpdateReqSendTo(dst__, src__, wmmApParams__, wmmApBcParams__) \
{ \
CsrWifiNmeApWmmParamUpdateReq *msg__; \
CsrWifiNmeApWmmParamUpdateReqCreate(msg__, dst__, src__, wmmApParams__, wmmApBcParams__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApWmmParamUpdateReqSend(src__, wmmApParams__, wmmApBcParams__) \
CsrWifiNmeApWmmParamUpdateReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, wmmApParams__, wmmApBcParams__)
/*******************************************************************************
NAME
CsrWifiNmeApWmmParamUpdateCfmSend
DESCRIPTION
A confirm for for the WMM parameters update
PARAMETERS
queue - Destination Task Queue
status - Status of the request.
*******************************************************************************/
#define CsrWifiNmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_CFM, dst__, src__); \
msg__->status = (status__);
#define CsrWifiNmeApWmmParamUpdateCfmSendTo(dst__, src__, status__) \
{ \
CsrWifiNmeApWmmParamUpdateCfm *msg__; \
CsrWifiNmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApWmmParamUpdateCfmSend(dst__, status__) \
CsrWifiNmeApWmmParamUpdateCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
/*******************************************************************************
NAME
CsrWifiNmeApWpsRegisterReqSend
DESCRIPTION
This primitive allows the NME to accept the WPS registration from an
enrollee. Such registration procedure can be cancelled by sending
CSR_WIFI_NME_WPS_CANCEL.request.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an
interface
selectedDevicePasswordId - Selected password type
selectedConfigMethod - Selected WPS configuration method type
pin - PIN value.
Relevant if selected device password ID is PIN.4
digit pin is passed by sending the pin digits in
pin[0]..pin[3] and rest of the contents filled
with '-'.
*******************************************************************************/
#define CsrWifiNmeApWpsRegisterReqCreate(msg__, dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApWpsRegisterReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WPS_REGISTER_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->selectedDevicePasswordId = (selectedDevicePasswordId__); \
msg__->selectedConfigMethod = (selectedConfigMethod__); \
memcpy(msg__->pin, (pin__), sizeof(u8) * 8);
#define CsrWifiNmeApWpsRegisterReqSendTo(dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \
{ \
CsrWifiNmeApWpsRegisterReq *msg__; \
CsrWifiNmeApWpsRegisterReqCreate(msg__, dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApWpsRegisterReqSend(src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \
CsrWifiNmeApWpsRegisterReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__)
/*******************************************************************************
NAME
CsrWifiNmeApWpsRegisterCfmSend
DESCRIPTION
This primitive reports the result of WPS procedure.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface identifier; unique identifier of an interface
status - Status of the request.
*******************************************************************************/
#define CsrWifiNmeApWpsRegisterCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeApWpsRegisterCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WPS_REGISTER_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__);
#define CsrWifiNmeApWpsRegisterCfmSendTo(dst__, src__, interfaceTag__, status__) \
{ \
CsrWifiNmeApWpsRegisterCfm *msg__; \
CsrWifiNmeApWpsRegisterCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
}
#define CsrWifiNmeApWpsRegisterCfmSend(dst__, interfaceTag__, status__) \
CsrWifiNmeApWpsRegisterCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
#endif /* CSR_WIFI_NME_AP_LIB_H__ */

View file

@ -1,494 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_NME_AP_PRIM_H__
#define CSR_WIFI_NME_AP_PRIM_H__
#include <linux/types.h>
#include "csr_prim_defs.h"
#include "csr_sched.h"
#include "csr_wifi_common.h"
#include "csr_result.h"
#include "csr_wifi_fsm_event.h"
#include "csr_wifi_sme_ap_prim.h"
#include "csr_wifi_nme_prim.h"
#ifndef CSR_WIFI_NME_ENABLE
#error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_prim.h
#endif
#ifndef CSR_WIFI_AP_ENABLE
#error CSR_WIFI_AP_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_prim.h
#endif
#define CSR_WIFI_NME_AP_PRIM (0x0426)
typedef CsrPrim CsrWifiNmeApPrim;
/*******************************************************************************
NAME
CsrWifiNmeApPersCredentialType
DESCRIPTION
NME Credential Types
VALUES
CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PSK
- Use PSK as credential.
CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE
- Use the specified passphrase as credential
*******************************************************************************/
typedef u8 CsrWifiNmeApPersCredentialType;
#define CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PSK ((CsrWifiNmeApPersCredentialType) 0x00)
#define CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE ((CsrWifiNmeApPersCredentialType) 0x01)
/*******************************************************************************
NAME
CsrWifiNmeApConfig
DESCRIPTION
Structure holding AP config data.
MEMBERS
apGroupkeyTimeout - Access point group key timeout.
apStrictGtkRekey - Access point strict GTK rekey flag. If set TRUE, the AP
shall rekey GTK every time a connected STA leaves BSS.
apGmkTimeout - Access point GMK timeout
apResponseTimeout - Response timeout
apRetransLimit - Max allowed retransmissions
*******************************************************************************/
typedef struct
{
u16 apGroupkeyTimeout;
u8 apStrictGtkRekey;
u16 apGmkTimeout;
u16 apResponseTimeout;
u8 apRetransLimit;
} CsrWifiNmeApConfig;
/*******************************************************************************
NAME
CsrWifiNmeApAuthPers
DESCRIPTION
MEMBERS
authSupport - Credential type value (as defined in the
enumeration type).
rsnCapabilities - RSN capabilities mask
wapiCapabilities - WAPI capabilities mask
pskOrPassphrase - Credential type value (as defined in the
enumeration type).
authPers_credentials - Union containing credentials which depends
on credentialType parameter.
authPers_credentialspsk -
authPers_credentialspassphrase -
*******************************************************************************/
typedef struct
{
CsrWifiSmeApAuthSupportMask authSupport;
CsrWifiSmeApRsnCapabilitiesMask rsnCapabilities;
CsrWifiSmeApWapiCapabilitiesMask wapiCapabilities;
CsrWifiNmeApPersCredentialType pskOrPassphrase;
union {
CsrWifiNmePsk psk;
CsrWifiNmePassphrase passphrase;
} authPers_credentials;
} CsrWifiNmeApAuthPers;
/*******************************************************************************
NAME
CsrWifiNmeApCredentials
DESCRIPTION
Structure containing the Credentials data.
MEMBERS
authType - Authentication type
nmeAuthType - Authentication parameters
nmeAuthTypeopenSystemEmpty -
nmeAuthTypeauthwep -
nmeAuthTypeauthTypePersonal -
*******************************************************************************/
typedef struct
{
CsrWifiSmeApAuthType authType;
union {
CsrWifiSmeEmpty openSystemEmpty;
CsrWifiSmeWepAuth authwep;
CsrWifiNmeApAuthPers authTypePersonal;
} nmeAuthType;
} CsrWifiNmeApCredentials;
/* Downstream */
#define CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_LOWEST (0x0000)
#define CSR_WIFI_NME_AP_CONFIG_SET_REQ ((CsrWifiNmeApPrim) (0x0000 + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_WPS_REGISTER_REQ ((CsrWifiNmeApPrim) (0x0001 + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_START_REQ ((CsrWifiNmeApPrim) (0x0002 + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_STOP_REQ ((CsrWifiNmeApPrim) (0x0003 + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_REQ ((CsrWifiNmeApPrim) (0x0004 + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_STA_REMOVE_REQ ((CsrWifiNmeApPrim) (0x0005 + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_HIGHEST (0x0005 + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_LOWEST)
/* Upstream */
#define CSR_WIFI_NME_AP_PRIM_UPSTREAM_LOWEST (0x0000 + CSR_PRIM_UPSTREAM)
#define CSR_WIFI_NME_AP_CONFIG_SET_CFM ((CsrWifiNmeApPrim)(0x0000 + CSR_WIFI_NME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_WPS_REGISTER_CFM ((CsrWifiNmeApPrim)(0x0001 + CSR_WIFI_NME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_START_CFM ((CsrWifiNmeApPrim)(0x0002 + CSR_WIFI_NME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_STOP_CFM ((CsrWifiNmeApPrim)(0x0003 + CSR_WIFI_NME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_STOP_IND ((CsrWifiNmeApPrim)(0x0004 + CSR_WIFI_NME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_CFM ((CsrWifiNmeApPrim)(0x0005 + CSR_WIFI_NME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_STATION_IND ((CsrWifiNmeApPrim)(0x0006 + CSR_WIFI_NME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_NME_AP_PRIM_UPSTREAM_HIGHEST (0x0006 + CSR_WIFI_NME_AP_PRIM_UPSTREAM_LOWEST)
#define CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_COUNT (CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_HIGHEST + 1 - CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_LOWEST)
#define CSR_WIFI_NME_AP_PRIM_UPSTREAM_COUNT (CSR_WIFI_NME_AP_PRIM_UPSTREAM_HIGHEST + 1 - CSR_WIFI_NME_AP_PRIM_UPSTREAM_LOWEST)
/*******************************************************************************
NAME
CsrWifiNmeApConfigSetReq
DESCRIPTION
This primitive passes AP configuration info for NME. This can be sent at
any time but will be acted upon when the AP is started again. This
information is common to both P2P GO and AP
MEMBERS
common - Common header for use with the CsrWifiFsm Module
apConfig - AP configuration for the NME.
apMacConfig - MAC configuration to be acted on when
CSR_WIFI_NME_AP_START.request is sent.
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrWifiNmeApConfig apConfig;
CsrWifiSmeApMacConfig apMacConfig;
} CsrWifiNmeApConfigSetReq;
/*******************************************************************************
NAME
CsrWifiNmeApWpsRegisterReq
DESCRIPTION
This primitive allows the NME to accept the WPS registration from an
enrollee. Such registration procedure can be cancelled by sending
CSR_WIFI_NME_WPS_CANCEL.request.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an
interface
selectedDevicePasswordId - Selected password type
selectedConfigMethod - Selected WPS configuration method type
pin - PIN value.
Relevant if selected device password ID is PIN.4
digit pin is passed by sending the pin digits in
pin[0]..pin[3] and rest of the contents filled
with '-'.
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrWifiSmeWpsDpid selectedDevicePasswordId;
CsrWifiSmeWpsConfigType selectedConfigMethod;
u8 pin[8];
} CsrWifiNmeApWpsRegisterReq;
/*******************************************************************************
NAME
CsrWifiNmeApStartReq
DESCRIPTION
This primitive requests NME to started the AP operation.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface identifier; unique identifier of an interface
apType - AP Type specifies the Legacy AP or P2P GO operation
cloakSsid - Indicates whether the SSID should be cloaked (hidden and
not broadcast in beacon) or not
ssid - Service Set Identifier
ifIndex - Radio interface
channel - Channel number of the channel to use
apCredentials - Security credential configuration.
maxConnections - Maximum number of stations/P2P clients allowed
p2pGoParam - P2P specific GO parameters.
wpsEnabled - Indicates whether WPS should be enabled or not
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrWifiSmeApType apType;
u8 cloakSsid;
CsrWifiSsid ssid;
CsrWifiSmeRadioIF ifIndex;
u8 channel;
CsrWifiNmeApCredentials apCredentials;
u8 maxConnections;
CsrWifiSmeApP2pGoConfig p2pGoParam;
u8 wpsEnabled;
} CsrWifiNmeApStartReq;
/*******************************************************************************
NAME
CsrWifiNmeApStopReq
DESCRIPTION
This primitive requests NME to stop the AP operation.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface identifier; unique identifier of an interface
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
} CsrWifiNmeApStopReq;
/*******************************************************************************
NAME
CsrWifiNmeApWmmParamUpdateReq
DESCRIPTION
Application uses this primitive to update the WMM parameters
MEMBERS
common - Common header for use with the CsrWifiFsm Module
wmmApParams - WMM Access point parameters per access category. The array
index corresponds to the ACI
wmmApBcParams - WMM station parameters per access category to be advertised
in the beacons and probe response The array index
corresponds to the ACI
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrWifiSmeWmmAcParams wmmApParams[4];
CsrWifiSmeWmmAcParams wmmApBcParams[4];
} CsrWifiNmeApWmmParamUpdateReq;
/*******************************************************************************
NAME
CsrWifiNmeApStaRemoveReq
DESCRIPTION
This primitive disconnects a connected station. If keepBlocking is set to
TRUE, the station with the specified MAC address is not allowed to
connect. If the requested station is not already connected,it may be
blocked based on keepBlocking parameter.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
staMacAddress - Mac Address of the station to be disconnected or blocked
keepBlocking - If TRUE, the station is blocked. If FALSE and the station is
connected, disconnect the station. If FALSE and the station
is not connected, no action is taken.
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrWifiMacAddress staMacAddress;
u8 keepBlocking;
} CsrWifiNmeApStaRemoveReq;
/*******************************************************************************
NAME
CsrWifiNmeApConfigSetCfm
DESCRIPTION
This primitive reports the result of the request.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
status - Status of the request.
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrResult status;
} CsrWifiNmeApConfigSetCfm;
/*******************************************************************************
NAME
CsrWifiNmeApWpsRegisterCfm
DESCRIPTION
This primitive reports the result of WPS procedure.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface identifier; unique identifier of an interface
status - Status of the request.
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrResult status;
} CsrWifiNmeApWpsRegisterCfm;
/*******************************************************************************
NAME
CsrWifiNmeApStartCfm
DESCRIPTION
This primitive reports the result of CSR_WIFI_NME_AP_START.request.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface identifier; unique identifier of an interface
status - Status of the request.
ssid - Service Set Identifier
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrResult status;
CsrWifiSsid ssid;
} CsrWifiNmeApStartCfm;
/*******************************************************************************
NAME
CsrWifiNmeApStopCfm
DESCRIPTION
This primitive confirms that the AP operation is stopped. NME shall send
this primitive in response to the request even if AP operation has
already been stopped
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface identifier; unique identifier of an interface
status - Status of the request.
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrResult status;
} CsrWifiNmeApStopCfm;
/*******************************************************************************
NAME
CsrWifiNmeApStopInd
DESCRIPTION
Indicates that AP operation had stopped because of some unrecoverable
error after AP operation was started successfully. NME sends this signal
after failing to restart the AP operation internally following an error
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
apType - Reports AP Type (P2PGO or AP)
status - Error Status
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrWifiSmeApType apType;
CsrResult status;
} CsrWifiNmeApStopInd;
/*******************************************************************************
NAME
CsrWifiNmeApWmmParamUpdateCfm
DESCRIPTION
A confirm for for the WMM parameters update
MEMBERS
common - Common header for use with the CsrWifiFsm Module
status - Status of the request.
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrResult status;
} CsrWifiNmeApWmmParamUpdateCfm;
/*******************************************************************************
NAME
CsrWifiNmeApStationInd
DESCRIPTION
This primitive indicates that a station has joined or a previously joined
station has left the BSS/group
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
mediaStatus - Indicates whether the station is connected or
disconnected
peerMacAddress - MAC address of the station
peerDeviceAddress - P2P Device Address
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrWifiSmeMediaStatus mediaStatus;
CsrWifiMacAddress peerMacAddress;
CsrWifiMacAddress peerDeviceAddress;
} CsrWifiNmeApStationInd;
#endif /* CSR_WIFI_NME_AP_PRIM_H__ */

View file

@ -1,30 +0,0 @@
/*****************************************************************************
FILE: csr_wifi_nme_sef.c
(c) Cambridge Silicon Radio Limited 2010
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include "csr_wifi_nme_ap_sef.h"
#include "unifi_priv.h"
void CsrWifiNmeApUpstreamStateHandlers(void* drvpriv, CsrWifiFsmEvent* msg)
{
switch(msg->type) {
case CSR_WIFI_NME_AP_START_CFM:
CsrWifiNmeApStartCfmHandler(drvpriv, msg);
break;
case CSR_WIFI_NME_AP_STOP_CFM:
CsrWifiNmeApStopCfmHandler(drvpriv, msg);
break;
case CSR_WIFI_NME_AP_CONFIG_SET_CFM:
CsrWifiNmeApConfigSetCfmHandler(drvpriv, msg);
break;
default:
unifi_error(drvpriv, "CsrWifiNmeApUpstreamStateHandlers: unhandled NME_AP message type 0x%.4X\n", msg->type);
break;
}
}

View file

@ -1,21 +0,0 @@
/*****************************************************************************
FILE: csr_wifi_nme_sef.h
(c) Cambridge Silicon Radio Limited 2010
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_ROUTER_SEF_CSR_WIFI_NME_H__
#define CSR_WIFI_ROUTER_SEF_CSR_WIFI_NME_H__
#include "csr_wifi_nme_prim.h"
void CsrWifiNmeApUpstreamStateHandlers(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiNmeApConfigSetCfmHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiNmeApStartCfmHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiNmeApStopCfmHandler(void* drvpriv, CsrWifiFsmEvent* msg);
#endif /* CSR_WIFI_ROUTER_SEF_CSR_WIFI_NME_H__ */

View file

@ -1,909 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include <linux/string.h>
#include <linux/slab.h>
#include "csr_msgconv.h"
#ifdef CSR_WIFI_NME_ENABLE
#ifdef CSR_WIFI_AP_ENABLE
#include "csr_wifi_nme_ap_prim.h"
#include "csr_wifi_nme_ap_serialize.h"
void CsrWifiNmeApPfree(void *ptr)
{
kfree(ptr);
}
size_t CsrWifiNmeApConfigSetReqSizeof(void *msg)
{
CsrWifiNmeApConfigSetReq *primitive = (CsrWifiNmeApConfigSetReq *) msg;
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 104) */
bufferSize += 2; /* u16 primitive->apConfig.apGroupkeyTimeout */
bufferSize += 1; /* u8 primitive->apConfig.apStrictGtkRekey */
bufferSize += 2; /* u16 primitive->apConfig.apGmkTimeout */
bufferSize += 2; /* u16 primitive->apConfig.apResponseTimeout */
bufferSize += 1; /* u8 primitive->apConfig.apRetransLimit */
bufferSize += 1; /* CsrWifiSmeApPhySupportMask primitive->apMacConfig.phySupportedBitmap */
bufferSize += 2; /* u16 primitive->apMacConfig.beaconInterval */
bufferSize += 1; /* u8 primitive->apMacConfig.dtimPeriod */
bufferSize += 2; /* u16 primitive->apMacConfig.maxListenInterval */
bufferSize += 1; /* u8 primitive->apMacConfig.supportedRatesCount */
bufferSize += 20; /* u8 primitive->apMacConfig.supportedRates[20] */
bufferSize += 1; /* CsrWifiSmePreambleType primitive->apMacConfig.preamble */
bufferSize += 1; /* u8 primitive->apMacConfig.shortSlotTimeEnabled */
bufferSize += 1; /* CsrWifiSmeCtsProtectionType primitive->apMacConfig.ctsProtectionType */
bufferSize += 1; /* u8 primitive->apMacConfig.wmmEnabled */
{
u16 i2;
for (i2 = 0; i2 < 4; i2++)
{
bufferSize += 1; /* u8 primitive->apMacConfig.wmmApParams[i2].cwMin */
bufferSize += 1; /* u8 primitive->apMacConfig.wmmApParams[i2].cwMax */
bufferSize += 1; /* u8 primitive->apMacConfig.wmmApParams[i2].aifs */
bufferSize += 2; /* u16 primitive->apMacConfig.wmmApParams[i2].txopLimit */
bufferSize += 1; /* u8 primitive->apMacConfig.wmmApParams[i2].admissionControlMandatory */
}
}
{
u16 i2;
for (i2 = 0; i2 < 4; i2++)
{
bufferSize += 1; /* u8 primitive->apMacConfig.wmmApBcParams[i2].cwMin */
bufferSize += 1; /* u8 primitive->apMacConfig.wmmApBcParams[i2].cwMax */
bufferSize += 1; /* u8 primitive->apMacConfig.wmmApBcParams[i2].aifs */
bufferSize += 2; /* u16 primitive->apMacConfig.wmmApBcParams[i2].txopLimit */
bufferSize += 1; /* u8 primitive->apMacConfig.wmmApBcParams[i2].admissionControlMandatory */
}
}
bufferSize += 1; /* CsrWifiSmeApAccessType primitive->apMacConfig.accessType */
bufferSize += 1; /* u8 primitive->apMacConfig.macAddressListCount */
{
u16 i2;
for (i2 = 0; i2 < primitive->apMacConfig.macAddressListCount; i2++)
{
bufferSize += 6; /* u8 primitive->apMacConfig.macAddressList[i2].a[6] */
}
}
bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.greenfieldSupported */
bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.shortGi20MHz */
bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.rxStbc */
bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.rifsModeAllowed */
bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.htProtection */
bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.dualCtsProtection */
return bufferSize;
}
u8* CsrWifiNmeApConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiNmeApConfigSetReq *primitive = (CsrWifiNmeApConfigSetReq *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->apConfig.apGroupkeyTimeout);
CsrUint8Ser(ptr, len, (u8) primitive->apConfig.apStrictGtkRekey);
CsrUint16Ser(ptr, len, (u16) primitive->apConfig.apGmkTimeout);
CsrUint16Ser(ptr, len, (u16) primitive->apConfig.apResponseTimeout);
CsrUint8Ser(ptr, len, (u8) primitive->apConfig.apRetransLimit);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.phySupportedBitmap);
CsrUint16Ser(ptr, len, (u16) primitive->apMacConfig.beaconInterval);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.dtimPeriod);
CsrUint16Ser(ptr, len, (u16) primitive->apMacConfig.maxListenInterval);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.supportedRatesCount);
CsrMemCpySer(ptr, len, (const void *) primitive->apMacConfig.supportedRates, ((u16) (20)));
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.preamble);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.shortSlotTimeEnabled);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.ctsProtectionType);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmEnabled);
{
u16 i2;
for (i2 = 0; i2 < 4; i2++)
{
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApParams[i2].cwMin);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApParams[i2].cwMax);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApParams[i2].aifs);
CsrUint16Ser(ptr, len, (u16) primitive->apMacConfig.wmmApParams[i2].txopLimit);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApParams[i2].admissionControlMandatory);
}
}
{
u16 i2;
for (i2 = 0; i2 < 4; i2++)
{
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApBcParams[i2].cwMin);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApBcParams[i2].cwMax);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApBcParams[i2].aifs);
CsrUint16Ser(ptr, len, (u16) primitive->apMacConfig.wmmApBcParams[i2].txopLimit);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApBcParams[i2].admissionControlMandatory);
}
}
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.accessType);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.macAddressListCount);
{
u16 i2;
for (i2 = 0; i2 < primitive->apMacConfig.macAddressListCount; i2++)
{
CsrMemCpySer(ptr, len, (const void *) primitive->apMacConfig.macAddressList[i2].a, ((u16) (6)));
}
}
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.greenfieldSupported);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.shortGi20MHz);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.rxStbc);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.rifsModeAllowed);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.htProtection);
CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.dualCtsProtection);
return(ptr);
}
void* CsrWifiNmeApConfigSetReqDes(u8 *buffer, size_t length)
{
CsrWifiNmeApConfigSetReq *primitive = kmalloc(sizeof(CsrWifiNmeApConfigSetReq), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->apConfig.apGroupkeyTimeout, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apConfig.apStrictGtkRekey, buffer, &offset);
CsrUint16Des((u16 *) &primitive->apConfig.apGmkTimeout, buffer, &offset);
CsrUint16Des((u16 *) &primitive->apConfig.apResponseTimeout, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apConfig.apRetransLimit, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.phySupportedBitmap, buffer, &offset);
CsrUint16Des((u16 *) &primitive->apMacConfig.beaconInterval, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.dtimPeriod, buffer, &offset);
CsrUint16Des((u16 *) &primitive->apMacConfig.maxListenInterval, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.supportedRatesCount, buffer, &offset);
CsrMemCpyDes(primitive->apMacConfig.supportedRates, buffer, &offset, ((u16) (20)));
CsrUint8Des((u8 *) &primitive->apMacConfig.preamble, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.shortSlotTimeEnabled, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.ctsProtectionType, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.wmmEnabled, buffer, &offset);
{
u16 i2;
for (i2 = 0; i2 < 4; i2++)
{
CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApParams[i2].cwMin, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApParams[i2].cwMax, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApParams[i2].aifs, buffer, &offset);
CsrUint16Des((u16 *) &primitive->apMacConfig.wmmApParams[i2].txopLimit, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApParams[i2].admissionControlMandatory, buffer, &offset);
}
}
{
u16 i2;
for (i2 = 0; i2 < 4; i2++)
{
CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApBcParams[i2].cwMin, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApBcParams[i2].cwMax, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApBcParams[i2].aifs, buffer, &offset);
CsrUint16Des((u16 *) &primitive->apMacConfig.wmmApBcParams[i2].txopLimit, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApBcParams[i2].admissionControlMandatory, buffer, &offset);
}
}
CsrUint8Des((u8 *) &primitive->apMacConfig.accessType, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.macAddressListCount, buffer, &offset);
primitive->apMacConfig.macAddressList = NULL;
if (primitive->apMacConfig.macAddressListCount)
{
primitive->apMacConfig.macAddressList = kmalloc(sizeof(CsrWifiMacAddress) * primitive->apMacConfig.macAddressListCount, GFP_KERNEL);
}
{
u16 i2;
for (i2 = 0; i2 < primitive->apMacConfig.macAddressListCount; i2++)
{
CsrMemCpyDes(primitive->apMacConfig.macAddressList[i2].a, buffer, &offset, ((u16) (6)));
}
}
CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.greenfieldSupported, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.shortGi20MHz, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.rxStbc, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.rifsModeAllowed, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.htProtection, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.dualCtsProtection, buffer, &offset);
return primitive;
}
void CsrWifiNmeApConfigSetReqSerFree(void *voidPrimitivePointer)
{
CsrWifiNmeApConfigSetReq *primitive = (CsrWifiNmeApConfigSetReq *) voidPrimitivePointer;
kfree(primitive->apMacConfig.macAddressList);
kfree(primitive);
}
size_t CsrWifiNmeApWpsRegisterReqSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 17) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 2; /* CsrWifiSmeWpsDpid primitive->selectedDevicePasswordId */
bufferSize += 2; /* CsrWifiSmeWpsConfigType primitive->selectedConfigMethod */
bufferSize += 8; /* u8 primitive->pin[8] */
return bufferSize;
}
u8* CsrWifiNmeApWpsRegisterReqSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiNmeApWpsRegisterReq *primitive = (CsrWifiNmeApWpsRegisterReq *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint16Ser(ptr, len, (u16) primitive->selectedDevicePasswordId);
CsrUint16Ser(ptr, len, (u16) primitive->selectedConfigMethod);
CsrMemCpySer(ptr, len, (const void *) primitive->pin, ((u16) (8)));
return(ptr);
}
void* CsrWifiNmeApWpsRegisterReqDes(u8 *buffer, size_t length)
{
CsrWifiNmeApWpsRegisterReq *primitive = kmalloc(sizeof(CsrWifiNmeApWpsRegisterReq), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint16Des((u16 *) &primitive->selectedDevicePasswordId, buffer, &offset);
CsrUint16Des((u16 *) &primitive->selectedConfigMethod, buffer, &offset);
CsrMemCpyDes(primitive->pin, buffer, &offset, ((u16) (8)));
return primitive;
}
size_t CsrWifiNmeApStartReqSizeof(void *msg)
{
CsrWifiNmeApStartReq *primitive = (CsrWifiNmeApStartReq *) msg;
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 112) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 1; /* CsrWifiSmeApType primitive->apType */
bufferSize += 1; /* u8 primitive->cloakSsid */
bufferSize += 32; /* u8 primitive->ssid.ssid[32] */
bufferSize += 1; /* u8 primitive->ssid.length */
bufferSize += 1; /* CsrWifiSmeRadioIF primitive->ifIndex */
bufferSize += 1; /* u8 primitive->channel */
bufferSize += 1; /* CsrWifiSmeApAuthType primitive->apCredentials.authType */
switch (primitive->apCredentials.authType)
{
case CSR_WIFI_SME_AP_AUTH_TYPE_OPEN_SYSTEM:
bufferSize += 1; /* u8 primitive->apCredentials.nmeAuthType.openSystemEmpty.empty */
break;
case CSR_WIFI_SME_AP_AUTH_TYPE_WEP:
bufferSize += 1; /* CsrWifiSmeWepCredentialType primitive->apCredentials.nmeAuthType.authwep.wepKeyType */
switch (primitive->apCredentials.nmeAuthType.authwep.wepKeyType)
{
case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP128:
bufferSize += 1; /* CsrWifiSmeWepAuthMode primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.wepAuthType */
bufferSize += 1; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.selectedWepKey */
bufferSize += 13; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key1[13] */
bufferSize += 13; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key2[13] */
bufferSize += 13; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key3[13] */
bufferSize += 13; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key4[13] */
break;
case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP64:
bufferSize += 1; /* CsrWifiSmeWepAuthMode primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.wepAuthType */
bufferSize += 1; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.selectedWepKey */
bufferSize += 5; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key1[5] */
bufferSize += 5; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key2[5] */
bufferSize += 5; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key3[5] */
bufferSize += 5; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key4[5] */
break;
default:
break;
}
break;
case CSR_WIFI_SME_AP_AUTH_TYPE_PERSONAL:
bufferSize += 1; /* CsrWifiSmeApAuthSupportMask primitive->apCredentials.nmeAuthType.authTypePersonal.authSupport */
bufferSize += 2; /* CsrWifiSmeApRsnCapabilitiesMask primitive->apCredentials.nmeAuthType.authTypePersonal.rsnCapabilities */
bufferSize += 2; /* CsrWifiSmeApWapiCapabilitiesMask primitive->apCredentials.nmeAuthType.authTypePersonal.wapiCapabilities */
bufferSize += 1; /* CsrWifiNmeApPersCredentialType primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase */
switch (primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase)
{
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PSK:
bufferSize += 2; /* u16 primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.encryptionMode */
bufferSize += 32; /* u8 primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.psk[32] */
break;
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE:
bufferSize += 2; /* u16 primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.encryptionMode */
bufferSize += (primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase ? strlen(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase) : 0) + 1; /* char* primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase (0 byte len + 1 for NULL Term) */
break;
default:
break;
}
break;
default:
break;
}
bufferSize += 1; /* u8 primitive->maxConnections */
bufferSize += 1; /* CsrWifiSmeP2pGroupCapabilityMask primitive->p2pGoParam.groupCapability */
bufferSize += 3; /* u8 primitive->p2pGoParam.operatingChanList.country[3] */
bufferSize += 1; /* u8 primitive->p2pGoParam.operatingChanList.channelEntryListCount */
{
u16 i3;
for (i3 = 0; i3 < primitive->p2pGoParam.operatingChanList.channelEntryListCount; i3++)
{
bufferSize += 1; /* u8 primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingClass */
bufferSize += 1; /* u8 primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount */
bufferSize += primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount; /* u8 primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel */
}
}
bufferSize += 1; /* u8 primitive->p2pGoParam.opPsEnabled */
bufferSize += 1; /* u8 primitive->p2pGoParam.ctWindow */
bufferSize += 1; /* CsrWifiSmeP2pNoaConfigMethod primitive->p2pGoParam.noaConfigMethod */
bufferSize += 1; /* u8 primitive->p2pGoParam.allowNoaWithNonP2pDevices */
bufferSize += 1; /* u8 primitive->wpsEnabled */
return bufferSize;
}
u8* CsrWifiNmeApStartReqSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiNmeApStartReq *primitive = (CsrWifiNmeApStartReq *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint8Ser(ptr, len, (u8) primitive->apType);
CsrUint8Ser(ptr, len, (u8) primitive->cloakSsid);
CsrMemCpySer(ptr, len, (const void *) primitive->ssid.ssid, ((u16) (32)));
CsrUint8Ser(ptr, len, (u8) primitive->ssid.length);
CsrUint8Ser(ptr, len, (u8) primitive->ifIndex);
CsrUint8Ser(ptr, len, (u8) primitive->channel);
CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.authType);
switch (primitive->apCredentials.authType)
{
case CSR_WIFI_SME_AP_AUTH_TYPE_OPEN_SYSTEM:
CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.openSystemEmpty.empty);
break;
case CSR_WIFI_SME_AP_AUTH_TYPE_WEP:
CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authwep.wepKeyType);
switch (primitive->apCredentials.nmeAuthType.authwep.wepKeyType)
{
case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP128:
CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.wepAuthType);
CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.selectedWepKey);
CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key1, ((u16) (13)));
CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key2, ((u16) (13)));
CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key3, ((u16) (13)));
CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key4, ((u16) (13)));
break;
case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP64:
CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.wepAuthType);
CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.selectedWepKey);
CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key1, ((u16) (5)));
CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key2, ((u16) (5)));
CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key3, ((u16) (5)));
CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key4, ((u16) (5)));
break;
default:
break;
}
break;
case CSR_WIFI_SME_AP_AUTH_TYPE_PERSONAL:
CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authTypePersonal.authSupport);
CsrUint16Ser(ptr, len, (u16) primitive->apCredentials.nmeAuthType.authTypePersonal.rsnCapabilities);
CsrUint16Ser(ptr, len, (u16) primitive->apCredentials.nmeAuthType.authTypePersonal.wapiCapabilities);
CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase);
switch (primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase)
{
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PSK:
CsrUint16Ser(ptr, len, (u16) primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.encryptionMode);
CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.psk, ((u16) (32)));
break;
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE:
CsrUint16Ser(ptr, len, (u16) primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.encryptionMode);
CsrCharStringSer(ptr, len, primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase);
break;
default:
break;
}
break;
default:
break;
}
CsrUint8Ser(ptr, len, (u8) primitive->maxConnections);
CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.groupCapability);
CsrMemCpySer(ptr, len, (const void *) primitive->p2pGoParam.operatingChanList.country, ((u16) (3)));
CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.operatingChanList.channelEntryListCount);
{
u16 i3;
for (i3 = 0; i3 < primitive->p2pGoParam.operatingChanList.channelEntryListCount; i3++)
{
CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingClass);
CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount);
if (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount)
{
CsrMemCpySer(ptr, len, (const void *) primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel, ((u16) (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount)));
}
}
}
CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.opPsEnabled);
CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.ctWindow);
CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.noaConfigMethod);
CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.allowNoaWithNonP2pDevices);
CsrUint8Ser(ptr, len, (u8) primitive->wpsEnabled);
return(ptr);
}
void* CsrWifiNmeApStartReqDes(u8 *buffer, size_t length)
{
CsrWifiNmeApStartReq *primitive = kmalloc(sizeof(CsrWifiNmeApStartReq), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apType, buffer, &offset);
CsrUint8Des((u8 *) &primitive->cloakSsid, buffer, &offset);
CsrMemCpyDes(primitive->ssid.ssid, buffer, &offset, ((u16) (32)));
CsrUint8Des((u8 *) &primitive->ssid.length, buffer, &offset);
CsrUint8Des((u8 *) &primitive->ifIndex, buffer, &offset);
CsrUint8Des((u8 *) &primitive->channel, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apCredentials.authType, buffer, &offset);
switch (primitive->apCredentials.authType)
{
case CSR_WIFI_SME_AP_AUTH_TYPE_OPEN_SYSTEM:
CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.openSystemEmpty.empty, buffer, &offset);
break;
case CSR_WIFI_SME_AP_AUTH_TYPE_WEP:
CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authwep.wepKeyType, buffer, &offset);
switch (primitive->apCredentials.nmeAuthType.authwep.wepKeyType)
{
case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP128:
CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.wepAuthType, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.selectedWepKey, buffer, &offset);
CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key1, buffer, &offset, ((u16) (13)));
CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key2, buffer, &offset, ((u16) (13)));
CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key3, buffer, &offset, ((u16) (13)));
CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key4, buffer, &offset, ((u16) (13)));
break;
case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP64:
CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.wepAuthType, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.selectedWepKey, buffer, &offset);
CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key1, buffer, &offset, ((u16) (5)));
CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key2, buffer, &offset, ((u16) (5)));
CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key3, buffer, &offset, ((u16) (5)));
CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key4, buffer, &offset, ((u16) (5)));
break;
default:
break;
}
break;
case CSR_WIFI_SME_AP_AUTH_TYPE_PERSONAL:
CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.authSupport, buffer, &offset);
CsrUint16Des((u16 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.rsnCapabilities, buffer, &offset);
CsrUint16Des((u16 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.wapiCapabilities, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase, buffer, &offset);
switch (primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase)
{
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PSK:
CsrUint16Des((u16 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.encryptionMode, buffer, &offset);
CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.psk, buffer, &offset, ((u16) (32)));
break;
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE:
CsrUint16Des((u16 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.encryptionMode, buffer, &offset);
CsrCharStringDes(&primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase, buffer, &offset);
break;
default:
break;
}
break;
default:
break;
}
CsrUint8Des((u8 *) &primitive->maxConnections, buffer, &offset);
CsrUint8Des((u8 *) &primitive->p2pGoParam.groupCapability, buffer, &offset);
CsrMemCpyDes(primitive->p2pGoParam.operatingChanList.country, buffer, &offset, ((u16) (3)));
CsrUint8Des((u8 *) &primitive->p2pGoParam.operatingChanList.channelEntryListCount, buffer, &offset);
primitive->p2pGoParam.operatingChanList.channelEntryList = NULL;
if (primitive->p2pGoParam.operatingChanList.channelEntryListCount)
{
primitive->p2pGoParam.operatingChanList.channelEntryList = kmalloc(sizeof(CsrWifiSmeApP2pOperatingChanEntry) * primitive->p2pGoParam.operatingChanList.channelEntryListCount, GFP_KERNEL);
}
{
u16 i3;
for (i3 = 0; i3 < primitive->p2pGoParam.operatingChanList.channelEntryListCount; i3++)
{
CsrUint8Des((u8 *) &primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingClass, buffer, &offset);
CsrUint8Des((u8 *) &primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount, buffer, &offset);
if (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount)
{
primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel = kmalloc(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount, GFP_KERNEL);
CsrMemCpyDes(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel, buffer, &offset, ((u16) (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount)));
}
else
{
primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel = NULL;
}
}
}
CsrUint8Des((u8 *) &primitive->p2pGoParam.opPsEnabled, buffer, &offset);
CsrUint8Des((u8 *) &primitive->p2pGoParam.ctWindow, buffer, &offset);
CsrUint8Des((u8 *) &primitive->p2pGoParam.noaConfigMethod, buffer, &offset);
CsrUint8Des((u8 *) &primitive->p2pGoParam.allowNoaWithNonP2pDevices, buffer, &offset);
CsrUint8Des((u8 *) &primitive->wpsEnabled, buffer, &offset);
return primitive;
}
void CsrWifiNmeApStartReqSerFree(void *voidPrimitivePointer)
{
CsrWifiNmeApStartReq *primitive = (CsrWifiNmeApStartReq *) voidPrimitivePointer;
switch (primitive->apCredentials.authType)
{
case CSR_WIFI_SME_AP_AUTH_TYPE_PERSONAL:
switch (primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase)
{
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE:
kfree(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase);
break;
default:
break;
}
break;
default:
break;
}
{
u16 i3;
for (i3 = 0; i3 < primitive->p2pGoParam.operatingChanList.channelEntryListCount; i3++)
{
kfree(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel);
}
}
kfree(primitive->p2pGoParam.operatingChanList.channelEntryList);
kfree(primitive);
}
size_t CsrWifiNmeApWmmParamUpdateReqSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 51) */
{
u16 i1;
for (i1 = 0; i1 < 4; i1++)
{
bufferSize += 1; /* u8 primitive->wmmApParams[i1].cwMin */
bufferSize += 1; /* u8 primitive->wmmApParams[i1].cwMax */
bufferSize += 1; /* u8 primitive->wmmApParams[i1].aifs */
bufferSize += 2; /* u16 primitive->wmmApParams[i1].txopLimit */
bufferSize += 1; /* u8 primitive->wmmApParams[i1].admissionControlMandatory */
}
}
{
u16 i1;
for (i1 = 0; i1 < 4; i1++)
{
bufferSize += 1; /* u8 primitive->wmmApBcParams[i1].cwMin */
bufferSize += 1; /* u8 primitive->wmmApBcParams[i1].cwMax */
bufferSize += 1; /* u8 primitive->wmmApBcParams[i1].aifs */
bufferSize += 2; /* u16 primitive->wmmApBcParams[i1].txopLimit */
bufferSize += 1; /* u8 primitive->wmmApBcParams[i1].admissionControlMandatory */
}
}
return bufferSize;
}
u8* CsrWifiNmeApWmmParamUpdateReqSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiNmeApWmmParamUpdateReq *primitive = (CsrWifiNmeApWmmParamUpdateReq *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
{
u16 i1;
for (i1 = 0; i1 < 4; i1++)
{
CsrUint8Ser(ptr, len, (u8) primitive->wmmApParams[i1].cwMin);
CsrUint8Ser(ptr, len, (u8) primitive->wmmApParams[i1].cwMax);
CsrUint8Ser(ptr, len, (u8) primitive->wmmApParams[i1].aifs);
CsrUint16Ser(ptr, len, (u16) primitive->wmmApParams[i1].txopLimit);
CsrUint8Ser(ptr, len, (u8) primitive->wmmApParams[i1].admissionControlMandatory);
}
}
{
u16 i1;
for (i1 = 0; i1 < 4; i1++)
{
CsrUint8Ser(ptr, len, (u8) primitive->wmmApBcParams[i1].cwMin);
CsrUint8Ser(ptr, len, (u8) primitive->wmmApBcParams[i1].cwMax);
CsrUint8Ser(ptr, len, (u8) primitive->wmmApBcParams[i1].aifs);
CsrUint16Ser(ptr, len, (u16) primitive->wmmApBcParams[i1].txopLimit);
CsrUint8Ser(ptr, len, (u8) primitive->wmmApBcParams[i1].admissionControlMandatory);
}
}
return(ptr);
}
void* CsrWifiNmeApWmmParamUpdateReqDes(u8 *buffer, size_t length)
{
CsrWifiNmeApWmmParamUpdateReq *primitive = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateReq), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
{
u16 i1;
for (i1 = 0; i1 < 4; i1++)
{
CsrUint8Des((u8 *) &primitive->wmmApParams[i1].cwMin, buffer, &offset);
CsrUint8Des((u8 *) &primitive->wmmApParams[i1].cwMax, buffer, &offset);
CsrUint8Des((u8 *) &primitive->wmmApParams[i1].aifs, buffer, &offset);
CsrUint16Des((u16 *) &primitive->wmmApParams[i1].txopLimit, buffer, &offset);
CsrUint8Des((u8 *) &primitive->wmmApParams[i1].admissionControlMandatory, buffer, &offset);
}
}
{
u16 i1;
for (i1 = 0; i1 < 4; i1++)
{
CsrUint8Des((u8 *) &primitive->wmmApBcParams[i1].cwMin, buffer, &offset);
CsrUint8Des((u8 *) &primitive->wmmApBcParams[i1].cwMax, buffer, &offset);
CsrUint8Des((u8 *) &primitive->wmmApBcParams[i1].aifs, buffer, &offset);
CsrUint16Des((u16 *) &primitive->wmmApBcParams[i1].txopLimit, buffer, &offset);
CsrUint8Des((u8 *) &primitive->wmmApBcParams[i1].admissionControlMandatory, buffer, &offset);
}
}
return primitive;
}
size_t CsrWifiNmeApStaRemoveReqSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 12) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 6; /* u8 primitive->staMacAddress.a[6] */
bufferSize += 1; /* u8 primitive->keepBlocking */
return bufferSize;
}
u8* CsrWifiNmeApStaRemoveReqSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiNmeApStaRemoveReq *primitive = (CsrWifiNmeApStaRemoveReq *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrMemCpySer(ptr, len, (const void *) primitive->staMacAddress.a, ((u16) (6)));
CsrUint8Ser(ptr, len, (u8) primitive->keepBlocking);
return(ptr);
}
void* CsrWifiNmeApStaRemoveReqDes(u8 *buffer, size_t length)
{
CsrWifiNmeApStaRemoveReq *primitive = kmalloc(sizeof(CsrWifiNmeApStaRemoveReq), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrMemCpyDes(primitive->staMacAddress.a, buffer, &offset, ((u16) (6)));
CsrUint8Des((u8 *) &primitive->keepBlocking, buffer, &offset);
return primitive;
}
size_t CsrWifiNmeApWpsRegisterCfmSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 2; /* CsrResult primitive->status */
return bufferSize;
}
u8* CsrWifiNmeApWpsRegisterCfmSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiNmeApWpsRegisterCfm *primitive = (CsrWifiNmeApWpsRegisterCfm *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint16Ser(ptr, len, (u16) primitive->status);
return(ptr);
}
void* CsrWifiNmeApWpsRegisterCfmDes(u8 *buffer, size_t length)
{
CsrWifiNmeApWpsRegisterCfm *primitive = kmalloc(sizeof(CsrWifiNmeApWpsRegisterCfm), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
return primitive;
}
size_t CsrWifiNmeApStartCfmSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 40) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 2; /* CsrResult primitive->status */
bufferSize += 32; /* u8 primitive->ssid.ssid[32] */
bufferSize += 1; /* u8 primitive->ssid.length */
return bufferSize;
}
u8* CsrWifiNmeApStartCfmSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiNmeApStartCfm *primitive = (CsrWifiNmeApStartCfm *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint16Ser(ptr, len, (u16) primitive->status);
CsrMemCpySer(ptr, len, (const void *) primitive->ssid.ssid, ((u16) (32)));
CsrUint8Ser(ptr, len, (u8) primitive->ssid.length);
return(ptr);
}
void* CsrWifiNmeApStartCfmDes(u8 *buffer, size_t length)
{
CsrWifiNmeApStartCfm *primitive = kmalloc(sizeof(CsrWifiNmeApStartCfm), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
CsrMemCpyDes(primitive->ssid.ssid, buffer, &offset, ((u16) (32)));
CsrUint8Des((u8 *) &primitive->ssid.length, buffer, &offset);
return primitive;
}
size_t CsrWifiNmeApStopCfmSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 2; /* CsrResult primitive->status */
return bufferSize;
}
u8* CsrWifiNmeApStopCfmSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiNmeApStopCfm *primitive = (CsrWifiNmeApStopCfm *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint16Ser(ptr, len, (u16) primitive->status);
return(ptr);
}
void* CsrWifiNmeApStopCfmDes(u8 *buffer, size_t length)
{
CsrWifiNmeApStopCfm *primitive = kmalloc(sizeof(CsrWifiNmeApStopCfm), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
return primitive;
}
size_t CsrWifiNmeApStopIndSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 1; /* CsrWifiSmeApType primitive->apType */
bufferSize += 2; /* CsrResult primitive->status */
return bufferSize;
}
u8* CsrWifiNmeApStopIndSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiNmeApStopInd *primitive = (CsrWifiNmeApStopInd *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint8Ser(ptr, len, (u8) primitive->apType);
CsrUint16Ser(ptr, len, (u16) primitive->status);
return(ptr);
}
void* CsrWifiNmeApStopIndDes(u8 *buffer, size_t length)
{
CsrWifiNmeApStopInd *primitive = kmalloc(sizeof(CsrWifiNmeApStopInd), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint8Des((u8 *) &primitive->apType, buffer, &offset);
CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
return primitive;
}
size_t CsrWifiNmeApStationIndSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 18) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 1; /* CsrWifiSmeMediaStatus primitive->mediaStatus */
bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */
bufferSize += 6; /* u8 primitive->peerDeviceAddress.a[6] */
return bufferSize;
}
u8* CsrWifiNmeApStationIndSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiNmeApStationInd *primitive = (CsrWifiNmeApStationInd *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint8Ser(ptr, len, (u8) primitive->mediaStatus);
CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6)));
CsrMemCpySer(ptr, len, (const void *) primitive->peerDeviceAddress.a, ((u16) (6)));
return(ptr);
}
void* CsrWifiNmeApStationIndDes(u8 *buffer, size_t length)
{
CsrWifiNmeApStationInd *primitive = kmalloc(sizeof(CsrWifiNmeApStationInd), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint8Des((u8 *) &primitive->mediaStatus, buffer, &offset);
CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6)));
CsrMemCpyDes(primitive->peerDeviceAddress.a, buffer, &offset, ((u16) (6)));
return primitive;
}
#endif /* CSR_WIFI_NME_ENABLE */
#endif /* CSR_WIFI_AP_ENABLE */

View file

@ -1,94 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_NME_AP_SERIALIZE_H__
#define CSR_WIFI_NME_AP_SERIALIZE_H__
#include "csr_wifi_msgconv.h"
#include "csr_wifi_nme_ap_prim.h"
#ifndef CSR_WIFI_NME_ENABLE
#error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_serialize.h
#endif
#ifndef CSR_WIFI_AP_ENABLE
#error CSR_WIFI_AP_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_serialize.h
#endif
extern void CsrWifiNmeApPfree(void *ptr);
extern u8* CsrWifiNmeApConfigSetReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeApConfigSetReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeApConfigSetReqSizeof(void *msg);
extern void CsrWifiNmeApConfigSetReqSerFree(void *msg);
extern u8* CsrWifiNmeApWpsRegisterReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeApWpsRegisterReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeApWpsRegisterReqSizeof(void *msg);
#define CsrWifiNmeApWpsRegisterReqSerFree CsrWifiNmeApPfree
extern u8* CsrWifiNmeApStartReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeApStartReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeApStartReqSizeof(void *msg);
extern void CsrWifiNmeApStartReqSerFree(void *msg);
#define CsrWifiNmeApStopReqSer CsrWifiEventCsrUint16Ser
#define CsrWifiNmeApStopReqDes CsrWifiEventCsrUint16Des
#define CsrWifiNmeApStopReqSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiNmeApStopReqSerFree CsrWifiNmeApPfree
extern u8* CsrWifiNmeApWmmParamUpdateReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeApWmmParamUpdateReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeApWmmParamUpdateReqSizeof(void *msg);
#define CsrWifiNmeApWmmParamUpdateReqSerFree CsrWifiNmeApPfree
extern u8* CsrWifiNmeApStaRemoveReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeApStaRemoveReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeApStaRemoveReqSizeof(void *msg);
#define CsrWifiNmeApStaRemoveReqSerFree CsrWifiNmeApPfree
#define CsrWifiNmeApConfigSetCfmSer CsrWifiEventCsrUint16Ser
#define CsrWifiNmeApConfigSetCfmDes CsrWifiEventCsrUint16Des
#define CsrWifiNmeApConfigSetCfmSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiNmeApConfigSetCfmSerFree CsrWifiNmeApPfree
extern u8* CsrWifiNmeApWpsRegisterCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeApWpsRegisterCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeApWpsRegisterCfmSizeof(void *msg);
#define CsrWifiNmeApWpsRegisterCfmSerFree CsrWifiNmeApPfree
extern u8* CsrWifiNmeApStartCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeApStartCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeApStartCfmSizeof(void *msg);
#define CsrWifiNmeApStartCfmSerFree CsrWifiNmeApPfree
extern u8* CsrWifiNmeApStopCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeApStopCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeApStopCfmSizeof(void *msg);
#define CsrWifiNmeApStopCfmSerFree CsrWifiNmeApPfree
extern u8* CsrWifiNmeApStopIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeApStopIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeApStopIndSizeof(void *msg);
#define CsrWifiNmeApStopIndSerFree CsrWifiNmeApPfree
#define CsrWifiNmeApWmmParamUpdateCfmSer CsrWifiEventCsrUint16Ser
#define CsrWifiNmeApWmmParamUpdateCfmDes CsrWifiEventCsrUint16Des
#define CsrWifiNmeApWmmParamUpdateCfmSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiNmeApWmmParamUpdateCfmSerFree CsrWifiNmeApPfree
extern u8* CsrWifiNmeApStationIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeApStationIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeApStationIndSizeof(void *msg);
#define CsrWifiNmeApStationIndSerFree CsrWifiNmeApPfree
#endif /* CSR_WIFI_NME_AP_SERIALIZE_H__ */

View file

@ -1,38 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_NME_CONVERTER_INIT_H__
#define CSR_WIFI_NME_CONVERTER_INIT_H__
#ifndef CSR_WIFI_NME_ENABLE
#error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_converter_init.h
#endif
#ifndef EXCLUDE_CSR_WIFI_NME_MODULE
#include "csr_msgconv.h"
#ifdef CSR_LOG_ENABLE
#include "csr_log.h"
extern const CsrLogPrimitiveInformation* CsrWifiNmeTechInfoGet(void);
#endif /* CSR_LOG_ENABLE */
extern void CsrWifiNmeConverterInit(void);
#else /* EXCLUDE_CSR_WIFI_NME_MODULE */
#define CsrWifiNmeConverterInit()
#endif /* EXCLUDE_CSR_WIFI_NME_MODULE */
#endif /* CSR_WIFI_NME_CONVERTER_INIT_H__ */

View file

@ -1,991 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_NME_LIB_H__
#define CSR_WIFI_NME_LIB_H__
#include "csr_sched.h"
#include "csr_macro.h"
#include "csr_msg_transport.h"
#include "csr_wifi_lib.h"
#include "csr_wifi_nme_prim.h"
#include "csr_wifi_nme_task.h"
#ifndef CSR_WIFI_NME_ENABLE
#error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_lib.h
#endif
/*******************************************************************************
NAME
CsrWifiNmeConnectionStatusGetReqSend
DESCRIPTION
Requests the current connection status of the NME.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an interface
*******************************************************************************/
#define CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__) \
msg__ = kmalloc(sizeof(CsrWifiNmeConnectionStatusGetReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_CONNECTION_STATUS_GET_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__);
#define CsrWifiNmeConnectionStatusGetReqSendTo(dst__, src__, interfaceTag__) \
{ \
CsrWifiNmeConnectionStatusGetReq *msg__; \
CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeConnectionStatusGetReqSend(src__, interfaceTag__) \
CsrWifiNmeConnectionStatusGetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
/*******************************************************************************
NAME
CsrWifiNmeConnectionStatusGetCfmSend
DESCRIPTION
Reports the connection status of the NME.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
status - Indicates the success or otherwise of the requested
operation.
connectionStatus - NME current connection status
*******************************************************************************/
#define CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__) \
msg__ = kmalloc(sizeof(CsrWifiNmeConnectionStatusGetCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_CONNECTION_STATUS_GET_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); \
msg__->connectionStatus = (connectionStatus__);
#define CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, src__, interfaceTag__, status__, connectionStatus__) \
{ \
CsrWifiNmeConnectionStatusGetCfm *msg__; \
CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeConnectionStatusGetCfmSend(dst__, interfaceTag__, status__, connectionStatus__) \
CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectionStatus__)
/*******************************************************************************
NAME
CsrWifiNmeEventMaskSetReqSend
DESCRIPTION
The wireless manager application may register with the NME to receive
notification of interesting events. Indications will be sent only if the
wireless manager explicitly registers to be notified of that event.
indMask is a bit mask of values defined in CsrWifiNmeIndicationsMask.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
indMask - Set mask with values from CsrWifiNmeIndications
*******************************************************************************/
#define CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__) \
msg__ = kmalloc(sizeof(CsrWifiNmeEventMaskSetReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_EVENT_MASK_SET_REQ, dst__, src__); \
msg__->indMask = (indMask__);
#define CsrWifiNmeEventMaskSetReqSendTo(dst__, src__, indMask__) \
{ \
CsrWifiNmeEventMaskSetReq *msg__; \
CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeEventMaskSetReqSend(src__, indMask__) \
CsrWifiNmeEventMaskSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, indMask__)
/*******************************************************************************
NAME
CsrWifiNmeEventMaskSetCfmSend
DESCRIPTION
The NME calls the primitive to report the result of the request
primitive.
PARAMETERS
queue - Destination Task Queue
status - Reports the result of the request
*******************************************************************************/
#define CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeEventMaskSetCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_EVENT_MASK_SET_CFM, dst__, src__); \
msg__->status = (status__);
#define CsrWifiNmeEventMaskSetCfmSendTo(dst__, src__, status__) \
{ \
CsrWifiNmeEventMaskSetCfm *msg__; \
CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeEventMaskSetCfmSend(dst__, status__) \
CsrWifiNmeEventMaskSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
/*******************************************************************************
NAME
CsrWifiNmeProfileConnectReqSend
DESCRIPTION
Requests the NME to attempt to connect to the specified profile.
Overrides any current connection attempt.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an interface
profileIdentity - Identity (BSSID, SSID) of profile to be connected to.
It must match an existing profile in the NME.
*******************************************************************************/
#define CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileConnectReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_CONNECT_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->profileIdentity = (profileIdentity__);
#define CsrWifiNmeProfileConnectReqSendTo(dst__, src__, interfaceTag__, profileIdentity__) \
{ \
CsrWifiNmeProfileConnectReq *msg__; \
CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileConnectReqSend(src__, interfaceTag__, profileIdentity__) \
CsrWifiNmeProfileConnectReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentity__)
/*******************************************************************************
NAME
CsrWifiNmeProfileConnectCfmSend
DESCRIPTION
Reports the status of the NME PROFILE CONNECT REQ. If unsuccessful the
connectAttempt parameters contain details of the APs that the NME
attempted to connect to before reporting the failure of the request.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an
interface
status - Indicates the success or otherwise of the requested
operation.
connectAttemptsCount - This parameter is relevant only if
status!=CSR_WIFI_NME_STATUS_SUCCESS.
Number of connection attempt elements provided with
this primitive
connectAttempts - This parameter is relevant only if
status!=CSR_WIFI_NME_STATUS_SUCCESS.
Points to the list of connection attempt elements
provided with this primitive
Each element of the list provides information about
an AP on which the connection attempt was made and
the error that occurred during the attempt.
*******************************************************************************/
#define CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileConnectCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_CONNECT_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); \
msg__->connectAttemptsCount = (connectAttemptsCount__); \
msg__->connectAttempts = (connectAttempts__);
#define CsrWifiNmeProfileConnectCfmSendTo(dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
{ \
CsrWifiNmeProfileConnectCfm *msg__; \
CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileConnectCfmSend(dst__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
CsrWifiNmeProfileConnectCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__)
/*******************************************************************************
NAME
CsrWifiNmeProfileDeleteAllReqSend
DESCRIPTION
Deletes all profiles present in the NME, but does NOT modify the
preferred profile list.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
*******************************************************************************/
#define CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteAllReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ, dst__, src__);
#define CsrWifiNmeProfileDeleteAllReqSendTo(dst__, src__) \
{ \
CsrWifiNmeProfileDeleteAllReq *msg__; \
CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileDeleteAllReqSend(src__) \
CsrWifiNmeProfileDeleteAllReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__)
/*******************************************************************************
NAME
CsrWifiNmeProfileDeleteAllCfmSend
DESCRIPTION
Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ.
Returns always CSR_WIFI_NME_STATUS_SUCCESS.
PARAMETERS
queue - Destination Task Queue
status - Indicates the success or otherwise of the requested operation, but
in this case it always set to success.
*******************************************************************************/
#define CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteAllCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_ALL_CFM, dst__, src__); \
msg__->status = (status__);
#define CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, src__, status__) \
{ \
CsrWifiNmeProfileDeleteAllCfm *msg__; \
CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileDeleteAllCfmSend(dst__, status__) \
CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
/*******************************************************************************
NAME
CsrWifiNmeProfileDeleteReqSend
DESCRIPTION
Will delete the profile with a matching identity, but does NOT modify the
preferred profile list.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
profileIdentity - Identity (BSSID, SSID) of profile to be deleted.
*******************************************************************************/
#define CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_REQ, dst__, src__); \
msg__->profileIdentity = (profileIdentity__);
#define CsrWifiNmeProfileDeleteReqSendTo(dst__, src__, profileIdentity__) \
{ \
CsrWifiNmeProfileDeleteReq *msg__; \
CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileDeleteReqSend(src__, profileIdentity__) \
CsrWifiNmeProfileDeleteReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profileIdentity__)
/*******************************************************************************
NAME
CsrWifiNmeProfileDeleteCfmSend
DESCRIPTION
Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_REQ.
Returns CSR_WIFI_NME_STATUS_NOT_FOUND if there is no matching profile.
PARAMETERS
queue - Destination Task Queue
status - Indicates the success or otherwise of the requested operation.
*******************************************************************************/
#define CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_CFM, dst__, src__); \
msg__->status = (status__);
#define CsrWifiNmeProfileDeleteCfmSendTo(dst__, src__, status__) \
{ \
CsrWifiNmeProfileDeleteCfm *msg__; \
CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileDeleteCfmSend(dst__, status__) \
CsrWifiNmeProfileDeleteCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
/*******************************************************************************
NAME
CsrWifiNmeProfileDisconnectIndSend
DESCRIPTION
Indication generated from the NME (if an application subscribes to
receive it) that informs that application that the current profile
connection has disconnected. The indication will contain information
about APs that it attempted to maintain the connection via i.e. in the
case of failed roaming.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an
interface
connectAttemptsCount - Number of connection attempt elements provided with
this primitive
connectAttempts - Points to the list of connection attempt elements
provided with this primitive
Each element of the list provides information about
an AP on which the connection attempt was made and
the error occurred during the attempt.
*******************************************************************************/
#define CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileDisconnectInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DISCONNECT_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->connectAttemptsCount = (connectAttemptsCount__); \
msg__->connectAttempts = (connectAttempts__);
#define CsrWifiNmeProfileDisconnectIndSendTo(dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
{ \
CsrWifiNmeProfileDisconnectInd *msg__; \
CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileDisconnectIndSend(dst__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
CsrWifiNmeProfileDisconnectIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, connectAttemptsCount__, connectAttempts__)
/*******************************************************************************
NAME
CsrWifiNmeProfileOrderSetReqSend
DESCRIPTION
Defines the preferred order that profiles present in the NME should be
used during the NME auto-connect behaviour.
If profileIdentitysCount == 0, it removes any existing preferred profile
list already present in the NME, effectively disabling the auto-connect
behaviour.
NOTE: Profile identities that do not match any profile stored in the NME
are ignored during the auto-connect procedure.
NOTE: during auto-connect the NME will only attempt to join an existing
adhoc network and it will never attempt to host an adhoc network; for
hosting and adhoc network, use CSR_WIFI_NME_PROFILE_CONNECT_REQ
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an
interface
profileIdentitysCount - The number of profiles identities in the list.
profileIdentitys - Points to the list of profile identities.
*******************************************************************************/
#define CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileOrderSetReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_ORDER_SET_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->profileIdentitysCount = (profileIdentitysCount__); \
msg__->profileIdentitys = (profileIdentitys__);
#define CsrWifiNmeProfileOrderSetReqSendTo(dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
{ \
CsrWifiNmeProfileOrderSetReq *msg__; \
CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileOrderSetReqSend(src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
CsrWifiNmeProfileOrderSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__)
/*******************************************************************************
NAME
CsrWifiNmeProfileOrderSetCfmSend
DESCRIPTION
Confirmation to UNIFI_NME_PROFILE_ORDER_SET.request.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
status - Indicates the success or otherwise of the requested
operation.
*******************************************************************************/
#define CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileOrderSetCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_ORDER_SET_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__);
#define CsrWifiNmeProfileOrderSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
{ \
CsrWifiNmeProfileOrderSetCfm *msg__; \
CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileOrderSetCfmSend(dst__, interfaceTag__, status__) \
CsrWifiNmeProfileOrderSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
/*******************************************************************************
NAME
CsrWifiNmeProfileSetReqSend
DESCRIPTION
Creates or updates an existing profile in the NME that matches the unique
identity of the profile. Each profile is identified by the combination of
BSSID and SSID. The profile contains all the required credentials for
attempting to connect to the network. Creating or updating a profile via
the NME PROFILE SET REQ does NOT add the profile to the preferred profile
list within the NME used for the NME auto-connect behaviour.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
profile - Specifies the identity and credentials of the network.
*******************************************************************************/
#define CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileSetReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_SET_REQ, dst__, src__); \
msg__->profile = (profile__);
#define CsrWifiNmeProfileSetReqSendTo(dst__, src__, profile__) \
{ \
CsrWifiNmeProfileSetReq *msg__; \
CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileSetReqSend(src__, profile__) \
CsrWifiNmeProfileSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profile__)
/*******************************************************************************
NAME
CsrWifiNmeProfileSetCfmSend
DESCRIPTION
Reports the status of the NME PROFILE SET REQ; the request will only fail
if the details specified in the profile contains an invalid combination
of parameters for example specifying the profile as cloaked but not
specifying the SSID. The NME doesn't limit the number of profiles that
may be created. The NME assumes that the entity configuring it is aware
of the appropriate limits.
PARAMETERS
queue - Destination Task Queue
status - Indicates the success or otherwise of the requested operation.
*******************************************************************************/
#define CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileSetCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_SET_CFM, dst__, src__); \
msg__->status = (status__);
#define CsrWifiNmeProfileSetCfmSendTo(dst__, src__, status__) \
{ \
CsrWifiNmeProfileSetCfm *msg__; \
CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileSetCfmSend(dst__, status__) \
CsrWifiNmeProfileSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
/*******************************************************************************
NAME
CsrWifiNmeProfileUpdateIndSend
DESCRIPTION
Indication generated from the NME (if an application subscribes to
receive it) that informs that application that the contained profile has
changed.
For example, either the credentials EAP-FAST PAC file or the session data
within the profile has changed.
It is up to the application whether it stores this updated profile or
not.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
profile - The identity and credentials of the network.
*******************************************************************************/
#define CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__) \
msg__ = kmalloc(sizeof(CsrWifiNmeProfileUpdateInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_UPDATE_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->profile = (profile__);
#define CsrWifiNmeProfileUpdateIndSendTo(dst__, src__, interfaceTag__, profile__) \
{ \
CsrWifiNmeProfileUpdateInd *msg__; \
CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeProfileUpdateIndSend(dst__, interfaceTag__, profile__) \
CsrWifiNmeProfileUpdateIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, profile__)
/*******************************************************************************
NAME
CsrWifiNmeSimGsmAuthIndSend
DESCRIPTION
Indication generated from the NME (if an application subscribes to
receive it) that requests the UICC Manager to perform a GSM
authentication on behalf of the NME. This indication is generated when
the NME is attempting to connect to a profile configured for EAP-SIM. An
application MUST register to receive this indication for the NME to
support the EAP-SIM credential types. Otherwise the NME has no route to
obtain the information from the UICC. EAP-SIM authentication requires 2
or 3 GSM authentication rounds and therefore 2 or 3 RANDS (GSM Random
Challenges) are included.
PARAMETERS
queue - Destination Task Queue
randsLength - GSM RAND is 16 bytes long hence valid values are 32 (2 RANDS)
or 48 (3 RANDs).
rands - 2 or 3 RANDs values.
*******************************************************************************/
#define CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__) \
msg__ = kmalloc(sizeof(CsrWifiNmeSimGsmAuthInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_GSM_AUTH_IND, dst__, src__); \
msg__->randsLength = (randsLength__); \
msg__->rands = (rands__);
#define CsrWifiNmeSimGsmAuthIndSendTo(dst__, src__, randsLength__, rands__) \
{ \
CsrWifiNmeSimGsmAuthInd *msg__; \
CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeSimGsmAuthIndSend(dst__, randsLength__, rands__) \
CsrWifiNmeSimGsmAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, randsLength__, rands__)
/*******************************************************************************
NAME
CsrWifiNmeSimGsmAuthResSend
DESCRIPTION
Response from the application that received the NME SIM GSM AUTH IND. For
each GSM authentication round a GSM Ciphering key (Kc) and a signed
response (SRES) are produced. Since 2 or 3 GSM authentication rounds are
used the 2 or 3 Kc's obtained respectively are combined into one buffer
and similarly the 2 or 3 SRES's obtained are combined into another
buffer. The order of Kc values (SRES values respectively) in their buffer
is the same as that of their corresponding RAND values in the incoming
indication.
PARAMETERS
status - Indicates the outcome of the requested operation:
STATUS_SUCCESS or STATUS_ERROR
kcsLength - Length in Bytes of Kc buffer. Legal values are: 16 or 24.
kcs - Kc buffer holding 2 or 3 Kc values.
sresLength - Length in Bytes of SRES buffer. Legal values are: 8 or 12.
sres - SRES buffer holding 2 or 3 SRES values.
*******************************************************************************/
#define CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
msg__ = kmalloc(sizeof(CsrWifiNmeSimGsmAuthRes), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_GSM_AUTH_RES, dst__, src__); \
msg__->status = (status__); \
msg__->kcsLength = (kcsLength__); \
msg__->kcs = (kcs__); \
msg__->sresLength = (sresLength__); \
msg__->sres = (sres__);
#define CsrWifiNmeSimGsmAuthResSendTo(dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
{ \
CsrWifiNmeSimGsmAuthRes *msg__; \
CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeSimGsmAuthResSend(src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
CsrWifiNmeSimGsmAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, kcsLength__, kcs__, sresLength__, sres__)
/*******************************************************************************
NAME
CsrWifiNmeSimImsiGetIndSend
DESCRIPTION
Indication generated from the NME (if an application subscribes to
receive it) that requests the IMSI and UICC type from the UICC Manager.
This indication is generated when the NME is attempting to connect to a
profile configured for EAP-SIM/AKA. An application MUST register to
receive this indication for the NME to support the EAP-SIM/AKA credential
types. Otherwise the NME has no route to obtain the information from the
UICC.
PARAMETERS
queue - Destination Task Queue
*******************************************************************************/
#define CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__) \
msg__ = kmalloc(sizeof(CsrWifiNmeSimImsiGetInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_IMSI_GET_IND, dst__, src__);
#define CsrWifiNmeSimImsiGetIndSendTo(dst__, src__) \
{ \
CsrWifiNmeSimImsiGetInd *msg__; \
CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeSimImsiGetIndSend(dst__) \
CsrWifiNmeSimImsiGetIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE)
/*******************************************************************************
NAME
CsrWifiNmeSimImsiGetResSend
DESCRIPTION
Response from the application that received the NME SIM IMSI GET IND.
PARAMETERS
status - Indicates the outcome of the requested operation: STATUS_SUCCESS
or STATUS_ERROR.
imsi - The value of the IMSI obtained from the UICC.
cardType - The UICC type (GSM only (SIM), UMTS only (USIM), Both).
*******************************************************************************/
#define CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__) \
msg__ = kmalloc(sizeof(CsrWifiNmeSimImsiGetRes), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_IMSI_GET_RES, dst__, src__); \
msg__->status = (status__); \
msg__->imsi = (imsi__); \
msg__->cardType = (cardType__);
#define CsrWifiNmeSimImsiGetResSendTo(dst__, src__, status__, imsi__, cardType__) \
{ \
CsrWifiNmeSimImsiGetRes *msg__; \
CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeSimImsiGetResSend(src__, status__, imsi__, cardType__) \
CsrWifiNmeSimImsiGetResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, imsi__, cardType__)
/*******************************************************************************
NAME
CsrWifiNmeSimUmtsAuthIndSend
DESCRIPTION
Indication generated from the NME (if an application subscribes to
receive it) that requests the UICC Manager to perform a UMTS
authentication on behalf of the NME. This indication is generated when
the NME is attempting to connect to a profile configured for EAP-AKA. An
application MUST register to receive this indication for the NME to
support the EAP-AKA credential types. Otherwise the NME has no route to
obtain the information from the USIM. EAP-AKA requires one UMTS
authentication round and therefore only one RAND and one AUTN values are
included.
PARAMETERS
queue - Destination Task Queue
rand - UMTS RAND value.
autn - UMTS AUTN value.
*******************************************************************************/
#define CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__) \
msg__ = kmalloc(sizeof(CsrWifiNmeSimUmtsAuthInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_UMTS_AUTH_IND, dst__, src__); \
memcpy(msg__->rand, (rand__), sizeof(u8) * 16); \
memcpy(msg__->autn, (autn__), sizeof(u8) * 16);
#define CsrWifiNmeSimUmtsAuthIndSendTo(dst__, src__, rand__, autn__) \
{ \
CsrWifiNmeSimUmtsAuthInd *msg__; \
CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeSimUmtsAuthIndSend(dst__, rand__, autn__) \
CsrWifiNmeSimUmtsAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, rand__, autn__)
/*******************************************************************************
NAME
CsrWifiNmeSimUmtsAuthResSend
DESCRIPTION
Response from the application that received the NME SIM UMTS AUTH IND.
The values of umtsCipherKey, umtsIntegrityKey, resParameterLength and
resParameter are only meanigful when result = UMTS_AUTH_RESULT_SUCCESS.
The value of auts is only meaningful when
result=UMTS_AUTH_RESULT_SYNC_FAIL.
PARAMETERS
status - Indicates the outcome of the requested operation:
STATUS_SUCCESS or STATUS_ERROR.
result - The result of UMTS authentication as performed by the
UICC which could be: Success, Authentication Reject or
Synchronisation Failure. For all these 3 outcomes the
value of status is success.
umtsCipherKey - The UMTS Cipher Key as calculated and returned by the
UICC.
umtsIntegrityKey - The UMTS Integrity Key as calculated and returned by
the UICC.
resParameterLength - The length (in bytes) of the RES parameter (min=4; max
= 16).
resParameter - The RES parameter as calculated and returned by the
UICC.
auts - The AUTS parameter as calculated and returned by the
UICC.
*******************************************************************************/
#define CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
msg__ = kmalloc(sizeof(CsrWifiNmeSimUmtsAuthRes), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_UMTS_AUTH_RES, dst__, src__); \
msg__->status = (status__); \
msg__->result = (result__); \
memcpy(msg__->umtsCipherKey, (umtsCipherKey__), sizeof(u8) * 16); \
memcpy(msg__->umtsIntegrityKey, (umtsIntegrityKey__), sizeof(u8) * 16); \
msg__->resParameterLength = (resParameterLength__); \
msg__->resParameter = (resParameter__); \
memcpy(msg__->auts, (auts__), sizeof(u8) * 14);
#define CsrWifiNmeSimUmtsAuthResSendTo(dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
{ \
CsrWifiNmeSimUmtsAuthRes *msg__; \
CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeSimUmtsAuthResSend(src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
CsrWifiNmeSimUmtsAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__)
/*******************************************************************************
NAME
CsrWifiNmeWpsCancelReqSend
DESCRIPTION
Requests the NME to cancel any WPS procedure that it is currently
performing. This includes WPS registrar activities started because of
CSR_WIFI_NME_AP_REGISTER.request
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an interface
*******************************************************************************/
#define CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__) \
msg__ = kmalloc(sizeof(CsrWifiNmeWpsCancelReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CANCEL_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__);
#define CsrWifiNmeWpsCancelReqSendTo(dst__, src__, interfaceTag__) \
{ \
CsrWifiNmeWpsCancelReq *msg__; \
CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeWpsCancelReqSend(src__, interfaceTag__) \
CsrWifiNmeWpsCancelReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
/*******************************************************************************
NAME
CsrWifiNmeWpsCancelCfmSend
DESCRIPTION
Reports the status of the NME WPS REQ, the request is always SUCCESSFUL.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
status - Only returns CSR_WIFI_NME_STATUS_SUCCESS
*******************************************************************************/
#define CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeWpsCancelCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CANCEL_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__);
#define CsrWifiNmeWpsCancelCfmSendTo(dst__, src__, interfaceTag__, status__) \
{ \
CsrWifiNmeWpsCancelCfm *msg__; \
CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeWpsCancelCfmSend(dst__, interfaceTag__, status__) \
CsrWifiNmeWpsCancelCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
/*******************************************************************************
NAME
CsrWifiNmeWpsCfmSend
DESCRIPTION
Reports the status of the NME WPS REQ.
If CSR_WIFI_NME_STATUS_SUCCESS, the profile parameter contains the
identity and credentials of the AP.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
status - Indicates the success or otherwise of the requested
operation.
profile - This parameter is relevant only if
status==CSR_WIFI_NME_STATUS_SUCCESS.
The identity and credentials of the network.
*******************************************************************************/
#define CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__) \
msg__ = kmalloc(sizeof(CsrWifiNmeWpsCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); \
msg__->profile = (profile__);
#define CsrWifiNmeWpsCfmSendTo(dst__, src__, interfaceTag__, status__, profile__) \
{ \
CsrWifiNmeWpsCfm *msg__; \
CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeWpsCfmSend(dst__, interfaceTag__, status__, profile__) \
CsrWifiNmeWpsCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, profile__)
/*******************************************************************************
NAME
CsrWifiNmeWpsConfigSetReqSend
DESCRIPTION
This primitive passes the WPS information for the device to NME. This may
be accepted only if no interface is active.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
wpsConfig - WPS config.
*******************************************************************************/
#define CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__) \
msg__ = kmalloc(sizeof(CsrWifiNmeWpsConfigSetReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CONFIG_SET_REQ, dst__, src__); \
msg__->wpsConfig = (wpsConfig__);
#define CsrWifiNmeWpsConfigSetReqSendTo(dst__, src__, wpsConfig__) \
{ \
CsrWifiNmeWpsConfigSetReq *msg__; \
CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeWpsConfigSetReqSend(src__, wpsConfig__) \
CsrWifiNmeWpsConfigSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, wpsConfig__)
/*******************************************************************************
NAME
CsrWifiNmeWpsConfigSetCfmSend
DESCRIPTION
Confirm.
PARAMETERS
queue - Destination Task Queue
status - Status of the request.
*******************************************************************************/
#define CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__) \
msg__ = kmalloc(sizeof(CsrWifiNmeWpsConfigSetCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CONFIG_SET_CFM, dst__, src__); \
msg__->status = (status__);
#define CsrWifiNmeWpsConfigSetCfmSendTo(dst__, src__, status__) \
{ \
CsrWifiNmeWpsConfigSetCfm *msg__; \
CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeWpsConfigSetCfmSend(dst__, status__) \
CsrWifiNmeWpsConfigSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
/*******************************************************************************
NAME
CsrWifiNmeWpsReqSend
DESCRIPTION
Requests the NME to look for WPS enabled APs and attempt to perform WPS
to determine the appropriate security credentials to connect to the AP.
If the PIN == '00000000' then 'push button mode' is indicated, otherwise
the PIN has to match that of the AP. 4 digit pin is passed by sending the
pin digits in pin[0]..pin[3] and rest of the contents filled with '-'.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an interface
pin - PIN value.
ssid - Service Set identifier
bssid - ID of Basic Service Set for which a WPS connection attempt is
being made.
*******************************************************************************/
#define CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
msg__ = kmalloc(sizeof(CsrWifiNmeWpsReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
memcpy(msg__->pin, (pin__), sizeof(u8) * 8); \
msg__->ssid = (ssid__); \
msg__->bssid = (bssid__);
#define CsrWifiNmeWpsReqSendTo(dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
{ \
CsrWifiNmeWpsReq *msg__; \
CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__); \
CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
}
#define CsrWifiNmeWpsReqSend(src__, interfaceTag__, pin__, ssid__, bssid__) \
CsrWifiNmeWpsReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, pin__, ssid__, bssid__)
#endif /* CSR_WIFI_NME_LIB_H__ */

File diff suppressed because it is too large Load diff

View file

@ -1,166 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_NME_SERIALIZE_H__
#define CSR_WIFI_NME_SERIALIZE_H__
#include "csr_wifi_msgconv.h"
#include "csr_wifi_nme_prim.h"
#ifndef CSR_WIFI_NME_ENABLE
#error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_serialize.h
#endif
extern void CsrWifiNmePfree(void *ptr);
extern u8* CsrWifiNmeProfileSetReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeProfileSetReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeProfileSetReqSizeof(void *msg);
extern void CsrWifiNmeProfileSetReqSerFree(void *msg);
extern u8* CsrWifiNmeProfileDeleteReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeProfileDeleteReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeProfileDeleteReqSizeof(void *msg);
#define CsrWifiNmeProfileDeleteReqSerFree CsrWifiNmePfree
#define CsrWifiNmeProfileDeleteAllReqSer CsrWifiEventSer
#define CsrWifiNmeProfileDeleteAllReqDes CsrWifiEventDes
#define CsrWifiNmeProfileDeleteAllReqSizeof CsrWifiEventSizeof
#define CsrWifiNmeProfileDeleteAllReqSerFree CsrWifiNmePfree
extern u8* CsrWifiNmeProfileOrderSetReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeProfileOrderSetReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeProfileOrderSetReqSizeof(void *msg);
extern void CsrWifiNmeProfileOrderSetReqSerFree(void *msg);
extern u8* CsrWifiNmeProfileConnectReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeProfileConnectReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeProfileConnectReqSizeof(void *msg);
#define CsrWifiNmeProfileConnectReqSerFree CsrWifiNmePfree
extern u8* CsrWifiNmeWpsReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeWpsReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeWpsReqSizeof(void *msg);
#define CsrWifiNmeWpsReqSerFree CsrWifiNmePfree
#define CsrWifiNmeWpsCancelReqSer CsrWifiEventCsrUint16Ser
#define CsrWifiNmeWpsCancelReqDes CsrWifiEventCsrUint16Des
#define CsrWifiNmeWpsCancelReqSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiNmeWpsCancelReqSerFree CsrWifiNmePfree
#define CsrWifiNmeConnectionStatusGetReqSer CsrWifiEventCsrUint16Ser
#define CsrWifiNmeConnectionStatusGetReqDes CsrWifiEventCsrUint16Des
#define CsrWifiNmeConnectionStatusGetReqSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiNmeConnectionStatusGetReqSerFree CsrWifiNmePfree
extern u8* CsrWifiNmeSimImsiGetResSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeSimImsiGetResDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeSimImsiGetResSizeof(void *msg);
extern void CsrWifiNmeSimImsiGetResSerFree(void *msg);
extern u8* CsrWifiNmeSimGsmAuthResSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeSimGsmAuthResDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeSimGsmAuthResSizeof(void *msg);
extern void CsrWifiNmeSimGsmAuthResSerFree(void *msg);
extern u8* CsrWifiNmeSimUmtsAuthResSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeSimUmtsAuthResDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeSimUmtsAuthResSizeof(void *msg);
extern void CsrWifiNmeSimUmtsAuthResSerFree(void *msg);
extern u8* CsrWifiNmeWpsConfigSetReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeWpsConfigSetReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeWpsConfigSetReqSizeof(void *msg);
extern void CsrWifiNmeWpsConfigSetReqSerFree(void *msg);
#define CsrWifiNmeEventMaskSetReqSer CsrWifiEventCsrUint32Ser
#define CsrWifiNmeEventMaskSetReqDes CsrWifiEventCsrUint32Des
#define CsrWifiNmeEventMaskSetReqSizeof CsrWifiEventCsrUint32Sizeof
#define CsrWifiNmeEventMaskSetReqSerFree CsrWifiNmePfree
#define CsrWifiNmeProfileSetCfmSer CsrWifiEventCsrUint16Ser
#define CsrWifiNmeProfileSetCfmDes CsrWifiEventCsrUint16Des
#define CsrWifiNmeProfileSetCfmSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiNmeProfileSetCfmSerFree CsrWifiNmePfree
#define CsrWifiNmeProfileDeleteCfmSer CsrWifiEventCsrUint16Ser
#define CsrWifiNmeProfileDeleteCfmDes CsrWifiEventCsrUint16Des
#define CsrWifiNmeProfileDeleteCfmSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiNmeProfileDeleteCfmSerFree CsrWifiNmePfree
#define CsrWifiNmeProfileDeleteAllCfmSer CsrWifiEventCsrUint16Ser
#define CsrWifiNmeProfileDeleteAllCfmDes CsrWifiEventCsrUint16Des
#define CsrWifiNmeProfileDeleteAllCfmSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiNmeProfileDeleteAllCfmSerFree CsrWifiNmePfree
extern u8* CsrWifiNmeProfileOrderSetCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeProfileOrderSetCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeProfileOrderSetCfmSizeof(void *msg);
#define CsrWifiNmeProfileOrderSetCfmSerFree CsrWifiNmePfree
extern u8* CsrWifiNmeProfileConnectCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeProfileConnectCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeProfileConnectCfmSizeof(void *msg);
extern void CsrWifiNmeProfileConnectCfmSerFree(void *msg);
extern u8* CsrWifiNmeWpsCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeWpsCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeWpsCfmSizeof(void *msg);
extern void CsrWifiNmeWpsCfmSerFree(void *msg);
extern u8* CsrWifiNmeWpsCancelCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeWpsCancelCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeWpsCancelCfmSizeof(void *msg);
#define CsrWifiNmeWpsCancelCfmSerFree CsrWifiNmePfree
extern u8* CsrWifiNmeConnectionStatusGetCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeConnectionStatusGetCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeConnectionStatusGetCfmSizeof(void *msg);
#define CsrWifiNmeConnectionStatusGetCfmSerFree CsrWifiNmePfree
extern u8* CsrWifiNmeProfileUpdateIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeProfileUpdateIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeProfileUpdateIndSizeof(void *msg);
extern void CsrWifiNmeProfileUpdateIndSerFree(void *msg);
extern u8* CsrWifiNmeProfileDisconnectIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeProfileDisconnectIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeProfileDisconnectIndSizeof(void *msg);
extern void CsrWifiNmeProfileDisconnectIndSerFree(void *msg);
#define CsrWifiNmeSimImsiGetIndSer CsrWifiEventSer
#define CsrWifiNmeSimImsiGetIndDes CsrWifiEventDes
#define CsrWifiNmeSimImsiGetIndSizeof CsrWifiEventSizeof
#define CsrWifiNmeSimImsiGetIndSerFree CsrWifiNmePfree
extern u8* CsrWifiNmeSimGsmAuthIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeSimGsmAuthIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeSimGsmAuthIndSizeof(void *msg);
extern void CsrWifiNmeSimGsmAuthIndSerFree(void *msg);
extern u8* CsrWifiNmeSimUmtsAuthIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiNmeSimUmtsAuthIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiNmeSimUmtsAuthIndSizeof(void *msg);
#define CsrWifiNmeSimUmtsAuthIndSerFree CsrWifiNmePfree
#define CsrWifiNmeWpsConfigSetCfmSer CsrWifiEventCsrUint16Ser
#define CsrWifiNmeWpsConfigSetCfmDes CsrWifiEventCsrUint16Des
#define CsrWifiNmeWpsConfigSetCfmSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiNmeWpsConfigSetCfmSerFree CsrWifiNmePfree
#define CsrWifiNmeEventMaskSetCfmSer CsrWifiEventCsrUint16Ser
#define CsrWifiNmeEventMaskSetCfmDes CsrWifiEventCsrUint16Des
#define CsrWifiNmeEventMaskSetCfmSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiNmeEventMaskSetCfmSerFree CsrWifiNmePfree
#endif /* CSR_WIFI_NME_SERIALIZE_H__ */

View file

@ -1,27 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_NME_TASK_H__
#define CSR_WIFI_NME_TASK_H__
#include <linux/types.h>
#include "csr_sched.h"
#ifndef CSR_WIFI_NME_ENABLE
#error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_task.h
#endif
#define CSR_WIFI_NME_LOG_ID 0x1203FFFF
extern CsrSchedQid CSR_WIFI_NME_IFACEQUEUE;
#endif /* CSR_WIFI_NME_TASK_H__ */

View file

@ -1,81 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_PRIVATE_COMMON_H__
#define CSR_WIFI_PRIVATE_COMMON_H__
/**
* @brief maximum number of STAs allowed to be connected
*
* @par Description
* min & max Beacon Interval
*/
#define CSR_WIFI_AP_MAX_ASSOC_STA 8
/** Number of only b rates */
#define CSR_WIFI_SME_AP_MAX_ONLY_B_RATES 4
/** Number of mandatory b rates */
#define CSR_WIFI_SME_AP_MAX_MANDATORY_B_RATES 2
/** Number of mandatory bg rates */
#define CSR_WIFI_SME_AP_MAX_MANDATORY_BG_RATES 4
/** Number of bg rates */
#define CSR_WIFI_SME_AP_MAX_BG_RATES 12
/** Number of no b only g rates */
#define CSR_WIFI_SME_AP_MAX_NO_B_ONLY_G_RATES 8
/** Number of mandatory g rates */
#define CSR_WIFI_SME_AP_MAX_MANDATORY_G_RATES 7
/* Number of g mandatory rates */
#define CSR_WIFI_SME_AP_G_MANDATORY_RATES_NUM 7
/* Number of b mandatory rates */
#define CSR_WIFI_SME_AP_B_MANDATORY_RATES_NUM 2
/* Number of b/g mandatory rates */
#define CSR_WIFI_SME_AP_BG_MANDATORY_RATES_NUM 4
/* The maximum allowed length of SSID */
#define CSR_WIFI_SME_AP_SSID_MAX_LENGTH 32
/* Refer 8.4.2.27 RSN element - we support TKIP, WPA2, WAPI and PSK only, no pmkid, group cipher suite */
#define CSR_WIFI_SME_RSN_PACKED_SIZE (1 + 1 + 2 + 4 + 2 + 4 * 2 + 2 + 4 * 1 + 2 + 24)
/* Refer 7.3.2.9 (ISO/IEC 8802-11:2006) WAPI element - we support WAPI PSK only, no bkid, group cipher suite */
#define CSR_WIFI_SME_WAPI_PACKED_SIZE (1 + 1 + 2 + 2 + 4 * 1 + 2 + 4 * 1 + 4 + 2 + 24)
/* Common structure for NME and SME to maintain Interface mode*/
typedef u8 CsrWifiInterfaceMode;
#define CSR_WIFI_MODE_NONE ((CsrWifiInterfaceMode) 0xFF)
#define CSR_WIFI_MODE_STA ((CsrWifiInterfaceMode) 0x00)
#define CSR_WIFI_MODE_AP ((CsrWifiInterfaceMode) 0x01)
#define CSR_WIFI_MODE_P2P_DEVICE ((CsrWifiInterfaceMode) 0x02)
#define CSR_WIFI_MODE_P2P_CLI ((CsrWifiInterfaceMode) 0x03)
#define CSR_WIFI_MODE_P2P_GO ((CsrWifiInterfaceMode) 0x04)
#define CSR_WIFI_MODE_AMP ((CsrWifiInterfaceMode) 0x05)
#define CSR_WIFI_MODE_WPS_ENROLLEE ((CsrWifiInterfaceMode) 0x06)
#define CSR_WIFI_MODE_IBSS ((CsrWifiInterfaceMode) 0x07)
#endif

View file

@ -1,27 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_RESULT_H__
#define CSR_WIFI_RESULT_H__
#include "csr_result.h"
/* THIS FILE SHOULD CONTAIN ONLY RESULT CODES */
/* Result Codes */
#define CSR_WIFI_HIP_RESULT_INVALID_VALUE ((CsrResult) 1) /* Invalid argument value */
#define CSR_WIFI_HIP_RESULT_NO_DEVICE ((CsrResult) 2) /* The specified device is no longer present */
#define CSR_WIFI_HIP_RESULT_NO_SPACE ((CsrResult) 3) /* A queue or buffer is full */
#define CSR_WIFI_HIP_RESULT_NO_MEMORY ((CsrResult) 4) /* Fatal error, no memory */
#define CSR_WIFI_HIP_RESULT_RANGE ((CsrResult) 5) /* Request exceeds the range of a file or a buffer */
#define CSR_WIFI_HIP_RESULT_NOT_FOUND ((CsrResult) 6) /* A file (typically a f/w patch) is not found */
#endif /* CSR_WIFI_RESULT_H__ */

View file

@ -1,82 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include "csr_msgconv.h"
#include "csr_macro.h"
#ifdef CSR_LOG_ENABLE
#include "csr_log.h"
#endif
#ifndef EXCLUDE_CSR_WIFI_ROUTER_MODULE
#include "csr_wifi_router_serialize.h"
#include "csr_wifi_router_prim.h"
static CsrMsgConvMsgEntry csrwifirouter_conv_lut[] = {
{ CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_REQ, CsrWifiRouterMaPacketSubscribeReqSizeof, CsrWifiRouterMaPacketSubscribeReqSer, CsrWifiRouterMaPacketSubscribeReqDes, CsrWifiRouterMaPacketSubscribeReqSerFree },
{ CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_REQ, CsrWifiRouterMaPacketUnsubscribeReqSizeof, CsrWifiRouterMaPacketUnsubscribeReqSer, CsrWifiRouterMaPacketUnsubscribeReqDes, CsrWifiRouterMaPacketUnsubscribeReqSerFree },
{ CSR_WIFI_ROUTER_MA_PACKET_REQ, CsrWifiRouterMaPacketReqSizeof, CsrWifiRouterMaPacketReqSer, CsrWifiRouterMaPacketReqDes, CsrWifiRouterMaPacketReqSerFree },
{ CSR_WIFI_ROUTER_MA_PACKET_RES, CsrWifiRouterMaPacketResSizeof, CsrWifiRouterMaPacketResSer, CsrWifiRouterMaPacketResDes, CsrWifiRouterMaPacketResSerFree },
{ CSR_WIFI_ROUTER_MA_PACKET_CANCEL_REQ, CsrWifiRouterMaPacketCancelReqSizeof, CsrWifiRouterMaPacketCancelReqSer, CsrWifiRouterMaPacketCancelReqDes, CsrWifiRouterMaPacketCancelReqSerFree },
{ CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_CFM, CsrWifiRouterMaPacketSubscribeCfmSizeof, CsrWifiRouterMaPacketSubscribeCfmSer, CsrWifiRouterMaPacketSubscribeCfmDes, CsrWifiRouterMaPacketSubscribeCfmSerFree },
{ CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_CFM, CsrWifiRouterMaPacketUnsubscribeCfmSizeof, CsrWifiRouterMaPacketUnsubscribeCfmSer, CsrWifiRouterMaPacketUnsubscribeCfmDes, CsrWifiRouterMaPacketUnsubscribeCfmSerFree },
{ CSR_WIFI_ROUTER_MA_PACKET_CFM, CsrWifiRouterMaPacketCfmSizeof, CsrWifiRouterMaPacketCfmSer, CsrWifiRouterMaPacketCfmDes, CsrWifiRouterMaPacketCfmSerFree },
{ CSR_WIFI_ROUTER_MA_PACKET_IND, CsrWifiRouterMaPacketIndSizeof, CsrWifiRouterMaPacketIndSer, CsrWifiRouterMaPacketIndDes, CsrWifiRouterMaPacketIndSerFree },
{ 0, NULL, NULL, NULL, NULL },
};
CsrMsgConvMsgEntry* CsrWifiRouterConverterLookup(CsrMsgConvMsgEntry *ce, u16 msgType)
{
if (msgType & CSR_PRIM_UPSTREAM)
{
u16 idx = (msgType & ~CSR_PRIM_UPSTREAM) + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT;
if (idx < (CSR_WIFI_ROUTER_PRIM_UPSTREAM_COUNT + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT) &&
csrwifirouter_conv_lut[idx].msgType == msgType)
{
return &csrwifirouter_conv_lut[idx];
}
}
else
{
if (msgType < CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT &&
csrwifirouter_conv_lut[msgType].msgType == msgType)
{
return &csrwifirouter_conv_lut[msgType];
}
}
return NULL;
}
void CsrWifiRouterConverterInit(void)
{
CsrMsgConvInsert(CSR_WIFI_ROUTER_PRIM, csrwifirouter_conv_lut);
CsrMsgConvCustomLookupRegister(CSR_WIFI_ROUTER_PRIM, CsrWifiRouterConverterLookup);
}
#ifdef CSR_LOG_ENABLE
static const CsrLogPrimitiveInformation csrwifirouter_conv_info = {
CSR_WIFI_ROUTER_PRIM,
(char *)"CSR_WIFI_ROUTER_PRIM",
csrwifirouter_conv_lut
};
const CsrLogPrimitiveInformation* CsrWifiRouterTechInfoGet(void)
{
return &csrwifirouter_conv_info;
}
#endif /* CSR_LOG_ENABLE */
#endif /* EXCLUDE_CSR_WIFI_ROUTER_MODULE */

View file

@ -1,34 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_ROUTER_CONVERTER_INIT_H__
#define CSR_WIFI_ROUTER_CONVERTER_INIT_H__
#ifndef EXCLUDE_CSR_WIFI_ROUTER_MODULE
#include "csr_msgconv.h"
#ifdef CSR_LOG_ENABLE
#include "csr_log.h"
extern const CsrLogPrimitiveInformation* CsrWifiRouterTechInfoGet(void);
#endif /* CSR_LOG_ENABLE */
extern void CsrWifiRouterConverterInit(void);
#else /* EXCLUDE_CSR_WIFI_ROUTER_MODULE */
#define CsrWifiRouterConverterInit()
#endif /* EXCLUDE_CSR_WIFI_ROUTER_MODULE */
#endif /* CSR_WIFI_ROUTER_CONVERTER_INIT_H__ */

View file

@ -1,134 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include "csr_msgconv.h"
#include "csr_macro.h"
#ifdef CSR_LOG_ENABLE
#include "csr_log.h"
#endif
#ifndef EXCLUDE_CSR_WIFI_ROUTER_CTRL_MODULE
#include "csr_wifi_router_ctrl_serialize.h"
#include "csr_wifi_router_ctrl_prim.h"
static CsrMsgConvMsgEntry csrwifirouterctrl_conv_lut[] = {
{ CSR_WIFI_ROUTER_CTRL_CONFIGURE_POWER_MODE_REQ, CsrWifiRouterCtrlConfigurePowerModeReqSizeof, CsrWifiRouterCtrlConfigurePowerModeReqSer, CsrWifiRouterCtrlConfigurePowerModeReqDes, CsrWifiRouterCtrlConfigurePowerModeReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_HIP_REQ, CsrWifiRouterCtrlHipReqSizeof, CsrWifiRouterCtrlHipReqSer, CsrWifiRouterCtrlHipReqDes, CsrWifiRouterCtrlHipReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_MEDIA_STATUS_REQ, CsrWifiRouterCtrlMediaStatusReqSizeof, CsrWifiRouterCtrlMediaStatusReqSer, CsrWifiRouterCtrlMediaStatusReqDes, CsrWifiRouterCtrlMediaStatusReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_MULTICAST_ADDRESS_RES, CsrWifiRouterCtrlMulticastAddressResSizeof, CsrWifiRouterCtrlMulticastAddressResSer, CsrWifiRouterCtrlMulticastAddressResDes, CsrWifiRouterCtrlMulticastAddressResSerFree },
{ CSR_WIFI_ROUTER_CTRL_PORT_CONFIGURE_REQ, CsrWifiRouterCtrlPortConfigureReqSizeof, CsrWifiRouterCtrlPortConfigureReqSer, CsrWifiRouterCtrlPortConfigureReqDes, CsrWifiRouterCtrlPortConfigureReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_QOS_CONTROL_REQ, CsrWifiRouterCtrlQosControlReqSizeof, CsrWifiRouterCtrlQosControlReqSer, CsrWifiRouterCtrlQosControlReqDes, CsrWifiRouterCtrlQosControlReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_SUSPEND_RES, CsrWifiRouterCtrlSuspendResSizeof, CsrWifiRouterCtrlSuspendResSer, CsrWifiRouterCtrlSuspendResDes, CsrWifiRouterCtrlSuspendResSerFree },
{ CSR_WIFI_ROUTER_CTRL_TCLAS_ADD_REQ, CsrWifiRouterCtrlTclasAddReqSizeof, CsrWifiRouterCtrlTclasAddReqSer, CsrWifiRouterCtrlTclasAddReqDes, CsrWifiRouterCtrlTclasAddReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_RESUME_RES, CsrWifiRouterCtrlResumeResSizeof, CsrWifiRouterCtrlResumeResSer, CsrWifiRouterCtrlResumeResDes, CsrWifiRouterCtrlResumeResSerFree },
{ CSR_WIFI_ROUTER_CTRL_RAW_SDIO_DEINITIALISE_REQ, CsrWifiRouterCtrlRawSdioDeinitialiseReqSizeof, CsrWifiRouterCtrlRawSdioDeinitialiseReqSer, CsrWifiRouterCtrlRawSdioDeinitialiseReqDes, CsrWifiRouterCtrlRawSdioDeinitialiseReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_RAW_SDIO_INITIALISE_REQ, CsrWifiRouterCtrlRawSdioInitialiseReqSizeof, CsrWifiRouterCtrlRawSdioInitialiseReqSer, CsrWifiRouterCtrlRawSdioInitialiseReqDes, CsrWifiRouterCtrlRawSdioInitialiseReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_TCLAS_DEL_REQ, CsrWifiRouterCtrlTclasDelReqSizeof, CsrWifiRouterCtrlTclasDelReqSer, CsrWifiRouterCtrlTclasDelReqDes, CsrWifiRouterCtrlTclasDelReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_TRAFFIC_CLASSIFICATION_REQ, CsrWifiRouterCtrlTrafficClassificationReqSizeof, CsrWifiRouterCtrlTrafficClassificationReqSer, CsrWifiRouterCtrlTrafficClassificationReqDes, CsrWifiRouterCtrlTrafficClassificationReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_TRAFFIC_CONFIG_REQ, CsrWifiRouterCtrlTrafficConfigReqSizeof, CsrWifiRouterCtrlTrafficConfigReqSer, CsrWifiRouterCtrlTrafficConfigReqDes, CsrWifiRouterCtrlTrafficConfigReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_WIFI_OFF_REQ, CsrWifiRouterCtrlWifiOffReqSizeof, CsrWifiRouterCtrlWifiOffReqSer, CsrWifiRouterCtrlWifiOffReqDes, CsrWifiRouterCtrlWifiOffReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_WIFI_OFF_RES, CsrWifiRouterCtrlWifiOffResSizeof, CsrWifiRouterCtrlWifiOffResSer, CsrWifiRouterCtrlWifiOffResDes, CsrWifiRouterCtrlWifiOffResSerFree },
{ CSR_WIFI_ROUTER_CTRL_WIFI_ON_REQ, CsrWifiRouterCtrlWifiOnReqSizeof, CsrWifiRouterCtrlWifiOnReqSer, CsrWifiRouterCtrlWifiOnReqDes, CsrWifiRouterCtrlWifiOnReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_WIFI_ON_RES, CsrWifiRouterCtrlWifiOnResSizeof, CsrWifiRouterCtrlWifiOnResSer, CsrWifiRouterCtrlWifiOnResDes, CsrWifiRouterCtrlWifiOnResSerFree },
{ CSR_WIFI_ROUTER_CTRL_M4_TRANSMIT_REQ, CsrWifiRouterCtrlM4TransmitReqSizeof, CsrWifiRouterCtrlM4TransmitReqSer, CsrWifiRouterCtrlM4TransmitReqDes, CsrWifiRouterCtrlM4TransmitReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_MODE_SET_REQ, CsrWifiRouterCtrlModeSetReqSizeof, CsrWifiRouterCtrlModeSetReqSer, CsrWifiRouterCtrlModeSetReqDes, CsrWifiRouterCtrlModeSetReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_PEER_ADD_REQ, CsrWifiRouterCtrlPeerAddReqSizeof, CsrWifiRouterCtrlPeerAddReqSer, CsrWifiRouterCtrlPeerAddReqDes, CsrWifiRouterCtrlPeerAddReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_PEER_DEL_REQ, CsrWifiRouterCtrlPeerDelReqSizeof, CsrWifiRouterCtrlPeerDelReqSer, CsrWifiRouterCtrlPeerDelReqDes, CsrWifiRouterCtrlPeerDelReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_PEER_UPDATE_REQ, CsrWifiRouterCtrlPeerUpdateReqSizeof, CsrWifiRouterCtrlPeerUpdateReqSer, CsrWifiRouterCtrlPeerUpdateReqDes, CsrWifiRouterCtrlPeerUpdateReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_CAPABILITIES_REQ, CsrWifiRouterCtrlCapabilitiesReqSizeof, CsrWifiRouterCtrlCapabilitiesReqSer, CsrWifiRouterCtrlCapabilitiesReqDes, CsrWifiRouterCtrlCapabilitiesReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_BLOCK_ACK_ENABLE_REQ, CsrWifiRouterCtrlBlockAckEnableReqSizeof, CsrWifiRouterCtrlBlockAckEnableReqSer, CsrWifiRouterCtrlBlockAckEnableReqDes, CsrWifiRouterCtrlBlockAckEnableReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_BLOCK_ACK_DISABLE_REQ, CsrWifiRouterCtrlBlockAckDisableReqSizeof, CsrWifiRouterCtrlBlockAckDisableReqSer, CsrWifiRouterCtrlBlockAckDisableReqDes, CsrWifiRouterCtrlBlockAckDisableReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_WAPI_RX_PKT_REQ, CsrWifiRouterCtrlWapiRxPktReqSizeof, CsrWifiRouterCtrlWapiRxPktReqSer, CsrWifiRouterCtrlWapiRxPktReqDes, CsrWifiRouterCtrlWapiRxPktReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_WAPI_MULTICAST_FILTER_REQ, CsrWifiRouterCtrlWapiMulticastFilterReqSizeof, CsrWifiRouterCtrlWapiMulticastFilterReqSer, CsrWifiRouterCtrlWapiMulticastFilterReqDes, CsrWifiRouterCtrlWapiMulticastFilterReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_FILTER_REQ, CsrWifiRouterCtrlWapiUnicastFilterReqSizeof, CsrWifiRouterCtrlWapiUnicastFilterReqSer, CsrWifiRouterCtrlWapiUnicastFilterReqDes, CsrWifiRouterCtrlWapiUnicastFilterReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_TX_PKT_REQ, CsrWifiRouterCtrlWapiUnicastTxPktReqSizeof, CsrWifiRouterCtrlWapiUnicastTxPktReqSer, CsrWifiRouterCtrlWapiUnicastTxPktReqDes, CsrWifiRouterCtrlWapiUnicastTxPktReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_WAPI_FILTER_REQ, CsrWifiRouterCtrlWapiFilterReqSizeof, CsrWifiRouterCtrlWapiFilterReqSer, CsrWifiRouterCtrlWapiFilterReqDes, CsrWifiRouterCtrlWapiFilterReqSerFree },
{ CSR_WIFI_ROUTER_CTRL_HIP_IND, CsrWifiRouterCtrlHipIndSizeof, CsrWifiRouterCtrlHipIndSer, CsrWifiRouterCtrlHipIndDes, CsrWifiRouterCtrlHipIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_MULTICAST_ADDRESS_IND, CsrWifiRouterCtrlMulticastAddressIndSizeof, CsrWifiRouterCtrlMulticastAddressIndSer, CsrWifiRouterCtrlMulticastAddressIndDes, CsrWifiRouterCtrlMulticastAddressIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_PORT_CONFIGURE_CFM, CsrWifiRouterCtrlPortConfigureCfmSizeof, CsrWifiRouterCtrlPortConfigureCfmSer, CsrWifiRouterCtrlPortConfigureCfmDes, CsrWifiRouterCtrlPortConfigureCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_RESUME_IND, CsrWifiRouterCtrlResumeIndSizeof, CsrWifiRouterCtrlResumeIndSer, CsrWifiRouterCtrlResumeIndDes, CsrWifiRouterCtrlResumeIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_SUSPEND_IND, CsrWifiRouterCtrlSuspendIndSizeof, CsrWifiRouterCtrlSuspendIndSer, CsrWifiRouterCtrlSuspendIndDes, CsrWifiRouterCtrlSuspendIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_TCLAS_ADD_CFM, CsrWifiRouterCtrlTclasAddCfmSizeof, CsrWifiRouterCtrlTclasAddCfmSer, CsrWifiRouterCtrlTclasAddCfmDes, CsrWifiRouterCtrlTclasAddCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_RAW_SDIO_DEINITIALISE_CFM, CsrWifiRouterCtrlRawSdioDeinitialiseCfmSizeof, CsrWifiRouterCtrlRawSdioDeinitialiseCfmSer, CsrWifiRouterCtrlRawSdioDeinitialiseCfmDes, CsrWifiRouterCtrlRawSdioDeinitialiseCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_RAW_SDIO_INITIALISE_CFM, CsrWifiRouterCtrlRawSdioInitialiseCfmSizeof, CsrWifiRouterCtrlRawSdioInitialiseCfmSer, CsrWifiRouterCtrlRawSdioInitialiseCfmDes, CsrWifiRouterCtrlRawSdioInitialiseCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_TCLAS_DEL_CFM, CsrWifiRouterCtrlTclasDelCfmSizeof, CsrWifiRouterCtrlTclasDelCfmSer, CsrWifiRouterCtrlTclasDelCfmDes, CsrWifiRouterCtrlTclasDelCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_TRAFFIC_PROTOCOL_IND, CsrWifiRouterCtrlTrafficProtocolIndSizeof, CsrWifiRouterCtrlTrafficProtocolIndSer, CsrWifiRouterCtrlTrafficProtocolIndDes, CsrWifiRouterCtrlTrafficProtocolIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_TRAFFIC_SAMPLE_IND, CsrWifiRouterCtrlTrafficSampleIndSizeof, CsrWifiRouterCtrlTrafficSampleIndSer, CsrWifiRouterCtrlTrafficSampleIndDes, CsrWifiRouterCtrlTrafficSampleIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_WIFI_OFF_IND, CsrWifiRouterCtrlWifiOffIndSizeof, CsrWifiRouterCtrlWifiOffIndSer, CsrWifiRouterCtrlWifiOffIndDes, CsrWifiRouterCtrlWifiOffIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_WIFI_OFF_CFM, CsrWifiRouterCtrlWifiOffCfmSizeof, CsrWifiRouterCtrlWifiOffCfmSer, CsrWifiRouterCtrlWifiOffCfmDes, CsrWifiRouterCtrlWifiOffCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_WIFI_ON_IND, CsrWifiRouterCtrlWifiOnIndSizeof, CsrWifiRouterCtrlWifiOnIndSer, CsrWifiRouterCtrlWifiOnIndDes, CsrWifiRouterCtrlWifiOnIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_WIFI_ON_CFM, CsrWifiRouterCtrlWifiOnCfmSizeof, CsrWifiRouterCtrlWifiOnCfmSer, CsrWifiRouterCtrlWifiOnCfmDes, CsrWifiRouterCtrlWifiOnCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_M4_READY_TO_SEND_IND, CsrWifiRouterCtrlM4ReadyToSendIndSizeof, CsrWifiRouterCtrlM4ReadyToSendIndSer, CsrWifiRouterCtrlM4ReadyToSendIndDes, CsrWifiRouterCtrlM4ReadyToSendIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_M4_TRANSMITTED_IND, CsrWifiRouterCtrlM4TransmittedIndSizeof, CsrWifiRouterCtrlM4TransmittedIndSer, CsrWifiRouterCtrlM4TransmittedIndDes, CsrWifiRouterCtrlM4TransmittedIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_MIC_FAILURE_IND, CsrWifiRouterCtrlMicFailureIndSizeof, CsrWifiRouterCtrlMicFailureIndSer, CsrWifiRouterCtrlMicFailureIndDes, CsrWifiRouterCtrlMicFailureIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_CONNECTED_IND, CsrWifiRouterCtrlConnectedIndSizeof, CsrWifiRouterCtrlConnectedIndSer, CsrWifiRouterCtrlConnectedIndDes, CsrWifiRouterCtrlConnectedIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_PEER_ADD_CFM, CsrWifiRouterCtrlPeerAddCfmSizeof, CsrWifiRouterCtrlPeerAddCfmSer, CsrWifiRouterCtrlPeerAddCfmDes, CsrWifiRouterCtrlPeerAddCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_PEER_DEL_CFM, CsrWifiRouterCtrlPeerDelCfmSizeof, CsrWifiRouterCtrlPeerDelCfmSer, CsrWifiRouterCtrlPeerDelCfmDes, CsrWifiRouterCtrlPeerDelCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_UNEXPECTED_FRAME_IND, CsrWifiRouterCtrlUnexpectedFrameIndSizeof, CsrWifiRouterCtrlUnexpectedFrameIndSer, CsrWifiRouterCtrlUnexpectedFrameIndDes, CsrWifiRouterCtrlUnexpectedFrameIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_PEER_UPDATE_CFM, CsrWifiRouterCtrlPeerUpdateCfmSizeof, CsrWifiRouterCtrlPeerUpdateCfmSer, CsrWifiRouterCtrlPeerUpdateCfmDes, CsrWifiRouterCtrlPeerUpdateCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_CAPABILITIES_CFM, CsrWifiRouterCtrlCapabilitiesCfmSizeof, CsrWifiRouterCtrlCapabilitiesCfmSer, CsrWifiRouterCtrlCapabilitiesCfmDes, CsrWifiRouterCtrlCapabilitiesCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_BLOCK_ACK_ENABLE_CFM, CsrWifiRouterCtrlBlockAckEnableCfmSizeof, CsrWifiRouterCtrlBlockAckEnableCfmSer, CsrWifiRouterCtrlBlockAckEnableCfmDes, CsrWifiRouterCtrlBlockAckEnableCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_BLOCK_ACK_DISABLE_CFM, CsrWifiRouterCtrlBlockAckDisableCfmSizeof, CsrWifiRouterCtrlBlockAckDisableCfmSer, CsrWifiRouterCtrlBlockAckDisableCfmDes, CsrWifiRouterCtrlBlockAckDisableCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_BLOCK_ACK_ERROR_IND, CsrWifiRouterCtrlBlockAckErrorIndSizeof, CsrWifiRouterCtrlBlockAckErrorIndSer, CsrWifiRouterCtrlBlockAckErrorIndDes, CsrWifiRouterCtrlBlockAckErrorIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_STA_INACTIVE_IND, CsrWifiRouterCtrlStaInactiveIndSizeof, CsrWifiRouterCtrlStaInactiveIndSer, CsrWifiRouterCtrlStaInactiveIndDes, CsrWifiRouterCtrlStaInactiveIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_WAPI_RX_MIC_CHECK_IND, CsrWifiRouterCtrlWapiRxMicCheckIndSizeof, CsrWifiRouterCtrlWapiRxMicCheckIndSer, CsrWifiRouterCtrlWapiRxMicCheckIndDes, CsrWifiRouterCtrlWapiRxMicCheckIndSerFree },
{ CSR_WIFI_ROUTER_CTRL_MODE_SET_CFM, CsrWifiRouterCtrlModeSetCfmSizeof, CsrWifiRouterCtrlModeSetCfmSer, CsrWifiRouterCtrlModeSetCfmDes, CsrWifiRouterCtrlModeSetCfmSerFree },
{ CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_TX_ENCRYPT_IND, CsrWifiRouterCtrlWapiUnicastTxEncryptIndSizeof, CsrWifiRouterCtrlWapiUnicastTxEncryptIndSer, CsrWifiRouterCtrlWapiUnicastTxEncryptIndDes, CsrWifiRouterCtrlWapiUnicastTxEncryptIndSerFree },
{ 0, NULL, NULL, NULL, NULL },
};
CsrMsgConvMsgEntry* CsrWifiRouterCtrlConverterLookup(CsrMsgConvMsgEntry *ce, u16 msgType)
{
if (msgType & CSR_PRIM_UPSTREAM)
{
u16 idx = (msgType & ~CSR_PRIM_UPSTREAM) + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_COUNT;
if (idx < (CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_COUNT + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_COUNT) &&
csrwifirouterctrl_conv_lut[idx].msgType == msgType)
{
return &csrwifirouterctrl_conv_lut[idx];
}
}
else
{
if (msgType < CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_COUNT &&
csrwifirouterctrl_conv_lut[msgType].msgType == msgType)
{
return &csrwifirouterctrl_conv_lut[msgType];
}
}
return NULL;
}
void CsrWifiRouterCtrlConverterInit(void)
{
CsrMsgConvInsert(CSR_WIFI_ROUTER_CTRL_PRIM, csrwifirouterctrl_conv_lut);
CsrMsgConvCustomLookupRegister(CSR_WIFI_ROUTER_CTRL_PRIM, CsrWifiRouterCtrlConverterLookup);
}
#ifdef CSR_LOG_ENABLE
static const CsrLogPrimitiveInformation csrwifirouterctrl_conv_info = {
CSR_WIFI_ROUTER_CTRL_PRIM,
(char *)"CSR_WIFI_ROUTER_CTRL_PRIM",
csrwifirouterctrl_conv_lut
};
const CsrLogPrimitiveInformation* CsrWifiRouterCtrlTechInfoGet(void)
{
return &csrwifirouterctrl_conv_info;
}
#endif /* CSR_LOG_ENABLE */
#endif /* EXCLUDE_CSR_WIFI_ROUTER_CTRL_MODULE */

View file

@ -1,34 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_ROUTER_CTRL_CONVERTER_INIT_H__
#define CSR_WIFI_ROUTER_CTRL_CONVERTER_INIT_H__
#ifndef EXCLUDE_CSR_WIFI_ROUTER_CTRL_MODULE
#include "csr_msgconv.h"
#ifdef CSR_LOG_ENABLE
#include "csr_log.h"
extern const CsrLogPrimitiveInformation* CsrWifiRouterCtrlTechInfoGet(void);
#endif /* CSR_LOG_ENABLE */
extern void CsrWifiRouterCtrlConverterInit(void);
#else /* EXCLUDE_CSR_WIFI_ROUTER_CTRL_MODULE */
#define CsrWifiRouterCtrlConverterInit()
#endif /* EXCLUDE_CSR_WIFI_ROUTER_CTRL_MODULE */
#endif /* CSR_WIFI_ROUTER_CTRL_CONVERTER_INIT_H__ */

View file

@ -1,108 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include <linux/slab.h>
#include "csr_wifi_router_ctrl_prim.h"
#include "csr_wifi_router_ctrl_lib.h"
/*----------------------------------------------------------------------------*
* NAME
* CsrWifiRouterCtrlFreeDownstreamMessageContents
*
* DESCRIPTION
*
*
* PARAMETERS
* eventClass: only the value CSR_WIFI_ROUTER_CTRL_PRIM will be handled
* message: the message to free
*----------------------------------------------------------------------------*/
void CsrWifiRouterCtrlFreeDownstreamMessageContents(u16 eventClass, void *message)
{
if (eventClass != CSR_WIFI_ROUTER_CTRL_PRIM)
{
return;
}
if (NULL == message)
{
return;
}
switch (*((CsrWifiRouterCtrlPrim *) message))
{
case CSR_WIFI_ROUTER_CTRL_HIP_REQ:
{
CsrWifiRouterCtrlHipReq *p = (CsrWifiRouterCtrlHipReq *)message;
kfree(p->mlmeCommand);
p->mlmeCommand = NULL;
kfree(p->dataRef1);
p->dataRef1 = NULL;
kfree(p->dataRef2);
p->dataRef2 = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_MULTICAST_ADDRESS_RES:
{
CsrWifiRouterCtrlMulticastAddressRes *p = (CsrWifiRouterCtrlMulticastAddressRes *)message;
kfree(p->getAddresses);
p->getAddresses = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_TCLAS_ADD_REQ:
{
CsrWifiRouterCtrlTclasAddReq *p = (CsrWifiRouterCtrlTclasAddReq *)message;
kfree(p->tclas);
p->tclas = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_TCLAS_DEL_REQ:
{
CsrWifiRouterCtrlTclasDelReq *p = (CsrWifiRouterCtrlTclasDelReq *)message;
kfree(p->tclas);
p->tclas = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WIFI_ON_REQ:
{
CsrWifiRouterCtrlWifiOnReq *p = (CsrWifiRouterCtrlWifiOnReq *)message;
kfree(p->data);
p->data = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WIFI_ON_RES:
{
CsrWifiRouterCtrlWifiOnRes *p = (CsrWifiRouterCtrlWifiOnRes *)message;
kfree(p->smeVersions.smeBuild);
p->smeVersions.smeBuild = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_RX_PKT_REQ:
{
CsrWifiRouterCtrlWapiRxPktReq *p = (CsrWifiRouterCtrlWapiRxPktReq *)message;
kfree(p->signal);
p->signal = NULL;
kfree(p->data);
p->data = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_TX_PKT_REQ:
{
CsrWifiRouterCtrlWapiUnicastTxPktReq *p = (CsrWifiRouterCtrlWapiUnicastTxPktReq *)message;
kfree(p->data);
p->data = NULL;
break;
}
default:
break;
}
}

View file

@ -1,87 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include <linux/slab.h>
#include "csr_wifi_router_ctrl_prim.h"
#include "csr_wifi_router_ctrl_lib.h"
/*----------------------------------------------------------------------------*
* NAME
* CsrWifiRouterCtrlFreeUpstreamMessageContents
*
* DESCRIPTION
*
*
* PARAMETERS
* eventClass: only the value CSR_WIFI_ROUTER_CTRL_PRIM will be handled
* message: the message to free
*----------------------------------------------------------------------------*/
void CsrWifiRouterCtrlFreeUpstreamMessageContents(u16 eventClass, void *message)
{
if (eventClass != CSR_WIFI_ROUTER_CTRL_PRIM)
{
return;
}
if (NULL == message)
{
return;
}
switch (*((CsrWifiRouterCtrlPrim *) message))
{
case CSR_WIFI_ROUTER_CTRL_HIP_IND:
{
CsrWifiRouterCtrlHipInd *p = (CsrWifiRouterCtrlHipInd *)message;
kfree(p->mlmeCommand);
p->mlmeCommand = NULL;
kfree(p->dataRef1);
p->dataRef1 = NULL;
kfree(p->dataRef2);
p->dataRef2 = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_MULTICAST_ADDRESS_IND:
{
CsrWifiRouterCtrlMulticastAddressInd *p = (CsrWifiRouterCtrlMulticastAddressInd *)message;
kfree(p->setAddresses);
p->setAddresses = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WIFI_ON_IND:
{
CsrWifiRouterCtrlWifiOnInd *p = (CsrWifiRouterCtrlWifiOnInd *)message;
kfree(p->versions.routerBuild);
p->versions.routerBuild = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_RX_MIC_CHECK_IND:
{
CsrWifiRouterCtrlWapiRxMicCheckInd *p = (CsrWifiRouterCtrlWapiRxMicCheckInd *)message;
kfree(p->signal);
p->signal = NULL;
kfree(p->data);
p->data = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_TX_ENCRYPT_IND:
{
CsrWifiRouterCtrlWapiUnicastTxEncryptInd *p = (CsrWifiRouterCtrlWapiUnicastTxEncryptInd *)message;
kfree(p->data);
p->data = NULL;
break;
}
default:
break;
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,46 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
Confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include "csr_wifi_router_ctrl_sef.h"
const CsrWifiRouterCtrlStateHandlerType
CsrWifiRouterCtrlDownstreamStateHandlers
[CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_COUNT] = {
/* 0x0000 */ CsrWifiRouterCtrlConfigurePowerModeReqHandler,
/* 0x0001 */ CsrWifiRouterCtrlHipReqHandler,
/* 0x0002 */ CsrWifiRouterCtrlMediaStatusReqHandler,
/* 0x0003 */ CsrWifiRouterCtrlMulticastAddressResHandler,
/* 0x0004 */ CsrWifiRouterCtrlPortConfigureReqHandler,
/* 0x0005 */ CsrWifiRouterCtrlQosControlReqHandler,
/* 0x0006 */ CsrWifiRouterCtrlSuspendResHandler,
/* 0x0007 */ CsrWifiRouterCtrlTclasAddReqHandler,
/* 0x0008 */ CsrWifiRouterCtrlResumeResHandler,
/* 0x0009 */ CsrWifiRouterCtrlRawSdioDeinitialiseReqHandler,
/* 0x000A */ CsrWifiRouterCtrlRawSdioInitialiseReqHandler,
/* 0x000B */ CsrWifiRouterCtrlTclasDelReqHandler,
/* 0x000C */ CsrWifiRouterCtrlTrafficClassificationReqHandler,
/* 0x000D */ CsrWifiRouterCtrlTrafficConfigReqHandler,
/* 0x000E */ CsrWifiRouterCtrlWifiOffReqHandler,
/* 0x000F */ CsrWifiRouterCtrlWifiOffResHandler,
/* 0x0010 */ CsrWifiRouterCtrlWifiOnReqHandler,
/* 0x0011 */ CsrWifiRouterCtrlWifiOnResHandler,
/* 0x0012 */ CsrWifiRouterCtrlM4TransmitReqHandler,
/* 0x0013 */ CsrWifiRouterCtrlModeSetReqHandler,
/* 0x0014 */ CsrWifiRouterCtrlPeerAddReqHandler,
/* 0x0015 */ CsrWifiRouterCtrlPeerDelReqHandler,
/* 0x0016 */ CsrWifiRouterCtrlPeerUpdateReqHandler,
/* 0x0017 */ CsrWifiRouterCtrlCapabilitiesReqHandler,
/* 0x0018 */ CsrWifiRouterCtrlBlockAckEnableReqHandler,
/* 0x0019 */ CsrWifiRouterCtrlBlockAckDisableReqHandler,
/* 0x001A */ CsrWifiRouterCtrlWapiRxPktReqHandler,
/* 0x001B */ CsrWifiRouterCtrlWapiMulticastFilterReqHandler,
/* 0x001C */ CsrWifiRouterCtrlWapiUnicastFilterReqHandler,
/* 0x001D */ CsrWifiRouterCtrlWapiUnicastTxPktReqHandler,
/* 0x001E */ CsrWifiRouterCtrlWapiFilterReqHandler,
};

View file

@ -1,51 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
Confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_ROUTER_SEF_CSR_WIFI_ROUTER_CTRL_H__
#define CSR_WIFI_ROUTER_SEF_CSR_WIFI_ROUTER_CTRL_H__
#include "csr_wifi_router_ctrl_prim.h"
typedef void (*CsrWifiRouterCtrlStateHandlerType)(void* drvpriv, CsrWifiFsmEvent* msg);
extern const CsrWifiRouterCtrlStateHandlerType CsrWifiRouterCtrlDownstreamStateHandlers[CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_COUNT];
extern void CsrWifiRouterCtrlConfigurePowerModeReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlHipReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlMediaStatusReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlMulticastAddressResHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlPortConfigureReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlQosControlReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlSuspendResHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlTclasAddReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlResumeResHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlRawSdioDeinitialiseReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlRawSdioInitialiseReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlTclasDelReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlTrafficClassificationReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlTrafficConfigReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWifiOffReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWifiOffResHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWifiOnReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWifiOnResHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlM4TransmitReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlModeSetReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlPeerAddReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlPeerDelReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlPeerUpdateReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlCapabilitiesReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlBlockAckEnableReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlBlockAckDisableReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWapiMulticastFilterReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWapiRxPktReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWapiUnicastTxPktReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWapiUnicastFilterReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWapiFilterReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
#endif /* CSR_WIFI_ROUTER_SEF_CSR_WIFI_ROUTER_CTRL_H__ */

File diff suppressed because it is too large Load diff

View file

@ -1,333 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_ROUTER_CTRL_SERIALIZE_H__
#define CSR_WIFI_ROUTER_CTRL_SERIALIZE_H__
#include "csr_wifi_msgconv.h"
#include "csr_wifi_router_ctrl_prim.h"
extern void CsrWifiRouterCtrlPfree(void *ptr);
extern u8* CsrWifiRouterCtrlConfigurePowerModeReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlConfigurePowerModeReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlConfigurePowerModeReqSizeof(void *msg);
#define CsrWifiRouterCtrlConfigurePowerModeReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlHipReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlHipReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlHipReqSizeof(void *msg);
extern void CsrWifiRouterCtrlHipReqSerFree(void *msg);
extern u8* CsrWifiRouterCtrlMediaStatusReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlMediaStatusReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlMediaStatusReqSizeof(void *msg);
#define CsrWifiRouterCtrlMediaStatusReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlMulticastAddressResSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlMulticastAddressResDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlMulticastAddressResSizeof(void *msg);
extern void CsrWifiRouterCtrlMulticastAddressResSerFree(void *msg);
extern u8* CsrWifiRouterCtrlPortConfigureReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlPortConfigureReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlPortConfigureReqSizeof(void *msg);
#define CsrWifiRouterCtrlPortConfigureReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlQosControlReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlQosControlReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlQosControlReqSizeof(void *msg);
#define CsrWifiRouterCtrlQosControlReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlSuspendResSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlSuspendResDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlSuspendResSizeof(void *msg);
#define CsrWifiRouterCtrlSuspendResSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlTclasAddReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlTclasAddReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlTclasAddReqSizeof(void *msg);
extern void CsrWifiRouterCtrlTclasAddReqSerFree(void *msg);
extern u8* CsrWifiRouterCtrlResumeResSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlResumeResDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlResumeResSizeof(void *msg);
#define CsrWifiRouterCtrlResumeResSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlRawSdioDeinitialiseReqSer CsrWifiEventCsrUint16Ser
#define CsrWifiRouterCtrlRawSdioDeinitialiseReqDes CsrWifiEventCsrUint16Des
#define CsrWifiRouterCtrlRawSdioDeinitialiseReqSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiRouterCtrlRawSdioDeinitialiseReqSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlRawSdioInitialiseReqSer CsrWifiEventCsrUint16Ser
#define CsrWifiRouterCtrlRawSdioInitialiseReqDes CsrWifiEventCsrUint16Des
#define CsrWifiRouterCtrlRawSdioInitialiseReqSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiRouterCtrlRawSdioInitialiseReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlTclasDelReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlTclasDelReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlTclasDelReqSizeof(void *msg);
extern void CsrWifiRouterCtrlTclasDelReqSerFree(void *msg);
extern u8* CsrWifiRouterCtrlTrafficClassificationReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlTrafficClassificationReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlTrafficClassificationReqSizeof(void *msg);
#define CsrWifiRouterCtrlTrafficClassificationReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlTrafficConfigReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlTrafficConfigReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlTrafficConfigReqSizeof(void *msg);
#define CsrWifiRouterCtrlTrafficConfigReqSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlWifiOffReqSer CsrWifiEventCsrUint16Ser
#define CsrWifiRouterCtrlWifiOffReqDes CsrWifiEventCsrUint16Des
#define CsrWifiRouterCtrlWifiOffReqSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiRouterCtrlWifiOffReqSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlWifiOffResSer CsrWifiEventCsrUint16Ser
#define CsrWifiRouterCtrlWifiOffResDes CsrWifiEventCsrUint16Des
#define CsrWifiRouterCtrlWifiOffResSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiRouterCtrlWifiOffResSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlWifiOnReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlWifiOnReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlWifiOnReqSizeof(void *msg);
extern void CsrWifiRouterCtrlWifiOnReqSerFree(void *msg);
extern u8* CsrWifiRouterCtrlWifiOnResSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlWifiOnResDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlWifiOnResSizeof(void *msg);
extern void CsrWifiRouterCtrlWifiOnResSerFree(void *msg);
extern u8* CsrWifiRouterCtrlM4TransmitReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlM4TransmitReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlM4TransmitReqSizeof(void *msg);
#define CsrWifiRouterCtrlM4TransmitReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlModeSetReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlModeSetReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlModeSetReqSizeof(void *msg);
#define CsrWifiRouterCtrlModeSetReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlPeerAddReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlPeerAddReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlPeerAddReqSizeof(void *msg);
#define CsrWifiRouterCtrlPeerAddReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlPeerDelReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlPeerDelReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlPeerDelReqSizeof(void *msg);
#define CsrWifiRouterCtrlPeerDelReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlPeerUpdateReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlPeerUpdateReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlPeerUpdateReqSizeof(void *msg);
#define CsrWifiRouterCtrlPeerUpdateReqSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlCapabilitiesReqSer CsrWifiEventCsrUint16Ser
#define CsrWifiRouterCtrlCapabilitiesReqDes CsrWifiEventCsrUint16Des
#define CsrWifiRouterCtrlCapabilitiesReqSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiRouterCtrlCapabilitiesReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlBlockAckEnableReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlBlockAckEnableReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlBlockAckEnableReqSizeof(void *msg);
#define CsrWifiRouterCtrlBlockAckEnableReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlBlockAckDisableReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlBlockAckDisableReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlBlockAckDisableReqSizeof(void *msg);
#define CsrWifiRouterCtrlBlockAckDisableReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlWapiRxPktReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlWapiRxPktReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlWapiRxPktReqSizeof(void *msg);
extern void CsrWifiRouterCtrlWapiRxPktReqSerFree(void *msg);
#define CsrWifiRouterCtrlWapiMulticastFilterReqSer CsrWifiEventCsrUint16CsrUint8Ser
#define CsrWifiRouterCtrlWapiMulticastFilterReqDes CsrWifiEventCsrUint16CsrUint8Des
#define CsrWifiRouterCtrlWapiMulticastFilterReqSizeof CsrWifiEventCsrUint16CsrUint8Sizeof
#define CsrWifiRouterCtrlWapiMulticastFilterReqSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlWapiUnicastFilterReqSer CsrWifiEventCsrUint16CsrUint8Ser
#define CsrWifiRouterCtrlWapiUnicastFilterReqDes CsrWifiEventCsrUint16CsrUint8Des
#define CsrWifiRouterCtrlWapiUnicastFilterReqSizeof CsrWifiEventCsrUint16CsrUint8Sizeof
#define CsrWifiRouterCtrlWapiUnicastFilterReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlWapiUnicastTxPktReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlWapiUnicastTxPktReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlWapiUnicastTxPktReqSizeof(void *msg);
extern void CsrWifiRouterCtrlWapiUnicastTxPktReqSerFree(void *msg);
#define CsrWifiRouterCtrlWapiFilterReqSer CsrWifiEventCsrUint16CsrUint8Ser
#define CsrWifiRouterCtrlWapiFilterReqDes CsrWifiEventCsrUint16CsrUint8Des
#define CsrWifiRouterCtrlWapiFilterReqSizeof CsrWifiEventCsrUint16CsrUint8Sizeof
#define CsrWifiRouterCtrlWapiFilterReqSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlHipIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlHipIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlHipIndSizeof(void *msg);
extern void CsrWifiRouterCtrlHipIndSerFree(void *msg);
extern u8* CsrWifiRouterCtrlMulticastAddressIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlMulticastAddressIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlMulticastAddressIndSizeof(void *msg);
extern void CsrWifiRouterCtrlMulticastAddressIndSerFree(void *msg);
extern u8* CsrWifiRouterCtrlPortConfigureCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlPortConfigureCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlPortConfigureCfmSizeof(void *msg);
#define CsrWifiRouterCtrlPortConfigureCfmSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlResumeIndSer CsrWifiEventCsrUint16CsrUint8Ser
#define CsrWifiRouterCtrlResumeIndDes CsrWifiEventCsrUint16CsrUint8Des
#define CsrWifiRouterCtrlResumeIndSizeof CsrWifiEventCsrUint16CsrUint8Sizeof
#define CsrWifiRouterCtrlResumeIndSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlSuspendIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlSuspendIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlSuspendIndSizeof(void *msg);
#define CsrWifiRouterCtrlSuspendIndSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlTclasAddCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlTclasAddCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlTclasAddCfmSizeof(void *msg);
#define CsrWifiRouterCtrlTclasAddCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlRawSdioDeinitialiseCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlRawSdioDeinitialiseCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlRawSdioDeinitialiseCfmSizeof(void *msg);
#define CsrWifiRouterCtrlRawSdioDeinitialiseCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlRawSdioInitialiseCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlRawSdioInitialiseCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlRawSdioInitialiseCfmSizeof(void *msg);
#define CsrWifiRouterCtrlRawSdioInitialiseCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlTclasDelCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlTclasDelCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlTclasDelCfmSizeof(void *msg);
#define CsrWifiRouterCtrlTclasDelCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlTrafficProtocolIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlTrafficProtocolIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlTrafficProtocolIndSizeof(void *msg);
#define CsrWifiRouterCtrlTrafficProtocolIndSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlTrafficSampleIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlTrafficSampleIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlTrafficSampleIndSizeof(void *msg);
#define CsrWifiRouterCtrlTrafficSampleIndSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlWifiOffIndSer CsrWifiEventCsrUint16CsrUint8Ser
#define CsrWifiRouterCtrlWifiOffIndDes CsrWifiEventCsrUint16CsrUint8Des
#define CsrWifiRouterCtrlWifiOffIndSizeof CsrWifiEventCsrUint16CsrUint8Sizeof
#define CsrWifiRouterCtrlWifiOffIndSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlWifiOffCfmSer CsrWifiEventCsrUint16Ser
#define CsrWifiRouterCtrlWifiOffCfmDes CsrWifiEventCsrUint16Des
#define CsrWifiRouterCtrlWifiOffCfmSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiRouterCtrlWifiOffCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlWifiOnIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlWifiOnIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlWifiOnIndSizeof(void *msg);
extern void CsrWifiRouterCtrlWifiOnIndSerFree(void *msg);
extern u8* CsrWifiRouterCtrlWifiOnCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlWifiOnCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlWifiOnCfmSizeof(void *msg);
#define CsrWifiRouterCtrlWifiOnCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlM4ReadyToSendIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlM4ReadyToSendIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlM4ReadyToSendIndSizeof(void *msg);
#define CsrWifiRouterCtrlM4ReadyToSendIndSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlM4TransmittedIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlM4TransmittedIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlM4TransmittedIndSizeof(void *msg);
#define CsrWifiRouterCtrlM4TransmittedIndSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlMicFailureIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlMicFailureIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlMicFailureIndSizeof(void *msg);
#define CsrWifiRouterCtrlMicFailureIndSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlConnectedIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlConnectedIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlConnectedIndSizeof(void *msg);
#define CsrWifiRouterCtrlConnectedIndSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlPeerAddCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlPeerAddCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlPeerAddCfmSizeof(void *msg);
#define CsrWifiRouterCtrlPeerAddCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlPeerDelCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlPeerDelCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlPeerDelCfmSizeof(void *msg);
#define CsrWifiRouterCtrlPeerDelCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlUnexpectedFrameIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlUnexpectedFrameIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlUnexpectedFrameIndSizeof(void *msg);
#define CsrWifiRouterCtrlUnexpectedFrameIndSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlPeerUpdateCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlPeerUpdateCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlPeerUpdateCfmSizeof(void *msg);
#define CsrWifiRouterCtrlPeerUpdateCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlCapabilitiesCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlCapabilitiesCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlCapabilitiesCfmSizeof(void *msg);
#define CsrWifiRouterCtrlCapabilitiesCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlBlockAckEnableCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlBlockAckEnableCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlBlockAckEnableCfmSizeof(void *msg);
#define CsrWifiRouterCtrlBlockAckEnableCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlBlockAckDisableCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlBlockAckDisableCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlBlockAckDisableCfmSizeof(void *msg);
#define CsrWifiRouterCtrlBlockAckDisableCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlBlockAckErrorIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlBlockAckErrorIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlBlockAckErrorIndSizeof(void *msg);
#define CsrWifiRouterCtrlBlockAckErrorIndSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlStaInactiveIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlStaInactiveIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlStaInactiveIndSizeof(void *msg);
#define CsrWifiRouterCtrlStaInactiveIndSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlWapiRxMicCheckIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlWapiRxMicCheckIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlWapiRxMicCheckIndSizeof(void *msg);
extern void CsrWifiRouterCtrlWapiRxMicCheckIndSerFree(void *msg);
extern u8* CsrWifiRouterCtrlModeSetCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlModeSetCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlModeSetCfmSizeof(void *msg);
#define CsrWifiRouterCtrlModeSetCfmSerFree CsrWifiRouterCtrlPfree
extern u8* CsrWifiRouterCtrlWapiUnicastTxEncryptIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterCtrlWapiUnicastTxEncryptIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterCtrlWapiUnicastTxEncryptIndSizeof(void *msg);
extern void CsrWifiRouterCtrlWapiUnicastTxEncryptIndSerFree(void *msg);
#endif /* CSR_WIFI_ROUTER_CTRL_SERIALIZE_H__ */

View file

@ -1,53 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include <linux/slab.h>
#include "csr_wifi_router_prim.h"
#include "csr_wifi_router_lib.h"
/*----------------------------------------------------------------------------*
* NAME
* CsrWifiRouterFreeDownstreamMessageContents
*
* DESCRIPTION
*
*
* PARAMETERS
* eventClass: only the value CSR_WIFI_ROUTER_PRIM will be handled
* message: the message to free
*----------------------------------------------------------------------------*/
void CsrWifiRouterFreeDownstreamMessageContents(u16 eventClass, void *message)
{
if (eventClass != CSR_WIFI_ROUTER_PRIM)
{
return;
}
if (NULL == message)
{
return;
}
switch (*((CsrWifiRouterPrim *) message))
{
case CSR_WIFI_ROUTER_MA_PACKET_REQ:
{
CsrWifiRouterMaPacketReq *p = (CsrWifiRouterMaPacketReq *)message;
kfree(p->frame);
p->frame = NULL;
break;
}
default:
break;
}
}

View file

@ -1,47 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include <linux/slab.h>
#include "csr_wifi_router_prim.h"
#include "csr_wifi_router_lib.h"
/*----------------------------------------------------------------------------*
* NAME
* CsrWifiRouterFreeUpstreamMessageContents
*
* DESCRIPTION
*
*
* PARAMETERS
* eventClass: only the value CSR_WIFI_ROUTER_PRIM will be handled
* message: the message to free
*----------------------------------------------------------------------------*/
void CsrWifiRouterFreeUpstreamMessageContents(u16 eventClass, void *message)
{
if (eventClass != CSR_WIFI_ROUTER_PRIM)
return;
if (NULL == message)
return;
switch (*((CsrWifiRouterPrim *) message)) {
case CSR_WIFI_ROUTER_MA_PACKET_IND:
{
CsrWifiRouterMaPacketInd *p =
(CsrWifiRouterMaPacketInd *) message;
kfree(p->frame);
p->frame = NULL;
break;
}
default:
break;
}
}

View file

@ -1,417 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_ROUTER_LIB_H__
#define CSR_WIFI_ROUTER_LIB_H__
#include "csr_sched.h"
#include "csr_macro.h"
#include "csr_msg_transport.h"
#include "csr_wifi_lib.h"
#include "csr_wifi_router_prim.h"
#include "csr_wifi_router_task.h"
/*----------------------------------------------------------------------------*
* CsrWifiRouterFreeUpstreamMessageContents
*
* DESCRIPTION
* Free the allocated memory in a CSR_WIFI_ROUTER upstream message. Does not
* free the message itself, and can only be used for upstream messages.
*
* PARAMETERS
* Deallocates the resources in a CSR_WIFI_ROUTER upstream message
*----------------------------------------------------------------------------*/
void CsrWifiRouterFreeUpstreamMessageContents(u16 eventClass, void *message);
/*----------------------------------------------------------------------------*
* CsrWifiRouterFreeDownstreamMessageContents
*
* DESCRIPTION
* Free the allocated memory in a CSR_WIFI_ROUTER downstream message. Does not
* free the message itself, and can only be used for downstream messages.
*
* PARAMETERS
* Deallocates the resources in a CSR_WIFI_ROUTER downstream message
*----------------------------------------------------------------------------*/
void CsrWifiRouterFreeDownstreamMessageContents(u16 eventClass, void *message);
/*----------------------------------------------------------------------------*
* Enum to string functions
*----------------------------------------------------------------------------*/
const char* CsrWifiRouterAppTypeToString(CsrWifiRouterAppType value);
const char* CsrWifiRouterEncapsulationToString(CsrWifiRouterEncapsulation value);
const char* CsrWifiRouterOuiToString(CsrWifiRouterOui value);
const char* CsrWifiRouterPriorityToString(CsrWifiRouterPriority value);
/*----------------------------------------------------------------------------*
* CsrPrim Type toString function.
* Converts a message type to the String name of the Message
*----------------------------------------------------------------------------*/
const char* CsrWifiRouterPrimTypeToString(CsrPrim msgType);
/*----------------------------------------------------------------------------*
* Lookup arrays for PrimType name Strings
*----------------------------------------------------------------------------*/
extern const char *CsrWifiRouterUpstreamPrimNames[CSR_WIFI_ROUTER_PRIM_UPSTREAM_COUNT];
extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT];
/*******************************************************************************
NAME
CsrWifiRouterMaPacketCancelReqSend
DESCRIPTION
This primitive is used to request cancellation of a previously send
CsrWifiRouterMaPacketReq.
The frame may already have been transmitted so there is no guarantees
that the CsrWifiRouterMaPacketCancelReq actually cancels the transmission
of the frame in question.
If the cancellation fails, the Router will send, if required,
CsrWifiRouterMaPacketCfm.
If the cancellation succeeds, the Router will not send
CsrWifiRouterMaPacketCfm.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an interface
hostTag - The hostTag for the frame, which should be cancelled.
priority - Priority of the frame, which should be cancelled
peerMacAddress - Destination MAC address of the frame, which should be
cancelled
*******************************************************************************/
#define CsrWifiRouterMaPacketCancelReqCreate(msg__, dst__, src__, interfaceTag__, hostTag__, priority__, peerMacAddress__) \
msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketCancelReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_CANCEL_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->hostTag = (hostTag__); \
msg__->priority = (priority__); \
msg__->peerMacAddress = (peerMacAddress__);
#define CsrWifiRouterMaPacketCancelReqSendTo(dst__, src__, interfaceTag__, hostTag__, priority__, peerMacAddress__) \
{ \
CsrWifiRouterMaPacketCancelReq *msg__; \
CsrWifiRouterMaPacketCancelReqCreate(msg__, dst__, src__, interfaceTag__, hostTag__, priority__, peerMacAddress__); \
CsrMsgTransport(dst__, CSR_WIFI_ROUTER_PRIM, msg__); \
}
#define CsrWifiRouterMaPacketCancelReqSend(src__, interfaceTag__, hostTag__, priority__, peerMacAddress__) \
CsrWifiRouterMaPacketCancelReqSendTo(CSR_WIFI_ROUTER_IFACEQUEUE, src__, interfaceTag__, hostTag__, priority__, peerMacAddress__)
/*******************************************************************************
NAME
CsrWifiRouterMaPacketReqSend
DESCRIPTION
A task sends this primitive to transmit a frame.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an interface
subscriptionHandle - The handle of the subscription
frameLength - Length of the frame to be sent in bytes
frame - Pointer to the frame to be sent
freeFunction - Pointer to function to be used to free the frame
priority - Priority of the frame, which should be sent
hostTag - An application shall set the bits b31..b28 using one of
the CSR_WIFI_ROUTER_APP_TYPE_* masks. Bits b0..b27 can
be used by the requestor without any restrictions, but
the hostTag shall be unique so the hostTag for
CSR_WIFI_ROUTER_APP _TYPE_OTHER should be constructured
in the following way [ CSR_WIFI_ROUTER_APP_TYPE_OTHER
(4 bits) | SubscriptionHandle (8 bits) | Sequence no.
(20 bits) ]. If the hostTag is not unique, the
behaviour of the system is unpredicatable with respect
to data/management frame transfer.
cfmRequested - Indicates if the requestor needs a confirm for packet
requests sent under this subscription. If set to TRUE,
the router will send a confirm, else it will not send
any confirm
*******************************************************************************/
#define CsrWifiRouterMaPacketReqCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, frameLength__, frame__, freeFunction__, priority__, hostTag__, cfmRequested__) \
msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->subscriptionHandle = (subscriptionHandle__); \
msg__->frameLength = (frameLength__); \
msg__->frame = (frame__); \
msg__->freeFunction = (freeFunction__); \
msg__->priority = (priority__); \
msg__->hostTag = (hostTag__); \
msg__->cfmRequested = (cfmRequested__);
#define CsrWifiRouterMaPacketReqSendTo(dst__, src__, interfaceTag__, subscriptionHandle__, frameLength__, frame__, freeFunction__, priority__, hostTag__, cfmRequested__) \
{ \
CsrWifiRouterMaPacketReq *msg__; \
CsrWifiRouterMaPacketReqCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, frameLength__, frame__, freeFunction__, priority__, hostTag__, cfmRequested__); \
CsrMsgTransport(dst__, CSR_WIFI_ROUTER_PRIM, msg__); \
}
#define CsrWifiRouterMaPacketReqSend(src__, interfaceTag__, subscriptionHandle__, frameLength__, frame__, freeFunction__, priority__, hostTag__, cfmRequested__) \
CsrWifiRouterMaPacketReqSendTo(CSR_WIFI_ROUTER_IFACEQUEUE, src__, interfaceTag__, subscriptionHandle__, frameLength__, frame__, freeFunction__, priority__, hostTag__, cfmRequested__)
/*******************************************************************************
NAME
CsrWifiRouterMaPacketIndSend
DESCRIPTION
The router sends the primitive to a subscribed task when it receives a
frame matching the subscription.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
subscriptionHandle - The handle of the subscription
result - Status of the operation
frameLength - Length of the received frame in bytes
frame - Pointer to the received frame
freeFunction - Pointer to function to be used to free the frame
rssi - Received signal strength indication in dBm
snr - Signal to Noise Ratio
rate - Transmission/Reception rate
*******************************************************************************/
#define CsrWifiRouterMaPacketIndCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, result__, frameLength__, frame__, freeFunction__, rssi__, snr__, rate__) \
msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->subscriptionHandle = (subscriptionHandle__); \
msg__->result = (result__); \
msg__->frameLength = (frameLength__); \
msg__->frame = (frame__); \
msg__->freeFunction = (freeFunction__); \
msg__->rssi = (rssi__); \
msg__->snr = (snr__); \
msg__->rate = (rate__);
#define CsrWifiRouterMaPacketIndSendTo(dst__, src__, interfaceTag__, subscriptionHandle__, result__, frameLength__, frame__, freeFunction__, rssi__, snr__, rate__) \
{ \
CsrWifiRouterMaPacketInd *msg__; \
CsrWifiRouterMaPacketIndCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, result__, frameLength__, frame__, freeFunction__, rssi__, snr__, rate__); \
CsrSchedMessagePut(dst__, CSR_WIFI_ROUTER_PRIM, msg__); \
}
#define CsrWifiRouterMaPacketIndSend(dst__, interfaceTag__, subscriptionHandle__, result__, frameLength__, frame__, freeFunction__, rssi__, snr__, rate__) \
CsrWifiRouterMaPacketIndSendTo(dst__, CSR_WIFI_ROUTER_IFACEQUEUE, interfaceTag__, subscriptionHandle__, result__, frameLength__, frame__, freeFunction__, rssi__, snr__, rate__)
/*******************************************************************************
NAME
CsrWifiRouterMaPacketResSend
DESCRIPTION
A task send this primitive to confirm the reception of the received
frame.
PARAMETERS
interfaceTag - Interface Identifier; unique identifier of an interface
subscriptionHandle - The handle of the subscription
result - Status of the operation
*******************************************************************************/
#define CsrWifiRouterMaPacketResCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, result__) \
msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketRes), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_RES, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->subscriptionHandle = (subscriptionHandle__); \
msg__->result = (result__);
#define CsrWifiRouterMaPacketResSendTo(dst__, src__, interfaceTag__, subscriptionHandle__, result__) \
{ \
CsrWifiRouterMaPacketRes *msg__; \
CsrWifiRouterMaPacketResCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, result__); \
CsrMsgTransport(dst__, CSR_WIFI_ROUTER_PRIM, msg__); \
}
#define CsrWifiRouterMaPacketResSend(src__, interfaceTag__, subscriptionHandle__, result__) \
CsrWifiRouterMaPacketResSendTo(CSR_WIFI_ROUTER_IFACEQUEUE, src__, interfaceTag__, subscriptionHandle__, result__)
/*******************************************************************************
NAME
CsrWifiRouterMaPacketCfmSend
DESCRIPTION
The router sends the primitive to confirm the result of the transmission
of the packet of the corresponding CSR_WIFI_ROUTER MA_PACKET_REQ request.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
result - Status of the operation
hostTag - The hostTrag will match the hostTag sent in the request.
rate - Transmission/Reception rate
*******************************************************************************/
#define CsrWifiRouterMaPacketCfmCreate(msg__, dst__, src__, interfaceTag__, result__, hostTag__, rate__) \
msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->result = (result__); \
msg__->hostTag = (hostTag__); \
msg__->rate = (rate__);
#define CsrWifiRouterMaPacketCfmSendTo(dst__, src__, interfaceTag__, result__, hostTag__, rate__) \
{ \
CsrWifiRouterMaPacketCfm *msg__; \
CsrWifiRouterMaPacketCfmCreate(msg__, dst__, src__, interfaceTag__, result__, hostTag__, rate__); \
CsrSchedMessagePut(dst__, CSR_WIFI_ROUTER_PRIM, msg__); \
}
#define CsrWifiRouterMaPacketCfmSend(dst__, interfaceTag__, result__, hostTag__, rate__) \
CsrWifiRouterMaPacketCfmSendTo(dst__, CSR_WIFI_ROUTER_IFACEQUEUE, interfaceTag__, result__, hostTag__, rate__)
/*******************************************************************************
NAME
CsrWifiRouterMaPacketSubscribeReqSend
DESCRIPTION
A task can use this primitive to subscribe for a particular OUI/protocol
and transmit and receive frames matching the subscription.
NOTE: Multiple subscriptions for a given protocol and OUI will result in
the first subscription receiving the data and not the subsequent
subscriptions.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an interface
encapsulation - Specifies the encapsulation type, which will be used for the
subscription
protocol - Together with the OUI, specifies the protocol, which a task
wants to subscribe to
oui - Specifies the OUI for the protocol, which a task wants to
subscribe to
*******************************************************************************/
#define CsrWifiRouterMaPacketSubscribeReqCreate(msg__, dst__, src__, interfaceTag__, encapsulation__, protocol__, oui__) \
msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketSubscribeReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->encapsulation = (encapsulation__); \
msg__->protocol = (protocol__); \
msg__->oui = (oui__);
#define CsrWifiRouterMaPacketSubscribeReqSendTo(dst__, src__, interfaceTag__, encapsulation__, protocol__, oui__) \
{ \
CsrWifiRouterMaPacketSubscribeReq *msg__; \
CsrWifiRouterMaPacketSubscribeReqCreate(msg__, dst__, src__, interfaceTag__, encapsulation__, protocol__, oui__); \
CsrMsgTransport(dst__, CSR_WIFI_ROUTER_PRIM, msg__); \
}
#define CsrWifiRouterMaPacketSubscribeReqSend(src__, interfaceTag__, encapsulation__, protocol__, oui__) \
CsrWifiRouterMaPacketSubscribeReqSendTo(CSR_WIFI_ROUTER_IFACEQUEUE, src__, interfaceTag__, encapsulation__, protocol__, oui__)
/*******************************************************************************
NAME
CsrWifiRouterMaPacketSubscribeCfmSend
DESCRIPTION
The router sends this primitive to confirm the result of the
subscription.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
subscriptionHandle - Handle to the subscription
This handle must be used in all subsequent requests
status - Status of the operation
allocOffset - Size of the offset for the frames of the subscription
*******************************************************************************/
#define CsrWifiRouterMaPacketSubscribeCfmCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, status__, allocOffset__) \
msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketSubscribeCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->subscriptionHandle = (subscriptionHandle__); \
msg__->status = (status__); \
msg__->allocOffset = (allocOffset__);
#define CsrWifiRouterMaPacketSubscribeCfmSendTo(dst__, src__, interfaceTag__, subscriptionHandle__, status__, allocOffset__) \
{ \
CsrWifiRouterMaPacketSubscribeCfm *msg__; \
CsrWifiRouterMaPacketSubscribeCfmCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, status__, allocOffset__); \
CsrSchedMessagePut(dst__, CSR_WIFI_ROUTER_PRIM, msg__); \
}
#define CsrWifiRouterMaPacketSubscribeCfmSend(dst__, interfaceTag__, subscriptionHandle__, status__, allocOffset__) \
CsrWifiRouterMaPacketSubscribeCfmSendTo(dst__, CSR_WIFI_ROUTER_IFACEQUEUE, interfaceTag__, subscriptionHandle__, status__, allocOffset__)
/*******************************************************************************
NAME
CsrWifiRouterMaPacketUnsubscribeReqSend
DESCRIPTION
A task sends this primitive to unsubscribe a subscription
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag - Interface Identifier; unique identifier of an interface
subscriptionHandle - The handle of the subscription
*******************************************************************************/
#define CsrWifiRouterMaPacketUnsubscribeReqCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__) \
msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketUnsubscribeReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->subscriptionHandle = (subscriptionHandle__);
#define CsrWifiRouterMaPacketUnsubscribeReqSendTo(dst__, src__, interfaceTag__, subscriptionHandle__) \
{ \
CsrWifiRouterMaPacketUnsubscribeReq *msg__; \
CsrWifiRouterMaPacketUnsubscribeReqCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__); \
CsrMsgTransport(dst__, CSR_WIFI_ROUTER_PRIM, msg__); \
}
#define CsrWifiRouterMaPacketUnsubscribeReqSend(src__, interfaceTag__, subscriptionHandle__) \
CsrWifiRouterMaPacketUnsubscribeReqSendTo(CSR_WIFI_ROUTER_IFACEQUEUE, src__, interfaceTag__, subscriptionHandle__)
/*******************************************************************************
NAME
CsrWifiRouterMaPacketUnsubscribeCfmSend
DESCRIPTION
The router sends this primitive to confirm the result of the
unsubscription.
PARAMETERS
queue - Destination Task Queue
interfaceTag - Interface Identifier; unique identifier of an interface
status - Status of the operation
*******************************************************************************/
#define CsrWifiRouterMaPacketUnsubscribeCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketUnsubscribeCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__);
#define CsrWifiRouterMaPacketUnsubscribeCfmSendTo(dst__, src__, interfaceTag__, status__) \
{ \
CsrWifiRouterMaPacketUnsubscribeCfm *msg__; \
CsrWifiRouterMaPacketUnsubscribeCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_ROUTER_PRIM, msg__); \
}
#define CsrWifiRouterMaPacketUnsubscribeCfmSend(dst__, interfaceTag__, status__) \
CsrWifiRouterMaPacketUnsubscribeCfmSendTo(dst__, CSR_WIFI_ROUTER_IFACEQUEUE, interfaceTag__, status__)
#endif /* CSR_WIFI_ROUTER_LIB_H__ */

View file

@ -1,421 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_ROUTER_PRIM_H__
#define CSR_WIFI_ROUTER_PRIM_H__
#include <linux/types.h>
#include "csr_prim_defs.h"
#include "csr_sched.h"
#include "csr_wifi_common.h"
#include "csr_result.h"
#include "csr_wifi_fsm_event.h"
#define CSR_WIFI_ROUTER_PRIM (0x0400)
typedef CsrPrim CsrWifiRouterPrim;
typedef void (*CsrWifiRouterFrameFreeFunction)(void *frame);
/*******************************************************************************
NAME
CsrWifiRouterAppType
DESCRIPTION
VALUES
CSR_WIFI_ROUTER_APP_TYPE_SME -
CSR_WIFI_ROUTER_APP_TYPE_PAL -
CSR_WIFI_ROUTER_APP_TYPE_NME -
CSR_WIFI_ROUTER_APP_TYPE_OTHER -
*******************************************************************************/
typedef u8 CsrWifiRouterAppType;
#define CSR_WIFI_ROUTER_APP_TYPE_SME ((CsrWifiRouterAppType) 0x0)
#define CSR_WIFI_ROUTER_APP_TYPE_PAL ((CsrWifiRouterAppType) 0x1)
#define CSR_WIFI_ROUTER_APP_TYPE_NME ((CsrWifiRouterAppType) 0x2)
#define CSR_WIFI_ROUTER_APP_TYPE_OTHER ((CsrWifiRouterAppType) 0x3)
/*******************************************************************************
NAME
CsrWifiRouterEncapsulation
DESCRIPTION
Indicates the type of encapsulation used for the subscription
VALUES
CSR_WIFI_ROUTER_ENCAPSULATION_ETHERNET
- Ethernet encapsulation
CSR_WIFI_ROUTER_ENCAPSULATION_LLC_SNAP
- LLC/SNAP encapsulation
*******************************************************************************/
typedef u8 CsrWifiRouterEncapsulation;
#define CSR_WIFI_ROUTER_ENCAPSULATION_ETHERNET ((CsrWifiRouterEncapsulation) 0x00)
#define CSR_WIFI_ROUTER_ENCAPSULATION_LLC_SNAP ((CsrWifiRouterEncapsulation) 0x01)
/*******************************************************************************
NAME
CsrWifiRouterOui
DESCRIPTION
VALUES
CSR_WIFI_ROUTER_OUI_RFC_1042 -
CSR_WIFI_ROUTER_OUI_BT -
*******************************************************************************/
typedef u32 CsrWifiRouterOui;
#define CSR_WIFI_ROUTER_OUI_RFC_1042 ((CsrWifiRouterOui) 0x000000)
#define CSR_WIFI_ROUTER_OUI_BT ((CsrWifiRouterOui) 0x001958)
/*******************************************************************************
NAME
CsrWifiRouterPriority
DESCRIPTION
As defined in the IEEE 802.11 standards
VALUES
CSR_WIFI_ROUTER_PRIORITY_QOS_UP0
- See IEEE 802.11 Standard
CSR_WIFI_ROUTER_PRIORITY_QOS_UP1
- See IEEE 802.11 Standard
CSR_WIFI_ROUTER_PRIORITY_QOS_UP2
- See IEEE 802.11 Standard
CSR_WIFI_ROUTER_PRIORITY_QOS_UP3
- See IEEE 802.11 Standard
CSR_WIFI_ROUTER_PRIORITY_QOS_UP4
- See IEEE 802.11 Standard
CSR_WIFI_ROUTER_PRIORITY_QOS_UP5
- See IEEE 802.11 Standard
CSR_WIFI_ROUTER_PRIORITY_QOS_UP6
- See IEEE 802.11 Standard
CSR_WIFI_ROUTER_PRIORITY_QOS_UP7
- See IEEE 802.11 Standard
CSR_WIFI_ROUTER_PRIORITY_CONTENTION
- See IEEE 802.11 Standard
CSR_WIFI_ROUTER_PRIORITY_MANAGEMENT
- See IEEE 802.11 Standard
*******************************************************************************/
typedef u16 CsrWifiRouterPriority;
#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP0 ((CsrWifiRouterPriority) 0x0000)
#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP1 ((CsrWifiRouterPriority) 0x0001)
#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP2 ((CsrWifiRouterPriority) 0x0002)
#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP3 ((CsrWifiRouterPriority) 0x0003)
#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP4 ((CsrWifiRouterPriority) 0x0004)
#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP5 ((CsrWifiRouterPriority) 0x0005)
#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP6 ((CsrWifiRouterPriority) 0x0006)
#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP7 ((CsrWifiRouterPriority) 0x0007)
#define CSR_WIFI_ROUTER_PRIORITY_CONTENTION ((CsrWifiRouterPriority) 0x8000)
#define CSR_WIFI_ROUTER_PRIORITY_MANAGEMENT ((CsrWifiRouterPriority) 0x8010)
/* Downstream */
#define CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST (0x0000)
#define CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_REQ ((CsrWifiRouterPrim) (0x0000 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_REQ ((CsrWifiRouterPrim) (0x0001 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_MA_PACKET_REQ ((CsrWifiRouterPrim) (0x0002 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_MA_PACKET_RES ((CsrWifiRouterPrim) (0x0003 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_MA_PACKET_CANCEL_REQ ((CsrWifiRouterPrim) (0x0004 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_HIGHEST (0x0004 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST)
/* Upstream */
#define CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST (0x0000 + CSR_PRIM_UPSTREAM)
#define CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_CFM ((CsrWifiRouterPrim)(0x0000 + CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_CFM ((CsrWifiRouterPrim)(0x0001 + CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_MA_PACKET_CFM ((CsrWifiRouterPrim)(0x0002 + CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_MA_PACKET_IND ((CsrWifiRouterPrim)(0x0003 + CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_PRIM_UPSTREAM_HIGHEST (0x0003 + CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST)
#define CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT (CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_HIGHEST + 1 - CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST)
#define CSR_WIFI_ROUTER_PRIM_UPSTREAM_COUNT (CSR_WIFI_ROUTER_PRIM_UPSTREAM_HIGHEST + 1 - CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST)
/*******************************************************************************
NAME
CsrWifiRouterMaPacketSubscribeReq
DESCRIPTION
A task can use this primitive to subscribe for a particular OUI/protocol
and transmit and receive frames matching the subscription.
NOTE: Multiple subscriptions for a given protocol and OUI will result in
the first subscription receiving the data and not the subsequent
subscriptions.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
encapsulation - Specifies the encapsulation type, which will be used for the
subscription
protocol - Together with the OUI, specifies the protocol, which a task
wants to subscribe to
oui - Specifies the OUI for the protocol, which a task wants to
subscribe to
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrWifiRouterEncapsulation encapsulation;
u16 protocol;
u32 oui;
} CsrWifiRouterMaPacketSubscribeReq;
/*******************************************************************************
NAME
CsrWifiRouterMaPacketUnsubscribeReq
DESCRIPTION
A task sends this primitive to unsubscribe a subscription
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
subscriptionHandle - The handle of the subscription
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
u8 subscriptionHandle;
} CsrWifiRouterMaPacketUnsubscribeReq;
/*******************************************************************************
NAME
CsrWifiRouterMaPacketReq
DESCRIPTION
A task sends this primitive to transmit a frame.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
subscriptionHandle - The handle of the subscription
frameLength - Length of the frame to be sent in bytes
frame - Pointer to the frame to be sent
freeFunction - Pointer to function to be used to free the frame
priority - Priority of the frame, which should be sent
hostTag - An application shall set the bits b31..b28 using one of
the CSR_WIFI_ROUTER_APP_TYPE_* masks. Bits b0..b27 can
be used by the requestor without any restrictions, but
the hostTag shall be unique so the hostTag for
CSR_WIFI_ROUTER_APP _TYPE_OTHER should be constructured
in the following way [ CSR_WIFI_ROUTER_APP_TYPE_OTHER
(4 bits) | SubscriptionHandle (8 bits) | Sequence no.
(20 bits) ]. If the hostTag is not unique, the
behaviour of the system is unpredicatable with respect
to data/management frame transfer.
cfmRequested - Indicates if the requestor needs a confirm for packet
requests sent under this subscription. If set to TRUE,
the router will send a confirm, else it will not send
any confirm
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
u8 subscriptionHandle;
u16 frameLength;
u8 *frame;
CsrWifiRouterFrameFreeFunction freeFunction;
CsrWifiRouterPriority priority;
u32 hostTag;
u8 cfmRequested;
} CsrWifiRouterMaPacketReq;
/*******************************************************************************
NAME
CsrWifiRouterMaPacketRes
DESCRIPTION
A task send this primitive to confirm the reception of the received
frame.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
subscriptionHandle - The handle of the subscription
result - Status of the operation
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
u8 subscriptionHandle;
CsrResult result;
} CsrWifiRouterMaPacketRes;
/*******************************************************************************
NAME
CsrWifiRouterMaPacketCancelReq
DESCRIPTION
This primitive is used to request cancellation of a previously send
CsrWifiRouterMaPacketReq.
The frame may already have been transmitted so there is no guarantees
that the CsrWifiRouterMaPacketCancelReq actually cancels the transmission
of the frame in question.
If the cancellation fails, the Router will send, if required,
CsrWifiRouterMaPacketCfm.
If the cancellation succeeds, the Router will not send
CsrWifiRouterMaPacketCfm.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
hostTag - The hostTag for the frame, which should be cancelled.
priority - Priority of the frame, which should be cancelled
peerMacAddress - Destination MAC address of the frame, which should be
cancelled
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
u32 hostTag;
CsrWifiRouterPriority priority;
CsrWifiMacAddress peerMacAddress;
} CsrWifiRouterMaPacketCancelReq;
/*******************************************************************************
NAME
CsrWifiRouterMaPacketSubscribeCfm
DESCRIPTION
The router sends this primitive to confirm the result of the
subscription.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
subscriptionHandle - Handle to the subscription
This handle must be used in all subsequent requests
status - Status of the operation
allocOffset - Size of the offset for the frames of the subscription
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
u8 subscriptionHandle;
CsrResult status;
u16 allocOffset;
} CsrWifiRouterMaPacketSubscribeCfm;
/*******************************************************************************
NAME
CsrWifiRouterMaPacketUnsubscribeCfm
DESCRIPTION
The router sends this primitive to confirm the result of the
unsubscription.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
status - Status of the operation
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrResult status;
} CsrWifiRouterMaPacketUnsubscribeCfm;
/*******************************************************************************
NAME
CsrWifiRouterMaPacketCfm
DESCRIPTION
The router sends the primitive to confirm the result of the transmission
of the packet of the corresponding CSR_WIFI_ROUTER MA_PACKET_REQ request.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
result - Status of the operation
hostTag - The hostTrag will match the hostTag sent in the request.
rate - Transmission/Reception rate
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
CsrResult result;
u32 hostTag;
u16 rate;
} CsrWifiRouterMaPacketCfm;
/*******************************************************************************
NAME
CsrWifiRouterMaPacketInd
DESCRIPTION
The router sends the primitive to a subscribed task when it receives a
frame matching the subscription.
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag - Interface Identifier; unique identifier of an interface
subscriptionHandle - The handle of the subscription
result - Status of the operation
frameLength - Length of the received frame in bytes
frame - Pointer to the received frame
freeFunction - Pointer to function to be used to free the frame
rssi - Received signal strength indication in dBm
snr - Signal to Noise Ratio
rate - Transmission/Reception rate
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
u16 interfaceTag;
u8 subscriptionHandle;
CsrResult result;
u16 frameLength;
u8 *frame;
CsrWifiRouterFrameFreeFunction freeFunction;
s16 rssi;
s16 snr;
u16 rate;
} CsrWifiRouterMaPacketInd;
#endif /* CSR_WIFI_ROUTER_PRIM_H__ */

View file

@ -1,19 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
Confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include "csr_wifi_router_sef.h"
const CsrWifiRouterStateHandlerType CsrWifiRouterDownstreamStateHandlers[CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT] =
{
/* 0x0000 */ CsrWifiRouterMaPacketSubscribeReqHandler,
/* 0x0001 */ CsrWifiRouterMaPacketUnsubscribeReqHandler,
/* 0x0002 */ CsrWifiRouterMaPacketReqHandler,
/* 0x0003 */ CsrWifiRouterMaPacketResHandler,
/* 0x0004 */ CsrWifiRouterMaPacketCancelReqHandler,
};

View file

@ -1,25 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
Confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#ifndef CSR_WIFI_ROUTER_SEF_CSR_WIFI_ROUTER_H__
#define CSR_WIFI_ROUTER_SEF_CSR_WIFI_ROUTER_H__
#include "csr_wifi_router_prim.h"
typedef void (*CsrWifiRouterStateHandlerType)(void* drvpriv, CsrWifiFsmEvent* msg);
extern const CsrWifiRouterStateHandlerType CsrWifiRouterDownstreamStateHandlers[CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT];
extern void CsrWifiRouterMaPacketSubscribeReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterMaPacketUnsubscribeReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterMaPacketReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterMaPacketResHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterMaPacketCancelReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
#endif /* CSR_WIFI_ROUTER_SEF_CSR_WIFI_ROUTER_H__ */

View file

@ -1,418 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include <linux/slab.h>
#include "csr_msgconv.h"
#include "csr_wifi_router_prim.h"
#include "csr_wifi_router_serialize.h"
void CsrWifiRouterPfree(void *ptr)
{
kfree(ptr);
}
size_t CsrWifiRouterMaPacketSubscribeReqSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 12) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 1; /* CsrWifiRouterEncapsulation primitive->encapsulation */
bufferSize += 2; /* u16 primitive->protocol */
bufferSize += 4; /* u32 primitive->oui */
return bufferSize;
}
u8* CsrWifiRouterMaPacketSubscribeReqSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiRouterMaPacketSubscribeReq *primitive = (CsrWifiRouterMaPacketSubscribeReq *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint8Ser(ptr, len, (u8) primitive->encapsulation);
CsrUint16Ser(ptr, len, (u16) primitive->protocol);
CsrUint32Ser(ptr, len, (u32) primitive->oui);
return(ptr);
}
void* CsrWifiRouterMaPacketSubscribeReqDes(u8 *buffer, size_t length)
{
CsrWifiRouterMaPacketSubscribeReq *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketSubscribeReq), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint8Des((u8 *) &primitive->encapsulation, buffer, &offset);
CsrUint16Des((u16 *) &primitive->protocol, buffer, &offset);
CsrUint32Des((u32 *) &primitive->oui, buffer, &offset);
return primitive;
}
size_t CsrWifiRouterMaPacketReqSizeof(void *msg)
{
CsrWifiRouterMaPacketReq *primitive = (CsrWifiRouterMaPacketReq *) msg;
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 20) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 1; /* u8 primitive->subscriptionHandle */
bufferSize += 2; /* u16 primitive->frameLength */
bufferSize += primitive->frameLength; /* u8 primitive->frame */
bufferSize += 4; /* CsrWifiRouterFrameFreeFunction primitive->freeFunction */
bufferSize += 2; /* CsrWifiRouterPriority primitive->priority */
bufferSize += 4; /* u32 primitive->hostTag */
bufferSize += 1; /* u8 primitive->cfmRequested */
return bufferSize;
}
u8* CsrWifiRouterMaPacketReqSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiRouterMaPacketReq *primitive = (CsrWifiRouterMaPacketReq *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint8Ser(ptr, len, (u8) primitive->subscriptionHandle);
CsrUint16Ser(ptr, len, (u16) primitive->frameLength);
if (primitive->frameLength)
{
CsrMemCpySer(ptr, len, (const void *) primitive->frame, ((u16) (primitive->frameLength)));
}
CsrUint32Ser(ptr, len, 0); /* Special for Function Pointers... primitive->freeFunction */
CsrUint16Ser(ptr, len, (u16) primitive->priority);
CsrUint32Ser(ptr, len, (u32) primitive->hostTag);
CsrUint8Ser(ptr, len, (u8) primitive->cfmRequested);
return(ptr);
}
void* CsrWifiRouterMaPacketReqDes(u8 *buffer, size_t length)
{
CsrWifiRouterMaPacketReq *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketReq), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint8Des((u8 *) &primitive->subscriptionHandle, buffer, &offset);
CsrUint16Des((u16 *) &primitive->frameLength, buffer, &offset);
if (primitive->frameLength)
{
primitive->frame = kmalloc(primitive->frameLength, GFP_KERNEL);
CsrMemCpyDes(primitive->frame, buffer, &offset, ((u16) (primitive->frameLength)));
}
else
{
primitive->frame = NULL;
}
primitive->freeFunction = NULL; /* Special for Function Pointers... */
offset += 4;
CsrUint16Des((u16 *) &primitive->priority, buffer, &offset);
CsrUint32Des((u32 *) &primitive->hostTag, buffer, &offset);
CsrUint8Des((u8 *) &primitive->cfmRequested, buffer, &offset);
return primitive;
}
void CsrWifiRouterMaPacketReqSerFree(void *voidPrimitivePointer)
{
CsrWifiRouterMaPacketReq *primitive = (CsrWifiRouterMaPacketReq *) voidPrimitivePointer;
kfree(primitive->frame);
kfree(primitive);
}
size_t CsrWifiRouterMaPacketResSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 1; /* u8 primitive->subscriptionHandle */
bufferSize += 2; /* CsrResult primitive->result */
return bufferSize;
}
u8* CsrWifiRouterMaPacketResSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiRouterMaPacketRes *primitive = (CsrWifiRouterMaPacketRes *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint8Ser(ptr, len, (u8) primitive->subscriptionHandle);
CsrUint16Ser(ptr, len, (u16) primitive->result);
return(ptr);
}
void* CsrWifiRouterMaPacketResDes(u8 *buffer, size_t length)
{
CsrWifiRouterMaPacketRes *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketRes), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint8Des((u8 *) &primitive->subscriptionHandle, buffer, &offset);
CsrUint16Des((u16 *) &primitive->result, buffer, &offset);
return primitive;
}
size_t CsrWifiRouterMaPacketCancelReqSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 17) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 4; /* u32 primitive->hostTag */
bufferSize += 2; /* CsrWifiRouterPriority primitive->priority */
bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */
return bufferSize;
}
u8* CsrWifiRouterMaPacketCancelReqSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiRouterMaPacketCancelReq *primitive = (CsrWifiRouterMaPacketCancelReq *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint32Ser(ptr, len, (u32) primitive->hostTag);
CsrUint16Ser(ptr, len, (u16) primitive->priority);
CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6)));
return(ptr);
}
void* CsrWifiRouterMaPacketCancelReqDes(u8 *buffer, size_t length)
{
CsrWifiRouterMaPacketCancelReq *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketCancelReq), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint32Des((u32 *) &primitive->hostTag, buffer, &offset);
CsrUint16Des((u16 *) &primitive->priority, buffer, &offset);
CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6)));
return primitive;
}
size_t CsrWifiRouterMaPacketSubscribeCfmSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 1; /* u8 primitive->subscriptionHandle */
bufferSize += 2; /* CsrResult primitive->status */
bufferSize += 2; /* u16 primitive->allocOffset */
return bufferSize;
}
u8* CsrWifiRouterMaPacketSubscribeCfmSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiRouterMaPacketSubscribeCfm *primitive = (CsrWifiRouterMaPacketSubscribeCfm *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint8Ser(ptr, len, (u8) primitive->subscriptionHandle);
CsrUint16Ser(ptr, len, (u16) primitive->status);
CsrUint16Ser(ptr, len, (u16) primitive->allocOffset);
return(ptr);
}
void* CsrWifiRouterMaPacketSubscribeCfmDes(u8 *buffer, size_t length)
{
CsrWifiRouterMaPacketSubscribeCfm *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketSubscribeCfm), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint8Des((u8 *) &primitive->subscriptionHandle, buffer, &offset);
CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
CsrUint16Des((u16 *) &primitive->allocOffset, buffer, &offset);
return primitive;
}
size_t CsrWifiRouterMaPacketUnsubscribeCfmSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 2; /* CsrResult primitive->status */
return bufferSize;
}
u8* CsrWifiRouterMaPacketUnsubscribeCfmSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiRouterMaPacketUnsubscribeCfm *primitive = (CsrWifiRouterMaPacketUnsubscribeCfm *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint16Ser(ptr, len, (u16) primitive->status);
return(ptr);
}
void* CsrWifiRouterMaPacketUnsubscribeCfmDes(u8 *buffer, size_t length)
{
CsrWifiRouterMaPacketUnsubscribeCfm *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketUnsubscribeCfm), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
return primitive;
}
size_t CsrWifiRouterMaPacketCfmSizeof(void *msg)
{
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 2; /* CsrResult primitive->result */
bufferSize += 4; /* u32 primitive->hostTag */
bufferSize += 2; /* u16 primitive->rate */
return bufferSize;
}
u8* CsrWifiRouterMaPacketCfmSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiRouterMaPacketCfm *primitive = (CsrWifiRouterMaPacketCfm *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint16Ser(ptr, len, (u16) primitive->result);
CsrUint32Ser(ptr, len, (u32) primitive->hostTag);
CsrUint16Ser(ptr, len, (u16) primitive->rate);
return(ptr);
}
void* CsrWifiRouterMaPacketCfmDes(u8 *buffer, size_t length)
{
CsrWifiRouterMaPacketCfm *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketCfm), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint16Des((u16 *) &primitive->result, buffer, &offset);
CsrUint32Des((u32 *) &primitive->hostTag, buffer, &offset);
CsrUint16Des((u16 *) &primitive->rate, buffer, &offset);
return primitive;
}
size_t CsrWifiRouterMaPacketIndSizeof(void *msg)
{
CsrWifiRouterMaPacketInd *primitive = (CsrWifiRouterMaPacketInd *) msg;
size_t bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 21) */
bufferSize += 2; /* u16 primitive->interfaceTag */
bufferSize += 1; /* u8 primitive->subscriptionHandle */
bufferSize += 2; /* CsrResult primitive->result */
bufferSize += 2; /* u16 primitive->frameLength */
bufferSize += primitive->frameLength; /* u8 primitive->frame */
bufferSize += 4; /* CsrWifiRouterFrameFreeFunction primitive->freeFunction */
bufferSize += 2; /* s16 primitive->rssi */
bufferSize += 2; /* s16 primitive->snr */
bufferSize += 2; /* u16 primitive->rate */
return bufferSize;
}
u8* CsrWifiRouterMaPacketIndSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiRouterMaPacketInd *primitive = (CsrWifiRouterMaPacketInd *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
CsrUint8Ser(ptr, len, (u8) primitive->subscriptionHandle);
CsrUint16Ser(ptr, len, (u16) primitive->result);
CsrUint16Ser(ptr, len, (u16) primitive->frameLength);
if (primitive->frameLength)
{
CsrMemCpySer(ptr, len, (const void *) primitive->frame, ((u16) (primitive->frameLength)));
}
CsrUint32Ser(ptr, len, 0); /* Special for Function Pointers... primitive->freeFunction */
CsrUint16Ser(ptr, len, (u16) primitive->rssi);
CsrUint16Ser(ptr, len, (u16) primitive->snr);
CsrUint16Ser(ptr, len, (u16) primitive->rate);
return(ptr);
}
void* CsrWifiRouterMaPacketIndDes(u8 *buffer, size_t length)
{
CsrWifiRouterMaPacketInd *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketInd), GFP_KERNEL);
size_t offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
CsrUint8Des((u8 *) &primitive->subscriptionHandle, buffer, &offset);
CsrUint16Des((u16 *) &primitive->result, buffer, &offset);
CsrUint16Des((u16 *) &primitive->frameLength, buffer, &offset);
if (primitive->frameLength)
{
primitive->frame = kmalloc(primitive->frameLength, GFP_KERNEL);
CsrMemCpyDes(primitive->frame, buffer, &offset, ((u16) (primitive->frameLength)));
}
else
{
primitive->frame = NULL;
}
primitive->freeFunction = NULL; /* Special for Function Pointers... */
offset += 4;
CsrUint16Des((u16 *) &primitive->rssi, buffer, &offset);
CsrUint16Des((u16 *) &primitive->snr, buffer, &offset);
CsrUint16Des((u16 *) &primitive->rate, buffer, &offset);
return primitive;
}
void CsrWifiRouterMaPacketIndSerFree(void *voidPrimitivePointer)
{
CsrWifiRouterMaPacketInd *primitive = (CsrWifiRouterMaPacketInd *) voidPrimitivePointer;
kfree(primitive->frame);
kfree(primitive);
}

View file

@ -1,67 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_ROUTER_SERIALIZE_H__
#define CSR_WIFI_ROUTER_SERIALIZE_H__
#include "csr_wifi_msgconv.h"
#include "csr_wifi_router_prim.h"
extern void CsrWifiRouterPfree(void *ptr);
extern u8* CsrWifiRouterMaPacketSubscribeReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterMaPacketSubscribeReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterMaPacketSubscribeReqSizeof(void *msg);
#define CsrWifiRouterMaPacketSubscribeReqSerFree CsrWifiRouterPfree
#define CsrWifiRouterMaPacketUnsubscribeReqSer CsrWifiEventCsrUint16CsrUint8Ser
#define CsrWifiRouterMaPacketUnsubscribeReqDes CsrWifiEventCsrUint16CsrUint8Des
#define CsrWifiRouterMaPacketUnsubscribeReqSizeof CsrWifiEventCsrUint16CsrUint8Sizeof
#define CsrWifiRouterMaPacketUnsubscribeReqSerFree CsrWifiRouterPfree
extern u8* CsrWifiRouterMaPacketReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterMaPacketReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterMaPacketReqSizeof(void *msg);
extern void CsrWifiRouterMaPacketReqSerFree(void *msg);
extern u8* CsrWifiRouterMaPacketResSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterMaPacketResDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterMaPacketResSizeof(void *msg);
#define CsrWifiRouterMaPacketResSerFree CsrWifiRouterPfree
extern u8* CsrWifiRouterMaPacketCancelReqSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterMaPacketCancelReqDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterMaPacketCancelReqSizeof(void *msg);
#define CsrWifiRouterMaPacketCancelReqSerFree CsrWifiRouterPfree
extern u8* CsrWifiRouterMaPacketSubscribeCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterMaPacketSubscribeCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterMaPacketSubscribeCfmSizeof(void *msg);
#define CsrWifiRouterMaPacketSubscribeCfmSerFree CsrWifiRouterPfree
extern u8* CsrWifiRouterMaPacketUnsubscribeCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterMaPacketUnsubscribeCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterMaPacketUnsubscribeCfmSizeof(void *msg);
#define CsrWifiRouterMaPacketUnsubscribeCfmSerFree CsrWifiRouterPfree
extern u8* CsrWifiRouterMaPacketCfmSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterMaPacketCfmDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterMaPacketCfmSizeof(void *msg);
#define CsrWifiRouterMaPacketCfmSerFree CsrWifiRouterPfree
extern u8* CsrWifiRouterMaPacketIndSer(u8 *ptr, size_t *len, void *msg);
extern void* CsrWifiRouterMaPacketIndDes(u8 *buffer, size_t len);
extern size_t CsrWifiRouterMaPacketIndSizeof(void *msg);
extern void CsrWifiRouterMaPacketIndSerFree(void *msg);
#endif /* CSR_WIFI_ROUTER_SERIALIZE_H__ */

View file

@ -1,25 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_ROUTER_TASK_H__
#define CSR_WIFI_ROUTER_TASK_H__
#include "csr_sched.h"
#define CSR_WIFI_ROUTER_LOG_ID 0x1201FFFF
extern CsrSchedQid CSR_WIFI_ROUTER_IFACEQUEUE;
void CsrWifiRouterInit(void **gash);
void CsrWifiRouterDeinit(void **gash);
void CsrWifiRouterHandler(void **gash);
#endif /* CSR_WIFI_ROUTER_TASK_H__ */

View file

@ -1,199 +0,0 @@
/** @file router_transport.c
*
*
* Copyright (C) Cambridge Silicon Radio Ltd 2006-2010. All rights reserved.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*
****************************************************************************/
#include "unifi_priv.h"
#include "csr_sched.h"
#include "csr_msgconv.h"
#include "sme_userspace.h"
#include "csr_wifi_hostio_prim.h"
#include "csr_wifi_router_lib.h"
#include "csr_wifi_router_sef.h"
#include "csr_wifi_router_converter_init.h"
#include "csr_wifi_router_ctrl_lib.h"
#include "csr_wifi_router_ctrl_sef.h"
#include "csr_wifi_router_ctrl_converter_init.h"
#include "csr_wifi_sme_prim.h"
#include "csr_wifi_sme_sef.h"
#include "csr_wifi_sme_converter_init.h"
#ifdef CSR_SUPPORT_WEXT
#ifdef CSR_SUPPORT_WEXT_AP
#include "csr_wifi_nme_ap_prim.h"
#include "csr_wifi_nme_ap_sef.h"
#include "csr_wifi_nme_ap_converter_init.h"
#endif
#endif
static unifi_priv_t *drvpriv = NULL;
void CsrWifiRouterTransportInit(unifi_priv_t *priv)
{
unifi_trace(priv, UDBG1, "CsrWifiRouterTransportInit: \n");
drvpriv = priv;
(void)CsrMsgConvInit();
CsrWifiRouterConverterInit();
CsrWifiRouterCtrlConverterInit();
CsrWifiSmeConverterInit();
#ifdef CSR_SUPPORT_WEXT
#ifdef CSR_SUPPORT_WEXT_AP
CsrWifiNmeApConverterInit();
#endif
#endif
}
void CsrWifiRouterTransportRecv(unifi_priv_t *priv, u8* buffer, size_t bufferLength)
{
CsrMsgConvMsgEntry* msgEntry;
u16 primType;
CsrSchedQid src;
CsrSchedQid dest;
u16 msgType;
size_t offset = 0;
CsrWifiFsmEvent* msg;
/* Decode the prim and message type */
CsrUint16Des(&primType, buffer, &offset);
CsrUint16Des(&src, buffer, &offset);
CsrUint16Des(&dest, buffer, &offset);
CsrUint16Des(&msgType, buffer, &offset);
offset -= 2; /* Adjust as the Deserialise Function will read this as well */
unifi_trace(priv, UDBG4, "CsrWifiRouterTransportRecv: primType=0x%.4X, msgType=0x%.4X, bufferLength=%d\n",
primType, msgType, bufferLength);
/* Special handling for HOSTIO messages.... */
if (primType == CSR_WIFI_HOSTIO_PRIM)
{
CsrWifiRouterCtrlHipReq req = {{CSR_WIFI_ROUTER_CTRL_HIP_REQ, CSR_WIFI_ROUTER_CTRL_PRIM, dest, src, NULL}, 0, NULL, 0, NULL, 0, NULL};
req.mlmeCommandLength = bufferLength;
req.mlmeCommand = buffer;
offset += 8;/* Skip the id, src, dest and slot number */
CsrUint16Des(&req.dataRef1Length, buffer, &offset);
offset += 2; /* Skip the slot number */
CsrUint16Des(&req.dataRef2Length, buffer, &offset);
if (req.dataRef1Length)
{
u16 dr1Offset = (bufferLength - req.dataRef2Length) - req.dataRef1Length;
req.dataRef1 = &buffer[dr1Offset];
}
if (req.dataRef2Length)
{
u16 dr2Offset = bufferLength - req.dataRef2Length;
req.dataRef2 = &buffer[dr2Offset];
}
/* Copy the hip data but strip off the prim type */
req.mlmeCommandLength -= (req.dataRef1Length + req.dataRef2Length + 6);
req.mlmeCommand = &buffer[6];
CsrWifiRouterCtrlHipReqHandler(priv, &req.common);
return;
}
msgEntry = CsrMsgConvFindEntry(primType, msgType);
if (!msgEntry)
{
unifi_error(priv, "CsrWifiRouterTransportDeserialiseAndSend can not process the message. primType=0x%.4X, msgType=0x%.4X\n",
primType, msgType);
dump(buffer, bufferLength);
return;
}
msg = (CsrWifiFsmEvent*)(msgEntry->deserFunc)(&buffer[offset], bufferLength - offset);
msg->primtype = primType;
msg->type = msgType;
msg->source = src;
msg->destination = dest;
switch(primType)
{
case CSR_WIFI_ROUTER_CTRL_PRIM:
CsrWifiRouterCtrlDownstreamStateHandlers[msg->type - CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST](priv, msg);
CsrWifiRouterCtrlFreeDownstreamMessageContents(CSR_WIFI_ROUTER_CTRL_PRIM, msg);
break;
case CSR_WIFI_ROUTER_PRIM:
CsrWifiRouterDownstreamStateHandlers[msg->type - CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST](priv, msg);
CsrWifiRouterFreeDownstreamMessageContents(CSR_WIFI_ROUTER_PRIM, msg);
break;
case CSR_WIFI_SME_PRIM:
CsrWifiSmeUpstreamStateHandlers[msg->type - CSR_WIFI_SME_PRIM_UPSTREAM_LOWEST](priv, msg);
CsrWifiSmeFreeUpstreamMessageContents(CSR_WIFI_SME_PRIM, msg);
break;
#ifdef CSR_SUPPORT_WEXT
#ifdef CSR_SUPPORT_WEXT_AP
case CSR_WIFI_NME_AP_PRIM:
CsrWifiNmeApUpstreamStateHandlers(priv, msg);
CsrWifiNmeApFreeUpstreamMessageContents(CSR_WIFI_NME_AP_PRIM, msg);
break;
#endif
#endif
default:
unifi_error(priv, "CsrWifiRouterTransportDeserialiseAndSend unhandled prim type 0x%.4X\n", primType);
break;
}
kfree(msg);
}
static void CsrWifiRouterTransportSerialiseAndSend(u16 primType, void* msg)
{
CsrWifiFsmEvent* evt = (CsrWifiFsmEvent*)msg;
CsrMsgConvMsgEntry* msgEntry;
size_t msgSize;
size_t encodeBufferLen = 0;
size_t offset = 0;
u8* encodeBuffer;
unifi_trace(drvpriv, UDBG4, "CsrWifiRouterTransportSerialiseAndSend: primType=0x%.4X, msgType=0x%.4X\n",
primType, evt->type);
msgEntry = CsrMsgConvFindEntry(primType, evt->type);
if (!msgEntry)
{
unifi_error(drvpriv, "CsrWifiRouterTransportSerialiseAndSend can not process the message. primType=0x%.4X, msgType=0x%.4X\n",
primType, evt->type);
return;
}
msgSize = 6 + (msgEntry->sizeofFunc)((void*)msg);
encodeBuffer = kmalloc(msgSize, GFP_KERNEL);
/* Encode PrimType */
CsrUint16Ser(encodeBuffer, &encodeBufferLen, primType);
CsrUint16Ser(encodeBuffer, &encodeBufferLen, evt->source);
CsrUint16Ser(encodeBuffer, &encodeBufferLen, evt->destination);
(void)(msgEntry->serFunc)(&encodeBuffer[encodeBufferLen], &offset, msg);
encodeBufferLen += offset;
uf_sme_queue_message(drvpriv, encodeBuffer, encodeBufferLen);
/* Do not use msgEntry->freeFunc because the memory is owned by the driver */
kfree(msg);
}
#if defined(CSR_LOG_ENABLE) && defined(CSR_LOG_INCLUDE_FILE_NAME_AND_LINE_NUMBER)
void CsrSchedMessagePutStringLog(CsrSchedQid q, u16 mi, void *mv, u32 line, char *file)
#else
void CsrSchedMessagePut(CsrSchedQid q, u16 mi, void *mv)
#endif
{
CsrWifiFsmEvent* evt = (CsrWifiFsmEvent*)mv;
evt->destination = q;
CsrWifiRouterTransportSerialiseAndSend(mi, mv);
}

View file

@ -1,256 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/module.h>
#include <linux/slab.h>
#include "csr_macro.h"
#include "csr_msgconv.h"
#include "csr_wifi_msgconv.h"
#include "csr_wifi_lib.h"
void CsrUint24Des(u32 *v, u8 *buffer, size_t *offset)
{
u32 val;
val = ((buffer[(*offset) + 2] << 16) |
(buffer[(*offset) + 1] << 8) |
(buffer[(*offset)]));
*offset += 3;
*v = val;
}
/* Big endian :e.g WSC, TCLAS */
void CsrUint16DesBigEndian(u16 *v, u8 *buffer, size_t *offset)
{
u16 val;
val = (buffer[(*offset)] << 8) | (buffer[(*offset) + 1]);
*offset += 2;
*v = val;
}
void CsrUint24DesBigEndian(u32 *v, u8 *buffer, size_t *offset)
{
u32 val;
val = ((buffer[(*offset)] << 16) |
(buffer[(*offset) + 1] << 8) |
(buffer[(*offset) + 2]));
*offset += 3;
*v = val;
}
void CsrUint32DesBigEndian(u32 *v, u8 *buffer, size_t *offset)
{
u32 val;
val = ((buffer[(*offset)] << 24) |
(buffer[(*offset) + 1] << 16) |
(buffer[(*offset) + 2] << 8) |
(buffer[(*offset) + 3]));
*offset += 4;
*v = val;
}
void CsrUint24Ser(u8 *ptr, size_t *len, u32 v)
{
ptr[(*len) + 2] = (u8)((v & 0x00ff0000) >> 16);
ptr[(*len) + 1] = (u8)((v & 0x0000ff00) >> 8);
ptr[(*len)] = (u8)((v & 0x000000ff));
*len += 3;
}
/* Big endian :e.g WSC, TCLAS */
void CsrUint16SerBigEndian(u8 *ptr, size_t *len, u16 v)
{
ptr[(*len)] = (u8)((v & 0xff00) >> 8);
ptr[(*len) + 1] = (u8)((v & 0x00ff));
*len += 2;
}
void CsrUint32SerBigEndian(u8 *ptr, size_t *len, u32 v)
{
ptr[(*len)] = (u8)((v & 0xff000000) >> 24);
ptr[(*len) + 1] = (u8)((v & 0x00ff0000) >> 16);
ptr[(*len) + 2] = (u8)((v & 0x0000ff00) >> 8);
ptr[(*len) + 3] = (u8)((v & 0x000000ff));
*len += 4;
}
void CsrUint24SerBigEndian(u8 *ptr, size_t *len, u32 v)
{
ptr[(*len)] = (u8)((v & 0x00ff0000) >> 16);
ptr[(*len) + 1] = (u8)((v & 0x0000ff00) >> 8);
ptr[(*len) + 2] = (u8)((v & 0x000000ff));
*len += 3;
}
size_t CsrWifiEventSizeof(void *msg)
{
return 2;
}
EXPORT_SYMBOL_GPL(CsrWifiEventSizeof);
u8* CsrWifiEventSer(u8 *ptr, size_t *len, void *msg)
{
CsrWifiFsmEvent *primitive = (CsrWifiFsmEvent *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->type);
return(ptr);
}
EXPORT_SYMBOL_GPL(CsrWifiEventSer);
void* CsrWifiEventDes(u8 *buffer, size_t length)
{
CsrWifiFsmEvent *primitive = kmalloc(sizeof(CsrWifiFsmEvent), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
return primitive;
}
EXPORT_SYMBOL_GPL(CsrWifiEventDes);
size_t CsrWifiEventCsrUint8Sizeof(void *msg)
{
return 3;
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint8Sizeof);
u8* CsrWifiEventCsrUint8Ser(u8 *ptr, size_t *len, void *msg)
{
CsrWifiEventCsrUint8 *primitive = (CsrWifiEventCsrUint8 *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint8Ser(ptr, len, primitive->value);
return(ptr);
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint8Ser);
void* CsrWifiEventCsrUint8Des(u8 *buffer, size_t length)
{
CsrWifiEventCsrUint8 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint8), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint8Des(&primitive->value, buffer, &offset);
return primitive;
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint8Des);
size_t CsrWifiEventCsrUint16Sizeof(void *msg)
{
return 4;
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16Sizeof);
u8* CsrWifiEventCsrUint16Ser(u8 *ptr, size_t *len, void *msg)
{
CsrWifiEventCsrUint16 *primitive = (CsrWifiEventCsrUint16 *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, primitive->value);
return(ptr);
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16Ser);
void* CsrWifiEventCsrUint16Des(u8 *buffer, size_t length)
{
CsrWifiEventCsrUint16 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint16), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des(&primitive->value, buffer, &offset);
return primitive;
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16Des);
size_t CsrWifiEventCsrUint32Sizeof(void *msg)
{
return 6;
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint32Sizeof);
u8* CsrWifiEventCsrUint32Ser(u8 *ptr, size_t *len, void *msg)
{
CsrWifiEventCsrUint32 *primitive = (CsrWifiEventCsrUint32 *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint32Ser(ptr, len, primitive->value);
return(ptr);
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint32Ser);
void* CsrWifiEventCsrUint32Des(u8 *buffer, size_t length)
{
CsrWifiEventCsrUint32 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint32), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint32Des(&primitive->value, buffer, &offset);
return primitive;
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint32Des);
size_t CsrWifiEventCsrUint16CsrUint8Sizeof(void *msg)
{
return 5;
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16CsrUint8Sizeof);
u8* CsrWifiEventCsrUint16CsrUint8Ser(u8 *ptr, size_t *len, void *msg)
{
CsrWifiEventCsrUint16CsrUint8 *primitive = (CsrWifiEventCsrUint16CsrUint8 *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint16Ser(ptr, len, primitive->value16);
CsrUint8Ser(ptr, len, primitive->value8);
return(ptr);
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16CsrUint8Ser);
void* CsrWifiEventCsrUint16CsrUint8Des(u8 *buffer, size_t length)
{
CsrWifiEventCsrUint16CsrUint8 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint16CsrUint8), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint16Des(&primitive->value16, buffer, &offset);
CsrUint8Des(&primitive->value8, buffer, &offset);
return primitive;
}
EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16CsrUint8Des);

View file

@ -1,774 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#ifndef CSR_WIFI_SME_AP_LIB_H__
#define CSR_WIFI_SME_AP_LIB_H__
#include "csr_sched.h"
#include "csr_macro.h"
#include "csr_msg_transport.h"
#include "csr_wifi_lib.h"
#include "csr_wifi_sme_ap_prim.h"
#include "csr_wifi_sme_task.h"
#ifndef CSR_WIFI_AP_ENABLE
#error CSR_WIFI_AP_ENABLE MUST be defined inorder to use csr_wifi_sme_ap_lib.h
#endif
/*----------------------------------------------------------------------------*
* CsrWifiSmeApFreeUpstreamMessageContents
*
* DESCRIPTION
* Free the allocated memory in a CSR_WIFI_SME_AP upstream message. Does not
* free the message itself, and can only be used for upstream messages.
*
* PARAMETERS
* Deallocates the resources in a CSR_WIFI_SME_AP upstream message
*----------------------------------------------------------------------------*/
void CsrWifiSmeApFreeUpstreamMessageContents(u16 eventClass, void *message);
/*----------------------------------------------------------------------------*
* CsrWifiSmeApFreeDownstreamMessageContents
*
* DESCRIPTION
* Free the allocated memory in a CSR_WIFI_SME_AP downstream message. Does not
* free the message itself, and can only be used for downstream messages.
*
* PARAMETERS
* Deallocates the resources in a CSR_WIFI_SME_AP downstream message
*----------------------------------------------------------------------------*/
void CsrWifiSmeApFreeDownstreamMessageContents(u16 eventClass, void *message);
/*----------------------------------------------------------------------------*
* Enum to string functions
*----------------------------------------------------------------------------*/
const char* CsrWifiSmeApAccessTypeToString(CsrWifiSmeApAccessType value);
const char* CsrWifiSmeApAuthSupportToString(CsrWifiSmeApAuthSupport value);
const char* CsrWifiSmeApAuthTypeToString(CsrWifiSmeApAuthType value);
const char* CsrWifiSmeApDirectionToString(CsrWifiSmeApDirection value);
const char* CsrWifiSmeApPhySupportToString(CsrWifiSmeApPhySupport value);
const char* CsrWifiSmeApTypeToString(CsrWifiSmeApType value);
/*----------------------------------------------------------------------------*
* CsrPrim Type toString function.
* Converts a message type to the String name of the Message
*----------------------------------------------------------------------------*/
const char* CsrWifiSmeApPrimTypeToString(CsrPrim msgType);
/*----------------------------------------------------------------------------*
* Lookup arrays for PrimType name Strings
*----------------------------------------------------------------------------*/
extern const char *CsrWifiSmeApUpstreamPrimNames[CSR_WIFI_SME_AP_PRIM_UPSTREAM_COUNT];
extern const char *CsrWifiSmeApDownstreamPrimNames[CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_COUNT];
/*******************************************************************************
NAME
CsrWifiSmeApActiveBaGetReqSend
DESCRIPTION
This primitive used to retrieve information related to the active block
ack sessions
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag -
*******************************************************************************/
#define CsrWifiSmeApActiveBaGetReqCreate(msg__, dst__, src__, interfaceTag__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApActiveBaGetReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_ACTIVE_BA_GET_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__);
#define CsrWifiSmeApActiveBaGetReqSendTo(dst__, src__, interfaceTag__) \
{ \
CsrWifiSmeApActiveBaGetReq *msg__; \
CsrWifiSmeApActiveBaGetReqCreate(msg__, dst__, src__, interfaceTag__); \
CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApActiveBaGetReqSend(src__, interfaceTag__) \
CsrWifiSmeApActiveBaGetReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__)
/*******************************************************************************
NAME
CsrWifiSmeApActiveBaGetCfmSend
DESCRIPTION
This primitive carries the information related to the active ba sessions
PARAMETERS
queue - Destination Task Queue
interfaceTag -
status - Reports the result of the request
activeBaCount - Number of active block ack session
activeBaSessions - Points to a buffer containing an array of
CsrWifiSmeApBaSession structures.
*******************************************************************************/
#define CsrWifiSmeApActiveBaGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, activeBaCount__, activeBaSessions__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApActiveBaGetCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_ACTIVE_BA_GET_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); \
msg__->activeBaCount = (activeBaCount__); \
msg__->activeBaSessions = (activeBaSessions__);
#define CsrWifiSmeApActiveBaGetCfmSendTo(dst__, src__, interfaceTag__, status__, activeBaCount__, activeBaSessions__) \
{ \
CsrWifiSmeApActiveBaGetCfm *msg__; \
CsrWifiSmeApActiveBaGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, activeBaCount__, activeBaSessions__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApActiveBaGetCfmSend(dst__, interfaceTag__, status__, activeBaCount__, activeBaSessions__) \
CsrWifiSmeApActiveBaGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, activeBaCount__, activeBaSessions__)
/*******************************************************************************
NAME
CsrWifiSmeApBaDeleteReqSend
DESCRIPTION
This primitive is used to delete an active block ack session
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag -
reason -
baSession - BA session to be deleted
*******************************************************************************/
#define CsrWifiSmeApBaDeleteReqCreate(msg__, dst__, src__, interfaceTag__, reason__, baSession__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApBaDeleteReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BA_DELETE_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->reason = (reason__); \
msg__->baSession = (baSession__);
#define CsrWifiSmeApBaDeleteReqSendTo(dst__, src__, interfaceTag__, reason__, baSession__) \
{ \
CsrWifiSmeApBaDeleteReq *msg__; \
CsrWifiSmeApBaDeleteReqCreate(msg__, dst__, src__, interfaceTag__, reason__, baSession__); \
CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApBaDeleteReqSend(src__, interfaceTag__, reason__, baSession__) \
CsrWifiSmeApBaDeleteReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__, reason__, baSession__)
/*******************************************************************************
NAME
CsrWifiSmeApBaDeleteCfmSend
DESCRIPTION
This primitive confirms the BA is deleted
PARAMETERS
queue - Destination Task Queue
interfaceTag -
status - Reports the result of the request
baSession - deleted BA session
*******************************************************************************/
#define CsrWifiSmeApBaDeleteCfmCreate(msg__, dst__, src__, interfaceTag__, status__, baSession__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApBaDeleteCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BA_DELETE_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); \
msg__->baSession = (baSession__);
#define CsrWifiSmeApBaDeleteCfmSendTo(dst__, src__, interfaceTag__, status__, baSession__) \
{ \
CsrWifiSmeApBaDeleteCfm *msg__; \
CsrWifiSmeApBaDeleteCfmCreate(msg__, dst__, src__, interfaceTag__, status__, baSession__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApBaDeleteCfmSend(dst__, interfaceTag__, status__, baSession__) \
CsrWifiSmeApBaDeleteCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, baSession__)
/*******************************************************************************
NAME
CsrWifiSmeApBeaconingStartReqSend
DESCRIPTION
This primitive requests the SME to start AP or GO functionality
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag -
initialPresence - Set to 0, if Not in a group fomration phase, set to 1 ,
during group formation phase
apType - apType : Legacy AP or P2PGO
cloakSsid - cloakSsid flag.
ssid - ssid.
ifIndex - Radio Interface
channel - channel.
maxConnections - Maximum Stations + P2PClients allowed
apCredentials - AP security credeitals used to advertise in beacon /probe
response
smeApConfig - AP configuration
p2pGoParam - P2P specific GO parameters. Ignored if it is a leagacy AP
*******************************************************************************/
#define CsrWifiSmeApBeaconingStartReqCreate(msg__, dst__, src__, interfaceTag__, initialPresence__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, maxConnections__, apCredentials__, smeApConfig__, p2pGoParam__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApBeaconingStartReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BEACONING_START_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->initialPresence = (initialPresence__); \
msg__->apType = (apType__); \
msg__->cloakSsid = (cloakSsid__); \
msg__->ssid = (ssid__); \
msg__->ifIndex = (ifIndex__); \
msg__->channel = (channel__); \
msg__->maxConnections = (maxConnections__); \
msg__->apCredentials = (apCredentials__); \
msg__->smeApConfig = (smeApConfig__); \
msg__->p2pGoParam = (p2pGoParam__);
#define CsrWifiSmeApBeaconingStartReqSendTo(dst__, src__, interfaceTag__, initialPresence__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, maxConnections__, apCredentials__, smeApConfig__, p2pGoParam__) \
{ \
CsrWifiSmeApBeaconingStartReq *msg__; \
CsrWifiSmeApBeaconingStartReqCreate(msg__, dst__, src__, interfaceTag__, initialPresence__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, maxConnections__, apCredentials__, smeApConfig__, p2pGoParam__); \
CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApBeaconingStartReqSend(src__, interfaceTag__, initialPresence__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, maxConnections__, apCredentials__, smeApConfig__, p2pGoParam__) \
CsrWifiSmeApBeaconingStartReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__, initialPresence__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, maxConnections__, apCredentials__, smeApConfig__, p2pGoParam__)
/*******************************************************************************
NAME
CsrWifiSmeApBeaconingStartCfmSend
DESCRIPTION
This primitive confirms the completion of the request along with the
status
PARAMETERS
queue - Destination Task Queue
interfaceTag -
status -
secIeLength -
secIe -
*******************************************************************************/
#define CsrWifiSmeApBeaconingStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, secIeLength__, secIe__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApBeaconingStartCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BEACONING_START_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); \
msg__->secIeLength = (secIeLength__); \
msg__->secIe = (secIe__);
#define CsrWifiSmeApBeaconingStartCfmSendTo(dst__, src__, interfaceTag__, status__, secIeLength__, secIe__) \
{ \
CsrWifiSmeApBeaconingStartCfm *msg__; \
CsrWifiSmeApBeaconingStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, secIeLength__, secIe__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApBeaconingStartCfmSend(dst__, interfaceTag__, status__, secIeLength__, secIe__) \
CsrWifiSmeApBeaconingStartCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, secIeLength__, secIe__)
/*******************************************************************************
NAME
CsrWifiSmeApBeaconingStopReqSend
DESCRIPTION
This primitive requests the SME to STOP AP or P2PGO operation
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag -
*******************************************************************************/
#define CsrWifiSmeApBeaconingStopReqCreate(msg__, dst__, src__, interfaceTag__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApBeaconingStopReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BEACONING_STOP_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__);
#define CsrWifiSmeApBeaconingStopReqSendTo(dst__, src__, interfaceTag__) \
{ \
CsrWifiSmeApBeaconingStopReq *msg__; \
CsrWifiSmeApBeaconingStopReqCreate(msg__, dst__, src__, interfaceTag__); \
CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApBeaconingStopReqSend(src__, interfaceTag__) \
CsrWifiSmeApBeaconingStopReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__)
/*******************************************************************************
NAME
CsrWifiSmeApBeaconingStopCfmSend
DESCRIPTION
This primitive confirms AP or P2PGO operation is terminated
PARAMETERS
queue - Destination Task Queue
interfaceTag -
status -
*******************************************************************************/
#define CsrWifiSmeApBeaconingStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApBeaconingStopCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BEACONING_STOP_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__);
#define CsrWifiSmeApBeaconingStopCfmSendTo(dst__, src__, interfaceTag__, status__) \
{ \
CsrWifiSmeApBeaconingStopCfm *msg__; \
CsrWifiSmeApBeaconingStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApBeaconingStopCfmSend(dst__, interfaceTag__, status__) \
CsrWifiSmeApBeaconingStopCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
/*******************************************************************************
NAME
CsrWifiSmeApErrorIndSend
DESCRIPTION
This primitve is sent by SME to indicate some error in AP operationi
after AP operations were started successfully and continuing the AP
operation may lead to undesired behaviour. It is the responsibility of
the upper layers to stop AP operation if needed
PARAMETERS
queue - Destination Task Queue
interfaceTag - Range 0-1
apType -
status - Contains the error status
*******************************************************************************/
#define CsrWifiSmeApErrorIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApErrorInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_ERROR_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->apType = (apType__); \
msg__->status = (status__);
#define CsrWifiSmeApErrorIndSendTo(dst__, src__, interfaceTag__, apType__, status__) \
{ \
CsrWifiSmeApErrorInd *msg__; \
CsrWifiSmeApErrorIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApErrorIndSend(dst__, interfaceTag__, apType__, status__) \
CsrWifiSmeApErrorIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, apType__, status__)
/*******************************************************************************
NAME
CsrWifiSmeApStaConnectStartIndSend
DESCRIPTION
This primitive indicates that a stations request to join the group/BSS is
accepted
PARAMETERS
queue - Destination Task Queue
interfaceTag -
peerMacAddress -
*******************************************************************************/
#define CsrWifiSmeApStaConnectStartIndCreate(msg__, dst__, src__, interfaceTag__, peerMacAddress__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApStaConnectStartInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_STA_CONNECT_START_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->peerMacAddress = (peerMacAddress__);
#define CsrWifiSmeApStaConnectStartIndSendTo(dst__, src__, interfaceTag__, peerMacAddress__) \
{ \
CsrWifiSmeApStaConnectStartInd *msg__; \
CsrWifiSmeApStaConnectStartIndCreate(msg__, dst__, src__, interfaceTag__, peerMacAddress__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApStaConnectStartIndSend(dst__, interfaceTag__, peerMacAddress__) \
CsrWifiSmeApStaConnectStartIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, peerMacAddress__)
/*******************************************************************************
NAME
CsrWifiSmeApStaDisconnectReqSend
DESCRIPTION
This primitive tells SME to deauth ot disassociate a particular station
within BSS
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag -
deauthReason -
disassocReason -
peerMacaddress -
keepBlocking - If TRUE, the station is blocked. If FALSE and the station
is connected, disconnect the station. If FALSE and the
station is not connected, no action is taken.
*******************************************************************************/
#define CsrWifiSmeApStaDisconnectReqCreate(msg__, dst__, src__, interfaceTag__, deauthReason__, disassocReason__, peerMacaddress__, keepBlocking__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApStaDisconnectReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_STA_DISCONNECT_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->deauthReason = (deauthReason__); \
msg__->disassocReason = (disassocReason__); \
msg__->peerMacaddress = (peerMacaddress__); \
msg__->keepBlocking = (keepBlocking__);
#define CsrWifiSmeApStaDisconnectReqSendTo(dst__, src__, interfaceTag__, deauthReason__, disassocReason__, peerMacaddress__, keepBlocking__) \
{ \
CsrWifiSmeApStaDisconnectReq *msg__; \
CsrWifiSmeApStaDisconnectReqCreate(msg__, dst__, src__, interfaceTag__, deauthReason__, disassocReason__, peerMacaddress__, keepBlocking__); \
CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApStaDisconnectReqSend(src__, interfaceTag__, deauthReason__, disassocReason__, peerMacaddress__, keepBlocking__) \
CsrWifiSmeApStaDisconnectReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__, deauthReason__, disassocReason__, peerMacaddress__, keepBlocking__)
/*******************************************************************************
NAME
CsrWifiSmeApStaDisconnectCfmSend
DESCRIPTION
This primitive confirms the station is disconnected
PARAMETERS
queue - Destination Task Queue
interfaceTag -
status -
peerMacaddress -
*******************************************************************************/
#define CsrWifiSmeApStaDisconnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, peerMacaddress__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApStaDisconnectCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_STA_DISCONNECT_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); \
msg__->peerMacaddress = (peerMacaddress__);
#define CsrWifiSmeApStaDisconnectCfmSendTo(dst__, src__, interfaceTag__, status__, peerMacaddress__) \
{ \
CsrWifiSmeApStaDisconnectCfm *msg__; \
CsrWifiSmeApStaDisconnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, peerMacaddress__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApStaDisconnectCfmSend(dst__, interfaceTag__, status__, peerMacaddress__) \
CsrWifiSmeApStaDisconnectCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, peerMacaddress__)
/*******************************************************************************
NAME
CsrWifiSmeApStaNotifyIndSend
DESCRIPTION
This primitive indicates that a station has joined or a previously joined
station has left the BSS/group
PARAMETERS
queue - Destination Task Queue
interfaceTag -
mediaStatus -
peerMacAddress -
peerDeviceAddress -
disassocReason -
deauthReason -
WpsRegistration -
secIeLength -
secIe -
groupKeyId -
seqNumber -
*******************************************************************************/
#define CsrWifiSmeApStaNotifyIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__, disassocReason__, deauthReason__, WpsRegistration__, secIeLength__, secIe__, groupKeyId__, seqNumber__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApStaNotifyInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_STA_NOTIFY_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->mediaStatus = (mediaStatus__); \
msg__->peerMacAddress = (peerMacAddress__); \
msg__->peerDeviceAddress = (peerDeviceAddress__); \
msg__->disassocReason = (disassocReason__); \
msg__->deauthReason = (deauthReason__); \
msg__->WpsRegistration = (WpsRegistration__); \
msg__->secIeLength = (secIeLength__); \
msg__->secIe = (secIe__); \
msg__->groupKeyId = (groupKeyId__); \
memcpy(msg__->seqNumber, (seqNumber__), sizeof(u16) * 8);
#define CsrWifiSmeApStaNotifyIndSendTo(dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__, disassocReason__, deauthReason__, WpsRegistration__, secIeLength__, secIe__, groupKeyId__, seqNumber__) \
{ \
CsrWifiSmeApStaNotifyInd *msg__; \
CsrWifiSmeApStaNotifyIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__, disassocReason__, deauthReason__, WpsRegistration__, secIeLength__, secIe__, groupKeyId__, seqNumber__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApStaNotifyIndSend(dst__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__, disassocReason__, deauthReason__, WpsRegistration__, secIeLength__, secIe__, groupKeyId__, seqNumber__) \
CsrWifiSmeApStaNotifyIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__, disassocReason__, deauthReason__, WpsRegistration__, secIeLength__, secIe__, groupKeyId__, seqNumber__)
/*******************************************************************************
NAME
CsrWifiSmeApWmmParamUpdateReqSend
DESCRIPTION
Application uses this primitive to update the WMM parameters on the fly
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag -
wmmApParams - WMM parameters to be used for local firmware queue
configuration
wmmApBcParams - WMM parameters to be advertised in beacon/probe response
*******************************************************************************/
#define CsrWifiSmeApWmmParamUpdateReqCreate(msg__, dst__, src__, interfaceTag__, wmmApParams__, wmmApBcParams__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApWmmParamUpdateReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WMM_PARAM_UPDATE_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
memcpy(msg__->wmmApParams, (wmmApParams__), sizeof(CsrWifiSmeWmmAcParams) * 4); \
memcpy(msg__->wmmApBcParams, (wmmApBcParams__), sizeof(CsrWifiSmeWmmAcParams) * 4);
#define CsrWifiSmeApWmmParamUpdateReqSendTo(dst__, src__, interfaceTag__, wmmApParams__, wmmApBcParams__) \
{ \
CsrWifiSmeApWmmParamUpdateReq *msg__; \
CsrWifiSmeApWmmParamUpdateReqCreate(msg__, dst__, src__, interfaceTag__, wmmApParams__, wmmApBcParams__); \
CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApWmmParamUpdateReqSend(src__, interfaceTag__, wmmApParams__, wmmApBcParams__) \
CsrWifiSmeApWmmParamUpdateReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__, wmmApParams__, wmmApBcParams__)
/*******************************************************************************
NAME
CsrWifiSmeApWmmParamUpdateCfmSend
DESCRIPTION
A confirm for CSR_WIFI_SME_AP_WMM_PARAM_UPDATE.request
PARAMETERS
queue - Destination Task Queue
interfaceTag -
status -
*******************************************************************************/
#define CsrWifiSmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApWmmParamUpdateCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WMM_PARAM_UPDATE_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__);
#define CsrWifiSmeApWmmParamUpdateCfmSendTo(dst__, src__, interfaceTag__, status__) \
{ \
CsrWifiSmeApWmmParamUpdateCfm *msg__; \
CsrWifiSmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApWmmParamUpdateCfmSend(dst__, interfaceTag__, status__) \
CsrWifiSmeApWmmParamUpdateCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
/*******************************************************************************
NAME
CsrWifiSmeApWpsConfigurationReqSend
DESCRIPTION
This primitive passes the WPS information for the device to SME. This may
be accepted only if no interface is active.
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
wpsConfig - WPS config.
*******************************************************************************/
#define CsrWifiSmeApWpsConfigurationReqCreate(msg__, dst__, src__, wpsConfig__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApWpsConfigurationReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_CONFIGURATION_REQ, dst__, src__); \
msg__->wpsConfig = (wpsConfig__);
#define CsrWifiSmeApWpsConfigurationReqSendTo(dst__, src__, wpsConfig__) \
{ \
CsrWifiSmeApWpsConfigurationReq *msg__; \
CsrWifiSmeApWpsConfigurationReqCreate(msg__, dst__, src__, wpsConfig__); \
CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApWpsConfigurationReqSend(src__, wpsConfig__) \
CsrWifiSmeApWpsConfigurationReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, wpsConfig__)
/*******************************************************************************
NAME
CsrWifiSmeApWpsConfigurationCfmSend
DESCRIPTION
Confirm.
PARAMETERS
queue - Destination Task Queue
status - Status of the request.
*******************************************************************************/
#define CsrWifiSmeApWpsConfigurationCfmCreate(msg__, dst__, src__, status__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApWpsConfigurationCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_CONFIGURATION_CFM, dst__, src__); \
msg__->status = (status__);
#define CsrWifiSmeApWpsConfigurationCfmSendTo(dst__, src__, status__) \
{ \
CsrWifiSmeApWpsConfigurationCfm *msg__; \
CsrWifiSmeApWpsConfigurationCfmCreate(msg__, dst__, src__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApWpsConfigurationCfmSend(dst__, status__) \
CsrWifiSmeApWpsConfigurationCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
/*******************************************************************************
NAME
CsrWifiSmeApWpsRegistrationFinishedReqSend
DESCRIPTION
This primitive tells SME that WPS registration procedure has finished
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag -
*******************************************************************************/
#define CsrWifiSmeApWpsRegistrationFinishedReqCreate(msg__, dst__, src__, interfaceTag__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApWpsRegistrationFinishedReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_REGISTRATION_FINISHED_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__);
#define CsrWifiSmeApWpsRegistrationFinishedReqSendTo(dst__, src__, interfaceTag__) \
{ \
CsrWifiSmeApWpsRegistrationFinishedReq *msg__; \
CsrWifiSmeApWpsRegistrationFinishedReqCreate(msg__, dst__, src__, interfaceTag__); \
CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApWpsRegistrationFinishedReqSend(src__, interfaceTag__) \
CsrWifiSmeApWpsRegistrationFinishedReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__)
/*******************************************************************************
NAME
CsrWifiSmeApWpsRegistrationFinishedCfmSend
DESCRIPTION
A confirm for UNIFI_MGT_AP_WPS_REGISTRATION_FINISHED.request
PARAMETERS
queue - Destination Task Queue
interfaceTag -
status -
*******************************************************************************/
#define CsrWifiSmeApWpsRegistrationFinishedCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApWpsRegistrationFinishedCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_REGISTRATION_FINISHED_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__);
#define CsrWifiSmeApWpsRegistrationFinishedCfmSendTo(dst__, src__, interfaceTag__, status__) \
{ \
CsrWifiSmeApWpsRegistrationFinishedCfm *msg__; \
CsrWifiSmeApWpsRegistrationFinishedCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApWpsRegistrationFinishedCfmSend(dst__, interfaceTag__, status__) \
CsrWifiSmeApWpsRegistrationFinishedCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
/*******************************************************************************
NAME
CsrWifiSmeApWpsRegistrationStartedReqSend
DESCRIPTION
This primitive tells SME that WPS registration procedure has started
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
interfaceTag -
SelectedDevicePasswordId -
SelectedconfigMethod -
*******************************************************************************/
#define CsrWifiSmeApWpsRegistrationStartedReqCreate(msg__, dst__, src__, interfaceTag__, SelectedDevicePasswordId__, SelectedconfigMethod__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApWpsRegistrationStartedReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_REGISTRATION_STARTED_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->SelectedDevicePasswordId = (SelectedDevicePasswordId__); \
msg__->SelectedconfigMethod = (SelectedconfigMethod__);
#define CsrWifiSmeApWpsRegistrationStartedReqSendTo(dst__, src__, interfaceTag__, SelectedDevicePasswordId__, SelectedconfigMethod__) \
{ \
CsrWifiSmeApWpsRegistrationStartedReq *msg__; \
CsrWifiSmeApWpsRegistrationStartedReqCreate(msg__, dst__, src__, interfaceTag__, SelectedDevicePasswordId__, SelectedconfigMethod__); \
CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApWpsRegistrationStartedReqSend(src__, interfaceTag__, SelectedDevicePasswordId__, SelectedconfigMethod__) \
CsrWifiSmeApWpsRegistrationStartedReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__, SelectedDevicePasswordId__, SelectedconfigMethod__)
/*******************************************************************************
NAME
CsrWifiSmeApWpsRegistrationStartedCfmSend
DESCRIPTION
A confirm for UNIFI_MGT_AP_WPS_REGISTRATION_STARTED.request
PARAMETERS
queue - Destination Task Queue
interfaceTag -
status -
*******************************************************************************/
#define CsrWifiSmeApWpsRegistrationStartedCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = kmalloc(sizeof(CsrWifiSmeApWpsRegistrationStartedCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_REGISTRATION_STARTED_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__);
#define CsrWifiSmeApWpsRegistrationStartedCfmSendTo(dst__, src__, interfaceTag__, status__) \
{ \
CsrWifiSmeApWpsRegistrationStartedCfm *msg__; \
CsrWifiSmeApWpsRegistrationStartedCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
}
#define CsrWifiSmeApWpsRegistrationStartedCfmSend(dst__, interfaceTag__, status__) \
CsrWifiSmeApWpsRegistrationStartedCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
#endif /* CSR_WIFI_SME_AP_LIB_H__ */

File diff suppressed because it is too large Load diff

View file

@ -1,201 +0,0 @@
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
/* Note: this is an auto-generated file. */
#include "csr_msgconv.h"
#include "csr_macro.h"
#ifdef CSR_LOG_ENABLE
#include "csr_log.h"
#endif
#ifndef EXCLUDE_CSR_WIFI_SME_MODULE
#include "csr_wifi_sme_serialize.h"
#include "csr_wifi_sme_prim.h"
static CsrMsgConvMsgEntry csrwifisme_conv_lut[] = {
{ CSR_WIFI_SME_ACTIVATE_REQ, CsrWifiSmeActivateReqSizeof, CsrWifiSmeActivateReqSer, CsrWifiSmeActivateReqDes, CsrWifiSmeActivateReqSerFree },
{ CSR_WIFI_SME_ADHOC_CONFIG_GET_REQ, CsrWifiSmeAdhocConfigGetReqSizeof, CsrWifiSmeAdhocConfigGetReqSer, CsrWifiSmeAdhocConfigGetReqDes, CsrWifiSmeAdhocConfigGetReqSerFree },
{ CSR_WIFI_SME_ADHOC_CONFIG_SET_REQ, CsrWifiSmeAdhocConfigSetReqSizeof, CsrWifiSmeAdhocConfigSetReqSer, CsrWifiSmeAdhocConfigSetReqDes, CsrWifiSmeAdhocConfigSetReqSerFree },
{ CSR_WIFI_SME_BLACKLIST_REQ, CsrWifiSmeBlacklistReqSizeof, CsrWifiSmeBlacklistReqSer, CsrWifiSmeBlacklistReqDes, CsrWifiSmeBlacklistReqSerFree },
{ CSR_WIFI_SME_CALIBRATION_DATA_GET_REQ, CsrWifiSmeCalibrationDataGetReqSizeof, CsrWifiSmeCalibrationDataGetReqSer, CsrWifiSmeCalibrationDataGetReqDes, CsrWifiSmeCalibrationDataGetReqSerFree },
{ CSR_WIFI_SME_CALIBRATION_DATA_SET_REQ, CsrWifiSmeCalibrationDataSetReqSizeof, CsrWifiSmeCalibrationDataSetReqSer, CsrWifiSmeCalibrationDataSetReqDes, CsrWifiSmeCalibrationDataSetReqSerFree },
{ CSR_WIFI_SME_CCX_CONFIG_GET_REQ, CsrWifiSmeCcxConfigGetReqSizeof, CsrWifiSmeCcxConfigGetReqSer, CsrWifiSmeCcxConfigGetReqDes, CsrWifiSmeCcxConfigGetReqSerFree },
{ CSR_WIFI_SME_CCX_CONFIG_SET_REQ, CsrWifiSmeCcxConfigSetReqSizeof, CsrWifiSmeCcxConfigSetReqSer, CsrWifiSmeCcxConfigSetReqDes, CsrWifiSmeCcxConfigSetReqSerFree },
{ CSR_WIFI_SME_COEX_CONFIG_GET_REQ, CsrWifiSmeCoexConfigGetReqSizeof, CsrWifiSmeCoexConfigGetReqSer, CsrWifiSmeCoexConfigGetReqDes, CsrWifiSmeCoexConfigGetReqSerFree },
{ CSR_WIFI_SME_COEX_CONFIG_SET_REQ, CsrWifiSmeCoexConfigSetReqSizeof, CsrWifiSmeCoexConfigSetReqSer, CsrWifiSmeCoexConfigSetReqDes, CsrWifiSmeCoexConfigSetReqSerFree },
{ CSR_WIFI_SME_COEX_INFO_GET_REQ, CsrWifiSmeCoexInfoGetReqSizeof, CsrWifiSmeCoexInfoGetReqSer, CsrWifiSmeCoexInfoGetReqDes, CsrWifiSmeCoexInfoGetReqSerFree },
{ CSR_WIFI_SME_CONNECT_REQ, CsrWifiSmeConnectReqSizeof, CsrWifiSmeConnectReqSer, CsrWifiSmeConnectReqDes, CsrWifiSmeConnectReqSerFree },
{ CSR_WIFI_SME_CONNECTION_CONFIG_GET_REQ, CsrWifiSmeConnectionConfigGetReqSizeof, CsrWifiSmeConnectionConfigGetReqSer, CsrWifiSmeConnectionConfigGetReqDes, CsrWifiSmeConnectionConfigGetReqSerFree },
{ CSR_WIFI_SME_CONNECTION_INFO_GET_REQ, CsrWifiSmeConnectionInfoGetReqSizeof, CsrWifiSmeConnectionInfoGetReqSer, CsrWifiSmeConnectionInfoGetReqDes, CsrWifiSmeConnectionInfoGetReqSerFree },
{ CSR_WIFI_SME_CONNECTION_STATS_GET_REQ, CsrWifiSmeConnectionStatsGetReqSizeof, CsrWifiSmeConnectionStatsGetReqSer, CsrWifiSmeConnectionStatsGetReqDes, CsrWifiSmeConnectionStatsGetReqSerFree },
{ CSR_WIFI_SME_DEACTIVATE_REQ, CsrWifiSmeDeactivateReqSizeof, CsrWifiSmeDeactivateReqSer, CsrWifiSmeDeactivateReqDes, CsrWifiSmeDeactivateReqSerFree },
{ CSR_WIFI_SME_DISCONNECT_REQ, CsrWifiSmeDisconnectReqSizeof, CsrWifiSmeDisconnectReqSer, CsrWifiSmeDisconnectReqDes, CsrWifiSmeDisconnectReqSerFree },
{ CSR_WIFI_SME_EVENT_MASK_SET_REQ, CsrWifiSmeEventMaskSetReqSizeof, CsrWifiSmeEventMaskSetReqSer, CsrWifiSmeEventMaskSetReqDes, CsrWifiSmeEventMaskSetReqSerFree },
{ CSR_WIFI_SME_HOST_CONFIG_GET_REQ, CsrWifiSmeHostConfigGetReqSizeof, CsrWifiSmeHostConfigGetReqSer, CsrWifiSmeHostConfigGetReqDes, CsrWifiSmeHostConfigGetReqSerFree },
{ CSR_WIFI_SME_HOST_CONFIG_SET_REQ, CsrWifiSmeHostConfigSetReqSizeof, CsrWifiSmeHostConfigSetReqSer, CsrWifiSmeHostConfigSetReqDes, CsrWifiSmeHostConfigSetReqSerFree },
{ CSR_WIFI_SME_KEY_REQ, CsrWifiSmeKeyReqSizeof, CsrWifiSmeKeyReqSer, CsrWifiSmeKeyReqDes, CsrWifiSmeKeyReqSerFree },
{ CSR_WIFI_SME_LINK_QUALITY_GET_REQ, CsrWifiSmeLinkQualityGetReqSizeof, CsrWifiSmeLinkQualityGetReqSer, CsrWifiSmeLinkQualityGetReqDes, CsrWifiSmeLinkQualityGetReqSerFree },
{ CSR_WIFI_SME_MIB_CONFIG_GET_REQ, CsrWifiSmeMibConfigGetReqSizeof, CsrWifiSmeMibConfigGetReqSer, CsrWifiSmeMibConfigGetReqDes, CsrWifiSmeMibConfigGetReqSerFree },
{ CSR_WIFI_SME_MIB_CONFIG_SET_REQ, CsrWifiSmeMibConfigSetReqSizeof, CsrWifiSmeMibConfigSetReqSer, CsrWifiSmeMibConfigSetReqDes, CsrWifiSmeMibConfigSetReqSerFree },
{ CSR_WIFI_SME_MIB_GET_NEXT_REQ, CsrWifiSmeMibGetNextReqSizeof, CsrWifiSmeMibGetNextReqSer, CsrWifiSmeMibGetNextReqDes, CsrWifiSmeMibGetNextReqSerFree },
{ CSR_WIFI_SME_MIB_GET_REQ, CsrWifiSmeMibGetReqSizeof, CsrWifiSmeMibGetReqSer, CsrWifiSmeMibGetReqDes, CsrWifiSmeMibGetReqSerFree },
{ CSR_WIFI_SME_MIB_SET_REQ, CsrWifiSmeMibSetReqSizeof, CsrWifiSmeMibSetReqSer, CsrWifiSmeMibSetReqDes, CsrWifiSmeMibSetReqSerFree },
{ CSR_WIFI_SME_MULTICAST_ADDRESS_REQ, CsrWifiSmeMulticastAddressReqSizeof, CsrWifiSmeMulticastAddressReqSer, CsrWifiSmeMulticastAddressReqDes, CsrWifiSmeMulticastAddressReqSerFree },
{ CSR_WIFI_SME_PACKET_FILTER_SET_REQ, CsrWifiSmePacketFilterSetReqSizeof, CsrWifiSmePacketFilterSetReqSer, CsrWifiSmePacketFilterSetReqDes, CsrWifiSmePacketFilterSetReqSerFree },
{ CSR_WIFI_SME_PERMANENT_MAC_ADDRESS_GET_REQ, CsrWifiSmePermanentMacAddressGetReqSizeof, CsrWifiSmePermanentMacAddressGetReqSer, CsrWifiSmePermanentMacAddressGetReqDes, CsrWifiSmePermanentMacAddressGetReqSerFree },
{ CSR_WIFI_SME_PMKID_REQ, CsrWifiSmePmkidReqSizeof, CsrWifiSmePmkidReqSer, CsrWifiSmePmkidReqDes, CsrWifiSmePmkidReqSerFree },
{ CSR_WIFI_SME_POWER_CONFIG_GET_REQ, CsrWifiSmePowerConfigGetReqSizeof, CsrWifiSmePowerConfigGetReqSer, CsrWifiSmePowerConfigGetReqDes, CsrWifiSmePowerConfigGetReqSerFree },
{ CSR_WIFI_SME_POWER_CONFIG_SET_REQ, CsrWifiSmePowerConfigSetReqSizeof, CsrWifiSmePowerConfigSetReqSer, CsrWifiSmePowerConfigSetReqDes, CsrWifiSmePowerConfigSetReqSerFree },
{ CSR_WIFI_SME_REGULATORY_DOMAIN_INFO_GET_REQ, CsrWifiSmeRegulatoryDomainInfoGetReqSizeof, CsrWifiSmeRegulatoryDomainInfoGetReqSer, CsrWifiSmeRegulatoryDomainInfoGetReqDes, CsrWifiSmeRegulatoryDomainInfoGetReqSerFree },
{ CSR_WIFI_SME_ROAMING_CONFIG_GET_REQ, CsrWifiSmeRoamingConfigGetReqSizeof, CsrWifiSmeRoamingConfigGetReqSer, CsrWifiSmeRoamingConfigGetReqDes, CsrWifiSmeRoamingConfigGetReqSerFree },
{ CSR_WIFI_SME_ROAMING_CONFIG_SET_REQ, CsrWifiSmeRoamingConfigSetReqSizeof, CsrWifiSmeRoamingConfigSetReqSer, CsrWifiSmeRoamingConfigSetReqDes, CsrWifiSmeRoamingConfigSetReqSerFree },
{ CSR_WIFI_SME_SCAN_CONFIG_GET_REQ, CsrWifiSmeScanConfigGetReqSizeof, CsrWifiSmeScanConfigGetReqSer, CsrWifiSmeScanConfigGetReqDes, CsrWifiSmeScanConfigGetReqSerFree },
{ CSR_WIFI_SME_SCAN_CONFIG_SET_REQ, CsrWifiSmeScanConfigSetReqSizeof, CsrWifiSmeScanConfigSetReqSer, CsrWifiSmeScanConfigSetReqDes, CsrWifiSmeScanConfigSetReqSerFree },
{ CSR_WIFI_SME_SCAN_FULL_REQ, CsrWifiSmeScanFullReqSizeof, CsrWifiSmeScanFullReqSer, CsrWifiSmeScanFullReqDes, CsrWifiSmeScanFullReqSerFree },
{ CSR_WIFI_SME_SCAN_RESULTS_FLUSH_REQ, CsrWifiSmeScanResultsFlushReqSizeof, CsrWifiSmeScanResultsFlushReqSer, CsrWifiSmeScanResultsFlushReqDes, CsrWifiSmeScanResultsFlushReqSerFree },
{ CSR_WIFI_SME_SCAN_RESULTS_GET_REQ, CsrWifiSmeScanResultsGetReqSizeof, CsrWifiSmeScanResultsGetReqSer, CsrWifiSmeScanResultsGetReqDes, CsrWifiSmeScanResultsGetReqSerFree },
{ CSR_WIFI_SME_SME_STA_CONFIG_GET_REQ, CsrWifiSmeSmeStaConfigGetReqSizeof, CsrWifiSmeSmeStaConfigGetReqSer, CsrWifiSmeSmeStaConfigGetReqDes, CsrWifiSmeSmeStaConfigGetReqSerFree },
{ CSR_WIFI_SME_SME_STA_CONFIG_SET_REQ, CsrWifiSmeSmeStaConfigSetReqSizeof, CsrWifiSmeSmeStaConfigSetReqSer, CsrWifiSmeSmeStaConfigSetReqDes, CsrWifiSmeSmeStaConfigSetReqSerFree },
{ CSR_WIFI_SME_STATION_MAC_ADDRESS_GET_REQ, CsrWifiSmeStationMacAddressGetReqSizeof, CsrWifiSmeStationMacAddressGetReqSer, CsrWifiSmeStationMacAddressGetReqDes, CsrWifiSmeStationMacAddressGetReqSerFree },
{ CSR_WIFI_SME_TSPEC_REQ, CsrWifiSmeTspecReqSizeof, CsrWifiSmeTspecReqSer, CsrWifiSmeTspecReqDes, CsrWifiSmeTspecReqSerFree },
{ CSR_WIFI_SME_VERSIONS_GET_REQ, CsrWifiSmeVersionsGetReqSizeof, CsrWifiSmeVersionsGetReqSer, CsrWifiSmeVersionsGetReqDes, CsrWifiSmeVersionsGetReqSerFree },
{ CSR_WIFI_SME_WIFI_FLIGHTMODE_REQ, CsrWifiSmeWifiFlightmodeReqSizeof, CsrWifiSmeWifiFlightmodeReqSer, CsrWifiSmeWifiFlightmodeReqDes, CsrWifiSmeWifiFlightmodeReqSerFree },
{ CSR_WIFI_SME_WIFI_OFF_REQ, CsrWifiSmeWifiOffReqSizeof, CsrWifiSmeWifiOffReqSer, CsrWifiSmeWifiOffReqDes, CsrWifiSmeWifiOffReqSerFree },
{ CSR_WIFI_SME_WIFI_ON_REQ, CsrWifiSmeWifiOnReqSizeof, CsrWifiSmeWifiOnReqSer, CsrWifiSmeWifiOnReqDes, CsrWifiSmeWifiOnReqSerFree },
{ CSR_WIFI_SME_CLOAKED_SSIDS_SET_REQ, CsrWifiSmeCloakedSsidsSetReqSizeof, CsrWifiSmeCloakedSsidsSetReqSer, CsrWifiSmeCloakedSsidsSetReqDes, CsrWifiSmeCloakedSsidsSetReqSerFree },
{ CSR_WIFI_SME_CLOAKED_SSIDS_GET_REQ, CsrWifiSmeCloakedSsidsGetReqSizeof, CsrWifiSmeCloakedSsidsGetReqSer, CsrWifiSmeCloakedSsidsGetReqDes, CsrWifiSmeCloakedSsidsGetReqSerFree },
{ CSR_WIFI_SME_SME_COMMON_CONFIG_GET_REQ, CsrWifiSmeSmeCommonConfigGetReqSizeof, CsrWifiSmeSmeCommonConfigGetReqSer, CsrWifiSmeSmeCommonConfigGetReqDes, CsrWifiSmeSmeCommonConfigGetReqSerFree },
{ CSR_WIFI_SME_SME_COMMON_CONFIG_SET_REQ, CsrWifiSmeSmeCommonConfigSetReqSizeof, CsrWifiSmeSmeCommonConfigSetReqSer, CsrWifiSmeSmeCommonConfigSetReqDes, CsrWifiSmeSmeCommonConfigSetReqSerFree },
{ CSR_WIFI_SME_INTERFACE_CAPABILITY_GET_REQ, CsrWifiSmeInterfaceCapabilityGetReqSizeof, CsrWifiSmeInterfaceCapabilityGetReqSer, CsrWifiSmeInterfaceCapabilityGetReqDes, CsrWifiSmeInterfaceCapabilityGetReqSerFree },
{ CSR_WIFI_SME_WPS_CONFIGURATION_REQ, CsrWifiSmeWpsConfigurationReqSizeof, CsrWifiSmeWpsConfigurationReqSer, CsrWifiSmeWpsConfigurationReqDes, CsrWifiSmeWpsConfigurationReqSerFree },
{ CSR_WIFI_SME_SET_REQ, CsrWifiSmeSetReqSizeof, CsrWifiSmeSetReqSer, CsrWifiSmeSetReqDes, CsrWifiSmeSetReqSerFree },
{ CSR_WIFI_SME_ACTIVATE_CFM, CsrWifiSmeActivateCfmSizeof, CsrWifiSmeActivateCfmSer, CsrWifiSmeActivateCfmDes, CsrWifiSmeActivateCfmSerFree },
{ CSR_WIFI_SME_ADHOC_CONFIG_GET_CFM, CsrWifiSmeAdhocConfigGetCfmSizeof, CsrWifiSmeAdhocConfigGetCfmSer, CsrWifiSmeAdhocConfigGetCfmDes, CsrWifiSmeAdhocConfigGetCfmSerFree },
{ CSR_WIFI_SME_ADHOC_CONFIG_SET_CFM, CsrWifiSmeAdhocConfigSetCfmSizeof, CsrWifiSmeAdhocConfigSetCfmSer, CsrWifiSmeAdhocConfigSetCfmDes, CsrWifiSmeAdhocConfigSetCfmSerFree },
{ CSR_WIFI_SME_ASSOCIATION_COMPLETE_IND, CsrWifiSmeAssociationCompleteIndSizeof, CsrWifiSmeAssociationCompleteIndSer, CsrWifiSmeAssociationCompleteIndDes, CsrWifiSmeAssociationCompleteIndSerFree },
{ CSR_WIFI_SME_ASSOCIATION_START_IND, CsrWifiSmeAssociationStartIndSizeof, CsrWifiSmeAssociationStartIndSer, CsrWifiSmeAssociationStartIndDes, CsrWifiSmeAssociationStartIndSerFree },
{ CSR_WIFI_SME_BLACKLIST_CFM, CsrWifiSmeBlacklistCfmSizeof, CsrWifiSmeBlacklistCfmSer, CsrWifiSmeBlacklistCfmDes, CsrWifiSmeBlacklistCfmSerFree },
{ CSR_WIFI_SME_CALIBRATION_DATA_GET_CFM, CsrWifiSmeCalibrationDataGetCfmSizeof, CsrWifiSmeCalibrationDataGetCfmSer, CsrWifiSmeCalibrationDataGetCfmDes, CsrWifiSmeCalibrationDataGetCfmSerFree },
{ CSR_WIFI_SME_CALIBRATION_DATA_SET_CFM, CsrWifiSmeCalibrationDataSetCfmSizeof, CsrWifiSmeCalibrationDataSetCfmSer, CsrWifiSmeCalibrationDataSetCfmDes, CsrWifiSmeCalibrationDataSetCfmSerFree },
{ CSR_WIFI_SME_CCX_CONFIG_GET_CFM, CsrWifiSmeCcxConfigGetCfmSizeof, CsrWifiSmeCcxConfigGetCfmSer, CsrWifiSmeCcxConfigGetCfmDes, CsrWifiSmeCcxConfigGetCfmSerFree },
{ CSR_WIFI_SME_CCX_CONFIG_SET_CFM, CsrWifiSmeCcxConfigSetCfmSizeof, CsrWifiSmeCcxConfigSetCfmSer, CsrWifiSmeCcxConfigSetCfmDes, CsrWifiSmeCcxConfigSetCfmSerFree },
{ CSR_WIFI_SME_COEX_CONFIG_GET_CFM, CsrWifiSmeCoexConfigGetCfmSizeof, CsrWifiSmeCoexConfigGetCfmSer, CsrWifiSmeCoexConfigGetCfmDes, CsrWifiSmeCoexConfigGetCfmSerFree },
{ CSR_WIFI_SME_COEX_CONFIG_SET_CFM, CsrWifiSmeCoexConfigSetCfmSizeof, CsrWifiSmeCoexConfigSetCfmSer, CsrWifiSmeCoexConfigSetCfmDes, CsrWifiSmeCoexConfigSetCfmSerFree },
{ CSR_WIFI_SME_COEX_INFO_GET_CFM, CsrWifiSmeCoexInfoGetCfmSizeof, CsrWifiSmeCoexInfoGetCfmSer, CsrWifiSmeCoexInfoGetCfmDes, CsrWifiSmeCoexInfoGetCfmSerFree },
{ CSR_WIFI_SME_CONNECT_CFM, CsrWifiSmeConnectCfmSizeof, CsrWifiSmeConnectCfmSer, CsrWifiSmeConnectCfmDes, CsrWifiSmeConnectCfmSerFree },
{ CSR_WIFI_SME_CONNECTION_CONFIG_GET_CFM, CsrWifiSmeConnectionConfigGetCfmSizeof, CsrWifiSmeConnectionConfigGetCfmSer, CsrWifiSmeConnectionConfigGetCfmDes, CsrWifiSmeConnectionConfigGetCfmSerFree },
{ CSR_WIFI_SME_CONNECTION_INFO_GET_CFM, CsrWifiSmeConnectionInfoGetCfmSizeof, CsrWifiSmeConnectionInfoGetCfmSer, CsrWifiSmeConnectionInfoGetCfmDes, CsrWifiSmeConnectionInfoGetCfmSerFree },
{ CSR_WIFI_SME_CONNECTION_QUALITY_IND, CsrWifiSmeConnectionQualityIndSizeof, CsrWifiSmeConnectionQualityIndSer, CsrWifiSmeConnectionQualityIndDes, CsrWifiSmeConnectionQualityIndSerFree },
{ CSR_WIFI_SME_CONNECTION_STATS_GET_CFM, CsrWifiSmeConnectionStatsGetCfmSizeof, CsrWifiSmeConnectionStatsGetCfmSer, CsrWifiSmeConnectionStatsGetCfmDes, CsrWifiSmeConnectionStatsGetCfmSerFree },
{ CSR_WIFI_SME_DEACTIVATE_CFM, CsrWifiSmeDeactivateCfmSizeof, CsrWifiSmeDeactivateCfmSer, CsrWifiSmeDeactivateCfmDes, CsrWifiSmeDeactivateCfmSerFree },
{ CSR_WIFI_SME_DISCONNECT_CFM, CsrWifiSmeDisconnectCfmSizeof, CsrWifiSmeDisconnectCfmSer, CsrWifiSmeDisconnectCfmDes, CsrWifiSmeDisconnectCfmSerFree },
{ CSR_WIFI_SME_EVENT_MASK_SET_CFM, CsrWifiSmeEventMaskSetCfmSizeof, CsrWifiSmeEventMaskSetCfmSer, CsrWifiSmeEventMaskSetCfmDes, CsrWifiSmeEventMaskSetCfmSerFree },
{ CSR_WIFI_SME_HOST_CONFIG_GET_CFM, CsrWifiSmeHostConfigGetCfmSizeof, CsrWifiSmeHostConfigGetCfmSer, CsrWifiSmeHostConfigGetCfmDes, CsrWifiSmeHostConfigGetCfmSerFree },
{ CSR_WIFI_SME_HOST_CONFIG_SET_CFM, CsrWifiSmeHostConfigSetCfmSizeof, CsrWifiSmeHostConfigSetCfmSer, CsrWifiSmeHostConfigSetCfmDes, CsrWifiSmeHostConfigSetCfmSerFree },
{ CSR_WIFI_SME_IBSS_STATION_IND, CsrWifiSmeIbssStationIndSizeof, CsrWifiSmeIbssStationIndSer, CsrWifiSmeIbssStationIndDes, CsrWifiSmeIbssStationIndSerFree },
{ CSR_WIFI_SME_KEY_CFM, CsrWifiSmeKeyCfmSizeof, CsrWifiSmeKeyCfmSer, CsrWifiSmeKeyCfmDes, CsrWifiSmeKeyCfmSerFree },
{ CSR_WIFI_SME_LINK_QUALITY_GET_CFM, CsrWifiSmeLinkQualityGetCfmSizeof, CsrWifiSmeLinkQualityGetCfmSer, CsrWifiSmeLinkQualityGetCfmDes, CsrWifiSmeLinkQualityGetCfmSerFree },
{ CSR_WIFI_SME_MEDIA_STATUS_IND, CsrWifiSmeMediaStatusIndSizeof, CsrWifiSmeMediaStatusIndSer, CsrWifiSmeMediaStatusIndDes, CsrWifiSmeMediaStatusIndSerFree },
{ CSR_WIFI_SME_MIB_CONFIG_GET_CFM, CsrWifiSmeMibConfigGetCfmSizeof, CsrWifiSmeMibConfigGetCfmSer, CsrWifiSmeMibConfigGetCfmDes, CsrWifiSmeMibConfigGetCfmSerFree },
{ CSR_WIFI_SME_MIB_CONFIG_SET_CFM, CsrWifiSmeMibConfigSetCfmSizeof, CsrWifiSmeMibConfigSetCfmSer, CsrWifiSmeMibConfigSetCfmDes, CsrWifiSmeMibConfigSetCfmSerFree },
{ CSR_WIFI_SME_MIB_GET_CFM, CsrWifiSmeMibGetCfmSizeof, CsrWifiSmeMibGetCfmSer, CsrWifiSmeMibGetCfmDes, CsrWifiSmeMibGetCfmSerFree },
{ CSR_WIFI_SME_MIB_GET_NEXT_CFM, CsrWifiSmeMibGetNextCfmSizeof, CsrWifiSmeMibGetNextCfmSer, CsrWifiSmeMibGetNextCfmDes, CsrWifiSmeMibGetNextCfmSerFree },
{ CSR_WIFI_SME_MIB_SET_CFM, CsrWifiSmeMibSetCfmSizeof, CsrWifiSmeMibSetCfmSer, CsrWifiSmeMibSetCfmDes, CsrWifiSmeMibSetCfmSerFree },
{ CSR_WIFI_SME_MIC_FAILURE_IND, CsrWifiSmeMicFailureIndSizeof, CsrWifiSmeMicFailureIndSer, CsrWifiSmeMicFailureIndDes, CsrWifiSmeMicFailureIndSerFree },
{ CSR_WIFI_SME_MULTICAST_ADDRESS_CFM, CsrWifiSmeMulticastAddressCfmSizeof, CsrWifiSmeMulticastAddressCfmSer, CsrWifiSmeMulticastAddressCfmDes, CsrWifiSmeMulticastAddressCfmSerFree },
{ CSR_WIFI_SME_PACKET_FILTER_SET_CFM, CsrWifiSmePacketFilterSetCfmSizeof, CsrWifiSmePacketFilterSetCfmSer, CsrWifiSmePacketFilterSetCfmDes, CsrWifiSmePacketFilterSetCfmSerFree },
{ CSR_WIFI_SME_PERMANENT_MAC_ADDRESS_GET_CFM, CsrWifiSmePermanentMacAddressGetCfmSizeof, CsrWifiSmePermanentMacAddressGetCfmSer, CsrWifiSmePermanentMacAddressGetCfmDes, CsrWifiSmePermanentMacAddressGetCfmSerFree },
{ CSR_WIFI_SME_PMKID_CANDIDATE_LIST_IND, CsrWifiSmePmkidCandidateListIndSizeof, CsrWifiSmePmkidCandidateListIndSer, CsrWifiSmePmkidCandidateListIndDes, CsrWifiSmePmkidCandidateListIndSerFree },
{ CSR_WIFI_SME_PMKID_CFM, CsrWifiSmePmkidCfmSizeof, CsrWifiSmePmkidCfmSer, CsrWifiSmePmkidCfmDes, CsrWifiSmePmkidCfmSerFree },
{ CSR_WIFI_SME_POWER_CONFIG_GET_CFM, CsrWifiSmePowerConfigGetCfmSizeof, CsrWifiSmePowerConfigGetCfmSer, CsrWifiSmePowerConfigGetCfmDes, CsrWifiSmePowerConfigGetCfmSerFree },
{ CSR_WIFI_SME_POWER_CONFIG_SET_CFM, CsrWifiSmePowerConfigSetCfmSizeof, CsrWifiSmePowerConfigSetCfmSer, CsrWifiSmePowerConfigSetCfmDes, CsrWifiSmePowerConfigSetCfmSerFree },
{ CSR_WIFI_SME_REGULATORY_DOMAIN_INFO_GET_CFM, CsrWifiSmeRegulatoryDomainInfoGetCfmSizeof, CsrWifiSmeRegulatoryDomainInfoGetCfmSer, CsrWifiSmeRegulatoryDomainInfoGetCfmDes, CsrWifiSmeRegulatoryDomainInfoGetCfmSerFree },
{ CSR_WIFI_SME_ROAM_COMPLETE_IND, CsrWifiSmeRoamCompleteIndSizeof, CsrWifiSmeRoamCompleteIndSer, CsrWifiSmeRoamCompleteIndDes, CsrWifiSmeRoamCompleteIndSerFree },
{ CSR_WIFI_SME_ROAM_START_IND, CsrWifiSmeRoamStartIndSizeof, CsrWifiSmeRoamStartIndSer, CsrWifiSmeRoamStartIndDes, CsrWifiSmeRoamStartIndSerFree },
{ CSR_WIFI_SME_ROAMING_CONFIG_GET_CFM, CsrWifiSmeRoamingConfigGetCfmSizeof, CsrWifiSmeRoamingConfigGetCfmSer, CsrWifiSmeRoamingConfigGetCfmDes, CsrWifiSmeRoamingConfigGetCfmSerFree },
{ CSR_WIFI_SME_ROAMING_CONFIG_SET_CFM, CsrWifiSmeRoamingConfigSetCfmSizeof, CsrWifiSmeRoamingConfigSetCfmSer, CsrWifiSmeRoamingConfigSetCfmDes, CsrWifiSmeRoamingConfigSetCfmSerFree },
{ CSR_WIFI_SME_SCAN_CONFIG_GET_CFM, CsrWifiSmeScanConfigGetCfmSizeof, CsrWifiSmeScanConfigGetCfmSer, CsrWifiSmeScanConfigGetCfmDes, CsrWifiSmeScanConfigGetCfmSerFree },
{ CSR_WIFI_SME_SCAN_CONFIG_SET_CFM, CsrWifiSmeScanConfigSetCfmSizeof, CsrWifiSmeScanConfigSetCfmSer, CsrWifiSmeScanConfigSetCfmDes, CsrWifiSmeScanConfigSetCfmSerFree },
{ CSR_WIFI_SME_SCAN_FULL_CFM, CsrWifiSmeScanFullCfmSizeof, CsrWifiSmeScanFullCfmSer, CsrWifiSmeScanFullCfmDes, CsrWifiSmeScanFullCfmSerFree },
{ CSR_WIFI_SME_SCAN_RESULT_IND, CsrWifiSmeScanResultIndSizeof, CsrWifiSmeScanResultIndSer, CsrWifiSmeScanResultIndDes, CsrWifiSmeScanResultIndSerFree },
{ CSR_WIFI_SME_SCAN_RESULTS_FLUSH_CFM, CsrWifiSmeScanResultsFlushCfmSizeof, CsrWifiSmeScanResultsFlushCfmSer, CsrWifiSmeScanResultsFlushCfmDes, CsrWifiSmeScanResultsFlushCfmSerFree },
{ CSR_WIFI_SME_SCAN_RESULTS_GET_CFM, CsrWifiSmeScanResultsGetCfmSizeof, CsrWifiSmeScanResultsGetCfmSer, CsrWifiSmeScanResultsGetCfmDes, CsrWifiSmeScanResultsGetCfmSerFree },
{ CSR_WIFI_SME_SME_STA_CONFIG_GET_CFM, CsrWifiSmeSmeStaConfigGetCfmSizeof, CsrWifiSmeSmeStaConfigGetCfmSer, CsrWifiSmeSmeStaConfigGetCfmDes, CsrWifiSmeSmeStaConfigGetCfmSerFree },
{ CSR_WIFI_SME_SME_STA_CONFIG_SET_CFM, CsrWifiSmeSmeStaConfigSetCfmSizeof, CsrWifiSmeSmeStaConfigSetCfmSer, CsrWifiSmeSmeStaConfigSetCfmDes, CsrWifiSmeSmeStaConfigSetCfmSerFree },
{ CSR_WIFI_SME_STATION_MAC_ADDRESS_GET_CFM, CsrWifiSmeStationMacAddressGetCfmSizeof, CsrWifiSmeStationMacAddressGetCfmSer, CsrWifiSmeStationMacAddressGetCfmDes, CsrWifiSmeStationMacAddressGetCfmSerFree },
{ CSR_WIFI_SME_TSPEC_IND, CsrWifiSmeTspecIndSizeof, CsrWifiSmeTspecIndSer, CsrWifiSmeTspecIndDes, CsrWifiSmeTspecIndSerFree },
{ CSR_WIFI_SME_TSPEC_CFM, CsrWifiSmeTspecCfmSizeof, CsrWifiSmeTspecCfmSer, CsrWifiSmeTspecCfmDes, CsrWifiSmeTspecCfmSerFree },
{ CSR_WIFI_SME_VERSIONS_GET_CFM, CsrWifiSmeVersionsGetCfmSizeof, CsrWifiSmeVersionsGetCfmSer, CsrWifiSmeVersionsGetCfmDes, CsrWifiSmeVersionsGetCfmSerFree },
{ CSR_WIFI_SME_WIFI_FLIGHTMODE_CFM, CsrWifiSmeWifiFlightmodeCfmSizeof, CsrWifiSmeWifiFlightmodeCfmSer, CsrWifiSmeWifiFlightmodeCfmDes, CsrWifiSmeWifiFlightmodeCfmSerFree },
{ CSR_WIFI_SME_WIFI_OFF_IND, CsrWifiSmeWifiOffIndSizeof, CsrWifiSmeWifiOffIndSer, CsrWifiSmeWifiOffIndDes, CsrWifiSmeWifiOffIndSerFree },
{ CSR_WIFI_SME_WIFI_OFF_CFM, CsrWifiSmeWifiOffCfmSizeof, CsrWifiSmeWifiOffCfmSer, CsrWifiSmeWifiOffCfmDes, CsrWifiSmeWifiOffCfmSerFree },
{ CSR_WIFI_SME_WIFI_ON_CFM, CsrWifiSmeWifiOnCfmSizeof, CsrWifiSmeWifiOnCfmSer, CsrWifiSmeWifiOnCfmDes, CsrWifiSmeWifiOnCfmSerFree },
{ CSR_WIFI_SME_CLOAKED_SSIDS_SET_CFM, CsrWifiSmeCloakedSsidsSetCfmSizeof, CsrWifiSmeCloakedSsidsSetCfmSer, CsrWifiSmeCloakedSsidsSetCfmDes, CsrWifiSmeCloakedSsidsSetCfmSerFree },
{ CSR_WIFI_SME_CLOAKED_SSIDS_GET_CFM, CsrWifiSmeCloakedSsidsGetCfmSizeof, CsrWifiSmeCloakedSsidsGetCfmSer, CsrWifiSmeCloakedSsidsGetCfmDes, CsrWifiSmeCloakedSsidsGetCfmSerFree },
{ CSR_WIFI_SME_WIFI_ON_IND, CsrWifiSmeWifiOnIndSizeof, CsrWifiSmeWifiOnIndSer, CsrWifiSmeWifiOnIndDes, CsrWifiSmeWifiOnIndSerFree },
{ CSR_WIFI_SME_SME_COMMON_CONFIG_GET_CFM, CsrWifiSmeSmeCommonConfigGetCfmSizeof, CsrWifiSmeSmeCommonConfigGetCfmSer, CsrWifiSmeSmeCommonConfigGetCfmDes, CsrWifiSmeSmeCommonConfigGetCfmSerFree },
{ CSR_WIFI_SME_SME_COMMON_CONFIG_SET_CFM, CsrWifiSmeSmeCommonConfigSetCfmSizeof, CsrWifiSmeSmeCommonConfigSetCfmSer, CsrWifiSmeSmeCommonConfigSetCfmDes, CsrWifiSmeSmeCommonConfigSetCfmSerFree },
{ CSR_WIFI_SME_INTERFACE_CAPABILITY_GET_CFM, CsrWifiSmeInterfaceCapabilityGetCfmSizeof, CsrWifiSmeInterfaceCapabilityGetCfmSer, CsrWifiSmeInterfaceCapabilityGetCfmDes, CsrWifiSmeInterfaceCapabilityGetCfmSerFree },
{ CSR_WIFI_SME_ERROR_IND, CsrWifiSmeErrorIndSizeof, CsrWifiSmeErrorIndSer, CsrWifiSmeErrorIndDes, CsrWifiSmeErrorIndSerFree },
{ CSR_WIFI_SME_INFO_IND, CsrWifiSmeInfoIndSizeof, CsrWifiSmeInfoIndSer, CsrWifiSmeInfoIndDes, CsrWifiSmeInfoIndSerFree },
{ CSR_WIFI_SME_CORE_DUMP_IND, CsrWifiSmeCoreDumpIndSizeof, CsrWifiSmeCoreDumpIndSer, CsrWifiSmeCoreDumpIndDes, CsrWifiSmeCoreDumpIndSerFree },
{ CSR_WIFI_SME_AMP_STATUS_CHANGE_IND, CsrWifiSmeAmpStatusChangeIndSizeof, CsrWifiSmeAmpStatusChangeIndSer, CsrWifiSmeAmpStatusChangeIndDes, CsrWifiSmeAmpStatusChangeIndSerFree },
{ CSR_WIFI_SME_WPS_CONFIGURATION_CFM, CsrWifiSmeWpsConfigurationCfmSizeof, CsrWifiSmeWpsConfigurationCfmSer, CsrWifiSmeWpsConfigurationCfmDes, CsrWifiSmeWpsConfigurationCfmSerFree },
{ 0, NULL, NULL, NULL, NULL },
};
CsrMsgConvMsgEntry* CsrWifiSmeConverterLookup(CsrMsgConvMsgEntry *ce, u16 msgType)
{
if (msgType & CSR_PRIM_UPSTREAM)
{
u16 idx = (msgType & ~CSR_PRIM_UPSTREAM) + CSR_WIFI_SME_PRIM_DOWNSTREAM_COUNT;
if (idx < (CSR_WIFI_SME_PRIM_UPSTREAM_COUNT + CSR_WIFI_SME_PRIM_DOWNSTREAM_COUNT) &&
csrwifisme_conv_lut[idx].msgType == msgType)
{
return &csrwifisme_conv_lut[idx];
}
}
else
{
if (msgType < CSR_WIFI_SME_PRIM_DOWNSTREAM_COUNT &&
csrwifisme_conv_lut[msgType].msgType == msgType)
{
return &csrwifisme_conv_lut[msgType];
}
}
return NULL;
}
void CsrWifiSmeConverterInit(void)
{
CsrMsgConvInsert(CSR_WIFI_SME_PRIM, csrwifisme_conv_lut);
CsrMsgConvCustomLookupRegister(CSR_WIFI_SME_PRIM, CsrWifiSmeConverterLookup);
}
#ifdef CSR_LOG_ENABLE
static const CsrLogPrimitiveInformation csrwifisme_conv_info = {
CSR_WIFI_SME_PRIM,
(char *)"CSR_WIFI_SME_PRIM",
csrwifisme_conv_lut
};
const CsrLogPrimitiveInformation* CsrWifiSmeTechInfoGet(void)
{
return &csrwifisme_conv_info;
}
#endif /* CSR_LOG_ENABLE */
#endif /* EXCLUDE_CSR_WIFI_SME_MODULE */

Some files were not shown because too many files have changed in this diff Show more