I have a pointer to a data buffer in user space mode, and now I want to copy the value of that data to kernel mode with "copy_from_user" function.
Assume that my data pointer is "data.ptr.buffer" and it's size is "data_size". the declaration of "data.ptr.buffer" is : const void *buffer;
Now, how I can declare and allocate memory to it in kernel mode to get data buffer value in kernel mode? my "copy_from_user" call is something like :
copy_from_user(data_value, data.ptr.buffer, data_size)
In other words I want to know how I can declare data_value parameter and allocate memory to it (e.g kzalloc,...)?