Commit 95edd09e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: csr: update to version 5.1.0 of the driver

This brings the in-kernel driver up to the level of the
csr-linux-wifi-5.1.0-oss.tar.gz tarball.

Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 635d2b00
......@@ -211,3 +211,38 @@ void CsrMemFree(void *pointer)
kfree(pointer);
}
EXPORT_SYMBOL_GPL(CsrMemFree);
/*----------------------------------------------------------------------------*
* NAME
* CsrMemAllocDma
*
* DESCRIPTION
* Allocate DMA capable dynamic memory of a given size.
*
* RETURNS
* Pointer to allocated memory, or NULL in case of failure.
* Allocated memory is not initialised.
*
*----------------------------------------------------------------------------*/
void *CsrMemAllocDma(CsrSize size)
{
return kmalloc(size, GFP_KERNEL | GFP_DMA);
}
EXPORT_SYMBOL_GPL(CsrMemAllocDma);
/*----------------------------------------------------------------------------*
* NAME
* CsrMemFreeDma
*
* DESCRIPTION
* Free DMA capable dynamic allocated memory.
*
* RETURNS
* void
*
*----------------------------------------------------------------------------*/
void CsrMemFreeDma(void *pointer)
{
kfree(pointer);
}
EXPORT_SYMBOL_GPL(CsrMemFreeDma);
......@@ -21,6 +21,7 @@
#include <stddef.h>
#include <sys/types.h>
#include <stdarg.h>
#include <string.h>
#endif
#ifdef __cplusplus
......
......@@ -221,6 +221,7 @@ void CsrUInt32ToHex(CsrUint32 number, CsrCharString *str)
/*------------------------------------------------------------------*/
/* String */
/*------------------------------------------------------------------*/
#ifndef CSR_USE_STDC_LIB
void *CsrMemCpy(void *dest, const void *src, CsrSize count)
{
return memcpy(dest, src, count);
......@@ -257,7 +258,9 @@ void *CsrMemDup(const void *buf1, CsrSize count)
return buf2;
}
#endif
#ifndef CSR_USE_STDC_LIB
CsrCharString *CsrStrCpy(CsrCharString *dest, const CsrCharString *src)
{
return strcpy(dest, src);
......@@ -303,6 +306,7 @@ CsrCharString *CsrStrChr(const CsrCharString *string, CsrCharString c)
{
return strchr(string, c);
}
#endif
CsrInt32 CsrVsnprintf(CsrCharString *string, CsrSize count, const CsrCharString *format, va_list args)
{
......
......@@ -35,26 +35,53 @@ void CsrUInt16ToHex(CsrUint16 number, CsrCharString *str);
void CsrUInt32ToHex(CsrUint32 number, CsrCharString *str);
/*------------------------------------------------------------------*/
/* String */
/* Standard C Library functions */
/*------------------------------------------------------------------*/
#ifdef CSR_USE_STDC_LIB
#define CsrMemCpy memcpy
#define CsrMemMove memmove
#define CsrStrCpy strcpy
#define CsrStrNCpy strncpy
#define CsrStrCat strcat
#define CsrStrNCat strncat
#define CsrMemCmp(s1, s2, n) ((CsrInt32) memcmp((s1), (s2), (n)))
#define CsrStrCmp(s1, s2) ((CsrInt32) strcmp((s1), (s2)))
#define CsrStrNCmp(s1, s2, n) ((CsrInt32) strncmp((s1), (s2), (n)))
/*#define CsrMemChr memchr*/
#define CsrStrChr strchr
/*#define CsrStrCSpn strcspn*/
/*#define CsrStrPBrk strpbrk*/
/*#define CsrStrRChr strrchr*/
/*#define CsrStrSpn strspn*/
#define CsrStrStr strstr
/*#define CsrStrTok strtok*/
#define CsrMemSet memset
#define CsrStrLen strlen
/*#define CsrVsnprintf(s, n, format, arg) ((CsrInt32) vsnprintf((s), (n), (format), (arg)))*/
#else /* !CSR_USE_STDC_LIB */
void *CsrMemCpy(void *dest, const void *src, CsrSize count);
void *CsrMemSet(void *dest, CsrUint8 c, CsrSize count);
void *CsrMemMove(void *dest, const void *src, CsrSize count);
CsrInt32 CsrMemCmp(const void *buf1, const void *buf2, CsrSize count);
void *CsrMemDup(const void *buf1, CsrSize count);
CsrCharString *CsrStrCpy(CsrCharString *dest, const CsrCharString *src);
CsrCharString *CsrStrNCpy(CsrCharString *dest, const CsrCharString *src, CsrSize count);
int CsrStrNICmp(const CsrCharString *string1, const CsrCharString *string2, CsrSize count);
CsrCharString *CsrStrCat(CsrCharString *dest, const CsrCharString *src);
CsrCharString *CsrStrNCat(CsrCharString *dest, const CsrCharString *src, CsrSize count);
CsrCharString *CsrStrStr(const CsrCharString *string1, const CsrCharString *string2);
CsrSize CsrStrLen(const CsrCharString *string);
CsrInt32 CsrMemCmp(const void *buf1, const void *buf2, CsrSize count);
CsrInt32 CsrStrCmp(const CsrCharString *string1, const CsrCharString *string2);
CsrInt32 CsrStrNCmp(const CsrCharString *string1, const CsrCharString *string2, CsrSize count);
CsrCharString *CsrStrDup(const CsrCharString *string);
CsrCharString *CsrStrChr(const CsrCharString *string, CsrCharString c);
CsrUint32 CsrStrToInt(const CsrCharString *string);
CsrCharString *CsrStrStr(const CsrCharString *string1, const CsrCharString *string2);
void *CsrMemSet(void *dest, CsrUint8 c, CsrSize count);
CsrSize CsrStrLen(const CsrCharString *string);
#endif /* !CSR_USE_STDC_LIB */
CsrInt32 CsrVsnprintf(CsrCharString *string, CsrSize count, const CsrCharString *format, va_list args);
/*------------------------------------------------------------------*/
/* Non-standard utility functions */
/*------------------------------------------------------------------*/
void *CsrMemDup(const void *buf1, CsrSize count);
int CsrStrNICmp(const CsrCharString *string1, const CsrCharString *string2, CsrSize count);
CsrCharString *CsrStrDup(const CsrCharString *string);
CsrUint32 CsrStrToInt(const CsrCharString *string);
CsrCharString *CsrStrNCpyZero(CsrCharString *dest, const CsrCharString *src, CsrSize count);
/*------------------------------------------------------------------*/
......
......@@ -99,7 +99,7 @@ typedef struct
#define CSR_WIFI_RESULT_INVALID_INTERFACE_TAG ((CsrResult) 0x000B)
#define CSR_WIFI_RESULT_P2P_NOA_CONFIG_CONFLICT ((CsrResult) 0x000C)
#define CSR_WIFI_VERSION "5.0.3.0"
#define CSR_WIFI_VERSION "5.1.0.0"
#ifdef __cplusplus
}
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -81,6 +81,15 @@ CsrResult CardWriteBulkData(card_t *card, card_signal_t *csptr, unifi_TrafficQue
*/
void CardClearFromHostDataSlot(card_t *card, const CsrInt16 aSlotNum);
#ifdef CSR_WIFI_REQUEUE_PACKET_TO_HAL
/*****************************************************************************
* CardClearFromHostDataSlotWithoutFreeingBulkData - Clear the data stot
* without freeing the bulk data
*/
void CardClearFromHostDataSlotWithoutFreeingBulkData(card_t *card, const CsrInt16 aSlotNum);
#endif
/*****************************************************************************
* CardGetFreeFromHostDataSlots -
*/
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -323,7 +323,7 @@ CsrResult unifi_init(card_t *card)
* have requested a mini-coredump which needs to be captured now the
* SDIO interface is alive.
*/
unifi_coredump_handle_request(card);
(void)unifi_coredump_handle_request(card);
/*
* Probe to see if the UniFi has ROM/flash to boot from. CSR6xxx should do.
......@@ -1616,14 +1616,14 @@ static CsrResult card_allocate_memory_resources(card_t *card)
/* Reset any state carried forward from a previous life */
card->fh_command_queue.q_rd_ptr = 0;
card->fh_command_queue.q_wr_ptr = 0;
CsrSnprintf(card->fh_command_queue.name, UNIFI_QUEUE_NAME_MAX_LENGTH,
"fh_cmd_q");
(void)CsrSnprintf(card->fh_command_queue.name, UNIFI_QUEUE_NAME_MAX_LENGTH,
"fh_cmd_q");
for (i = 0; i < UNIFI_NO_OF_TX_QS; i++)
{
card->fh_traffic_queue[i].q_rd_ptr = 0;
card->fh_traffic_queue[i].q_wr_ptr = 0;
CsrSnprintf(card->fh_traffic_queue[i].name,
UNIFI_QUEUE_NAME_MAX_LENGTH, "fh_data_q%d", i);
(void)CsrSnprintf(card->fh_traffic_queue[i].name,
UNIFI_QUEUE_NAME_MAX_LENGTH, "fh_data_q%d", i);
}
#ifndef CSR_WIFI_HIP_TA_DISABLE
unifi_ta_sampling_init(card);
......@@ -1634,7 +1634,7 @@ static CsrResult card_allocate_memory_resources(card_t *card)
/*
* Allocate memory for the from-host and to-host signal buffers.
*/
card->fh_buffer.buf = CsrMemAlloc(UNIFI_FH_BUF_SIZE);
card->fh_buffer.buf = CsrMemAllocDma(UNIFI_FH_BUF_SIZE);
if (card->fh_buffer.buf == NULL)
{
unifi_error(card->ospriv, "Failed to allocate memory for F-H signals\n");
......@@ -1645,7 +1645,7 @@ static CsrResult card_allocate_memory_resources(card_t *card)
card->fh_buffer.ptr = card->fh_buffer.buf;
card->fh_buffer.count = 0;
card->th_buffer.buf = CsrMemAlloc(UNIFI_FH_BUF_SIZE);
card->th_buffer.buf = CsrMemAllocDma(UNIFI_FH_BUF_SIZE);
if (card->th_buffer.buf == NULL)
{
unifi_error(card->ospriv, "Failed to allocate memory for T-H signals\n");
......@@ -1693,6 +1693,12 @@ static CsrResult card_allocate_memory_resources(card_t *card)
return CSR_WIFI_HIP_RESULT_NO_MEMORY;
}
/* Initialise host tag entries for from-host bulk data slots */
for (i = 0; i < n; i++)
{
card->fh_slot_host_tag_record[i] = CSR_WIFI_HIP_RESERVED_HOST_TAG;
}
/* Allocate memory for the array of pointers */
n = cfg_data->num_tohost_data_slots;
......@@ -1811,7 +1817,7 @@ static void card_free_memory_resources(card_t *card)
if (card->fh_buffer.buf)
{
CsrMemFree(card->fh_buffer.buf);
CsrMemFreeDma(card->fh_buffer.buf);
}
card->fh_buffer.ptr = card->fh_buffer.buf = NULL;
card->fh_buffer.bufsize = 0;
......@@ -1819,7 +1825,7 @@ static void card_free_memory_resources(card_t *card)
if (card->th_buffer.buf)
{
CsrMemFree(card->th_buffer.buf);
CsrMemFreeDma(card->th_buffer.buf);
}
card->th_buffer.ptr = card->th_buffer.buf = NULL;
card->th_buffer.bufsize = 0;
......@@ -1842,14 +1848,14 @@ static void card_init_soft_queues(card_t *card)
/* Reset any state carried forward from a previous life */
card->fh_command_queue.q_rd_ptr = 0;
card->fh_command_queue.q_wr_ptr = 0;
CsrSnprintf(card->fh_command_queue.name, UNIFI_QUEUE_NAME_MAX_LENGTH,
"fh_cmd_q");
(void)CsrSnprintf(card->fh_command_queue.name, UNIFI_QUEUE_NAME_MAX_LENGTH,
"fh_cmd_q");
for (i = 0; i < UNIFI_NO_OF_TX_QS; i++)
{
card->fh_traffic_queue[i].q_rd_ptr = 0;
card->fh_traffic_queue[i].q_wr_ptr = 0;
CsrSnprintf(card->fh_traffic_queue[i].name,
UNIFI_QUEUE_NAME_MAX_LENGTH, "fh_data_q%d", i);
(void)CsrSnprintf(card->fh_traffic_queue[i].name,
UNIFI_QUEUE_NAME_MAX_LENGTH, "fh_data_q%d", i);
}
#ifndef CSR_WIFI_HIP_TA_DISABLE
unifi_ta_sampling_init(card);
......@@ -2399,6 +2405,57 @@ void CardClearFromHostDataSlot(card_t *card, const CsrInt16 slot)
} /* CardClearFromHostDataSlot() */
#ifdef CSR_WIFI_REQUEUE_PACKET_TO_HAL
/*
* ---------------------------------------------------------------------------
* CardClearFromHostDataSlotWithoutFreeingBulkData
*
* Clear the given data slot with out freeing the bulk data.
*
* Arguments:
* card Pointer to Card object
* slot Index of the signal slot to clear.
*
* Returns:
* None.
* ---------------------------------------------------------------------------
*/
void CardClearFromHostDataSlotWithoutFreeingBulkData(card_t *card, const CsrInt16 slot)
{
CsrUint8 queue = card->from_host_data[slot].queue;
/* Initialise the from_host data slot so it can be re-used,
* Set length field in from_host_data array to 0.
*/
UNIFI_INIT_BULK_DATA(&card->from_host_data[slot].bd);
queue = card->from_host_data[slot].queue;
if (queue < UNIFI_NO_OF_TX_QS)
{
if (card->dynamic_slot_data.from_host_used_slots[queue] == 0)
{
unifi_error(card->ospriv, "Goofed up used slots q = %d used slots = %d\n",
queue,
card->dynamic_slot_data.from_host_used_slots[queue]);
}
else
{
card->dynamic_slot_data.from_host_used_slots[queue]--;
}
card->dynamic_slot_data.packets_txed[queue]++;
card->dynamic_slot_data.total_packets_txed++;
if (card->dynamic_slot_data.total_packets_txed >=
card->dynamic_slot_data.packets_interval)
{
CardReassignDynamicReservation(card);
}
}
} /* CardClearFromHostDataSlotWithoutFreeingBulkData() */
#endif
CsrUint16 CardGetDataSlotSize(card_t *card)
{
return card->config_data.data_slot_size;
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -148,9 +148,9 @@ void unifi_debug_hex_to_buf(const CsrCharString *buff, CsrUint16 length)
CsrCharString s[5];
CsrUint16 i;
for (i = 0; i < length; i++)
for (i = 0; i < length; i = i + 2)
{
CsrUInt16ToHex(0xff & buff[i], s);
CsrUInt16ToHex(*((CsrUint16 *)(buff + i)), s);
unifi_debug_string_to_buf(s);
}
}
......@@ -277,7 +277,7 @@ void unifi_sdio_interrupt_handler(card_t *card)
* Then ask the OS layer to run the unifi_bh to give attention to the UniFi.
*/
card->bh_reason_unifi = 1;
unifi_run_bh(card->ospriv);
(void)unifi_run_bh(card->ospriv);
} /* sdio_interrupt_handler() */
......@@ -309,7 +309,7 @@ CsrResult unifi_configure_low_power_mode(card_t *card,
(low_power_mode == UNIFI_LOW_POWER_DISABLED)?"disabled" : "enabled",
(periodic_wake_mode == UNIFI_PERIODIC_WAKE_HOST_DISABLED)?"FALSE" : "TRUE");
unifi_run_bh(card->ospriv);
(void)unifi_run_bh(card->ospriv);
return CSR_RESULT_SUCCESS;
} /* unifi_configure_low_power_mode() */
......@@ -614,10 +614,10 @@ CsrResult unifi_bh(card_t *card, CsrUint32 *remaining)
(low_power_mode == UNIFI_LOW_POWER_DISABLED)?"disabled" : "enabled");
/* Try to capture firmware panic codes */
unifi_capture_panic(card);
(void)unifi_capture_panic(card);
/* Ask for a mini-coredump when the driver has reset UniFi */
unifi_coredump_request_at_next_reset(card, 1);
(void)unifi_coredump_request_at_next_reset(card, 1);
}
return r;
......@@ -932,9 +932,13 @@ static CsrResult handle_host_protocol(card_t *card, CsrBool *processed_something
return r;
}
}
#ifdef CSR_WIFI_RX_PATH_SPLIT
#ifdef CSR_WIFI_RX_PATH_SPLIT_DONT_USE_WQ
unifi_rx_queue_flush(card->ospriv);
#endif
#endif
/* See if we can re-enable transmission now */
restart_packet_flow(card);
......@@ -1324,7 +1328,6 @@ static CsrResult process_to_host_signals(card_t *card, CsrInt32 *processed)
if (status && (card->fh_slot_host_tag_record))
{
CsrUint16 num_fh_slots = card->config_data.num_fromhost_data_slots;
CsrUint16 i = 0;
/* search through the list of slot records and match with host tag
* If a slot is not yet cleared then clear the slot from here
......@@ -1333,12 +1336,27 @@ static CsrResult process_to_host_signals(card_t *card, CsrInt32 *processed)
{
if (card->fh_slot_host_tag_record[i] == host_tag)
{
#ifdef CSR_WIFI_REQUEUE_PACKET_TO_HAL
/* Invoke the HAL module function to requeue it back to HAL Queues */
r = unifi_reque_ma_packet_request(card->ospriv, host_tag, status, &card->from_host_data[i].bd);
card->fh_slot_host_tag_record[i] = CSR_WIFI_HIP_RESERVED_HOST_TAG;
if (CSR_RESULT_SUCCESS != r)
{
unifi_trace(card->ospriv, UDBG5, "process_to_host_signals: Failed to requeue Packet(hTag:%x) back to HAL \n", host_tag);
CardClearFromHostDataSlot(card, i);
}
else
{
CardClearFromHostDataSlotWithoutFreeingBulkData(card, i);
}
#else
unifi_trace(card->ospriv, UDBG4, "process_to_host_signals Clear slot=%x host tag=%x\n", i, host_tag);
card->fh_slot_host_tag_record[i] = CSR_WIFI_HIP_RESERVED_HOST_TAG;
/* Set length field in from_host_data array to 0 */
CardClearFromHostDataSlot(card, i);
#endif
break;
}
}
......@@ -1724,7 +1742,7 @@ static CsrResult process_bulk_data_command(card_t *card, const CsrUint8 *cmdptr,
if (len != 0 && (dir == UNIFI_SDIO_WRITE) && (((CsrIntptr)bdslot->os_data_ptr + offset) & 3))
{
host_bulk_data_slot = CsrMemAlloc(len);
host_bulk_data_slot = CsrMemAllocDma(len);
if (!host_bulk_data_slot)
{
......@@ -1783,7 +1801,7 @@ static CsrResult process_bulk_data_command(card_t *card, const CsrUint8 *cmdptr,
/* moving this check before we clear host data slot */
if ((len != 0) && (dir == UNIFI_SDIO_WRITE) && (((CsrIntptr)bdslot->os_data_ptr + offset) & 3))
{
CsrMemFree(host_bulk_data_slot);
CsrMemFreeDma(host_bulk_data_slot);
}
#endif
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -1565,7 +1565,7 @@ CsrResult unifi_bulk_rw(card_t *card, CsrUint32 handle, void *pdata,
*/
if (card->chip_id <= SDIO_CARD_ID_UNIFI_2)
{
unifi_set_host_state(card, UNIFI_HOST_STATE_AWAKE);
(void)unifi_set_host_state(card, UNIFI_HOST_STATE_AWAKE);
}
/* If csr_sdio_block_rw() failed in a non-retryable way, or retries exhausted
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -674,7 +674,7 @@ static CsrResult send_ptdl_to_unifi(card_t *card, void *dlpriv,
return CSR_WIFI_HIP_RESULT_INVALID_VALUE;
}
buf = CsrMemAlloc(buf_size);
buf = CsrMemAllocDma(buf_size);
if (buf == NULL)
{
unifi_error(card->ospriv, "Failed to allocate transfer buffer for firmware download\n");
......@@ -720,7 +720,7 @@ static CsrResult send_ptdl_to_unifi(card_t *card, void *dlpriv,
}
}
CsrMemFree(buf);
CsrMemFreeDma(buf);
if (r != CSR_RESULT_SUCCESS && r != CSR_WIFI_HIP_RESULT_NO_DEVICE)
{
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -293,7 +293,7 @@ CsrResult unifi_coredump_capture(card_t *card, struct unifi_coredump_req *req)
* Notes:
* ---------------------------------------------------------------------------
*/
static CsrInt32 get_value_from_coredump(const coredump_buffer *dump,
static CsrInt32 get_value_from_coredump(const coredump_buffer *coreDump,
const unifi_coredump_space_t space,
const CsrUint16 offset_in_space)
{
......@@ -316,7 +316,7 @@ static CsrInt32 get_value_from_coredump(const coredump_buffer *dump,
{
/* Calculate the offset of data within the zone buffer */
offset_in_zone = offset_in_space - def->offset;
r = (CsrInt32) * (dump->zone[i] + offset_in_zone);
r = (CsrInt32) * (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",
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -69,9 +69,9 @@ enum ta_frame_identity
#define TA_EAPOL_TYPE_OFFSET 9
#define TA_EAPOL_TYPE_START 0x01
static const CsrUint8 snap_802_2[3] = { 0xAA, 0xAA, 0x03 };
static const CsrUint8 oui_rfc1042[3] = { 0x00, 0x00, 0x00 };
static const CsrUint8 oui_8021h[3] = { 0x00, 0x00, 0xf8 };
#define snap_802_2 0xAAAA0300
#define oui_rfc1042 0x00000000
#define oui_8021h 0x0000f800
static const CsrUint8 aironet_snap[5] = { 0x00, 0x40, 0x96, 0x00, 0x00 };
......@@ -100,13 +100,17 @@ static enum ta_frame_identity ta_detect_protocol(card_t *card, CsrWifiRouterCtrl
CsrUint16 proto;
CsrUint16 source_port, dest_port;
CsrWifiMacAddress srcAddress;
CsrUint32 snap_hdr, oui_hdr;
if (data->data_length < TA_LLC_HEADER_SIZE)
{
return TA_FRAME_UNKNOWN;
}
if (CsrMemCmp(data->os_data_ptr, snap_802_2, 3))
snap_hdr = (((CsrUint32)data->os_data_ptr[0]) << 24) |
(((CsrUint32)data->os_data_ptr[1]) << 16) |
(((CsrUint32)data->os_data_ptr[2]) << 8);
if (snap_hdr != snap_802_2)
{
return TA_FRAME_UNKNOWN;
}
......@@ -118,8 +122,10 @@ static enum ta_frame_identity ta_detect_protocol(card_t *card, CsrWifiRouterCtrl
*/
}
if (!CsrMemCmp(data->os_data_ptr + 3, oui_rfc1042, 3) ||
!CsrMemCmp(data->os_data_ptr + 3, oui_8021h, 3))
oui_hdr = (((CsrUint32)data->os_data_ptr[3]) << 24) |
(((CsrUint32)data->os_data_ptr[4]) << 16) |
(((CsrUint32)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];
......@@ -177,7 +183,7 @@ static enum ta_frame_identity ta_detect_protocol(card_t *card, CsrWifiRouterCtrl
/* The DHCP should have at least a message type (request, ack, nack, etc) */
if (data->data_length > TA_DHCP_MESSAGE_TYPE_OFFSET + 6)
{
CsrMemCpy(srcAddress.a, saddr, 6);
UNIFI_MAC_ADDRESS_COPY(srcAddress.a, saddr);
if (direction == CSR_WIFI_ROUTER_CTRL_PROTOCOL_DIRECTION_TX)
{
......@@ -189,7 +195,7 @@ static enum ta_frame_identity ta_detect_protocol(card_t *card, CsrWifiRouterCtrl
}
/* DHCPACK is a special indication */
if (!CsrMemCmp(data->os_data_ptr + TA_BOOTP_CLIENT_MAC_ADDR_OFFSET, sta_macaddr, 6))
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)
{
......@@ -224,7 +230,7 @@ static enum ta_frame_identity ta_detect_protocol(card_t *card, CsrWifiRouterCtrl
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))
{
CsrMemCpy(srcAddress.a, saddr, 6);
UNIFI_MAC_ADDRESS_COPY(srcAddress.a, saddr);
unifi_ta_indicate_protocol(card->ospriv,
CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_EAPOL,
direction, &srcAddress);
......@@ -238,7 +244,7 @@ static enum ta_frame_identity ta_detect_protocol(card_t *card, CsrWifiRouterCtrl
{
if (proto == TA_PROTO_TYPE_ARP)
{
CsrMemCpy(srcAddress.a, saddr, 6);
UNIFI_MAC_ADDRESS_COPY(srcAddress.a, saddr);
unifi_ta_indicate_protocol(card->ospriv,
CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_ARP,
direction, &srcAddress);
......@@ -253,7 +259,7 @@ static enum ta_frame_identity ta_detect_protocol(card_t *card, CsrWifiRouterCtrl
/* detect Aironet frames */
if (!CsrMemCmp(data->os_data_ptr + 3, aironet_snap, 5))
{
CsrMemCpy(srcAddress.a, saddr, 6);
UNIFI_MAC_ADDRESS_COPY(srcAddress.a, saddr);
unifi_ta_indicate_protocol(card->ospriv, CSR_WIFI_ROUTER_CTRL_TRAFFIC_PACKET_TYPE_AIRONET,
direction, &srcAddress);
}
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -103,6 +103,17 @@ extern "C" {
#include "csr_formatted_io.h" /* from the synergy gsp 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
......@@ -635,7 +646,24 @@ void unifi_receive_event(void *ospriv,
CsrUint8 *sigdata, CsrUint32 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, CsrUint32 host_tag,
CsrUint16 status,
bulk_data_desc_t *bulkDataDesc);
#endif
typedef struct
{
CsrUint16 free_fh_sig_queue_slots[UNIFI_NO_OF_TX_QS];
......@@ -836,6 +864,8 @@ const CsrCharString* lookup_bulkcmd_name(CsrUint16 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 CsrCharString *fmt, ...);
void unifi_debug_hex_to_buf(const CsrCharString *buff, CsrUint16 length);
#endif
/* Mini-coredump utility functions */
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -579,8 +579,8 @@ static CsrUint32 write_uint16(void *buf, const CsrUint32 offset, const CsrUint16
static CsrUint32 write_uint32(void *buf, const CsrUint32 offset, const CsrUint32 val)
{
write_uint16(buf, offset + 0, (CsrUint16)(val & 0xffff));
write_uint16(buf, offset + 2, (CsrUint16)(val >> 16));
(void)write_uint16(buf, offset + 0, (CsrUint16)(val & 0xffff));
(void)write_uint16(buf, offset + 2, (CsrUint16)(val >> 16));
return sizeof(CsrUint32);
}
......@@ -1055,11 +1055,11 @@ void* xbv_to_patch(card_t *card, fwreadfn_t readfn,
patch_offs += write_reset_ptdl(patch_buf, patch_offs, fwinfo, fw_id);
/* Now the length is known, update the LIST.length */
write_uint32(patch_buf, list_len_offs,
(patch_offs - ptdl_start_offs) + PTCH_LIST_SIZE);
(void)write_uint32(patch_buf, list_len_offs,
(patch_offs - ptdl_start_offs) + PTCH_LIST_SIZE);
/* Re write XBV headers just to fill in the correct file size */
write_xbv_header(patch_buf, 0, (patch_offs - payload_offs));
(void)write_xbv_header(patch_buf, 0, (patch_offs - payload_offs));
unifi_trace(card->ospriv, UDBG1, "XBV:PTCH size %u, fw_id %u\n",
patch_offs, fw_id);
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -196,7 +196,6 @@ extern const CsrCharString *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM
apCredentials - Security credential configuration.
maxConnections - Maximum number of stations/P2P clients allowed
p2pGoParam - P2P specific GO parameters.
NOT USED FOR CURRENT RELEASE
wpsEnabled - Indicates whether WPS should be enabled or not
*******************************************************************************/
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -248,7 +248,6 @@ typedef struct
apCredentials - Security credential configuration.
maxConnections - Maximum number of stations/P2P clients allowed
p2pGoParam - P2P specific GO parameters.
NOT USED FOR CURRENT RELEASE
wpsEnabled - Indicates whether WPS should be enabled or not
*******************************************************************************/
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -41,11 +41,11 @@ CsrMsgConvMsgEntry* CsrWifiRouterConverterLookup(CsrMsgConvMsgEntry *ce, CsrUint
{
if (msgType & CSR_PRIM_UPSTREAM)
{
CsrUint16 index = (msgType & ~CSR_PRIM_UPSTREAM) + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT;
if (index < (CSR_WIFI_ROUTER_PRIM_UPSTREAM_COUNT + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT) &&
csrwifirouter_conv_lut[index].msgType == msgType)
CsrUint16 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[index];
return &csrwifirouter_conv_lut[idx];
}
}
else
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -50,9 +50,11 @@ static CsrMsgConvMsgEntry csrwifirouterctrl_conv_lut[] = {
{ 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_MULTICAST_REQ, CsrWifiRouterCtrlWapiMulticastReqSizeof, CsrWifiRouterCtrlWapiMulticastReqSer, CsrWifiRouterCtrlWapiMulticastReqDes, CsrWifiRouterCtrlWapiMulticastReqSerFree },
{ 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 },
......@@ -81,7 +83,9 @@ static CsrMsgConvMsgEntry csrwifirouterctrl_conv_lut[] = {
{ 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_MULTICAST_IND, CsrWifiRouterCtrlWapiMulticastIndSizeof, CsrWifiRouterCtrlWapiMulticastIndSer, CsrWifiRouterCtrlWapiMulticastIndDes, CsrWifiRouterCtrlWapiMulticastIndSerFree },
{ 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 },
};
......@@ -90,11 +94,11 @@ CsrMsgConvMsgEntry* CsrWifiRouterCtrlConverterLookup(CsrMsgConvMsgEntry *ce, Csr
{
if (msgType & CSR_PRIM_UPSTREAM)
{
CsrUint16 index = (msgType & ~CSR_PRIM_UPSTREAM) + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_COUNT;
if (index < (CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_COUNT + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_COUNT) &&
csrwifirouterctrl_conv_lut[index].msgType == msgType)
CsrUint16 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[index];
return &csrwifirouterctrl_conv_lut[idx];
}
}
else
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -70,6 +70,13 @@ void CsrWifiRouterCtrlFreeDownstreamMessageContents(CsrUint16 eventClass, void *
p->tclas = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WIFI_ON_REQ:
{
CsrWifiRouterCtrlWifiOnReq *p = (CsrWifiRouterCtrlWifiOnReq *)message;
CsrPmemFree(p->data);
p->data = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WIFI_ON_RES:
{
CsrWifiRouterCtrlWifiOnRes *p = (CsrWifiRouterCtrlWifiOnRes *)message;
......@@ -77,15 +84,22 @@ void CsrWifiRouterCtrlFreeDownstreamMessageContents(CsrUint16 eventClass, void *
p->smeVersions.smeBuild = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_MULTICAST_REQ:
case CSR_WIFI_ROUTER_CTRL_WAPI_RX_PKT_REQ:
{
CsrWifiRouterCtrlWapiMulticastReq *p = (CsrWifiRouterCtrlWapiMulticastReq *)message;
CsrWifiRouterCtrlWapiRxPktReq *p = (CsrWifiRouterCtrlWapiRxPktReq *)message;
CsrPmemFree(p->signal);
p->signal = NULL;
CsrPmemFree(p->data);
p->data = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_TX_PKT_REQ:
{
CsrWifiRouterCtrlWapiUnicastTxPktReq *p = (CsrWifiRouterCtrlWapiUnicastTxPktReq *)message;
CsrPmemFree(p->data);
p->data = NULL;
break;
}
default:
break;
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -63,15 +63,22 @@ void CsrWifiRouterCtrlFreeUpstreamMessageContents(CsrUint16 eventClass, void *me
p->versions.routerBuild = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_MULTICAST_IND:
case CSR_WIFI_ROUTER_CTRL_WAPI_RX_MIC_CHECK_IND:
{
CsrWifiRouterCtrlWapiMulticastInd *p = (CsrWifiRouterCtrlWapiMulticastInd *)message;
CsrWifiRouterCtrlWapiRxMicCheckInd *p = (CsrWifiRouterCtrlWapiRxMicCheckInd *)message;
CsrPmemFree(p->signal);
p->signal = NULL;
CsrPmemFree(p->data);
p->data = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_TX_ENCRYPT_IND:
{
CsrWifiRouterCtrlWapiUnicastTxEncryptInd *p = (CsrWifiRouterCtrlWapiUnicastTxEncryptInd *)message;
CsrPmemFree(p->data);
p->data = NULL;
break;
}
default:
break;
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -616,12 +616,14 @@ typedef struct
#define CSR_WIFI_ROUTER_CTRL_CAPABILITIES_REQ ((CsrWifiRouterCtrlPrim) (0x0017 + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_BLOCK_ACK_ENABLE_REQ ((CsrWifiRouterCtrlPrim) (0x0018 + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_BLOCK_ACK_DISABLE_REQ ((CsrWifiRouterCtrlPrim) (0x0019 + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_WAPI_MULTICAST_REQ ((CsrWifiRouterCtrlPrim) (0x001A + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_WAPI_RX_PKT_REQ ((CsrWifiRouterCtrlPrim) (0x001A + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_WAPI_MULTICAST_FILTER_REQ ((CsrWifiRouterCtrlPrim) (0x001B + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_FILTER_REQ ((CsrWifiRouterCtrlPrim) (0x001C + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_TX_PKT_REQ ((CsrWifiRouterCtrlPrim) (0x001D + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_WAPI_FILTER_REQ ((CsrWifiRouterCtrlPrim) (0x001E + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_HIGHEST (0x001C + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST)
#define CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_HIGHEST (0x001E + CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST)
/* Upstream */
#define CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST (0x0000 + CSR_PRIM_UPSTREAM)
......@@ -654,9 +656,11 @@ typedef struct
#define CSR_WIFI_ROUTER_CTRL_BLOCK_ACK_DISABLE_CFM ((CsrWifiRouterCtrlPrim)(0x0019 + CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_BLOCK_ACK_ERROR_IND ((CsrWifiRouterCtrlPrim)(0x001A + CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_STA_INACTIVE_IND ((CsrWifiRouterCtrlPrim)(0x001B + CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_WAPI_MULTICAST_IND ((CsrWifiRouterCtrlPrim)(0x001C + CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_WAPI_RX_MIC_CHECK_IND ((CsrWifiRouterCtrlPrim)(0x001C + CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_MODE_SET_CFM ((CsrWifiRouterCtrlPrim)(0x001D + CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_TX_ENCRYPT_IND ((CsrWifiRouterCtrlPrim)(0x001E + CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_HIGHEST (0x001C + CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST)
#define CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_HIGHEST (0x001E + CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST)
#define CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_COUNT (CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_HIGHEST + 1 - CSR_WIFI_ROUTER_CTRL_PRIM_DOWNSTREAM_LOWEST)
#define CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_COUNT (CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_HIGHEST + 1 - CSR_WIFI_ROUTER_CTRL_PRIM_UPSTREAM_LOWEST)
......@@ -1032,12 +1036,16 @@ typedef struct
MEMBERS
common - Common header for use with the CsrWifiFsm Module
clientData -
dataLength - Number of bytes in the buffer pointed to by 'data'
data - Pointer to the buffer containing 'dataLength' bytes
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrWifiRouterCtrlRequestorInfo clientData;
CsrUint32 dataLength;
CsrUint8 *data;
} CsrWifiRouterCtrlWifiOnReq;
/*******************************************************************************
......@@ -1273,12 +1281,13 @@ typedef struct
/*******************************************************************************
NAME
CsrWifiRouterCtrlWapiMulticastReq
CsrWifiRouterCtrlWapiRxPktReq
DESCRIPTION
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag -
signalLength -
signal -
dataLength -
......@@ -1288,11 +1297,12 @@ typedef struct
typedef struct
{
CsrWifiFsmEvent common;
CsrUint16 interfaceTag;
CsrUint16 signalLength;
CsrUint8 *signal;
CsrUint16 dataLength;
CsrUint8 *data;
} CsrWifiRouterCtrlWapiMulticastReq;
} CsrWifiRouterCtrlWapiRxPktReq;
/*******************************************************************************
......@@ -1302,13 +1312,15 @@ typedef struct
DESCRIPTION
MEMBERS
common - Common header for use with the CsrWifiFsm Module
status -
common - Common header for use with the CsrWifiFsm Module
interfaceTag -
status -
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrUint16 interfaceTag;
CsrUint8 status;
} CsrWifiRouterCtrlWapiMulticastFilterReq;
......@@ -1320,16 +1332,60 @@ typedef struct
DESCRIPTION
MEMBERS
common - Common header for use with the CsrWifiFsm Module
status -
common - Common header for use with the CsrWifiFsm Module
interfaceTag -
status -
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrUint16 interfaceTag;
CsrUint8 status;
} CsrWifiRouterCtrlWapiUnicastFilterReq;
/*******************************************************************************
NAME
CsrWifiRouterCtrlWapiUnicastTxPktReq
DESCRIPTION
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag -
dataLength -
data -
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrUint16 interfaceTag;
CsrUint16 dataLength;
CsrUint8 *data;
} CsrWifiRouterCtrlWapiUnicastTxPktReq;
/*******************************************************************************
NAME
CsrWifiRouterCtrlWapiFilterReq
DESCRIPTION
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag -
isWapiConnected -
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrUint16 interfaceTag;
CsrBool isWapiConnected;
} CsrWifiRouterCtrlWapiFilterReq;
/*******************************************************************************
NAME
......@@ -1984,7 +2040,7 @@ typedef struct
/*******************************************************************************
NAME
CsrWifiRouterCtrlWapiMulticastInd
CsrWifiRouterCtrlWapiRxMicCheckInd
DESCRIPTION
......@@ -2007,7 +2063,55 @@ typedef struct
CsrUint8 *signal;
CsrUint16 dataLength;
CsrUint8 *data;
} CsrWifiRouterCtrlWapiMulticastInd;
} CsrWifiRouterCtrlWapiRxMicCheckInd;
/*******************************************************************************
NAME
CsrWifiRouterCtrlModeSetCfm
DESCRIPTION
MEMBERS
common - Common header for use with the CsrWifiFsm Module
clientData -
interfaceTag -
mode -
status -
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrWifiRouterCtrlRequestorInfo clientData;
CsrUint16 interfaceTag;
CsrWifiRouterCtrlMode mode;
CsrResult status;
} CsrWifiRouterCtrlModeSetCfm;
/*******************************************************************************
NAME
CsrWifiRouterCtrlWapiUnicastTxEncryptInd
DESCRIPTION
MEMBERS
common - Common header for use with the CsrWifiFsm Module
clientData -
interfaceTag -
dataLength -
data -
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrWifiRouterCtrlRequestorInfo clientData;
CsrUint16 interfaceTag;
CsrUint16 dataLength;
CsrUint8 *data;
} CsrWifiRouterCtrlWapiUnicastTxEncryptInd;
#ifdef __cplusplus
......
......@@ -35,9 +35,11 @@ const CsrWifiRouterCtrlStateHandlerType CsrWifiRouterCtrlDownstreamStateHandlers
/* 0x0015 */ CsrWifiRouterCtrlPeerDelReqHandler,
/* 0x0016 */ CsrWifiRouterCtrlPeerUpdateReqHandler,
/* 0x0017 */ CsrWifiRouterCtrlCapabilitiesReqHandler,
CsrWifiRouterCtrlBlockAckEnableReqHandler, /* 0x0018 */
CsrWifiRouterCtrlBlockAckDisableReqHandler, /* 0x0019 */
CsrWifiRouterCtrlWapiMulticastReqHandler, /* 0x001A */
CsrWifiRouterCtrlWapiMulticastFilterReqHandler, /* 0x001B */
CsrWifiRouterCtrlWapiUnicastFilterReqHandler, /* 0x001C */
/* 0x0018 */ CsrWifiRouterCtrlBlockAckEnableReqHandler,
/* 0x0019 */ CsrWifiRouterCtrlBlockAckDisableReqHandler,
/* 0x001A */ CsrWifiRouterCtrlWapiRxPktReqHandler,
/* 0x001B */ CsrWifiRouterCtrlWapiMulticastFilterReqHandler,
/* 0x001C */ CsrWifiRouterCtrlWapiUnicastFilterReqHandler,
/* 0x001D */ CsrWifiRouterCtrlWapiUnicastTxPktReqHandler,
/* 0x001E */ CsrWifiRouterCtrlWapiFilterReqHandler,
};
......@@ -47,8 +47,10 @@ extern "C" {
extern void CsrWifiRouterCtrlBlockAckEnableReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlBlockAckDisableReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWapiMulticastFilterReqHandler(void* drvpriv, CsrWifiFsmEvent* msg);
extern void CsrWifiRouterCtrlWapiMulticastReqHandler(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);
#ifdef __cplusplus
}
#endif
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -105,10 +105,10 @@ extern CsrSize CsrWifiRouterCtrlTrafficConfigReqSizeof(void *msg);
#define CsrWifiRouterCtrlWifiOffResSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiRouterCtrlWifiOffResSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlWifiOnReqSer CsrWifiEventCsrUint16Ser
#define CsrWifiRouterCtrlWifiOnReqDes CsrWifiEventCsrUint16Des
#define CsrWifiRouterCtrlWifiOnReqSizeof CsrWifiEventCsrUint16Sizeof
#define CsrWifiRouterCtrlWifiOnReqSerFree CsrWifiRouterCtrlPfree
extern CsrUint8* CsrWifiRouterCtrlWifiOnReqSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiRouterCtrlWifiOnReqDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiRouterCtrlWifiOnReqSizeof(void *msg);
extern void CsrWifiRouterCtrlWifiOnReqSerFree(void *msg);
extern CsrUint8* CsrWifiRouterCtrlWifiOnResSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiRouterCtrlWifiOnResDes(CsrUint8 *buffer, CsrSize len);
......@@ -155,21 +155,31 @@ extern void* CsrWifiRouterCtrlBlockAckDisableReqDes(CsrUint8 *buffer, CsrSize le
extern CsrSize CsrWifiRouterCtrlBlockAckDisableReqSizeof(void *msg);
#define CsrWifiRouterCtrlBlockAckDisableReqSerFree CsrWifiRouterCtrlPfree
extern CsrUint8* CsrWifiRouterCtrlWapiMulticastReqSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiRouterCtrlWapiMulticastReqDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiRouterCtrlWapiMulticastReqSizeof(void *msg);
extern void CsrWifiRouterCtrlWapiMulticastReqSerFree(void *msg);
extern CsrUint8* CsrWifiRouterCtrlWapiRxPktReqSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiRouterCtrlWapiRxPktReqDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiRouterCtrlWapiRxPktReqSizeof(void *msg);
extern void CsrWifiRouterCtrlWapiRxPktReqSerFree(void *msg);
#define CsrWifiRouterCtrlWapiMulticastFilterReqSer CsrWifiEventCsrUint8Ser
#define CsrWifiRouterCtrlWapiMulticastFilterReqDes CsrWifiEventCsrUint8Des
#define CsrWifiRouterCtrlWapiMulticastFilterReqSizeof CsrWifiEventCsrUint8Sizeof
#define CsrWifiRouterCtrlWapiMulticastFilterReqSer CsrWifiEventCsrUint16CsrUint8Ser
#define CsrWifiRouterCtrlWapiMulticastFilterReqDes CsrWifiEventCsrUint16CsrUint8Des
#define CsrWifiRouterCtrlWapiMulticastFilterReqSizeof CsrWifiEventCsrUint16CsrUint8Sizeof
#define CsrWifiRouterCtrlWapiMulticastFilterReqSerFree CsrWifiRouterCtrlPfree
#define CsrWifiRouterCtrlWapiUnicastFilterReqSer CsrWifiEventCsrUint8Ser
#define CsrWifiRouterCtrlWapiUnicastFilterReqDes CsrWifiEventCsrUint8Des
#define CsrWifiRouterCtrlWapiUnicastFilterReqSizeof CsrWifiEventCsrUint8Sizeof
#define CsrWifiRouterCtrlWapiUnicastFilterReqSer CsrWifiEventCsrUint16CsrUint8Ser
#define CsrWifiRouterCtrlWapiUnicastFilterReqDes CsrWifiEventCsrUint16CsrUint8Des
#define CsrWifiRouterCtrlWapiUnicastFilterReqSizeof CsrWifiEventCsrUint16CsrUint8Sizeof
#define CsrWifiRouterCtrlWapiUnicastFilterReqSerFree CsrWifiRouterCtrlPfree
extern CsrUint8* CsrWifiRouterCtrlWapiUnicastTxPktReqSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiRouterCtrlWapiUnicastTxPktReqDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiRouterCtrlWapiUnicastTxPktReqSizeof(void *msg);
extern void CsrWifiRouterCtrlWapiUnicastTxPktReqSerFree(void *msg);
#define CsrWifiRouterCtrlWapiFilterReqSer CsrWifiEventCsrUint16CsrUint8Ser
#define CsrWifiRouterCtrlWapiFilterReqDes CsrWifiEventCsrUint16CsrUint8Des
#define CsrWifiRouterCtrlWapiFilterReqSizeof CsrWifiEventCsrUint16CsrUint8Sizeof
#define CsrWifiRouterCtrlWapiFilterReqSerFree CsrWifiRouterCtrlPfree
extern CsrUint8* CsrWifiRouterCtrlHipIndSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiRouterCtrlHipIndDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiRouterCtrlHipIndSizeof(void *msg);
......@@ -310,10 +320,20 @@ extern void* CsrWifiRouterCtrlStaInactiveIndDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiRouterCtrlStaInactiveIndSizeof(void *msg);
#define CsrWifiRouterCtrlStaInactiveIndSerFree CsrWifiRouterCtrlPfree
extern CsrUint8* CsrWifiRouterCtrlWapiMulticastIndSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiRouterCtrlWapiMulticastIndDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiRouterCtrlWapiMulticastIndSizeof(void *msg);
extern void CsrWifiRouterCtrlWapiMulticastIndSerFree(void *msg);
extern CsrUint8* CsrWifiRouterCtrlWapiRxMicCheckIndSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiRouterCtrlWapiRxMicCheckIndDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiRouterCtrlWapiRxMicCheckIndSizeof(void *msg);
extern void CsrWifiRouterCtrlWapiRxMicCheckIndSerFree(void *msg);
extern CsrUint8* CsrWifiRouterCtrlModeSetCfmSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiRouterCtrlModeSetCfmDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiRouterCtrlModeSetCfmSizeof(void *msg);
#define CsrWifiRouterCtrlModeSetCfmSerFree CsrWifiRouterCtrlPfree
extern CsrUint8* CsrWifiRouterCtrlWapiUnicastTxEncryptIndSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiRouterCtrlWapiUnicastTxEncryptIndDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiRouterCtrlWapiUnicastTxEncryptIndSizeof(void *msg);
extern void CsrWifiRouterCtrlWapiUnicastTxEncryptIndSerFree(void *msg);
#ifdef __cplusplus
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -63,6 +63,7 @@ void CsrWifiSmeApFreeDownstreamMessageContents(CsrUint16 eventClass, void *messa
const CsrCharString* CsrWifiSmeApAccessTypeToString(CsrWifiSmeApAccessType value);
const CsrCharString* CsrWifiSmeApAuthSupportToString(CsrWifiSmeApAuthSupport value);
const CsrCharString* CsrWifiSmeApAuthTypeToString(CsrWifiSmeApAuthType value);
const CsrCharString* CsrWifiSmeApDirectionToString(CsrWifiSmeApDirection value);
const CsrCharString* CsrWifiSmeApPhySupportToString(CsrWifiSmeApPhySupport value);
const CsrCharString* CsrWifiSmeApTypeToString(CsrWifiSmeApType value);
......@@ -79,6 +80,134 @@ const CsrCharString* CsrWifiSmeApPrimTypeToString(CsrPrim msgType);
extern const CsrCharString *CsrWifiSmeApUpstreamPrimNames[CSR_WIFI_SME_AP_PRIM_UPSTREAM_COUNT];
extern const CsrCharString *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__ = (CsrWifiSmeApActiveBaGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeApActiveBaGetReq)); \
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__ = (CsrWifiSmeApActiveBaGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeApActiveBaGetCfm)); \
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__ = (CsrWifiSmeApBaDeleteReq *) CsrPmemAlloc(sizeof(CsrWifiSmeApBaDeleteReq)); \
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__ = (CsrWifiSmeApBaDeleteCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeApBaDeleteCfm)); \
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
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -95,6 +95,23 @@ typedef CsrUint8 CsrWifiSmeApAuthType;
#define CSR_WIFI_SME_AP_AUTH_TYPE_PERSONAL ((CsrWifiSmeApAuthType) 0x01)
#define CSR_WIFI_SME_AP_AUTH_TYPE_WEP ((CsrWifiSmeApAuthType) 0x02)
/*******************************************************************************
NAME
CsrWifiSmeApDirection
DESCRIPTION
Definition of Direction
VALUES
CSR_WIFI_AP_DIRECTION_RECEIPIENT - Receipient
CSR_WIFI_AP_DIRECTION_ORIGINATOR - Originator
*******************************************************************************/
typedef CsrUint8 CsrWifiSmeApDirection;
#define CSR_WIFI_AP_DIRECTION_RECEIPIENT ((CsrWifiSmeApDirection) 0x00)
#define CSR_WIFI_AP_DIRECTION_ORIGINATOR ((CsrWifiSmeApDirection) 0x01)
/*******************************************************************************
NAME
......@@ -302,6 +319,28 @@ typedef struct
CsrWifiSmeApWapiCapabilitiesMask wapiCapabilities;
} CsrWifiSmeApAuthPers;
/*******************************************************************************
NAME
CsrWifiSmeApBaSession
DESCRIPTION
MEMBERS
peerMacAddress - Indicates MAC address of the peer station
tid - Specifies the TID of the MSDUs for which this Block Ack has
been set up. Range: 0-15
direction - Specifies if the AP is the originator or the recipient of
the data stream that uses the Block Ack.
*******************************************************************************/
typedef struct
{
CsrWifiMacAddress peerMacAddress;
CsrUint8 tid;
CsrWifiSmeApDirection direction;
} CsrWifiSmeApBaSession;
/*******************************************************************************
NAME
......@@ -456,9 +495,11 @@ typedef struct
#define CSR_WIFI_SME_AP_WMM_PARAM_UPDATE_REQ ((CsrWifiSmeApPrim) (0x0004 + CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_SME_AP_STA_DISCONNECT_REQ ((CsrWifiSmeApPrim) (0x0005 + CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_SME_AP_WPS_CONFIGURATION_REQ ((CsrWifiSmeApPrim) (0x0006 + CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_SME_AP_ACTIVE_BA_GET_REQ ((CsrWifiSmeApPrim) (0x0007 + CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_SME_AP_BA_DELETE_REQ ((CsrWifiSmeApPrim) (0x0008 + CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_HIGHEST (0x0006 + CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_LOWEST)
#define CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_HIGHEST (0x0008 + CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_LOWEST)
/* Upstream */
#define CSR_WIFI_SME_AP_PRIM_UPSTREAM_LOWEST (0x0000 + CSR_PRIM_UPSTREAM)
......@@ -473,8 +514,10 @@ typedef struct
#define CSR_WIFI_SME_AP_STA_DISCONNECT_CFM ((CsrWifiSmeApPrim)(0x0007 + CSR_WIFI_SME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_SME_AP_WPS_CONFIGURATION_CFM ((CsrWifiSmeApPrim)(0x0008 + CSR_WIFI_SME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_SME_AP_ERROR_IND ((CsrWifiSmeApPrim)(0x0009 + CSR_WIFI_SME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_SME_AP_ACTIVE_BA_GET_CFM ((CsrWifiSmeApPrim)(0x000A + CSR_WIFI_SME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_SME_AP_BA_DELETE_CFM ((CsrWifiSmeApPrim)(0x000B + CSR_WIFI_SME_AP_PRIM_UPSTREAM_LOWEST))
#define CSR_WIFI_SME_AP_PRIM_UPSTREAM_HIGHEST (0x0009 + CSR_WIFI_SME_AP_PRIM_UPSTREAM_LOWEST)
#define CSR_WIFI_SME_AP_PRIM_UPSTREAM_HIGHEST (0x000B + CSR_WIFI_SME_AP_PRIM_UPSTREAM_LOWEST)
#define CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_COUNT (CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_HIGHEST + 1 - CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_LOWEST)
#define CSR_WIFI_SME_AP_PRIM_UPSTREAM_COUNT (CSR_WIFI_SME_AP_PRIM_UPSTREAM_HIGHEST + 1 - CSR_WIFI_SME_AP_PRIM_UPSTREAM_LOWEST)
......@@ -655,6 +698,49 @@ typedef struct
CsrWifiSmeWpsConfig wpsConfig;
} CsrWifiSmeApWpsConfigurationReq;
/*******************************************************************************
NAME
CsrWifiSmeApActiveBaGetReq
DESCRIPTION
This primitive used to retrieve information related to the active block
ack sessions
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag -
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrUint16 interfaceTag;
} CsrWifiSmeApActiveBaGetReq;
/*******************************************************************************
NAME
CsrWifiSmeApBaDeleteReq
DESCRIPTION
This primitive is used to delete an active block ack session
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag -
reason -
baSession - BA session to be deleted
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrUint16 interfaceTag;
CsrWifiSmeIEEE80211Reason reason;
CsrWifiSmeApBaSession baSession;
} CsrWifiSmeApBaDeleteReq;
/*******************************************************************************
NAME
......@@ -895,6 +981,55 @@ typedef struct
CsrResult status;
} CsrWifiSmeApErrorInd;
/*******************************************************************************
NAME
CsrWifiSmeApActiveBaGetCfm
DESCRIPTION
This primitive carries the information related to the active ba sessions
MEMBERS
common - Common header for use with the CsrWifiFsm Module
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.
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrUint16 interfaceTag;
CsrResult status;
CsrUint16 activeBaCount;
CsrWifiSmeApBaSession *activeBaSessions;
} CsrWifiSmeApActiveBaGetCfm;
/*******************************************************************************
NAME
CsrWifiSmeApBaDeleteCfm
DESCRIPTION
This primitive confirms the BA is deleted
MEMBERS
common - Common header for use with the CsrWifiFsm Module
interfaceTag -
status - Reports the result of the request
baSession - deleted BA session
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrUint16 interfaceTag;
CsrResult status;
CsrWifiSmeApBaSession baSession;
} CsrWifiSmeApBaDeleteCfm;
#ifdef __cplusplus
}
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -79,6 +79,7 @@ static CsrMsgConvMsgEntry csrwifisme_conv_lut[] = {
{ 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 },
......@@ -159,11 +160,11 @@ CsrMsgConvMsgEntry* CsrWifiSmeConverterLookup(CsrMsgConvMsgEntry *ce, CsrUint16
{
if (msgType & CSR_PRIM_UPSTREAM)
{
CsrUint16 index = (msgType & ~CSR_PRIM_UPSTREAM) + CSR_WIFI_SME_PRIM_DOWNSTREAM_COUNT;
if (index < (CSR_WIFI_SME_PRIM_UPSTREAM_COUNT + CSR_WIFI_SME_PRIM_DOWNSTREAM_COUNT) &&
csrwifisme_conv_lut[index].msgType == msgType)
CsrUint16 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[index];
return &csrwifisme_conv_lut[idx];
}
}
else
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -172,6 +172,13 @@ void CsrWifiSmeFreeDownstreamMessageContents(CsrUint16 eventClass, void *message
p->wpsConfig.secondaryDeviceType = NULL;
break;
}
case CSR_WIFI_SME_SET_REQ:
{
CsrWifiSmeSetReq *p = (CsrWifiSmeSetReq *)message;
CsrPmemFree(p->data);
p->data = NULL;
break;
}
default:
break;
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -3442,6 +3442,39 @@ extern const CsrCharString *CsrWifiSmeDownstreamPrimNames[CSR_WIFI_SME_PRIM_DOWN
#define CsrWifiSmeScanResultsGetCfmSend(dst__, status__, scanResultsCount__, scanResults__) \
CsrWifiSmeScanResultsGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, scanResultsCount__, scanResults__)
/*******************************************************************************
NAME
CsrWifiSmeSetReqSend
DESCRIPTION
Used to pass custom data to the SME. Format is the same as 802.11 Info
Elements => | Id | Length | Data
1) Cmanr Test Mode "Id:0 Length:1 Data:0x00 = OFF 0x01 = ON" "0x00 0x01
(0x00|0x01)"
PARAMETERS
queue - Message Source Task Queue (Cfm's will be sent to this Queue)
dataLength - Number of bytes in the buffer pointed to by 'data'
data - Pointer to the buffer containing 'dataLength' bytes
*******************************************************************************/
#define CsrWifiSmeSetReqCreate(msg__, dst__, src__, dataLength__, data__) \
msg__ = (CsrWifiSmeSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeSetReq)); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SET_REQ, dst__, src__); \
msg__->dataLength = (dataLength__); \
msg__->data = (data__);
#define CsrWifiSmeSetReqSendTo(dst__, src__, dataLength__, data__) \
{ \
CsrWifiSmeSetReq *msg__; \
CsrWifiSmeSetReqCreate(msg__, dst__, src__, dataLength__, data__); \
CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
}
#define CsrWifiSmeSetReqSend(src__, dataLength__, data__) \
CsrWifiSmeSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, dataLength__, data__)
/*******************************************************************************
NAME
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -1434,7 +1434,7 @@ typedef CsrUint8 CsrWifiSmeWepCredentialType;
CsrWifiSmeWmmMode
DESCRIPTION
Defines bits for wmmModeMask: enable/disable WMM features.
Defines bits for CsrWifiSmeWmmModeMask: enable/disable WMM features.
VALUES
CSR_WIFI_SME_WMM_MODE_DISABLED - Disables the WMM features.
......@@ -2410,40 +2410,6 @@ typedef struct
CsrUint16 maxPassiveChannelTimeTu;
} CsrWifiSmeScanConfigData;
/*******************************************************************************
NAME
CsrWifiSmeStaConfig
DESCRIPTION
Station configuration options in the SME
MEMBERS
connectionQualityRssiChangeTrigger - Sets the difference of RSSI
measurements which triggers reports
from the Firmware
connectionQualitySnrChangeTrigger - Sets the difference of SNR measurements
which triggers reports from the
Firmware
wmmModeMask - Mask containing one or more values from
CsrWifiSmeWmmMode
ifIndex - Indicates the band of frequencies used
allowUnicastUseGroupCipher - If TRUE, it allows to use groupwise
keys if no pairwise key is specified
enableOpportunisticKeyCaching - If TRUE, enables the Opportunistic Key
Caching feature
*******************************************************************************/
typedef struct
{
CsrUint8 connectionQualityRssiChangeTrigger;
CsrUint8 connectionQualitySnrChangeTrigger;
CsrUint8 wmmModeMask;
CsrWifiSmeRadioIF ifIndex;
CsrBool allowUnicastUseGroupCipher;
CsrBool enableOpportunisticKeyCaching;
} CsrWifiSmeStaConfig;
/*******************************************************************************
NAME
......@@ -3197,6 +3163,40 @@ typedef struct
} deviceInfo;
} CsrWifiSmeScanResult;
/*******************************************************************************
NAME
CsrWifiSmeStaConfig
DESCRIPTION
Station configuration options in the SME
MEMBERS
connectionQualityRssiChangeTrigger - Sets the difference of RSSI
measurements which triggers reports
from the Firmware
connectionQualitySnrChangeTrigger - Sets the difference of SNR measurements
which triggers reports from the
Firmware
wmmModeMask - Mask containing one or more values from
CsrWifiSmeWmmMode
ifIndex - Indicates the band of frequencies used
allowUnicastUseGroupCipher - If TRUE, it allows to use groupwise
keys if no pairwise key is specified
enableOpportunisticKeyCaching - If TRUE, enables the Opportunistic Key
Caching feature
*******************************************************************************/
typedef struct
{
CsrUint8 connectionQualityRssiChangeTrigger;
CsrUint8 connectionQualitySnrChangeTrigger;
CsrWifiSmeWmmModeMask wmmModeMask;
CsrWifiSmeRadioIF ifIndex;
CsrBool allowUnicastUseGroupCipher;
CsrBool enableOpportunisticKeyCaching;
} CsrWifiSmeStaConfig;
/*******************************************************************************
NAME
......@@ -3393,9 +3393,10 @@ typedef struct
#define CSR_WIFI_SME_SME_COMMON_CONFIG_SET_REQ ((CsrWifiSmePrim) (0x0034 + CSR_WIFI_SME_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_SME_INTERFACE_CAPABILITY_GET_REQ ((CsrWifiSmePrim) (0x0035 + CSR_WIFI_SME_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_SME_WPS_CONFIGURATION_REQ ((CsrWifiSmePrim) (0x0036 + CSR_WIFI_SME_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_SME_SET_REQ ((CsrWifiSmePrim) (0x0037 + CSR_WIFI_SME_PRIM_DOWNSTREAM_LOWEST))
#define CSR_WIFI_SME_PRIM_DOWNSTREAM_HIGHEST (0x0036 + CSR_WIFI_SME_PRIM_DOWNSTREAM_LOWEST)
#define CSR_WIFI_SME_PRIM_DOWNSTREAM_HIGHEST (0x0037 + CSR_WIFI_SME_PRIM_DOWNSTREAM_LOWEST)
/* Upstream */
#define CSR_WIFI_SME_PRIM_UPSTREAM_LOWEST (0x0000 + CSR_PRIM_UPSTREAM)
......@@ -4809,6 +4810,30 @@ typedef struct
CsrWifiSmeWpsConfig wpsConfig;
} CsrWifiSmeWpsConfigurationReq;
/*******************************************************************************
NAME
CsrWifiSmeSetReq
DESCRIPTION
Used to pass custom data to the SME. Format is the same as 802.11 Info
Elements => | Id | Length | Data
1) Cmanr Test Mode "Id:0 Length:1 Data:0x00 = OFF 0x01 = ON" "0x00 0x01
(0x00|0x01)"
MEMBERS
common - Common header for use with the CsrWifiFsm Module
dataLength - Number of bytes in the buffer pointed to by 'data'
data - Pointer to the buffer containing 'dataLength' bytes
*******************************************************************************/
typedef struct
{
CsrWifiFsmEvent common;
CsrUint32 dataLength;
CsrUint8 *data;
} CsrWifiSmeSetReq;
/*******************************************************************************
NAME
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -1356,7 +1356,7 @@ CsrSize CsrWifiSmeSmeStaConfigSetReqSizeof(void *msg)
bufferSize += 2; /* CsrUint16 primitive->interfaceTag */
bufferSize += 1; /* CsrUint8 primitive->smeConfig.connectionQualityRssiChangeTrigger */
bufferSize += 1; /* CsrUint8 primitive->smeConfig.connectionQualitySnrChangeTrigger */
bufferSize += 1; /* CsrUint8 primitive->smeConfig.wmmModeMask */
bufferSize += 1; /* CsrWifiSmeWmmModeMask primitive->smeConfig.wmmModeMask */
bufferSize += 1; /* CsrWifiSmeRadioIF primitive->smeConfig.ifIndex */
bufferSize += 1; /* CsrBool primitive->smeConfig.allowUnicastUseGroupCipher */
bufferSize += 1; /* CsrBool primitive->smeConfig.enableOpportunisticKeyCaching */
......@@ -1898,6 +1898,62 @@ void CsrWifiSmeWpsConfigurationReqSerFree(void *voidPrimitivePointer)
}
CsrSize CsrWifiSmeSetReqSizeof(void *msg)
{
CsrWifiSmeSetReq *primitive = (CsrWifiSmeSetReq *) msg;
CsrSize bufferSize = 2;
/* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
bufferSize += 4; /* CsrUint32 primitive->dataLength */
bufferSize += primitive->dataLength; /* CsrUint8 primitive->data */
return bufferSize;
}
CsrUint8* CsrWifiSmeSetReqSer(CsrUint8 *ptr, CsrSize *len, void *msg)
{
CsrWifiSmeSetReq *primitive = (CsrWifiSmeSetReq *)msg;
*len = 0;
CsrUint16Ser(ptr, len, primitive->common.type);
CsrUint32Ser(ptr, len, (CsrUint32) primitive->dataLength);
if (primitive->dataLength)
{
CsrMemCpySer(ptr, len, (const void *) primitive->data, ((CsrUint16) (primitive->dataLength)));
}
return(ptr);
}
void* CsrWifiSmeSetReqDes(CsrUint8 *buffer, CsrSize length)
{
CsrWifiSmeSetReq *primitive = (CsrWifiSmeSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeSetReq));
CsrSize offset;
offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
CsrUint32Des((CsrUint32 *) &primitive->dataLength, buffer, &offset);
if (primitive->dataLength)
{
primitive->data = (CsrUint8 *)CsrPmemAlloc(primitive->dataLength);
CsrMemCpyDes(primitive->data, buffer, &offset, ((CsrUint16) (primitive->dataLength)));
}
else
{
primitive->data = NULL;
}
return primitive;
}
void CsrWifiSmeSetReqSerFree(void *voidPrimitivePointer)
{
CsrWifiSmeSetReq *primitive = (CsrWifiSmeSetReq *) voidPrimitivePointer;
CsrPmemFree(primitive->data);
CsrPmemFree(primitive);
}
CsrSize CsrWifiSmeAdhocConfigGetCfmSizeof(void *msg)
{
CsrSize bufferSize = 2;
......@@ -5085,7 +5141,7 @@ CsrSize CsrWifiSmeSmeStaConfigGetCfmSizeof(void *msg)
bufferSize += 2; /* CsrResult primitive->status */
bufferSize += 1; /* CsrUint8 primitive->smeConfig.connectionQualityRssiChangeTrigger */
bufferSize += 1; /* CsrUint8 primitive->smeConfig.connectionQualitySnrChangeTrigger */
bufferSize += 1; /* CsrUint8 primitive->smeConfig.wmmModeMask */
bufferSize += 1; /* CsrWifiSmeWmmModeMask primitive->smeConfig.wmmModeMask */
bufferSize += 1; /* CsrWifiSmeRadioIF primitive->smeConfig.ifIndex */
bufferSize += 1; /* CsrBool primitive->smeConfig.allowUnicastUseGroupCipher */
bufferSize += 1; /* CsrBool primitive->smeConfig.enableOpportunisticKeyCaching */
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2011
(c) Cambridge Silicon Radio Limited 2012
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
......@@ -300,6 +300,11 @@ extern void* CsrWifiSmeWpsConfigurationReqDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiSmeWpsConfigurationReqSizeof(void *msg);
extern void CsrWifiSmeWpsConfigurationReqSerFree(void *msg);
extern CsrUint8* CsrWifiSmeSetReqSer(CsrUint8 *ptr, CsrSize *len, void *msg);
extern void* CsrWifiSmeSetReqDes(CsrUint8 *buffer, CsrSize len);
extern CsrSize CsrWifiSmeSetReqSizeof(void *msg);
extern void CsrWifiSmeSetReqSerFree(void *msg);
#define CsrWifiSmeActivateCfmSer CsrWifiEventCsrUint16Ser
#define CsrWifiSmeActivateCfmDes CsrWifiEventCsrUint16Des
#define CsrWifiSmeActivateCfmSizeof CsrWifiEventCsrUint16Sizeof
......
......@@ -47,12 +47,7 @@
int buswidth = 0; /* 0 means use default, values 1,4 */
int sdio_clock = 50000; /* kHz */
int unifi_debug = 0;
/*
* fw_init prevents f/w initialisation on error.
* Unless necessary, avoid usage in the CSR_SME_EMB build because it prevents
* UniFi initialisation after getting out of suspend and also leaves
* UniFi powered when the module unloads.
*/
/* fw_init prevents f/w initialisation on error. */
int fw_init[MAX_UNIFI_DEVS] = {-1, -1};
int use_5g = 0;
int led_mask = 0; /* 0x0c00 for dev-pc-1503c, dev-pc-1528a */
......@@ -67,6 +62,12 @@ int sdio_byte_mode = 0; /* 0 for block mode + padding, 1 for byte mode */
int coredump_max = CSR_WIFI_HIP_NUM_COREDUMP_BUFFERS;
int run_bh_once = -1; /* Set for scheduled interrupt mode, -1 = default */
int bh_priority = -1;
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
#define UNIFI_LOG_HIP_SIGNALS_FILTER_SIGNAL (1 << 0)
#define UNIFI_LOG_HIP_SIGNALS_FILTER_BULKDATA (1 << 1)
#define UNIFI_LOG_HIP_SIGNALS_FILTER_TIMESTAMP (1 << 2)
int log_hip_signals = 0;
#endif
MODULE_DESCRIPTION("CSR UniFi (SDIO)");
......@@ -87,6 +88,9 @@ module_param(sdio_byte_mode, int, S_IRUGO|S_IWUSR);
module_param(coredump_max, int, S_IRUGO|S_IWUSR);
module_param(run_bh_once, int, S_IRUGO|S_IWUSR);
module_param(bh_priority, int, S_IRUGO|S_IWUSR);
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
module_param(log_hip_signals, int, S_IRUGO|S_IWUSR);
#endif
MODULE_PARM_DESC(buswidth, "SDIO bus width (0=default), set 1 for 1-bit or 4 for 4-bit mode");
MODULE_PARM_DESC(sdio_clock, "SDIO bus frequency in kHz, (default = 50 MHz)");
......@@ -105,6 +109,10 @@ MODULE_PARM_DESC(sdio_byte_mode, "Set to 1 for byte mode SDIO");
MODULE_PARM_DESC(coredump_max, "Number of chip mini-coredump buffers to allocate");
MODULE_PARM_DESC(run_bh_once, "Run BH only when firmware interrupts");
MODULE_PARM_DESC(bh_priority, "Modify the BH thread priority");
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
MODULE_PARM_DESC(log_hip_signals, "Set to 1 to enable HIP signal offline logging");
#endif
/* Callback for event logging to UDI clients */
static void udi_log_event(ul_client_t *client,
......@@ -193,6 +201,54 @@ trace_putest_cmdid(unifi_putest_command_t putest_cmd)
}
}
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
int uf_register_hip_offline_debug(unifi_priv_t *priv)
{
ul_client_t *udi_cli;
int i;
udi_cli = ul_register_client(priv, CLI_USING_WIRE_FORMAT, udi_log_event);
if (udi_cli == NULL) {
/* Too many clients already using this device */
unifi_error(priv, "Too many UDI clients already open\n");
return -ENOSPC;
}
unifi_trace(priv, UDBG1, "Offline HIP client is registered\n");
down(&priv->udi_logging_mutex);
udi_cli->event_hook = udi_log_event;
unifi_set_udi_hook(priv->card, logging_handler);
/* Log all signals by default */
for (i = 0; i < SIG_FILTER_SIZE; i++) {
udi_cli->signal_filter[i] = 0xFFFF;
}
priv->logging_client = udi_cli;
up(&priv->udi_logging_mutex);
return 0;
}
int uf_unregister_hip_offline_debug(unifi_priv_t *priv)
{
ul_client_t *udi_cli = priv->logging_client;
if (udi_cli == NULL)
{
unifi_error(priv, "Unknown HIP client unregister request\n");
return -ERANGE;
}
unifi_trace(priv, UDBG1, "Offline HIP client is unregistered\n");
down(&priv->udi_logging_mutex);
priv->logging_client = NULL;
udi_cli->event_hook = NULL;
up(&priv->udi_logging_mutex);
ul_deregister_client(udi_cli);
return 0;
}
#endif
/*
......@@ -312,7 +368,6 @@ unifi_open(struct inode *inode, struct file *file)
} /* unifi_open() */
static int
unifi_release(struct inode *inode, struct file *filp)
{
......@@ -354,6 +409,15 @@ unifi_release(struct inode *inode, struct file *filp)
}
uf_sme_deinit(priv);
/* It is possible that a blocking SME request was made from another process
* which did not get read by the SME before the WifiOffReq.
* So check for a pending request which will go unanswered and cancel
* the wait for event. As only one blocking request can be in progress at
* a time, up to one event should be completed.
*/
uf_sme_cancel_request(priv, 0);
#endif /* CSR_SME_USERSPACE */
} else {
......@@ -979,6 +1043,14 @@ unifi_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
goto out;
}
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
if (log_hip_signals) {
unifi_error(priv, "omnicli cannot be used when log_hip_signals is used\n");
r = -EFAULT;
goto out;
}
#endif
down(&priv->udi_logging_mutex);
if (int_param) {
pcli->event_hook = udi_log_event;
......@@ -1264,6 +1336,11 @@ unifi_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
unifi_info(priv, "UniFi ready\n");
#ifdef ANDROID_BUILD
/* Release the wakelock */
unifi_trace(priv, UDBG1, "netdev_init: release wake lock\n");
wake_unlock(&unifi_sdio_wake_lock);
#endif
#ifdef CSR_NATIVE_SOFTMAC /* For softmac dev, force-enable the network interface rather than wait for a connected-ind */
{
struct net_device *dev = priv->netdev[interfaceTag];
......@@ -1720,6 +1797,40 @@ udi_log_event(ul_client_t *pcli,
return;
}
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
/* When HIP offline signal logging is enabled, omnicli cannot run */
if (log_hip_signals)
{
/* Add timestamp */
if (log_hip_signals & UNIFI_LOG_HIP_SIGNALS_FILTER_TIMESTAMP)
{
int timestamp = jiffies_to_msecs(jiffies);
unifi_debug_log_to_buf("T:");
unifi_debug_log_to_buf("%04X%04X ", *(((CsrUint16*)&timestamp) + 1),
*(CsrUint16*)&timestamp);
}
/* Add signal */
unifi_debug_log_to_buf("S%s:%04X R:%04X D:%04X ",
dir ? "T" : "F",
*(CsrUint16*)signal,
*(CsrUint16*)(signal + 2),
*(CsrUint16*)(signal + 4));
unifi_debug_hex_to_buf(signal + 6, signal_len - 6);
/* Add bulk data (assume 1 bulk data per signal) */
if ((log_hip_signals & UNIFI_LOG_HIP_SIGNALS_FILTER_BULKDATA) &&
(bulkdata->d[0].data_length > 0))
{
unifi_debug_log_to_buf("\nD:");
unifi_debug_hex_to_buf(bulkdata->d[0].os_data_ptr, bulkdata->d[0].data_length);
}
unifi_debug_log_to_buf("\n");
return;
}
#endif
#ifdef CSR_NATIVE_LINUX
uf_native_process_udi_signal(pcli, signal, signal_len, bulkdata, dir);
#endif
......@@ -1950,7 +2061,7 @@ int uf_create_device_nodes(unifi_priv_t *priv, int bus_id)
priv->unifiudi_cdev.owner = THIS_MODULE;
devno = MKDEV(MAJOR(unifi_first_devno),
MINOR(unifi_first_devno) + (bus_id * MAX_UNIFI_DEVS) + 1);
MINOR(unifi_first_devno) + (bus_id * 2) + 1);
r = cdev_add(&priv->unifiudi_cdev, devno, 1);
if (r) {
device_destroy(unifi_class, priv->unifi_cdev.dev);
......@@ -2081,7 +2192,9 @@ unifi_load(void)
#endif
printk("CSR native no WEXT support\n");
#endif
#ifdef CSR_WIFI_SPLIT_PATCH
printk("Split patch support\n");
#endif
printk("Kernel %d.%d.%d\n",
((LINUX_VERSION_CODE) >> 16) & 0xff,
((LINUX_VERSION_CODE) >> 8) & 0xff,
......
......@@ -296,7 +296,18 @@ uf_run_unifihelper(unifi_priv_t *priv)
#endif
} /* uf_run_unifihelper() */
#ifdef CSR_WIFI_SPLIT_PATCH
static CsrBool is_ap_mode(unifi_priv_t *priv)
{
if (priv == NULL || priv->interfacePriv[0] == NULL)
{
return FALSE;
}
/* Test for mode requiring AP patch */
return(CSR_WIFI_HIP_IS_AP_FW(priv->interfacePriv[0]->interfaceMode));
}
#endif
/*
* ---------------------------------------------------------------------------
......@@ -334,8 +345,13 @@ int uf_request_firmware_files(unifi_priv_t *priv, int is_fw)
if (is_fw == UNIFI_FW_STA) {
/* Free kernel buffer and reload */
uf_release_firmware(priv, &priv->fw_sta);
#ifdef CSR_WIFI_SPLIT_PATCH
scnprintf(fw_name, UNIFI_MAX_FW_PATH_LEN, "unifi-sdio-%d/%s",
postfix, "sta.xbv");
postfix, (is_ap_mode(priv) ? "ap.xbv" : "staonly.xbv") );
#else
scnprintf(fw_name, UNIFI_MAX_FW_PATH_LEN, "unifi-sdio-%d/%s",
postfix, "sta.xbv" );
#endif
r = request_firmware(&fw_entry, fw_name, priv->unifi_device);
if (r == 0) {
priv->fw_sta.dl_data = fw_entry->data;
......
......@@ -407,6 +407,13 @@ register_unifi_sdio(CsrSdioFunction *sdio_dev, int bus_id, struct device *dev)
INIT_WORK(&priv->rx_work_struct, rx_wq_handler);
#endif
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
if (log_hip_signals)
{
uf_register_hip_offline_debug(priv);
}
#endif
/* Initialise the SME related threads and parameters */
r = uf_sme_init(priv);
if (r) {
......@@ -431,6 +438,12 @@ register_unifi_sdio(CsrSdioFunction *sdio_dev, int bus_id, struct device *dev)
return priv;
failed4:
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
if (log_hip_signals)
{
uf_unregister_hip_offline_debug(priv);
}
#endif
#ifdef CSR_WIFI_RX_PATH_SPLIT
flush_workqueue(priv->rx_workqueue);
destroy_workqueue(priv->rx_workqueue);
......@@ -547,6 +560,13 @@ cleanup_unifi_sdio(unifi_priv_t *priv)
priv->smepriv = NULL;
#endif
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
if (log_hip_signals)
{
uf_unregister_hip_offline_debug(priv);
}
#endif
/* Free any packets left in the Rx queues */
for(i=0;i<CSR_WIFI_NUM_INTERFACES;i++)
{
......
This diff is collapsed.
......@@ -204,12 +204,10 @@ extern int unifi_debug;
(_s)[DEBUG_BUFFER_SIZE - 1] = 0; \
} \
} while (0)
#endif /* UNIFI_DEBUG */
void
unifi_error(void* ospriv, const char *fmt, ...)
{
#ifdef UNIFI_DEBUG
unifi_priv_t *priv = (unifi_priv_t*) ospriv;
char s[DEBUG_BUFFER_SIZE];
va_list args;
......@@ -230,13 +228,11 @@ unifi_error(void* ospriv, const char *fmt, ...)
FORMAT_TRACE(s, len, args, fmt);
printk("%s", s);
#endif /* UNIFI_DEBUG */
}
void
unifi_warning(void* ospriv, const char *fmt, ...)
{
#ifdef UNIFI_DEBUG
unifi_priv_t *priv = (unifi_priv_t*) ospriv;
char s[DEBUG_BUFFER_SIZE];
va_list args;
......@@ -259,14 +255,12 @@ unifi_warning(void* ospriv, const char *fmt, ...)
FORMAT_TRACE(s, len, args, fmt);
printk("%s", s);
#endif /* UNIFI_DEBUG */
}
void
unifi_notice(void* ospriv, const char *fmt, ...)
{
#ifdef UNIFI_DEBUG
unifi_priv_t *priv = (unifi_priv_t*) ospriv;
char s[DEBUG_BUFFER_SIZE];
va_list args;
......@@ -289,14 +283,12 @@ unifi_notice(void* ospriv, const char *fmt, ...)
FORMAT_TRACE(s, len, args, fmt);
printk("%s", s);
#endif /* UNIFI_DEBUG */
}
void
unifi_info(void* ospriv, const char *fmt, ...)
{
#ifdef UNIFI_DEBUG
unifi_priv_t *priv = (unifi_priv_t*) ospriv;
char s[DEBUG_BUFFER_SIZE];
va_list args;
......@@ -319,14 +311,12 @@ unifi_info(void* ospriv, const char *fmt, ...)
FORMAT_TRACE(s, len, args, fmt);
printk("%s", s);
#endif /* UNIFI_DEBUG */
}
/* debugging */
void
unifi_trace(void* ospriv, int level, const char *fmt, ...)
{
#ifdef UNIFI_DEBUG
unifi_priv_t *priv = (unifi_priv_t*) ospriv;
char s[DEBUG_BUFFER_SIZE];
va_list args;
......@@ -351,9 +341,23 @@ unifi_trace(void* ospriv, int level, const char *fmt, ...)
printk("%s", s);
}
#endif /* UNIFI_DEBUG */
}
#else
void
unifi_error_nop(void* ospriv, const char *fmt, ...)
{
}
void
unifi_trace_nop(void* ospriv, int level, const char *fmt, ...)
{
}
#endif /* UNIFI_DEBUG */
/*
* ---------------------------------------------------------------------------
*
......
......@@ -180,8 +180,9 @@ int unifi_putest_gp_read16(unifi_priv_t *priv, unsigned char *arg)
"unifi_putest_gp_read16: Failed to get the params\n");
return -EFAULT;
}
CsrSdioClaim(priv->sdio);
csrResult = unifi_card_read16(priv->card, gp_r16_params.addr, &gp_r16_params.data);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv,
"unifi_putest_gp_read16: unifi_card_read16() GP=0x%x failed (csrResult=0x%x)\n", gp_r16_params.addr, csrResult);
......@@ -240,8 +241,9 @@ int unifi_putest_gp_write16(unifi_priv_t *priv, unsigned char *arg)
}
unifi_trace(priv, UDBG2, "gp_w16: GP=0x%08x, data=0x%04x\n", gp_w16_params.addr, gp_w16_params.data);
CsrSdioClaim(priv->sdio);
csrResult = unifi_card_write16(priv->card, gp_w16_params.addr, gp_w16_params.data);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv,
"unifi_putest_gp_write16: unifi_card_write16() GP=%x failed (csrResult=0x%x)\n", gp_w16_params.addr, csrResult);
......@@ -265,7 +267,7 @@ int unifi_putest_set_sdio_clock(unifi_priv_t *priv, unsigned char *arg)
unifi_trace(priv, UDBG2, "set sdio clock: %d KHz\n", sdio_clock_speed);
CsrSdioClaim(priv->sdio);
csrResult = CsrSdioMaxBusClockFrequencySet(priv->sdio, sdio_clock_speed);
csrResult = CsrSdioMaxBusClockFrequencySet(priv->sdio, sdio_clock_speed * 1000);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv,
......@@ -304,7 +306,9 @@ int unifi_putest_start(unifi_priv_t *priv, unsigned char *arg)
/* Application may have stopped the XAPs, but they are needed for reset */
if (already_in_test) {
CsrSdioClaim(priv->sdio);
csrResult = unifi_start_processors(priv->card);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv, "Failed to start XAPs. Hard reset required.\n");
}
......@@ -317,8 +321,9 @@ int unifi_putest_start(unifi_priv_t *priv, unsigned char *arg)
unifi_error(priv, "CsrSdioPowerOn csrResult = %d\n", csrResult);
}
}
CsrSdioClaim(priv->sdio);
csrResult = unifi_init(priv->card);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv,
"unifi_putest_start: failed to init UniFi\n");
......@@ -335,7 +340,9 @@ int unifi_putest_stop(unifi_priv_t *priv, unsigned char *arg)
CsrResult csrResult;
/* Application may have stopped the XAPs, but they are needed for reset */
CsrSdioClaim(priv->sdio);
csrResult = unifi_start_processors(priv->card);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv, "Failed to start XAPs. Hard reset required.\n");
}
......@@ -428,7 +435,9 @@ int unifi_putest_dl_fw(unifi_priv_t *priv, unsigned char *arg)
}
/* Application may have stopped the XAPs, but they are needed for reset */
CsrSdioClaim(priv->sdio);
csrResult = unifi_start_processors(priv->card);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv, "Failed to start XAPs. Hard reset required.\n");
}
......@@ -436,7 +445,9 @@ int unifi_putest_dl_fw(unifi_priv_t *priv, unsigned char *arg)
/* Download the f/w. On UF6xxx this will cause the f/w file to convert
* into patch format and download via the ROM boot loader
*/
CsrSdioClaim(priv->sdio);
csrResult = unifi_download(priv->card, 0x0c00);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv,
"unifi_putest_dl_fw: failed to download the f/w\n");
......@@ -504,7 +515,9 @@ int unifi_putest_dl_fw_buff(unifi_priv_t *priv, unsigned char *arg)
priv->fw_sta.dl_len = fw_length;
/* Application may have stopped the XAPs, but they are needed for reset */
CsrSdioClaim(priv->sdio);
csrResult = unifi_start_processors(priv->card);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv, "Failed to start XAPs. Hard reset required.\n");
}
......@@ -512,7 +525,9 @@ int unifi_putest_dl_fw_buff(unifi_priv_t *priv, unsigned char *arg)
/* Download the f/w. On UF6xxx this will cause the f/w file to convert
* into patch format and download via the ROM boot loader
*/
CsrSdioClaim(priv->sdio);
csrResult = unifi_download(priv->card, 0x0c00);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv,
"unifi_putest_dl_fw_buff: failed to download the f/w\n");
......@@ -581,7 +596,9 @@ int unifi_putest_coredump_prepare(unifi_priv_t *priv, unsigned char *arg)
}
/* Card software reset */
CsrSdioClaim(priv->sdio);
r = unifi_card_hard_reset(priv->card);
CsrSdioRelease(priv->sdio);
if (r != CSR_RESULT_SUCCESS) {
unifi_error(priv, "unifi_card_hard_reset() failed %d\n", r);
}
......@@ -599,7 +616,9 @@ int unifi_putest_coredump_prepare(unifi_priv_t *priv, unsigned char *arg)
/* Stop the XAPs for coredump. The PUTEST_STOP must be called, e.g. at
* Raw SDIO deinit, to resume them.
*/
CsrSdioClaim(priv->sdio);
r = unifi_card_stop_processor(priv->card, UNIFI_PROC_BOTH);
CsrSdioRelease(priv->sdio);
if (r != CSR_RESULT_SUCCESS) {
unifi_error(priv, "Failed to stop processors\n");
}
......@@ -646,7 +665,9 @@ int unifi_putest_cmd52_block_read(unifi_priv_t *priv, unsigned char *arg)
return -ENOMEM;
}
CsrSdioClaim(priv->sdio);
r = unifi_card_readn(priv->card, block_cmd52.addr, block_local_buffer, block_cmd52.length);
CsrSdioRelease(priv->sdio);
if (r != CSR_RESULT_SUCCESS) {
unifi_error(priv, "cmd52r_block: unifi_readn failed\n");
return -EIO;
......
......@@ -17,6 +17,7 @@
*/
#include <linux/kmod.h>
#include <linux/init.h>
#include <linux/suspend.h>
#include "csr_wifi_hip_unifi.h"
#include "unifi_priv.h"
......@@ -25,7 +26,16 @@
/* The function driver context, i.e the UniFi Driver */
static CsrSdioFunctionDriver *sdio_func_drv;
#ifdef CONFIG_PM
static int uf_sdio_emb_power_event(struct notifier_block *this, unsigned long event, void *ptr);
#endif
/* The Android wakelock is here for completeness. Typically the MMC driver is used
* instead of sdioemb, but sdioemb may be used for CSPI.
*/
#ifdef ANDROID_BUILD
struct wake_lock unifi_sdio_wake_lock; /* wakelock to prevent suspend while resuming */
#endif
/* sdioemb driver uses POSIX error codes */
static CsrResult
......@@ -501,6 +511,131 @@ uf_glue_sdio_int_handler(struct sdioemb_dev *fdev)
}
}
#ifdef CONFIG_PM
/*
* Power Management notifier
*/
struct uf_sdio_emb_pm_notifier
{
struct list_head list;
CsrSdioFunction *sdio_ctx;
struct notifier_block pm_notifier;
};
/* PM notifier list head */
static struct uf_sdio_emb_pm_notifier uf_sdio_emb_pm_notifiers = {
.sdio_ctx = NULL,
};
/*
* ---------------------------------------------------------------------------
* uf_sdio_emb_register_pm_notifier
* uf_sdio_emb_unregister_pm_notifier
*
* Register/unregister for power management events. A list is used to
* allow multiple card instances to be supported.
*
* Arguments:
* sdio_ctx - CSR SDIO context to associate PM notifier to
*
* Returns:
* Register function returns NULL on error
* ---------------------------------------------------------------------------
*/
static struct uf_sdio_emb_pm_notifier *
uf_sdio_emb_register_pm_notifier(CsrSdioFunction *sdio_ctx)
{
/* Allocate notifier context for this card instance */
struct uf_sdio_emb_pm_notifier *notifier_ctx = kmalloc(sizeof(struct uf_sdio_emb_pm_notifier), GFP_KERNEL);
if (notifier_ctx)
{
notifier_ctx->sdio_ctx = sdio_ctx;
notifier_ctx->pm_notifier.notifier_call = uf_sdio_emb_power_event;
list_add(&notifier_ctx->list, &uf_sdio_emb_pm_notifiers.list);
if (register_pm_notifier(&notifier_ctx->pm_notifier)) {
printk(KERN_ERR "unifi: register_pm_notifier failed\n");
}
}
return notifier_ctx;
}
static void
uf_sdio_emb_unregister_pm_notifier(CsrSdioFunction *sdio_ctx)
{
struct uf_sdio_emb_pm_notifier *notifier_ctx;
struct list_head *node, *q;
list_for_each_safe(node, q, &uf_sdio_emb_pm_notifiers.list) {
notifier_ctx = list_entry(node, struct uf_sdio_emb_pm_notifier, list);
/* If it matches, unregister and free the notifier context */
if (notifier_ctx && notifier_ctx->sdio_ctx == sdio_ctx)
{
if (unregister_pm_notifier(&notifier_ctx->pm_notifier)) {
printk(KERN_ERR "unifi: unregister_pm_notifier failed\n");
}
/* Remove from list */
notifier_ctx->sdio_ctx = NULL;
list_del(node);
kfree(notifier_ctx);
}
}
}
/*
* ---------------------------------------------------------------------------
* uf_sdio_emb_power_event
*
* Handler for power management events.
*
* We need to handle suspend/resume events while the userspace is unsuspended
* to allow the SME to run its suspend/resume state machines.
*
* Arguments:
* event event ID
*
* Returns:
* Status of the event handling
* ---------------------------------------------------------------------------
*/
static int
uf_sdio_emb_power_event(struct notifier_block *this, unsigned long event, void *ptr)
{
struct uf_sdio_emb_pm_notifier *notifier_ctx = container_of(this,
struct uf_sdio_emb_pm_notifier,
pm_notifier);
/* Call the CSR SDIO function driver's suspend/resume method
* while the userspace is unsuspended.
*/
switch (event) {
case PM_POST_HIBERNATION:
case PM_POST_SUSPEND:
printk(KERN_INFO "%s:%d resume\n", __FUNCTION__, __LINE__ );
if (sdio_func_drv && sdio_func_drv->resume) {
sdio_func_drv->resume(notifier_ctx->sdio_ctx);
}
break;
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
printk(KERN_INFO "%s:%d suspend\n", __FUNCTION__, __LINE__ );
if (sdio_func_drv && sdio_func_drv->suspend) {
sdio_func_drv->suspend(notifier_ctx->sdio_ctx);
}
break;
}
return NOTIFY_DONE;
}
#endif /* CONFIG_PM */
/*
* ---------------------------------------------------------------------------
......@@ -550,16 +685,30 @@ uf_glue_sdio_probe(struct sdioemb_dev *fdev)
unifi_trace(NULL, UDBG1, "Setting SDIO bus clock to %d kHz\n", sdio_clock);
sdioemb_set_max_bus_freq(fdev, 1000 * sdio_clock);
#ifdef CONFIG_PM
/* Register to get PM events */
if (uf_sdio_emb_register_pm_notifier(sdio_ctx) == NULL) {
unifi_error(NULL, "%s: Failed to register for PM events\n", __FUNCTION__);
}
#endif
/* Call the main UniFi driver inserted handler */
if (sdio_func_drv && sdio_func_drv->inserted) {
uf_add_os_device(fdev->slot_id, fdev->os_device);
sdio_func_drv->inserted(sdio_ctx);
}
#ifdef ANDROID_BUILD
/* Take the wakelock */
unifi_trace(NULL, UDBG1, "emb probe: take wake lock\n");
wake_lock(&unifi_sdio_wake_lock);
#endif
return 0;
} /* uf_glue_sdio_probe() */
/*
* ---------------------------------------------------------------------------
* uf_sdio_remove
......@@ -585,6 +734,11 @@ uf_sdio_remove(struct sdioemb_dev *fdev)
sdio_func_drv->removed(sdio_ctx);
}
#ifdef CONFIG_PM
/* Unregister for PM events */
uf_sdio_emb_unregister_pm_notifier(sdio_ctx);
#endif
kfree(sdio_ctx);
} /* uf_sdio_remove */
......@@ -606,14 +760,7 @@ uf_sdio_remove(struct sdioemb_dev *fdev)
static void
uf_glue_sdio_suspend(struct sdioemb_dev *fdev)
{
CsrSdioFunction *sdio_ctx = fdev->drv_data;
unifi_trace(NULL, UDBG3, "Suspending...\n");
/* Pass event to UniFi Driver. */
if (sdio_func_drv && sdio_func_drv->suspend) {
sdio_func_drv->suspend(sdio_ctx);
}
unifi_info(NULL, "Suspending...\n");
} /* uf_glue_sdio_suspend() */
......@@ -634,14 +781,13 @@ uf_glue_sdio_suspend(struct sdioemb_dev *fdev)
static void
uf_glue_sdio_resume(struct sdioemb_dev *fdev)
{
CsrSdioFunction *sdio_ctx = fdev->drv_data;
unifi_info(NULL, "Resuming...\n");
unifi_trace(NULL, UDBG3, "Resuming...\n");
#ifdef ANDROID_BUILD
unifi_trace(NULL, UDBG1, "emb resume: take wakelock\n");
wake_lock(&unifi_sdio_wake_lock);
#endif
/* Pass event to UniFi Driver. */
if (sdio_func_drv && sdio_func_drv->resume) {
sdio_func_drv->resume(sdio_ctx);
}
} /* uf_glue_sdio_resume() */
......@@ -708,6 +854,15 @@ CsrSdioFunctionDriverRegister(CsrSdioFunctionDriver *sdio_drv)
/* Save the registered driver description */
sdio_func_drv = sdio_drv;
#ifdef CONFIG_PM
/* Initialise PM notifier list */
INIT_LIST_HEAD(&uf_sdio_emb_pm_notifiers.list);
#endif
#ifdef ANDROID_BUILD
wake_lock_init(&unifi_sdio_wake_lock, WAKE_LOCK_SUSPEND, "unifi_sdio_work");
#endif
/* Register ourself with sdioemb */
r = sdioemb_driver_register(&unifi_sdioemb);
if (r) {
......@@ -724,6 +879,10 @@ CsrSdioFunctionDriverUnregister(CsrSdioFunctionDriver *sdio_drv)
{
sdioemb_driver_unregister(&unifi_sdioemb);
#ifdef ANDROID_BUILD
wake_lock_destroy(&unifi_sdio_wake_lock);
#endif
sdio_func_drv = NULL;
CsrPmemFree(unifi_sdioemb.id_table);
......
......@@ -47,6 +47,12 @@ void unifi_suspend(void *ospriv)
unifi_priv_t *priv = ospriv;
int interfaceTag=0;
/* For powered suspend, tell the resume's wifi_on() not to reinit UniFi */
priv->wol_suspend = (enable_wol == UNIFI_WOL_OFF) ? FALSE : TRUE;
unifi_trace(priv, UDBG1, "unifi_suspend: wol_suspend %d, enable_wol %d",
priv->wol_suspend, enable_wol );
/* Stop network traffic. */
/* need to stop all the netdevices*/
for( interfaceTag=0;interfaceTag<CSR_WIFI_NUM_INTERFACES;interfaceTag++)
......@@ -54,11 +60,20 @@ void unifi_suspend(void *ospriv)
netInterface_priv_t *interfacePriv = priv->interfacePriv[interfaceTag];
if (interfacePriv->netdev_registered == 1)
{
netif_carrier_off(priv->netdev[interfaceTag]);
if( priv->wol_suspend ) {
unifi_trace(priv, UDBG1, "unifi_suspend: Don't netif_carrier_off");
} else {
unifi_trace(priv, UDBG1, "unifi_suspend: netif_carrier_off");
netif_carrier_off(priv->netdev[interfaceTag]);
}
UF_NETIF_TX_STOP_ALL_QUEUES(priv->netdev[interfaceTag]);
}
}
unifi_trace(priv, UDBG1, "unifi_suspend: suspend SME");
sme_sys_suspend(priv);
} /* unifi_suspend() */
......@@ -76,12 +91,44 @@ void unifi_suspend(void *ospriv)
void unifi_resume(void *ospriv)
{
unifi_priv_t *priv = ospriv;
int interfaceTag=0;
int r;
int wol = priv->wol_suspend;
unifi_trace(priv, UDBG1, "unifi_resume: resume SME, enable_wol=%d", enable_wol);
/* The resume causes wifi-on which will re-enable the BH and reinstall the ISR */
r = sme_sys_resume(priv);
if (r) {
unifi_error(priv, "Failed to resume UniFi\n");
}
/* Resume the network interfaces. For the cold resume case, this will
* happen upon reconnection.
*/
if (wol) {
unifi_trace(priv, UDBG1, "unifi_resume: try to enable carrier");
/* need to start all the netdevices*/
for( interfaceTag=0;interfaceTag<CSR_WIFI_NUM_INTERFACES;interfaceTag++) {
netInterface_priv_t *interfacePriv = priv->interfacePriv[interfaceTag];
unifi_trace(priv, UDBG1, "unifi_resume: interfaceTag %d netdev_registered %d mode %d\n",
interfaceTag, interfacePriv->netdev_registered, interfacePriv->interfaceMode);
if (interfacePriv->netdev_registered == 1)
{
netif_carrier_on(priv->netdev[interfaceTag]);
UF_NETIF_TX_START_ALL_QUEUES(priv->netdev[interfaceTag]);
}
}
/* Kick the BH thread (with reason=host) to poll for data that may have
* arrived during a powered suspend. This caters for the case where the SME
* doesn't interact with the chip (e.g install autonomous scans) during resume.
*/
unifi_send_signal(priv->card, NULL, 0, NULL);
}
} /* unifi_resume() */
This diff is collapsed.
......@@ -92,11 +92,15 @@ sme_init_request(unifi_priv_t *priv)
return -EIO;
}
unifi_trace(priv, UDBG5, "sme_init_request: wait sem\n");
/* Grab the SME semaphore until the reply comes, or timeout */
if (down_interruptible(&priv->sme_sem)) {
unifi_error(priv, "sme_init_request: Failed to get SME semaphore\n");
return -EIO;
}
unifi_trace(priv, UDBG5, "sme_init_request: got sem: pending\n");
priv->sme_reply.request_status = SME_REQUEST_PENDING;
return 0;
......@@ -118,6 +122,10 @@ uf_sme_complete_request(unifi_priv_t *priv, CsrResult reply_status, const char *
(func ? func : ""), priv->sme_reply.request_status);
return;
}
unifi_trace(priv, UDBG5,
"sme_complete_request: completed %s (s:%d)\n",
(func ? func : ""), priv->sme_reply.request_status);
priv->sme_reply.request_status = SME_REQUEST_RECEIVED;
priv->sme_reply.reply_status = reply_status;
......@@ -127,23 +135,66 @@ uf_sme_complete_request(unifi_priv_t *priv, CsrResult reply_status, const char *
}
void
uf_sme_cancel_request(unifi_priv_t *priv, CsrResult reply_status)
{
/* Check for a blocking SME request in progress, and cancel the wait.
* This should be used when the character device is closed.
*/
if (priv == NULL) {
unifi_error(priv, "sme_cancel_request: Invalid priv\n");
return;
}
/* If no request is pending, nothing to wake up */
if (priv->sme_reply.request_status != SME_REQUEST_PENDING) {
unifi_trace(priv, UDBG5,
"sme_cancel_request: no request was pending (s:%d)\n",
priv->sme_reply.request_status);
/* Nothing to do */
return;
}
unifi_trace(priv, UDBG5,
"sme_cancel_request: request cancelled (s:%d)\n",
priv->sme_reply.request_status);
/* Wake up the wait with an error status */
priv->sme_reply.request_status = SME_REQUEST_CANCELLED;
priv->sme_reply.reply_status = reply_status; /* unimportant since the CANCELLED state will fail the ioctl */
wake_up_interruptible(&priv->sme_request_wq);
return;
}
static int
_sme_wait_for_reply(unifi_priv_t *priv,
unsigned long timeout, const char *func)
{
long r;
unifi_trace(priv, UDBG5, "sme_wait_for_reply: sleep\n");
unifi_trace(priv, UDBG5, "sme_wait_for_reply: %s sleep\n", func ? func : "");
r = wait_event_interruptible_timeout(priv->sme_request_wq,
(priv->sme_reply.request_status != SME_REQUEST_PENDING),
msecs_to_jiffies(timeout));
unifi_trace(priv, UDBG5, "sme_wait_for_reply: awake\n");
unifi_trace(priv, UDBG5, "sme_wait_for_reply: %s awake (%d)\n", func ? func : "", r);
if (r == -ERESTARTSYS) {
/* The thread was killed */
unifi_info(priv, "ERESTARTSYS in _sme_wait_for_reply\n");
up(&priv->sme_sem);
return r;
}
if (priv->sme_reply.request_status == SME_REQUEST_CANCELLED) {
unifi_trace(priv, UDBG5, "Cancelled waiting for SME to reply (%s s:%d, t:%d, r:%d)\n",
(func ? func : ""), priv->sme_reply.request_status, timeout, r);
/* Release the SME semaphore that was downed in sme_init_request() */
up(&priv->sme_sem);
return -EIO; /* fail the ioctl */
}
if ((r == 0) && (priv->sme_reply.request_status != SME_REQUEST_RECEIVED)) {
unifi_notice(priv, "Timeout waiting for SME to reply (%s s:%d, t:%d)\n",
(func ? func : ""), priv->sme_reply.request_status, timeout);
......@@ -156,6 +207,9 @@ _sme_wait_for_reply(unifi_priv_t *priv,
return -ETIMEDOUT;
}
unifi_trace(priv, UDBG5, "sme_wait_for_reply: %s received (%d)\n",
func ? func : "", r);
/* Release the SME semaphore that was downed in sme_init_request() */
up(&priv->sme_sem);
......@@ -1289,22 +1343,20 @@ int sme_sys_suspend(unifi_priv_t *priv)
return -EIO;
}
/* For powered suspend, tell the resume's wifi_on() not to reinit UniFi */
priv->wol_suspend = (enable_wol == UNIFI_WOL_OFF) ? FALSE : TRUE;
/* Suspend the SME, which will cause it to power down UniFi */
/* Suspend the SME, which MAY cause it to power down UniFi */
CsrWifiRouterCtrlSuspendIndSend(priv->CSR_WIFI_SME_IFACEQUEUE,0, 0, priv->wol_suspend);
r = sme_wait_for_reply(priv, UNIFI_SME_SYS_LONG_TIMEOUT);
if (r) {
/* No reply - forcibly power down in case the request wasn't processed */
unifi_notice(priv,
"suspend: SME did not reply %s, ",
priv->ptest_mode ? "leave powered" : "power off UniFi anyway\n");
(priv->ptest_mode | priv->wol_suspend) ? "leave powered" : "power off UniFi anyway\n");
/* Leave power on for production test, though */
if (!priv->ptest_mode) {
/* Put UniFi to deep sleep, in case we can not power it off */
CsrSdioClaim(priv->sdio);
unifi_trace(priv, UDBG1, "Force deep sleep");
csrResult = unifi_force_low_power_mode(priv->card);
/* For WOL, the UniFi must stay powered */
......@@ -1319,13 +1371,40 @@ int sme_sys_suspend(unifi_priv_t *priv)
if (priv->wol_suspend) {
unifi_trace(priv, UDBG1, "UniFi left powered for WOL\n");
/* For PIO WOL, disable SDIO interrupt to enable PIO mode in the f/w */
if (enable_wol == UNIFI_WOL_PIO) {
unifi_trace(priv, UDBG1, "Remove IRQ to enable PIO WOL\n");
if (csr_sdio_linux_remove_irq(priv->sdio)) {
unifi_notice(priv, "WOL csr_sdio_linux_remove_irq failed\n");
/* Remove the IRQ, which also disables the card SDIO interrupt.
* Disabling the card SDIO interrupt enables the PIO WOL source.
* Removal of the of the handler ensures that in both SDIO and PIO cases
* the card interrupt only wakes the host. The card will be polled
* after resume to handle any pending data.
*/
if (csr_sdio_linux_remove_irq(priv->sdio)) {
unifi_notice(priv, "WOL csr_sdio_linux_remove_irq failed\n");
}
if (enable_wol == UNIFI_WOL_SDIO) {
/* Because csr_sdio_linux_remove_irq() disabled the card SDIO interrupt,
* it must be left enabled to wake-on-SDIO.
*/
unifi_trace(priv, UDBG1, "Enable card SDIO interrupt for SDIO WOL\n");
CsrSdioClaim(priv->sdio);
csrResult = CsrSdioInterruptEnable(priv->sdio);
CsrSdioRelease(priv->sdio);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv, "WOL CsrSdioInterruptEnable failed %d\n", csrResult);
}
} else {
unifi_trace(priv, UDBG1, "Disabled card SDIO interrupt for PIO WOL\n");
}
/* Prevent the BH thread from running during the suspend.
* Upon resume, sme_sys_resume() will trigger a wifi-on, this will cause
* the BH thread to be re-enabled and reinstall the ISR.
*/
priv->bh_thread.block_thread = 1;
unifi_trace(priv, UDBG1, "unifi_suspend: suspended BH");
}
/* Consider UniFi to be uninitialised */
......@@ -1354,22 +1433,10 @@ int sme_sys_resume(unifi_priv_t *priv)
CsrWifiRouterCtrlResumeIndSend(priv->CSR_WIFI_SME_IFACEQUEUE,0, priv->wol_suspend);
if (priv->ptest_mode == 1) {
r = sme_wait_for_reply(priv, UNIFI_SME_SYS_LONG_TIMEOUT);
if (r) {
/* No reply - forcibly power down in case the request wasn't processed */
unifi_notice(priv,
"resume: SME did not reply, return success anyway\n");
}
} else {
/*
* We are not going to wait for the reply because the SME might be in
* the userspace. In this case the event will reach it when the kernel
* resumes. So, release now the SME semaphore that was downed in
* sme_init_request().
*/
up(&priv->sme_sem);
r = sme_wait_for_reply(priv, UNIFI_SME_SYS_LONG_TIMEOUT);
if (r) {
unifi_notice(priv,
"resume: SME did not reply, return success anyway\n");
}
return 0;
......
This diff is collapsed.
......@@ -101,7 +101,6 @@ uf_sme_init(unifi_priv_t *priv)
INIT_LIST_HEAD(&interfacePriv->genericMgtFrames);
INIT_LIST_HEAD(&interfacePriv->genericMulticastOrBroadCastMgtFrames);
INIT_LIST_HEAD(&interfacePriv->genericMulticastOrBroadCastFrames);
INIT_LIST_HEAD(&interfacePriv->directedMaPktReq);
for(j = 0; j < UNIFI_MAX_CONNECTIONS; j++) {
interfacePriv->staInfo[j] = NULL;
......@@ -139,7 +138,7 @@ uf_sme_deinit(unifi_priv_t *priv)
/* Remove all the Peer database, before going down */
for (i = 0; i < CSR_WIFI_NUM_INTERFACES; i++) {
spin_lock(&priv->ba_lock);
down(&priv->ba_mutex);
for(ba_session_idx=0; ba_session_idx < MAX_SUPPORTED_BA_SESSIONS_RX; ba_session_idx++){
ba_session_rx = priv->interfacePriv[i]->ba_session_rx[ba_session_idx];
if(ba_session_rx) {
......@@ -161,7 +160,7 @@ uf_sme_deinit(unifi_priv_t *priv)
}
}
spin_unlock(&priv->ba_lock);
up(&priv->ba_mutex);
interfacePriv = priv->interfacePriv[i];
if(interfacePriv){
for(j = 0; j < UNIFI_MAX_CONNECTIONS; j++) {
......
......@@ -29,8 +29,10 @@
} \
} while (0)
/* Workaround for the wpa_supplicant hanging issue */
/* Workaround for the wpa_supplicant hanging issue - disabled on Android */
#ifndef ANDROID_BUILD
#define CSR_WIFI_WEXT_HANG_WORKAROUND
#endif
#ifdef CSR_WIFI_WEXT_HANG_WORKAROUND
# define UF_RTNL_LOCK() rtnl_lock()
......
......@@ -265,7 +265,9 @@ ul_log_config_ind(unifi_priv_t *priv, u8 *conf_param, int len)
/* wifi_off_ind (error or exit) */
CsrWifiRouterCtrlWifiOffIndSend(priv->CSR_WIFI_SME_IFACEQUEUE,0, (CsrWifiRouterCtrlControlIndication)(*conf_param));
}
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
unifi_debug_buf_dump();
#endif
#else
bulk_data_param_t bulkdata;
......@@ -420,10 +422,6 @@ ul_send_signal_unpacked(unifi_priv_t *priv, CSR_SIGNAL *sigptr,
CsrResult csrResult;
unsigned long lock_flags;
int r;
#ifdef CSR_SUPPORT_SME
netInterface_priv_t *interfacePriv = priv->interfacePriv[0];
CsrUint32 alignOffset = 0;
#endif
csrResult = write_pack(sigptr, sigbuf, &packed_siglen);
......@@ -431,12 +429,6 @@ ul_send_signal_unpacked(unifi_priv_t *priv, CSR_SIGNAL *sigptr,
unifi_error(priv, "Malformed HIP signal in ul_send_signal_unpacked()\n");
return CsrHipResultToStatus(csrResult);
}
#ifdef CSR_SUPPORT_SME
if (bulkdata != NULL){
alignOffset = (CsrUint32)(long)(bulkdata->d[0].os_data_ptr) & (CSR_WIFI_ALIGN_BYTES-1);
}
#endif
r = _align_bulk_data_buffers(priv, sigbuf, (bulk_data_param_t*)bulkdata);
if (r) {
return r;
......@@ -449,17 +441,6 @@ ul_send_signal_unpacked(unifi_priv_t *priv, CSR_SIGNAL *sigptr,
spin_unlock_irqrestore(&priv->send_signal_lock, lock_flags);
return CsrHipResultToStatus(csrResult);
}
#ifdef CSR_SUPPORT_SME
if (sigptr->SignalPrimitiveHeader.SignalId == CSR_MA_PACKET_REQUEST_ID) {
if(interfacePriv->interfaceMode == CSR_WIFI_ROUTER_CTRL_MODE_AP ||
interfacePriv->interfaceMode == CSR_WIFI_ROUTER_CTRL_MODE_P2PGO) {
uf_store_directed_ma_packet_referenece(priv, bulkdata, sigptr,alignOffset);
}
}
#endif
spin_unlock_irqrestore(&priv->send_signal_lock, lock_flags);
return 0;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment