* memory is not available to the o/s at all.
*/
if (!(*dma_ctx)->secure_dma && dma->out_map_array) {
-
for (count = 0; count < dma->out_num_pages; count++) {
dma_unmap_page(&sep->pdev->dev,
dma->out_map_array[count].dma_addr,
/* Again, we do this only for non secure dma */
if (!(*dma_ctx)->secure_dma && dma->out_page_array) {
-
for (count = 0; count < dma->out_num_pages; count++) {
if (!PageReserved(dma->out_page_array[count]))
return 0;
}
-
/**
* sep_release - close a SEP device
* @inode: inode of SEP device
goto end_function;
}
-
/* Add the event to the polling wait table */
dev_dbg(&sep->pdev->dev, "[PID%d] poll: calling wait sep_event\n",
current->pid);
struct timeval time;
u32 *time_addr; /* Address of time as seen by the kernel */
-
do_gettimeofday(&time);
/* Set value in the SYSTEM MEMORY offset */
msg_pool += 1;
if ((*msg_pool < 2) ||
(*msg_pool > SEP_DRIVER_MAX_MESSAGE_SIZE_IN_BYTES)) {
-
dev_warn(&sep->pdev->dev, "invalid message size\n");
error = -EPROTO;
goto end_function;
*dma_maps = sep_dma;
return count_mapped;
-
}
/**
u32 data_size,
enum dma_data_direction direction)
{
-
int ct1;
struct sep_lli_entry *sep_lli;
struct sep_dma_map *sep_map;
(unsigned long)lli_array[0].bus_address,
lli_array[0].block_size);
-
/* Check the size of the last page */
if (num_pages > 1) {
lli_array[num_pages - 1].block_size =
/* Set the output parameter */
*num_processed_entries_ptr += array_counter;
-
}
/**
/* Print entries of the table (without info entry) */
for (entries_count = 0; entries_count < num_table_entries;
entries_count++, lli_table_ptr++) {
-
dev_dbg(&sep->pdev->dev,
"[PID%d] lli_table_ptr address is %08lx\n",
current->pid,
current->pid,
(unsigned long)lli_table_ptr->bus_address);
-
table_data_size = lli_table_ptr->block_size & 0xffffff;
num_table_entries = (lli_table_ptr->block_size >> 24) & 0xff;
#endif
}
-
/**
* sep_prepare_empty_lli_table - create a blank LLI table
* @sep: pointer to struct sep_device
/* Loop till all the entries in in array are processed */
while (current_entry < sep_lli_entries) {
-
/* Set the new input and output tables */
in_lli_table_ptr =
(struct sep_lli_entry *)lli_table_alloc_addr;
((void *)sep->shared_addr +
SYNCHRONIC_DMA_TABLES_AREA_OFFSET_BYTES +
SYNCHRONIC_DMA_TABLES_AREA_SIZE_BYTES)) {
-
error = -ENOMEM;
goto end_function_error;
-
}
/* Update the number of created tables */
¤t_entry, &num_entries_in_table, table_data_size);
if (info_entry_ptr == NULL) {
-
/* Set the output parameters to physical addresses */
*lli_table_ptr = sep_shared_area_virt_to_bus(sep,
dma_in_lli_table_ptr);
end_function:
return error;
-
}
/**
((void *)sep->shared_addr +
SYNCHRONIC_DMA_TABLES_AREA_OFFSET_BYTES +
SYNCHRONIC_DMA_TABLES_AREA_SIZE_BYTES)) {
-
dev_warn(&sep->pdev->dev, "dma table limit overrun\n");
return -ENOMEM;
}
goto end_function_free_lli_in;
}
-
- }
-
- else {
+ } else {
dev_dbg(&sep->pdev->dev, "[PID%d] Locking user input pages\n",
current->pid);
error = sep_lock_user_pages(sep, app_virt_in_addr,
dma_ctx->dma_res_arr[dma_ctx->nr_dcb_creat].out_page_array = NULL;
kfree(lli_out_array);
-
end_function_free_lli_in:
kfree(dma_ctx->dma_res_arr[dma_ctx->nr_dcb_creat].in_map_array);
dma_ctx->dma_res_arr[dma_ctx->nr_dcb_creat].in_map_array = NULL;
kfree(lli_in_array);
end_function:
-
return error;
-
}
/**
dcb_table_ptr->out_vr_tail_pt = 0;
if (isapplet) {
-
/* Check if there is enough data for DMA operation */
if (data_in_size < SEP_DRIVER_MIN_DATA_SIZE_PER_TABLE) {
if (is_kva) {
end_function:
return error;
-
}
-
/**
* sep_free_dma_tables_and_dcb - free DMA tables and DCBs
* @sep: pointer to struct sep_device
end_function:
return error;
-
}
/**
dev_dbg(&sep->pdev->dev, "sep int: IRR REG val: %x\n", reg_val);
if (reg_val & (0x1 << 13)) {
-
/* Lock and update the counter of reply messages */
spin_lock_irqsave(&sep->snd_rply_lck, lock_irq_flag);
sep->reply_ct++;
dev_warn(&sep->pdev->dev, "could not reconfig shared area\n");
dev_warn(&sep->pdev->dev, "result was %x\n", ret_val);
ret_val = -ENOMEM;
- } else
+ } else {
ret_val = 0;
+ }
dev_dbg(&sep->pdev->dev, "reconfig shared area end\n");
end_function:
kfree(dcb_args);
return error;
-
}
/**
end_function:
return error;
-
}
/**
return error;
}
-
/**
* sep_read - Returns results of an operation for fastcall interface
* @filp: File pointer
goto end_function_error;
}
-
/* Wait for SEP to finish */
wait_event(sep->event_interrupt,
test_bit(SEP_WORKING_LOCK_BIT,
goto end_function;
}
-
if (copy_from_user(args, buf_user, sizeof(struct sep_fastcall_hdr))) {
error = -EFAULT;
goto end_function;
goto end_function_error;
}
-
/*
* Prepare contents of the shared area regions for
* the operation into temporary buffers
return error;
}
+
/**
* sep_seek - Handler for seek system call
* @filp: File pointer
return -ENOSYS;
}
-
-
/**
* sep_file_operations - file operation on sep device
* @sep_ioctl: ioctl handler from user space call
if (queue_num > SEP_DOUBLEBUF_USERS_LIMIT)
queue_num = SEP_DOUBLEBUF_USERS_LIMIT;
-
if (count < sizeof(queue_num)
+ (queue_num * sizeof(struct sep_queue_data))) {
spin_unlock_irqrestore(&sep->sep_queue_lock, lck_flags);
return ret_val;
}
-
/**
*sep_probe - probe a matching PCI device
*@pdev: pci_device
*/
static int sep_pm_runtime_resume(struct device *dev)
{
-
u32 retval2;
u32 delay_count;
struct sep_device *sep = sep_dev;