summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/wext.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2009-10-06 19:20:28 -0700
committerJohn W. Linville <linville@tuxdriver.com>2009-10-07 16:39:53 -0400
commit63f275df64dc69a46bbc21e6a68d5506d2da9c51 (patch)
tree4d21f47420f0ef155e9e461512d3c6354019c31c /drivers/net/wireless/libertas/wext.c
parent536b3a7a10c8fd39576a0602bfeca9bbd04658a6 (diff)
downloadblackbird-op-linux-63f275df64dc69a46bbc21e6a68d5506d2da9c51.tar.gz
blackbird-op-linux-63f275df64dc69a46bbc21e6a68d5506d2da9c51.zip
libertas: Use lbs_is_cmd_allowed() check in command handling routines.
lbs_is_cmd_allowed() check is added in __lbs_cmd_async() and lbs_prepare_and_send_command(). The check is removed from other places. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/wext.c')
-rw-r--r--drivers/net/wireless/libertas/wext.c133
1 files changed, 0 insertions, 133 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 38a451edb703..69dd19bf9558 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -46,32 +46,6 @@ static inline void lbs_cancel_association_work(struct lbs_private *priv)
}
/**
- * @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
@@ -193,11 +167,6 @@ static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info,
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);
@@ -308,12 +277,6 @@ static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info,
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;
@@ -335,11 +298,6 @@ static int lbs_get_rts(struct net_device *dev, struct iw_request_info *info,
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;
@@ -362,12 +320,6 @@ static int lbs_set_frag(struct net_device *dev, struct iw_request_info *info,
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;
@@ -389,11 +341,6 @@ static int lbs_get_frag(struct net_device *dev, struct iw_request_info *info,
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;
@@ -443,11 +390,6 @@ static int lbs_get_txpow(struct net_device *dev,
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;
@@ -481,11 +423,6 @@ static int lbs_set_retry(struct net_device *dev, struct iw_request_info *info,
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;
@@ -534,11 +471,6 @@ static int lbs_get_retry(struct net_device *dev, struct iw_request_info *info,
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) {
@@ -907,9 +839,6 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
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 */
@@ -1010,12 +939,6 @@ static int lbs_set_freq(struct net_device *dev, struct iw_request_info *info,
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) {
@@ -1125,11 +1048,6 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
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);
@@ -1188,11 +1106,6 @@ static int lbs_get_rate(struct net_device *dev, struct iw_request_info *info,
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;
@@ -1219,11 +1132,6 @@ static int lbs_set_mode(struct net_device *dev,
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)) {
@@ -1465,12 +1373,6 @@ static int lbs_set_encode(struct net_device *dev,
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) {
@@ -1654,12 +1556,6 @@ static int lbs_set_encodeext(struct net_device *dev,
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) {
@@ -1872,12 +1768,6 @@ static int lbs_set_auth(struct net_device *dev,
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) {
@@ -1980,12 +1870,6 @@ static int lbs_get_auth(struct net_device *dev,
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;
@@ -2028,11 +1912,6 @@ static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info,
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;
@@ -2152,12 +2031,6 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info,
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;
@@ -2285,12 +2158,6 @@ static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info,
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;
OpenPOWER on IntegriCloud