static void event_to_unifi_sys_hip_ind(FsmContext* context, CsrUint8* inputbuffer, CsrUint16 length) { CsrUint8* buffer = &inputbuffer[6]; UnifiSysHipInd_Evt evt; evt.mlmeCommandLength = event_unpack_CsrUint16(&buffer); evt.mlmeCommand = NULL; if (evt.mlmeCommandLength) { evt.mlmeCommand = (CsrUint8*)CsrPmalloc(evt.mlmeCommandLength); event_unpack_buffer(&buffer, evt.mlmeCommand, evt.mlmeCommandLength); } evt.dataRef1Length = event_unpack_CsrUint16(&buffer); evt.dataRef1 = NULL; if (evt.dataRef1Length) { evt.dataRef1 = (CsrUint8*)CsrPmalloc(evt.dataRef1Length); event_unpack_buffer(&buffer, evt.dataRef1, evt.dataRef1Length); } evt.dataRef2Length = event_unpack_CsrUint16(&buffer); evt.dataRef2 = NULL; if (evt.dataRef2Length) { evt.dataRef2 = (CsrUint8*)CsrPmalloc(evt.dataRef2Length); event_unpack_buffer(&buffer, evt.dataRef2, evt.dataRef2Length); } unifi_sys_hip_ind(context, evt.mlmeCommandLength, evt.mlmeCommand, evt.dataRef1Length, evt.dataRef1, evt.dataRef2Length, evt.dataRef2); CsrPfree(evt.mlmeCommand); CsrPfree(evt.dataRef1); CsrPfree(evt.dataRef2); }
int sme_queue_message(unifi_priv_t *priv, u8 *buffer, int length) { ul_client_t *pcli; udi_log_t *logptr; udi_msg_t *msgptr; u8 *p; func_enter(); /* Just a sanity check */ if ((buffer == NULL) || (length <= 0)) { return -EINVAL; } pcli = priv->sme_cli; if (pcli == NULL) { CsrPfree(buffer); return -EINVAL; } /* Allocate log structure plus actual signal. */ logptr = (udi_log_t *)kmalloc(sizeof(udi_log_t) + length, GFP_KERNEL); if (logptr == NULL) { unifi_error(priv, "Failed to allocate %d bytes for an SME message\n", sizeof(udi_log_t) + length); CsrPfree(buffer); return -ENOMEM; } /* Fill in udi_log struct */ INIT_LIST_HEAD(&logptr->q); msgptr = &logptr->msg; msgptr->length = sizeof(udi_msg_t) + length; msgptr->signal_length = length; /* Copy signal and bulk data to the log */ p = (u8 *)(msgptr + 1); memcpy(p, buffer, length); /* Add to tail of log queue */ down(&pcli->udi_sem); list_add_tail(&logptr->q, &pcli->udi_log); up(&pcli->udi_sem); /* Wake any waiting user process */ wake_up_interruptible(&pcli->udi_wq); /* It is our responsibility to free the buffer allocated in build_packed_*() */ CsrPfree(buffer); func_exit(); return 0; } /* sme_queue_message() */
int unifi_cfg_wmm_addts(unifi_priv_t *priv, unsigned char *arg) { CsrUint32 addts_tid; CsrUint8 addts_ie_length; CsrUint8 *addts_ie; CsrUint8 *addts_params; unifi_DataBlock tspec; unifi_DataBlock tclas; int rc; addts_params = (CsrUint8*)(((unifi_cfg_command_t*)arg) + 1); if (get_user(addts_tid, (CsrUint32*)addts_params)) { unifi_error(priv, "unifi_cfg_wmm_addts: Failed to get the argument\n"); return -EFAULT; } addts_params += sizeof(CsrUint32); if (get_user(addts_ie_length, (CsrUint8*)addts_params)) { unifi_error(priv, "unifi_cfg_wmm_addts: Failed to get the argument\n"); return -EFAULT; } unifi_trace(priv, UDBG4, "addts: tid = 0x%x ie_length = %d\n", addts_tid, addts_ie_length); addts_ie = CsrPmalloc(addts_ie_length); if (addts_ie == NULL) { unifi_error(priv, "unifi_cfg_wmm_addts: Failed to malloc %d bytes for addts_ie buffer\n", addts_ie_length); return -ENOMEM; } addts_params += sizeof(CsrUint8); rc = copy_from_user(addts_ie, addts_params, addts_ie_length); if (rc) { unifi_error(priv, "unifi_cfg_wmm_addts: Failed to get the addts buffer\n"); CsrPfree(addts_ie); return -EFAULT; } tspec.data = addts_ie; tspec.length = addts_ie_length; tclas.data = NULL; tclas.length = 0; rc = sme_mgt_tspec(priv, unifi_ListActionAdd, addts_tid, &tspec, &tclas); CsrPfree(addts_ie); return rc; }
/** * @brief * This function handles asynchronous signals to indicate to the main * loop that a shutdown has been requested. * * @par Description: * This function is a handler for caught signals that indicate the process * should be shut down. Pre-shutdown preparation is done and then exit() is * called to terminate. * * @param[in] signum: The number of the signal to handle * * @return * void * * @todo Exit should not be called from an asynchronous signal * handler, rather it should set a flag that calls exit from the main * thread */ static void handleExit(void) { if (!linuxContext) return; #ifdef CUSTOM_UNIFI_NME_SYS_EAPOL_REQ csr_wpa_loopback_deinit(); #endif (void) signalCommon(); CsrPfree(getMainData(linuxContext)); CsrPfree(linuxContext); }
static void ipc_chardevice_disconnect(ipcConnection* con) { sme_trace_entry((TR_IPC, "ipc_disconnect()")); if (con->impl == NULL) return; close(con->impl->fd); #ifdef IPC_TX_THREAD ipc_destroy_thread(con->impl->thread); #endif CsrPfree(con->impl); CsrPfree(con); }
void amp_start_receiver_test_evt(void* context, HciStatusCode status) { CsrUint8* evt; CsrUint16 packedLength = serialise_amp_start_receiver_test_evt(&evt, status); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_data_buffer_overflow_evt(void* context, HciLinkType linkType) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_data_buffer_overflow_evt(&evt, linkType); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_qos_violation_evt(void* context, CsrUint16 handle) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_qos_violation_evt(&evt, handle); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_hardware_error_evt(void* context, CsrUint8 hardwareCode) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_hardware_error_evt(&evt, hardwareCode); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_physical_link_loss_early_warning_evt(void* context, CsrUint8 physicalLinkHandle, LinkLossReasonCode linkLossReason) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_physical_link_loss_early_warning_evt(&evt, physicalLinkHandle, linkLossReason); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_command_complete_evt(void* context, CsrUint8 numHciCommandPackets, const ReturnParameters* returnParameters) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_command_complete_evt(&evt, numHciCommandPackets, returnParameters); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_command_status_evt(void* context, HciStatusCode status, CsrUint8 numHciCommandPackets, HciOpcode commandOpcode) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_command_status_evt(&evt, status, numHciCommandPackets, commandOpcode); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_flow_spec_modify_complete_evt(void* context, HciStatusCode status, CsrUint16 handle) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_flow_spec_modify_complete_evt(&evt, status, handle); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_disconnect_logical_link_complete_evt(void* context, HciStatusCode status, CsrUint16 logicalLinkHandle, CsrUint8 reason) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_disconnect_logical_link_complete_evt(&evt, status, logicalLinkHandle, reason); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void amp_transmit_power_evt(void* context, HciStatusCode status, PowerLevel powerLevel) { CsrUint8* evt; CsrUint16 packedLength = serialise_amp_transmit_power_evt(&evt, status, powerLevel); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_generic_amp_link_key_nt(void* context, const BdAddr* bdAddr, const GenericAmpLinkKey* genericAmpLinkKey, LinkKeyType keyType) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_generic_amp_link_key_nt(&evt, bdAddr, genericAmpLinkKey, keyType); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_amp_status_change_evt(void* context, HciStatusCode status, AmpStatus ampStatus) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_amp_status_change_evt(&evt, status, ampStatus); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_short_range_mode_change_complete_evt(void* context, HciStatusCode status, CsrUint8 physicalLinkHandle, ShortRangeMode shortRangeModeState) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_short_range_mode_change_complete_evt(&evt, status, physicalLinkHandle, shortRangeModeState); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_number_of_completed_data_blocks_evt(void* context, CsrUint16 totalNumDataBlocks, CsrUint8 numberOfHandles, CsrUint16 handle, CsrUint16 numberOfCompletedPackets, CsrUint16 numberOfCompletedBlocks) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_number_of_completed_data_blocks_evt(&evt, totalNumDataBlocks, numberOfHandles, handle, numberOfCompletedPackets, numberOfCompletedBlocks); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void amp_receiver_report_evt(void* context, CsrUint8 ampReport) { CsrUint8* evt; CsrUint16 packedLength = serialise_amp_receiver_report_evt(&evt, ampReport); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_physical_link_recovery_evt(void* context, CsrUint8 physicalLinkHandle) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_physical_link_recovery_evt(&evt, physicalLinkHandle); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_loopback_command_evt(void* context, HciCommandPacket hciCommandPacket) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_loopback_command_evt(&evt, hciCommandPacket); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void hci_enhanced_flush_complete_evt(void* context, CsrUint16 handle) { CsrUint8* evt; CsrUint16 packedLength = serialise_hci_enhanced_flush_complete_evt(&evt, handle); (void)ipc_message_send(get_pal_hci_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
/* -------------------------------------------------------------------------- * * Releases all resources allocated by pld_init(). */ void pld_shutdown(PldContext* context) { #ifdef FSM_MUTEX_ENABLE (void)CsrMutexLock(context->payloadLock); #endif sme_trace_entry((TR_PAYLOAD_MGR, "pld_shutdown()")); #ifdef SME_TRACE_ENABLE /* Display payload usage statistics */ pld_dump_stats(context); /* Display the owners of any remaining payloads (suggesting that other * parts of the SME have not cleaned up properly) */ pld_dump_owners(context); #endif /* This will delete the buffers as well */ csr_list_clear(&context->payloads); #ifdef FSM_MUTEX_ENABLE (void)CsrMutexUnlock(context->payloadLock); #endif #ifdef FSM_MUTEX_ENABLE CsrMutexDestroy(context->payloadLock); #endif CsrPfree(context); }
void unifi_nme_mgt_wifi_on_req(void* context, void* appHandle, const unifi_MACAddress *address, CsrUint16 mibFilesCount, const unifi_DataBlock *mibFiles) { CsrUint8* evt; CsrUint16 packedLength = serialise_unifi_nme_mgt_wifi_on_req(&evt, appHandle, address, mibFilesCount, mibFiles); (void)ipc_message_send(get_csr_wifi_nme_mgt_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void unifi_nme_mgt_connect_req(void* context, void* appHandle, const unifi_ConnectionConfig *connectionConfig) { CsrUint8* evt; CsrUint16 packedLength = serialise_unifi_nme_mgt_connect_req(&evt, appHandle, connectionConfig); (void)ipc_message_send(get_csr_wifi_nme_mgt_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void unifi_nme_mgt_event_mask_set_req(void* context, void* appHandle, CsrUint32 indMask) { CsrUint8* evt; CsrUint16 packedLength = serialise_unifi_nme_mgt_event_mask_set_req(&evt, appHandle, indMask); (void)ipc_message_send(get_csr_wifi_nme_mgt_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void unifi_nme_mgt_mib_get_next_req(void* context, void* appHandle, CsrUint16 mibAttributeLength, const CsrUint8 *mibAttribute) { CsrUint8* evt; CsrUint16 packedLength = serialise_unifi_nme_mgt_mib_get_next_req(&evt, appHandle, mibAttributeLength, mibAttribute); (void)ipc_message_send(get_csr_wifi_nme_mgt_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void unifi_nme_mgt_key_req(void* context, void* appHandle, unifi_ListAction action, const unifi_Key *key) { CsrUint8* evt; CsrUint16 packedLength = serialise_unifi_nme_mgt_key_req(&evt, appHandle, action, key); (void)ipc_message_send(get_csr_wifi_nme_mgt_ipc_connection(context), evt, packedLength); CsrPfree(evt); }
void unifi_nme_mgt_get_value_req(void* context, void* appHandle, unifi_AppValueId appValueId) { CsrUint8* evt; CsrUint16 packedLength = serialise_unifi_nme_mgt_get_value_req(&evt, appHandle, appValueId); (void)ipc_message_send(get_csr_wifi_nme_mgt_ipc_connection(context), evt, packedLength); CsrPfree(evt); }