Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Upper edge API

Functions

card_tunifi_alloc_card (CsrSdioFunction *sdiopriv, void *ospriv)
 
CsrResult unifi_init_card (card_t *card, s32 led_mask)
 
void unifi_free_card (card_t *card)
 
void unifi_cancel_pending_signals (card_t *card)
 
CsrResult unifi_send_signal (card_t *card, const u8 *sigptr, u32 siglen, const bulk_data_param_t *bulkdata)
 
CsrResult unifi_send_resources_available (card_t *card, const u8 *sigptr)
 
void unifi_card_info (card_t *card, card_info_t *card_info)
 
CsrResult unifi_check_io_status (card_t *card, s32 *status)
 
CsrResult unifi_bh (card_t *card, u32 *remaining)
 
CsrResult unifi_configure_low_power_mode (card_t *card, enum unifi_low_power_mode low_power_mode, enum unifi_periodic_wake_mode periodic_wake_mode)
 
CsrResult unifi_force_low_power_mode (card_t *card)
 
CsrResult unifi_ta_configure (card_t *card, CsrWifiRouterCtrlTrafficConfigType config_type, const CsrWifiRouterCtrlTrafficConfig *config)
 
void unifi_ta_sample (card_t *card, CsrWifiRouterCtrlProtocolDirection direction, const bulk_data_desc_t *data, const u8 *saddr, const u8 *sta_macaddr, u32 timestamp, u16 rate)
 
void unifi_ta_classification (card_t *card, CsrWifiRouterCtrlTrafficType traffic_type, u16 period)
 
CsrResult unifi_card_hard_reset (card_t *card)
 
unifi_TrafficQueue unifi_frame_priority_to_queue (CSR_PRIORITY priority)
 
CSR_PRIORITY unifi_get_default_downgrade_priority (unifi_TrafficQueue queue)
 
void unifi_pause_xmit (void *ospriv, unifi_TrafficQueue queue)
 
CsrResult unifi_run_bh (void *ospriv)
 
void unifi_receive_event (void *ospriv, u8 *sigdata, u32 siglen, const bulk_data_param_t *bulkdata)
 
voidunifi_fw_read_start (void *ospriv, s8 is_fw, const card_info_t *info)
 
s32 unifi_fw_read (void *ospriv, void *arg, u32 offset, void *buf, u32 len)
 
void unifi_fw_read_stop (void *ospriv, void *dlpriv)
 
voidunifi_fw_open_buffer (void *ospriv, void *fwbuf, u32 len)
 
void unifi_fw_close_buffer (void *ospriv, void *fwbuf)
 
void unifi_ta_indicate_protocol (void *ospriv, CsrWifiRouterCtrlTrafficPacketType packet_type, CsrWifiRouterCtrlProtocolDirection direction, const CsrWifiMacAddress *src_addr)
 
void unifi_ta_indicate_sampling (void *ospriv, CsrWifiRouterCtrlTrafficStats *stats)
 

Detailed Description

The following functions are implemented in the HIP core lib.

Function Documentation

card_t* unifi_alloc_card ( CsrSdioFunction sdiopriv,
void ospriv 
)

Initialise the HIP core lib. Note that the OS layer must initialise the SDIO glue layer and obtain an SDIO function context, prior to this call.

Parameters
sdioprivthe SDIO function context.
osprivthe OS layer context.
Returns
card_t the HIP core lib API context.

Definition at line 68 of file csr_wifi_hip_card_sdio.c.

CsrResult unifi_bh ( card_t card,
u32 remaining 
)

Run the HIP core lib Botton-Half. Whenever the HIP core lib want this function to be called by the OS layer, it calls unifi_run_bh().

Parameters
cardthe HIP core lib API context.
remainingpointer to return the time (in msecs) that this function should be re-scheduled. A return value of 0 means that no re-scheduling is required. If unifi_bh() is called before the timeout expires, the caller must pass in the remaining time.
Returns
0 if no error occured.
-CSR_ENODEV if the card is no longer present.
-CSR_E* if an error occured while running the bottom half.

Definition at line 373 of file csr_wifi_hip_card_sdio_intr.c.

void unifi_cancel_pending_signals ( card_t card)

Cancel all the signals pending in the HIP core lib. Normally used during a system suspend when the power is retained on UniFi.

Parameters
cardthe HIP core lib API context.

Definition at line 1858 of file csr_wifi_hip_card_sdio.c.

CsrResult unifi_card_hard_reset ( card_t card)

Use software to hard reset the chip. This is a subset of the unifi_init_card() functionality and should only be used only to reset a paniced chip before a coredump is taken.

Parameters
cardthe HIP core context.

Definition at line 3005 of file csr_wifi_hip_card_sdio.c.

void unifi_card_info ( card_t card,
card_info_t card_info 
)

Read the UniFi chip and the HIP core lib information.

Parameters
cardthe HIP core lib API context.
card_infopointer to save the information.

Definition at line 3990 of file csr_wifi_hip_card_sdio.c.

CsrResult unifi_check_io_status ( card_t card,
s32 status 
)

Print the UniFi I/O and Interrupt status. Normally it is used for debug purposes only.

Parameters
cardthe HIP core lib API context.
statusbuffer for the chip status
Returns
0 if the check was performed.
-CSR_EIO if an error occured while checking the status.
-CSR_ENODEV if the card is no longer present.

Definition at line 4016 of file csr_wifi_hip_card_sdio.c.

CsrResult unifi_configure_low_power_mode ( card_t card,
enum unifi_low_power_mode  low_power_mode,
enum unifi_periodic_wake_mode  periodic_wake_mode 
)

Run the HIP core lib Botton-Half. Whenever the HIP core lib want this function to be called by the OS layer, it calls unifi_run_bh().

Typically, the SME is responsible for configuring these parameters, so unifi_sys_configure_power_mode_req() is usually implemented as a direct call to unifi_configure_low_power_mode().

Note: When polling mode is used instead of interrupts, low_power_mode must never be set to UNIFI_LOW_POWER_ENABLED.

Parameters
cardthe HIP core lib API context.
low_power_modethe Low Power Mode.
periodic_wake_modethe Periodic Wake Mode.
Returns
0 if no error occured.
-CSR_E* if the request failed.

Definition at line 316 of file csr_wifi_hip_card_sdio_intr.c.

CsrResult unifi_force_low_power_mode ( card_t card)

Forces the UniFi chip to enter a Deep Sleep state. This is normally called by the OS layer when the platform suspends.

Note that if the UniFi Low Power Mode is disabled this call fails.

Parameters
cardthe HIP core lib API context.
Returns
0 if no error occured.
-CSR_ENODEV if the card is no longer present.
-CSR_E* if the request failed.

Definition at line 347 of file csr_wifi_hip_card_sdio_intr.c.

unifi_TrafficQueue unifi_frame_priority_to_queue ( CSR_PRIORITY  priority)

Call-outs from the HIP core lib to the OS layer. The following functions need to be implemented during the porting exercise. Selects appropriate queue according to priority Helps maintain uniformity in queue selection between the HIP and the OS layers.

Parameters
prioritypriority of the packet
Returns
Traffic queue to which a packet of this priority belongs

Definition at line 28 of file csr_wifi_hip_send.c.

void unifi_free_card ( card_t card)

De-Initialise the HIP core lib.

Parameters
cardthe HIP core lib API context.

Definition at line 1952 of file csr_wifi_hip_card_sdio.c.

void unifi_fw_close_buffer ( void ospriv,
void fwbuf 
)

Release a handle to a dynamically allocated firmware buffer (primarily intended for production test images which may need conversion)

Parameters
osprivthe OS layer context.
fwbufpointer to dynamically allocated buffer

Definition at line 177 of file firmware.c.

void* unifi_fw_open_buffer ( void ospriv,
void fwbuf,
u32  len 
)

Ask OS layer for a handle to a dynamically allocated firmware buffer (primarily intended for production test images which may need conversion)

Parameters
osprivthe OS layer context.
fwbufpointer to dynamically allocated buffer
lenlength of provided buffer in bytes

Definition at line 143 of file firmware.c.

s32 unifi_fw_read ( void ospriv,
void arg,
u32  offset,
void buf,
u32  len 
)

Ask the OS layer to return a portion from a f/w file.

Parameters
osprivthe OS layer context.
argthe OS pointer returned by unifi_fw_read_start().
offsetthe offset in the f/w file to read the read from.
bufthe buffer to store the returned data.
lenthe size in bytes of the requested read.

Definition at line 200 of file firmware.c.

void* unifi_fw_read_start ( void ospriv,
s8  is_fw,
const card_info_t info 
)

Ask the OS layer to initialise a read from a f/w file.

Parameters
osprivthe OS layer context.
is_fwif 0 the request if for the loader file, if 1 the request is for a f/w file.
infoa card_info_t structure containing versions information. Note that some members of the structure may not be initialised.
Returns
NULL if the file is not available, or a pointer which contains OS specific information for the file (typically the contents of the file) that the HIP core uses when calling unifi_fw_read() and unifi_fw_read_stop()

Definition at line 60 of file firmware.c.

void unifi_fw_read_stop ( void ospriv,
void dlpriv 
)

Ask the OS layer to finish reading from a f/w file.

Parameters
osprivthe OS layer context.
dlprivthe OS pointer returned by unifi_fw_read_start().

Definition at line 104 of file firmware.c.

CSR_PRIORITY unifi_get_default_downgrade_priority ( unifi_TrafficQueue  queue)

Returns the priority corresponding to a particular Queue when that is used when downgrading a packet to a lower AC. Helps maintain uniformity in queue - priority mapping between the HIP and the OS layers.

Parameters
queue
Returns
Highest priority corresponding to this queue

Definition at line 51 of file csr_wifi_hip_send.c.

CsrResult unifi_init_card ( card_t card,
s32  led_mask 
)

Initialise the UniFi chip.

Parameters
cardthe HIP core lib API context.
led_maskthe led mask to apply to UniFi.
Returns
0 if UniFi is initialized.
-CSR_EIO if an I/O error occured while initializing UniFi
-CSR_ENODEV if the card is no longer present.

Definition at line 170 of file csr_wifi_hip_card_sdio.c.

void unifi_pause_xmit ( void ospriv,
unifi_TrafficQueue  queue 
)

Flow control callbacks. unifi_pause_xmit() is called when the HIP core lib does not have any resources to store data packets. The OS layer needs to pause the Tx data plane until unifi_restart_xmit() is called.

Parameters
osprivthe OS layer context.

Definition at line 1875 of file netdev.c.

void unifi_receive_event ( void ospriv,
u8 sigdata,
u32  siglen,
const bulk_data_param_t bulkdata 
)

Delivers a signal received from UniFi to the OS layer. Normally, the data signals should be delivered to the data plane and all the rest to the SME (unifi_sys_hip_ind()).

Note that the OS layer is responsible for freeing the bulkdata buffers, using unifi_net_data_free().

Parameters
osprivthe OS layer context.
sigptrpointer to the signal.
siglensize of the signal.
bulkdatapointer to the bulk data associated with the signal.

Definition at line 649 of file unifi_event.c.

CsrResult unifi_run_bh ( void ospriv)

Request to run the Bottom-Half. The HIP core lib calls this function to request that unifi_bh() needs to be run by the OS layer. It can be called anytime, i.e. when the unifi_bh() is running. Since unifi_bh() is not re-entrant, usually unifi_run_bh() sets an event to a thread that schedules a call to unifi_bh().

Parameters
osprivthe OS layer context.

Definition at line 372 of file bh.c.

CsrResult unifi_send_resources_available ( card_t card,
const u8 sigptr 
)

Check if the HIP core lib has resources to send a signal. Normally there no need to use this function.

Parameters
cardthe HIP core lib API context.
sigptrpointer to the signal.
Returns
0 if there are resources for the signal.
-CSR_ENOSPC if there are not enough resources

Definition at line 381 of file csr_wifi_hip_send.c.

CsrResult unifi_send_signal ( card_t card,
const u8 sigptr,
u32  siglen,
const bulk_data_param_t bulkdata 
)

Send a signal to UniFi. Normally it is called from unifi_sys_hip_req() and the OS layer Tx data plane.

Note that the bulkdata buffers ownership is passed to the HIP core lib. These buffers must be allocated using unifi_net_data_malloc().

Parameters
cardthe HIP core lib API context.
sigptrpointer to the signal.
siglensize of the signal.
bulkdatapointer to the bulk data associated with the signal.
Returns
0 signal is sent.
-CSR_EIO if an error occured while sending the signal
-CSR_ENODEV if the card is no longer present.

Definition at line 301 of file csr_wifi_hip_send.c.

void unifi_ta_classification ( card_t card,
CsrWifiRouterCtrlTrafficType  traffic_type,
u16  period 
)

Notify the HIP core lib for a detected Traffic Classification. Typically, the SME is responsible for configuring these parameters, so unifi_sys_traffic_classification_req() is usually implemented as a direct call to unifi_ta_classification().

Parameters
cardthe HIP core context.
traffic_typethe detected traffic type.
periodThe detected period of the traffic.

Definition at line 531 of file csr_wifi_hip_ta_sampling.c.

CsrResult unifi_ta_configure ( card_t card,
CsrWifiRouterCtrlTrafficConfigType  config_type,
const CsrWifiRouterCtrlTrafficConfig config 
)

Configure the Traffic Analysis sampling

Enable or disable statistics gathering. Enable or disable particular packet detection.

Parameters
cardthe HIP core context
config_typethe item to configure
configpointer to struct containing config info
Returns
0 if configuration was successful
-CSR_EINVAL if a parameter had an invalid value

Definition at line 480 of file csr_wifi_hip_ta_sampling.c.

void unifi_ta_indicate_protocol ( void ospriv,
CsrWifiRouterCtrlTrafficPacketType  packet_type,
CsrWifiRouterCtrlProtocolDirection  direction,
const CsrWifiMacAddress src_addr 
)

Indicates a detected packet of type packet_type. Typically, this information is processed by the SME so unifi_ta_indicate_protocol() needs to schedule a call to unifi_sys_traffic_protocol_ind().

Parameters
osprivthe OS layer context.
packet_typethe detected packet type.
directionthe direction of the packet (Rx, Tx).
src_addrthe source address of the packet.

Definition at line 363 of file sme_native.c.

void unifi_ta_indicate_sampling ( void ospriv,
CsrWifiRouterCtrlTrafficStats stats 
)

Indicates statistics for the sample data over a period. Typically, this information is processed by the SME so unifi_ta_indicate_sampling() needs to schedule a call to unifi_sys_traffic_sample_ind().

Parameters
osprivthe OS layer context.
statsthe pointer to the structure that contains the statistics.

Definition at line 386 of file sme_native.c.

void unifi_ta_sample ( card_t card,
CsrWifiRouterCtrlProtocolDirection  direction,
const bulk_data_desc_t data,
const u8 saddr,
const u8 sta_macaddr,
u32  timestamp,
u16  rate 
)

Pass a packet for Traffic Analysis sampling

Parameters
cardthe HIP core context
directionthe direction (Rx or Tx) of the frame.
datapointer to bulkdata struct containing the packet
saddrthe source address of the packet
sta_macaddrthe MAC address of the UniFi chip
timestampthe current time in msecs

Definition at line 344 of file csr_wifi_hip_ta_sampling.c.