diff options
author | Andrea Merello <andrea.merello@gmail.com> | 2014-03-26 16:00:24 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-03-27 14:20:07 -0400 |
commit | 732c8932060dbc6630ca155d5eb8b484faccef45 (patch) | |
tree | a9bd3d8b92614f07c106741fbc5fdd87fa06a94c | |
parent | a373ebcb5a4cc0c7a99141bcf7942653facca330 (diff) |
rtl8180: introduce functions to enable/disable ints and add support for rtl8187se
This patch introduces two dedicated functions for enabling and
disabling ints.
Support for rtl8187se is also added to them
Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8180/dev.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c index 242a4bc46b88..92b6d53ca0ef 100644 --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c | |||
@@ -463,6 +463,36 @@ void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam) | |||
463 | rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); | 463 | rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); |
464 | } | 464 | } |
465 | 465 | ||
466 | static void rtl8180_int_enable(struct ieee80211_hw *dev) | ||
467 | { | ||
468 | struct rtl8180_priv *priv = dev->priv; | ||
469 | |||
470 | if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE) { | ||
471 | rtl818x_iowrite32(priv, &priv->map->IMR, IMR_TMGDOK | | ||
472 | IMR_TBDER | IMR_THPDER | | ||
473 | IMR_THPDER | IMR_THPDOK | | ||
474 | IMR_TVODER | IMR_TVODOK | | ||
475 | IMR_TVIDER | IMR_TVIDOK | | ||
476 | IMR_TBEDER | IMR_TBEDOK | | ||
477 | IMR_TBKDER | IMR_TBKDOK | | ||
478 | IMR_RDU | IMR_RER | | ||
479 | IMR_ROK | IMR_RQOSOK); | ||
480 | } else { | ||
481 | rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0xFFFF); | ||
482 | } | ||
483 | } | ||
484 | |||
485 | static void rtl8180_int_disable(struct ieee80211_hw *dev) | ||
486 | { | ||
487 | struct rtl8180_priv *priv = dev->priv; | ||
488 | |||
489 | if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE) { | ||
490 | rtl818x_iowrite32(priv, &priv->map->IMR, 0); | ||
491 | } else { | ||
492 | rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0); | ||
493 | } | ||
494 | } | ||
495 | |||
466 | static void rtl8180_conf_basic_rates(struct ieee80211_hw *dev, | 496 | static void rtl8180_conf_basic_rates(struct ieee80211_hw *dev, |
467 | u32 rates_mask) | 497 | u32 rates_mask) |
468 | { | 498 | { |
@@ -507,7 +537,7 @@ static int rtl8180_init_hw(struct ieee80211_hw *dev) | |||
507 | msleep(10); | 537 | msleep(10); |
508 | 538 | ||
509 | /* reset */ | 539 | /* reset */ |
510 | rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0); | 540 | rtl8180_int_disable(dev); |
511 | rtl818x_ioread8(priv, &priv->map->CMD); | 541 | rtl818x_ioread8(priv, &priv->map->CMD); |
512 | 542 | ||
513 | reg = rtl818x_ioread8(priv, &priv->map->CMD); | 543 | reg = rtl818x_ioread8(priv, &priv->map->CMD); |
@@ -747,7 +777,7 @@ static int rtl8180_start(struct ieee80211_hw *dev) | |||
747 | goto err_free_rings; | 777 | goto err_free_rings; |
748 | } | 778 | } |
749 | 779 | ||
750 | rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0xFFFF); | 780 | rtl8180_int_enable(dev); |
751 | 781 | ||
752 | rtl818x_iowrite32(priv, &priv->map->MAR[0], ~0); | 782 | rtl818x_iowrite32(priv, &priv->map->MAR[0], ~0); |
753 | rtl818x_iowrite32(priv, &priv->map->MAR[1], ~0); | 783 | rtl818x_iowrite32(priv, &priv->map->MAR[1], ~0); |
@@ -840,7 +870,7 @@ static void rtl8180_stop(struct ieee80211_hw *dev) | |||
840 | u8 reg; | 870 | u8 reg; |
841 | int i; | 871 | int i; |
842 | 872 | ||
843 | rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0); | 873 | rtl8180_int_disable(dev); |
844 | 874 | ||
845 | reg = rtl818x_ioread8(priv, &priv->map->CMD); | 875 | reg = rtl818x_ioread8(priv, &priv->map->CMD); |
846 | reg &= ~RTL818X_CMD_TX_ENABLE; | 876 | reg &= ~RTL818X_CMD_TX_ENABLE; |