diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2014-09-22 10:39:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-09-26 17:25:00 -0400 |
commit | 34ed780a6afc4df5e3285d20fac721c591e0724e (patch) | |
tree | 222af39b8ed4876c99cce6f6f6575f2ca0a53d76 /drivers/net/wireless/rtlwifi/core.c | |
parent | 21e4b0726dc671c423e2dc9a85364716219c4502 (diff) |
rtlwifi: Fix problems with building an allyesconfig
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/core.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/core.c | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c index dea754aecdaf..10a3bc6dca80 100644 --- a/drivers/net/wireless/rtlwifi/core.c +++ b/drivers/net/wireless/rtlwifi/core.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "cam.h" | 28 | #include "cam.h" |
29 | #include "base.h" | 29 | #include "base.h" |
30 | #include "ps.h" | 30 | #include "ps.h" |
31 | #include "pwrseqcmd.h" | ||
31 | 32 | ||
32 | #include "btcoexist/rtl_btc.h" | 33 | #include "btcoexist/rtl_btc.h" |
33 | #include <linux/firmware.h> | 34 | #include <linux/firmware.h> |
@@ -1670,6 +1671,103 @@ static void rtl_op_flush(struct ieee80211_hw *hw, | |||
1670 | rtlpriv->intf_ops->flush(hw, queues, drop); | 1671 | rtlpriv->intf_ops->flush(hw, queues, drop); |
1671 | } | 1672 | } |
1672 | 1673 | ||
1674 | /* Description: | ||
1675 | * This routine deals with the Power Configuration CMD | ||
1676 | * parsing for RTL8723/RTL8188E Series IC. | ||
1677 | * Assumption: | ||
1678 | * We should follow specific format that was released from HW SD. | ||
1679 | */ | ||
1680 | bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version, | ||
1681 | u8 faversion, u8 interface_type, | ||
1682 | struct wlan_pwr_cfg pwrcfgcmd[]) | ||
1683 | { | ||
1684 | struct wlan_pwr_cfg cfg_cmd = {0}; | ||
1685 | bool polling_bit = false; | ||
1686 | u32 ary_idx = 0; | ||
1687 | u8 value = 0; | ||
1688 | u32 offset = 0; | ||
1689 | u32 polling_count = 0; | ||
1690 | u32 max_polling_cnt = 5000; | ||
1691 | |||
1692 | do { | ||
1693 | cfg_cmd = pwrcfgcmd[ary_idx]; | ||
1694 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, | ||
1695 | "rtl_hal_pwrseqcmdparsing(): offset(%#x),cut_msk(%#x), famsk(%#x), interface_msk(%#x), base(%#x), cmd(%#x), msk(%#x), value(%#x)\n", | ||
1696 | GET_PWR_CFG_OFFSET(cfg_cmd), | ||
1697 | GET_PWR_CFG_CUT_MASK(cfg_cmd), | ||
1698 | GET_PWR_CFG_FAB_MASK(cfg_cmd), | ||
1699 | GET_PWR_CFG_INTF_MASK(cfg_cmd), | ||
1700 | GET_PWR_CFG_BASE(cfg_cmd), GET_PWR_CFG_CMD(cfg_cmd), | ||
1701 | GET_PWR_CFG_MASK(cfg_cmd), GET_PWR_CFG_VALUE(cfg_cmd)); | ||
1702 | |||
1703 | if ((GET_PWR_CFG_FAB_MASK(cfg_cmd)&faversion) && | ||
1704 | (GET_PWR_CFG_CUT_MASK(cfg_cmd)&cut_version) && | ||
1705 | (GET_PWR_CFG_INTF_MASK(cfg_cmd)&interface_type)) { | ||
1706 | switch (GET_PWR_CFG_CMD(cfg_cmd)) { | ||
1707 | case PWR_CMD_READ: | ||
1708 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, | ||
1709 | "rtl_hal_pwrseqcmdparsing(): PWR_CMD_READ\n"); | ||
1710 | break; | ||
1711 | case PWR_CMD_WRITE: | ||
1712 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, | ||
1713 | "rtl_hal_pwrseqcmdparsing(): PWR_CMD_WRITE\n"); | ||
1714 | offset = GET_PWR_CFG_OFFSET(cfg_cmd); | ||
1715 | |||
1716 | /*Read the value from system register*/ | ||
1717 | value = rtl_read_byte(rtlpriv, offset); | ||
1718 | value &= (~(GET_PWR_CFG_MASK(cfg_cmd))); | ||
1719 | value |= (GET_PWR_CFG_VALUE(cfg_cmd) & | ||
1720 | GET_PWR_CFG_MASK(cfg_cmd)); | ||
1721 | |||
1722 | /*Write the value back to sytem register*/ | ||
1723 | rtl_write_byte(rtlpriv, offset, value); | ||
1724 | break; | ||
1725 | case PWR_CMD_POLLING: | ||
1726 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, | ||
1727 | "rtl_hal_pwrseqcmdparsing(): PWR_CMD_POLLING\n"); | ||
1728 | polling_bit = false; | ||
1729 | offset = GET_PWR_CFG_OFFSET(cfg_cmd); | ||
1730 | |||
1731 | do { | ||
1732 | value = rtl_read_byte(rtlpriv, offset); | ||
1733 | |||
1734 | value &= GET_PWR_CFG_MASK(cfg_cmd); | ||
1735 | if (value == | ||
1736 | (GET_PWR_CFG_VALUE(cfg_cmd) & | ||
1737 | GET_PWR_CFG_MASK(cfg_cmd))) | ||
1738 | polling_bit = true; | ||
1739 | else | ||
1740 | udelay(10); | ||
1741 | |||
1742 | if (polling_count++ > max_polling_cnt) | ||
1743 | return false; | ||
1744 | } while (!polling_bit); | ||
1745 | break; | ||
1746 | case PWR_CMD_DELAY: | ||
1747 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, | ||
1748 | "rtl_hal_pwrseqcmdparsing(): PWR_CMD_DELAY\n"); | ||
1749 | if (GET_PWR_CFG_VALUE(cfg_cmd) == | ||
1750 | PWRSEQ_DELAY_US) | ||
1751 | udelay(GET_PWR_CFG_OFFSET(cfg_cmd)); | ||
1752 | else | ||
1753 | mdelay(GET_PWR_CFG_OFFSET(cfg_cmd)); | ||
1754 | break; | ||
1755 | case PWR_CMD_END: | ||
1756 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, | ||
1757 | "rtl_hal_pwrseqcmdparsing(): PWR_CMD_END\n"); | ||
1758 | return true; | ||
1759 | default: | ||
1760 | RT_ASSERT(false, | ||
1761 | "rtl_hal_pwrseqcmdparsing(): Unknown CMD!!\n"); | ||
1762 | break; | ||
1763 | } | ||
1764 | } | ||
1765 | ary_idx++; | ||
1766 | } while (1); | ||
1767 | |||
1768 | return true; | ||
1769 | } | ||
1770 | EXPORT_SYMBOL(rtl_hal_pwrseqcmdparsing); | ||
1673 | const struct ieee80211_ops rtl_ops = { | 1771 | const struct ieee80211_ops rtl_ops = { |
1674 | .start = rtl_op_start, | 1772 | .start = rtl_op_start, |
1675 | .stop = rtl_op_stop, | 1773 | .stop = rtl_op_stop, |