Lines Matching +full:mode +full:- +full:capable
1 // SPDX-License-Identifier: GPL-2.0-or-later
26 int ret = -EINVAL; in get_integer()
44 if (!capable(CAP_NET_ADMIN)) in b43_attr_interfmode_show()
45 return -EPERM; in b43_attr_interfmode_show()
47 mutex_lock(&wldev->wl->mutex); in b43_attr_interfmode_show()
49 if (wldev->phy.type != B43_PHYTYPE_G) { in b43_attr_interfmode_show()
50 mutex_unlock(&wldev->wl->mutex); in b43_attr_interfmode_show()
51 return -ENOSYS; in b43_attr_interfmode_show()
54 switch (wldev->phy.g->interfmode) { in b43_attr_interfmode_show()
63 "1 (Non-WLAN Interference Mitigation)\n"); in b43_attr_interfmode_show()
74 mutex_unlock(&wldev->wl->mutex); in b43_attr_interfmode_show()
85 int mode; in b43_attr_interfmode_store() local
87 if (!capable(CAP_NET_ADMIN)) in b43_attr_interfmode_store()
88 return -EPERM; in b43_attr_interfmode_store()
90 mode = get_integer(buf, count); in b43_attr_interfmode_store()
91 switch (mode) { in b43_attr_interfmode_store()
93 mode = B43_INTERFMODE_NONE; in b43_attr_interfmode_store()
96 mode = B43_INTERFMODE_NONWLAN; in b43_attr_interfmode_store()
99 mode = B43_INTERFMODE_MANUALWLAN; in b43_attr_interfmode_store()
102 mode = B43_INTERFMODE_AUTOWLAN; in b43_attr_interfmode_store()
105 return -EINVAL; in b43_attr_interfmode_store()
108 mutex_lock(&wldev->wl->mutex); in b43_attr_interfmode_store()
110 if (wldev->phy.ops->interf_mitigation) { in b43_attr_interfmode_store()
111 err = wldev->phy.ops->interf_mitigation(wldev, mode); in b43_attr_interfmode_store()
113 b43err(wldev->wl, "Interference Mitigation not " in b43_attr_interfmode_store()
117 err = -ENOSYS; in b43_attr_interfmode_store()
119 mutex_unlock(&wldev->wl->mutex); in b43_attr_interfmode_store()
129 struct device *dev = wldev->dev->dev; in b43_sysfs_register()
138 struct device *dev = wldev->dev->dev; in b43_sysfs_unregister()