void **platform_data
时间: 2023-08-23 18:07:52 浏览: 32
void **platform_data 是一个指向指针的指针,用于返回初始化后的平台数据结构体指针。在函数调用完成后,*platform_data 将指向一个指针,该指针指向一个平台数据结构体。该平台数据结构体将保存 cfg80211 子系统的一些信息,例如 Wi-Fi 设备的类型、硬件地址等。通过 platform_data 可以在其他函数中使用这些信息,例如注册 Wi-Fi 设备或者监听 Wi-Fi 事件等。
相关问题
ecrnx_cfg80211_init(void *ecrnx_plat, void **platform_data)
这是一个用于初始化 Linux 内核中的 cfg80211 子系统的函数调用。其中,ecrnx_plat 是一个指向自定义平台数据的指针,platform_data 则是一个用于返回初始化后的平台数据结构体指针的指针。该函数将会完成 cfg80211 子系统的初始化,并返回 0 表示初始化成功,否则返回一个错误码。在初始化成功后,platform_data 将用于管理 cfg80211 子系统的一些操作,例如注册 Wi-Fi 设备和监听 Wi-Fi 事件等。
from void * to in
`void*` is a pointer type in C and C++ that can hold any memory address. It is often used when writing functions or data structures that need to be generic and work with different types of data.
In order to convert a `void*` pointer to an `int` in C or C++, you should first cast the `void*` to a pointer of the appropriate type, and then dereference it to get the value. For example:
```
void* ptr = ...; // some void* pointer
int* int_ptr = (int*)ptr; // cast to int*
int value = *int_ptr; // dereference to get the int value
```
Note that this conversion is not always safe, since the size and representation of pointers and integers can vary depending on the platform and compiler. You should only perform this conversion if you are certain that the pointer actually points to an integer value.