if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out_unlock;
- }
-
buf_size = min(count, len - 1);
if (copy_from_user(buf, user_buf, buf_size)) {
ret = -EFAULT;
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out_unlock;
- }
-
ret = lbs_cmd_802_11_sleep_params(priv, CMD_ACT_GET, &sp);
if (ret)
goto out_unlock;
u8 freq;
int events = 0;
- if (!lbs_is_cmd_allowed(priv))
- return -EBUSY;
-
buf = (char *)get_zeroed_page(GFP_KERNEL);
if (!buf)
return -ENOMEM;
char *buf;
int ret;
- if (!lbs_is_cmd_allowed(priv))
- return -EBUSY;
-
buf = (char *)get_zeroed_page(GFP_KERNEL);
if (!buf)
return -ENOMEM;
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- free_page(addr);
- return -EBUSY;
- }
-
offval.offset = priv->mac_offset;
offval.value = 0;
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- res = -EBUSY;
- goto out_unlock;
- }
-
buf_size = min(count, len - 1);
if (copy_from_user(buf, userbuf, buf_size)) {
res = -EFAULT;
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- free_page(addr);
- return -EBUSY;
- }
-
offval.offset = priv->bbp_offset;
offval.value = 0;
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- res = -EBUSY;
- goto out_unlock;
- }
-
buf_size = min(count, len - 1);
if (copy_from_user(buf, userbuf, buf_size)) {
res = -EFAULT;
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- free_page(addr);
- return -EBUSY;
- }
-
offval.offset = priv->rf_offset;
offval.value = 0;
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- res = -EBUSY;
- goto out_unlock;
- }
-
buf_size = min(count, len - 1);
if (copy_from_user(buf, userbuf, buf_size)) {
res = -EFAULT;
}
/**
- * @brief This function checks if the command is allowed.
- *
- * @param priv A pointer to lbs_private structure
- * @return allowed or not allowed.
- */
-
-int lbs_is_cmd_allowed(struct lbs_private *priv)
-{
- int ret = 1;
-
- lbs_deb_enter(LBS_DEB_WEXT);
-
- if (!priv->is_auto_deep_sleep_enabled) {
- if (priv->is_deep_sleep) {
- lbs_deb_wext("IOCTLS called when station"
- "is in deep sleep\n");
- ret = 0;
- }
- }
-
- lbs_deb_leave(LBS_DEB_WEXT);
- return ret;
-}
-
-
-/**
* @brief Find the channel frequency power info with specific channel
*
* @param priv A pointer to struct lbs_private structure
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- lbs_deb_leave(LBS_DEB_WEXT);
- return -EBUSY;
- }
-
cfp = lbs_find_cfp_by_band_and_channel(priv, 0,
priv->curbssparams.channel);
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
if (vwrq->disabled)
val = MRVDRV_RTS_MAX_VALUE;
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_RTS_THRESHOLD, &val);
if (ret)
goto out;
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
if (vwrq->disabled)
val = MRVDRV_FRAG_MAX_VALUE;
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_FRAG_THRESHOLD, &val);
if (ret)
goto out;
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
if (!priv->radio_on) {
lbs_deb_wext("tx power off\n");
vwrq->value = 0;
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
if ((vwrq->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
return -EOPNOTSUPP;
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
vwrq->disabled = 0;
if (vwrq->flags & IW_RETRY_LONG) {
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv))
- return NULL;
-
priv->wstats.status = priv->mode;
/* If we're not associated, all quality values are meaningless */
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
mutex_lock(&priv->lock);
assoc_req = lbs_get_association_request(priv);
if (!assoc_req) {
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
lbs_deb_wext("vwrq->value %d\n", vwrq->value);
lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed);
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- lbs_deb_leave(LBS_DEB_WEXT);
- return -EBUSY;
- }
-
if (priv->connect_status == LBS_CONNECTED) {
vwrq->value = priv->cur_rate * 500000;
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
if ( (*uwrq != IW_MODE_ADHOC)
&& (*uwrq != IW_MODE_INFRA)
&& (*uwrq != IW_MODE_AUTO)) {
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
mutex_lock(&priv->lock);
assoc_req = lbs_get_association_request(priv);
if (!assoc_req) {
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
mutex_lock(&priv->lock);
assoc_req = lbs_get_association_request(priv);
if (!assoc_req) {
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
mutex_lock(&priv->lock);
assoc_req = lbs_get_association_request(priv);
if (!assoc_req) {
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
switch (dwrq->flags & IW_AUTH_INDEX) {
case IW_AUTH_KEY_MGMT:
dwrq->value = priv->secinfo.key_mgmt;
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
if (vwrq->disabled) {
lbs_set_radio(priv, RADIO_PREAMBLE_AUTO, 0);
goto out;
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
if (!priv->radio_on) {
ret = -EINVAL;
goto out;
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
if (!priv->radio_on)
return -EINVAL;