diff options
author | Joe Perches <joe@perches.com> | 2012-01-04 22:40:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-24 14:07:40 -0500 |
commit | f30d7507a8116e2099a9135c873411db8c0a3dc6 (patch) | |
tree | 14ff0954b36045e9dfce93a4f0dd0e40c04960a2 /drivers/net/wireless/rtlwifi/pci.c | |
parent | af08687b4e6d44dcdb04b519e718eb58ecb99050 (diff) |
rtlwifi: Convert RT_TRACE macro to use ##__VA_ARGS__
Consolidate printks to avoid possible message interleaving
and reduce the object size.
Remove unnecessary RT_TRACE parentheses.
Miscellaneous typo and grammar fixes.
Add missing newlines to formats.
Remove duplicate KERN_DEBUG prefixes.
Coalesce formats.
Align arguments.
$ size drivers/net/wireless/rtlwifi/built-in.o*
text data bss dec hex filename
594841 55333 129680 779854 be64e drivers/net/wireless/rtlwifi/built-in.o.new
607022 55333 138720 801075 c3933 drivers/net/wireless/rtlwifi/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/pci.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 196 |
1 files changed, 90 insertions, 106 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 39e0907a3c4e..b52fef235754 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -170,7 +170,7 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) | |||
170 | break; | 170 | break; |
171 | default: | 171 | default: |
172 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 172 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
173 | ("switch case not process\n")); | 173 | "switch case not processed\n"); |
174 | break; | 174 | break; |
175 | } | 175 | } |
176 | 176 | ||
@@ -232,7 +232,7 @@ static void rtl_pci_disable_aspm(struct ieee80211_hw *hw) | |||
232 | 232 | ||
233 | if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { | 233 | if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { |
234 | RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, | 234 | RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, |
235 | ("PCI(Bridge) UNKNOWN.\n")); | 235 | "PCI(Bridge) UNKNOWN\n"); |
236 | 236 | ||
237 | return; | 237 | return; |
238 | } | 238 | } |
@@ -286,7 +286,7 @@ static void rtl_pci_enable_aspm(struct ieee80211_hw *hw) | |||
286 | 286 | ||
287 | if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { | 287 | if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { |
288 | RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, | 288 | RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, |
289 | ("PCI(Bridge) UNKNOWN.\n")); | 289 | "PCI(Bridge) UNKNOWN\n"); |
290 | return; | 290 | return; |
291 | } | 291 | } |
292 | 292 | ||
@@ -303,11 +303,10 @@ static void rtl_pci_enable_aspm(struct ieee80211_hw *hw) | |||
303 | u_pcibridge_aspmsetting); | 303 | u_pcibridge_aspmsetting); |
304 | 304 | ||
305 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | 305 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, |
306 | ("PlatformEnableASPM():PciBridge busnumber[%x], " | 306 | "PlatformEnableASPM():PciBridge busnumber[%x], DevNumbe[%x], funcnumber[%x], Write reg[%x] = %x\n", |
307 | "DevNumbe[%x], funcnumber[%x], Write reg[%x] = %x\n", | 307 | pcibridge_busnum, pcibridge_devnum, pcibridge_funcnum, |
308 | pcibridge_busnum, pcibridge_devnum, pcibridge_funcnum, | 308 | (pcipriv->ndis_adapter.pcibridge_pciehdr_offset + 0x10), |
309 | (pcipriv->ndis_adapter.pcibridge_pciehdr_offset + 0x10), | 309 | u_pcibridge_aspmsetting); |
310 | u_pcibridge_aspmsetting)); | ||
311 | 310 | ||
312 | udelay(50); | 311 | udelay(50); |
313 | 312 | ||
@@ -382,9 +381,8 @@ static void rtl_pci_parse_configuration(struct pci_dev *pdev, | |||
382 | pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &linkctrl_reg); | 381 | pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &linkctrl_reg); |
383 | pcipriv->ndis_adapter.linkctrl_reg = linkctrl_reg; | 382 | pcipriv->ndis_adapter.linkctrl_reg = linkctrl_reg; |
384 | 383 | ||
385 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, | 384 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Link Control Register =%x\n", |
386 | ("Link Control Register =%x\n", | 385 | pcipriv->ndis_adapter.linkctrl_reg); |
387 | pcipriv->ndis_adapter.linkctrl_reg)); | ||
388 | 386 | ||
389 | pci_read_config_byte(pdev, 0x98, &tmp); | 387 | pci_read_config_byte(pdev, 0x98, &tmp); |
390 | tmp |= BIT(4); | 388 | tmp |= BIT(4); |
@@ -551,11 +549,10 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) | |||
551 | skb_pull(skb, EM_HDR_LEN); | 549 | skb_pull(skb, EM_HDR_LEN); |
552 | 550 | ||
553 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_SEND), DBG_TRACE, | 551 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_SEND), DBG_TRACE, |
554 | ("new ring->idx:%d, " | 552 | "new ring->idx:%d, free: skb_queue_len:%d, free: seq:%x\n", |
555 | "free: skb_queue_len:%d, free: seq:%x\n", | 553 | ring->idx, |
556 | ring->idx, | 554 | skb_queue_len(&ring->queue), |
557 | skb_queue_len(&ring->queue), | 555 | *(u16 *) (skb->data + 22)); |
558 | *(u16 *) (skb->data + 22))); | ||
559 | 556 | ||
560 | if (prio == TXCMD_QUEUE) { | 557 | if (prio == TXCMD_QUEUE) { |
561 | dev_kfree_skb(skb); | 558 | dev_kfree_skb(skb); |
@@ -593,11 +590,9 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) | |||
593 | == 2) { | 590 | == 2) { |
594 | 591 | ||
595 | RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD, | 592 | RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD, |
596 | ("more desc left, wake" | 593 | "more desc left, wake skb_queue@%d, ring->idx = %d, skb_queue_len = 0x%d\n", |
597 | "skb_queue@%d,ring->idx = %d," | 594 | prio, ring->idx, |
598 | "skb_queue_len = 0x%d\n", | 595 | skb_queue_len(&ring->queue)); |
599 | prio, ring->idx, | ||
600 | skb_queue_len(&ring->queue))); | ||
601 | 596 | ||
602 | ieee80211_wake_queue(hw, | 597 | ieee80211_wake_queue(hw, |
603 | skb_get_queue_mapping | 598 | skb_get_queue_mapping |
@@ -709,9 +704,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
709 | 704 | ||
710 | new_skb = dev_alloc_skb(rtlpci->rxbuffersize); | 705 | new_skb = dev_alloc_skb(rtlpci->rxbuffersize); |
711 | if (unlikely(!new_skb)) { | 706 | if (unlikely(!new_skb)) { |
712 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), | 707 | RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), DBG_DMESG, |
713 | DBG_DMESG, | 708 | "can't alloc skb for rx\n"); |
714 | ("can't alloc skb for rx\n")); | ||
715 | goto done; | 709 | goto done; |
716 | } | 710 | } |
717 | 711 | ||
@@ -796,38 +790,37 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) | |||
796 | /*<1> beacon related */ | 790 | /*<1> beacon related */ |
797 | if (inta & rtlpriv->cfg->maps[RTL_IMR_TBDOK]) { | 791 | if (inta & rtlpriv->cfg->maps[RTL_IMR_TBDOK]) { |
798 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 792 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, |
799 | ("beacon ok interrupt!\n")); | 793 | "beacon ok interrupt!\n"); |
800 | } | 794 | } |
801 | 795 | ||
802 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_TBDER])) { | 796 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_TBDER])) { |
803 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 797 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, |
804 | ("beacon err interrupt!\n")); | 798 | "beacon err interrupt!\n"); |
805 | } | 799 | } |
806 | 800 | ||
807 | if (inta & rtlpriv->cfg->maps[RTL_IMR_BDOK]) { | 801 | if (inta & rtlpriv->cfg->maps[RTL_IMR_BDOK]) { |
808 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 802 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, "beacon interrupt!\n"); |
809 | ("beacon interrupt!\n")); | ||
810 | } | 803 | } |
811 | 804 | ||
812 | if (inta & rtlpriv->cfg->maps[RTL_IMR_BcnInt]) { | 805 | if (inta & rtlpriv->cfg->maps[RTL_IMR_BcnInt]) { |
813 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 806 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, |
814 | ("prepare beacon for interrupt!\n")); | 807 | "prepare beacon for interrupt!\n"); |
815 | tasklet_schedule(&rtlpriv->works.irq_prepare_bcn_tasklet); | 808 | tasklet_schedule(&rtlpriv->works.irq_prepare_bcn_tasklet); |
816 | } | 809 | } |
817 | 810 | ||
818 | /*<3> Tx related */ | 811 | /*<3> Tx related */ |
819 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_TXFOVW])) | 812 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_TXFOVW])) |
820 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, ("IMR_TXFOVW!\n")); | 813 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, "IMR_TXFOVW!\n"); |
821 | 814 | ||
822 | if (inta & rtlpriv->cfg->maps[RTL_IMR_MGNTDOK]) { | 815 | if (inta & rtlpriv->cfg->maps[RTL_IMR_MGNTDOK]) { |
823 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 816 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, |
824 | ("Manage ok interrupt!\n")); | 817 | "Manage ok interrupt!\n"); |
825 | _rtl_pci_tx_isr(hw, MGNT_QUEUE); | 818 | _rtl_pci_tx_isr(hw, MGNT_QUEUE); |
826 | } | 819 | } |
827 | 820 | ||
828 | if (inta & rtlpriv->cfg->maps[RTL_IMR_HIGHDOK]) { | 821 | if (inta & rtlpriv->cfg->maps[RTL_IMR_HIGHDOK]) { |
829 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 822 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, |
830 | ("HIGH_QUEUE ok interrupt!\n")); | 823 | "HIGH_QUEUE ok interrupt!\n"); |
831 | _rtl_pci_tx_isr(hw, HIGH_QUEUE); | 824 | _rtl_pci_tx_isr(hw, HIGH_QUEUE); |
832 | } | 825 | } |
833 | 826 | ||
@@ -835,7 +828,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) | |||
835 | rtlpriv->link_info.num_tx_inperiod++; | 828 | rtlpriv->link_info.num_tx_inperiod++; |
836 | 829 | ||
837 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 830 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, |
838 | ("BK Tx OK interrupt!\n")); | 831 | "BK Tx OK interrupt!\n"); |
839 | _rtl_pci_tx_isr(hw, BK_QUEUE); | 832 | _rtl_pci_tx_isr(hw, BK_QUEUE); |
840 | } | 833 | } |
841 | 834 | ||
@@ -843,7 +836,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) | |||
843 | rtlpriv->link_info.num_tx_inperiod++; | 836 | rtlpriv->link_info.num_tx_inperiod++; |
844 | 837 | ||
845 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 838 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, |
846 | ("BE TX OK interrupt!\n")); | 839 | "BE TX OK interrupt!\n"); |
847 | _rtl_pci_tx_isr(hw, BE_QUEUE); | 840 | _rtl_pci_tx_isr(hw, BE_QUEUE); |
848 | } | 841 | } |
849 | 842 | ||
@@ -851,7 +844,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) | |||
851 | rtlpriv->link_info.num_tx_inperiod++; | 844 | rtlpriv->link_info.num_tx_inperiod++; |
852 | 845 | ||
853 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 846 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, |
854 | ("VI TX OK interrupt!\n")); | 847 | "VI TX OK interrupt!\n"); |
855 | _rtl_pci_tx_isr(hw, VI_QUEUE); | 848 | _rtl_pci_tx_isr(hw, VI_QUEUE); |
856 | } | 849 | } |
857 | 850 | ||
@@ -859,7 +852,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) | |||
859 | rtlpriv->link_info.num_tx_inperiod++; | 852 | rtlpriv->link_info.num_tx_inperiod++; |
860 | 853 | ||
861 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 854 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, |
862 | ("Vo TX OK interrupt!\n")); | 855 | "Vo TX OK interrupt!\n"); |
863 | _rtl_pci_tx_isr(hw, VO_QUEUE); | 856 | _rtl_pci_tx_isr(hw, VO_QUEUE); |
864 | } | 857 | } |
865 | 858 | ||
@@ -868,25 +861,25 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) | |||
868 | rtlpriv->link_info.num_tx_inperiod++; | 861 | rtlpriv->link_info.num_tx_inperiod++; |
869 | 862 | ||
870 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, | 863 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, |
871 | ("CMD TX OK interrupt!\n")); | 864 | "CMD TX OK interrupt!\n"); |
872 | _rtl_pci_tx_isr(hw, TXCMD_QUEUE); | 865 | _rtl_pci_tx_isr(hw, TXCMD_QUEUE); |
873 | } | 866 | } |
874 | } | 867 | } |
875 | 868 | ||
876 | /*<2> Rx related */ | 869 | /*<2> Rx related */ |
877 | if (inta & rtlpriv->cfg->maps[RTL_IMR_ROK]) { | 870 | if (inta & rtlpriv->cfg->maps[RTL_IMR_ROK]) { |
878 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, ("Rx ok interrupt!\n")); | 871 | RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, "Rx ok interrupt!\n"); |
879 | _rtl_pci_rx_interrupt(hw); | 872 | _rtl_pci_rx_interrupt(hw); |
880 | } | 873 | } |
881 | 874 | ||
882 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RDU])) { | 875 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RDU])) { |
883 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | 876 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, |
884 | ("rx descriptor unavailable!\n")); | 877 | "rx descriptor unavailable!\n"); |
885 | _rtl_pci_rx_interrupt(hw); | 878 | _rtl_pci_rx_interrupt(hw); |
886 | } | 879 | } |
887 | 880 | ||
888 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RXFOVW])) { | 881 | if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RXFOVW])) { |
889 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, ("rx overflow !\n")); | 882 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, "rx overflow !\n"); |
890 | _rtl_pci_rx_interrupt(hw); | 883 | _rtl_pci_rx_interrupt(hw); |
891 | } | 884 | } |
892 | 885 | ||
@@ -1028,7 +1021,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, | |||
1028 | 1021 | ||
1029 | if (!ring || (unsigned long)ring & 0xFF) { | 1022 | if (!ring || (unsigned long)ring & 0xFF) { |
1030 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1023 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
1031 | ("Cannot allocate TX ring (prio = %d)\n", prio)); | 1024 | "Cannot allocate TX ring (prio = %d)\n", prio); |
1032 | return -ENOMEM; | 1025 | return -ENOMEM; |
1033 | } | 1026 | } |
1034 | 1027 | ||
@@ -1039,8 +1032,8 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, | |||
1039 | rtlpci->tx_ring[prio].entries = entries; | 1032 | rtlpci->tx_ring[prio].entries = entries; |
1040 | skb_queue_head_init(&rtlpci->tx_ring[prio].queue); | 1033 | skb_queue_head_init(&rtlpci->tx_ring[prio].queue); |
1041 | 1034 | ||
1042 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | 1035 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "queue:%d, ring_addr:%p\n", |
1043 | ("queue:%d, ring_addr:%p\n", prio, ring)); | 1036 | prio, ring); |
1044 | 1037 | ||
1045 | for (i = 0; i < entries; i++) { | 1038 | for (i = 0; i < entries; i++) { |
1046 | nextdescaddress = (u32) dma + | 1039 | nextdescaddress = (u32) dma + |
@@ -1078,7 +1071,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw) | |||
1078 | if (!rtlpci->rx_ring[rx_queue_idx].desc || | 1071 | if (!rtlpci->rx_ring[rx_queue_idx].desc || |
1079 | (unsigned long)rtlpci->rx_ring[rx_queue_idx].desc & 0xFF) { | 1072 | (unsigned long)rtlpci->rx_ring[rx_queue_idx].desc & 0xFF) { |
1080 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1073 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
1081 | ("Cannot allocate RX ring\n")); | 1074 | "Cannot allocate RX ring\n"); |
1082 | return -ENOMEM; | 1075 | return -ENOMEM; |
1083 | } | 1076 | } |
1084 | 1077 | ||
@@ -1355,7 +1348,7 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1355 | u8 temp_one = 1; | 1348 | u8 temp_one = 1; |
1356 | 1349 | ||
1357 | if (ieee80211_is_auth(fc)) { | 1350 | if (ieee80211_is_auth(fc)) { |
1358 | RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, ("MAC80211_LINKING\n")); | 1351 | RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "MAC80211_LINKING\n"); |
1359 | rtl_ips_nic_on(hw); | 1352 | rtl_ips_nic_on(hw); |
1360 | } | 1353 | } |
1361 | 1354 | ||
@@ -1388,10 +1381,9 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1388 | 1381 | ||
1389 | if ((own == 1) && (hw_queue != BEACON_QUEUE)) { | 1382 | if ((own == 1) && (hw_queue != BEACON_QUEUE)) { |
1390 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | 1383 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, |
1391 | ("No more TX desc@%d, ring->idx = %d," | 1384 | "No more TX desc@%d, ring->idx = %d, idx = %d, skb_queue_len = 0x%d\n", |
1392 | "idx = %d, skb_queue_len = 0x%d\n", | 1385 | hw_queue, ring->idx, idx, |
1393 | hw_queue, ring->idx, idx, | 1386 | skb_queue_len(&ring->queue)); |
1394 | skb_queue_len(&ring->queue))); | ||
1395 | 1387 | ||
1396 | spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); | 1388 | spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); |
1397 | return skb->len; | 1389 | return skb->len; |
@@ -1426,11 +1418,9 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1426 | hw_queue != BEACON_QUEUE) { | 1418 | hw_queue != BEACON_QUEUE) { |
1427 | 1419 | ||
1428 | RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD, | 1420 | RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD, |
1429 | ("less desc left, stop skb_queue@%d, " | 1421 | "less desc left, stop skb_queue@%d, ring->idx = %d, idx = %d, skb_queue_len = 0x%d\n", |
1430 | "ring->idx = %d," | 1422 | hw_queue, ring->idx, idx, |
1431 | "idx = %d, skb_queue_len = 0x%d\n", | 1423 | skb_queue_len(&ring->queue)); |
1432 | hw_queue, ring->idx, idx, | ||
1433 | skb_queue_len(&ring->queue))); | ||
1434 | 1424 | ||
1435 | ieee80211_stop_queue(hw, skb_get_queue_mapping(skb)); | 1425 | ieee80211_stop_queue(hw, skb_get_queue_mapping(skb)); |
1436 | } | 1426 | } |
@@ -1497,7 +1487,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev) | |||
1497 | err = _rtl_pci_init_trx_ring(hw); | 1487 | err = _rtl_pci_init_trx_ring(hw); |
1498 | if (err) { | 1488 | if (err) { |
1499 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1489 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
1500 | ("tx ring initialization failed")); | 1490 | "tx ring initialization failed\n"); |
1501 | return err; | 1491 | return err; |
1502 | } | 1492 | } |
1503 | 1493 | ||
@@ -1519,12 +1509,12 @@ static int rtl_pci_start(struct ieee80211_hw *hw) | |||
1519 | err = rtlpriv->cfg->ops->hw_init(hw); | 1509 | err = rtlpriv->cfg->ops->hw_init(hw); |
1520 | if (err) { | 1510 | if (err) { |
1521 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1511 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1522 | ("Failed to config hardware!\n")); | 1512 | "Failed to config hardware!\n"); |
1523 | return err; | 1513 | return err; |
1524 | } | 1514 | } |
1525 | 1515 | ||
1526 | rtlpriv->cfg->ops->enable_interrupt(hw); | 1516 | rtlpriv->cfg->ops->enable_interrupt(hw); |
1527 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("enable_interrupt OK\n")); | 1517 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "enable_interrupt OK\n"); |
1528 | 1518 | ||
1529 | rtl_init_rx_config(hw); | 1519 | rtl_init_rx_config(hw); |
1530 | 1520 | ||
@@ -1535,7 +1525,7 @@ static int rtl_pci_start(struct ieee80211_hw *hw) | |||
1535 | 1525 | ||
1536 | rtlpci->up_first_time = false; | 1526 | rtlpci->up_first_time = false; |
1537 | 1527 | ||
1538 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("OK\n")); | 1528 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "OK\n"); |
1539 | return 0; | 1529 | return 0; |
1540 | } | 1530 | } |
1541 | 1531 | ||
@@ -1622,20 +1612,20 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1622 | switch (revisionid) { | 1612 | switch (revisionid) { |
1623 | case RTL_PCI_REVISION_ID_8192PCIE: | 1613 | case RTL_PCI_REVISION_ID_8192PCIE: |
1624 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1614 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1625 | ("8192 PCI-E is found - " | 1615 | "8192 PCI-E is found - vid/did=%x/%x\n", |
1626 | "vid/did=%x/%x\n", venderid, deviceid)); | 1616 | venderid, deviceid); |
1627 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192E; | 1617 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192E; |
1628 | break; | 1618 | break; |
1629 | case RTL_PCI_REVISION_ID_8192SE: | 1619 | case RTL_PCI_REVISION_ID_8192SE: |
1630 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1620 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1631 | ("8192SE is found - " | 1621 | "8192SE is found - vid/did=%x/%x\n", |
1632 | "vid/did=%x/%x\n", venderid, deviceid)); | 1622 | venderid, deviceid); |
1633 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192SE; | 1623 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192SE; |
1634 | break; | 1624 | break; |
1635 | default: | 1625 | default: |
1636 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | 1626 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, |
1637 | ("Err: Unknown device - " | 1627 | "Err: Unknown device - vid/did=%x/%x\n", |
1638 | "vid/did=%x/%x\n", venderid, deviceid)); | 1628 | venderid, deviceid); |
1639 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192SE; | 1629 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192SE; |
1640 | break; | 1630 | break; |
1641 | 1631 | ||
@@ -1646,18 +1636,18 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1646 | deviceid == RTL_PCI_8188CE_DID) { | 1636 | deviceid == RTL_PCI_8188CE_DID) { |
1647 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192CE; | 1637 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192CE; |
1648 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1638 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1649 | ("8192C PCI-E is found - " | 1639 | "8192C PCI-E is found - vid/did=%x/%x\n", |
1650 | "vid/did=%x/%x\n", venderid, deviceid)); | 1640 | venderid, deviceid); |
1651 | } else if (deviceid == RTL_PCI_8192DE_DID || | 1641 | } else if (deviceid == RTL_PCI_8192DE_DID || |
1652 | deviceid == RTL_PCI_8192DE_DID2) { | 1642 | deviceid == RTL_PCI_8192DE_DID2) { |
1653 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192DE; | 1643 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192DE; |
1654 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1644 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1655 | ("8192D PCI-E is found - " | 1645 | "8192D PCI-E is found - vid/did=%x/%x\n", |
1656 | "vid/did=%x/%x\n", venderid, deviceid)); | 1646 | venderid, deviceid); |
1657 | } else { | 1647 | } else { |
1658 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | 1648 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, |
1659 | ("Err: Unknown device -" | 1649 | "Err: Unknown device - vid/did=%x/%x\n", |
1660 | " vid/did=%x/%x\n", venderid, deviceid)); | 1650 | venderid, deviceid); |
1661 | 1651 | ||
1662 | rtlhal->hw_type = RTL_DEFAULT_HARDWARE_TYPE; | 1652 | rtlhal->hw_type = RTL_DEFAULT_HARDWARE_TYPE; |
1663 | } | 1653 | } |
@@ -1665,19 +1655,18 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1665 | if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192DE) { | 1655 | if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192DE) { |
1666 | if (revisionid == 0 || revisionid == 1) { | 1656 | if (revisionid == 0 || revisionid == 1) { |
1667 | if (revisionid == 0) { | 1657 | if (revisionid == 0) { |
1668 | RT_TRACE(rtlpriv, COMP_INIT, | 1658 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, |
1669 | DBG_LOUD, ("Find 92DE MAC0.\n")); | 1659 | "Find 92DE MAC0\n"); |
1670 | rtlhal->interfaceindex = 0; | 1660 | rtlhal->interfaceindex = 0; |
1671 | } else if (revisionid == 1) { | 1661 | } else if (revisionid == 1) { |
1672 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | 1662 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, |
1673 | ("Find 92DE MAC1.\n")); | 1663 | "Find 92DE MAC1\n"); |
1674 | rtlhal->interfaceindex = 1; | 1664 | rtlhal->interfaceindex = 1; |
1675 | } | 1665 | } |
1676 | } else { | 1666 | } else { |
1677 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | 1667 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, |
1678 | ("Unknown device - " | 1668 | "Unknown device - VendorID/DeviceID=%x/%x, Revision=%x\n", |
1679 | "VendorID/DeviceID=%x/%x, Revision=%x\n", | 1669 | venderid, deviceid, revisionid); |
1680 | venderid, deviceid, revisionid)); | ||
1681 | rtlhal->interfaceindex = 0; | 1670 | rtlhal->interfaceindex = 0; |
1682 | } | 1671 | } |
1683 | } | 1672 | } |
@@ -1693,8 +1682,8 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1693 | if (bridge_pdev->vendor == pcibridge_vendors[tmp]) { | 1682 | if (bridge_pdev->vendor == pcibridge_vendors[tmp]) { |
1694 | pcipriv->ndis_adapter.pcibridge_vendor = tmp; | 1683 | pcipriv->ndis_adapter.pcibridge_vendor = tmp; |
1695 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1684 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1696 | ("Pci Bridge Vendor is found index:" | 1685 | "Pci Bridge Vendor is found index: %d\n", |
1697 | " %d\n", tmp)); | 1686 | tmp); |
1698 | break; | 1687 | break; |
1699 | } | 1688 | } |
1700 | } | 1689 | } |
@@ -1723,23 +1712,21 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1723 | } | 1712 | } |
1724 | 1713 | ||
1725 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1714 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1726 | ("pcidev busnumber:devnumber:funcnumber:" | 1715 | "pcidev busnumber:devnumber:funcnumber:vendor:link_ctl %d:%d:%d:%x:%x\n", |
1727 | "vendor:link_ctl %d:%d:%d:%x:%x\n", | 1716 | pcipriv->ndis_adapter.busnumber, |
1728 | pcipriv->ndis_adapter.busnumber, | 1717 | pcipriv->ndis_adapter.devnumber, |
1729 | pcipriv->ndis_adapter.devnumber, | 1718 | pcipriv->ndis_adapter.funcnumber, |
1730 | pcipriv->ndis_adapter.funcnumber, | 1719 | pdev->vendor, pcipriv->ndis_adapter.linkctrl_reg); |
1731 | pdev->vendor, pcipriv->ndis_adapter.linkctrl_reg)); | ||
1732 | 1720 | ||
1733 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1721 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1734 | ("pci_bridge busnumber:devnumber:funcnumber:vendor:" | 1722 | "pci_bridge busnumber:devnumber:funcnumber:vendor:pcie_cap:link_ctl_reg:amd %d:%d:%d:%x:%x:%x:%x\n", |
1735 | "pcie_cap:link_ctl_reg:amd %d:%d:%d:%x:%x:%x:%x\n", | 1723 | pcipriv->ndis_adapter.pcibridge_busnum, |
1736 | pcipriv->ndis_adapter.pcibridge_busnum, | 1724 | pcipriv->ndis_adapter.pcibridge_devnum, |
1737 | pcipriv->ndis_adapter.pcibridge_devnum, | 1725 | pcipriv->ndis_adapter.pcibridge_funcnum, |
1738 | pcipriv->ndis_adapter.pcibridge_funcnum, | 1726 | pcibridge_vendors[pcipriv->ndis_adapter.pcibridge_vendor], |
1739 | pcibridge_vendors[pcipriv->ndis_adapter.pcibridge_vendor], | 1727 | pcipriv->ndis_adapter.pcibridge_pciehdr_offset, |
1740 | pcipriv->ndis_adapter.pcibridge_pciehdr_offset, | 1728 | pcipriv->ndis_adapter.pcibridge_linkctrlreg, |
1741 | pcipriv->ndis_adapter.pcibridge_linkctrlreg, | 1729 | pcipriv->ndis_adapter.amd_l1_patch); |
1742 | pcipriv->ndis_adapter.amd_l1_patch)); | ||
1743 | 1730 | ||
1744 | rtl_pci_parse_configuration(pdev, hw); | 1731 | rtl_pci_parse_configuration(pdev, hw); |
1745 | 1732 | ||
@@ -1828,10 +1815,9 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1828 | } | 1815 | } |
1829 | 1816 | ||
1830 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1817 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1831 | ("mem mapped space: start: 0x%08lx len:%08lx " | 1818 | "mem mapped space: start: 0x%08lx len:%08lx flags:%08lx, after map:0x%08lx\n", |
1832 | "flags:%08lx, after map:0x%08lx\n", | 1819 | pmem_start, pmem_len, pmem_flags, |
1833 | pmem_start, pmem_len, pmem_flags, | 1820 | rtlpriv->io.pci_mem_start); |
1834 | rtlpriv->io.pci_mem_start)); | ||
1835 | 1821 | ||
1836 | /* Disable Clk Request */ | 1822 | /* Disable Clk Request */ |
1837 | pci_write_config_byte(pdev, 0x81, 0); | 1823 | pci_write_config_byte(pdev, 0x81, 0); |
@@ -1851,8 +1837,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1851 | rtlpriv->cfg->ops->read_eeprom_info(hw); | 1837 | rtlpriv->cfg->ops->read_eeprom_info(hw); |
1852 | 1838 | ||
1853 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | 1839 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { |
1854 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1840 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); |
1855 | ("Can't init_sw_vars.\n")); | ||
1856 | goto fail3; | 1841 | goto fail3; |
1857 | } | 1842 | } |
1858 | 1843 | ||
@@ -1865,22 +1850,21 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1865 | err = rtl_init_core(hw); | 1850 | err = rtl_init_core(hw); |
1866 | if (err) { | 1851 | if (err) { |
1867 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1852 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
1868 | ("Can't allocate sw for mac80211.\n")); | 1853 | "Can't allocate sw for mac80211\n"); |
1869 | goto fail3; | 1854 | goto fail3; |
1870 | } | 1855 | } |
1871 | 1856 | ||
1872 | /* Init PCI sw */ | 1857 | /* Init PCI sw */ |
1873 | err = !rtl_pci_init(hw, pdev); | 1858 | err = !rtl_pci_init(hw, pdev); |
1874 | if (err) { | 1859 | if (err) { |
1875 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1860 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n"); |
1876 | ("Failed to init PCI.\n")); | ||
1877 | goto fail3; | 1861 | goto fail3; |
1878 | } | 1862 | } |
1879 | 1863 | ||
1880 | err = ieee80211_register_hw(hw); | 1864 | err = ieee80211_register_hw(hw); |
1881 | if (err) { | 1865 | if (err) { |
1882 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1866 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
1883 | ("Can't register mac80211 hw.\n")); | 1867 | "Can't register mac80211 hw\n"); |
1884 | goto fail3; | 1868 | goto fail3; |
1885 | } else { | 1869 | } else { |
1886 | rtlpriv->mac80211.mac80211_registered = 1; | 1870 | rtlpriv->mac80211.mac80211_registered = 1; |
@@ -1889,7 +1873,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1889 | err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); | 1873 | err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); |
1890 | if (err) { | 1874 | if (err) { |
1891 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1875 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
1892 | ("failed to create sysfs device attributes\n")); | 1876 | "failed to create sysfs device attributes\n"); |
1893 | goto fail3; | 1877 | goto fail3; |
1894 | } | 1878 | } |
1895 | 1879 | ||
@@ -1901,8 +1885,8 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1901 | IRQF_SHARED, KBUILD_MODNAME, hw); | 1885 | IRQF_SHARED, KBUILD_MODNAME, hw); |
1902 | if (err) { | 1886 | if (err) { |
1903 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, | 1887 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1904 | ("%s: failed to register IRQ handler\n", | 1888 | "%s: failed to register IRQ handler\n", |
1905 | wiphy_name(hw->wiphy))); | 1889 | wiphy_name(hw->wiphy)); |
1906 | goto fail3; | 1890 | goto fail3; |
1907 | } else { | 1891 | } else { |
1908 | rtlpci->irq_alloc = 1; | 1892 | rtlpci->irq_alloc = 1; |