mirror of
https://github.com/torvalds/linux
synced 2024-10-25 12:49:03 +00:00
rtl8180: config carbus register for rtl8187se
configuration of carbus-related registers is different for rtl8187se. Introduce a dedicated function that does it for all cards in the proper way Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
3ee44d6011
commit
f1026df86a
|
@ -601,6 +601,26 @@ static void rtl8180_conf_basic_rates(struct ieee80211_hw *dev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rtl8180_config_cardbus(struct ieee80211_hw *dev)
|
||||||
|
{
|
||||||
|
struct rtl8180_priv *priv = dev->priv;
|
||||||
|
u16 reg16;
|
||||||
|
u8 reg8;
|
||||||
|
|
||||||
|
reg8 = rtl818x_ioread8(priv, &priv->map->CONFIG3);
|
||||||
|
reg8 |= 1 << 1;
|
||||||
|
rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg8);
|
||||||
|
|
||||||
|
if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE) {
|
||||||
|
rtl818x_iowrite16(priv, FEMR_SE, 0xffff);
|
||||||
|
} else {
|
||||||
|
reg16 = rtl818x_ioread16(priv, &priv->map->FEMR);
|
||||||
|
reg16 |= (1 << 15) | (1 << 14) | (1 << 4);
|
||||||
|
rtl818x_iowrite16(priv, &priv->map->FEMR, reg16);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static int rtl8180_init_hw(struct ieee80211_hw *dev)
|
static int rtl8180_init_hw(struct ieee80211_hw *dev)
|
||||||
{
|
{
|
||||||
struct rtl8180_priv *priv = dev->priv;
|
struct rtl8180_priv *priv = dev->priv;
|
||||||
|
@ -632,13 +652,7 @@ static int rtl8180_init_hw(struct ieee80211_hw *dev)
|
||||||
msleep(200);
|
msleep(200);
|
||||||
|
|
||||||
if (rtl818x_ioread8(priv, &priv->map->CONFIG3) & (1 << 3)) {
|
if (rtl818x_ioread8(priv, &priv->map->CONFIG3) & (1 << 3)) {
|
||||||
/* For cardbus */
|
rtl8180_config_cardbus(dev);
|
||||||
reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
|
|
||||||
reg |= 1 << 1;
|
|
||||||
rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg);
|
|
||||||
reg = rtl818x_ioread16(priv, &priv->map->FEMR);
|
|
||||||
reg |= (1 << 15) | (1 << 14) | (1 << 4);
|
|
||||||
rtl818x_iowrite16(priv, &priv->map->FEMR, reg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rtl818x_iowrite8(priv, &priv->map->MSR, 0);
|
rtl818x_iowrite8(priv, &priv->map->MSR, 0);
|
||||||
|
|
Loading…
Reference in a new issue