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 "1 (Non-WLAN Interference Mitigation)\n"); in b43legacy_attr_interfmode_show()
91 mutex_unlock(&wldev->wl->mutex); in b43legacy_attr_interfmode_show()
103 int mode; in b43legacy_attr_interfmode_store() local
105 if (!capable(CAP_NET_ADMIN)) in b43legacy_attr_interfmode_store()
106 return -EPERM; in b43legacy_attr_interfmode_store()
108 mode = get_integer(buf, count); in b43legacy_attr_interfmode_store()
109 switch (mode) { in b43legacy_attr_interfmode_store()
111 mode = B43legacy_INTERFMODE_NONE; in b43legacy_attr_interfmode_store()
114 mode = B43legacy_INTERFMODE_NONWLAN; in b43legacy_attr_interfmode_store()
117 mode = B43legacy_INTERFMODE_MANUALWLAN; in b43legacy_attr_interfmode_store()
120 mode = B43legacy_INTERFMODE_AUTOWLAN; in b43legacy_attr_interfmode_store()
123 return -EINVAL; in b43legacy_attr_interfmode_store()
126 mutex_lock(&wldev->wl->mutex); in b43legacy_attr_interfmode_store()
127 spin_lock_irqsave(&wldev->wl->irq_lock, flags); in b43legacy_attr_interfmode_store()
129 err = b43legacy_radio_set_interference_mitigation(wldev, mode); in b43legacy_attr_interfmode_store()
131 b43legacyerr(wldev->wl, "Interference Mitigation not " in b43legacy_attr_interfmode_store()
133 spin_unlock_irqrestore(&wldev->wl->irq_lock, flags); in b43legacy_attr_interfmode_store()
134 mutex_unlock(&wldev->wl->mutex); in b43legacy_attr_interfmode_store()
150 if (!capable(CAP_NET_ADMIN)) in b43legacy_attr_preamble_show()
151 return -EPERM; in b43legacy_attr_preamble_show()
153 mutex_lock(&wldev->wl->mutex); in b43legacy_attr_preamble_show()
155 if (wldev->short_preamble) in b43legacy_attr_preamble_show()
160 mutex_unlock(&wldev->wl->mutex); in b43legacy_attr_preamble_show()
173 if (!capable(CAP_NET_ADMIN)) in b43legacy_attr_preamble_store()
174 return -EPERM; in b43legacy_attr_preamble_store()
179 mutex_lock(&wldev->wl->mutex); in b43legacy_attr_preamble_store()
180 spin_lock_irqsave(&wldev->wl->irq_lock, flags); in b43legacy_attr_preamble_store()
182 wldev->short_preamble = !!value; in b43legacy_attr_preamble_store()
184 spin_unlock_irqrestore(&wldev->wl->irq_lock, flags); in b43legacy_attr_preamble_store()
185 mutex_unlock(&wldev->wl->mutex); in b43legacy_attr_preamble_store()
196 struct device *dev = wldev->dev->dev; in b43legacy_sysfs_register()
218 struct device *dev = wldev->dev->dev; in b43legacy_sysfs_unregister()