rdev_flush_pmksa
时间: 2023-06-21 22:03:43 浏览: 57
rdev_flush_pmksa是一个Linux内核中的函数,用于清除与特定无线网络相关联的PMKSA缓存条目。PMKSA是Pairwise Master Key Security Association的缩写,它是一种在Wi-Fi网络中使用的安全协议,用于在客户端和接入点之间建立双向认证和加密连接。rdev_flush_pmksa函数是在无线网络接口设备被关闭时调用的,以确保在下次重新连接到该网络时不会使用过时的PMKSA缓存。
相关问题
regulator_set_voltage函数成员
regulator_set_voltage函数的成员可能因芯片厂商和芯片型号而异,但通常包括以下参数:
1. struct regulator_dev *rdev:指向电压稳压器设备的指针,用于标识要设置的电压稳压器。
2. int min_uV:设置稳压器的最小输出电压,单位为微伏(uV)。
3. int max_uV:设置稳压器的最大输出电压,单位为微伏(uV)。
4. unsigned int *selector:指向一个无符号整型变量的指针,用于指定电压稳压器的输出电压编号,有些芯片可以支持多组输出电压,通过编号来选择不同的输出电压。
5. int num_selectors:指定电压稳压器的输出电压编号数量,有些芯片可以支持多组输出电压,通过数量来指定支持的输出电压编号数量。
该函数的返回值通常为0表示成功,其他返回值表示失败。
cfg80211_remain_on_channel代码具体实现
cfg80211_remain_on_channel函数的具体实现代码如下:
```
int cfg80211_remain_on_channel(struct wiphy *wiphy,
struct net_device *dev,
struct ieee80211_channel *chan,
unsigned int duration,
u64 *cookie)
{
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
struct cfg80211_roc_request *roc_req;
int err;
if (!rdev->ops->remain_on_channel)
return -EOPNOTSUPP;
roc_req = kzalloc(sizeof(*roc_req), GFP_KERNEL);
if (!roc_req)
return -ENOMEM;
roc_req->cookie = get_wiphy_cookie(wiphy);
roc_req->wdev = dev_to_wdev(dev);
roc_req->chan = chan;
roc_req->duration = duration;
roc_req->aborted = false;
roc_req->wait = wait_event_interruptible(rdev->roc_wait, roc_req->aborted);
if (roc_req->wait < 0) {
/* user cancelled */
kfree(roc_req);
return roc_req->wait;
}
err = rdev_remain_on_channel(rdev, roc_req);
if (err) {
kfree(roc_req);
return err;
}
*cookie = roc_req->cookie;
return 0;
}
```
在此实现中,首先检查设备是否支持ROC功能。如果不支持,则返回-EOPNOTSUPP。如果支持ROC,则会创建一个新的cfg80211_roc_request结构体,该结构体用于保存ROC请求信息。然后,会将ROC请求添加到设备的ROC请求列表中,并调用驱动程序的remain_on_channel函数启动ROC操作。最后,会等待ROC操作完成,并将ROC请求从设备的ROC请求列表中删除。
需要注意的是,实际的ROC操作是由驱动程序完成的,因此具体的实现方式可能会因不同的硬件平台而有所不同。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)