5.11.0.0R3
Software Development Kit
 
Loading...
Searching...
No Matches
wwd_sdpcm.c File Reference

Functions

uint32_t wwd_get_bss_index (wwd_interface_t interface)
 
wwd_result_t wwd_management_set_event_handler (const wwd_event_num_t *event_nums, wwd_event_handler_t handler_func, void *handler_user_data, wwd_interface_t interface)
 
wwd_result_t wwd_management_set_event_handler_locally (const wwd_event_num_t *event_nums, wwd_event_handler_t handler_func, void *handler_user_data, wwd_interface_t interface)
 
void wwd_network_send_ethernet_data (wiced_buffer_t buffer, wwd_interface_t interface)
 
uint8_t wwd_sdpcm_get_available_credits (void)
 
void * wwd_sdpcm_get_ioctl_buffer (wiced_buffer_t *buffer, uint16_t data_length)
 
void * wwd_sdpcm_get_iovar_buffer (wiced_buffer_t *buffer, uint16_t data_length, const char *name)
 
wwd_result_t wwd_sdpcm_init (void)
 
void wwd_sdpcm_process_rx_packet (wiced_buffer_t buffer)
 
void wwd_sdpcm_quit (void)
 
wwd_result_t wwd_sdpcm_send_ioctl (sdpcm_command_type_t type, uint32_t command, wiced_buffer_t send_buffer_hnd, wiced_buffer_t *response_buffer_hnd, wwd_interface_t interface)
 
wwd_result_t wwd_sdpcm_send_iovar (sdpcm_command_type_t type, wiced_buffer_t send_buffer_hnd, wiced_buffer_t *response_buffer_hnd, wwd_interface_t interface)
 
wwd_result_t wwd_wifi_set_raw_packet_processor (wwd_wifi_raw_packet_processor_t function)
 

Detailed Description

Provides an implementation of the Broadcom SDPCM protocol. The Broadcom SDPCM protocol provides multiplexing of Wireless Data frames, I/O Control functions (IOCTL), and Asynchronous Event signalling. It is required when communicating with Broadcom 802.11 devices.

Function Documentation

◆ wwd_network_send_ethernet_data()

void wwd_network_send_ethernet_data ( wiced_buffer_t buffer,
wwd_interface_t interface )

Sends a data packet.

This function should be called by the bottom of the network stack in order for it to send an ethernet frame. The function prepends a BDC header, before sending to wwd_sdpcm_send_common where the SDPCM header will be added

Parameters
buffer: The ethernet packet buffer to be sent
interface: the interface over which to send the packet (AP or STA)

◆ wwd_sdpcm_get_available_credits()

uint8_t wwd_sdpcm_get_available_credits ( void )

Returns the number of bus credits available

Returns
The number of bus credits available

◆ wwd_sdpcm_get_ioctl_buffer()

void * wwd_sdpcm_get_ioctl_buffer ( wiced_buffer_t * buffer,
uint16_t data_length )

A helper function to easily acquire and initialise a buffer destined for use as an ioctl

Parameters
buffer: A pointer to a wiced_buffer_t object where the created buffer will be stored
data_length: The length of space reserved for user data
Returns
A pointer to the start of user data with data_length space available

◆ wwd_sdpcm_get_iovar_buffer()

void * wwd_sdpcm_get_iovar_buffer ( wiced_buffer_t * buffer,
uint16_t data_length,
const char * name )

A helper function to easily acquire and initialise a buffer destined for use as an iovar

Parameters
buffer: A pointer to a wiced_buffer_t object where the created buffer will be stored
data_length: The length of space reserved for user data
name: The name of the iovar
Returns
A pointer to the start of user data with data_length space available

◆ wwd_sdpcm_init()

wwd_result_t wwd_sdpcm_init ( void )

Initialises the SDPCM protocol handler

Initialises mutex and semaphore flags needed by the SDPCM handler. Also initialises the list of event handlers. This function is called from the wwd_thread_init function.

Returns
WWD result code

◆ wwd_sdpcm_process_rx_packet()

void wwd_sdpcm_process_rx_packet ( wiced_buffer_t buffer)

Processes and directs incoming SDPCM packets

This function receives SDPCM packets from the Broadcom 802.11 device and decodes the SDPCM header to determine where the packet should be directed.

  • Control packets (IOCTL/IOVAR) cause the IOCTL flag to be set to allow the resumption of the thread which sent the IOCTL
  • Data Packets are sent to the bottom layer of the network stack via the host_network_process_ethernet_data function
  • Event Packets are decoded to determine which event occurred, and the event handler list is consulted and the appropriate event handler is called.
Parameters
buffer: The SDPCM packet buffer received from the Broadcom 802.11 device

◆ wwd_sdpcm_quit()

void wwd_sdpcm_quit ( void )

Initialises the SDPCM protocol handler

De-initialises mutex and semaphore flags needed by the SDPCM handler. This function is called from the wwd_thread_func function when it is exiting.

◆ wwd_sdpcm_send_ioctl()

wwd_result_t wwd_sdpcm_send_ioctl ( sdpcm_command_type_t type,
uint32_t command,
wiced_buffer_t send_buffer_hnd,
wiced_buffer_t * response_buffer_hnd,
wwd_interface_t interface )

Sends an IOCTL command

Sends a I/O Control command to the Broadcom 802.11 device. The data which is set or retrieved must be in a format structure which is appropriate for the particular I/O control being sent. These structures can only be found in the DHD source code such as wl/exe/wlu.c. The I/O control will always respond with a packet buffer which may contain data in a format specific to the I/O control being used.

@Note: The caller is responsible for releasing the response buffer. @Note: The function blocks until the IOCTL has completed @Note: Only one IOCTL may happen simultaneously.

Parameters
type: SDPCM_SET or SDPCM_GET - indicating whether to set or get the I/O control
send_buffer_hnd: A handle for a packet buffer containing the data value to be sent.
response_buffer_hnd: A pointer which will receive the handle for the packet buffer containing the response data value received..
interface: Which interface to send the iovar to (WWD_STA_INTERFACE or WWD_AP_INTERFACE)
Returns
WWD result code

◆ wwd_sdpcm_send_iovar()

wwd_result_t wwd_sdpcm_send_iovar ( sdpcm_command_type_t type,
wiced_buffer_t send_buffer_hnd,
wiced_buffer_t * response_buffer_hnd,
wwd_interface_t interface )

Sets/Gets an I/O Variable (IOVar)

This function either sets or retrieves the value of an I/O variable from the Broadcom 802.11 device. The data which is set or retrieved must be in a format structure which is appropriate for the particular I/O variable being accessed. These structures can only be found in the DHD source code such as wl/exe/wlu.c.

@Note: The function blocks until the I/O variable read/write has completed

Parameters
type: SDPCM_SET or SDPCM_GET - indicating whether to set or get the I/O variable value
send_buffer_hnd: A handle for a packet buffer containing the data value to be sent.
response_buffer_hnd: A pointer which will receive the handle for the packet buffer containing the response data value received..
interface: Which interface to send the iovar to (AP or STA)
Returns
WWD result code

◆ wwd_wifi_set_raw_packet_processor()

wwd_result_t wwd_wifi_set_raw_packet_processor ( wwd_wifi_raw_packet_processor_t function)

Sets a handler functions for monitor mode

Packets received in monitor mode have raw 802.11 headers and cannot be processed by the normal stack. Use this function to set a handler function which will process and free the raw packets received in monitor mode.

Parameters
func: function pointer to handler. Set to NULL to clear handler.
Returns
result code