user:
use command such as NL80211_CMD_GET_KEY in netlink socket to kernel.
driver:
wiphy_new(&xx_cfg80211_ops, size);(need to pad struct cfg80211_ops xx_cfg80211_ops)---->create struct cfg80211_registered_device *rdev, rdev->ops = &xx_cfg80211_ops.
kernel:
net/wireless/nl80211.c
static struct genl_ops nl80211_ops[]
{
.cmd = NL80211_CMD_GET_KEY,
.doit = nl80211_get_key,
.policy = nl80211_policy,
.flags = GENL_ADMIN_PERM,
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
NL80211_FLAG_NEED_RTNL,
}
nl80211_get_key--->rdev_get_key---->net/wireless/rdev-ops.h(rdev->ops->get_key), and call api defined in driver.
use command such as NL80211_CMD_GET_KEY in netlink socket to kernel.
driver:
wiphy_new(&xx_cfg80211_ops, size);(need to pad struct cfg80211_ops xx_cfg80211_ops)---->create struct cfg80211_registered_device *rdev, rdev->ops = &xx_cfg80211_ops.
kernel:
net/wireless/nl80211.c
static struct genl_ops nl80211_ops[]
{
.cmd = NL80211_CMD_GET_KEY,
.doit = nl80211_get_key,
.policy = nl80211_policy,
.flags = GENL_ADMIN_PERM,
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
NL80211_FLAG_NEED_RTNL,
}
nl80211_get_key--->rdev_get_key---->net/wireless/rdev-ops.h(rdev->ops->get_key), and call api defined in driver.