rtl8180: remove priv->mode
It is only checked in add_interface, and there it is easily replaced with a check of priv->vif. If that information should become necessary, it is available in vif->type anyway. Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
@@ -60,7 +60,6 @@ struct rtl8180_priv {
|
|||||||
struct rtl818x_csr __iomem *map;
|
struct rtl818x_csr __iomem *map;
|
||||||
const struct rtl818x_rf_ops *rf;
|
const struct rtl818x_rf_ops *rf;
|
||||||
struct ieee80211_vif *vif;
|
struct ieee80211_vif *vif;
|
||||||
int mode;
|
|
||||||
|
|
||||||
/* rtl8180 driver specific */
|
/* rtl8180 driver specific */
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
|
@@ -82,8 +82,6 @@ static const struct ieee80211_channel rtl818x_channels[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data)
|
void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data)
|
||||||
{
|
{
|
||||||
struct rtl8180_priv *priv = dev->priv;
|
struct rtl8180_priv *priv = dev->priv;
|
||||||
@@ -615,7 +613,6 @@ static int rtl8180_start(struct ieee80211_hw *dev)
|
|||||||
reg |= RTL818X_CMD_TX_ENABLE;
|
reg |= RTL818X_CMD_TX_ENABLE;
|
||||||
rtl818x_iowrite8(priv, &priv->map->CMD, reg);
|
rtl818x_iowrite8(priv, &priv->map->CMD, reg);
|
||||||
|
|
||||||
priv->mode = NL80211_IFTYPE_MONITOR;
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_free_rings:
|
err_free_rings:
|
||||||
@@ -633,8 +630,6 @@ static void rtl8180_stop(struct ieee80211_hw *dev)
|
|||||||
u8 reg;
|
u8 reg;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
priv->mode = NL80211_IFTYPE_UNSPECIFIED;
|
|
||||||
|
|
||||||
rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0);
|
rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0);
|
||||||
|
|
||||||
reg = rtl818x_ioread8(priv, &priv->map->CMD);
|
reg = rtl818x_ioread8(priv, &priv->map->CMD);
|
||||||
@@ -661,12 +656,14 @@ static int rtl8180_add_interface(struct ieee80211_hw *dev,
|
|||||||
{
|
{
|
||||||
struct rtl8180_priv *priv = dev->priv;
|
struct rtl8180_priv *priv = dev->priv;
|
||||||
|
|
||||||
if (priv->mode != NL80211_IFTYPE_MONITOR)
|
/*
|
||||||
return -EOPNOTSUPP;
|
* We only support one active interface at a time.
|
||||||
|
*/
|
||||||
|
if (priv->vif)
|
||||||
|
return -EBUSY;
|
||||||
|
|
||||||
switch (conf->type) {
|
switch (conf->type) {
|
||||||
case NL80211_IFTYPE_STATION:
|
case NL80211_IFTYPE_STATION:
|
||||||
priv->mode = conf->type;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
@@ -688,7 +685,6 @@ static void rtl8180_remove_interface(struct ieee80211_hw *dev,
|
|||||||
struct ieee80211_if_init_conf *conf)
|
struct ieee80211_if_init_conf *conf)
|
||||||
{
|
{
|
||||||
struct rtl8180_priv *priv = dev->priv;
|
struct rtl8180_priv *priv = dev->priv;
|
||||||
priv->mode = NL80211_IFTYPE_MONITOR;
|
|
||||||
priv->vif = NULL;
|
priv->vif = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user