Lines Matching +full:mode +full:- +full:capable

1 // SPDX-License-Identifier: GPL-2.0-or-later
28 int ret = -EINVAL, res; in get_integer()
61 return -EINVAL; in get_boolean()
71 if (!capable(CAP_NET_ADMIN)) in b43legacy_attr_interfmode_show()
72 return -EPERM; in b43legacy_attr_interfmode_show()
74 mutex_lock(&wldev->wl->mutex); in b43legacy_attr_interfmode_show()
76 switch (wldev->phy.interfmode) { in b43legacy_attr_interfmode_show()
82 count = snprintf(buf, PAGE_SIZE, "1 (Non-WLAN Interference" in b43legacy_attr_interfmode_show()
93 mutex_unlock(&wldev->wl->mutex); in b43legacy_attr_interfmode_show()
105 int mode; in b43legacy_attr_interfmode_store() local
107 if (!capable(CAP_NET_ADMIN)) in b43legacy_attr_interfmode_store()
108 return -EPERM; in b43legacy_attr_interfmode_store()
110 mode = get_integer(buf, count); in b43legacy_attr_interfmode_store()
111 switch (mode) { in b43legacy_attr_interfmode_store()
113 mode = B43legacy_INTERFMODE_NONE; in b43legacy_attr_interfmode_store()
116 mode = B43legacy_INTERFMODE_NONWLAN; in b43legacy_attr_interfmode_store()
119 mode = B43legacy_INTERFMODE_MANUALWLAN; in b43legacy_attr_interfmode_store()
122 mode = B43legacy_INTERFMODE_AUTOWLAN; in b43legacy_attr_interfmode_store()
125 return -EINVAL; in b43legacy_attr_interfmode_store()
128 mutex_lock(&wldev->wl->mutex); in b43legacy_attr_interfmode_store()
129 spin_lock_irqsave(&wldev->wl->irq_lock, flags); in b43legacy_attr_interfmode_store()
131 err = b43legacy_radio_set_interference_mitigation(wldev, mode); in b43legacy_attr_interfmode_store()
133 b43legacyerr(wldev->wl, "Interference Mitigation not " in b43legacy_attr_interfmode_store()
135 spin_unlock_irqrestore(&wldev->wl->irq_lock, flags); in b43legacy_attr_interfmode_store()
136 mutex_unlock(&wldev->wl->mutex); in b43legacy_attr_interfmode_store()
152 if (!capable(CAP_NET_ADMIN)) in b43legacy_attr_preamble_show()
153 return -EPERM; in b43legacy_attr_preamble_show()
155 mutex_lock(&wldev->wl->mutex); in b43legacy_attr_preamble_show()
157 if (wldev->short_preamble) in b43legacy_attr_preamble_show()
164 mutex_unlock(&wldev->wl->mutex); in b43legacy_attr_preamble_show()
177 if (!capable(CAP_NET_ADMIN)) in b43legacy_attr_preamble_store()
178 return -EPERM; in b43legacy_attr_preamble_store()
183 mutex_lock(&wldev->wl->mutex); in b43legacy_attr_preamble_store()
184 spin_lock_irqsave(&wldev->wl->irq_lock, flags); in b43legacy_attr_preamble_store()
186 wldev->short_preamble = !!value; in b43legacy_attr_preamble_store()
188 spin_unlock_irqrestore(&wldev->wl->irq_lock, flags); in b43legacy_attr_preamble_store()
189 mutex_unlock(&wldev->wl->mutex); in b43legacy_attr_preamble_store()
200 struct device *dev = wldev->dev->dev; in b43legacy_sysfs_register()
222 struct device *dev = wldev->dev->dev; in b43legacy_sysfs_unregister()