Commit 3044975f authored by Binoy Jayan's avatar Binoy Jayan Committed by Greg Kroah-Hartman

rtl8192e: r8192_priv: Replace semaphore wx_sem with mutex

The semaphore 'wx_sem' in the r8192_priv is a simple mutex,
so it should be written as one. Semaphores are going away in the future.
Signed-off-by: default avatarBinoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9afa9370
...@@ -993,7 +993,7 @@ static void _rtl92e_init_priv_lock(struct r8192_priv *priv) ...@@ -993,7 +993,7 @@ static void _rtl92e_init_priv_lock(struct r8192_priv *priv)
spin_lock_init(&priv->irq_th_lock); spin_lock_init(&priv->irq_th_lock);
spin_lock_init(&priv->rf_ps_lock); spin_lock_init(&priv->rf_ps_lock);
spin_lock_init(&priv->ps_lock); spin_lock_init(&priv->ps_lock);
sema_init(&priv->wx_sem, 1); mutex_init(&priv->wx_mutex);
sema_init(&priv->rf_sem, 1); sema_init(&priv->rf_sem, 1);
mutex_init(&priv->mutex); mutex_init(&priv->mutex);
} }
...@@ -1247,7 +1247,7 @@ static void _rtl92e_if_silent_reset(struct net_device *dev) ...@@ -1247,7 +1247,7 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
RESET_START: RESET_START:
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
if (priv->rtllib->state == RTLLIB_LINKED) if (priv->rtllib->state == RTLLIB_LINKED)
rtl92e_leisure_ps_leave(dev); rtl92e_leisure_ps_leave(dev);
...@@ -1255,7 +1255,7 @@ static void _rtl92e_if_silent_reset(struct net_device *dev) ...@@ -1255,7 +1255,7 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
if (priv->up) { if (priv->up) {
netdev_info(dev, "%s():the driver is not up.\n", netdev_info(dev, "%s():the driver is not up.\n",
__func__); __func__);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return; return;
} }
priv->up = 0; priv->up = 0;
...@@ -1292,7 +1292,7 @@ static void _rtl92e_if_silent_reset(struct net_device *dev) ...@@ -1292,7 +1292,7 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
rtl92e_dm_backup_state(dev); rtl92e_dm_backup_state(dev);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
RT_TRACE(COMP_RESET, RT_TRACE(COMP_RESET,
"%s():<==========down process is finished\n", "%s():<==========down process is finished\n",
__func__); __func__);
...@@ -2179,9 +2179,9 @@ static int _rtl92e_open(struct net_device *dev) ...@@ -2179,9 +2179,9 @@ static int _rtl92e_open(struct net_device *dev)
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
int ret; int ret;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = _rtl92e_try_up(dev); ret = _rtl92e_try_up(dev);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -2206,11 +2206,11 @@ static int _rtl92e_close(struct net_device *dev) ...@@ -2206,11 +2206,11 @@ static int _rtl92e_close(struct net_device *dev)
rtllib_stop_scan(priv->rtllib); rtllib_stop_scan(priv->rtllib);
} }
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = _rtl92e_down(dev, true); ret = _rtl92e_down(dev, true);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
...@@ -2242,11 +2242,11 @@ static void _rtl92e_restart(void *data) ...@@ -2242,11 +2242,11 @@ static void _rtl92e_restart(void *data)
reset_wq); reset_wq);
struct net_device *dev = priv->rtllib->dev; struct net_device *dev = priv->rtllib->dev;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
rtl92e_commit(dev); rtl92e_commit(dev);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
} }
static void _rtl92e_set_multicast(struct net_device *dev) static void _rtl92e_set_multicast(struct net_device *dev)
...@@ -2265,12 +2265,12 @@ static int _rtl92e_set_mac_adr(struct net_device *dev, void *mac) ...@@ -2265,12 +2265,12 @@ static int _rtl92e_set_mac_adr(struct net_device *dev, void *mac)
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
struct sockaddr *addr = mac; struct sockaddr *addr = mac;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ether_addr_copy(dev->dev_addr, addr->sa_data); ether_addr_copy(dev->dev_addr, addr->sa_data);
schedule_work(&priv->reset_wq); schedule_work(&priv->reset_wq);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return 0; return 0;
} }
...@@ -2287,7 +2287,7 @@ static int _rtl92e_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2287,7 +2287,7 @@ static int _rtl92e_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
struct iw_point *p = &wrq->u.data; struct iw_point *p = &wrq->u.data;
struct ieee_param *ipw = NULL; struct ieee_param *ipw = NULL;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
switch (cmd) { switch (cmd) {
case RTL_IOCTL_WPA_SUPPLICANT: case RTL_IOCTL_WPA_SUPPLICANT:
...@@ -2393,7 +2393,7 @@ static int _rtl92e_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2393,7 +2393,7 @@ static int _rtl92e_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
} }
out: out:
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
......
...@@ -375,7 +375,7 @@ struct r8192_priv { ...@@ -375,7 +375,7 @@ struct r8192_priv {
struct tasklet_struct irq_tx_tasklet; struct tasklet_struct irq_tx_tasklet;
struct tasklet_struct irq_prepare_beacon_tasklet; struct tasklet_struct irq_prepare_beacon_tasklet;
struct semaphore wx_sem; struct mutex wx_mutex;
struct semaphore rf_sem; struct semaphore rf_sem;
struct mutex mutex; struct mutex mutex;
......
...@@ -65,11 +65,11 @@ static int _rtl92e_wx_set_rate(struct net_device *dev, ...@@ -65,11 +65,11 @@ static int _rtl92e_wx_set_rate(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_set_rate(priv->rtllib, info, wrqu, extra); ret = rtllib_wx_set_rate(priv->rtllib, info, wrqu, extra);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -84,11 +84,11 @@ static int _rtl92e_wx_set_rts(struct net_device *dev, ...@@ -84,11 +84,11 @@ static int _rtl92e_wx_set_rts(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_set_rts(priv->rtllib, info, wrqu, extra); ret = rtllib_wx_set_rts(priv->rtllib, info, wrqu, extra);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -114,11 +114,11 @@ static int _rtl92e_wx_set_power(struct net_device *dev, ...@@ -114,11 +114,11 @@ static int _rtl92e_wx_set_power(struct net_device *dev,
__func__); __func__);
return 0; return 0;
} }
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_set_power(priv->rtllib, info, wrqu, extra); ret = rtllib_wx_set_power(priv->rtllib, info, wrqu, extra);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -142,11 +142,11 @@ static int _rtl92e_wx_set_rawtx(struct net_device *dev, ...@@ -142,11 +142,11 @@ static int _rtl92e_wx_set_rawtx(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_set_rawtx(priv->rtllib, info, wrqu, extra); ret = rtllib_wx_set_rawtx(priv->rtllib, info, wrqu, extra);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
...@@ -158,12 +158,12 @@ static int _rtl92e_wx_force_reset(struct net_device *dev, ...@@ -158,12 +158,12 @@ static int _rtl92e_wx_force_reset(struct net_device *dev,
{ {
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
RT_TRACE(COMP_DBG, "%s(): force reset ! extra is %d\n", RT_TRACE(COMP_DBG, "%s(): force reset ! extra is %d\n",
__func__, *extra); __func__, *extra);
priv->force_reset = *extra; priv->force_reset = *extra;
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return 0; return 0;
} }
...@@ -177,7 +177,7 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev, ...@@ -177,7 +177,7 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev,
(&(priv->rtllib->PowerSaveControl)); (&(priv->rtllib->PowerSaveControl));
struct rtllib_device *ieee = priv->rtllib; struct rtllib_device *ieee = priv->rtllib;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
RT_TRACE(COMP_POWER, "%s(): %s\n", __func__, (*extra == 6) ? RT_TRACE(COMP_POWER, "%s(): %s\n", __func__, (*extra == 6) ?
"DC power" : "AC power"); "DC power" : "AC power");
...@@ -193,7 +193,7 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev, ...@@ -193,7 +193,7 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev,
ieee->ps = *extra; ieee->ps = *extra;
} }
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return 0; return 0;
} }
...@@ -207,13 +207,13 @@ static int _rtl92e_wx_set_lps_awake_interval(struct net_device *dev, ...@@ -207,13 +207,13 @@ static int _rtl92e_wx_set_lps_awake_interval(struct net_device *dev,
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
(&(priv->rtllib->PowerSaveControl)); (&(priv->rtllib->PowerSaveControl));
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
netdev_info(dev, "%s(): set lps awake interval ! extra is %d\n", netdev_info(dev, "%s(): set lps awake interval ! extra is %d\n",
__func__, *extra); __func__, *extra);
pPSC->RegMaxLPSAwakeIntvl = *extra; pPSC->RegMaxLPSAwakeIntvl = *extra;
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return 0; return 0;
} }
...@@ -223,13 +223,13 @@ static int _rtl92e_wx_set_force_lps(struct net_device *dev, ...@@ -223,13 +223,13 @@ static int _rtl92e_wx_set_force_lps(struct net_device *dev,
{ {
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
netdev_info(dev, netdev_info(dev,
"%s(): force LPS ! extra is %d (1 is open 0 is close)\n", "%s(): force LPS ! extra is %d (1 is open 0 is close)\n",
__func__, *extra); __func__, *extra);
priv->force_lps = *extra; priv->force_lps = *extra;
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return 0; return 0;
} }
...@@ -266,7 +266,7 @@ static int _rtl92e_wx_set_mode(struct net_device *dev, ...@@ -266,7 +266,7 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
rtState = priv->rtllib->eRFPowerState; rtState = priv->rtllib->eRFPowerState;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR || if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR ||
ieee->bNetPromiscuousMode) { ieee->bNetPromiscuousMode) {
if (priv->rtllib->PowerSaveControl.bInactivePs) { if (priv->rtllib->PowerSaveControl.bInactivePs) {
...@@ -275,7 +275,7 @@ static int _rtl92e_wx_set_mode(struct net_device *dev, ...@@ -275,7 +275,7 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
RF_CHANGE_BY_IPS) { RF_CHANGE_BY_IPS) {
netdev_warn(dev, "%s(): RF is OFF.\n", netdev_warn(dev, "%s(): RF is OFF.\n",
__func__); __func__);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return -1; return -1;
} }
netdev_info(dev, netdev_info(dev,
...@@ -289,7 +289,7 @@ static int _rtl92e_wx_set_mode(struct net_device *dev, ...@@ -289,7 +289,7 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
} }
ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b); ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -425,7 +425,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, ...@@ -425,7 +425,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
} }
} }
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
priv->rtllib->FirstIe_InScan = true; priv->rtllib->FirstIe_InScan = true;
...@@ -436,7 +436,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, ...@@ -436,7 +436,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
RF_CHANGE_BY_IPS) { RF_CHANGE_BY_IPS) {
netdev_warn(dev, "%s(): RF is OFF.\n", netdev_warn(dev, "%s(): RF is OFF.\n",
__func__); __func__);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return -1; return -1;
} }
RT_TRACE(COMP_PS, RT_TRACE(COMP_PS,
...@@ -471,7 +471,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, ...@@ -471,7 +471,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
ret = rtllib_wx_set_scan(priv->rtllib, a, wrqu, b); ret = rtllib_wx_set_scan(priv->rtllib, a, wrqu, b);
} }
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -491,11 +491,11 @@ static int _rtl92e_wx_get_scan(struct net_device *dev, ...@@ -491,11 +491,11 @@ static int _rtl92e_wx_get_scan(struct net_device *dev,
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_get_scan(priv->rtllib, a, wrqu, b); ret = rtllib_wx_get_scan(priv->rtllib, a, wrqu, b);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -513,10 +513,10 @@ static int _rtl92e_wx_set_essid(struct net_device *dev, ...@@ -513,10 +513,10 @@ static int _rtl92e_wx_set_essid(struct net_device *dev,
__func__); __func__);
return 0; return 0;
} }
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_set_essid(priv->rtllib, a, wrqu, b); ret = rtllib_wx_set_essid(priv->rtllib, a, wrqu, b);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -528,11 +528,11 @@ static int _rtl92e_wx_get_essid(struct net_device *dev, ...@@ -528,11 +528,11 @@ static int _rtl92e_wx_get_essid(struct net_device *dev,
int ret; int ret;
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_get_essid(priv->rtllib, a, wrqu, b); ret = rtllib_wx_get_essid(priv->rtllib, a, wrqu, b);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -545,12 +545,12 @@ static int _rtl92e_wx_set_nick(struct net_device *dev, ...@@ -545,12 +545,12 @@ static int _rtl92e_wx_set_nick(struct net_device *dev,
if (wrqu->data.length > IW_ESSID_MAX_SIZE) if (wrqu->data.length > IW_ESSID_MAX_SIZE)
return -E2BIG; return -E2BIG;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
wrqu->data.length = min_t(size_t, wrqu->data.length, wrqu->data.length = min_t(size_t, wrqu->data.length,
sizeof(priv->nick)); sizeof(priv->nick));
memset(priv->nick, 0, sizeof(priv->nick)); memset(priv->nick, 0, sizeof(priv->nick));
memcpy(priv->nick, extra, wrqu->data.length); memcpy(priv->nick, extra, wrqu->data.length);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return 0; return 0;
} }
...@@ -561,11 +561,11 @@ static int _rtl92e_wx_get_nick(struct net_device *dev, ...@@ -561,11 +561,11 @@ static int _rtl92e_wx_get_nick(struct net_device *dev,
{ {
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
wrqu->data.length = strlen(priv->nick); wrqu->data.length = strlen(priv->nick);
memcpy(extra, priv->nick, wrqu->data.length); memcpy(extra, priv->nick, wrqu->data.length);
wrqu->data.flags = 1; /* active */ wrqu->data.flags = 1; /* active */
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return 0; return 0;
} }
...@@ -579,11 +579,11 @@ static int _rtl92e_wx_set_freq(struct net_device *dev, ...@@ -579,11 +579,11 @@ static int _rtl92e_wx_set_freq(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_set_freq(priv->rtllib, a, wrqu, b); ret = rtllib_wx_set_freq(priv->rtllib, a, wrqu, b);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -644,11 +644,11 @@ static int _rtl92e_wx_set_wap(struct net_device *dev, ...@@ -644,11 +644,11 @@ static int _rtl92e_wx_set_wap(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_set_wap(priv->rtllib, info, awrq, extra); ret = rtllib_wx_set_wap(priv->rtllib, info, awrq, extra);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
...@@ -701,11 +701,11 @@ static int _rtl92e_wx_set_enc(struct net_device *dev, ...@@ -701,11 +701,11 @@ static int _rtl92e_wx_set_enc(struct net_device *dev,
down(&priv->rtllib->ips_sem); down(&priv->rtllib->ips_sem);
rtl92e_ips_leave(dev); rtl92e_ips_leave(dev);
up(&priv->rtllib->ips_sem); up(&priv->rtllib->ips_sem);
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
RT_TRACE(COMP_SEC, "Setting SW wep key"); RT_TRACE(COMP_SEC, "Setting SW wep key");
ret = rtllib_wx_set_encode(priv->rtllib, info, wrqu, key); ret = rtllib_wx_set_encode(priv->rtllib, info, wrqu, key);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
if (wrqu->encoding.flags & IW_ENCODE_DISABLED) { if (wrqu->encoding.flags & IW_ENCODE_DISABLED) {
...@@ -799,7 +799,7 @@ static int _rtl92e_wx_set_retry(struct net_device *dev, ...@@ -799,7 +799,7 @@ static int _rtl92e_wx_set_retry(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
if (wrqu->retry.flags & IW_RETRY_LIFETIME || if (wrqu->retry.flags & IW_RETRY_LIFETIME ||
wrqu->retry.disabled) { wrqu->retry.disabled) {
...@@ -822,7 +822,7 @@ static int _rtl92e_wx_set_retry(struct net_device *dev, ...@@ -822,7 +822,7 @@ static int _rtl92e_wx_set_retry(struct net_device *dev,
rtl92e_commit(dev); rtl92e_commit(dev);
exit: exit:
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return err; return err;
} }
...@@ -875,7 +875,7 @@ static int _rtl92e_wx_set_sens(struct net_device *dev, ...@@ -875,7 +875,7 @@ static int _rtl92e_wx_set_sens(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
if (priv->rf_set_sens == NULL) { if (priv->rf_set_sens == NULL) {
err = -1; /* we have not this support for this radio */ err = -1; /* we have not this support for this radio */
goto exit; goto exit;
...@@ -886,7 +886,7 @@ static int _rtl92e_wx_set_sens(struct net_device *dev, ...@@ -886,7 +886,7 @@ static int _rtl92e_wx_set_sens(struct net_device *dev,
err = -EINVAL; err = -EINVAL;
exit: exit:
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return err; return err;
} }
...@@ -902,7 +902,7 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev, ...@@ -902,7 +902,7 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
priv->rtllib->wx_set_enc = 1; priv->rtllib->wx_set_enc = 1;
down(&priv->rtllib->ips_sem); down(&priv->rtllib->ips_sem);
...@@ -969,7 +969,7 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev, ...@@ -969,7 +969,7 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev,
end_hw_sec: end_hw_sec:
priv->rtllib->wx_set_enc = 0; priv->rtllib->wx_set_enc = 0;
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -985,9 +985,9 @@ static int _rtl92e_wx_set_auth(struct net_device *dev, ...@@ -985,9 +985,9 @@ static int _rtl92e_wx_set_auth(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_set_auth(priv->rtllib, info, &(data->param), extra); ret = rtllib_wx_set_auth(priv->rtllib, info, &(data->param), extra);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -1003,9 +1003,9 @@ static int _rtl92e_wx_set_mlme(struct net_device *dev, ...@@ -1003,9 +1003,9 @@ static int _rtl92e_wx_set_mlme(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_set_mlme(priv->rtllib, info, wrqu, extra); ret = rtllib_wx_set_mlme(priv->rtllib, info, wrqu, extra);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -1020,9 +1020,9 @@ static int _rtl92e_wx_set_gen_ie(struct net_device *dev, ...@@ -1020,9 +1020,9 @@ static int _rtl92e_wx_set_gen_ie(struct net_device *dev,
if (priv->bHwRadioOff) if (priv->bHwRadioOff)
return 0; return 0;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
ret = rtllib_wx_set_gen_ie(priv->rtllib, extra, data->data.length); ret = rtllib_wx_set_gen_ie(priv->rtllib, extra, data->data.length);
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return ret; return ret;
} }
...@@ -1097,14 +1097,14 @@ static int _rtl92e_wx_get_promisc_mode(struct net_device *dev, ...@@ -1097,14 +1097,14 @@ static int _rtl92e_wx_get_promisc_mode(struct net_device *dev,
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
struct rtllib_device *ieee = priv->rtllib; struct rtllib_device *ieee = priv->rtllib;
down(&priv->wx_sem); mutex_lock(&priv->wx_mutex);
snprintf(extra, 45, "PromiscuousMode:%d, FilterSrcSTAFrame:%d", snprintf(extra, 45, "PromiscuousMode:%d, FilterSrcSTAFrame:%d",
ieee->IntelPromiscuousModeInfo.bPromiscuousOn, ieee->IntelPromiscuousModeInfo.bPromiscuousOn,
ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame); ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame);
wrqu->data.length = strlen(extra) + 1; wrqu->data.length = strlen(extra) + 1;
up(&priv->wx_sem); mutex_unlock(&priv->wx_mutex);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment