aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2011-04-25 14:23:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-26 16:14:55 -0400
commitd3bb1429a2c1470d1f84646c00e34dc6784ee06e (patch)
tree3d3aa086cdcdddd296b829ec7745ee36e9091a27 /drivers/net/wireless/rtlwifi
parent76c34f910a5c99a402de5068444563d4c151e794 (diff)
rtlwifi: rtl8192ce: rtl8192cu: Fix most sparse warnings
Fix most sparse warnings in rtlwifi, rtl8192ce and rtl8192cu drivers. 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')
-rw-r--r--drivers/net/wireless/rtlwifi/base.c6
-rw-r--r--drivers/net/wireless/rtlwifi/efuse.c4
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c170
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c45
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c16
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192c/phy_common.h16
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/hw.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/phy.c69
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/phy.h4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/reg.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/sw.c8
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/trx.c10
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/phy.c14
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/phy.h14
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/rf.c4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/rf.h4
-rw-r--r--drivers/net/wireless/rtlwifi/wifi.h7
17 files changed, 93 insertions, 302 deletions
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 2df99463a681..d3666573d6b8 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -795,7 +795,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
795 ip = (struct iphdr *)((u8 *) skb->data + mac_hdr_len + 795 ip = (struct iphdr *)((u8 *) skb->data + mac_hdr_len +
796 SNAP_SIZE + PROTOC_TYPE_SIZE); 796 SNAP_SIZE + PROTOC_TYPE_SIZE);
797 ether_type = *(u16 *) ((u8 *) skb->data + mac_hdr_len + SNAP_SIZE); 797 ether_type = *(u16 *) ((u8 *) skb->data + mac_hdr_len + SNAP_SIZE);
798 ether_type = ntohs(ether_type); 798 /* ether_type = ntohs(ether_type); */
799 799
800 if (ETH_P_IP == ether_type) { 800 if (ETH_P_IP == ether_type) {
801 if (IPPROTO_UDP == ip->protocol) { 801 if (IPPROTO_UDP == ip->protocol) {
@@ -1105,7 +1105,7 @@ u8 *rtl_find_ie(u8 *data, unsigned int len, u8 ie)
1105 1105
1106/* when we use 2 rx ants we send IEEE80211_SMPS_OFF */ 1106/* when we use 2 rx ants we send IEEE80211_SMPS_OFF */
1107/* when we use 1 rx ant we send IEEE80211_SMPS_STATIC */ 1107/* when we use 1 rx ant we send IEEE80211_SMPS_STATIC */
1108struct sk_buff *rtl_make_smps_action(struct ieee80211_hw *hw, 1108static struct sk_buff *rtl_make_smps_action(struct ieee80211_hw *hw,
1109 enum ieee80211_smps_mode smps, u8 *da, u8 *bssid) 1109 enum ieee80211_smps_mode smps, u8 *da, u8 *bssid)
1110{ 1110{
1111 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); 1111 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
@@ -1230,7 +1230,7 @@ static bool rtl_chk_vendor_ouisub(struct ieee80211_hw *hw,
1230 return matched; 1230 return matched;
1231} 1231}
1232 1232
1233bool rtl_find_221_ie(struct ieee80211_hw *hw, u8 *data, 1233static bool rtl_find_221_ie(struct ieee80211_hw *hw, u8 *data,
1234 unsigned int len) 1234 unsigned int len)
1235{ 1235{
1236 struct ieee80211_mgmt *mgmt = (void *)data; 1236 struct ieee80211_mgmt *mgmt = (void *)data;
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
index 664703ce9da8..510d42edb8ca 100644
--- a/drivers/net/wireless/rtlwifi/efuse.c
+++ b/drivers/net/wireless/rtlwifi/efuse.c
@@ -235,7 +235,7 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf)
235{ 235{
236 struct rtl_priv *rtlpriv = rtl_priv(hw); 236 struct rtl_priv *rtlpriv = rtl_priv(hw);
237 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); 237 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
238 u8 efuse_tbl[rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]]; 238 u8 efuse_tbl[HWSET_MAX_SIZE];
239 u8 rtemp8[1]; 239 u8 rtemp8[1];
240 u16 efuse_addr = 0; 240 u16 efuse_addr = 0;
241 u8 offset, wren; 241 u8 offset, wren;
@@ -245,7 +245,7 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf)
245 rtlpriv->cfg->maps[EFUSE_MAX_SECTION_MAP]; 245 rtlpriv->cfg->maps[EFUSE_MAX_SECTION_MAP];
246 const u32 efuse_len = 246 const u32 efuse_len =
247 rtlpriv->cfg->maps[EFUSE_REAL_CONTENT_SIZE]; 247 rtlpriv->cfg->maps[EFUSE_REAL_CONTENT_SIZE];
248 u16 efuse_word[efuse_max_section][EFUSE_MAX_WORD_UNIT]; 248 u16 efuse_word[EFUSE_MAX_SECTION][EFUSE_MAX_WORD_UNIT];
249 u16 efuse_utilized = 0; 249 u16 efuse_utilized = 0;
250 u8 efuse_usage; 250 u8 efuse_usage;
251 251
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index aeb0901ce711..367d9b4ebd20 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -48,11 +48,11 @@ static const u8 ac_to_hwq[] = {
48 BK_QUEUE 48 BK_QUEUE
49}; 49};
50 50
51u8 _rtl_mac_to_hwqueue(struct ieee80211_hw *hw, 51static u8 _rtl_mac_to_hwqueue(struct ieee80211_hw *hw,
52 struct sk_buff *skb) 52 struct sk_buff *skb)
53{ 53{
54 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 54 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
55 u16 fc = rtl_get_fc(skb); 55 __le16 fc = rtl_get_fc(skb);
56 u8 queue_index = skb_get_queue_mapping(skb); 56 u8 queue_index = skb_get_queue_mapping(skb);
57 57
58 if (unlikely(ieee80211_is_beacon(fc))) 58 if (unlikely(ieee80211_is_beacon(fc)))
@@ -181,71 +181,6 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
181 ppsc->support_aspm = false; 181 ppsc->support_aspm = false;
182} 182}
183 183
184/*Disable L0s dirtectly. We will disable host L0s by default. */
185void rtl_pci_disable_host_l0s(struct ieee80211_hw *hw)
186{
187 struct rtl_priv *rtlpriv = rtl_priv(hw);
188 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
189 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
190 u8 pcibridge_busnum = pcipriv->ndis_adapter.pcibridge_busnum;
191 u8 pcibridge_devnum = pcipriv->ndis_adapter.pcibridge_devnum;
192 u8 pcibridge_funcnum = pcipriv->ndis_adapter.pcibridge_funcnum;
193 u32 pcicfg_addrport = pcipriv->ndis_adapter.pcicfg_addrport;
194 u8 num4bytes = pcipriv->ndis_adapter.num4bytes;
195 u8 u_pcibridge_aspmsetting = 0;
196
197 /*Read Link Control Register */
198 rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS,
199 pcicfg_addrport + (num4bytes << 2));
200 rtl_pci_raw_read_port_uchar(PCI_CONF_DATA, &u_pcibridge_aspmsetting);
201
202 if (u_pcibridge_aspmsetting & BIT(0))
203 u_pcibridge_aspmsetting &= ~(BIT(0));
204
205 rtl_pci_raw_write_port_ulong(PCI_CONF_ADDRESS,
206 pcicfg_addrport + (num4bytes << 2));
207 rtl_pci_raw_write_port_uchar(PCI_CONF_DATA, u_pcibridge_aspmsetting);
208
209 udelay(50);
210
211 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
212 ("PciBridge busnumber[%x], DevNumbe[%x], "
213 "funcnumber[%x], Write reg[%x] = %lx\n",
214 pcibridge_busnum, pcibridge_devnum, pcibridge_funcnum,
215 (pcipriv->ndis_adapter.pcibridge_pciehdr_offset + 0x10),
216 (pcipriv->ndis_adapter.pcibridge_linkctrlreg |
217 (rtlpci->const_devicepci_aspm_setting & ~BIT(0)))));
218}
219
220/*Enable rtl8192ce backdoor to control ASPM and clock request.*/
221bool rtl_pci_enable_back_door(struct ieee80211_hw *hw)
222{
223 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
224 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
225 u8 pcibridge_vendor = pcipriv->ndis_adapter.pcibridge_vendor;
226 bool bresult = true;
227 u8 value;
228
229 pci_read_config_byte(rtlpci->pdev, 0x70f, &value);
230
231 /*0x70f BIT(7) is used to control L0S */
232 if (pcibridge_vendor == PCI_BRIDGE_VENDOR_INTEL) {
233 value |= BIT(7);
234 } else {
235 /*Set 0x70f to 0x23 when non-Intel platform. */
236 value = 0x23;
237 }
238
239 pci_write_config_byte(rtlpci->pdev, 0x70f, value);
240
241 pci_read_config_byte(rtlpci->pdev, 0x719, &value);
242 /*0x719 BIT(3) is for L1 BIT(4) is for clock request */
243 value |= (BIT(3) | BIT(4));
244 pci_write_config_byte(rtlpci->pdev, 0x719, value);
245
246 return bresult;
247}
248
249static bool _rtl_pci_platform_switch_device_pci_aspm( 184static bool _rtl_pci_platform_switch_device_pci_aspm(
250 struct ieee80211_hw *hw, 185 struct ieee80211_hw *hw,
251 u8 value) 186 u8 value)
@@ -426,7 +361,7 @@ static bool rtl_pci_get_amd_l1_patch(struct ieee80211_hw *hw)
426 return status; 361 return status;
427} 362}
428 363
429void rtl_pci_get_linkcontrol_field(struct ieee80211_hw *hw) 364static void rtl_pci_get_linkcontrol_field(struct ieee80211_hw *hw)
430{ 365{
431 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); 366 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
432 u8 capabilityoffset = pcipriv->ndis_adapter.pcibridge_pciehdr_offset; 367 u8 capabilityoffset = pcipriv->ndis_adapter.pcibridge_pciehdr_offset;
@@ -618,9 +553,9 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
618 553
619 skb = __skb_dequeue(&ring->queue); 554 skb = __skb_dequeue(&ring->queue);
620 pci_unmap_single(rtlpci->pdev, 555 pci_unmap_single(rtlpci->pdev,
621 le32_to_cpu(rtlpriv->cfg->ops-> 556 rtlpriv->cfg->ops->
622 get_desc((u8 *) entry, true, 557 get_desc((u8 *) entry, true,
623 HW_DESC_TXBUFF_ADDR)), 558 HW_DESC_TXBUFF_ADDR),
624 skb->len, PCI_DMA_TODEVICE); 559 skb->len, PCI_DMA_TODEVICE);
625 560
626 /* remove early mode header */ 561 /* remove early mode header */
@@ -844,7 +779,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
844 779
845 } 780 }
846done: 781done:
847 bufferaddress = cpu_to_le32(*((dma_addr_t *)skb->cb)); 782 bufferaddress = (*((dma_addr_t *)skb->cb));
848 tmp_one = 1; 783 tmp_one = 1;
849 rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false, 784 rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false,
850 HW_DESC_RXBUFF_ADDR, 785 HW_DESC_RXBUFF_ADDR,
@@ -868,75 +803,6 @@ done:
868 803
869} 804}
870 805
871void _rtl_pci_tx_interrupt(struct ieee80211_hw *hw)
872{
873 struct rtl_priv *rtlpriv = rtl_priv(hw);
874 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
875 int prio;
876
877 for (prio = 0; prio < RTL_PCI_MAX_TX_QUEUE_COUNT; prio++) {
878 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[prio];
879
880 while (skb_queue_len(&ring->queue)) {
881 struct rtl_tx_desc *entry = &ring->desc[ring->idx];
882 struct sk_buff *skb;
883 struct ieee80211_tx_info *info;
884 u8 own;
885
886 /*
887 *beacon packet will only use the first
888 *descriptor defautly, and the own may not
889 *be cleared by the hardware, and
890 *beacon will free in prepare beacon
891 */
892 if (prio == BEACON_QUEUE || prio == TXCMD_QUEUE ||
893 prio == HCCA_QUEUE)
894 break;
895
896 own = (u8) rtlpriv->cfg->ops->get_desc((u8 *) entry,
897 true,
898 HW_DESC_OWN);
899
900 if (own)
901 break;
902
903 skb = __skb_dequeue(&ring->queue);
904 pci_unmap_single(rtlpci->pdev,
905 le32_to_cpu(rtlpriv->cfg->ops->
906 get_desc((u8 *) entry,
907 true,
908 HW_DESC_TXBUFF_ADDR)),
909 skb->len, PCI_DMA_TODEVICE);
910
911 ring->idx = (ring->idx + 1) % ring->entries;
912
913 info = IEEE80211_SKB_CB(skb);
914 ieee80211_tx_info_clear_status(info);
915
916 info->flags |= IEEE80211_TX_STAT_ACK;
917 /*info->status.rates[0].count = 1; */
918
919 ieee80211_tx_status_irqsafe(hw, skb);
920
921 if ((ring->entries - skb_queue_len(&ring->queue))
922 == 2 && prio != BEACON_QUEUE) {
923 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
924 ("more desc left, wake "
925 "skb_queue@%d,ring->idx = %d,"
926 "skb_queue_len = 0x%d\n",
927 prio, ring->idx,
928 skb_queue_len(&ring->queue)));
929
930 ieee80211_wake_queue(hw,
931 skb_get_queue_mapping
932 (skb));
933 }
934
935 skb = NULL;
936 }
937 }
938}
939
940static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) 806static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
941{ 807{
942 struct ieee80211_hw *hw = dev_id; 808 struct ieee80211_hw *hw = dev_id;
@@ -1202,9 +1068,9 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
1202 ("queue:%d, ring_addr:%p\n", prio, ring)); 1068 ("queue:%d, ring_addr:%p\n", prio, ring));
1203 1069
1204 for (i = 0; i < entries; i++) { 1070 for (i = 0; i < entries; i++) {
1205 nextdescaddress = cpu_to_le32((u32) dma + 1071 nextdescaddress = (u32) dma +
1206 ((i + 11) % entries) * 1072 ((i + 11) % entries) *
1207 sizeof(*ring)); 1073 sizeof(*ring);
1208 1074
1209 rtlpriv->cfg->ops->set_desc((u8 *)&(ring[i]), 1075 rtlpriv->cfg->ops->set_desc((u8 *)&(ring[i]),
1210 true, HW_DESC_TX_NEXTDESC_ADDR, 1076 true, HW_DESC_TX_NEXTDESC_ADDR,
@@ -1268,7 +1134,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
1268 rtlpci->rxbuffersize, 1134 rtlpci->rxbuffersize,
1269 PCI_DMA_FROMDEVICE); 1135 PCI_DMA_FROMDEVICE);
1270 1136
1271 bufferaddress = cpu_to_le32(*((dma_addr_t *)skb->cb)); 1137 bufferaddress = (*((dma_addr_t *)skb->cb));
1272 rtlpriv->cfg->ops->set_desc((u8 *)entry, false, 1138 rtlpriv->cfg->ops->set_desc((u8 *)entry, false,
1273 HW_DESC_RXBUFF_ADDR, 1139 HW_DESC_RXBUFF_ADDR,
1274 (u8 *)&bufferaddress); 1140 (u8 *)&bufferaddress);
@@ -1299,9 +1165,9 @@ static void _rtl_pci_free_tx_ring(struct ieee80211_hw *hw,
1299 struct sk_buff *skb = __skb_dequeue(&ring->queue); 1165 struct sk_buff *skb = __skb_dequeue(&ring->queue);
1300 1166
1301 pci_unmap_single(rtlpci->pdev, 1167 pci_unmap_single(rtlpci->pdev,
1302 le32_to_cpu(rtlpriv->cfg-> 1168 rtlpriv->cfg->
1303 ops->get_desc((u8 *) entry, true, 1169 ops->get_desc((u8 *) entry, true,
1304 HW_DESC_TXBUFF_ADDR)), 1170 HW_DESC_TXBUFF_ADDR),
1305 skb->len, PCI_DMA_TODEVICE); 1171 skb->len, PCI_DMA_TODEVICE);
1306 kfree_skb(skb); 1172 kfree_skb(skb);
1307 ring->idx = (ring->idx + 1) % ring->entries; 1173 ring->idx = (ring->idx + 1) % ring->entries;
@@ -1433,11 +1299,11 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
1433 __skb_dequeue(&ring->queue); 1299 __skb_dequeue(&ring->queue);
1434 1300
1435 pci_unmap_single(rtlpci->pdev, 1301 pci_unmap_single(rtlpci->pdev,
1436 le32_to_cpu(rtlpriv->cfg->ops-> 1302 rtlpriv->cfg->ops->
1437 get_desc((u8 *) 1303 get_desc((u8 *)
1438 entry, 1304 entry,
1439 true, 1305 true,
1440 HW_DESC_TXBUFF_ADDR)), 1306 HW_DESC_TXBUFF_ADDR),
1441 skb->len, PCI_DMA_TODEVICE); 1307 skb->len, PCI_DMA_TODEVICE);
1442 kfree_skb(skb); 1308 kfree_skb(skb);
1443 ring->idx = (ring->idx + 1) % ring->entries; 1309 ring->idx = (ring->idx + 1) % ring->entries;
@@ -1484,7 +1350,7 @@ static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw,
1484 return true; 1350 return true;
1485} 1351}
1486 1352
1487int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb, 1353static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
1488 struct rtl_tcb_desc *ptcb_desc) 1354 struct rtl_tcb_desc *ptcb_desc)
1489{ 1355{
1490 struct rtl_priv *rtlpriv = rtl_priv(hw); 1356 struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -1623,7 +1489,7 @@ static void rtl_pci_flush(struct ieee80211_hw *hw, bool drop)
1623 } 1489 }
1624} 1490}
1625 1491
1626void rtl_pci_deinit(struct ieee80211_hw *hw) 1492static void rtl_pci_deinit(struct ieee80211_hw *hw)
1627{ 1493{
1628 struct rtl_priv *rtlpriv = rtl_priv(hw); 1494 struct rtl_priv *rtlpriv = rtl_priv(hw);
1629 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1495 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
@@ -1638,7 +1504,7 @@ void rtl_pci_deinit(struct ieee80211_hw *hw)
1638 1504
1639} 1505}
1640 1506
1641int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev) 1507static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
1642{ 1508{
1643 struct rtl_priv *rtlpriv = rtl_priv(hw); 1509 struct rtl_priv *rtlpriv = rtl_priv(hw);
1644 int err; 1510 int err;
@@ -1655,7 +1521,7 @@ int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
1655 return 1; 1521 return 1;
1656} 1522}
1657 1523
1658int rtl_pci_start(struct ieee80211_hw *hw) 1524static int rtl_pci_start(struct ieee80211_hw *hw)
1659{ 1525{
1660 struct rtl_priv *rtlpriv = rtl_priv(hw); 1526 struct rtl_priv *rtlpriv = rtl_priv(hw);
1661 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 1527 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
@@ -1690,7 +1556,7 @@ int rtl_pci_start(struct ieee80211_hw *hw)
1690 return 0; 1556 return 0;
1691} 1557}
1692 1558
1693void rtl_pci_stop(struct ieee80211_hw *hw) 1559static void rtl_pci_stop(struct ieee80211_hw *hw)
1694{ 1560{
1695 struct rtl_priv *rtlpriv = rtl_priv(hw); 1561 struct rtl_priv *rtlpriv = rtl_priv(hw);
1696 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1562 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
index bfc84054cc07..97183829b9be 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
@@ -1238,51 +1238,6 @@ static void rtl92c_dm_init_dynamic_bb_powersaving(struct ieee80211_hw *hw)
1238 dm_pstable.rssi_val_min = 0; 1238 dm_pstable.rssi_val_min = 0;
1239} 1239}
1240 1240
1241void rtl92c_dm_1r_cca(struct ieee80211_hw *hw)
1242{
1243 struct rtl_priv *rtlpriv = rtl_priv(hw);
1244 struct rtl_phy *rtlphy = &(rtlpriv->phy);
1245
1246 if (dm_pstable.rssi_val_min != 0) {
1247 if (dm_pstable.pre_ccastate == CCA_2R) {
1248 if (dm_pstable.rssi_val_min >= 35)
1249 dm_pstable.cur_ccasate = CCA_1R;
1250 else
1251 dm_pstable.cur_ccasate = CCA_2R;
1252 } else {
1253 if (dm_pstable.rssi_val_min <= 30)
1254 dm_pstable.cur_ccasate = CCA_2R;
1255 else
1256 dm_pstable.cur_ccasate = CCA_1R;
1257 }
1258 } else {
1259 dm_pstable.cur_ccasate = CCA_MAX;
1260 }
1261
1262 if (dm_pstable.pre_ccastate != dm_pstable.cur_ccasate) {
1263 if (dm_pstable.cur_ccasate == CCA_1R) {
1264 if (get_rf_type(rtlphy) == RF_2T2R) {
1265 rtl_set_bbreg(hw, ROFDM0_TRXPATHENABLE,
1266 MASKBYTE0, 0x13);
1267 rtl_set_bbreg(hw, 0xe70, MASKBYTE3, 0x20);
1268 } else {
1269 rtl_set_bbreg(hw, ROFDM0_TRXPATHENABLE,
1270 MASKBYTE0, 0x23);
1271 rtl_set_bbreg(hw, 0xe70, 0x7fc00000, 0x10c);
1272 }
1273 } else {
1274 rtl_set_bbreg(hw, ROFDM0_TRXPATHENABLE, MASKBYTE0,
1275 0x33);
1276 rtl_set_bbreg(hw, 0xe70, MASKBYTE3, 0x63);
1277 }
1278 dm_pstable.pre_ccastate = dm_pstable.cur_ccasate;
1279 }
1280
1281 RT_TRACE(rtlpriv, DBG_LOUD, DBG_LOUD, ("CCAStage = %s\n",
1282 (dm_pstable.cur_ccasate ==
1283 0) ? "1RCCA" : "2RCCA"));
1284}
1285
1286void rtl92c_dm_rf_saving(struct ieee80211_hw *hw, u8 bforce_in_normal) 1241void rtl92c_dm_rf_saving(struct ieee80211_hw *hw, u8 bforce_in_normal)
1287{ 1242{
1288 static u8 initialize; 1243 static u8 initialize;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
index 991d865cb38c..c5424cad43cb 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
@@ -83,7 +83,7 @@ void rtl92c_phy_set_bb_reg(struct ieee80211_hw *hw,
83EXPORT_SYMBOL(rtl92c_phy_set_bb_reg); 83EXPORT_SYMBOL(rtl92c_phy_set_bb_reg);
84 84
85u32 _rtl92c_phy_fw_rf_serial_read(struct ieee80211_hw *hw, 85u32 _rtl92c_phy_fw_rf_serial_read(struct ieee80211_hw *hw,
86 enum radio_path rfpath, u32 offset) 86 enum radio_path rfpath, u32 offset)
87{ 87{
88 RT_ASSERT(false, ("deprecated!\n")); 88 RT_ASSERT(false, ("deprecated!\n"));
89 return 0; 89 return 0;
@@ -92,15 +92,15 @@ u32 _rtl92c_phy_fw_rf_serial_read(struct ieee80211_hw *hw,
92EXPORT_SYMBOL(_rtl92c_phy_fw_rf_serial_read); 92EXPORT_SYMBOL(_rtl92c_phy_fw_rf_serial_read);
93 93
94void _rtl92c_phy_fw_rf_serial_write(struct ieee80211_hw *hw, 94void _rtl92c_phy_fw_rf_serial_write(struct ieee80211_hw *hw,
95 enum radio_path rfpath, u32 offset, 95 enum radio_path rfpath, u32 offset,
96 u32 data) 96 u32 data)
97{ 97{
98 RT_ASSERT(false, ("deprecated!\n")); 98 RT_ASSERT(false, ("deprecated!\n"));
99} 99}
100EXPORT_SYMBOL(_rtl92c_phy_fw_rf_serial_write); 100EXPORT_SYMBOL(_rtl92c_phy_fw_rf_serial_write);
101 101
102u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw, 102u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw,
103 enum radio_path rfpath, u32 offset) 103 enum radio_path rfpath, u32 offset)
104{ 104{
105 struct rtl_priv *rtlpriv = rtl_priv(hw); 105 struct rtl_priv *rtlpriv = rtl_priv(hw);
106 struct rtl_phy *rtlphy = &(rtlpriv->phy); 106 struct rtl_phy *rtlphy = &(rtlpriv->phy);
@@ -151,8 +151,8 @@ u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw,
151EXPORT_SYMBOL(_rtl92c_phy_rf_serial_read); 151EXPORT_SYMBOL(_rtl92c_phy_rf_serial_read);
152 152
153void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw, 153void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
154 enum radio_path rfpath, u32 offset, 154 enum radio_path rfpath, u32 offset,
155 u32 data) 155 u32 data)
156{ 156{
157 u32 data_and_addr; 157 u32 data_and_addr;
158 u32 newoffset; 158 u32 newoffset;
@@ -250,8 +250,8 @@ bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw)
250EXPORT_SYMBOL(_rtl92c_phy_bb8192c_config_parafile); 250EXPORT_SYMBOL(_rtl92c_phy_bb8192c_config_parafile);
251 251
252void _rtl92c_store_pwrIndex_diffrate_offset(struct ieee80211_hw *hw, 252void _rtl92c_store_pwrIndex_diffrate_offset(struct ieee80211_hw *hw,
253 u32 regaddr, u32 bitmask, 253 u32 regaddr, u32 bitmask,
254 u32 data) 254 u32 data)
255{ 255{
256 struct rtl_priv *rtlpriv = rtl_priv(hw); 256 struct rtl_priv *rtlpriv = rtl_priv(hw);
257 struct rtl_phy *rtlphy = &(rtlpriv->phy); 257 struct rtl_phy *rtlphy = &(rtlpriv->phy);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.h b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.h
index b09a45842d61..9a264c0d6127 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.h
@@ -238,5 +238,21 @@ void _rtl92c_phy_set_rf_sleep(struct ieee80211_hw *hw);
238bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw, 238bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
239 u8 channel, u8 *stage, u8 *step, 239 u8 channel, u8 *stage, u8 *step,
240 u32 *delay); 240 u32 *delay);
241u8 rtl92c_bt_rssi_state_change(struct ieee80211_hw *hw);
242u32 _rtl92c_phy_fw_rf_serial_read(struct ieee80211_hw *hw,
243 enum radio_path rfpath, u32 offset);
244void _rtl92c_phy_fw_rf_serial_write(struct ieee80211_hw *hw,
245 enum radio_path rfpath, u32 offset,
246 u32 data);
247u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw,
248 enum radio_path rfpath, u32 offset);
249void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
250 enum radio_path rfpath, u32 offset,
251 u32 data);
252bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw);
253void _rtl92c_store_pwrIndex_diffrate_offset(struct ieee80211_hw *hw,
254 u32 regaddr, u32 bitmask,
255 u32 data);
256bool rtl92c_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype);
241 257
242#endif 258#endif
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
index 794b4b6d09a2..4a56138eb33c 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
@@ -2177,7 +2177,7 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index,
2177 } 2177 }
2178} 2178}
2179 2179
2180void rtl8192ce_bt_var_init(struct ieee80211_hw *hw) 2180static void rtl8192ce_bt_var_init(struct ieee80211_hw *hw)
2181{ 2181{
2182 struct rtl_pci_priv *rtlpcipriv = rtl_pcipriv(hw); 2182 struct rtl_pci_priv *rtlpcipriv = rtl_pcipriv(hw);
2183 2183
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c b/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
index 604540160a31..73ae8a431848 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
@@ -366,75 +366,6 @@ bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
366 return true; 366 return true;
367} 367}
368 368
369void rtl92c_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
370{
371 struct rtl_priv *rtlpriv = rtl_priv(hw);
372 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
373 struct rtl_phy *rtlphy = &(rtlpriv->phy);
374 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
375 u8 reg_bw_opmode;
376 u8 reg_prsr_rsc;
377
378 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE,
379 ("Switch to %s bandwidth\n",
380 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ?
381 "20MHz" : "40MHz"))
382
383 if (is_hal_stop(rtlhal)) {
384 rtlphy->set_bwmode_inprogress = false;
385 return;
386 }
387
388 reg_bw_opmode = rtl_read_byte(rtlpriv, REG_BWOPMODE);
389 reg_prsr_rsc = rtl_read_byte(rtlpriv, REG_RRSR + 2);
390
391 switch (rtlphy->current_chan_bw) {
392 case HT_CHANNEL_WIDTH_20:
393 reg_bw_opmode |= BW_OPMODE_20MHZ;
394 rtl_write_byte(rtlpriv, REG_BWOPMODE, reg_bw_opmode);
395 break;
396 case HT_CHANNEL_WIDTH_20_40:
397 reg_bw_opmode &= ~BW_OPMODE_20MHZ;
398 rtl_write_byte(rtlpriv, REG_BWOPMODE, reg_bw_opmode);
399 reg_prsr_rsc =
400 (reg_prsr_rsc & 0x90) | (mac->cur_40_prime_sc << 5);
401 rtl_write_byte(rtlpriv, REG_RRSR + 2, reg_prsr_rsc);
402 break;
403 default:
404 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
405 ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw));
406 break;
407 }
408
409 switch (rtlphy->current_chan_bw) {
410 case HT_CHANNEL_WIDTH_20:
411 rtl_set_bbreg(hw, RFPGA0_RFMOD, BRFMOD, 0x0);
412 rtl_set_bbreg(hw, RFPGA1_RFMOD, BRFMOD, 0x0);
413 rtl_set_bbreg(hw, RFPGA0_ANALOGPARAMETER2, BIT(10), 1);
414 break;
415 case HT_CHANNEL_WIDTH_20_40:
416 rtl_set_bbreg(hw, RFPGA0_RFMOD, BRFMOD, 0x1);
417 rtl_set_bbreg(hw, RFPGA1_RFMOD, BRFMOD, 0x1);
418
419 rtl_set_bbreg(hw, RCCK0_SYSTEM, BCCK_SIDEBAND,
420 (mac->cur_40_prime_sc >> 1));
421 rtl_set_bbreg(hw, ROFDM1_LSTF, 0xC00, mac->cur_40_prime_sc);
422 rtl_set_bbreg(hw, RFPGA0_ANALOGPARAMETER2, BIT(10), 0);
423
424 rtl_set_bbreg(hw, 0x818, (BIT(26) | BIT(27)),
425 (mac->cur_40_prime_sc ==
426 HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1);
427 break;
428 default:
429 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
430 ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw));
431 break;
432 }
433 rtl92ce_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
434 rtlphy->set_bwmode_inprogress = false;
435 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n"));
436}
437
438void _rtl92ce_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t) 369void _rtl92ce_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t)
439{ 370{
440 u8 tmpreg; 371 u8 tmpreg;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/phy.h b/drivers/net/wireless/rtlwifi/rtl8192ce/phy.h
index eb93088d0ed8..ad580852cc76 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/phy.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/phy.h
@@ -253,5 +253,9 @@ bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw);
253void _rtl92c_phy_set_rf_sleep(struct ieee80211_hw *hw); 253void _rtl92c_phy_set_rf_sleep(struct ieee80211_hw *hw);
254bool rtl92c_phy_set_rf_power_state(struct ieee80211_hw *hw, 254bool rtl92c_phy_set_rf_power_state(struct ieee80211_hw *hw,
255 enum rf_pwrstate rfpwr_state); 255 enum rf_pwrstate rfpwr_state);
256bool _rtl92ce_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
257 u8 configtype);
258bool _rtl92ce_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
259 u8 configtype);
256 260
257#endif 261#endif
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/reg.h b/drivers/net/wireless/rtlwifi/rtl8192ce/reg.h
index 115b3f841ddc..598cecc63f41 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/reg.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/reg.h
@@ -543,8 +543,6 @@
543#define IMR_OCPINT BIT(1) 543#define IMR_OCPINT BIT(1)
544#define IMR_WLANOFF BIT(0) 544#define IMR_WLANOFF BIT(0)
545 545
546#define HWSET_MAX_SIZE 128
547#define EFUSE_MAX_SECTION 16
548#define EFUSE_REAL_CONTENT_LEN 512 546#define EFUSE_REAL_CONTENT_LEN 512
549 547
550#define EEPROM_DEFAULT_TSSI 0x0 548#define EEPROM_DEFAULT_TSSI 0x0
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index 702dd11b9370..390bbb5ee11d 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -42,7 +42,7 @@
42#include "trx.h" 42#include "trx.h"
43#include "led.h" 43#include "led.h"
44 44
45void rtl92c_init_aspm_vars(struct ieee80211_hw *hw) 45static void rtl92c_init_aspm_vars(struct ieee80211_hw *hw)
46{ 46{
47 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 47 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
48 48
@@ -185,7 +185,7 @@ void rtl92c_deinit_sw_vars(struct ieee80211_hw *hw)
185 } 185 }
186} 186}
187 187
188struct rtl_hal_ops rtl8192ce_hal_ops = { 188static struct rtl_hal_ops rtl8192ce_hal_ops = {
189 .init_sw_vars = rtl92c_init_sw_vars, 189 .init_sw_vars = rtl92c_init_sw_vars,
190 .deinit_sw_vars = rtl92c_deinit_sw_vars, 190 .deinit_sw_vars = rtl92c_deinit_sw_vars,
191 .read_eeprom_info = rtl92ce_read_eeprom_info, 191 .read_eeprom_info = rtl92ce_read_eeprom_info,
@@ -235,14 +235,14 @@ struct rtl_hal_ops rtl8192ce_hal_ops = {
235 .dm_dynamic_txpower = rtl92ce_dm_dynamic_txpower, 235 .dm_dynamic_txpower = rtl92ce_dm_dynamic_txpower,
236}; 236};
237 237
238struct rtl_mod_params rtl92ce_mod_params = { 238static struct rtl_mod_params rtl92ce_mod_params = {
239 .sw_crypto = false, 239 .sw_crypto = false,
240 .inactiveps = true, 240 .inactiveps = true,
241 .swctrl_lps = false, 241 .swctrl_lps = false,
242 .fwctrl_lps = true, 242 .fwctrl_lps = true,
243}; 243};
244 244
245struct rtl_hal_cfg rtl92ce_hal_cfg = { 245static struct rtl_hal_cfg rtl92ce_hal_cfg = {
246 .bar_id = 2, 246 .bar_id = 2,
247 .write_readback = true, 247 .write_readback = true,
248 .name = "rtl92c_pci", 248 .name = "rtl92c_pci",
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index f76d406535dc..54b2bd53d36a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -36,9 +36,9 @@
36#include "trx.h" 36#include "trx.h"
37#include "led.h" 37#include "led.h"
38 38
39u8 _rtl92ce_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue) 39static u8 _rtl92ce_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue)
40{ 40{
41 u16 fc = rtl_get_fc(skb); 41 __le16 fc = rtl_get_fc(skb);
42 42
43 if (unlikely(ieee80211_is_beacon(fc))) 43 if (unlikely(ieee80211_is_beacon(fc)))
44 return QSLT_BEACON; 44 return QSLT_BEACON;
@@ -795,7 +795,6 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
795 u8 ampdu_density = sta->ht_cap.ampdu_density; 795 u8 ampdu_density = sta->ht_cap.ampdu_density;
796 SET_TX_DESC_AMPDU_DENSITY(pdesc, ampdu_density); 796 SET_TX_DESC_AMPDU_DENSITY(pdesc, ampdu_density);
797 } 797 }
798 rcu_read_unlock();
799 798
800 if (info->control.hw_key) { 799 if (info->control.hw_key) {
801 struct ieee80211_key_conf *keyconf = 800 struct ieee80211_key_conf *keyconf =
@@ -834,13 +833,14 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
834 } 833 }
835 } 834 }
836 } 835 }
836 rcu_read_unlock();
837 837
838 SET_TX_DESC_FIRST_SEG(pdesc, (firstseg ? 1 : 0)); 838 SET_TX_DESC_FIRST_SEG(pdesc, (firstseg ? 1 : 0));
839 SET_TX_DESC_LAST_SEG(pdesc, (lastseg ? 1 : 0)); 839 SET_TX_DESC_LAST_SEG(pdesc, (lastseg ? 1 : 0));
840 840
841 SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) skb->len); 841 SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) skb->len);
842 842
843 SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); 843 SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping);
844 844
845 if (rtlpriv->dm.useramask) { 845 if (rtlpriv->dm.useramask) {
846 SET_TX_DESC_RATE_ID(pdesc, tcb_desc->ratr_index); 846 SET_TX_DESC_RATE_ID(pdesc, tcb_desc->ratr_index);
@@ -901,7 +901,7 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
901 901
902 SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) (skb->len)); 902 SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) (skb->len));
903 903
904 SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); 904 SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping);
905 905
906 SET_TX_DESC_RATE_ID(pdesc, 7); 906 SET_TX_DESC_RATE_ID(pdesc, 7);
907 SET_TX_DESC_MACID(pdesc, 0); 907 SET_TX_DESC_MACID(pdesc, 0);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
index 4e020e654e6b..9a3d0239e27e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
@@ -38,7 +38,7 @@
38#include "table.h" 38#include "table.h"
39 39
40u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw, 40u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw,
41 enum radio_path rfpath, u32 regaddr, u32 bitmask) 41 enum radio_path rfpath, u32 regaddr, u32 bitmask)
42{ 42{
43 struct rtl_priv *rtlpriv = rtl_priv(hw); 43 struct rtl_priv *rtlpriv = rtl_priv(hw);
44 u32 original_value, readback_value, bitshift; 44 u32 original_value, readback_value, bitshift;
@@ -64,8 +64,8 @@ u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw,
64} 64}
65 65
66void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw, 66void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw,
67 enum radio_path rfpath, 67 enum radio_path rfpath,
68 u32 regaddr, u32 bitmask, u32 data) 68 u32 regaddr, u32 bitmask, u32 data)
69{ 69{
70 struct rtl_priv *rtlpriv = rtl_priv(hw); 70 struct rtl_priv *rtlpriv = rtl_priv(hw);
71 struct rtl_phy *rtlphy = &(rtlpriv->phy); 71 struct rtl_phy *rtlphy = &(rtlpriv->phy);
@@ -163,7 +163,7 @@ bool _rtl92cu_phy_config_mac_with_headerfile(struct ieee80211_hw *hw)
163} 163}
164 164
165bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, 165bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
166 u8 configtype) 166 u8 configtype)
167{ 167{
168 int i; 168 int i;
169 u32 *phy_regarray_table; 169 u32 *phy_regarray_table;
@@ -223,7 +223,7 @@ bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
223} 223}
224 224
225bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, 225bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
226 u8 configtype) 226 u8 configtype)
227{ 227{
228 struct rtl_priv *rtlpriv = rtl_priv(hw); 228 struct rtl_priv *rtlpriv = rtl_priv(hw);
229 struct rtl_phy *rtlphy = &(rtlpriv->phy); 229 struct rtl_phy *rtlphy = &(rtlpriv->phy);
@@ -459,7 +459,7 @@ void _rtl92cu_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t)
459 } 459 }
460} 460}
461 461
462bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw, 462static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
463 enum rf_pwrstate rfpwr_state) 463 enum rf_pwrstate rfpwr_state)
464{ 464{
465 struct rtl_priv *rtlpriv = rtl_priv(hw); 465 struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -595,7 +595,7 @@ bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
595} 595}
596 596
597bool rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw, 597bool rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
598 enum rf_pwrstate rfpwr_state) 598 enum rf_pwrstate rfpwr_state)
599{ 599{
600 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 600 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
601 bool bresult = false; 601 bool bresult = false;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.h b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.h
index 06299559ab68..ff81a61729d7 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.h
@@ -34,3 +34,17 @@ bool rtl8192_phy_check_is_legal_rfpath(struct ieee80211_hw *hw, u32 rfpath);
34void rtl92c_phy_set_io(struct ieee80211_hw *hw); 34void rtl92c_phy_set_io(struct ieee80211_hw *hw);
35bool _rtl92cu_phy_config_mac_with_headerfile(struct ieee80211_hw *hw); 35bool _rtl92cu_phy_config_mac_with_headerfile(struct ieee80211_hw *hw);
36bool rtl92cu_phy_bb_config(struct ieee80211_hw *hw); 36bool rtl92cu_phy_bb_config(struct ieee80211_hw *hw);
37u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw,
38 enum radio_path rfpath, u32 regaddr, u32 bitmask);
39void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw,
40 enum radio_path rfpath,
41 u32 regaddr, u32 bitmask, u32 data);
42bool rtl92cu_phy_mac_config(struct ieee80211_hw *hw);
43bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
44 u8 configtype);
45void _rtl92cu_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t);
46bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
47 u8 configtype);
48void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw);
49bool rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
50 enum rf_pwrstate rfpwr_state);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
index 1c79c226f145..c7576ec4744e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
@@ -62,7 +62,7 @@ void rtl92cu_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
62} 62}
63 63
64void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 64void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
65 u8 *ppowerlevel) 65 u8 *ppowerlevel)
66{ 66{
67 struct rtl_priv *rtlpriv = rtl_priv(hw); 67 struct rtl_priv *rtlpriv = rtl_priv(hw);
68 struct rtl_phy *rtlphy = &(rtlpriv->phy); 68 struct rtl_phy *rtlphy = &(rtlpriv->phy);
@@ -389,7 +389,7 @@ static void _rtl92c_write_ofdm_power_reg(struct ieee80211_hw *hw,
389} 389}
390 390
391void rtl92cu_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 391void rtl92cu_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw,
392 u8 *ppowerlevel, u8 channel) 392 u8 *ppowerlevel, u8 channel)
393{ 393{
394 u32 writeVal[2], powerBase0[2], powerBase1[2]; 394 u32 writeVal[2], powerBase0[2], powerBase1[2];
395 u8 index = 0; 395 u8 index = 0;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.h b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.h
index 86c2728cfa00..500a2094b6bb 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.h
@@ -43,5 +43,9 @@ extern void rtl92c_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw,
43bool rtl92cu_phy_rf6052_config(struct ieee80211_hw *hw); 43bool rtl92cu_phy_rf6052_config(struct ieee80211_hw *hw);
44bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, 44bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
45 enum radio_path rfpath); 45 enum radio_path rfpath);
46void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
47 u8 *ppowerlevel);
48void rtl92cu_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw,
49 u8 *ppowerlevel, u8 channel);
46 50
47#endif 51#endif
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index 690508feafcc..a406c616b697 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -303,6 +303,9 @@ enum hw_variables {
303 HW_VAR_DATA_FILTER, 303 HW_VAR_DATA_FILTER,
304}; 304};
305 305
306#define HWSET_MAX_SIZE 128
307#define EFUSE_MAX_SECTION 16
308
306enum _RT_MEDIA_STATUS { 309enum _RT_MEDIA_STATUS {
307 RT_MEDIA_DISCONNECT = 0, 310 RT_MEDIA_DISCONNECT = 0,
308 RT_MEDIA_CONNECT = 1 311 RT_MEDIA_CONNECT = 1
@@ -1963,9 +1966,9 @@ static inline struct ieee80211_hdr *rtl_get_hdr(struct sk_buff *skb)
1963 return (struct ieee80211_hdr *)(skb->data); 1966 return (struct ieee80211_hdr *)(skb->data);
1964} 1967}
1965 1968
1966static inline u16 rtl_get_fc(struct sk_buff *skb) 1969static inline __le16 rtl_get_fc(struct sk_buff *skb)
1967{ 1970{
1968 return le16_to_cpu(rtl_get_hdr(skb)->frame_control); 1971 return rtl_get_hdr(skb)->frame_control;
1969} 1972}
1970 1973
1971static inline u16 rtl_get_tid_h(struct ieee80211_hdr *hdr) 1974static inline u16 rtl_get_tid_h(struct ieee80211_hdr *hdr)